Class: HermitSignMultisigTransaction

hermit.HermitSignMultisigTransaction(options)

Displays a signature request for Hermit's sign command and reads the resulting signature.

This interaction class works in tandem with the BCURDecoder class. The BCURDecoder parses data from Hermit, this class interprets it.

Constructor

new HermitSignMultisigTransaction(options)

Parameters:
Name Type Description
options object

options argument

Properties
Name Type Description
psbt array.<object>

unsigned PSBT to sign

returnSignatureArray bool

return a signed PSBT or an array of signatures (useful in Caravan's testing app)

Source:
Example
const interaction = new HermitSignMultisigTransaction({psbt});
const urParts = interaction.request();
console.log(urParts);
// [ "ur:...", "ur:...", ... ]

// Some application function which knows how to display an animated
// QR code sequence.
displayQRCodeSequence(urParts);

// Hermit returns a PSBT encoded as hex through BC-UR.  Some
// application function needs to work with the BCURDecoder class to
// parse this data.
const signedPSBTHex = readQRCodeSequence();

// The interaction parses the data from Hermit.
const signedPSBTBase64 = interaction.parse(signedPSBTHex);
console.log(signedPSBTBase64);
// "cHNidP8B..."

Extends

Methods

parse(response) → {Object}

Parse the response into a result.

Subclasses must override this function. It must accept an appropriate kind of response object and return the final result of this interaction.

Parameters:
Name Type Description
response Object

the raw response

Overrides:
Source:
Returns:

the parsed response

Type
Object

request() → {Object}

Provide the request.

Subclasses may override this function. It can return any kind of object. Strings, data for QR codes, HTTP requests, command lines, functions, &c. are all allowed. Whatever is appropriate for the interaction.

Overrides:
Source:
Returns:

the request data

Type
Object

(async) run() → {void}

Throws an error.

Overrides:
Source:
Throws:

An error since this is an indirect interaction.

Returns:
Type
void