Optionaloptions: TonConnectOptionsStaticistarget wallet's js bridge key.
StaticisCheck if specified wallet is injected and available to use with the app.
target wallet's js bridge key.
Current connected account or null if no account is connected.
Shows if the wallet is connected right now.
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<{ openingDeadlineMS?: number; signal?: AbortSignal }>Disconnect form thw 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.
Generates a universal link for a send action intent. This allows users to complete actions via a dynamic action URL without being connected to the wallet.
action intent request.
Optionaloptions: OptionalTraceable<{ walletUniversalLink?: string }>(optional) options including traceId and wallet universal link.
universal link that can be opened in a wallet or displayed as QR code.
Generates a universal link for a send transaction intent. This allows users to complete transactions without being connected to the wallet.
transaction intent request.
Optionaloptions: OptionalTraceable<{ walletUniversalLink?: string }>(optional) options including traceId and wallet universal link.
universal link that can be opened in a wallet or displayed as QR code.
Generates a universal link for a sign data intent. This allows users to sign data without being connected to the wallet.
sign data intent request.
Optionaloptions: OptionalTraceable<{ walletUniversalLink?: string }>(optional) options including traceId and wallet universal link.
universal link that can be opened in a wallet or displayed as QR code.
Generates a universal link for a sign message intent. This allows users to sign messages without being connected to the wallet.
sign message intent request.
Optionaloptions: OptionalTraceable<{ walletUniversalLink?: string }>(optional) options including traceId and wallet universal link.
universal link that can be opened in a wallet or displayed as QR code.
Subscribe to intent response events. This allows you to receive responses from intents (e.g., transaction results, sign data results).
will be called when an intent response is received.
unsubscribe function.
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.
Optionaloptions: OptionalTraceable<{ onRequestSent?: () => void; signal?: AbortSignal }>Asks connected wallet to sign the message.
message to sign.
OptionaloptionsOrOnRequestSent: (optional) onRequestSent callback will be called after the message is sent and signal to abort the request.
signed message boc. If user rejects message, method will throw the corresponding error.
Unpause bridge HTTP connection if it is paused.
StaticgetReturns available wallets list.
Check if the app is opened inside specified wallet's browser.