Skip to main content

aptosGetPublicKey

Use requirement

  • Firmware version required
    • UKey Lite 24 / UKey Lite 25: 1.1.0
    • UKey Core 26: 1.1.0

Aptos: 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.aptosGetPublicKey(connectId, deviceId, params);

Params

Optional common params

Exporting single public key

  • path - required string | Array<number> minimum length is 1. read more
  • showOnUKey - optional boolean determines whether the public key will be displayed on the device. Default is true.

Exporting bundle of public keys

  • bundle - Array of objects with path and showOnUKey fields

Example

Return the public key of the second Aptos account:

HardwareSDK.aptosGetPublicKey(connectId, deviceId, {
path: "m/44'/637'/1'/0'/0'",
showOnUKey: true,
});

Return a bundle of public keys for multiple aptos accounts:

HardwareSDK.aptosGetPublicKey(connectId, deviceId, {
bundle: [
{ path: "m/637'/0'/3'/0'/0'" }, // fourth derivation path
{ path: "m/637'/0'/4'/0'/0'" }, // fifth derivation path
{ path: "m/637'/0'/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
}
}