Signing

Sign data on TON using OneKey

Learn how to sign data for off-chain verification.


Sign Arbitrary Data

Sign data cells for off-chain verification:

const result = await provider.send({
  method: 'signData',
  id: Date.now().toString(),
  params: [
    JSON.stringify({
      schema_crc: 0, // Custom schema identifier
      cell: cellBoc.toString('base64'), // Base64 encoded cell to sign
    })
  ]
})

if ('result' in result) {
  console.log('Signature:', result.result.signature) // Base64 signature
  console.log('Timestamp:', result.result.timestamp) // UNIX timestamp
}

Sign Proof (Authentication)

Request proof for authentication during connection:


Error Handling


Error Codes

Code
Description

0

Unknown error

1

Bad request

100

Unknown app

300

User rejected request

400

Method not supported

Last updated

Was this helpful?