Return an interaction class for signing a multisig transaction with the given keystore.
keystore
The inputs are objects which have txid, index, and a multisig object, the last which is a Multisig object from @caravan/bitcoin.
txid
index
multisig
Multisig
@caravan/bitcoin
The outputs are objects which have address and amountSats (an integer).
address
amountSats
bip32Paths is an array of BIP32 paths for the public keys on this device, one for each input.
bip32Paths
Supported keystores: Trezor, Ledger, Hermit
import { generateMultisigFromHex, TESTNET, P2SH,} from "@caravan/bitcoin";import {SignMultisigTransaction, TREZOR} 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 = SignMultisigTransaction({ keystore: TREZOR, // works the same for Ledger 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] Copy
import { generateMultisigFromHex, TESTNET, P2SH,} from "@caravan/bitcoin";import {SignMultisigTransaction, TREZOR} 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 = SignMultisigTransaction({ keystore: TREZOR, // works the same for Ledger 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]
Optional
Return an interaction class for signing a multisig transaction with the given
keystore.The inputs are objects which have
txid,index, and amultisigobject, the last which is aMultisigobject from@caravan/bitcoin.The outputs are objects which have
addressandamountSats(an integer).bip32Pathsis an array of BIP32 paths for the public keys on this device, one for each input.Supported keystores: Trezor, Ledger, Hermit
Example