From ccf1834b6840c3ed47420752fb7ad0db0ead2fbd Mon Sep 17 00:00:00 2001 From: laviniat1996 Date: Thu, 30 Oct 2025 16:53:16 +0200 Subject: [PATCH 01/40] add ton center overview + rate limit pages --- docs.json | 1 + ecosystem/rpc/toncenter/overview.mdx | 139 ++++++++++++++++++++++++- ecosystem/rpc/toncenter/rate-limit.mdx | 47 +++++++++ 3 files changed, 184 insertions(+), 3 deletions(-) create mode 100644 ecosystem/rpc/toncenter/rate-limit.mdx diff --git a/docs.json b/docs.json index 000fc7507..12eba1f3a 100644 --- a/docs.json +++ b/docs.json @@ -178,6 +178,7 @@ "pages": [ "ecosystem/rpc/toncenter/overview", "ecosystem/rpc/toncenter/get-api-key", + "ecosystem/rpc/toncenter/rate-limit", { "group": "API v2", "openapi": { diff --git a/ecosystem/rpc/toncenter/overview.mdx b/ecosystem/rpc/toncenter/overview.mdx index 3ad6122c4..d2cda2441 100644 --- a/ecosystem/rpc/toncenter/overview.mdx +++ b/ecosystem/rpc/toncenter/overview.mdx @@ -1,7 +1,140 @@ --- -title: "Overview" +title: Overview +description: Learn what the TON Center APIs provide and how to use them. --- -import { Stub } from '/snippets/stub.jsx'; +The **TON Center API** provides developer access to the TON blockchain through REST and JSON-RPC endpoints. +It allows applications to read blockchain data, run smart contract methods, and send transactions. - +TON Center serves as a public gateway to the TON network. It implements two types APIs, **v2** and **v3**, that correspond to the non-indexed and indexed access layers. + +Applications interact with the TON blockchain by connecting to a TON node. +Since nodes communicate through the binary ADNL protocol, an intermediate layer +is needed for web-based access. v2 provides this bridge by using [`tonlib`](https://github.com/ton-blockchain/ton/tree/master/tonlib/tonlib) +to query data from liteservers and exposes it +through a standard REST interface. v3 extends this model by reading raw data from a node’s +RocksDB storage, parsing and decoding that data, and storing it in PostgreSQL. + +## Base URLs + +| Environment | v2 | v3 | +| ----------- | -------------------------------------- | -------------------------------------- | +| **Mainnet** | `https://toncenter.com/api/v2` | `https://toncenter.com/api/v3` | +| **Testnet** | `https://testnet.toncenter.com/api/v2` | `https://testnet.toncenter.com/api/v3` | + + +## Typical use cases + +### v2 + +* Query account balances and state +* Run get-methods on smart contracts +* Send or broadcast messages +* Retrieve latest transactions and block information + +### v3 + +* Query historical transactions and traces +* Retrieve decoded Jetton and NFT data +* Run analytical or filtered searches across multiple accounts +* Power explorers or reporting tools + +## Endpoints v2 + +| Category | Method | Description | +| ----------------------------- | ------------------------------------- | --------------------------------------------------------- | +| **Accounts** | `GET /detectAddress` | Detect all address formats and return normalized versions | +| **Accounts** | `GET /getAddressBalance` | Get balance for an address | +| **Accounts** | `GET /getAddressInformation` | Get account info including balance and state | +| **Accounts** | `GET /getExtendedAddressInformation` | Extended account info (wallet type, seqno, etc) | +| **Accounts** | `GET /getJettonBalances` | Get Jetton balances for a wallet | +| **Accounts** | `GET /getMasterchainInfoExt` | Get extended masterchain info | +| **Accounts** | `GET /getNftItemsByCollectionAddress` | Get NFT items by collection | +| **Accounts** | `GET /getTokenData` | Get Jetton metadata by master address | +| **Accounts** | `GET /packAddress` | Convert raw address to user-friendly format | +| **Accounts** | `GET /unpackAddress` | Convert user-friendly address to raw format | +| **Blocks** | `GET /getBlockHeader` | Get block header metadata | +| **Blocks** | `GET /getBlockTransactions` | Get transactions in a block | +| **Blocks** | `GET /getConfigParam` | Get specific config parameter | +| **Blocks** | `GET /getConfigAll` | Get all config parameters | +| **Blocks** | `GET /getMasterchainBlockSignatures` | Get masterchain block signatures | +| **Blocks** | `GET /getMasterchainInfo` | Get last masterchain block info | +| **Blocks** | `GET /getRawBlockHeader` | Get raw block header | +| **Blocks** | `GET /getRawMasterchainInfo` | Get raw masterchain info | +| **Blocks** | `GET /getRawShardBlockHeader` | Get raw shard block header | +| **Blocks** | `GET /getTime` | Get server time | +| **Blocks** | `GET /lookupBlock` | Lookup block by seqno/lt/root hash | +| **Config** | `GET /getConfigParam` | Get specific config parameter | +| **Config** | `GET /getConfigAll` | Get all config parameters | +| **Transactions** | `GET /getTransactions` | Get account transactions | +| **Transactions** | `GET /tryLocateSourceTx` | Try to find source transaction by message hash | +| **Transactions** | `GET /tryLocateResultTx` | Try to find result transaction by message hash | +| **Messages and transactions** | `POST /sendBoc` | Send BOC to the network | +| **Messages and transactions** | `POST /sendBocReturnHash` | Send BOC and return its hash | +| **Messages and transactions** | `POST /sendQuery` | Send external query to liteserver | +| **Messages and transactions** | `GET /tryLocateTx` | Try to find transaction by message hash | +| **Smart contracts** | `POST /runGetMethod` | Run a get-method on a smart contract | +| **JSON-RPC** | `POST /jsonRPC` | Proxy JSON-RPC requests to liteservers | + +## Endpoints v3 + +| Category | Method | Description | +| -------------------------- | ----------------------------------------- | -------------------------------------------------------------------------- | +| **Accounts** | `GET /accounts` | List or search accounts with filters | +| **Accounts** | `GET /accounts/{account_id}` | Get account details by ID | +| **Accounts** | `GET /accounts/{account_id}/transactions` | List transactions for an account | +| **Accounts** | `GET /accounts/{account_id}/actions` | List high-level actions for an account (DEX, Jettons, NFTs, etc) | +| **Actions and traces** | `GET /actions` | List decoded high-level actions like swaps, transfers, or stake operations | +| **Actions and traces** | `GET /traces` | List full transaction traces with filters and pagination | +| **Actions and traces** | `GET /emulateTrace` | Emulate a transaction trace for a given external message or BOC | +| **Actions and traces** | `GET /emulateActions` | Classify emulated traces into actions | +| **Blockchain data** | `GET /transactions/{hash}` | Get transaction by hash | +| **Blockchain data** | `GET /transactionsByMessage` | Find transactions by message hash | +| **Blockchain data** | `GET /blocks/{workchain}/{shard}/{seqno}` | Get a specific block by coordinates | +| **Blockchain data** | `GET /blocks` | Search or filter blocks with pagination | +| **Blockchain data** | `GET /messages/{hash}` | Get message by hash | +| **Blockchain data** | `GET /messages` | Search messages with filters | +| **Blockchain data** | `GET /validators` | Get current validators and info | +| **Blockchain data** | `GET /masterchain` | Get masterchain status | +| **Blockchain data** | `GET /shards` | List active shards and their info | +| **Blockchain data** | `GET /workchains` | List all configured workchains | +| **Jettons** | `GET /jettons` | List all Jetton contracts | +| **Jettons** | `GET /jettons/{master}` | Get Jetton master contract info | +| **Jettons** | `GET /jettons/{master}/holders` | List holders of a Jetton | +| **Jettons** | `GET /jettons/{master}/transactions` | Get Jetton transactions | +| **NFTs** | `GET /nfts` | List NFTs (items or collections) | +| **NFTs** | `GET /nfts/{collection}` | Get NFT collection details | +| **NFTs** | `GET /nfts/{collection}/{item}` | Get specific NFT item details | +| **DNS** | `GET /dns/{domain}` | Resolve TON DNS records | +| **Utils** | `GET /estimateFee` | Estimate fees for an external message | +| **Utils** | `GET /detectAddress` | Normalize and inspect address formats | +| **Stats and analytics** | `GET /stats` | Retrieve aggregated network and protocol statistics | +| **Legacy (v2-compatible)** | `POST /runGetMethod` | Run get-method | +| **Legacy (v2-compatible)** | `POST /sendBoc` | Send BOC | +| **Legacy (v2-compatible)** | `POST /sendBocReturnHash` | Send BOC and return hash | +| **Legacy (v2-compatible)** | `GET /getAddressInformation` | Get address info | +| **Legacy (v2-compatible)** | `GET /getTransactions` | Get transactions | + + +## How to access the API + +Developers can access TON Center APIs either through hosted infrastructure managed by TON Center or by running their own instance. + +### Hosted Access + +Hosted access means using TON Center’s managed infrastructure instead of running your own node. This lets you +connect to the network immediately, without setup or maintenance. + +You can start making requests without an API key at a default rate of 1 request per second. + +To increase this limit or access private liteservers, generate an [API key](./get-api-key) and [choose a plan](./rate-limit) that suits your needs. + +### Self-Hosting + +Run your own TON Center infrastructure for full control over performance and data retention. + +- [v2](https://github.com/toncenter/ton-http-api) +- [v3](https://github.com/toncenter/ton-indexer) + +**Minimum recommended configuration:** +16-core CPU, 128 GB RAM, 1 TB NVMe SSD, and 1 Gbps network connection. diff --git a/ecosystem/rpc/toncenter/rate-limit.mdx b/ecosystem/rpc/toncenter/rate-limit.mdx new file mode 100644 index 000000000..b5009e5ee --- /dev/null +++ b/ecosystem/rpc/toncenter/rate-limit.mdx @@ -0,0 +1,47 @@ +--- +title: "Rate limits" +description: "Understand TON Center API rate limits." +--- + +import {Aside} from "/snippets/aside.jsx"; + +To ensure stability and fair access, TON Center applies rate limits to all API requests. +If your application exceeds these limits, the API returns a **429** response. + +You can increase your limits by [requesting an API key](./get-api-key) and selecting a higher subscription plan. + +## Default limits + +| Plan | Tokens per Network | Requests per Second | Notes | +|------|--------------------|---------------------|-------| +| **Free** | 1 | 10 | Shared liteservers — ideal for quick tests and small projects. | +| **Plus** | 3 | 25 | Private liteservers for more consistent performance. | +| **Advanced** | 10 | 100 | Private infrastructure with priority routing. | +| **Enterprise** | Custom | Custom | Tailored throughput and support. Contact [@toncenter_support](https://t.me/toncenter_support) for details. | + +Rate limits apply per API token and per network (mainnet/testnet). + + + + +## Rate limit exceeded + +When requests are sent faster than the allowed rate limit, the TON Center API temporarily blocks new ones. +You’ll receive a JSON response that tells you the rate limit was exceeded: + +```json +{ + "ok": false, + "result": "Ratelimit exceed", + "code": 429 +} +``` + +When this occurs: + +* Stop sending new requests and wait a few seconds before retrying. +* Implement exponential backoff to avoid repeated rate-limit violations. From fd1baa470b26ba1930fbd26343837eaa86c46761 Mon Sep 17 00:00:00 2001 From: laviniat1996 Date: Thu, 30 Oct 2025 17:09:34 +0200 Subject: [PATCH 02/40] fix linting --- ecosystem/rpc/toncenter/overview.mdx | 32 ++++++++++++-------------- ecosystem/rpc/toncenter/rate-limit.mdx | 25 ++++++++++---------- 2 files changed, 27 insertions(+), 30 deletions(-) diff --git a/ecosystem/rpc/toncenter/overview.mdx b/ecosystem/rpc/toncenter/overview.mdx index d2cda2441..1f84688c7 100644 --- a/ecosystem/rpc/toncenter/overview.mdx +++ b/ecosystem/rpc/toncenter/overview.mdx @@ -9,10 +9,10 @@ It allows applications to read blockchain data, run smart contract methods, and TON Center serves as a public gateway to the TON network. It implements two types APIs, **v2** and **v3**, that correspond to the non-indexed and indexed access layers. Applications interact with the TON blockchain by connecting to a TON node. -Since nodes communicate through the binary ADNL protocol, an intermediate layer +Since nodes communicate through the binary ADNL protocol, an intermediate layer is needed for web-based access. v2 provides this bridge by using [`tonlib`](https://github.com/ton-blockchain/ton/tree/master/tonlib/tonlib) to query data from liteservers and exposes it -through a standard REST interface. v3 extends this model by reading raw data from a node’s +through a standard REST interface. v3 extends this model by reading raw data from a node’s RocksDB storage, parsing and decoding that data, and storing it in PostgreSQL. ## Base URLs @@ -22,22 +22,21 @@ RocksDB storage, parsing and decoding that data, and storing it in PostgreSQL. | **Mainnet** | `https://toncenter.com/api/v2` | `https://toncenter.com/api/v3` | | **Testnet** | `https://testnet.toncenter.com/api/v2` | `https://testnet.toncenter.com/api/v3` | - ## Typical use cases -### v2 +### v2 -* Query account balances and state -* Run get-methods on smart contracts -* Send or broadcast messages -* Retrieve latest transactions and block information +- Query account balances and state +- Run get-methods on smart contracts +- Send or broadcast messages +- Retrieve latest transactions and block information -### v3 +### v3 -* Query historical transactions and traces -* Retrieve decoded Jetton and NFT data -* Run analytical or filtered searches across multiple accounts -* Power explorers or reporting tools +- Query historical transactions and traces +- Retrieve decoded Jetton and NFT data +- Run analytical or filtered searches across multiple accounts +- Power explorers or reporting tools ## Endpoints v2 @@ -46,7 +45,7 @@ RocksDB storage, parsing and decoding that data, and storing it in PostgreSQL. | **Accounts** | `GET /detectAddress` | Detect all address formats and return normalized versions | | **Accounts** | `GET /getAddressBalance` | Get balance for an address | | **Accounts** | `GET /getAddressInformation` | Get account info including balance and state | -| **Accounts** | `GET /getExtendedAddressInformation` | Extended account info (wallet type, seqno, etc) | +| **Accounts** | `GET /getExtendedAddressInformation` | Extended account info (wallet type, seqno, etc) | | **Accounts** | `GET /getJettonBalances` | Get Jetton balances for a wallet | | **Accounts** | `GET /getMasterchainInfoExt` | Get extended masterchain info | | **Accounts** | `GET /getNftItemsByCollectionAddress` | Get NFT items by collection | @@ -115,7 +114,6 @@ RocksDB storage, parsing and decoding that data, and storing it in PostgreSQL. | **Legacy (v2-compatible)** | `GET /getAddressInformation` | Get address info | | **Legacy (v2-compatible)** | `GET /getTransactions` | Get transactions | - ## How to access the API Developers can access TON Center APIs either through hosted infrastructure managed by TON Center or by running their own instance. @@ -125,7 +123,7 @@ Developers can access TON Center APIs either through hosted infrastructure manag Hosted access means using TON Center’s managed infrastructure instead of running your own node. This lets you connect to the network immediately, without setup or maintenance. -You can start making requests without an API key at a default rate of 1 request per second. +You can start making requests without an API key at a default rate of 1 request per second. To increase this limit or access private liteservers, generate an [API key](./get-api-key) and [choose a plan](./rate-limit) that suits your needs. @@ -133,7 +131,7 @@ To increase this limit or access private liteservers, generate an [API key](./ge Run your own TON Center infrastructure for full control over performance and data retention. -- [v2](https://github.com/toncenter/ton-http-api) +- [v2](https://github.com/toncenter/ton-http-api) - [v3](https://github.com/toncenter/ton-indexer) **Minimum recommended configuration:** diff --git a/ecosystem/rpc/toncenter/rate-limit.mdx b/ecosystem/rpc/toncenter/rate-limit.mdx index b5009e5ee..f3db71f2c 100644 --- a/ecosystem/rpc/toncenter/rate-limit.mdx +++ b/ecosystem/rpc/toncenter/rate-limit.mdx @@ -5,32 +5,31 @@ description: "Understand TON Center API rate limits." import {Aside} from "/snippets/aside.jsx"; -To ensure stability and fair access, TON Center applies rate limits to all API requests. +To ensure stability and fair access, TON Center applies rate limits to all API requests.\ If your application exceeds these limits, the API returns a **429** response. You can increase your limits by [requesting an API key](./get-api-key) and selecting a higher subscription plan. ## Default limits -| Plan | Tokens per Network | Requests per Second | Notes | -|------|--------------------|---------------------|-------| -| **Free** | 1 | 10 | Shared liteservers — ideal for quick tests and small projects. | -| **Plus** | 3 | 25 | Private liteservers for more consistent performance. | -| **Advanced** | 10 | 100 | Private infrastructure with priority routing. | -| **Enterprise** | Custom | Custom | Tailored throughput and support. Contact [@toncenter_support](https://t.me/toncenter_support) for details. | +| Plan | Tokens per Network | Requests per Second | Notes | +| -------------- | ------------------ | ------------------- | ----------------------------------------------------------------------------------------------------------- | +| **Free** | 1 | 10 | Shared liteservers — ideal for quick tests and small projects. | +| **Plus** | 3 | 25 | Private liteservers for more consistent performance. | +| **Advanced** | 10 | 100 | Private infrastructure with priority routing. | +| **Enterprise** | Custom | Custom | Tailored throughput and support. Contact [@toncenter\_support](https://t.me/toncenter_support) for details. | Rate limits apply per API token and per network (mainnet/testnet). - ## Rate limit exceeded -When requests are sent faster than the allowed rate limit, the TON Center API temporarily blocks new ones. +When requests are sent faster than the allowed rate limit, the TON Center API temporarily blocks new ones.\ You’ll receive a JSON response that tells you the rate limit was exceeded: ```json @@ -43,5 +42,5 @@ You’ll receive a JSON response that tells you the rate limit was exceeded: When this occurs: -* Stop sending new requests and wait a few seconds before retrying. -* Implement exponential backoff to avoid repeated rate-limit violations. +- Stop sending new requests and wait a few seconds before retrying. +- Implement exponential backoff to avoid repeated rate-limit violations. From cc23a566b4cba60170e62aef9b6c64413cb75e48 Mon Sep 17 00:00:00 2001 From: laviniat1996 Date: Thu, 6 Nov 2025 00:04:29 +0200 Subject: [PATCH 03/40] fixes --- ecosystem/rpc/toncenter/overview.mdx | 30 +++++++++++++------------- ecosystem/rpc/toncenter/rate-limit.mdx | 18 ++++++++++++++-- 2 files changed, 31 insertions(+), 17 deletions(-) diff --git a/ecosystem/rpc/toncenter/overview.mdx b/ecosystem/rpc/toncenter/overview.mdx index 1f84688c7..5c6c9fe36 100644 --- a/ecosystem/rpc/toncenter/overview.mdx +++ b/ecosystem/rpc/toncenter/overview.mdx @@ -6,39 +6,39 @@ description: Learn what the TON Center APIs provide and how to use them. The **TON Center API** provides developer access to the TON blockchain through REST and JSON-RPC endpoints. It allows applications to read blockchain data, run smart contract methods, and send transactions. -TON Center serves as a public gateway to the TON network. It implements two types APIs, **v2** and **v3**, that correspond to the non-indexed and indexed access layers. +TON Center serves as a public gateway to the TON network. It implements two types APIs, **API v2** and **API v3**, that correspond to the non-indexed and indexed access layers. Applications interact with the TON blockchain by connecting to a TON node. Since nodes communicate through the binary ADNL protocol, an intermediate layer -is needed for web-based access. v2 provides this bridge by using [`tonlib`](https://github.com/ton-blockchain/ton/tree/master/tonlib/tonlib) +is needed for web-based access. API v2 provides this bridge by using [`tonlib`](https://github.com/ton-blockchain/ton/tree/master/tonlib/tonlib) to query data from liteservers and exposes it -through a standard REST interface. v3 extends this model by reading raw data from a node’s +through a standard REST interface. API v3 extends this model by reading raw data from a node’s RocksDB storage, parsing and decoding that data, and storing it in PostgreSQL. ## Base URLs -| Environment | v2 | v3 | -| ----------- | -------------------------------------- | -------------------------------------- | -| **Mainnet** | `https://toncenter.com/api/v2` | `https://toncenter.com/api/v3` | -| **Testnet** | `https://testnet.toncenter.com/api/v2` | `https://testnet.toncenter.com/api/v3` | +| API | Mainnet | Testnet | +| ---------- | ------------------------------ | -------------------------------------- | +| **API v2** | `https://toncenter.com/api/v2` | `https://testnet.toncenter.com/api/v2` | +| **API v3** | `https://toncenter.com/api/v3` | `https://testnet.toncenter.com/api/v3` | ## Typical use cases -### v2 +### API v2 - Query account balances and state - Run get-methods on smart contracts - Send or broadcast messages - Retrieve latest transactions and block information -### v3 +### API v3 - Query historical transactions and traces - Retrieve decoded Jetton and NFT data - Run analytical or filtered searches across multiple accounts - Power explorers or reporting tools -## Endpoints v2 +## Endpoints API v2 | Category | Method | Description | | ----------------------------- | ------------------------------------- | --------------------------------------------------------- | @@ -75,7 +75,7 @@ RocksDB storage, parsing and decoding that data, and storing it in PostgreSQL. | **Smart contracts** | `POST /runGetMethod` | Run a get-method on a smart contract | | **JSON-RPC** | `POST /jsonRPC` | Proxy JSON-RPC requests to liteservers | -## Endpoints v3 +## Endpoints API v3 | Category | Method | Description | | -------------------------- | ----------------------------------------- | -------------------------------------------------------------------------- | @@ -118,7 +118,7 @@ RocksDB storage, parsing and decoding that data, and storing it in PostgreSQL. Developers can access TON Center APIs either through hosted infrastructure managed by TON Center or by running their own instance. -### Hosted Access +### Managed Service Hosted access means using TON Center’s managed infrastructure instead of running your own node. This lets you connect to the network immediately, without setup or maintenance. @@ -127,12 +127,12 @@ You can start making requests without an API key at a default rate of 1 request To increase this limit or access private liteservers, generate an [API key](./get-api-key) and [choose a plan](./rate-limit) that suits your needs. -### Self-Hosting +### Self-hosted service Run your own TON Center infrastructure for full control over performance and data retention. -- [v2](https://github.com/toncenter/ton-http-api) -- [v3](https://github.com/toncenter/ton-indexer) +- [API v2](https://github.com/toncenter/ton-http-api) +- [API v3](https://github.com/toncenter/ton-indexer) **Minimum recommended configuration:** 16-core CPU, 128 GB RAM, 1 TB NVMe SSD, and 1 Gbps network connection. diff --git a/ecosystem/rpc/toncenter/rate-limit.mdx b/ecosystem/rpc/toncenter/rate-limit.mdx index f3db71f2c..30408f6f1 100644 --- a/ecosystem/rpc/toncenter/rate-limit.mdx +++ b/ecosystem/rpc/toncenter/rate-limit.mdx @@ -1,5 +1,5 @@ --- -title: "Rate limits" +title: "Managed plans and rate limiting" description: "Understand TON Center API rate limits." --- @@ -9,12 +9,13 @@ To ensure stability and fair access, TON Center applies rate limits to all API r If your application exceeds these limits, the API returns a **429** response. You can increase your limits by [requesting an API key](./get-api-key) and selecting a higher subscription plan. +Without any API key, the default rate limit is 1 request per second. ## Default limits | Plan | Tokens per Network | Requests per Second | Notes | | -------------- | ------------------ | ------------------- | ----------------------------------------------------------------------------------------------------------- | -| **Free** | 1 | 10 | Shared liteservers — ideal for quick tests and small projects. | +| **Free** | 1 | 10 | Shared liteservers, ideal for quick tests and small projects. | | **Plus** | 3 | 25 | Private liteservers for more consistent performance. | | **Advanced** | 10 | 100 | Private infrastructure with priority routing. | | **Enterprise** | Custom | Custom | Tailored throughput and support. Contact [@toncenter\_support](https://t.me/toncenter_support) for details. | @@ -44,3 +45,16 @@ When this occurs: - Stop sending new requests and wait a few seconds before retrying. - Implement exponential backoff to avoid repeated rate-limit violations. + +## Common mistakes + +If you purchased a paid plan but still experience a 1 RPS rate limit: + +- Check that your API key is included correctly in your requests. + Requests without a valid API key are limited to 1 RPS, even if a subscription is active. + +- Verify the correct key is used for the intended environment (mainnet or testnet). + Each network requires its own key. + +- Wait up to 10 minutes after upgrading your plan or changing your API key. + Subscription and key updates can take several minutes to propagate across TON Center’s rate-limiting system. From d55bb2632793e932529ed4a0cf97137bf33c9532 Mon Sep 17 00:00:00 2001 From: Daniil Sedov Date: Fri, 31 Oct 2025 16:46:11 +0300 Subject: [PATCH 04/40] fix(ci): do not skip empty suggestions (#1065) --- .github/scripts/build_review_payload.py | 74 ++++++++++++++++++++----- 1 file changed, 59 insertions(+), 15 deletions(-) diff --git a/.github/scripts/build_review_payload.py b/.github/scripts/build_review_payload.py index 36a3c7342..986f027a7 100644 --- a/.github/scripts/build_review_payload.py +++ b/.github/scripts/build_review_payload.py @@ -177,9 +177,15 @@ def _build_from_sidecar(sidecar: dict, *, repo: str, sha: str, repo_root: Path) items = sidecar.get("selected_details") or [] comments: List[Dict[str, object]] = [] def sanitize_code_for_gh_suggestion(code: str) -> str: - # Remove diff headers and convert +added lines to plain text; drop -removed lines. + """Normalize a suggestion snippet for GitHub suggestions. + - If a fenced block is present, extract its inner content. + - Remove diff headers and treat leading '+' additions as plain text; drop '-' lines. + """ + # Extract inner of first fenced block when present + lang, inner = _extract_first_code_block(code) + text = inner if inner is not None else code out: List[str] = [] - for ln in code.splitlines(): + for ln in text.splitlines(): if ln.startswith('--- ') or ln.startswith('+++ ') or ln.startswith('@@'): continue if ln.startswith('+') and not ln.startswith('++'): @@ -216,12 +222,8 @@ def sanitize_code_for_gh_suggestion(code: str) -> str: continue except Exception: pass - # Build comment body with title + description + suggestion fence + # Build comment body with title + description and optional suggestion fence code = code.rstrip("\n") - if not code: - # Skip items with no replacement text - continue - repl = sanitize_code_for_gh_suggestion(code) parts: List[str] = [] # Prefer including severity in heading when present in sidecar sev = (it.get("severity") or "").strip().upper() @@ -231,10 +233,26 @@ def sanitize_code_for_gh_suggestion(code: str) -> str: if desc: parts.append("") parts.append(desc) - parts.append("") - parts.append("```suggestion") - parts.append(repl) - parts.append("```") + # When replacement text is present, include a GitHub suggestion block. + # Allow empty replacement (deletion) suggestions: GitHub treats an empty block as delete selected lines. + if code is not None: + repl = sanitize_code_for_gh_suggestion(code) + repl_lines = repl.splitlines() + n_range = end - start + 1 + if ( + (n_range == 1 and len(repl_lines) == 1) or + (n_range > 1 and len(repl_lines) == n_range) or + (repl == "" and n_range >= 1) + ): + parts.append("") + parts.append("```suggestion") + if repl: + parts.append(repl) + parts.append("```") + else: + # No auto-fix block; rely on title/description and CTA only. + pass + # Always include the feedback CTA parts.append("") parts.append("Please leave a reaction 👍/👎 to this suggestion to improve future reviews for everyone!") body_text = "\n".join(parts).strip() @@ -292,6 +310,8 @@ def _extract_first_code_block(text: str) -> Tuple[Optional[str], Optional[str]]: _TRAILER_JSON_RE = re.compile(r"```json\s*(\{[\s\S]*?\})\s*```\s*$", re.IGNORECASE | re.MULTILINE) +# Remove any fenced code blocks (```lang ... ```), used when we can't submit a proper GH suggestion +_FENCED_BLOCK_RE = re.compile(r"```[a-zA-Z0-9_-]*\s*\n[\s\S]*?\n```", re.MULTILINE) def _strip_trailing_json_trailer(text: str) -> str: """Remove a trailing fenced JSON block (validator trailer) from text.""" @@ -608,20 +628,44 @@ def main() -> None: parts.append(f.desc.strip()) # Only submit commit suggestions when the replacement likely covers the full selected range submitted_suggestion = False - if f.suggestion_replacement: + if f.suggestion_replacement is not None: repl = f.suggestion_replacement.rstrip("\n") repl_lines = repl.splitlines() n_range = f.end - f.start + 1 - if (n_range == 1 and len(repl_lines) == 1) or (n_range > 1 and len(repl_lines) == n_range): + if ( + (n_range == 1 and len(repl_lines) == 1) or + (n_range > 1 and len(repl_lines) == n_range) or + (repl == "" and n_range >= 1) + ): + parts.append("") + parts.append("```suggestion") + if repl: + parts.append(repl) + parts.append("```") + submitted_suggestion = True + if not submitted_suggestion and f.suggestion_raw.strip(): + # Detect deletion-only diffs and convert to empty GH suggestion + raw = f.suggestion_raw + lang, inner = _extract_first_code_block(raw) + text = inner if inner is not None else raw + lines = [ln.strip() for ln in text.splitlines()] + has_add = any(ln.startswith('+') and not ln.startswith('++') for ln in lines) + has_del = any(ln.startswith('-') and not ln.startswith('--') for ln in lines) + if has_del and not has_add: parts.append("") parts.append("```suggestion") - parts.append(repl) parts.append("```") submitted_suggestion = True if not submitted_suggestion and f.suggestion_raw.strip(): parts.append("") # Do not include fenced blocks if we can't guarantee a commit suggestion - parts.append(_TRAILER_JSON_RE.sub("", f.suggestion_raw.strip())) + cleaned = _TRAILER_JSON_RE.sub("", f.suggestion_raw.strip()) + cleaned = _FENCED_BLOCK_RE.sub("", cleaned).strip() + if cleaned: + parts.append(cleaned) + # Always include the feedback CTA + parts.append("") + parts.append("Please leave a reaction 👍/👎 to this suggestion to improve future reviews for everyone!") body_text = "\n".join(parts).strip() # Rewrite style-guide references to clickable blob URLs body_text = _absolutize_location_links(body_text, repo if repo else None, sha if sha else None) From 025d5b5acb416684f5c1c9fbb49c58fbf5d97e01 Mon Sep 17 00:00:00 2001 From: laviniat1996 Date: Thu, 6 Nov 2025 00:35:40 +0200 Subject: [PATCH 05/40] feat(structure): tvm/serialization -> foundations/serialization, ecosystem/rpc -> ecosystem/api (#1064) - other minor structure improvements # Conflicts: # docs.json # ecosystem/api/toncenter/rate-limit.mdx --- .prettierignore | 4 +- .remarkignore | 4 +- CODEOWNERS | 4 +- contract-dev/first-smart-contract.mdx | 4 +- contract-dev/using-onchain-libraries.mdx | 6 +- docs.json | 202 +++++++++--------- ecosystem/analytics.mdx | 37 ++-- ecosystem/{rpc => api}/overview.mdx | 0 ecosystem/{rpc => api}/price.mdx | 0 .../{rpc => api}/toncenter/get-api-key.mdx | 0 ecosystem/{rpc => api}/toncenter/overview.mdx | 0 .../{rpc => api}/toncenter/rate-limit.mdx | 0 ecosystem/{rpc => api}/toncenter/v2.json | 0 ...rt-raw-address-to-user-friendly-format.mdx | 0 ...rt-user-friendly-address-to-raw-format.mdx | 0 .../accounts/detect-all-address-formats.mdx | 0 .../v2/accounts/get-account-balance-only.mdx | 0 .../accounts/get-account-lifecycle-state.mdx | 0 .../get-account-state-and-balance.mdx | 0 .../get-detailed-account-state-extended.mdx | 0 .../accounts/get-nft-or-jetton-metadata.mdx | 0 .../v2/accounts/get-wallet-information.mdx | 0 .../v2/accounts/list-account-transactions.mdx | 0 .../v2/blocks/get-block-header-metadata.mdx | 0 .../v2/blocks/get-latest-consensus-block.mdx | 0 .../v2/blocks/get-latest-masterchain-info.mdx | 0 .../get-masterchain-block-signatures.mdx | 0 .../get-outgoing-message-queue-sizes.mdx | 0 .../v2/blocks/get-shard-block-proof.mdx | 0 .../get-shards-at-masterchain-seqno.mdx | 0 .../blocks/get-smart-contract-libraries.mdx | 0 ...st-block-transactions-extended-details.mdx | 0 .../v2/blocks/list-block-transactions.mdx | 0 ...ook-up-block-by-height-lt-or-timestamp.mdx | 0 .../v2/config/get-all-config-parameters.mdx | 0 .../v2/config/get-single-config-parameter.mdx | 0 .../v2/json-rpc/json-rpc-handler.mdx | 0 .../estimate-transaction-fees.mdx | 0 .../send-external-message-and-return-hash.mdx | 0 .../send-external-message-boc.mdx | 0 .../send-unpacked-external-query.mdx | 0 .../run-get-method-on-contract.mdx | 0 ...result-transaction-by-incoming-message.mdx | 0 ...source-transaction-by-outgoing-message.mdx | 0 ...locate-transaction-by-incoming-message.mdx | 0 ecosystem/{rpc => api}/toncenter/v3.yaml | 0 .../v3/accounts/get-account-address-book.mdx | 0 .../v3/accounts/get-account-metadata.mdx | 0 .../get-account-states-with-codedata.mdx | 0 .../get-wallet-states-and-balances.mdx | 0 .../list-actions-by-filters-tx-msg-trace.mdx | 0 .../list-completed-traces-with-actions.mdx | 0 .../list-pending-actions.mdx | 0 .../list-pending-traces.mdx | 0 .../get-indexed-masterchain-range.mdx | 0 .../get-masterchain-block-shard-state.mdx | 0 ...et-parentchild-transactions-for-a-hash.mdx | 0 .../get-transactions-by-masterchain-block.mdx | 0 .../get-transactions-by-message.mdx | 0 .../v3/blockchain-data/get-transactions.mdx | 0 ...rkchain-blocks-after-masterchain-block.mdx | 0 .../list-blocks-by-filters.mdx | 0 .../list-messages-by-filters.mdx | 0 .../list-pending-transactions.mdx | 0 .../v3/dns/query-dns-records-ton-tme.mdx | 0 .../v3/jettons/list-jetton-burns.mdx | 0 .../v3/jettons/list-jetton-masters.mdx | 0 .../v3/jettons/list-jetton-transfers.mdx | 0 .../v3/jettons/list-jetton-wallets.mdx | 0 .../estimate-transaction-fees.mdx | 0 .../get-smart-contract-state-legacy-v2.mdx | 0 .../get-wallet-information.mdx | 0 .../run-smart-contract-get-method.mdx | 0 .../send-external-message-boc.mdx | 0 .../toncenter/v3/nfts/get-nft-items.mdx | 0 .../v3/nfts/list-nft-collections.mdx | 0 .../toncenter/v3/nfts/list-nft-transfers.mdx | 0 .../list-top-accounts-by-balance.mdx | 0 .../v3/utils/decode-opcodes-and-bodies-1.mdx | 0 .../v3/utils/decode-opcodes-and-bodies.mdx | 0 .../bridges/overview.mdx => bridges.mdx} | 3 +- ecosystem/explorers/tonviewer.mdx | 2 +- ecosystem/node/overview.mdx | 22 +- .../oracles/overview.mdx | 4 +- .../{interoperability => }/oracles/pyth.mdx | 8 +- .../oracles/redstone.mdx | 16 +- ecosystem/ton-connect/message-lookup.mdx | 2 +- ecosystem/wallet-apps/addresses-workflow.mdx | 2 +- ecosystem/wallet-apps/web.mdx | 6 +- foundations/addresses/formats.mdx | 2 +- foundations/addresses/overview.mdx | 6 +- foundations/config.mdx | 4 +- foundations/fees.mdx | 4 +- foundations/glossary.mdx | 4 +- foundations/hypercube-routing.mdx | 7 - foundations/phases.mdx | 5 +- foundations/proofs.mdx | 7 - foundations/proofs/overview.mdx | 2 +- .../proofs/verifying-liteserver-proofs.mdx | 2 +- {tvm => foundations}/serialization/boc.mdx | 0 {tvm => foundations}/serialization/cells.mdx | 14 +- .../serialization/library.mdx | 2 +- .../serialization/merkle-update.mdx | 2 +- {tvm => foundations}/serialization/merkle.mdx | 2 +- {tvm => foundations}/serialization/pruned.mdx | 2 +- foundations/{statuses.mdx => status.mdx} | 4 +- from-ethereum.mdx | 2 +- index.mdx | 2 +- languages/func/cookbook.mdx | 2 +- languages/func/index.mdx | 4 +- languages/tact.mdx | 16 +- more-tutorials.mdx | 2 +- package.json | 6 +- payments/overview.mdx | 2 +- standard/tokens/jettons/burn.mdx | 2 +- standard/tokens/jettons/find.mdx | 2 +- standard/tokens/jettons/supply-data.mdx | 2 +- standard/tokens/jettons/transfer.mdx | 2 +- standard/tokens/metadata.mdx | 2 +- standard/tokens/nft/how-works.mdx | 2 +- .../tokens/nft/reference-implementation.mdx | 6 +- standard/wallets/highload/v3/create.mdx | 4 +- tvm/overview.mdx | 2 +- tvm/tools/ton-decompiler.mdx | 2 +- tvm/tools/txtracer.mdx | 2 +- 125 files changed, 218 insertions(+), 241 deletions(-) rename ecosystem/{rpc => api}/overview.mdx (100%) rename ecosystem/{rpc => api}/price.mdx (100%) rename ecosystem/{rpc => api}/toncenter/get-api-key.mdx (100%) rename ecosystem/{rpc => api}/toncenter/overview.mdx (100%) rename ecosystem/{rpc => api}/toncenter/rate-limit.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v2.json (100%) rename ecosystem/{rpc => api}/toncenter/v2/accounts/convert-raw-address-to-user-friendly-format.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v2/accounts/convert-user-friendly-address-to-raw-format.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v2/accounts/detect-all-address-formats.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v2/accounts/get-account-balance-only.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v2/accounts/get-account-lifecycle-state.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v2/accounts/get-account-state-and-balance.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v2/accounts/get-detailed-account-state-extended.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v2/accounts/get-nft-or-jetton-metadata.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v2/accounts/get-wallet-information.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v2/accounts/list-account-transactions.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v2/blocks/get-block-header-metadata.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v2/blocks/get-latest-consensus-block.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v2/blocks/get-latest-masterchain-info.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v2/blocks/get-masterchain-block-signatures.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v2/blocks/get-outgoing-message-queue-sizes.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v2/blocks/get-shard-block-proof.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v2/blocks/get-shards-at-masterchain-seqno.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v2/blocks/get-smart-contract-libraries.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v2/blocks/list-block-transactions-extended-details.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v2/blocks/list-block-transactions.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v2/blocks/look-up-block-by-height-lt-or-timestamp.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v2/config/get-all-config-parameters.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v2/config/get-single-config-parameter.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v2/json-rpc/json-rpc-handler.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v2/messages-and-transactions/estimate-transaction-fees.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v2/messages-and-transactions/send-external-message-and-return-hash.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v2/messages-and-transactions/send-external-message-boc.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v2/messages-and-transactions/send-unpacked-external-query.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v2/smart-contracts/run-get-method-on-contract.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v2/transactions/locate-result-transaction-by-incoming-message.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v2/transactions/locate-source-transaction-by-outgoing-message.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v2/transactions/locate-transaction-by-incoming-message.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v3.yaml (100%) rename ecosystem/{rpc => api}/toncenter/v3/accounts/get-account-address-book.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v3/accounts/get-account-metadata.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v3/accounts/get-account-states-with-codedata.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v3/accounts/get-wallet-states-and-balances.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v3/actions-and-traces/list-actions-by-filters-tx-msg-trace.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v3/actions-and-traces/list-completed-traces-with-actions.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v3/actions-and-traces/list-pending-actions.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v3/actions-and-traces/list-pending-traces.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v3/blockchain-data/get-indexed-masterchain-range.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v3/blockchain-data/get-masterchain-block-shard-state.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v3/blockchain-data/get-parentchild-transactions-for-a-hash.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v3/blockchain-data/get-transactions-by-masterchain-block.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v3/blockchain-data/get-transactions-by-message.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v3/blockchain-data/get-transactions.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v3/blockchain-data/get-workchain-blocks-after-masterchain-block.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v3/blockchain-data/list-blocks-by-filters.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v3/blockchain-data/list-messages-by-filters.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v3/blockchain-data/list-pending-transactions.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v3/dns/query-dns-records-ton-tme.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v3/jettons/list-jetton-burns.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v3/jettons/list-jetton-masters.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v3/jettons/list-jetton-transfers.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v3/jettons/list-jetton-wallets.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v3/legacy-v2-compatible/estimate-transaction-fees.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v3/legacy-v2-compatible/get-smart-contract-state-legacy-v2.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v3/legacy-v2-compatible/get-wallet-information.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v3/legacy-v2-compatible/run-smart-contract-get-method.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v3/legacy-v2-compatible/send-external-message-boc.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v3/nfts/get-nft-items.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v3/nfts/list-nft-collections.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v3/nfts/list-nft-transfers.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v3/stats-and-analytics/list-top-accounts-by-balance.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v3/utils/decode-opcodes-and-bodies-1.mdx (100%) rename ecosystem/{rpc => api}/toncenter/v3/utils/decode-opcodes-and-bodies.mdx (100%) rename ecosystem/{interoperability/bridges/overview.mdx => bridges.mdx} (98%) rename ecosystem/{interoperability => }/oracles/overview.mdx (98%) rename ecosystem/{interoperability => }/oracles/pyth.mdx (95%) rename ecosystem/{interoperability => }/oracles/redstone.mdx (91%) delete mode 100644 foundations/hypercube-routing.mdx delete mode 100644 foundations/proofs.mdx rename {tvm => foundations}/serialization/boc.mdx (100%) rename {tvm => foundations}/serialization/cells.mdx (94%) rename {tvm => foundations}/serialization/library.mdx (97%) rename {tvm => foundations}/serialization/merkle-update.mdx (87%) rename {tvm => foundations}/serialization/merkle.mdx (91%) rename {tvm => foundations}/serialization/pruned.mdx (86%) rename foundations/{statuses.mdx => status.mdx} (98%) diff --git a/.prettierignore b/.prettierignore index d636ba68f..7806b52ef 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,3 +1,3 @@ *.mdx -/ecosystem/rpc/toncenter/v2/ -/ecosystem/rpc/toncenter/v3/ +/ecosystem/api/toncenter/v2/ +/ecosystem/api/toncenter/v3/ diff --git a/.remarkignore b/.remarkignore index 401cc9f40..ac093d054 100644 --- a/.remarkignore +++ b/.remarkignore @@ -13,5 +13,5 @@ node_modules/ # Ignore generated files and directories /tvm/instructions.mdx -/ecosystem/rpc/toncenter/v2/ -/ecosystem/rpc/toncenter/v3/ +/ecosystem/api/toncenter/v2/ +/ecosystem/api/toncenter/v3/ diff --git a/CODEOWNERS b/CODEOWNERS index cb44c730f..e7e0a1491 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -29,8 +29,8 @@ # ecosystem/sdks.mdx @verytactical # ecosystem/analytics.mdx @anton-trunov # ecosystem/status.mdx @anton-trunov -# ecosystem/rpc/overview.mdx @tact-lang/smart-contracts -# ecosystem/rpc/toncenter.mdx @tact-lang/smart-contracts +# ecosystem/api/overview.mdx @tact-lang/smart-contracts +# ecosystem/api/toncenter.mdx @tact-lang/smart-contracts # ecosystem/node/overview.mdx @tact-lang/smart-contracts # ecosystem/node/usage.mdx @tact-lang/smart-contracts # ecosystem/node/mytonctrl.mdx @tact-lang/smart-contracts diff --git a/contract-dev/first-smart-contract.mdx b/contract-dev/first-smart-contract.mdx index fa7f871af..283f9fb16 100644 --- a/contract-dev/first-smart-contract.mdx +++ b/contract-dev/first-smart-contract.mdx @@ -132,7 +132,7 @@ fun Storage.save(self) { } ``` -Behind the scenes, structures know how to serialize and deserialize themselves into [cells](/tvm/serialization/cells) — the fundamental way TON stores data. This happens through the `fromCell` and `toCell` functions - Tolk automatically converts between your nice structures and the cell format that TON understands. +Behind the scenes, structures know how to serialize and deserialize themselves into [cells](/foundations/serialization/cells) — the fundamental way TON stores data. This happens through the `fromCell` and `toCell` functions - Tolk automatically converts between your nice structures and the cell format that TON understands. You may think of cells like containers that hold data on TON: - Each cell can store up to 1023 bits of data. @@ -480,7 +480,7 @@ The only difference from the deploy message is that we pass a **body** to it — ### Building message bodies -Construction of cells starts with the `beginCell` method ([learn more about cell serialization](/tvm/serialization/cells)): +Construction of cells starts with the `beginCell` method ([learn more about cell serialization](/foundations/serialization/cells)): - `beginCell()` - creates a new cell builder - `storeUint(value, bits)` - adds an unsigned integer of specified bit length diff --git a/contract-dev/using-onchain-libraries.mdx b/contract-dev/using-onchain-libraries.mdx index f8fc3edef..8ca3ecdc5 100644 --- a/contract-dev/using-onchain-libraries.mdx +++ b/contract-dev/using-onchain-libraries.mdx @@ -5,7 +5,7 @@ title: "Using on-chain libraries" import { Image } from '/snippets/image.jsx'; import { Aside } from '/snippets/aside.jsx'; -It is recommended to read [Library cells](/tvm/serialization/library) first. +It is recommended to read [Library cells](/foundations/serialization/library) first. @@ -79,11 +79,13 @@ If you're just starting to explore TON data on Dune, we recommend checking these arrow href="https://dune.com/ton_foundation/ton-quick-start" /> + + + + -Additionally, a 64-bit prefix of an account id is crucial for the sharding process and delivering messages from one shard to another during [Hypercube Routing](/foundations/hypercube-routing). +Additionally, a 64-bit prefix of an account id is crucial for the sharding process and delivering messages from one shard to another during [Hypercube Routing](/foundations/shards). ## External addresses @@ -99,4 +99,4 @@ addr_extern$01 len:(## 9) external_address:(bits len) For more technical details, refer to: - [Internal address formats](/foundations/addresses/formats): encoding rules and practical examples. -- [Account statuses](/foundations/statuses): how addresses evolve (active, frozen, etc.). +- [Account status](/foundations/status): how addresses evolve (active, frozen, etc.). diff --git a/foundations/config.mdx b/foundations/config.mdx index 28e475f67..f32510c52 100644 --- a/foundations/config.mdx +++ b/foundations/config.mdx @@ -17,10 +17,10 @@ TON features a complex configuration consisting of many technical parameters, so This material should be read alongside the parameter list. -You can view the parameter values in the [current configuration](https://tonviewer.com/config), and the method of writing them into [cells](/tvm/serialization/boc) is outlined in the [block.tlb](https://github.com/ton-blockchain/ton/blob/master/crypto/block/block.tlb) file in [TL-B](/languages/TL-B/overview) format. +You can view the parameter values in the [current configuration](https://tonviewer.com/config), and the method of writing them into [cells](/foundations/serialization/boc) is outlined in the [block.tlb](https://github.com/ton-blockchain/ton/blob/master/crypto/block/block.tlb) file in [TL-B](/languages/TL-B/overview) format. All parameters are in place, and you won't get lost. For your convenience, please use the right sidebar for quick navigation. diff --git a/foundations/fees.mdx b/foundations/fees.mdx index 64ac33fa7..6404e6d61 100644 --- a/foundations/fees.mdx +++ b/foundations/fees.mdx @@ -75,7 +75,7 @@ const fee = shr16ceil( type="note" title="Deduplication" > - The system counts only unique hash cells for storage and forward fees. For example, it counts three identical hash cells as one. This mechanism deduplicates data by storing the content of multiple equivalent sub-cells only once, even if they are referenced across different branches. [Read more about deduplication](/tvm/serialization/library). + The system counts only unique hash cells for storage and forward fees. For example, it counts three identical hash cells as one. This mechanism deduplicates data by storing the content of multiple equivalent sub-cells only once, even if they are referenced across different branches. [Read more about deduplication](/foundations/serialization/library). ## Gas fee @@ -132,7 +132,7 @@ const details = computeMessageForwardFees(msgPrices, internalMessage); ```