Skip to main content

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 to Settings > 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.
Then create the SDK instance as follows:

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.
The 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 the preparePays 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:

Resources

  1. Official TON Website
  2. Official TON Docs
  3. Official TON JS Client
  4. Explore TON wallets
  5. Ton web JS client
  6. Tonviewer - TON Block explore

API Reference

https://kynesyslabs.github.io/demosdk-api-ref/classes/xmwebsdk.TON.html