Changeset View
Changeset View
Standalone View
Standalone View
web/cashtab/src/utils/cashMethods.js
Show First 20 Lines • Show All 155 Lines • ▼ Show 20 Lines | export const signUtxosByAddress = (inputUtxos, wallet, txBuilder) => { | ||||
for (let i = 0; i < inputUtxos.length; i++) { | for (let i = 0; i < inputUtxos.length; i++) { | ||||
const utxo = inputUtxos[i]; | const utxo = inputUtxos[i]; | ||||
const accounts = [wallet.Path245, wallet.Path145, wallet.Path1899]; | const accounts = [wallet.Path245, wallet.Path145, wallet.Path1899]; | ||||
const wif = accounts | const wif = accounts | ||||
.filter(acc => acc.cashAddress === utxo.address) | .filter(acc => acc.cashAddress === utxo.address) | ||||
.pop().fundingWif; | .pop().fundingWif; | ||||
const utxoEcPair = getECPairFromWIF(wif); | const utxoECPair = getECPairFromWIF(wif); | ||||
txBuilder.sign( | txBuilder.sign( | ||||
i, | i, | ||||
utxoEcPair, | utxoECPair, | ||||
undefined, | undefined, | ||||
txBuilder.hashTypes.SIGHASH_ALL, | txBuilder.hashTypes.SIGHASH_ALL, | ||||
parseInt(utxo.value), | parseInt(utxo.value), | ||||
); | ); | ||||
} | } | ||||
return txBuilder; | return txBuilder; | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 1,053 Lines • Show Last 20 Lines |