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.
ES6
const result = await TrezorConnect.cardanoGetPublicKey(params);
CommonJS
TrezorConnect.cardanoGetPublicKey(params).then(function(result) {
});
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=2
bundle
-Array
of Objects withpath
andshowOnTrezor
fields
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 with only one public key
{
success: true,
payload: {
path: Array<number>, // hardended path
serializedPath: string,
publicKey: string,
node: HDPubNode,
rootHDPassphrase: string,
}
}
Result with bundle of publick keys
{
success: true,
payload: [
{ path: Array<number>, serializedPath: string, publicKey: string, node: HDPubNode, hdPassphrase: string }, // account 1
{ path: Array<number>, serializedPath: string, publicKey: string, node: HDPubNode, rootHDPassphrase: string }, // account 2
{ path: Array<number>, serializedPath: string, publicKey: string, node: HDPubNode, hdPassphrase: string } // account 3
]
}
Error
{
success: false,
payload: {
error: string // error message
}
}