mirror of
https://github.com/trezor/trezor-suite.git
synced 2026-03-22 23:27:18 +01:00
1.6 KiB
1.6 KiB
Get account descriptor
Gets an descriptor of specified account.
const result = await TrezorConnect.getAccountDescriptor(params);
Params
path— requiredstring | Array<number>minimum length is3. read morecoin— requiredstringdetermines network definition specified in coins.json file. Coinshortcut,nameorlabelcan be used.derivationType— optionalCardanoDerivationTypeenum. determines used derivation type. Default is set to ICARUS_TREZOR=2suppressBackupWarning-booleanBy 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
{
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
}
}