nervosGetAddress
Nervos: 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.nervosGetAddress(connectId, deviceId, params);Use requirement
- Firmware version required - Touch: 4.9.0 
- mini: 3.7.0 
 
Parameters
connectId: string
- Unique identifier for the connection 
deviceId: string
- Unique identifier for the hardware device 
params: object
- path: required - string- BIP32 path of requested address (e.g. "m/44'/309'/0'/0/0")
- network: required - string- Network name (e.g. "ckb")
- showOnOneKey: optional - boolean- Whether to display address on device
Example
const response = await HardwareSDK.nervosGetAddress('connect1', 'device1', {
    path: "m/44'/309'/0'/0/0",
    showOnOneKey: true,
    network: "ckb"
});
console.log(response.address);Returns
Returns a Promise resolving to:
{
    success: true,
    payload: {
        address: string,     // Nervos address
        path: string  // BIP32 path used for derivation
    }
}Error response:
{
    success: false,
    payload: {
        error: string,  // Error message
        code: number    // Error code
    }
}Last updated
Was this helpful?
