Class: ColdcardSignMultisigTransaction

coldcard.ColdcardSignMultisigTransaction(options)

Returns signature request data via a PSBT for a Coldcard to sign and accepts a PSBT for parsing signatures from a Coldcard device

Constructor

new ColdcardSignMultisigTransaction(options)

Parameters:
Name Type Description
options object

options argument

Properties
Name Type Attributes Description
network string

bitcoin network

inputs array.<object>

inputs for the transaction

outputs array.<object>

outputs for the transaction

bip32Paths array.<string>

BIP32 paths

psbt object <optional>

PSBT of the transaction to sign, include it or we will generate it

Source:
Example
const interaction = new ColdcardSignMultisigTransaction({network, inputs, outputs, bip32paths, psbt});
console.log(interaction.request());
// "cHNidP8BA..."

// Parse signatures from a signed PSBT
const signatures = interaction.parse(psbt);
console.log(signatures);
// {'029e866...': ['3045...01', ...]}

Extends

Methods

parse(psbtObject) → {Object}

Parameters:
Name Type Description
psbtObject Object

the PSBT

Overrides:
Source:
Returns:

signatures - This calls a function in unchained-bitcoin which parses PSBT files for sigantures and then returns an object with the format { pubkey1 : [sig1, sig2, ...], pubkey2 : [sig1, sig2, ...] } This format may change in the future or there may be additional options for return type.

Type
Object

request() → {Object}

Request for the PSBT data that needs to be signed.

NOTE: the application may be expecting the PSBT in some format other than the direct Object.

E.g. PSBT in Base64 is interaction().request().toBase64()

Overrides:
Source:
Returns:

Returns the local unsigned PSBT from transaction details

Type
Object

(async) run() → {void}

Throws an error.

Overrides:
Source:
Throws:

An error since this is an indirect interaction.

Returns:
Type
void