tonGetAddress
Use requirement
- Firmware version required - Touch: 4.10.0 
 
TON: 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 response = await HardwareSDK.tonGetAddress(connectId, deviceId, {
    path: "m/44'/607'/0'",
    showOnOneKey: true,
    walletVersion: 3,
    isBounceable: false,
    isTestnetOnly: false
});Params
Exporting single address
- path— required- string | Array<number>minimum length is 3. read more
- showOnOneKey— optional- booleandetermines if address will be displayed on device. Default is set to- true
- walletVersion— optional- TonWalletVersionTON wallet version (default: 3)
- isBounceable— optional- booleanwhether address is bounceable (default: false)
- isTestnetOnly— optional- booleanwhether to use testnet (default: false)
Exporting bundle of addresses
- bundle-- Arrayof Objects with- pathand- showOnOneKeyfields
Example
// Get single address
const response = await HardwareSDK.tonGetAddress(connectId, deviceId, {
    path: "m/44'/607'/0'",
    showOnOneKey: false,
    walletVersion: 3,
    isBounceable: false,
    isTestnetOnly: false,
});
// Get multiple addresses
const batchResponse = await HardwareSDK.tonGetAddress(connectId, deviceId, {
    bundle: [
        {
            path: "m/44'/607'/0'",
            showOnOneKey: false
        },
        {
            path: "m/44'/607'/1'",
            showOnOneKey: false
        }
    ]
});Result
Result with only one address
{
    success: true,
    payload: {
        address: string,     // displayed address
        publicKey: string,
        path: Array<number> // hardended path
    }
}Result with bundle of addresses sorted by FIFO
{
    success: true,
    payload: [
        { address: string, publicKey: string, path: Array<number> }, // account 1
        { address: string, publicKey: string, path: Array<number> }, // account 2
        { address: 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?
