Gaëtan Renaudeau
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
13 additions and
5 deletions
-
package.json
-
src/commands/libcoreSignAndBroadcast.js
-
yarn.lock
|
|
@ -35,7 +35,7 @@ |
|
|
|
"webpack-sources": "1.0.1" |
|
|
|
}, |
|
|
|
"dependencies": { |
|
|
|
"@ledgerhq/hw-app-btc": "^4.13.0", |
|
|
|
"@ledgerhq/hw-app-btc": "4.20.0", |
|
|
|
"@ledgerhq/hw-app-eth": "^4.14.0", |
|
|
|
"@ledgerhq/hw-app-xrp": "^4.13.0", |
|
|
|
"@ledgerhq/hw-transport": "^4.13.0", |
|
|
|
|
|
@ -77,7 +77,9 @@ async function signTransaction({ |
|
|
|
hasTimestamp: boolean, |
|
|
|
}) { |
|
|
|
const additionals = [] |
|
|
|
let expiryHeight |
|
|
|
if (currencyId === 'bitcoin_cash' || currencyId === 'bitcoin_gold') additionals.push('bip143') |
|
|
|
if (currencyId === 'zcash') expiryHeight = Buffer.from([0x00, 0x00, 0x00, 0x00]) |
|
|
|
const rawInputs = transaction.getInputs() |
|
|
|
|
|
|
|
const inputs = await Promise.all( |
|
|
@ -119,9 +121,14 @@ async function signTransaction({ |
|
|
|
|
|
|
|
const changePath = output ? output.getDerivationPath().toString() : undefined |
|
|
|
const outputScriptHex = Buffer.from(transaction.serializeOutputs()).toString('hex') |
|
|
|
const lockTime = transaction.getLockTime() |
|
|
|
const initialTimestamp = hasTimestamp ? transaction.getTimestamp() : undefined |
|
|
|
|
|
|
|
// FIXME
|
|
|
|
// should be `transaction.getLockTime()` as soon as lock time is
|
|
|
|
// handled by libcore (actually: it always returns a default value
|
|
|
|
// and that caused issue with zcash (see #904))
|
|
|
|
const lockTime = undefined |
|
|
|
|
|
|
|
const signedTransaction = await hwApp.createPaymentTransactionNew( |
|
|
|
inputs, |
|
|
|
associatedKeysets, |
|
|
@ -132,6 +139,7 @@ async function signTransaction({ |
|
|
|
isSegwit, |
|
|
|
initialTimestamp, |
|
|
|
additionals, |
|
|
|
expiryHeight, |
|
|
|
) |
|
|
|
|
|
|
|
return signedTransaction |
|
|
|
|
|
@ -1474,9 +1474,9 @@ |
|
|
|
version "0.7.1" |
|
|
|
resolved "https://registry.yarnpkg.com/@emotion/utils/-/utils-0.7.1.tgz#e44e596d03c9f16ba3b127ad333a8a072bcb5a0a" |
|
|
|
|
|
|
|
"@ledgerhq/hw-app-btc@^4.13.0": |
|
|
|
version "4.19.0" |
|
|
|
resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-btc/-/hw-app-btc-4.19.0.tgz#0fdce47ad71df7783c6bf881e6a9bc8b4c84de52" |
|
|
|
"@ledgerhq/hw-app-btc@4.20.0": |
|
|
|
version "4.20.0" |
|
|
|
resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-btc/-/hw-app-btc-4.20.0.tgz#116f841932c199c3a286563831154207a5aa656f" |
|
|
|
dependencies: |
|
|
|
"@ledgerhq/hw-transport" "^4.19.0" |
|
|
|
create-hash "^1.1.3" |
|
|
|