Class: TrezorConfirmMultisigAddress

trezor.TrezorConfirmMultisigAddress(options)

Shows a multisig address on the device and prompts the user to confirm it. If the optional publicKey parameter is used, the public key at the given BIP32 path is checked, returning an error if they don't match.

Without the publicKey parameter, this function simply checks that the public key at the given BIP32 path is in the redeemscript (with validation on-device.

Constructor

new TrezorConfirmMultisigAddress(options)

Most of the information required to confirm a multisig address lives in the Multisig object from unchained-bitcoin.

Parameters:
Name Type Description
options object

options argument

Properties
Name Type Description
network string

bitcoin network

bip32Path string

BIP32 path to the public key on this device used in the multisig address

multisig Multisig

multisig object

publicKey string

optional public key to confirm

Source:
Example
import {
  generateMultisigFromPublicKeys, MAINNET, P2SH,
} from "unchained-bitcoin";
import {TrezorConfirmMultisigAddress} from "unchained-wallets";
const multisig = generateMultisigFromPublicKeys(MAINNET, P2SH, 2, "03a...", "03b...");
const interaction = new TrezorConfirmMultisigAddress({network: MAINNET, bip32Path: "m/45'/0'/0'/0/0", multisig});
await interaction.run();

Extends

Methods

connectParams() → {Array.<function(), Object>}

Overrides:
Source:
Returns:

TrezorConnect parameters

Type
Array.<function(), Object>

messages() → {Array.<module:interaction.Message>}

Adds messages about BIP32 path warnings.

Overrides:
Source:
Returns:

messages for this interaction

Type
Array.<module:interaction.Message>

parse() → {void}

Throws an error.

Overrides:
Source:
Throws:

An error since this is a direct interaction.

Returns:
Type
void

parsePayload(payload) → {Object}

Override this method in a subclass to parse the payload of a successful response from the device.

By default, the entire payload is returned.

Parameters:
Name Type Description
payload Object

the raw payload from the device response

Overrides:
Source:
Returns:
  • relevant or formatted data built from the raw payload
Type
Object

request() → {void}

Throws an error.

Overrides:
Source:
Throws:

An error since this is a direct interaction.

Returns:
Type
void

(async) run() → {Promise}

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.

Overrides:
Source:
Returns:

handles the work of calling TrezorConnect

Type
Promise