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, or list of bridges urls for creating an universal connection request for the corresponding wallets.
Optionalrequest: ConnectAdditionalRequest(optional) additional request to pass to the wallet while connect (currently only ton_proof is available).
Optionaloptions: OptionalTraceable<{ openingDeadlineMS?: number; signal?: AbortSignal }>(optional) options
universal link if external wallet was passed or void for the injected wallet.
Disconnect form thw connected wallet and drop current session.
Optionaloptions: OptionalTraceable<{ signal?: AbortSignal }>Builds a full ConnectRequest for use in intent options (e.g. from UI). Merges manifest from connector config with optional additional request (tonProof etc).
OptionaladditionalRequest: ConnectAdditionalRequestGets 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 }>Sends action intent.
actionUrl to be called by the wallet.
Optionaloptions: OptionalTraceable<IntentUrlOptions>optional connect request, abort signal, trace id and URL callback.
result of underlying sendTransaction, signData or signMessage operation. If user rejects action, method will throw the corresponding error.
Asks connected wallet to sign and send the transaction.
transaction to send.
Optionaloptions: OptionalTraceable<{ onRequestSent?: () => void; signal?: AbortSignal }>(optional) onRequestSent callback will be called after the transaction is sent and signal to abort the request.
signed transaction boc that allows you to find the transaction in the blockchain. If user rejects transaction, method will throw the corresponding error.
OptionalonRequestSent: () => voidSends transaction via intent flow.
transaction to send.
Optionaloptions: OptionalTraceable<IntentUrlOptions>optional connect request, abort signal, trace id and URL callback.
signed transaction boc that allows you to find the transaction in the blockchain. If user rejects transaction, method will throw the corresponding error.
Set 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 }>Signs data via intent flow.
data to sign.
Optionaloptions: OptionalTraceable<IntentUrlOptions>optional connect request, abort signal, trace id and URL callback.
signature and related metadata. If user rejects signing, method will throw the corresponding error.
Optionaloptions: OptionalTraceable<{ onRequestSent?: () => void; signal?: AbortSignal }>Signs message via intent flow.
message to sign.
Optionaloptions: OptionalTraceable<IntentUrlOptions>optional connect request, abort signal, trace id and URL callback.
signed message boc. If user rejects signing, method will throw the corresponding error.
Unpause bridge HTTP connection if it is paused.
Current connected account or null if no account is connected.