diff --git a/package.json b/package.json index cef9fcec..320ac2da 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "@ledgerhq/hw-app-xrp": "^4.12.0", "@ledgerhq/hw-transport": "^4.12.0", "@ledgerhq/hw-transport-node-hid": "^4.12.0", - "@ledgerhq/ledger-core": "^1.2.1", + "@ledgerhq/ledger-core": "^1.3.0", "@ledgerhq/live-common": "2.11.0", "axios": "^0.18.0", "babel-runtime": "^6.26.0", diff --git a/src/commands/libcoreSignAndBroadcast.js b/src/commands/libcoreSignAndBroadcast.js index 310da766..9e3bea3f 100644 --- a/src/commands/libcoreSignAndBroadcast.js +++ b/src/commands/libcoreSignAndBroadcast.js @@ -6,6 +6,7 @@ import { createCommand, Command } from 'helpers/ipc' import { withDevice } from 'helpers/deviceAccess' import { getWalletIdentifier } from 'helpers/libcore' import { fromPromise } from 'rxjs/observable/fromPromise' +import { getCryptoCurrencyById } from '@ledgerhq/live-common/lib/helpers/currencies' type BitcoinLikeTransaction = { amount: number, @@ -55,7 +56,18 @@ const cmd: Command = createCommand( transactionBuilder.setFeesPerByte(fees) const builded = await transactionBuilder.build() - const signedTransaction = await core.signTransaction(hwApp, builded) + const sigHashType = core.helpers.bytesToHex( + njsWalletCurrency.bitcoinLikeNetworkParameters.SigHash, + ) + + const currency = getCryptoCurrencyById(account.currencyId) + const signedTransaction = await core.signTransaction({ + hwApp, + transaction: builded, + sigHashType, + supportsSegwit: currency.supportsSegwit, + isSegwit: account.isSegwit, + }) const txHash = await njsAccount .asBitcoinLikeAccount() diff --git a/yarn.lock b/yarn.lock index 8628cbf3..f25bb9d9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1451,9 +1451,9 @@ dependencies: events "^2.0.0" -"@ledgerhq/ledger-core@^1.2.1": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@ledgerhq/ledger-core/-/ledger-core-1.2.1.tgz#8176a4fa9182d8e0fe4456cbdc4701e4e6e25145" +"@ledgerhq/ledger-core@^1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/ledger-core/-/ledger-core-1.3.0.tgz#2b26d43c4a8973e00e0c6671a2da5183ef0ce229" dependencies: "@ledgerhq/hw-app-btc" "^4.7.3" "@ledgerhq/hw-transport-node-hid" "^4.7.6"