Eos: get public key
Display requested public key derived by given BIP44 path on device and returns it to caller. User is presented with a description of the requested public key and asked to confirm the export.
const result = await TrezorConnect.eosGetPublicKey(params);
Params
Exporting single address
path
— requiredstring | Array<number>
minimum length is5
. read moreshowOnTrezor
— optionalboolean
determines if address will be displayed on device. Default is set totrue
chunkify
— optionalboolean
determines if address will be displayed in chunks of 4 characters. Default is set tofalse
Exporting bundle of addresses
bundle
-Array
of Objects withpath
andshowOnTrezor
fields
Example
Displays public key derived from BIP44 path:
TrezorConnect.eosGetPublicKey({
path: "m/44'/194'/0'/0/0",
});
Return a bundle of public keys without displaying them on device:
TrezorConnect.eosGetPublicKey({
bundle: [
{ path: "m/44'/194'/0'/0/0", showOnTrezor: false }, // public key 1
{ path: "m/44'/194'/0'/0/1", showOnTrezor: false }, // public key 2
{ path: "m/44'/194'/0'/0/2", showOnTrezor: false }, // public key 3
],
});
Result
Result with only one public key
{
success: true,
payload: {
wifPublicKey: string,
rawPublicKey: string,
path: number[],
serializedPath: string
}
}
Result with bundle of public keys sorted by FIFO
{
success: true,
payload: [
{ wifPublicKey: string, rawPublicKey: string, path: number[], serializedPath: string }, // public key 1
{ wifPublicKey: string, rawPublicKey: string, path: number[], serializedPath: string }, // public key 2
{ wifPublicKey: string, rawPublicKey: string, path: number[], serializedPath: string } // public key 3
]
}
Error
{
success: false,
payload: {
error: string // error message
}
}