Class: HermitSignTransaction

hermit.HermitSignTransaction(options)

Returns signature request data to display in a QR code for Hermit and reads the signature data passed back by Hermit in another QR code.

NOTE: Transactions with inputs & outputs to non-P2SH addresses are not supported by Hermit.

Constructor

new HermitSignTransaction(options)

Parameters:
Name Type Description
options object

options argument

Properties
Name Type Description
inputs array.<object>

inputs for the transaction

outputs array.<object>

outputs for the transaction

bip32Paths array.<string>

BIP32 paths

Source:
Example
const interaction = new HermitSignTransaction({inputs, outputs, bip32Paths});
console.log(interaction.request());
// "IJQXGZI..."

// Display a QR code containing the above data to Hermit running
// `sign-bitcoin` and it will return another QR code which needs
// parsed.
const encodedString = readHermitQRCode(); // application dependent
const signatures = interaction.parse(encoodedString);
console.log(signatures);
// ["ababa...01", ... ]

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