TON
The Open Network (TON) is a decentralized and open internet, created by the community using a technology designed by Telegram.Setting up a wallet
Install the Tonkeeper wallet extension in your browser and create your wallet. Then export your recovery phrase by going toSettings > Recovery Phrase. Enter your password and save your phrase.
Creating the SDK instance
You need a HTTP endpoint provider to access the TON network. We’ll use the endpoint provided by Orbs.com for that. Install the@orbs-network/ton-access package in your project to get started.
Connecting your wallet
You can connect your wallet using a mnemonic as follows:Getting your address
You can get your wallet address as follows:Creating a transaction
Now you can create a signed TON transfer transaction.tx will be a signed BOC buffer that can be sent to a DEMOS node for broadcasting.
Creating multiple transactions
You can create multiple transfer transactions using theprepareTransfers method.
Signing Messages
Cleaning up
You can remove your wallet and RPC connections as follows:Hacking
The DEMOS TON sdk is built on top of the TonJs library, and only provides a limited set of methods to interact with the TON blockchain. You can access the underlying TonJs objects to have more control over the transactions and interactions with the blockchain. Here is a list of the objects you can access:| Property | Type | Description |
|---|---|---|
instance.provider | TonClient | Provides read-only access to blockchain data |
instance.signer | KeyPair | Allows for signing and broadcasting transactions |
instance.wallet | WalletContractV4 | Manages the private key and signing operations |
Resources
- Official TON Website
- Official TON Docs
- Official TON JS Client
- Explore TON wallets
- Ton web JS client
- Tonviewer - TON Block explore