Files
trezor-suite/docs/packages/connect/methods/getAccountDescriptor.md
2023-10-27 12:24:48 +02:00

1.6 KiB

Get account descriptor

Gets an descriptor of specified account.

const result = await TrezorConnect.getAccountDescriptor(params);

Params

Optional common params

  • pathrequired string | Array<number> minimum length is 3. read more
  • coinrequired string determines network definition specified in coins.json file. Coin shortcut, name or label can be used.
  • derivationTypeoptional CardanoDerivationType enum. determines used derivation type. Default is set to ICARUS_TREZOR=2
  • suppressBackupWarning - boolean 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.

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
    }
}