Method testing tool
Binance: 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.binanceGetPublicKey(params);
Params
Including CommonParams
GetPublicKey
path
String | Array<Number>
Required
minimum length is 5
. read more
showOnTrezor
Boolean
Optional
determines if address will be displayed on device. Default is set to true
suppressBackupWarning
Boolean
Optional
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.
chunkify
Boolean
Optional
Display the result in chunks for better readability. Default is false
Bundle(GetPublicKey)
Example
Displays public key derived from BIP44 path:
TrezorConnect.binanceGetPublicKey({
path: "m/44'/714'/0'/0/0",
});
Return a bundle of public keys without displaying them on device:
TrezorConnect.binanceGetPublicKey({
bundle: [
{ path: "m/44'/714'/0'/0/0", showOnTrezor: false }, // public key 1
{ path: "m/44'/714'/1'/0/0", showOnTrezor: false }, // public key 2
{ path: "m/44'/714'/2'/0/0", showOnTrezor: false }, // public key 3
],
});
Result
Result with only one public key
{
success: true,
payload: {
path: Array<number>,
serializedPath: string,
publicKey: string,
}
}
Result with bundle of public keys sorted by FIFO
{
success: true,
payload: [
{ path: Array<number>, serializedPath: string, publicKey: string }, // public key 1
{ path: Array<number>, serializedPath: string, publicKey: string }, // public key 2
{ path: Array<number>, serializedPath: string, publicKey: string } // public key 3
]
}
Error
{
success: false,
payload: {
error: string // error message
}
}