Prerequisites
Before enabling WalletConnect in your TON Connect application, ensure you have the following:1. TON Connect Project
You should have an existing TON Connect project initialized with the @tonconnect/sdk package. If you haven’t set up TON Connect yet, please refer to the TON Connect documentation to get started.2. WalletConnect Project ID
Create a new project on the WalletConnect Dashboard at https://dashboard.walletconnect.com and obtain a new project ID. You will need this project ID to initialize WalletConnect in your application.Don’t have a project ID?Head over to WalletConnect Dashboard and create a new project now!
Get started
3. Allowlist Your Domains
To help prevent malicious use of your project ID, you are strongly encouraged to set an allowlist of origins where your project ID is used. You can manage your allowlist in the WalletConnect Dashboard under the project settings. The allowlist supports a list of origins in the format[scheme://]<hostname[:port]>. Using localhost (or 127.0.0.1) is always permitted, and if the allowlist is empty, all origins are allowed. Updates take 15 minutes to apply.
Examples of possible origins in the allowlist:
example.com- allowshttps://example.comorhttp://example.combut nothttps://www.example.comhttps://example.com- allowshttps://example.combut nothttp://example.comhttps://*.example.com- allowshttps://www.example.combut nothttps://example.com
Enable WalletConnect
To enable WalletConnect in your TON Connect application, use theinitializeWalletConnect() function from the @tonconnect/sdk package along with the UniversalConnector from @reown/appkit-universal-connector.
Configuration Options
TheinitializeWalletConnect function accepts the following configuration options:
| Option | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | Your WalletConnect project ID from the Dashboard |
metadata.name | string | Yes | The name of your application |
metadata.description | string | Yes | A brief description of your application |
metadata.url | string | Yes | The URL of your application |
metadata.icons | string[] | Yes | An array of icon URLs for your application |