suiGetPublicKey
Sui: get public key
Retrieves the BIP32 extended public key derived from the given BIP32 path. The user is asked to confirm the export on Ukey Wallet.
const result = await HardwareSDK.suiGetPublicKey(connectId, deviceId, params);
Params
Exporting single public key
path- requiredstring | Array<number>minimum length is1. read moreshowOnUKey- optionalbooleandetermines whether the public key will be displayed on the device. Default istrue.
Exporting bundle of public keys
bundle-Arrayof objects withpathandshowOnUKeyfields
Example
Return the public key of the second Sui account:
HardwareSDK.suiGetPublicKey(connectId, deviceId, {
path: "m/44'/784'/1'/0'/0'",
showOnUKey: true,
});
Return a bundle of public keys for multiple Sui accounts:
HardwareSDK.suiGetPublicKey(connectId, deviceId, {
bundle: [
{ path: "m/44'/784'/3'/0'/0'" }, // fourth derivation path
{ path: "m/44'/784'/4'/0'/0'" }, // fifth derivation path
{ path: "m/44'/784'/5'/0'/0'" }, // sixth derivation path
],
});
Result
Result with only one public key
{
success: true,
payload: {
path: string, // derived path
publicKey: string
}
}
Read more about BIP32 serialization format
Result with a bundle of public keys in the same order as the request
{
success: true,
payload: [
{ path: serializedPath, publicKey }, // fourth derivation path
{ path: serializedPath, publicKey }, // fifth derivation path
{ path: serializedPath, publicKey }, // sixth derivation path
]
}
Error
{
success: false,
payload: {
error: string, // error message
code: number // error code
}
}