Caravan Documentation
    Preparing search index...

    Class TrezorSignMultisigTransaction

    Returns a signature for a bitcoin transaction with inputs from one or many multisig addresses.

    • inputs is an array of UTXO objects from @caravan/bitcoin
    • outputs is an array of TransactionOutput objects from @caravan/bitcoin
    • bip32Paths is an array of (string) BIP32 paths, one for each input, identifying the path on this device to sign that input with
    import {
    generateMultisigFromHex, TESTNET, P2SH,
    } from "@caravan/bitcoin";
    import {TrezorSignMultisigTransaction} from "@caravan/wallets";
    const redeemScript = "5...ae";
    const inputs = [
    {
    txid: "8d276c76b3550b145e44d35c5833bae175e0351b4a5c57dc1740387e78f57b11",
    index: 1,
    multisig: generateMultisigFromHex(TESTNET, P2SH, redeemScript),
    amountSats: '1234000'
    },
    // other inputs...
    ];
    const outputs = [
    {
    amountSats: '1299659',
    address: "2NGHod7V2TAAXC1iUdNmc6R8UUd4TVTuBmp"
    },
    // other outputs...
    ];
    const interaction = new TrezorSignMultisigTransaction({
    network: TESTNET,
    inputs,
    outputs,
    bip32Paths: ["m/45'/0'/0'/0", // add more, 1 per input],
    });
    const signature = await interaction.run();
    console.log(signatures);
    // ["ababab...", // 1 per input]

    Hierarchy (View Summary)

    Index

    Constructors

    • Parameters

      • __namedParameters: {
            addressType: any;
            bip32Paths: any;
            inputs: any;
            keyDetails: any;
            network: any;
            outputs: any;
            psbt: any;
            returnSignatureArray: any;
        }

      Returns TrezorSignMultisigTransaction

    Properties

    bip32Paths: string[]
    direct: boolean
    environment: Parser
    inputs: any[]
    network: null | Network
    outputs: any[]
    psbt?: string
    pubkeys?: any
    returnSignatureArray?: boolean
    trezorCoin: string

    Methods

    • Subclasses can override this method to indicate they are not supported.

      This method has access to whatever options may have been passed in by the constructor as well as the ability to interact with this.environment to determine whether the functionality is supported. See the Bowser documentation for more details: https://github.com/lancedikson/bowser

      Returns boolean

      isSupported() {
      return this.environment.satisfies({
      * declare browsers per OS
      windows: {
      "internet explorer": ">10",
      },
      macos: {
      safari: ">10.1"
      },

      * per platform (mobile, desktop or tablet)
      mobile: {
      safari: '>=9',
      'android browser': '>3.10'
      },

      * or in general
      chrome: "~20.1.1432",
      firefox: ">31",
      opera: ">=22",

      * also supports equality operator
      chrome: "=20.1.1432", * will match particular build only

      * and loose-equality operator
      chrome: "~20", * will match any 20.* sub-version
      chrome: "~20.1" * will match any 20.1.* sub-version (20.1.19 as well as 20.1.12.42-alpha.1)
      });
      }
    • Return messages filtered by the given options.

      Multiple options can be given at once to filter along multiple dimensions.

      Parameters

      • __namedParameters: MessageMethodArgs

      Returns Message[]

      import {PENDING, ACTIVE} from "@caravan/bitcoin";
      // Create any interaction instance
      interaction.messages().forEach(msg => console.log(msg));
      { code: "device.connect", state: "pending", level: "info", text: "Please plug in your device."}
      { code: "device.active", state: "active", level: "info", text: "Communicating with your device..."}
      { code: "device.active.warning", state: "active", level: "warning", text: "Your device will warn you about...", version: "2.x"}
      interaction.messagesFor({state: PENDING}).forEach(msg => console.log(msg));
      { code: "device.connect", state: "pending", level: "info", text: "Please plug in your device."}
      interaction.messagesFor({code: ACTIVE}).forEach(msg => console.log(msg));
      { code: "device.active", state: "active", level: "info", text: "Communicating with your device..."}
      { code: "device.active.warning", state: "active", level: "warning", text: "Your device will warn you about...", version: "2.x"}
      interaction.messagesFor({version: /^2/}).forEach(msg => console.log(msg));
      { code: "device.active", state: "active", level: "warning", text: "Your device will warn you about...", version: "2.x"}
    • Awaits the call of this.method, passing in the output of this.params().

      If the call returns but is unsuccessful (result.success) is false, will throw the returned error message. If some other error is thrown, it will not be caught.

      Otherwise it returns the result of passing result.payload to this.parsePayload.

      Returns Promise<any>