Create a new connector. See TonConnectOptions for every option;
the most common shape is { manifestUrl } in the browser, and
{ manifestUrl, storage } in Node.js / non-browser hosts.
Optionaloptions: TonConnectOptionsStaticistrue when the dApp is running inside the named wallet's in-app
browser. Use it to pick the JS-bridge transport automatically and skip
the QR-code modal.
— value of the wallet's jsBridgeKey in the wallets list.
Staticistrue when a wallet identified by walletJSKey exposes a JS bridge on
the current page. The fastest way to detect a browser extension before
deciding which connect source to build.
— value of the wallet's jsBridgeKey in the wallets list.
Current connected account or null if no account is connected.
Shows if the wallet is connected right now.
Current connected wallet or null if no account is connected.
Generates universal link for an external wallet and subscribes to the wallet's bridge, or sends connect request to the injected wallet.
wallet's bridge url and universal link for an external wallet or jsBridge key for the injected wallet.
Optionaloptions: OptionalTraceable<(optional) openingDeadlineMS for the connection opening deadline and signal for the connection abort.
universal link if external wallet was passed or void for the injected wallet.
Optionalrequest: ConnectAdditionalRequestOptionaloptions: OptionalTraceable<Disconnect from the connected wallet and drop current session.
Optionaloptions: OptionalTraceable<{ signal?: AbortSignal }>Gets the current session ID if available.
session ID string or null if not available.
Returns available wallets list.
Allows to subscribe to connection status changes and handle connection errors.
will be called after connections status changes with actual wallet or null.
OptionalerrorsHandler: (err: TonConnectError) => void(optional) will be called with some instance of TonConnectError when connect error is received.
unsubscribe callback.
Pause bridge HTTP connection. Might be helpful, if you want to pause connections while browser tab is unfocused, or if you use SDK with NodeJS and want to save server resources.
Try to restore existing session and reconnect to the corresponding wallet. Call it immediately when your app is loaded.
Optionaloptions: OptionalTraceable<{ openingDeadlineMS?: number; signal?: AbortSignal }>Asks connected wallet to sign and send the transaction.
transaction to send.
Optionaloptions: OptionalTraceable<{ onRequestSent?: () => void; signal?: AbortSignal }>(optional) onRequestSent will be called after the request was sent to the wallet and signal for the transaction abort.
signed transaction boc that allows you to find the transaction in the blockchain. If user rejects transaction, method will throw the corresponding error.
OptionalonRequestSent: () => voidSet desired network for the connection. Can only be set before connecting. If wallet connects with a different chain, the SDK will throw an error and abort connection.
Optionalnetwork: stringdesired network id (e.g., '-239', '-3', or custom). Pass undefined to allow any network.
Ask the connected wallet to sign opaque data (SignDataPayload). The signature is bound to the user's wallet address, the dApp's domain, a timestamp, and the payload — verify on the backend or on-chain.
Optionaloptions: OptionalTraceable<{ onRequestSent?: () => void; signal?: AbortSignal }>The SignDataResponse plus, when available, the traceId
* the SDK propagated through the bridge.
*
*
WalletNotConnectedError — no wallet is connected. *
WalletNotSupportFeatureError — wallet does not advertise the
* requested SignData.types.
*
UserRejectsError — user declined. *
WalletWrongNetworkError — wallet network differs from the request. *
TonConnectError — bridge / validation error. * *
Ask the connected wallet to sign an internal message without broadcasting it.
Same payload shape as sendTransaction; supported by wallets that
advertise the SignMessage feature (typically Wallet V5).
Optionaloptions: OptionalTraceable<{ onRequestSent?: () => void; signal?: AbortSignal }>a signed BoC the dApp can wrap in an external * message and submit through a relayer (e.g. for a gasless jetton * transfer). * *
WalletNotConnectedError — no wallet is connected. *
WalletNotSupportFeatureError — wallet does not advertise SignMessage.
*
UserRejectsError — user declined. *
WalletWrongNetworkError — wallet network differs from the request. *
TonConnectError — bridge / validation error. * *
Unpause bridge HTTP connection if it is paused.
StaticgetFetch the wallets-list registry without instantiating a connector.
Equivalent to ITonConnect.getWallets but usable before
constructing a TonConnect.
Headless TON Connect connector — implements the ITonConnect contract. Wraps the protocol handshake and the HTTP / JS bridge / WalletConnect transports.
Example