Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
signatureRequestData() {
const hermitInputsByRedeemScript = {};
for (let i=0; i < this.inputs.length; i++) {
const input = this.inputs[i];
const bip32Path = this.bip32Paths[i];
const redeemScriptHex = scriptToHex(multisigRedeemScript(input.multisig));
if (! hermitInputsByRedeemScript[redeemScriptHex]) {
hermitInputsByRedeemScript[redeemScriptHex] = [redeemScriptHex, bip32Path];
}
hermitInputsByRedeemScript[redeemScriptHex].push({
txid: input.txid,
index: input.index,
amount: input.amountSats.toNumber(),
});
}
return {
inputs: Object.values(hermitInputsByRedeemScript),
outputs: this.outputs.map((output) => ({
address: output.address,
amount: output.amountSats.toNumber(),
})),
};
function ledgerInput(ledgerbtc, input) {
const addressType = multisigAddressType(input.multisig);
const tx = ledgerbtc.splitTransaction(input.transactionHex, true)
if (addressType == MULTISIG_ADDRESS_TYPES.P2SH) {
return [tx, input.index, scriptToHex(multisigRedeemScript(input.multisig))];
} else {
return [tx, input.index, scriptToHex(multisigWitnessScript(input.multisig))];
}
}
render() {
const {network, multisig} = this.props;
const address = multisig.address;
const redeemScript = multisigRedeemScript(multisig);
const witnessScript = multisigWitnessScript(multisig);
return (
Address
<code>{address}</code>
{externalLink(blockExplorerAddressURL(address, network), )}