Wallets allow the addition of custom RPC endpoints either by directly modifying the settings of an existing network or by adding a custom network and specifying a custom RPC endpoint.To obtain the address of your RPC endpoint, navigate to the node details on the Chainstack console and locate the Execution client HTTPS endpoint in the Access and credentials section.Note that there are different versions of TON wallets. This is because, essentially, any wallet is a smart contract running on the TON Blockchain. These smart contracts can be configured in different ways and may have different features.
This wallet does not offer an option to set custom RPC endpoints through the user interface. However, since the wallet is open-source, you can modify the RPC endpoint directly in the source code. Additionally, the wallet supports switching between different versions of wallet contracts.To switch to Testnet, go to Settings, click on the Tonkeeper Web icon 5 times, and then change the active network.
This wallet does not offer an option to set custom RPC endpoints through the user interface. However, since the wallet is open-source, you can modify the RPC endpoint directly in the source code. Additionally, the wallet supports switching between different versions of wallet contracts.To switch to Testnet, go to Settings, click on the MyTonWallet label 5 times, and then change the active network.
This wallet offers an option to set custom RPC endpoints through the user interface. It is an open-source MetaMask extension equivalent for TON. The wallet supports switching between different versions of wallet contracts.To set a custom RPC endpoint, navigate to Wallet Settings.To switch to Testnet, change the active network in the top menu of the wallet window.
This wallet does not offer an option to set custom RPC endpoints through the user interface. However, since the wallet is open-source, you can modify the RPC endpoint directly in the source code. The wallet doesn’t support switching between different versions of wallet contracts.
Cloud-based IDEs offer the flexibility to use injected providers. By adding a Chainstack RPC node to a wallet and connecting that wallet in your IDE, you can seamlessly interact with the network through the Chainstack node.There are also multiple TON-related plugins for various IDEs. You can find them on the Awesome List page or the TON Research page.
Note that there are two types of APIs available for interacting with the TON network. The TON HTTP API enables access to indexed blockchain information, providing a way to work with data efficiently. On the other hand, the TON ADNL API offers a secure communication method based on the ADNL protocol, ensuring reliable and protected interactions with the TON network.
Build DApps on the TON Blockchain using TonWeb and custom RPC nodes.Prerequisites
Node.js installed on your machine.
A package manager like npm or yarn.
Initialize a project
mkdir tonweb-projectcd tonweb-projectnpm init -y
Install TonWeb
npm install tonweb
Initialize connection with a Chainstack RPC Node
// For ES Module// import TonWeb from "tonweb";// For CommonJSconst TonWeb = require('tonweb');const rpcEndpoint = "YOUR_CHAINSTACK_RPC_ENDPOINT";const tonweb = new TonWeb(new TonWeb.HttpProvider(rpcEndpoint));tonweb.getBalance('EQ...').then(info => { console.log(info);});
Build DApps on the TON Blockchain using TonUtils and custom RPC nodes.Prerequisites
Go installed on your machine (version 1.16 or higher).
A Go package manager like go mod.
Initialize a project
go mod init go-tonproject
Please make sure that go.mod contains all required dependencies.Install TonUtils
go get github.com/xssnick/tonutils-go@latest
Initialize connection with a Chainstack RPC Node
package mainimport ( "context" "fmt" "log" "github.com/xssnick/tonutils-go/address" "github.com/xssnick/tonutils-go/liteclient" "github.com/xssnick/tonutils-go/ton")func main() { client := liteclient.NewConnectionPool() // Add a connection to a custom Lite Server using the global config URL err := client.AddConnectionsFromConfigUrl(context.Background(), "https://ton.org/global.config.json") if err != nil { log.Fatalf("Connection error: %v", err) } // Initialize the API client with proof check policy api := ton.NewAPIClient(client, ton.ProofCheckPolicyFast).WithRetry() // Create a context bound to a single TON node ctx := client.StickyContext(context.Background()) // Get the current masterchain block info block, err := api.CurrentMasterchainInfo(ctx) if err != nil { log.Fatalf("Error getting block info: %v", err) } // Specify the wallet address to check the balance walletAddr := address.MustParseAddr("EQ...") // Use WaitForBlock to ensure the block is ready account, err := api.WaitForBlock(block.SeqNo).GetAccount(ctx, block, walletAddr) if err != nil { log.Fatalf("Error getting account: %v", err) } // Display account information fmt.Printf("Is active: %v\n", account.IsActive) if account.IsActive { fmt.Printf("Status: %s\n", account.State.Status) fmt.Printf("Balance: %s TON\n", account.State.Balance.String()) }}
Initialize connection with a Chainstack RPC NodeCreate a new file named main.py in the project directory and add the following code:
import asyncioimport aiohttpfrom tonsdk.provider import ToncenterClient, prepare_address, address_statefrom tonsdk.utils import TonCurrencyEnum, from_nanoasync def get_wallet_balance(address: str): client = ToncenterClient(base_url="YOUR_CHAINSTACK_RPC_ENDPOINT", api_key="") address = prepare_address(address) async with aiohttp.ClientSession() as session: # Get the account state function and its arguments account_state_func = client.raw_get_account_state(address) # Invoke the function with the session account_state = await account_state_func['func'](session, *account_state_func['args'], **account_state_func['kwargs']) # Process the account state to get the balance account_state["state"] = address_state(account_state) if "balance" in account_state: if int(account_state["balance"]) < 0: account_state["balance"] = 0 else: account_state["balance"] = from_nano(int(account_state["balance"]), TonCurrencyEnum.ton) return account_state["balance"]address = "EQ..."balance = asyncio.run(get_wallet_balance(address))print(f"Balance: {balance} TON")