Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .cspell.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"ShardChain->shardchain",
"StateInit->`StateInit`",
"TLB->TL-B",
"TONAPI->TonAPI",
"Toncenter->TON Center",
"toncoins->Toncoin",
"Toncoins->Toncoin",
Expand Down
96 changes: 77 additions & 19 deletions ecosystem/api/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,92 @@ Access TON data via public liteservers, hosted APIs (TON Center v2/v3, TonAPI, d

## Comparison table

| Feature | Public liteservers | TON Center v2 | TON Center v3 | TonAPI | dTON |
| ------------------------- | ----------------------------------------------------------------------------------- | --------------------------------------------------- | -------------------------------------------------- | ---------------------------------------------------------------------------------------- | ------------------------------------------ |
| **Can be self-hosted?** | ✅ | ✅ | ✅ | ❌ | ❌ |
| **Open-source** | ✅ | ✅ | ✅ | 🟡 Limited<sup>1</sup> | ❌ |
| **Indexer**<sup>2</sup> | ❌ | ❌ | ✅ | ✅ | ✅ |
| **Archival**<sup>3</sup> | 🟡 Varies | 🟡 Depends on liteserver | ✅ | ✅ | ✅ |
| **Proofs**<sup>4</sup> | ✅ | ❌ | ❌ | ❌ | ❌ |
| **Mainnet endpoint** | [Config](https://ton-blockchain.github.io/global.config.json) | [Endpoint](https://toncenter.com/api/v2) | [Endpoint](https://toncenter.com/api/v3) | [Endpoint](https://tonapi.io/v2) | [GraphQL](https://dton.io/graphql) |
| **Testnet endpoint** | [Config](https://ton-blockchain.github.io/testnet-global.config.json) | [Endpoint](https://testnet.toncenter.com/api/v2) | [Endpoint](https://testnet.toncenter.com/api/v3) | [Endpoint](https://testnet.tonapi.io/v2) | [GraphQL](https://testnet.dton.io/graphql) |
| **Source / Deploy guide** | [Run node / liteserver](/ecosystem/nodes/cpp/setup-mytonctrl#liteserver-quickstart) | [Deploy](https://github.com/toncenter/ton-http-api) | [Source](https://github.com/toncenter/ton-indexer) | [OpenTonAPI](https://github.com/tonkeeper/opentonapi)<sup>1</sup> | — |
| **Documentation** | [Guide](/ecosystem/nodes/overview#interacting-with-ton-nodes) | [Docs](/ecosystem/api/toncenter/v2/overview) | [Docs](/ecosystem/api/toncenter/v3/overview) | [REST](https://docs.tonconsole.com/tonapi/rest-api), [Swagger](https://tonapi.io/api-v2) | [Site](https://docs.dton.io/) |

<sup>1</sup> TonAPI's full indexer is not open-source; [OpenTonAPI](https://github.com/tonkeeper/opentonapi) is a limited open-source version.
### Requests

| Feature | Public liteservers | TON Center v2 | TON Center v3 | TonAPI | dTON |
| ------------------------- | --------------------------------- | ------------------------ | --------------------- | --------------------------------------- | ----------------- |
| **Can be self-hosted?** | ✅ | ✅ | ✅ | ❌ | ❌ |
| **Open-source** | ✅ | ✅ | ✅ | 🟡 Limited<sup>1</sup> | ❌ |
| **Indexer**<sup>2</sup> | ❌ | ❌ | ✅ | ✅ | ✅ |
| **Archival**<sup>3</sup> | 🟡 Varies | 🟡 Depends on liteserver | ✅ | ✅ | ✅ |
| **Proofs**<sup>4</sup> | ✅ | ❌ | ❌ | ❌ | ❌ |
| **Mainnet endpoint** | [Config][c] | [Endpoint][etc-v2] | [Endpoint][etc-v3] | [Endpoint][eta-v2] | [GraphQL][edt] |
| **Testnet endpoint** | [Config][c-tn] | [Endpoint][etc-v2-tn] | [Endpoint][etc-v3-tn] | [Endpoint][eta-v2-tn] | [GraphQL][edt-tn] |
| **Source / Deploy guide** | [Run node / liteserver][ls-setup] | [Deploy][etc-v2-src] | [Source][etc-v3-src] | [OpenTonAPI][eta-oss-src]<sup>1</sup> | — |
| **Documentation** | [Guide][ls-doc] | [Docs][etc-v2-doc] | [Docs][etc-v3-doc] | [REST][eta-doc], [Swagger][eta-swagger] | [Site][edt-doc] |

<sup>1</sup> TonAPI's full indexer is not open-source; [OpenTonAPI][eta-oss-src] is a limited open-source version.

<sup>2</sup> **Indexer** means the service maintains its own database derived from blockchain data for richer queries (traces, jettons, NFTs, etc.), beyond raw liteserver RPC.

<sup>3</sup> **Archival** indicates historical data retention. For liteservers, this depends on the node's archival configuration; hosted indexers typically keep full history, but exact retention policies are service-specific.

<sup>4</sup> **Proofs** denote responses that can be verified without trust using cryptographic proofs from the network (liteserver/tonlib-based). HTTP indexers typically do not return proof bundles in their REST/GraphQL responses.

### Streaming

| Feature | TON Center Streaming API v2 | TonAPI Streaming API |
| -------------------------- | ------------------------------------------ | ------------------------------------------ |
| **Protocol compatibility** | Native reference implementation | Compatible with TON Center |
| **Mainnet endpoints** | [SSE][etc-sse], [WebSocket][etc-wss] | [SSE][eta-sse], [WebSocket][eta-wss] |
| **Testnet endpoints** | [SSE][etc-sse-tn], [WebSocket][etc-wss-tn] | [SSE][eta-sse-tn], [WebSocket][eta-wss-tn] |
| **Authentication** | [TON Center][etc-key] | [Ton Console][eta-key] |
| **Documentation** | [Docs][etc-stream-doc] | [Same as TON Center][etc-stream-doc] |

## References

- [TON node and liteserver source](https://github.com/ton-blockchain/ton)
- [Mainnet liteserver config](https://ton-blockchain.github.io/global.config.json), [testnet config](https://ton-blockchain.github.io/testnet-global.config.json)
- [Mainnet liteserver config][c], [testnet config][c-tn]
- [TON Center landing page](https://toncenter.com)
- [TON Center v2 (Python, older) source and deploy instructions](https://github.com/toncenter/ton-http-api)
- [TON Center v2 (Python, older) source and deploy instructions][etc-v2-src]
- [TON Center v2 (C++, newer) source and deploy instructions](https://github.com/toncenter/ton-http-api-cpp)
- [TON Center v3 source and deploy instructions](https://github.com/toncenter/ton-indexer)
- [TonAPI site](https://tonapi.io), [REST docs](https://docs.tonconsole.com/tonapi/rest-api), [Swagger](https://tonapi.io/api-v2)
- [OpenTonAPI (limited open-source)](https://github.com/tonkeeper/opentonapi)
- [dTON GraphQL](https://dton.io/graphql)
- [TON Center v3 source and deploy instructions][etc-v3-src]
- [TonAPI site](https://tonapi.io), [REST docs][eta-doc], [Swagger][eta-swagger]
- [OpenTonAPI (limited open-source)][eta-oss-src]
- [dTON GraphQL][edt]

{/* Config */}

[c]: https://ton-blockchain.github.io/global.config.json
[c-tn]: https://ton-blockchain.github.io/testnet-global.config.json

{/* TON Center */}

[etc-v2]: https://toncenter.com/api/v2
[etc-v2-tn]: https://testnet.toncenter.com/api/v2
[etc-v2-src]: https://github.com/toncenter/ton-http-api
[etc-v2-doc]: /ecosystem/api/toncenter/v2/overview
[etc-v3]: https://toncenter.com/api/v3
[etc-v3-tn]: https://testnet.toncenter.com/api/v3
[etc-v3-src]: https://github.com/toncenter/ton-indexer
[etc-v3-doc]: /ecosystem/api/toncenter/v3/overview
[etc-sse]: https://toncenter.com/api/streaming/v2/sse
[etc-sse-tn]: https://testnet.toncenter.com/api/streaming/v2/sse
[etc-wss]: wss://toncenter.com/api/streaming/v2/ws
[etc-wss-tn]: wss://testnet.toncenter.com/api/streaming/v2/ws
[etc-key]: /ecosystem/api/toncenter/get-api-key
[etc-stream-doc]: /ecosystem/api/toncenter/streaming/overview

{/* TON API */}

[eta-v2]: https://tonapi.io/v2
[eta-v2-tn]: https://testnet.tonapi.io/v2
[eta-oss-src]: https://github.com/tonkeeper/opentonapi
[eta-doc]: https://docs.tonconsole.com/tonapi/rest-api
[eta-swagger]: https://tonapi.io/api-v2
[eta-sse]: https://tonapi.io/streaming/v2/sse
[eta-sse-tn]: https://testnet.tonapi.io/streaming/v2/sse
[eta-wss]: wss://tonapi.io/streaming/v2/ws
[eta-wss-tn]: wss://testnet.tonapi.io/streaming/v2/ws
[eta-key]: https://tonconsole.com/tonapi/api-keys

{/* dTON */}

[edt]: https://dton.io/graphql
[edt-tn]: https://testnet.dton.io/graphql
[edt-doc]: https://docs.dton.io/

{/* Liteservers */}

[ls-setup]: /ecosystem/nodes/cpp/setup-mytonctrl#liteserver-quickstart
[ls-doc]: /ecosystem/nodes/overview#interacting-with-ton-nodes
9 changes: 9 additions & 0 deletions ecosystem/api/toncenter/streaming/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ Streaming API serves as a real-time, streaming version of the [indexed access la
The [API v2](/ecosystem/api/toncenter/v2/overview) and [API v3](/ecosystem/api/toncenter/v3/overview) include their major version numbers in their product names. For the Streaming API, `v2` means the current protocol version and doesn't refer to different APIs.
</Aside>

<Aside
type="note"
title="Compatibility with TonAPI"
>
TonAPI exposes compatible Streaming API endpoints for the same SSE and WebSocket protocol. The request fields, event types, and finality model documented on this page also apply there.

Authentication uses a [Ton Console API key](https://tonconsole.com/tonapi/api-keys).
</Aside>

## Event groups

The Streaming API emits the following event groups:
Expand Down
12 changes: 12 additions & 0 deletions ecosystem/api/toncenter/streaming/sse.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@ Send one `POST` request to the SSE endpoint with a JSON body that defines the su
- Mainnet: `https://toncenter.com/api/streaming/v2/sse`
- Testnet: `https://testnet.toncenter.com/api/streaming/v2/sse`

<Aside
type="note"
title="TonAPI endpoint compatibility"
>
TonAPI supports the same SSE subscription format on different endpoints:

- Mainnet: `https://tonapi.io/streaming/v2/sse`
- Testnet: `https://testnet.tonapi.io/streaming/v2/sse`

Authentication uses a [Ton Console API key](https://tonconsole.com/tonapi/api-keys).
</Aside>

### Request fields

<ParamField
Expand Down
12 changes: 12 additions & 0 deletions ecosystem/api/toncenter/streaming/wss.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@ Each request may include an optional `id` field for request and response correla
- Mainnet: `wss://toncenter.com/api/streaming/v2/ws`
- Testnet: `wss://testnet.toncenter.com/api/streaming/v2/ws`

<Aside
type="note"
title="TonAPI endpoint compatibility"
>
TonAPI supports the same WebSocket subscription format on different endpoints:

- Mainnet: `wss://tonapi.io/streaming/v2/ws`
- Testnet: `wss://testnet.tonapi.io/streaming/v2/ws`

Authentication uses a [Ton Console API key](https://tonconsole.com/tonapi/api-keys).
</Aside>

### Operations

#### `subscribe`
Expand Down
Loading
Loading