Methods
Other
getAccountDescriptor

Get account descriptor

Gets an descriptor of specified account.

const result = await TrezorConnect.getAccountDescriptor(params);

Params

Including CommonParams

GetAccountDescriptorParams

coin

String

Required

determines network definition specified in coins.json file. Coin shortcut, name or label can be used.

derivationType

Enum: LEDGER (0) | ICARUS (1) | ICARUS_TREZOR (2)

Optional

enum. determines used derivation type. Default is set to ICARUS_TREZOR=2

suppressBackupWarning

Boolean

Optional

By default, this method will emit an event to show a warning if the wallet does not have a backup. This option suppresses the message.

Bundle(GetAccountDescriptorParams)

Example

Get descriptor of first bitcoin account

TrezorConnect.getAccountDescriptor({
    path: "m/49'/0'/0'",
    coin: 'btc',
});

Result

AccountInfo type

{
    success: true,
    payload: {
        id: number,                           // account id
        path: string,                         // serialized path
        descriptor: string,                   // account public key
        legacyXpub?: string,                  // (optional) account public key in legacy format (only for segwit and segwit native accounts)
 
    }
}

Error

{
    success: false,
    payload: {
        error: string // error message
    }
}
Last updated on