Cardano: get public key
Retrieves BIP32-Ed25519 extended public derived by given BIP32-Ed25519 path. User is presented with a description of the requested key and asked to confirm the export on Trezor.
const result = await TrezorConnect.cardanoGetPublicKey(params);
Params
Exporting single public key
path
— requiredstring | Array<number>
minimum length is3
. read moreshowOnTrezor
— optionalboolean
determines if publick key will be displayed on device. Default is set totrue
derivationType
— optionalCardanoDerivationType
enum. determines used derivation type. Default is set to ICARUS_TREZOR=2suppressBackupWarning
- optionalboolean
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.
Exporting bundle of publick keys
bundle
-Array
of Objects withpath
andshowOnTrezor
fields
Example
Display public key of first cardano account:
TrezorConnect.cardanoGetPublicKey({
path: "m/44'/1815'/0'",
});
Return a bundle of cardano public keys without displaying them on device:
TrezorConnect.cardanoGetPublicKey({
bundle: [
{ path: "m/44'/1815'/0'", showOnTrezor: false }, // account 1
{ path: "m/44'/1815'/1'", showOnTrezor: false }, // account 2
{ path: "m/44'/1815'/2'", showOnTrezor: false }, // account 3
],
});
Result
Result with only one public key
{
success: true,
payload: {
path: Array<number>, // hardended path
serializedPath: string,
publicKey: string,
node: HDPubNode,
}
}
Result with a bundle of public keys
{
success: true,
payload: [
{ path: Array<number>, serializedPath: string, publicKey: string, node: HDPubNode }, // account 1
{ path: Array<number>, serializedPath: string, publicKey: string, node: HDPubNode}, // account 2
{ path: Array<number>, serializedPath: string, publicKey: string, node: HDPubNode } // account 3
]
}
Error
{
success: false,
payload: {
error: string // error message
}
}