Skip to main content
Examples use API client signing.

Signing request types

To sign transactions you build yourself or messages you format yourself, use raw signing.

Wallet

Create a wallet with networkType: "NETWORK_TYPE_TON". Fund it with GRAM (formerly TON) for the transfer and fees, plus the jetton balance for jetton transfers. MPCVault includes wallet deployment in the first outgoing transaction when needed.

Send GRAM

This TON Mainnet example sends 1 GRAM.
value is an integer string in nanograms: 1 GRAM = 1,000,000,000 nanograms. If the recipient requires a deposit memo, put it in comment (up to 50 Unicode characters). Omit comment when none is required. Transaction notes are separate and do not appear on-chain.

Send USDT (Jetton)

Replace tonSendNative with this payload in the same request:
This example sends 1 USDT on TON Mainnet (six decimals). mintAddress is Tether’s TON Mainnet USDT jetton master. to is the recipient’s TON wallet address. GRAM pays transaction fees.

Send contract messages

Build the contract message bodies, then replace tonSendNative with this payload:
The outer payload is standard base64 of the following UTF-8 JSON. Encode it using Encode bytes:
Each messages[].amount is the native GRAM amount attached to that message, as an integer string in nanograms. Each messages[].payload is a base64 Bag of Cells (BOC) containing the contract message body. Optional messages[].state_init is a base64 BOC of the contract’s initialization data. The outer base64-encoded JSON contains these inner base64 BOC strings.

Sign and track

Sign the request. The returned txHash is the hash of the signed external message, not the on-chain transaction hash. Track its delivery through the message trace below. Use TON Center’s trace lookup by message hash on Mainnet:
  • Find the sending wallet’s transaction in traces[].transactions, then check description.aborted: false, description.compute_ph.success: true and description.action.success: true. Follow the intended messages through the complete trace; wallet execution alone does not establish downstream success.
  • For GRAM, verify delivery to the expected recipient and amount without a bounced payment. For jettons, verify the expected jetton master, recipient and raw amount through the recipient’s jetton-wallet transaction. For custom calls, check the contract’s expected result.
  • An empty or incomplete trace can reflect indexing delay. Keep tracking the same external-message hash until the intended downstream result is known.

Sign a TON Connect proof

Use this payload with the shared message-signing flow:
content is standard base64 of this UTF-8 ton_proof envelope. Encode it using Encode bytes:
Use the signing wallet’s address, the current Unix timestamp in seconds, your application’s domain and its UTF-8 byte length, and a verifier-issued, single-use challenge. Verify the proof using TON’s verification flow.