tonlib
to query data from liteservers and exposes it through a standard REST interface.
Base URLs
| API | Mainnet | Testnet |
|---|---|---|
| API v2 | https://toncenter.com/api/v2 | https://testnet.toncenter.com/api/v2 |
Versioning
API v2 uses semantic versioning in the formata.b.c (for example, 2.1.1):
| Segment | Example | Meaning |
|---|---|---|
| Major | 2.x.x | Fixed at 2 to avoid confusion (“API v2 v3.x.x”). Will not change. |
| Minor | 2.1.x | Implementation variant: 0 = Python version, 1 = C++ version. |
| Patch | 2.1.1 | Bumped with every release on GitHub. |
Typical use cases
- Query account balances and state
- Run get-methods on smart contracts
- Send or broadcast messages
- Retrieve latest transactions and block information
Endpoints
| Category | Method | Description |
|---|---|---|
| Accounts | GET /getAddressInformation | Get address information |
| Accounts | GET /getExtendedAddressInformation | Get extended address information |
| Accounts | GET /getWalletInformation | Get wallet information |
| Accounts | GET /getAddressBalance | Get address balance |
| Accounts | GET /getAddressState | Get address state |
| Accounts | GET /getTokenData | Get token data |
| Blocks | GET /getMasterchainInfo | Get masterchain info |
| Blocks | GET /getMasterchainBlockSignatures | Get masterchain block signatures |
| Blocks | GET /getShardBlockProof | Get shard block proof |
| Blocks | GET /getConsensusBlock | Get consensus block |
| Blocks | GET /lookupBlock | Lookup block |
| Blocks | GET /getShards | Get shards |
| Blocks | GET /getBlockHeader | Get block header |
| Blocks | GET /getOutMsgQueueSize | Get outbound message queue size |
| Transactions | GET /getBlockTransactions | Get block transactions |
| Transactions | GET /getBlockTransactionsExt | Get block transactions (extended) |
| Transactions | GET /getTransactions | Get transactions |
| Transactions | GET /getTransactionsStd | Get transactions (standard) |
| Transactions | GET /tryLocateTx | Try locate transaction |
| Transactions | GET /tryLocateResultTx | Try locate result transaction |
| Transactions | GET /tryLocateSourceTx | Try locate source transaction |
| Send | POST /sendBoc | Send BoC |
| Send | POST /sendBocReturnHash | Send BoC (return hash) |
| Send | POST /estimateFee | Estimate fee |
| Run method | POST /runGetMethod | Run get method |
| Run method | POST /runGetMethodStd | Run get method (standard) |
| Utils | GET /detectAddress | Detect address |
| Utils | GET /detectHash | Detect hash |
| Utils | GET /packAddress | Pack address |
| Utils | GET /unpackAddress | Unpack address |
| Configuration | GET /getConfigParam | Get config parameter |
| Configuration | GET /getConfigAll | Get all config parameters |
| Configuration | GET /getLibraries | Get libraries |
| RPC | POST /jsonRPC | JSON-RPC endpoint |