# TON

## TON API 概述

### TON 提供两种用于访问区块链数据的主要服务：

1. **TON HTTP API**：此 API 将 ADNL 二进制协议转换为 HTTP，让您可以像直接连接一样与 TON 节点通信。它旨在易于使用并与标准 Web 技术兼容。
2. **TON 索引器 API：**&#x6B64;服务将区块链数据索引到 PostgreSQL，从而通过 API 调用实现高效的数据检索。它对于需要访问历史区块链数据的应用程序特别有用。

## 访问 API

* &#x20;**TON HTTP API 基本 URL：**\
  `https://api.chainup.net/ton/mainnet/{token}/api/v2`
* **TON 索引器 API 基本 URL：**\
  `https://api.chainup.net/ton/mainnet/{token}/api/v3`

## 示例用法

您可以使用标准 HTTP 请求与 API 交互。以下是如何获取主链信息的示例：

## 使用 TON HTTP API

```
curl -X 'GET' \
  'https://api.chainup.net/ton/mainnet/{token}/api/v2/getMasterchainInfo' \
  -H 'accept: application/json'
```

## 使用 TON 索引器 API

```
curl -X 'GET' \
  'https://api.chainup.net/ton/mainnet/{token}/api/v3/masterchainInfo' \
  -H 'accept: application/json'
```

### 关于 ADNL 协议的注意事项

TON 节点不提供 HTTP RPC API，仅通过 ADNL 二进制协议进行通信。如果您需要 ADNL 的访问方法，请联系我们的支持团队寻求帮助。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.chainupcloud.com/zhong-wen/qu-kuai-lian-api/ton.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
