How to use the unchained-bitcoin.multisigRedeemScript function in unchained-bitcoin

To help you get started, we’ve selected a few unchained-bitcoin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github unchained-capital / unchained-wallets / src / hermit.js View on Github external
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(),
      })),
    };
github unchained-capital / unchained-wallets / src / ledger.js View on Github external
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))];
  }

}
github unchained-capital / caravan / src / components / MultisigDetails.jsx View on Github external
render() {
    const {network, multisig} = this.props;
    const address = multisig.address;
    const redeemScript = multisigRedeemScript(multisig);
    const witnessScript = multisigWitnessScript(multisig);
    return (
      

        Address

        

          

            
              
                <code>{address}</code>
              
              &nbsp;
              {externalLink(blockExplorerAddressURL(address, network), )}