diff --git a/docs/v3/guidelines/dapps/apis-sdks/api-types.md b/docs/v3/guidelines/dapps/apis-sdks/api-types.md index 58310e1307c..6edc73874f1 100644 --- a/docs/v3/guidelines/dapps/apis-sdks/api-types.md +++ b/docs/v3/guidelines/dapps/apis-sdks/api-types.md @@ -1,26 +1,26 @@ -# API Types +# API types -**High availability blockchain APIs are the core element of secure, convenient and fast development of useful applications on TON.** +**High availability blockchain APIs are essential for developing secure, efficient, and scalable applications on TON.** -- [TON HTTP API](/v3/guidelines/dapps/apis-sdks/ton-http-apis) — API that allows to work with the _indexed blockchain information_. -- [TON ADNL API](/v3/guidelines/dapps/apis-sdks/ton-adnl-apis) — secure API to communicate with TON, based on ADNL protocol. +- [TON HTTP API](/v3/guidelines/dapps/apis-sdks/ton-http-apis) — An API that allows working with the _indexed blockchain information_. +- [TON ADNL API](/v3/guidelines/dapps/apis-sdks/ton-adnl-apis) — A secure API for communicating with TON using the ADNL protocol. :::tip TON Infrastructure Status -* [status.toncenter](https://status.toncenter.com/) - various statistics of nodes activity during the last hour. -* [Tonstat.us](https://tonstat.us/) - a real-time Grafana, updated every 5 minutes. +* [status.toncenter](https://status.toncenter.com/) - Displays various node activity statistics from the last hour. +* [Tonstat.us](https://tonstat.us/) - A real-time Grafana dashboard, updated every 5 minutes. ::: ## Toncenter APIs -- [TON Index](https://toncenter.com/api/v3/) - TON Index collects data from a full node to PostgreSQL database and provides convenient API to an indexed blockchain. -- [toncenter/v2](https://toncenter.com/) - This API enables HTTP access to TON blockchain - getting accounts and wallets information, looking up blocks and transactions, sending messages to the blockchain, calling get methods of smart contracts, and more. +- [TON Index](https://toncenter.com/api/v3/) - Collects data from a full node into a PostgreSQL database and provides a convenient API for accessing indexed blockchain data. +- [toncenter/v2](https://toncenter.com/) - Enables HTTP access to TON Blockchain, allowing developers to retrieve account and wallet information, look up blocks and transactions, send messages to the blockchain, call smart contract methods, and more. -## Third party APIs -- [tonapi.io](https://docs.tonconsole.com/tonapi) - fast indexed API which provides basic data about accounts, transactions, blocks, application-specific data about NFT, Auctions, Jettons, TON DNS, Subscriptions. It also provides annotated data on transaction chains. -- [TONX API](https://docs.tonxapi.com/) - an API specifically designed for seamless Dapp development, enabling easy access to a variety of tools and data. -- [dton.io](https://dton.io/graphql/) - GraphQL API with that can provide data about accounts, transactions and blocks, as well as application-specific data about NFT, Auctions, Jettons and TON DNS. -- [ton-api-v4](https://mainnet-v4.tonhubapi.com) - another lite-api focused on speed via aggressive cashing in CDN. -- [docs.nftscan.com](https://docs.nftscan.com/reference/ton/model/asset-model) - NFT APIs for TON blockchain. -- [everspace.center](https://everspace.center/toncoin) - Simple RPC API for accessing TON Blockchain. +## Third-party APIs +- [tonapi.io](https://docs.tonconsole.com/tonapi) - A fast indexed API that provides basic data about accounts, transactions, blocks, application-specific data about NFT, auctions, jettons, TON DNS, and subscriptions. It also offers annotated transaction chain data. +- [TONX API](https://docs.tonxapi.com/) - Designed for seamless dApp development, this API provides easy access to various tools and data. +- [dton.io](https://dton.io/graphql/) - A GraphQL API that delivers data on accounts, transactions, and blocks, as well as application-specific data about NFT, auctions, jettons, and TON DNS. +- [ton-api-v4](https://mainnet-v4.tonhubapi.com) - A lightweight API optimized for speed through aggressive CDN caching +- [docs.nftscan.com](https://docs.nftscan.com/reference/ton/model/asset-model) - NFT APIs for TON Blockchain. +- [everspace.center](https://everspace.center/toncoin) - A simple RPC API for accessing TON Blockchain. ## Additional APIs @@ -32,15 +32,15 @@ * https://apiguide.coingecko.com/getting-started -### Address Convert APIs +### Address convert APIs :::info -It is preferable to convert address via local algorithm, read more in the [Addresses](/v3/documentation/smart-contracts/addresses) section of documentation. +It is preferable to convert addresses using a local algorithm. See [Addresses](/v3/documentation/smart-contracts/addresses) section of documentation for details. ::: -#### From Friendly to Raw form +#### From friendly to raw form /api/v2/unpackAddress @@ -59,7 +59,7 @@ Response body } ``` -#### From Friendly to Raw form +#### From friendly to raw form /api/v2/packAddress @@ -80,7 +80,7 @@ Response body -## See Also +## See also * [TON HTTP API](/v3/guidelines/dapps/apis-sdks/ton-http-apis) * [List of SDKs](/v3/guidelines/dapps/apis-sdks/sdk) -* [TON Cookbook](/v3/guidelines/dapps/cookbook) +* [TON cookbook](/v3/guidelines/dapps/cookbook) diff --git a/docs/v3/guidelines/dapps/apis-sdks/overview.md b/docs/v3/guidelines/dapps/apis-sdks/overview.md index d0e5e5832c7..2db1203ef1c 100644 --- a/docs/v3/guidelines/dapps/apis-sdks/overview.md +++ b/docs/v3/guidelines/dapps/apis-sdks/overview.md @@ -1,41 +1,40 @@ # Overview -The purpose of this article is to help you choose the right tools for application development in TON ecosystem. +This article helps you choose the right tools for application development in TON Ecosystem. ## TMA development * Use [Mini Apps SDKs](/v3/guidelines/dapps/tma/overview#mini-apps-sdks) for [Telegram Mini Apps](/v3/guidelines/dapps/tma/overview) development. -* Choose [JS/TS-based SDK](/v3/guidelines/dapps/apis-sdks/sdk#typescript--javascript) for interacting with TON blockchain. +* Choose [JS/TS-based SDK](/v3/guidelines/dapps/apis-sdks/sdk#typescript--javascript) to interact with TON Blockchain. ## DApps development -* Use Tolk, FunC or Tact [programming languages](/v3/documentation/smart-contracts/overview#programming-languages) for TON blockchain smart contracts development for your [DApp](/v3/guidelines/dapps/overview) if needed. -* To interacts with TON blockchain and process its data choose listed [SDK](/v3/guidelines/dapps/apis-sdks/sdk). One of the most popular languages for this purpose are: - * [JS/TS](/v3/guidelines/dapps/apis-sdks/sdk#typescript--javascript) +* Use Tolk, FunC, or Tact [programming languages](/v3/documentation/smart-contracts/overview#programming-languages) to develop TON Blockchain smart contracts for your [dApp](/v3/guidelines/dapps/overview). +* To interacts with TON Blockchain and process its data, choose one of the listed [SDKs](/v3/guidelines/dapps/apis-sdks/sdk). One of the most popular languages for this purpose include: + * [JavaScript/TypeScript](/v3/guidelines/dapps/apis-sdks/sdk#typescript--javascript) * [Go](/v3/guidelines/dapps/apis-sdks/sdk#go) * [Python](/v3/guidelines/dapps/apis-sdks/sdk#python) -* To integrate user authentication with their TON Wallets (also payments processing logic) into your DApp use [TON Connect](/v3/guidelines/ton-connect/overview). +* To integrate user authentication and payments processing via with their TON wallets, use [TON Connect](/v3/guidelines/ton-connect/overview). ## TON data analytics -Quite often developers need to perform analytical queries on top of on-chain data: for example to track historical changes and aggregate data from multiple accounts. -Blockchains are not designed for this kind of workload and one need to build indexing pipeline and run analytical queries off-chain. Building such pipelines -from scratch could be resource-consuming so one can use one of the following alternatives: -* [Dune Analytics](https://dune.com/queries?category=canonical&namespace=ton) has a set of tables with TON data: raw transactions and messages, jetton events and DEX trades. Dune allows to build custom charts and dashboard, fetch query results via API and configure alerts. Before starting with writting queries please check [this guide](https://dune.com/ton_foundation/ton-quick-start) for best practices, tips and tricks. -* Dune integration is powered by the Public Data Lake from the [ton-etl](https://github.com/re-doubt/ton-etl/blob/main/datalake/README.md) project. It is a parsing and decoding pipeline -which dumps raw and decode data into S3 bucket __s3://ton-blockchain-public-datalake/v1/__ in AVRO format. The bucket is publicly available and everyone can use it with tools like [Amazon Athena](https://aws.amazon.com/athena/) (see [DDLs](https://github.com/re-doubt/ton-etl/blob/main/datalake/athena_ddl.sql)) or Apache Spark. The data is updated on the daily basis. -* If you need to track on-chain data in near real-time you can run your own [Ton Node](/v3/documentation/infra/nodes/node-types) and launch [ton-etl](https://github.com/re-doubt/ton-etl/blob/main/README.md) or [ton-index-worker](https://github.com/toncenter/ton-index-worker). -* [chainbase](https://docs.chainbase.com/catalog/Ton/Overview) comes with a set of raw and decoded tables with TON data. It allows to run SQL queries and fetch results via API. +Developers often need to run analytical queries on top of on-chain data—for example, to track historical changes and aggregate data from multiple accounts. +Since blockchains are not designed for analytical workloads, you need to build an indexing pipeline and run off-chain analytical queries. Creating such pipelines +from scratch can be resource-consuming, so you can use one of these alternatives: +* [Dune analytics](https://dune.com/queries?category=canonical&namespace=ton) provides tables with TON data, including raw transactions and messages, jetton events, and DEX trades. Dune allows building custom charts and dashboards, fetch query results via API and set up alerts. Before writing queries, check [this guide](https://dune.com/ton_foundation/ton-quick-start) for best practices, tips, and tricks. +* Dune integration is runs on the public data lake from the [ton-etl](https://github.com/re-doubt/ton-etl/blob/main/datalake/README.md) project. This parsing and decoding pipeline dumps raw and decoded data into an S3 bucket __s3://ton-blockchain-public-datalake/v1/__ in AVRO format. The bucket is publicly available and everyone can use it with [Amazon Athena](https://aws.amazon.com/athena/) (see [DDLs](https://github.com/re-doubt/ton-etl/blob/main/datalake/athena_ddl.sql)) or Apache Spark. The data updates daily. +* If you need real-time on-chain data tracking, you can run your own [Ton Node](/v3/documentation/infra/nodes/node-types) and launch [ton-etl](https://github.com/re-doubt/ton-etl/blob/main/README.md) or [ton-index-worker](https://github.com/toncenter/ton-index-worker). +* [Chainbase](https://docs.chainbase.com/catalog/Ton/Overview) offers a set of raw and decoded tables with TON data. It allows you to run SQL queries and fetch results via API. -## Infrastructure Status +## Infrastructure status -* [status.toncenter](https://status.toncenter.com/) - various statistics of nodes activity during the last hour. -* [Tonstat.us](https://tonstat.us/) - a real-time Grafana, updated every 5 minutes. +* [status.toncenter](https://status.toncenter.com/) - Displays various node activity statistics from the last hour. +* [Tonstat.us](https://tonstat.us/) - A real-time Grafana dashboard, updated every 5 minutes. -## See Also +## See also * [SDKs](/v3/guidelines/dapps/apis-sdks/sdk) -* [TMA Tutorials](/v3/guidelines/dapps/tma/tutorials/step-by-step-guide) -* [TON Connect Tutorials](/v3/guidelines/ton-connect/guidelines/how-ton-connect-works) -* [Payments Processing](/v3/guidelines/dapps/asset-processing/payments-processing) +* [TMA tutorials](/v3/guidelines/dapps/tma/tutorials/step-by-step-guide) +* [TON Connect tutorials](/v3/guidelines/ton-connect/guidelines/how-ton-connect-works) +* [Payments processing](/v3/guidelines/dapps/asset-processing/payments-processing) diff --git a/docs/v3/guidelines/dapps/apis-sdks/sdk.mdx b/docs/v3/guidelines/dapps/apis-sdks/sdk.mdx index 295372ba584..8407c8bb859 100644 --- a/docs/v3/guidelines/dapps/apis-sdks/sdk.mdx +++ b/docs/v3/guidelines/dapps/apis-sdks/sdk.mdx @@ -1,25 +1,26 @@ # SDKs -Instantly navigate to your preferred language using the right sidebar. +Easily navigate to your preferred programming language using the right sidebar. + ## Overview -There are different ways to connect to blockchain: -1. RPC data provider or other API: in most cases, you have to *rely* on its stability and security. -2. ADNL connection: you're connecting to a [liteserver](/v3/guidelines/nodes/running-nodes/liteserver-node). They might be inaccessible, but with a certain level of validation (implemented in the library), cannot lie. -3. Tonlib binary: you're connecting to liteserver as well, so all benefits and downsides apply. However, your application also contains a dynamic-loading library compiled outside. -4. Offchain-only. These SDKs enable the creation and serialization of cells, which can be transmitted to APIs. +There are different ways to connect to the blockchain: +1. RPC data provider or other API – Requires stability and security from a third-party service. +2. ADNL connection - Connects to a [liteserver](/v3/guidelines/nodes/running-nodes/liteserver-node). While it may be inaccessible at times, it cannot provide false data due to built-in validation. +3. Tonlib binary - Also connects to a liteserver, inheriting the same advantages and limitations. However, your application includes a dynamically loaded library compiled externally. +4. Offchain-only - These SDKs allow you to create and serialize cells, which can then be sent to APIs. ### TypeScript / JavaScript | Library | Blockchain connection | Description | |---------|------------------|--------------| -|[ton](https://github.com/ton-org/ton)|via RPC ([Orbs](https://www.orbs.com/ton-access/) / [Toncenter](https://toncenter.com/api/v2/) / etc)|Convenient client library with wallet wrappers for development dApps on TON Blockchain.| +|[ton](https://github.com/ton-org/ton)|via RPC ([Orbs](https://www.orbs.com/ton-access/) / [Toncenter](https://toncenter.com/api/v2/) / etc)|Convenient client library with wallet wrappers for developing dApps on TON Blockchain.| |[tonweb](https://github.com/toncenter/tonweb)|via RPC ([Orbs](https://www.orbs.com/ton-access/) / [Toncenter](https://toncenter.com/api/v2/) / etc)|Old-style TON JS SDK, with minimal external dependencies, extensively tested in production.| |[tonkite/adnl](https://github.com/tonkite/adnl)|[ADNL](/v3/documentation/network/protocols/adnl/adnl-tcp) natively / via WebSocket| ADNL TypeScript implementation. | -|[tonutils](https://github.com/thekiba/tonutils)|Native [ADNL](/v3/documentation/network/protocols/adnl/adnl-tcp)| TypeScript-based interface for building and interacting with applications in TON Ecosystem. Due to native ADNL dependency, cannot be used for blockchain interaction in browser.| -|[foton](https://foton.sh/)|via RPC ([Orbs](https://www.orbs.com/ton-access/) / [Toncenter](https://toncenter.com/api/v2/) / etc)|TypeScript toolkit for interacting with TON wallets and blockchain as a whole. The library wraps existing solutions (Blueprint and TON Connect) into one comfortable API.| +|[tonutils](https://github.com/thekiba/tonutils)|Native [ADNL](/v3/documentation/network/protocols/adnl/adnl-tcp)| TypeScript-based interface for TON application development. Due to native ADNL dependency, it cannot be used in browsers.| +|[foton](https://foton.sh/)|via RPC ([Orbs](https://www.orbs.com/ton-access/) / [Toncenter](https://toncenter.com/api/v2/) / etc)|TypeScript toolkit for interacting with TON wallets and blockchain. Wraps existing solutions (Blueprint and TON Connect) into one API.| ### Java | Library | Blockchain connection | Description | @@ -33,15 +34,15 @@ There are different ways to connect to blockchain: | Library | Blockchain connection | Description | |---------|------------------|--------------| -|[pytoniq](https://github.com/yungwine/pytoniq) |Native ADNL| Python SDK with native LiteClient and other ADNL-based protocols implementations. | -|[pytoniq-core](https://github.com/yungwine/pytoniq-core) | *offchain-only* | Python powerful transport-free SDK | -|[tonutils](https://github.com/nessshon/tonutils) | via RPC ([TONAPI](https://tonapi.io/api-v2) / [Toncenter](https://toncenter.com/api/v3/)) / Native ADNL ([pytoniq](https://github.com/yungwine/pytoniq))| Tonutils is a high-level object-oriented library for Python designed to facilitate interactions with the TON blockchain | -|[pytonlib](https://github.com/toncenter/pytonlib)|Tonlib binary| This is a standalone Python library based on libtonlibjson, brought as a binary dependency from TON monorepo. | +|[pytoniq](https://github.com/yungwine/pytoniq) |Native ADNL| Python SDK with native LiteClient and other ADNL-based protocols. | +|[pytoniq-core](https://github.com/yungwine/pytoniq-core) | *offchain-only* | Transport-free, powerful SDK. | +|[tonutils](https://github.com/nessshon/tonutils) | via RPC ([TONAPI](https://tonapi.io/api-v2) / [Toncenter](https://toncenter.com/api/v3/)) / Native ADNL ([pytoniq](https://github.com/yungwine/pytoniq))| High-level OOP library for interacting with TON Blockchain. | +|[pytonlib](https://github.com/toncenter/pytonlib)|Tonlib binary| Standalone Python library based on libtonlibjson. | |[mytonlib](https://github.com/igroman787/mytonlib)|Native ADNL| Native Python SDK library for working with The Open Network | -|[TonTools](https://github.com/yungwine/TonTools)|via RPC ([Orbs](https://www.orbs.com/ton-access/) / [Toncenter](https://toncenter.com/api/v2/) / etc)|TonTools is a high-level OOP library for Python, which can be used to interact with TON Blockchain.| -|[tonpy](https://github.com/disintar/tonpy)|Native ADNL| Python package that provides data structures and API to interact with TON blockchain. | -|[tvm_valuetypes](https://github.com/toncenter/tvm_valuetypes)|*offchain-only*| library is collection of utilities for handling TVM types. | -|[pytvm](https://github.com/yungwine/pytvm) | *offchain* | Python TVM emulator using bindings to C++ standard emulator | +|[TonTools](https://github.com/yungwine/TonTools)|via RPC ([Orbs](https://www.orbs.com/ton-access/) / [Toncenter](https://toncenter.com/api/v2/) / etc)|High-level OOP Python library for interacting with TON.| +|[tonpy](https://github.com/disintar/tonpy)|Native ADNL| PPython package providing TON Blockchain interaction. | +|[tvm_valuetypes](https://github.com/toncenter/tvm_valuetypes)|*offchain-only*| Utilities for handling TVM types. | +|[pytvm](https://github.com/yungwine/pytvm) | *offchain* | Python TVM emulator using C++ bindings. | ### C# @@ -49,24 +50,24 @@ There are different ways to connect to blockchain: | Library | Blockchain connection | Description | |---------|------------------|--------------| |[TonSdk.NET](https://github.com/continuation-team/TonSdk.NET)|Native ADNL or RPC|Native C# SDK for The Open Network. | -|[justdmitry/TonLib.NET](https://github.com/justdmitry/TonLib.NET) |Tonlib binary|.NET SDK for The Open Network, connecting via libtonlibjson brought as a binary dependency from TON monorepo.| +|[justdmitry/TonLib.NET](https://github.com/justdmitry/TonLib.NET) |Tonlib binary|.NET SDK for The Open Network, connecting via libtonlibjson.| ### Rust | Library | Blockchain connection | Description | |---------|------------------|--------------| -|[tonlib-rs](https://github.com/ston-fi/tonlib-rs)|Tonlib binary| Rust SDK for The Open Network, bringing binary dependency from TON monorepo.| -|[getgems-io/ton-grpc](https://github.com/getgems-io/ton-grpc)|Tonlib binary| Rust bindings for tonlibjson (thus, depending on binary from TON monorepo) and services built on top of it | +|[tonlib-rs](https://github.com/ston-fi/tonlib-rs)|Tonlib binary| Rust SDK for TON, using binary dependency from TON monorepo.| +|[getgems-io/ton-grpc](https://github.com/getgems-io/ton-grpc)|Tonlib binary| Rust bindings for tonlibjson with additional services.| ### Go | Library | Blockchain connection | Description | |---------|------------------|--------------| -|[tonutils-go](https://github.com/xssnick/tonutils-go)|Native ADNL|Golang library for interacting with TON blockchain| -|[tongo](https://github.com/tonkeeper/tongo)|Native ADNL|Go implementation of libraries for TON blockchain| -|[tonlib-go](https://github.com/ton-blockchain/tonlib-go)|Tonlib binary|Official bindings for libtonlibjson| +|[tonutils-go](https://github.com/xssnick/tonutils-go)|Native ADNL|Golang library for interacting with TON.| +|[tongo](https://github.com/tonkeeper/tongo)|Native ADNL|Go implementation of TON Blockchain libraries.| +|[tonlib-go](https://github.com/ton-blockchain/tonlib-go)|Tonlib binary|Official bindings for libtonlibjson.| ### SDKs for other languages @@ -74,11 +75,11 @@ There are different ways to connect to blockchain: | Library | Language | Blockchain connection | Description | |---------|----------|-------|--------------| |[ton-kotlin](https://github.com/ton-community/ton-kotlin)|Kotlin|Native ADNL |Kotlin/Multiplatform SDK for The Open Network.| -|[tonlib-java](https://github.com/ton-blockchain/tonlib-java) | Java | Tonlib bin | JVM wrapper for TonLib that can be used with Java/Scala/Kotlin/etc.| +|[tonlib-java](https://github.com/ton-blockchain/tonlib-java) | Java | Tonlib bin | JVM wrapper for TonLib, usable with Java, Scala, Kotlin, etc.| |[ayrat555/ton](https://github.com/ayrat555/ton) | Elixir | *offchain-only* | TON SDK for Elixir.| -|[C++ Tonlib](https://github.com/ton-blockchain/ton/tree/master/example/cpp)|C++|Tonlib binary|Official examples on smart contract interaction in TON monorepo|. -|[Java Tonlib](https://github.com/ton-blockchain/tonlib-java)|Java|Tonlib binary|Official examples on smart contract interaction in TON monorepo.| -|[labraburn/SwiftyTON](https://github.com/labraburn/SwiftyTON)|Swift|Tonlib binary|Native Swift wrapper for tonlib with async/await.| -|[tonlib-xcframework](https://github.com/labraburn/tonlib-xcframework)|Swift|Tonlib binary|Tonlib build helper for iOS, all architectures.| +|[C++ Tonlib](https://github.com/ton-blockchain/ton/tree/master/example/cpp)|C++|Tonlib binary|Official examples on smart contract interaction from the TON monorepo.|. +|[Java Tonlib](https://github.com/ton-blockchain/tonlib-java)|Java|Tonlib binary|Official Java-based examples from the TON monorepo.| +|[labraburn/SwiftyTON](https://github.com/labraburn/SwiftyTON)|Swift|Tonlib binary|Native Swift wrapper for tonlib with async/await support.| +|[tonlib-xcframework](https://github.com/labraburn/tonlib-xcframework)|Swift|Tonlib binary|Tonlib build helper for iOS, supporting all architectures.| |[labraburn/node-tonlib](https://github.com/labraburn/node-tonlib)|NodeJS|Tonlib binary|C++ addon for NodeJS to work with tonlibjson.| -|[olifanton/ton](https://github.com/olifanton/ton)|PHP|via RPC ([Orbs](https://www.orbs.com/ton-access/) / [Toncenter](https://toncenter.com/api/v2/) / etc)|PHP SDK with a set of standard primitives and contracts.| +|[olifanton/ton](https://github.com/olifanton/ton)|PHP|via RPC ([Orbs](https://www.orbs.com/ton-access/) / [Toncenter](https://toncenter.com/api/v2/) / etc)|PHP SDK with TON primitives and smart contract tools.| diff --git a/docs/v3/guidelines/dapps/apis-sdks/ton-adnl-apis.md b/docs/v3/guidelines/dapps/apis-sdks/ton-adnl-apis.md index 47882eeb9da..ddc57e72c62 100644 --- a/docs/v3/guidelines/dapps/apis-sdks/ton-adnl-apis.md +++ b/docs/v3/guidelines/dapps/apis-sdks/ton-adnl-apis.md @@ -1,39 +1,38 @@ # TON ADNL API -There are different ways to connect to blockchain: -1. RPC data provider or another API: in most cases, you have to *rely* on its stability and security. -2. **ADNL connection**: you're connecting to a [liteserver](/v3/guidelines/nodes/running-nodes/liteserver-node). They might be inaccessible, but with a certain level of validation (implemented in the library), cannot lie. -3. Tonlib binary: you're connecting to liteserver as well, so all benefits and downsides apply, but your application also contains a dynamic-loading library compiled outside. -4. Offchain-only. Such SDKs allow to create and serialize cells, which you can then send to APIs. +There are several ways to connect to blockchain: +1. RPC data provider or another API - In most cases, you must *rely* on its stability and security. +2. **ADNL connection** - You connect to a [liteserver](/v3/guidelines/nodes/running-nodes/liteserver-node). While it may sometimes be inaccessible, a built-in validation mechanism (implemented in the library) ensures it cannot provide false data. +3. Tonlib binary - Like ADNL, you connect to a liteserver and face the same benefits and downsides. However, your application also includes a dynamically loaded library compiled externally. +4. Offchain-only – Some SDKs allow you to create and serialize cells, which you can then send to APIs. +Clients connect directly to liteservers (nodes) using a binary protocol. -Clients connect directly to Liteservers (nodes) using a binary protocol. +The client downloads keyblocks, the current state of an account, and their **Merkle proofs**, ensuring the validity of received data. -The client downloads keyblocks, the current state of the account, and their **Merkle proofs**, which guarantees the validity of the received data. +For read operations (such as get-method calls), the client launches a local TVM with a downloaded and verified state. There's no need to download the full blockchain state—the client only retrieves what’s required for the operation. -Read operations (like get-method calls) are made by launching a local TVM with a downloaded and verified state. It's worth noting that there is no need to download the full state of the blockchain, the client downloads only what is needed for the operation. +You can connect to public liteservers from the global config ([Mainnet](https://ton.org/global-config.json) or [Testnet](https://ton.org/testnet-global.config.json)) or run your own [liteserver](/v3/documentation/infra/nodes/node-types) and manage it with [ADNL SDKs](/v3/guidelines/dapps/apis-sdks/sdk#overview). -You can connect to public liteservers from the global config ([Mainnet](https://ton.org/global-config.json) or [Testnet](https://ton.org/testnet-global.config.json)) or run your own [Liteserver](/v3/documentation/infra/nodes/node-types) and handle this with [ADNL SDKs](/v3/guidelines/dapps/apis-sdks/sdk#overview). +Read more about [Merkle proofs](/v3/documentation/data-formats/tlb/proofs) at [TON whitepaper](https://ton.org/ton.pdf) 2.3.10, 2.3.11. -Read more about [Merkle proofs](/v3/documentation/data-formats/tlb/proofs) at [TON Whitepaper](https://ton.org/ton.pdf) 2.3.10, 2.3.11. +Public liteservers (from the global config) help you quickly get started with TON. You can use them to learn TON programming or for applications and scripts that do not require 100% uptime. -Public liteservers (from the global config) exist to get you started with TON quickly. It can be used for learning to program in TON, or for applications and scripts that do not require 100% uptime. +For production infrastructure, consider using a well-prepared setup: +- [Run your own liteserver](/v3/guidelines/nodes/running-nodes/liteserver-node), +- Use Liteserver premium providers via [@liteserver_bot](https://t.me/liteserver_bot) -For building production infrastructure - it is suggested use well prepared infrastructure: -- [set up own liteserver](/v3/guidelines/nodes/running-nodes/liteserver-node), -- use Liteserver premium providers [@liteserver_bot](https://t.me/liteserver_bot) +## Pros & cons -## Pros & Cons +- ✅ Reliable - Uses an API with Merkle proof hashes to verify incoming binary data. +- ✅ Secure - Since it checks Merkle proofs, you can even use untrusted liteservers. +- ✅ Fast - Connects directly to TON Blockchain nodes instead of relying on HTTP middleware. -- ✅ Reliable. Uses API with Merkle proof hashes to verify incoming binary data. -- ✅ Secure. Since it checks Merkle proofs, you can even use untrusted liteservers. -- ✅ Fast. Connects directly to TON Blockchain nodes, instead of using HTTP middleware. - -- ❌ Complicated. More time is required to figure things out. -- ❌ Back-end first. Not compatible with web frontends (built for non-HTTP protocol), or requires HTTP-ADNL proxy. +- ❌ Complex - Requires time to set up and understand. +- ❌ Back-end first - Not compatible with web frontends (built for a non-HTTP protocol) unless you use an HTTP-ADNL proxy. ## API reference -Requests and responses to the server are described by the [TL](/v3/documentation/data-formats/tl) schema that allows you to generate a typed interface for a certain programming language. +Requests and responses follow the [TL](/v3/documentation/data-formats/tl) schema, which allows you to generate a typed interface for a specific programming language. -[TonLib TL Schema](https://github.com/ton-blockchain/ton/blob/master/tl/generate/scheme/tonlib_api.tl) +[TonLib TL schema](https://github.com/ton-blockchain/ton/blob/master/tl/generate/scheme/tonlib_api.tl) diff --git a/docs/v3/guidelines/dapps/apis-sdks/ton-http-apis.md b/docs/v3/guidelines/dapps/apis-sdks/ton-http-apis.md index 9c9e73127d0..e8a1e9d6b61 100644 --- a/docs/v3/guidelines/dapps/apis-sdks/ton-http-apis.md +++ b/docs/v3/guidelines/dapps/apis-sdks/ton-http-apis.md @@ -1,63 +1,61 @@ # TON HTTP-based APIs -There are different ways to connect to blockchain: -1. **RPC data provider or another API**: in most cases, you have to *rely* on its stability and security. -2. ADNL connection: you're connecting to a [liteserver](/v3/guidelines/nodes/running-nodes/liteserver-node). It may be inaccessible, but with a certain level of validation (implemented in the library), it cannot lie. -3. Tonlib binary: you're also connecting to a liteserver, so all benefits and downsides apply, but your application includes a dynamically-loaded library compiled externally. -4. Offchain-only. Such SDKs allow the creation and serialization of cells, which can then be sent to APIs. - +There are different ways to connect to TON Blockchain: +1. **RPC data provider or another API** - You must rely on its stability and security. +2. ADNL connection - Connect to a [liteserver](/v3/guidelines/nodes/running-nodes/liteserver-node). While it may be inaccessible at times, it cannot provide false data due to library-implemented validation. +3. Tonlib binary - Also connects to a liteserver, so it shares the same advantages and limitations. However, your application includes a dynamically loaded library compiled externally. +4. Offchain-only - These SDKs allow you to create and serialize cells, which you can then send to APIs. ## Pros & Cons -- ✅ Habitual and suitable for a quick start, this is perfect for every newcomer looking to play with TON. -- ✅ Web-oriented. Perfect for loading data from TON smart contracts via the Web, and also allows sending messages. +- ✅ Easy-to-use - Ideal for newcomers exploring TON. +- ✅ Web-oriented - Suitable for loading data from TON smart contracts via the web and sending messages. -- ❌ Simplified. It's not possible to receive information where you need an indexed TON API. -- ❌ HTTP-Middleware. You can't fully trust server responses unless the server augments blockchain data with [Merkle proofs](/v3/documentation/data-formats/tlb/proofs) to validate its authenticity. +- ❌ Simplified - Does not provide indexed TON API data. +- ❌ HTTP-middleware dependency - Server responses cannot be fully trusted unless augmented with [merkle proofs](/v3/documentation/data-formats/tlb/proofs) to verify authenticity. -## RPC Nodes +## RPC nodes -:::tip TON Infrastructure Status -* [status.toncenter](https://status.toncenter.com/) - various statistics of nodes activity during the last hour. -* [Tonstat.us](https://tonstat.us/) - a real-time Grafana, updated every 5 minutes. +:::tip TON infrastructure status +* [status.toncenter](https://status.toncenter.com/) - Displays various node activity statistics from the last hour. +* [Tonstat.us](https://tonstat.us/) - A real-time Grafana dashboard, updated every 5 minutes. ::: -* [QuickNode](https://www.quicknode.com/chains/ton?utm_source=ton-docs) - Leading blockchain node provider offering the fastest access with smart DNS routing for optimized global reach and load-balanced scalability. -* [Chainstack](https://chainstack.com/build-better-with-ton/) — RPC nodes and indexer in multiple regions with geo and load balancing. -* [Tatum](https://docs.tatum.io/reference/rpc-ton) — Access TON RPC nodes and powerful developer tools in one simple-to-use platform. -* [GetBlock Nodes](https://getblock.io/nodes/ton/) — connect and test your dApps using GetBlocks Nodes -* [TON Access](https://www.orbs.com/ton-access/) - HTTP API for The Open Network (TON). -* [Toncenter](https://toncenter.com/api/v2/) — community-hosted project for Quick Start with API. (Get an API key [@tonapibot](https://t.me/tonapibot)) -* [ton-node-docker](https://github.com/fmira21/ton-node-docker) - Docker Full Node and Toncenter API. -* [toncenter/ton-http-api](https://github.com/toncenter/ton-http-api) — run your own RPC node. -* [nownodes.io](https://nownodes.io/nodes) — NOWNodes full Nodes and blockbook Explorers via API. -* [Chainbase](https://chainbase.com/chainNetwork/TON) — Node API and data infrastructure for The Open Network. +* [QuickNode](https://www.quicknode.com/chains/ton?utm_source=ton-docs) - A top-tier blockchain node provider, offering fast access, smart DNS routing, and load-balanced scalability. +* [Chainstack](https://chainstack.com/build-better-with-ton/) — Provides RPC nodes and indexers in multiple regions with geo and load balancing. +* [Tatum](https://docs.tatum.io/reference/rpc-ton) — Offers TON RPC node access and developer tools in a simple interface. +* [GetBlock nodes](https://getblock.io/nodes/ton/) — Enables developers to connect and test DApps using GetBlock’s nodes. +* [TON access](https://www.orbs.com/ton-access/) - A public HTTP API for The Open Network (TON). +* [Toncenter](https://toncenter.com/api/v2/) — A community-hosted project for quick API access. (Get an API key [@tonapibot](https://t.me/tonapibot)) +* [ton-node-docker](https://github.com/fmira21/ton-node-docker) - A Docker Full Node and Toncenter API. +* [toncenter/ton-http-api](https://github.com/toncenter/ton-http-api) — Allows you to run your own RPC node. +* [nownodes.io](https://nownodes.io/nodes) — Provides full nodes and blockbook explorers via API. +* [Chainbase](https://chainbase.com/chainNetwork/TON) — A node API and data infrastructure for TON. ## Indexer -### Toncenter TON Index +### Toncenter TON index -Indexers allow to list jetton wallets, NFTs, transactions by certain filters, not only retrieve specific ones. +Indexers allow you to list jetton wallets, NFTs, and transactions using filters, rather than retrieving only specific ones. -- Public TON Index can be used: tests and development are for free, [premium](https://t.me/tonapibot) for production - [toncenter.com/api/v3/](https://toncenter.com/api/v3/). -- Run your own TON Index with [Worker](https://github.com/toncenter/ton-index-worker/tree/36134e7376986c5517ee65e6a1ddd54b1c76cdba) and [TON Index API wrapper](https://github.com/toncenter/ton-indexer). +- Public TON index can be used for free tests and development; [premium](https://t.me/tonapibot) plans are available for production at [toncenter.com/api/v3/](https://toncenter.com/api/v3/). +- Run your own TON index with [Worker](https://github.com/toncenter/ton-index-worker/tree/36134e7376986c5517ee65e6a1ddd54b1c76cdba) and [TON index API wrapper](https://github.com/toncenter/ton-indexer). ### Anton -Written in Go, Anton is an open source The Open Network blockchain indexer available under the Apache License 2.0. Anton is designed to provide a scalable, flexible solution for developers to access and analyze blockchain data. Our goal is to help developers and users understand how the blockchain is being used, and to make it possible for developers to add their own contracts with custom message schemas to our explorer. - -* [Project GitHub](https://github.com/tonindexer/anton) - to run your own indexer -* [Swagger API documentation](https://github.com/tonindexer/anton), [API Query Examples](https://github.com/tonindexer/anton/blob/main/docs/API.md) - to use, study the documentation and examples -* [Apache Superset](https://github.com/tonindexer/anton) - use to view data +Anton is an open-source TON Blockchain indexer written in Go and licensed under Apache 2.0. It offers a scalable, flexible way for developers to access and analyze blockchain data. Developers can also add custom smart contracts with custom message schemas. -### GraphQL Nodes +* [Project GitHub](https://github.com/tonindexer/anton) - Run your own indexer. +* [Swagger API documentation](https://github.com/tonindexer/anton), [API query examples](https://github.com/tonindexer/anton/blob/main/docs/API.md) - Learn how to use Anton. +* [Apache superset](https://github.com/tonindexer/anton) - Visualize blockchain data. -GraphQL nodes act as indexers as well. +### GraphQL nodes -* [dton.io](https://dton.io/graphql) - as well as providing contracts data augmented with parsed "is jetton", "is NFT" flags, allows emulating transactions and receiving execution traces. +GraphQL nodes also function as indexers. +* [dton.io](https://dton.io/graphql) - Provides contract data according to contract type. It also supports transaction emulation and execution trace retrieval. ## Other APIs -* [TonAPI](https://docs.tonconsole.com/tonapi) - API that is designed to provide users with a streamlined experience, not worrying about low-level details of smart contracts. +* [TonAPI](https://docs.tonconsole.com/tonapi) - A user-friendly API that abstracts low-level smart contract details for a streamlined experience.