A TON Connect session ends from either side — the dApp callsDocumentation Index
Fetch the complete documentation index at: https://companyname-a7d5b98e-feature-fumodocs.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
disconnect(), or the user revokes the session from inside the wallet.
dApp-initiated disconnect
disconnect() returns a Promise<void>. It first clears the wallet info from local storage and sets the connector’s wallet to null (firing every onStatusChange subscriber), so the dApp sees the disconnected state immediately. The SDK then sends a disconnect RPC request over the bridge so the wallet can clean up its own state. The wallet does not emit a disconnect event in response to a dApp-initiated call.
If no wallet is connected, disconnect() throws WalletNotConnectedError. Guard the call with tonConnectUi.connected.
The call accepts an optional traceId (UUIDv7 by default) that the SDK attaches to the bridge request for analytics correlation, mirroring the option on sendTransaction, signData, and signMessage:
Wallet-initiated disconnect
The user can revoke the session from inside the wallet — for example, from a “Connected dApps” list. The wallet sends adisconnect event over the bridge:
wallet === null.
Reacting to disconnects
Both disconnect paths funnel into the same status change. Subscribe to the connector to handle either case:disconnect() earlier.