Skip to main content

solGetAddress

Solana: get address

Display the requested address derived from the given BIP32 path on the device and return it to the caller. The user is asked to confirm the export on Ukey Wallet.

const response = await HardwareSDK.solGetAddress(connectId, deviceId, params);

Params

Optional common params

Exporting single address

  • path - required string | Array<number> length is 4 for this special chain. more information
  • showOnUKey - optional boolean determines whether the address will be displayed on the device. Default is true.

Exporting bundle of addresses

  • bundle - Array of objects with path and showOnUKey fields

Example

Display the address of the first Solana account:

HardwareSDK.solGetAddress(connectId, deviceId, {
path: "m/44'/501'/0'/0'",
});

Return a bundle of Solana addresses without displaying them on the device:

HardwareSDK.solGetAddress(connectId, deviceId, {
bundle: [
{ path: "m/44'/501'/3'/0'", showOnUKey: false }, // fourth derivation path
{ path: "m/44'/501'/4'/0'", showOnUKey: false }, // fifth derivation path
{ path: "m/44'/501'/5'/0'", showOnUKey: false }, // sixth derivation path
],
});

Result

Result with only one address

{
success: true,
payload: {
address: string, // displayed address
path: Array<number> // derived path
}
}

Result with a bundle of addresses in the same order as the request

{
success: true,
payload: [
{ address: string, path: Array<number> }, // fourth derivation path
{ address: string, path: Array<number> }, // fifth derivation path
{ address: string, path: Array<number> } // sixth derivation path
]
}

Error

{
success: false,
payload: {
error: string, // error message
code: number // error code
}
}