Scan your whole stack
From OX Research Newsroom
Are you using @tonconnect/ui?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v6.2.0
@tonconnect/ui was last scanned on 1 Dec 2026 at version 6.2.0. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 6.2.0 LATEST | 1 Dec 2026 | No rules fired |
| 6.1.0 | 28 Nov 2026 | No rules fired |
| 6.0.0 | 27 Nov 2026 | No rules fired |
| 5.0.4 | 22 Nov 2026 | Not shown |
| 5.0.3 | 13 Nov 2026 | Not shown |
Findings for v6.2.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 6.2.0; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
TonConnect UI is a UI kit for TonConnect SDK. Use it to connect your app to TON wallets via TonConnect protocol.
If you use React for your dapp, take a look at TonConnect UI React kit.
If you want to use TonConnect on the server side, you should use the TonConnect SDK.
You can find more details and the protocol specification in the docs.
Add the script to your HTML file:
<script src="https://unpkg.com/@tonconnect/ui@latest/dist/tonconnect-ui.min.js"></script>
ℹ️ If you don't want auto-update the library, pass concrete version instead of latest, e.g.
<script src="https://unpkg.com/@tonconnect/ui@0.0.9/dist/tonconnect-ui.min.js"></script>
You can find TonConnectUI in global variable TON_CONNECT_UI, e.g.
<script>
const tonConnectUI = new TON_CONNECT_UI.TonConnectUI({
manifestUrl: 'https://<YOUR_APP_URL>/tonconnect-manifest.json',
buttonRootId: '<YOUR_CONNECT_BUTTON_ANCHOR_ID>'
});
</script>
npm i @tonconnect/ui
import { TonConnectUI } from '@tonconnect/ui'
const tonConnectUI = new TonConnectUI({
manifestUrl: 'https://<YOUR_APP_URL>/tonconnect-manifest.json',
buttonRootId: '<YOUR_CONNECT_BUTTON_ANCHOR_ID>'
});
You can also specify required wallet features to filter wallets that will be shown in the connect wallet modal:
import { TonConnectUI } from '@tonconnect/ui'
const tonConnectUI = new TonConnectUI({
manifestUrl: 'https://<YOUR_APP_URL>/tonconnect-manifest.json',
buttonRootId: '<YOUR_CONNECT_BUTTON_ANCHOR_ID>',
walletsRequiredFeatures: {
sendTransaction: {
minMessages: 2, // Wallet must support at least 2 messages
extraCurrencyRequired: true // Wallet must support extra currency
}
}
});
This will filter out wallets that don't support sending multiple messages or don't support extra currencies.
You can also specify preferred wallet features to prioritize wallets that support them in the connect wallet modal. These wallets will be shown first in the list, but others will still be available:
import { TonConnectUI } from '@tonconnect/ui'
const tonConnectUI = new TonConnectUI({
manifestUrl: 'https://<YOUR_APP_URL>/tonconnect-manifest.json',
buttonRootId: '<YOUR_CONNECT_BUTTON_ANCHOR_ID>',
walletsPreferredFeatures: {
sendTransaction: {
minMessages: 2,
extraCurrencyRequired: true
}
}
});
This will highlight wallets that support sending multiple messages and extra currencies, but won’t hide those that don’t. Use this to gently recommend more feature-rich wallets without excluding others.
You can configure analytics collection when creating TonConnectUI:
const tonConnectUI = new TonConnectUI({
manifestUrl: 'https://<YOUR_APP_URL>/tonconnect-manifest.json',
analytics: { mode: 'off' } // or 'telemetry' (default), 'full'
});
Analytics modes:
| Mode | Description |
|---|---|
| off | Analytics turned off. No events are collected or sent. |
| telemetry (default) | Analytics used for technical research and issue debugging. |
| full | Full analytics events. |
See all available options:
TonConnectUiOptionsWithManifest
TonConnectUiOptionsWithConnector
tonConnectUI.uiOptions = {
language: 'ru',
uiPreferences: {
theme: THEME.DARK
}
};
UI element will be rerendered after assignation. You should pass only options that you want to change.
Passed options will be merged with current UI options. Note, that you have to pass object to tonConnectUI.uiOptions to keep reactivity.
DON'T do this:
/* WRONG, WILL NOT WORK */ tonConnectUI.uiOptions.language = 'ru';
const walletsList = await tonConnectUI.getWallets();
/* walletsList is
{
name: string;
imageUrl: string;
tondns?: string;
aboutUrl: string;
universalLink?: string;
deepLink?: string;
bridgeUrl?: string;
jsBridgeKey?: string;
injected?: boolean; // true if this wallet is injected to the webpage
embedded?: boolean; // true if the dapp is opened inside this wallet's browser
}[]
*/
or
const walletsList = await TonConnectUI.getWallets();
"TonConnect UI connect button" (which is added at buttonRootId) automatically handles clicks and calls connect.
But you are still able to open "connect modal" programmatically, e.g. after click on your custom connect button.
await tonConnectUI.openModal();
This method opens the modal window and returns a promise that resolves after the modal window is opened.
If there is an error while modal opening, TonConnectUIError or TonConnectError will be thrown depends on situation.
tonConnectUI.closeModal();
This method closes the modal window.
This getter returns the current state of the modal window. The state will be an object with status and closeReason properties. The status can be either 'opened' or 'closed'. If the modal is closed, you can check the closeReason to find out the reason of closing.
const currentModalState = tonConnectUI.modalState;
To subscribe to the changes of the modal window state, you can use the onModalStateChange method. It returns a function which has to be called to unsubscribe.
const unsubscribeModal = tonConnectUI.onModalStateChange(
(state: WalletsModalState) => {
// update state/reactive variables to show updates in the ui
// state.status will be 'opened' or 'closed'
// if state.status is 'closed', you can check state.closeReason to find out the reason
}
);
Call unsubscribeModal() later to save resources when you don't need to listen for updates anymore.
The tonConnectUI provides methods for managing the modal window, such as openModal(), closeModal() and other, which are designed for ease of use and cover most use cases.
const { modal } = tonConnectUI;
// Open and close the modal
await modal.open();
modal.close();
// Get the current modal state
const currentState = modal.state;
// Subscribe and unsubscribe to modal state changes
const unsubscribe = modal.onStateChange(state => { /* ... */ });
unsubscribe();
While tonConnectUI internally delegates these calls to the modal, it is recommended to use the tonConnectUI methods for a more straightforward and consistent experience. The modal is exposed in case you need direct access to the modal window's state and behavior, but this should generally be avoided unless necessary.
The methods described in this section are marked as experimental and are subject to change in future releases.
To open a modal window for a specific wallet, use the openSingleWalletModal() method. This method accepts the wallet app_name as a parameter (please refer to the wallets-list.json) and opens the corresponding wallet modal. It returns a promise that resolves after the modal window is successfully opened.
await tonConnectUI.openSingleWalletModal('wallet_identifier');
To close the currently open specific wallet modal, use the closeSingleWalletModal() method:
tonConnectUI.closeSingleWalletModal();
To subscribe to the state changes of the specific wallet modal, use the onSingleWalletModalStateChange((state) => {}) method. It accepts a callback function that will be called with the current modal state.
const unsubscribe = tonConnectUI.onSingleWalletModalStateChange((state) => {
console.log('Modal state changed:', state);
});
// Call `unsubscribe` when you want to stop listening to the state changes
unsubscribe();
To get the current state of the specific wallet modal window, use the singleWalletModalState property:
const currentState = tonConnectUI.singleWalletModalState;
console.log('Current modal state:', currentState);
You can use special getters to read current connection state. Note that this getter only represents current value, so they are not reactive.
To react and handle wallet changes use onStatusChange method.
const currentWallet = tonConnectUI.wallet;
const currentWalletInfo = tonConnectUI.walletInfo;
const currentAccount = tonConnectUI.account;
const currentIsConnectedStatus = tonConnectUI.connected;
To subscribe to the changes of the connection status, you can use the onStatusChange method. It returns a function which has to be called to unsubscribe.
const unsubscribe = tonConnectUI.onStatusChange(
walletAndwalletInfo => {
// update state/reactive variables to show updates in the ui
}
);
Call unsubscribe() later to save resources when you don't need to listen for updates anymore.
Call to disconnect the wallet.
await tonConnectUI.disconnect();
Wallet must be connected when you call sendTransaction. Otherwise, an error will be thrown.
const transaction = {
validUntil: Math.floor(Date.now() / 1000) + 60, // 60 sec
messages: [
{
address: "EQBBJBB3HagsujBqVfqeDUPJ0kXjgTPLWPFFffuNXNiJL0aA",
amount: "20000000",
// stateInit: "base64bocblahblahblah==" // just for instance. Replace with your transaction initState or remove
},
{
address: "EQDmnxDMhId6v1Ofg_h5KR5coWlFG6e86Ro3pc7Tq4CA0-Jn",
amount: "60000000",
// payload: "base64bocblahblahblah==" // just for instance. Replace with your transaction payload or remove
}
]
};
// you can also include extra currencies in your transaction
const transactionWithExtraCurrency = {
validUntil: Math.floor(Date.now() / 1000) + 60,
messages: [
{
address: "EQBBJBB3HagsujBqVfqeDUPJ0kXjgTPLWPFFffuNXNiJL0aA",
// Specify the extra currency
extraCurrency: {
100: "10000000"
}
}
]
};
try {
const result = await tonConnectUI.sendTransaction(transaction);
// you can use signed boc to find the transaction
const someTxData = await myAppExplorerService.getTransaction(result.boc);
alert('Transaction was sent successfully', someTxData);
} catch (e) {
console.error(e);
}
You can pass a custom trace ID to track the transaction through your analytics:
const result = await tonConnectUI.sendTransaction(transaction, {
traceId: '019a2a92-a884-7cfc-b1bc-caab18644b6f' // optional, UUIDv7 auto-generated if not provided
});
console.log(result.traceId); // use this ID to correlate with analytics events
sendTransaction will automatically render informational modals and notifications. You can change its behavior:
const result = await tonConnectUI.sendTransaction(defaultTx, {
modals: ['before', 'success', 'error'],
notifications: ['before', 'success', 'error']
});
Default configuration is:
const defaultBehavior = {
modals: ['before'],
notifications: ['before', 'success', 'error']
}
You can also modify this behavior for all actions calls using uiOptions setter:
tonConnectUI.uiOptions = {
actionsConfiguration: {
modals: ['before', 'success', 'error'],
notifications: ['before', 'success', 'error']
}
};
Instead of raw messages, you can describe what to do — transfer TON, a jetton, or an NFT — and let the wallet build the message body (BoC) for you. Pass items instead of messages; the two are mutually exclusive in a single request.
import { comment } from '@ton/ton';
await tonConnectUI.sendTransaction({
validUntil: Math.floor(Date.now() / 1000) + 600,
network: '-239', // CHAIN.MAINNET; '-3' for testnet
items: [
// Native TON transfer
{
type: 'ton',
address: 'EQD4oN...wz7A',
amount: '5000000',
payload: comment('Hello, world!') // optional, base64 BoC
},
// Jetton (TEP-74) transfer — the wallet resolves the user's jetton wallet
// and builds the transfer body
{
type: 'jetton',
master: 'EQCxE6...Id_sDs', // jetton master address
amount: '1000000', // amount in jetton elementary units
destination: 'EQD4oN...wz7A'
},
// NFT (TEP-62) transfer
{
type: 'nft',
nftAddress: 'EQAcoW...qD8qM3T',
newOwner: 'EQD4oN...wz7A'
}
]
});
Structured items work only with wallets that advertise the matching SendTransaction.itemTypes. Restrict the wallet picker with walletsRequiredFeatures so only supporting wallets are shown:
const tonConnectUI = new TonConnectUI({
manifestUrl: 'https://<YOUR_APP_URL>/tonconnect-manifest.json',
walletsRequiredFeatures: {
sendTransaction: { itemTypes: ['ton', 'jetton', 'nft'] }
}
});
items are also accepted by signMessage. See StructuredItem for the full field reference.
Sign arbitrary data with the user's wallet. The wallet will display the data to the user for confirmation before signing. Wallet must be connected when you call signData, otherwise an error will be thrown.
You can sign three types of data. Choose the right format based on your use case:
Use when you need to sign human-readable text. The wallet displays the text to the user.
Parameters:
type (string, required): Must be "text"text (string, required): UTF-8 text to signnetwork (string, optional): "-239" for mainnet, "-3" for testnetfrom (string, optional): Signer address in raw format "0:<hex>"const textData = {
type: "text",
text: "Confirm new 2fa number:\n+1 234 567 8901",
network: "-239", // MAINNET = '-239', TESTNET = '-3'
from: "0:348bcf827469c5fc38541c77fdd91d4e347eac200f6f2d9fd62dc08885f0415f"
};
try {
const result = await tonConnectUI.signData(textData);
console.log('Signed:', result);
} catch (e) {
console.error('Error:', e);
}
You can also pass a trace ID to correlate with analytics:
const result = await tonConnectUI.signData(textData, {
traceId: '019a2a92-a884-7cfc-b1bc-caab18644b6f' // optional, UUIDv7 auto-generated if not provided
});
console.log(result.traceId); // use this ID to correlate with analytics events
Use for arbitrary binary data. The wallet shows a warning about unknown content.
Parameters:
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.