Toncenter API
812 subscribers
6 photos
40 links
Updates and announcements of https://toncenter.com โ€” fast and reliable HTTP API for TON (The Open Network).

Bot @toncenter.

API is developed by the TON Core team @toncore.
Download Telegram
Toncenter Technical Support

If you find a bug or issue in Toncenter, you can report it to @toncenter_support. Messages are processed in order of priority.
๐Ÿ‘3
Mintless jettons support

Toncenter supports mintless jettons, check on preview.toncenter.com!

Now for jettons that allow mintless claim v3/jetton/wallets API returns additional field:

"mintless_info": {
"amount": "<amount-as-string>",
"start_from": <unix-timestamp>,
"expire_at": <unix-timestamp>
}


How to support mintless jettons in your dapp?
โ€” To show balance with mintless, use data["balance"] + data["mintless_info"]["amount"]
โ€” To autoclaim on transaction, when your dapp asks user to send outgoing jetton transfer via TonConnect, check if data["mintless_info"] is present and retrieve from mintless jetton claim api custom_payload and init_data to fill them in to transfer.
โ€” That's it. Now you support mintless jettons!


P.S. Note that now code_hash and data_hash fields can be null for not yet deployed jettons wallets.
๐Ÿ‘12โค11๐Ÿ‘Ž2๐Ÿ”ฅ2
Partial out of sync for API v3

We've faced out of sync for some of our indexer databases from 5:45utc to 8:15utc. Now the issue is fixed.
๐Ÿ‘Ž4โค3
We are pleased to announce that the mainnet API key bot is available at the new short username @toncenter.
๐Ÿ”ฅ4๐Ÿ‘3โค1
Due to network issues the API v3 was out of sync from 13:48UTC to 13:54UTC. Now, the API v3 is fully operational.
๐Ÿคฎ5๐Ÿค”2
Introducing the Domain API

Now the /accountStates method returns the .ton/.t.me domain bound to the specified account in the address_book field.

In other methods, such as transaction list, you will also find domains in address_book.

In case there are several domains bound to an account, the shortest one is returned.

Mainnet API
โค4
Introducing the Action API

The Toncenter Indexer now recognizes user-friendly actions among transaction series, such as staking, exchanging Jettons on DeDust DEX, or sending NFTs. A set of filters is available.

Supported Actions:

Basic
โ€” Toncoin transfer
โ€” Call contract
โ€” Contract deploy

System
โ€” Deposit stake to elector
โ€” Recover stake to elector
โ€” Tick-tock

Jettons
โ€” Transfer
โ€” Burn
โ€” Mint

NFT
โ€” Transfer
โ€” Mint

Nominator Pool
โ€” Deposit
โ€” Withdraw

@stakee/TonStakers
โ€” Deposit
โ€” Withdraw

DeDust DEX
โ€” Swap
โ€” Add liquidity
โ€” Withdraw liquidity

Ston-fi DEX
โ€” Swaps v1
โ€” Swaps v2
โ€” Add liquidity v2
โ€” Withdraw liquidity v2

NFT Auctions
โ€” Bidding (Fragment, ton.diamonds, Getgems)

TON DNS
โ€” Renew domain
โ€” Change DNS record
โ€” Delete DNS record

W4R2 Toncoin Subscriptions
โ€” Subscribe
โ€” Unsubscribe

The Toncenter team will continue to work and will be adding new action types in the next versions.

Also the /trace method now supports the incude_actions=true parameter, which will also return a list of actions related to this transaction series.

Mainnet API

Testnet API
โค4๐Ÿ”ฅ4
Introducing the Emulation API

Using this API you can simulate the result of sending a message to the blockchain, before sending it.

The API predicts not only raw transactions, but also recognizes known user-friendly actions among them.

This will allow the user to see what happens if they sign the send, as well as estimate the total fees.

Mainnet API

Testnet API
โค3
Support for extra-currencies in local ton-http-api

In ton-http-api v2.0.53, which you can install by yourself on your server, support for extra-currencies and a number of other improvements have been made.

Recall that earlier support for extra-currencies was made in the public Toncenter V2 and Toncenter V3 APIs.

https://github.com/toncenter/ton-http-api/releases/tag/v2.0.53
โค4
Improved Metadata API

Last month we started providing metadata for Jettons and NFTs in the V3 API.

We are pleased to report a number of improvements:

โ€” The metadata now enters the API in advance as soon as the token appears on the network. In the previous implementation, the metadata was indexed the first time the token was requested.

โ€” Images and JSON are now proxied via toncenter.com. 3 image sizes are available, as well as original non-proxied urls for JSON and images. IPFS is supported.
Using a proxy increases security (you don't make requests to third-party hosting) and speed of downloading resources.
๐Ÿ‘9โค5
Now you can get all .ton and .t.me domains bound to a specific wallet using the new /dns/records method.

https://toncenter.com/api/v3/index.html#/dns/api_v3_get_dns_records
๐Ÿ‘6โค1
Now /api/v3/jetton/wallets supports the jetton_address array[string] field and /api/v3/nft/items supports the collection_address array[string] field.

You can request selected user jettons or NFTs, for example to display the most popular ones.
The peer_swaps field has been added to the Action API for complex swaps on DEXes. This field contains information about intermediate swaps (exchanges).
Emulation API now uses the same response models for transactions, messages, and actions as Index API v3.

Additionally, is_incomplete flag has been added to indicate if the emulated trace was truncated due to size limits.
๐Ÿ‘5
Toncenter API supported hash of a normalized external message

API V3 (Index):

- hash_norm field added to the Message structure. If the field is not present, it means this message is not an external message, or the normalized hash_norm is equal to the regular hash.

- All methods with msg_hash parameter search also by normalized hash.

API V2:

- api/v2/sendBocReturnHash returns the normalized hash in addition to the normal hash.
๐Ÿ”ฅ2
Introducing the Pending API

Using this API you can track operations on the blockchain that have not yet completed.

As soon as an external message enters the blockchain, the Toncenter API Indexer notices it and builds a subsequent transaction series. Next, the action to be executed (e.g. "Swap on DeDust DEX") is recognized. As transactions are executed, the transaction series is re-indexed.

You can use this API to build responsive applications that respond quickly to user actions and show the progress of pending blockchain operations.

/api/v3/pendingActions

/api/v3/pendingTraces
๐Ÿ”ฅ9
Tonscan.org uses the Toncenter API

A great example of using the latest features of the Toncenter API is the popular blockchain explorer tonscan.org.

Using the Actions API, it shows user-understandable actions (such as โ€œSwap on DeDust DEXโ€ or โ€œDomain Renewโ€) instead of raw account transactions.

Using Pending API it displays a list of pending transactions. By opening such a pending transaction we can see its progress in real time.

In the next updates, the Tonscan.org team plans to further simplify the UI.
๐Ÿ”ฅ6๐Ÿ˜4๐Ÿ‘2๐Ÿฅด1
MyTonWallet uses the Toncenter API

Another impressive example is how the popular non-custodial wallet MyTonWallet has enhanced the โ€œActivity Feedโ€ tab with user activity history using Toncenter's Actions API.

https://tg-me.sbs/MyTonWalletEn/227
๐Ÿ‘9๐Ÿ”ฅ6๐Ÿ˜4
The Emulation API now supports the optional mc_block_seqno parameter. You can emulate a transaction chain for a specific masterchain block. Only recent masterchain blocks (~7 days) are supported.
๐Ÿ”ฅ3๐Ÿ‘1