kaspaGetAddress

Use requirement

  • Firmware version required

    • Touch: 4.3.0

    • Classic/Mini: 3.0.0

Kaspa: get address

Display requested address derived by given BIP32 path on device and returns it to caller. User is presented with a description of the requested key and asked to confirm the export on OneKey.

const result = await HardwareSDK.kaspaGetAddress(connectId, deviceId, params);

Params

Optional common params

Exporting single public key

  • pathrequired string | Array<number> minimum length is 3. read more

  • showOnOneKeyoptional boolean determines if address will be displayed on device. Default is set to true

  • prefix - optional string Address prefix. Default is set to kaspa

  • scheme - optional string Encryption algorithm mode. Default is set to schnorr

Exporting bundle of public keys

  • bundle - Array of Objects with path, coin fields

Example

Return public key of first ethereum account:

HardwareSDK.kaspaGetAddress(connectId, deviceId, {
    path: "m/44'/111111'/0'/0/0",
    showOnOneKey: true,
    prefix: "prefix",
    scheme: "schnorr",
});

Return a bundle of public keys for multiple ethereum accounts:

HardwareSDK.kaspaGetAddress(connectId, deviceId, {
    bundle: [
        { path: "m/44'/111111'/0'/0/0" }, // account 1
        { path: "m/44'/111111'/0'" }, // account 2
        { path: "m/44'/111111'/0'/0/1" }  // account 3
    ]
});

Result

Result with only one public key

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

Result with bundle of public keys

{
    success: true,
    payload: [
        { path, address }, // account 1
        { path, address }, // account 2
        { path, address }, // account 3
    ]
}

Error

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

Last updated