tonSignProof

Use requirement

  • Firmware version required

    • Touch: 4.10.0

TON: sign proof

Sign a proof message for dApp authentication using the private key derived by given BIP32 path. User needs to confirm the action on OneKey device.

const result = await HardwareSDK.tonSignProof(connectId, deviceId, {
    path: "m/44'/607'/0'",
    appdomain: "onekey.so",
    comment: "48656c6c6f204f6e654b6579",
    expireAt: Date.now() + 1000 * 60 * 60 * 24,
    walletVersion: "V4R2",
    isBounceable: false,
    isTestnetOnly: false
});

Params

Optional common params

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

  • appdomainrequired string domain of the dApp requesting the proof

  • commentoptional string message comment in hex format

  • expireAtrequired number proof expiration timestamp

  • walletVersionoptional TonWalletVersion TON wallet version (default: 3)

  • walletIdoptional number wallet ID (default: 698983191)

  • workchainoptional TonWorkChain TON workchain (0: BaseChain, 1: MasterChain)

  • isBounceableoptional boolean whether message is bounceable (default: false)

  • isTestnetOnlyoptional boolean whether to use testnet (default: false)

Returns

Response

  • signature - proof signature in hex format

Example

const response = await HardwareSDK.tonSignProof(connectId, deviceId, {
    path: "m/44'/607'/0'",
    appdomain: "onekey.so",
    comment: "48656c6c6f204f6e654b6579",
    expireAt: Date.now() + 1000 * 60 * 60 * 24,
    walletVersion: 3,
    isBounceable: false,
    isTestnetOnly: false
});

Result

{
    success: true,
    payload: {
        signature: string;
    }
}

Error

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

Last updated