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
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.
👍95
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
👍61
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
Instant appearance of pending transactions

Pending actions and transactions are now instantly available in the Pending API after message sending via Toncenter API.
👍31
New actions supported in Toncenter API

Multisig V2:

— Multisig order creation (multisig_create_order)

— Order approval (multisig_approve)

— Order execution (multisig_execute)

Vesting:

— Message sending (vesting_send_message)

— Adding to the whitelist (vesting_add_whitelist)

Evaa:

— Supply (evaa_supply)

— Withdraw (evaa_withdraw)

— Liquidation (evaa_liquidate)

Jvault:

— Stake (jvault_stake)

— Unstake (jvault_unstake)

— Claim (jvault_claim)

In addition, the current actions have been improved:

— Supported NFT discovery message (nft_discovery).

— A definition of unsuccessful TON transfer (ton_transfer) and Jetton transfer (jetton_transfer) has been added for cases where the execution failed on the sender's account (traces with a single transaction by an external message).

— Improved support for Jetton Mint action: added support for mints that run with opcode 0x00000015. Previously, only 0x642b7d07 was supported.

— Improved support for liquid staking (@stakee, Tonstakers) actions: added tokens_minted and tokens_burnt fields to deposit/withdrawal operations. Improved the method of calculating how many TON a user receives for burning tokens upon withdrawal. Added the definition of the pool address when burning NFT vouchers (deferred deposit withdrawal).

https://toncenter.com/api/v3/index.html#/actions/api_v3_get_actions
👍3
Versioning in the Actions API

We introduce versioning for actions in https://toncenter.com/api/v3/.

Specify the "supported_action_types" in methods api/v3/traces and api/v3/actions to desired version of action types and get the actions of supported types or set it to "latest" to get all newest actions from API v3.

Clients (e.g., wallet or blockchain explorers applications) can use it to receive the only actions that they support.

Version "v1":
— Basic: call_contract, contract_deploy, ton_transfer, tick_tock
— Jettons: jetton_burn, jetton_transfer, jetton_mint
— NFTs: nft_mint, nft_transfer, auction_bid
— DEXs: jetton_swap, dex_deposit_liquidity, dex_withdraw_liquidity
— Liquid staking: stake_deposit, stake_withdrawal, stake_withdrawal_request
— Elections: election_deposit, election_recover
— TON DNS: change_dns, delete_dns, renew_dns
— Subsctiptions: subscribe, unsubscribe

Version "v2":
— Multisig: multisig_create_order, multisig_approve, multisig_execute
— Vesting: vesting_send_message, vesting_add_whitelist
— EVAA: evaa_supply, evaa_withdraw, evaa_liquidate
— Jvault: jvault_stake, jvault_unstake, jvault_claim
— NFTs: nft_discovery

Version "latest": returns all newest action types.
👍4
Emulation and Pending API Updates

— In the Emulation API and Pending API, transaction chains are now emulated more accurately.
Previously, all transactions in a chain were emulated for a single block. Now, the emulator distributes transactions across different blocks (for example, an inter-shard message will occupy several blocks).
This allows for more accurate prediction of transaction order and results, as well as approximate timestamps and lt values for transactions, which makes it possible to estimate approximate execution times.

Emulation API: added address_book and metadata.
👍41
ton-http-api 2.0.54

Normalized hash of external messages supported.

https://github.com/toncenter/ton-http-api
👍3