polkadotGetAddress

Use requirement

  • Firmware version required

    • Touch: 4.3.0

    • Classic/Mini: 3.0.0

  • Joystream Chain Firmware version required

    • Touch: 4.7.0

    • Classic/Mini: 3.6.0

  • Manta Chain Firmware version required

    • Touch: 4.9.0

    • Classic/Mini: 3.7.0

Polkadot: get address

Retrieves BIP32 extended public derived by given BIP32 path. User is presented with a description of the requested key and asked to confirm the export.

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

Params

Optional common params

Exporting single public key

  • path — required string | Array<number> minimum length is 3. read more

  • prefix - required string Address prefix. Default is set to nexatest

  • network - required string Network name, Default is set to polkadot

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

Exporting bundle of public keys

  • bundle - Array of Objects with path, coin fields

Example

Return public key of first ethereum account:

HardwareSDK.polkadotGetAddress(connectId, deviceId, {
    path: "m/44'/354'/0'/0'/0'",
    showOnOneKey: true,
    isTestnet: false
});

Return a bundle of public keys for multiple ethereum accounts:

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

Result

Result with only one public key

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

Result with bundle of public keys

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

Error

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

Last updated