TON Connect manifest
Before installing and setting up the TON Pay SDK, the application must provide a TON Connect manifest, which is a JSON file that defines application metadata. Wallets use this manifest to discover the application.First payment
Add TON Connect provider
TON Pay UI uses TON Connect UI for wallet communication.The application must be wrapped with
TonConnectUIProvider and configured with an absolute URL to the TON Connect manifest. Add TonConnectUIProvider at the root of the application.Add a payment button
Add a
TonPayButton and provide a handler. The handler uses useTonPay to connect a wallet if needed, send a transaction through TON Connect, and track the transaction result.TonPayButtonwraps wallet connect and disconnect UX and invokes the provided handler.useTonPayaccepts an async message factory that receivessenderAddrand returns{ message }along with any tracking fields to propagate.
{ message } is a TON Connect transaction message. useTonPay forwards it to the wallet through TON Connect and initiates the transaction send; direct calls to the wallet SDK are not required.Minimal server‑side flow quick sample
Minimal server‑side flow quick sample
Loading state and result handling
Loading state and result handling
This example shows a minimal loading state and how to surface the reference. If a transaction hash is available, an explorer link can be rendered.
Full example
This minimal example scaffolds a React app, installs TON Pay dependencies, and renders a working button wired to TON Connect. Replace the manifest URL andrecipientAddr with the necessary values.