TONAPI and TON Console
11.9K subscribers
16 photos
1 file
40 links
Download Telegram
⚠️ Planned TON Console Update

When: 16 Feb, 06:30–08:30 UTC

Impact: Console may be unavailable for up to 2 hours during this window.

Services: Your products and APIs will continue running normally (no downtime expected).

Please plan accordingly — you won’t be able to access Console to manage products while the migration is in progress
❤7🔥4🕊1
🚀 Billing Update: USDT Top-Ups

We’ve rolled out an update that makes USDT the primary way to top up your balance and pay for services in TON Console.

What’s new
• Top up in USDT and pay for services in USDT
• Improved charge history with CSV export
• Multiple UX improvements across the Console

📝 TON top-ups will still be available only for projects with an existing TON balance at the time of the update.. Also, charges are deducted from one balance type only — you can’t split a single charge between TON and USDT.
❤14🔥9🐳7👍4🤓1
Help up become better.

We want to make TON Console better and more useful for everyone, and we’re currently collecting some feedback from users.

If you’ve used the console, we’d love to hear:
- what you like about it
- what feels confusing or inconvenient
- what features you think are missing

You can share your feedback through this short form
or just leave a comment under this post.

Any thoughts or suggestions would be really helpful
Thanks!
❤30🔥11👍10👏3🎉2
Toncoin → Gram

Following the approved network changes, TONAPI and Tonviewer now support the new currency naming: Gram.

We have made every effort to preserve backward compatibility wherever possible.

List of Changes

1. Both Variants Are Accepted in Input Parameters

The /v2/rates/chart endpoint now supports a new currency value:

* https://tonapi.io/v2/rates/chart?token=usdt&currency=ton&points_count=5
* https://tonapi.io/v2/rates/chart?token=usdt&currency=gram&points_count=5

The response returns the currency name exactly as specified in the request parameters.

2. New Fields for Gram

Throughout the TONAPI response schema https://tonapi.io/api-v2, Gram support has been added to all fields that previously referenced TON.

For example, in the GET /v2/multisig/{account_id} endpoint, the field orders[].risk.gram has been added alongside orders[].risk.ton.

Similarly, corresponding Gram fields have been introduced across other endpoints, such as:

* ton_balance + gram_balance
* and other TON-related fields.

3. `token_name` Value Changes

The token_name field now contains the value Gram instead of TON.

4. Other User-Facing Fields

In structures where fields are primarily intended for user-facing display, references to Toncoin have been changed to Gram.

For example, in the Action structure (used by endpoints such as /v2/accounts/{account_id}/events, /v2/gasless/estimate/{master_id}, and others):

* simple_preview.name: "Ton Transfer" → "Gram Transfer"
* simple_preview.description, prefix.simple_preview.value: "5 TON" → "5 Gram"
👍18🔥13❤12💩11🕊2
How to get all jettons? And what's changing in TONAPI?
In a nutshell
There are two main ways: TONAPI (the /v2/jettons method) and Tonconsole.com (CSV export).
When using the /v2/jettons method for pagination, it's recommended to use the cursor — the last_account_id parameter, which is taken from the previous response. It looks something like this:

% curl -s 'https://tonapi.io/v2/jettons?limit=10' | jq -r '.jettons | last | .metadata.address'
0:249936139b63719c0afc44f883f4d8c15fd53bc6f93b6244debcf92b3e6c3ce1
% curl -s 'https://tonapi.io/v2/jettons?limit=10&last_account_id=0:249936139b63719c0afc44f883f4d8c15fd53bc6f93b6244debcf92b3e6c3ce1' | jq -r '.jettons | last | .metadata.address'
0:31bb2214dca832dd8091d90adc313e9834782934263764810cb28fc7f8fb3878

In more detail

1. The /v2/jettons method allows you to get real-time data.

At the moment there are almost 1 million jettons on TON. One request lets you get 1000 data rows. Theoretically, on the Lite tier (10 RPS), you could download all jettons in about a minute and a half.

But this method had a problem — the offset parameter. Until recently, this method's execution time grew proportionally to the offset parameter. To maintain compatibility and ensure high performance, we carried out an optimization that uses a cached jetton list when offset is used. This list is updated once a day.

At the same time, we've added a new parameter — last_account_id. It provides a more correct and efficient way to paginate to the most up-to-date data.

2. For large exports like this, it may be more convenient to use Tonconsole.

For example, a query like SELECT d.account_id FROM getmethods.get_jetton_data d lets you get the full list of jettons. In Tonconsole you can enable scheduled export runs. The "Download CSV" link is stable, and you can quickly get a ready-made dataset with a single request from the backend (for the query above, that's 60 MB).

Feel free to ask question in comments ✍️
🔥3❤2🤔1
❗️`/v2/jettons/{addr}/holders` got pagination upgrade. offset parameter will be limited soon.

GetJettonHolders method was always returning holders sorted by their balance (starting from the top). It also had offset parameter that users can use to traverse the top 10k holders.

This approach has two problems:
1) inconsistency. Obviously, balances change constantly. So scanning data with limit+offset will get a lot of gaps due to volatile ordering
2) performance. Request time grows with the offset, because of how databases usually work

We've just made optimization to speed this method ⚡️4x times!

🎚️Introducing cursor

But O(n) is still O(n). So those who need real-time set of jetton holders can use new cursor-based pagination method, which has constant performance no matter what page it is.

So similarly to /v2/jettons, we introduce two new parameters to the GetJettonHolders method: sort_by and last_account_id.

Use /holders like before to get top holders (sort_by=balance is default). Offset can't be more than 9000.

Use /holders?sort_by=address to scan through the whole holders set. Here is how it looks:


# get first page
% time curl -s 'https://tonapi.io/v2/jettons/EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs/holders?sort_by=address' | jq -r '.addresses | last | .address'
0:9dfaaafbc46bad3c46d9362d8e5d99f993e953034212c5f34689cac419ea9d2c
curl -s 0.02s user 0.02s system 5% cpu 0.670 total

# get second page
% time curl -s 'https://tonapi.io/v2/jettons/EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs/holders?sort_by=address&last_account_id=0:9dfaaafbc46bad3c46d9362d8e5d99f993e953034212c5f34689cac419ea9d2c' | jq -r '.addresses | last | .address'
0:b6a096bdc189790abde43c11041f1f5a72daa92fa0ed24e918e7187515dce53b
curl -s 0.01s user 0.01s system 4% cpu 0.533 total


Have the set of holders of your jettons in real-time with these high-performance updates!
👍7❤6🌚3🕊2
Testnet flood, and how we manage it

Today testnet is receiving a huge performance benchmark. 🥵
Load has peaked at ~500 jetton transfer per second, about 1500 raw TPS.

This is about 30x of current mainnet baseline.

How TONAPI indexer was feeling?

We have two independent setup for testnet indexing. And with this flood we were lucky to see the difference between two setups under the performance load.
Because one of them just got a huge update ✨

The update is how we interact public liteservers and internal archive node to index data.

1) ⚖️ each liteserver performance and lag is measured to sustain nice and stable flow of blocks from the network
2) 🧮 account state is derived from block's merke update to minimize interaction with liteserver (they are usually unable to give account states during such load)

So how did it help. Well old indexer basically stuck for half an hour though it catches up quickly once liteservers are back alive. New indexer was behind the head of the blockchain at most 35 seconds - this only after sustained 30x mainnet load, and it recovers immediately once load gets down a little.

This shows continuing improvement and development of TONAPI to deliver our users most recent data as fast as possible even with future-proof performance.
❤11👍8🔥2🙏1
Get account's NFT history in 80 ms.

That's the new baseline we have just released.
🔥16❤14👌4🗿4🕊2
The new TON Console is ready to try!

We’ve refreshed the interface to make it easier to navigate and work with your projects.

Try the staging version here:
https://console.tonapi.io/

We’d love to hear your feedback!
🔥3💅2