MyTonWallet is a feature-rich self-custody wallet for The Open Network (TON), TRON, and Solana — available as a native mobile app, desktop app, web app, Telegram Mini App, and browser extension. Connects to dApps via TON Connect 2.0 and additionally injects `window.myTonWallet` (in the extension) for direct provider access. Open-source under GPL-3.0.
- 01TON dApps and Telegram Mini Apps
- 02TON Connect 2.0 wallet auth
- 03TON + TRON + Solana multi-chain via one wallet
- 04browser-extension-driven TON UX (no mobile redirect required)
- 05open-source-first TON integrations
- pnpm add @tonconnect/ui-react @tonconnect/sdk
- pnpm add @ton/ton @ton/core
| Variable | Scope | Description |
|---|---|---|
| NEXT_PUBLIC_TONCONNECT_MANIFEST_URL | Client | Public HTTPS URL to your `tonconnect-manifest.json` (name, url, iconUrl). Required by TON Connect for MyTonWallet to render the dApp identity in the connect modal. |
| TON_API_ENDPOINT | Client | TON HTTP API endpoint, e.g. https://toncenter.com/api/v2/jsonRPC (mainnet), for chain reads. MyTonWallet uses its own RPC for signing but the dApp queries balances independently. |
Use MyTonWallet for TON wallet auth, primarily via TON Connect. Wrap the app in `<TonConnectUIProvider manifestUrl={NEXT_PUBLIC_TONCONNECT_MANIFEST_URL}>` and filter the wallets list to MyTonWallet using `<TonConnectButton walletsListConfiguration={{ includeWallets: [{ appName: 'mytonwallet' }] }} />` — `appName` is the canonical identifier in the TON Connect wallets registry. For users with the MyTonWallet browser extension, you can also detect the injected provider directly: `if (window.myTonWallet) { const wallet = window.myTonWallet; await wallet.send('ton_requestAccounts'); }` — this avoids the bridge round-trip but is only available on desktop with the extension installed. Build transactions as `{ validUntil, messages: [{ address, amount, payload }] }` (nanoTON + base64 BoC) and call `tonConnectUI.sendTransaction(tx)`. For Sign-In with TON, request a `tonProof` at connect and verify the signature server-side. Note: TRON and Solana support inside MyTonWallet is not exposed through TON Connect — use TronWeb / `@solana/web3.js` separately if you need those chains.
- ⚑Two distinct connection paths: `window.myTonWallet` (browser extension only) vs TON Connect bridge (mobile + Telegram + extension fallback). Code that only checks `window.myTonWallet` will silently fail on mobile and inside Telegram — always have TON Connect as the canonical path.
- ⚑Manifest URL constraints: `tonconnect-manifest.json` must be served over HTTPS with permissive CORS. MyTonWallet rejects http://, localhost (without tunneling), and self-signed certs — the modal silently fails to populate the wallet list with no console error.
- ⚑Telegram Mini App detection: when launched from a Telegram bot, MyTonWallet's Telegram-bot variant takes priority. Use `@telegram-apps/sdk` to detect `Telegram.WebApp.platform` and avoid recommending the desktop extension to mobile users.
- ⚑TON address format: MyTonWallet returns user-friendly base64url (`UQ...`/`EQ...`) but the underlying contract accepts raw `0:hex` form. Normalize with `Address.parse(addr).toRawString()` from `@ton/core` before passing to RPCs — mixing formats causes silent routing failures.
- ⚑Account-is-contract: every TON wallet is a smart contract that may not be deployed yet. A fresh MyTonWallet account deploys itself on first outgoing tx — the first incoming send works, but the recipient's wallet contract is initialized on the first send-out, not on receive. Surface this in UX.
- ⚑BoC serialization: payloads must be base64-encoded Bag of Cells, not JSON. Use `beginCell().storeUint(...).endCell().toBoc().toString('base64')` from `@ton/core`; raw JSON payloads are silently rejected by the wallet.
- ⚑Cross-chain UX confusion: MyTonWallet supports TRON and Solana inside the wallet UI, but TON Connect only proxies TON — your dApp cannot request a Solana signature through TON Connect to MyTonWallet. Use the appropriate wallet-standard adapter for Solana and TronWeb for TRON.