alephiumGetAddress
Use requirement
Firmware version required
Touch: 4.10.0
Alephium: get address
Display requested address derived by given BIP32 path on device and returns it to caller. User is asked to confirm the export on OneKey.
const result = await HardwareSDK.alephiumGetAddress(connectId, deviceId, {
path: "m/44'/1234'/0'/0/0",
showOnOneKey: false,
group: 0,
includePublicKey: true
});
Params
Exporting single address
path
— requiredstring | Array<number>
minimum length is 3group
— optionalnumber | undefined | null
showOnOneKey
— optionalboolean
determines if address will be displayed on device. Default is set totrue
Exporting bundle of addresses
bundle
-Array
of Objects withpath
andshowOnOneKey
andgroup
fields
Example
// Get single address
const response = await HardwareSDK.alephiumGetAddress(connectId, deviceId, {
path: "m/44'/1234'/0'/0/0",
showOnOneKey: true
});
// Get multiple addresses
const batchResponse = await HardwareSDK.alephiumGetAddress(connectId, deviceId, {
bundle: [
{
path: "m/44'/1234'/0'/0/0",
showOnOneKey: false
},
{
path: "m/44'/1234'/1'/0/0",
showOnOneKey: false
}
]
});
Result
Result with only one address
{
success: true,
payload: {
address: string, // displayed address
derivedPath: string,
publicKey: string,
path: Array<number> // hardended path
}
}
Result with bundle of addresses sorted by FIFO
{
success: true,
payload: [
{ address: string, derivedPath: string, publicKey: string, path: Array<number> }, // account 1
{ address: string, derivedPath: string, publicKey: string, path: Array<number> }, // account 2
{ address: string, derivedPath: string, publicKey: string, path: Array<number> } // account 3
]
}
Error
{
success: false,
payload: {
error: string, // error message
code: number // error code
}
}
Last updated
Was this helpful?