Skip to main content

tonSignMessage

Use requirement

  • Firmware version required
    • UKey Lite 24 / UKey Lite 25 / UKey Core 26: 4.10.0

TON: sign message

Sign a message or transaction using the private key derived by given BIP32 path. User needs to confirm the action on Ukey Wallet device.

const response = await HardwareSDK.tonSignMessage(connectId, deviceId, {
path: "m/44'/607'/0'",
destination: "UQBYkuShkZzRYAWX_HrK3kFpeAixiRKd-K7QBXYxl9OBXM0_",
tonAmount: 100,
seqno: 0,
expireAt: Date.now() + 1000 * 60 * 60 * 24,
walletVersion: 3,
isBounceable: false,
isTestnetOnly: false,
});

Params

Optional common params

Required Parameters

  • path - required string | Array<number> minimum length is 3
  • destination - required string destination address
  • tonAmount - required number amount of TON to transfer
  • seqno - required number sequence number
  • expireAt - required number message expiration timestamp

Optional Parameters

  • walletVersion - optional TonWalletVersion TON wallet version (default: 3)
  • isBounceable - optional boolean whether message is bounceable (default: false)
  • isTestnetOnly - optional boolean whether to use testnet (default: false)
  • jettonMasterAddress - optional string Jetton master contract address
  • jettonAmount - optional number amount of jettons to transfer
  • fwdFee - optional number forward fee for jetton transfer
  • comment - optional string message comment
  • mode - optional number message mode
  • workchain - optional TonWorkChain TON workchain
  • walletId - optional number wallet ID

Example

// Simple TON transfer
const response = await HardwareSDK.tonSignMessage(connectId, deviceId, {
path: "m/44'/607'/0'",
destination: "UQBYkuShkZzRYAWX_HrK3kFpeAixiRKd-K7QBXYxl9OBXM0_",
tonAmount: 100,
seqno: 0,
expireAt: Date.now() + 1000 * 60 * 60 * 24,
walletVersion: 3,
isBounceable: false,
isTestnetOnly: false,
});

// Multiple Native
const jettonResponse = await HardwareSDK.tonSignMessage(connectId, deviceId, {
path: "m/44'/607'/0'",
destination: "UQBYkuShkZzRYAWX_HrK3kFpeAixiRKd-K7QBXYxl9OBXM0_",
tonAmount: 100,
seqno: 0,
expireAt: Date.now() + 1000 * 60 * 60 * 24,
walletVersion: 3,
isBounceable: false,
isTestnetOnly: false,
extDestination: ["UQBYkuShkZzRYAWX_HrK3kFpeAixiRKd-K7QBXYxl9OBXM0_"],
extTonAmount: [100],
extPayload: ["48656c6c6f204f6e654b6579"],
});

Result

{
success: true,
payload: {
skip_validate: boolean; // Used to skip validation on UKey Lite 24 / Lite 25 and similar models.
signature: string;
signning_message: string;
}
}

Error

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