ton-api-v4

0

Описание

TON HTTP API v4

Языки

  • TypeScript99,2%
  • JavaScript0,4%
  • Dockerfile0,3%
  • Остальные0,1%
3 года назад
4 года назад
3 года назад
3 года назад
3 года назад
2 года назад
10 месяцев назад
10 месяцев назад
10 месяцев назад
README.md

TON API v4

Scallable and CDN-friendly HTTP API for TON blockchain.

API Endpoints

There are two public endpoints for this API:

Selfhosting

Easiest way to selfhost is to use docker:

Methods

Get latest block

GET /block/latest

Example

Get full block

GET /block/<seqno>

Example

Get block by unix time

GET /block/utime/<unix time>

Example

Get account state at block

GET /block/<seqno>/<address>

Example Active

Example Uninitialized

Example Frozen

Detect if account was changed

GET /block/<seqno>/<address>/changed/<since_lt>

Example

Run get method of account at block

NOTE: To pass arguments you need to serialize them into url-safe base64 serialization of BOC with stack. You can find implementation in

ton
library.

GET /block/<seqno>/<address>/run/<method>/<args?>

Example

Watch for new blocks

Open a WebSocket connection to

/block/watch
. And you will get notifications about current
seqno
, block time and server time. Server immediatelly sends current known block after opening a connection.

NOTE: This API doesn't guarantee that seqno always sequental. There are could be holes in sequences and apps have to adjust for them.

Example:

Watch for new blocks (extended)

Open a WebSocket connection to

/block/watch/changed
to get stream of new blocks. This endpoint behaves same way as a previous one.

Example:

Get config at block

GET /block/<seqno>/config/:ids

NOTE: you need to manually parse cell into dict with 32 bit integer keys.

Example

Get account transactions

GET /account/<address>/tx/:lt/:hash

NOTE: This method always returns at most 20 results. Example

License

MIT