Skip to main content
In total, there are five distinct kinds of incoming requests from the TON Connect bridge. They form the corresponding events and their handlers:

Handle onTransactionRequest

If a dApp is connected to the wallet service, the former can request to initiate a blockchain transaction, which fires the transaction request over the bridge. The wallet service then handles it with the onTransactionRequest method of the WalletKit. On TON, transactions are initiated by sending an external message to the TON wallet contract, which then processes it and sends internal messages as requested. To estimate money flows for planned transactions, WalletKit uses emulation via the configured API client, if supported.
TypeScript

Handle onSignDataRequest

If a dApp is connected to the wallet service, the former can request to sign data with the private key used by the selected TON wallet, which fires the signData request over the bridge. The wallet service then handles it with the onSignDataRequest method of the WalletKit. The data to sign can be of several kinds: text, binary, or a raw cell.
TypeScript

Handle request errors

Upon any error in any of the requests, the onRequestError() method is invoked. Provide it with a callback function that would handle arbitrary errors and display useful information to the user.
TypeScript

Next steps

Work with Toncoin

See also