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
59 changes: 52 additions & 7 deletions .cspell.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,21 @@
"language": "en-US",
"dictionaryDefinitions": [
{
// Allowed words
"name": "main-list",
"path": "resources/dictionaries/custom.txt",
"addWords": true,
},
{
// Banned words with no clear or correct replacements
// For a few words with those, see the flagWords property later in this file
"name": "deny-list",
"path": "resources/dictionaries/ban.txt"
},
{
"name": "2lw-deny-list",
"path": "resources/dictionaries/two-letter-words-ban.txt"
},
{
"name": "tvm-instructions",
"path": "resources/dictionaries/tvm-instructions.txt"
Expand All @@ -23,43 +30,80 @@
"dictionaries": [
"main-list",
"deny-list",
"2lw-deny-list",
"tvm-instructions",
],
"useGitignore": true,
"files": [
"**/*.{md,mdx}",
"**/*.{js,jsx}",
"**/*.{js,jsx,mjs}",
],
"minWordLength": 3,
"overrides": [
// Enable case sensitivity for Markdown and MDX files only
{
"filename": "**/*.{md,mdx}",
"caseSensitive": true
"caseSensitive": true,
// Known incorrect spellings and correct suggestions
"flagWords": [
"AccountChain->accountchain",
"BaseChain->basechain",
"boc->BoC",
"BOC->BoC",
"Github->GitHub",
"MasterChain->masterchain",
"ShardChain->shardchain",
"Toncenter->TON Center",
"toncoins->Toncoin",
"Toncoins->Toncoin",
"WorkChain->workchain",
],
},
// Do not check for banned words (denylist) in certain files
// Do not check for banned words (denylists or flagWords) in certain files
{
"filename": "contribute/style-guide*.mdx",
"ignoreWords": [
"tos",
"DOI",
"boc",
"BOC",
],
"ignoreRegExpList": [
"\\b[tT]on[a-zA-Z]+\\b", // ton or Ton-prefixed words
"\\b[a-zA-Z]+Chain\\b", // Chain-suffixed words
],
"dictionaries": [
"!deny-list"
"!deny-list", // turns off the dictionary
"!2lw-deny-list", // turns off the dictionary
]
},
{
"filename": "**/api/**/v*",
"filename": "**/api/**/*.{json,yml,yaml}",
"ignoreWords": [
"smc",
],
"dictionaries": [
"!deny-list"
"!deny-list", // turns off the dictionary
"!2lw-deny-list", // turns off the dictionary
]
},
{
"filename": "**/*.{js,jsx,mjs}",
"ignoreWords": [
"Dests",
],
"dictionaries": [
"!deny-list", // turns off the dictionary
"!2lw-deny-list", // turns off the dictionary
]
}
],
"ignorePaths": [
// Some whitepapers
"foundations/whitepapers/tblkch.mdx",
"foundations/whitepapers/ton.mdx",
"foundations/whitepapers/tvm.mdx",
"languages/fift/whitepaper.mdx",
// Generated files
"tvm/instructions.mdx",
// Binaries
Expand All @@ -80,6 +124,7 @@
"**/*.svg",
"**/*.txt",
"CODEOWNERS",
"LICENSE-*",
"snippets/tvm-instruction-table.jsx",
],
"ignoreRegExpList": [
Expand Down Expand Up @@ -110,11 +155,11 @@
"=\\s*\".*?\"", // ="..."
"(?<!\\\\)\\$(?:\\\\.|[^$\\\\])*?\\$", // inline math
"/(?<!\\\\)\\$\\$[\\s\\S]*?\\$\\$/g", // block math
"(?<!\\\\)``.*?``", // inline code with double backticks
"(?<!\\\\)`.*?`", // inline code
"/^([ \\t]*```).*([\\s\\S]*?)^\\1$/gmx", // block code
"^import[ \\t].+$", // import ...
"/^export[ \\t].+?(?=\\r?\\n\\r?\\n)/gms", // export ...
"(?<!\\\\)\\{(?:[^{}]|\\{(?:[^{}]|\\{[^{}]*\\})*\\})*\\}", // jsx expressions in {}
"/\\bton-?[a-z]+/gi", // ton-prefixed product names
],
}
5 changes: 3 additions & 2 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
# The fetch-depth is not set to 0 to prevent the cspell-action
# from misfiring on files that are in main but not on this PR branch

- name: Setup Node.js
uses: actions/setup-node@v4
Expand All @@ -108,6 +108,7 @@ jobs:
with:
check_dot_files: explicit
suggestions: true
config: ".cspell.jsonc"

redirects-check:
name: "Redirects"
Expand Down
1 change: 1 addition & 0 deletions .remarkignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ node_modules/
/tvm/instructions.mdx
/ecosystem/api/toncenter/v2/
/ecosystem/api/toncenter/v3/
/ecosystem/api/toncenter/smc-index/
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ The dictionaries (or vocabularies) for custom words are placed under `resources/

The primary dictionary is `resources/dictionaries/custom.txt` — extend it in case a word exists but was flagged by CSpell as invalid, or in cases where the word does not exist and shall be prohibited. For the latter, use the `!` prefix when adding words.

If an existing two-letter word was flagged as forbidden, remove it from the `resources/dictionaries/two-letter-words-ban.txt` file.

See more: [CSpell docs on custom dictionaries](https://cspell.org/docs/dictionaries/custom-dictionaries).

### Format checks
Expand Down
18 changes: 9 additions & 9 deletions contract-dev/blueprint/api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ Waits for a contract to be deployed by polling the address until the contract ap
export async function run(provider: NetworkProvider) {
// Send deployment transaction
await contract.sendDeploy(provider.sender(), { value: toNano('0.01') });

// Wait for deployment to complete
await provider.waitForDeploy(contract.address);
console.log('Contract deployed successfully');
Expand Down Expand Up @@ -490,14 +490,14 @@ Presents a list of choices to the user and returns the selected option.
```typescript
export async function run(provider: NetworkProvider) {
const ui = provider.ui();

const networks = ['mainnet', 'testnet'];
const selectedNetwork = await ui.choose(
'Select deployment network:',
networks,
(network) => network.toUpperCase()
);

ui.write(`Selected network: ${selectedNetwork}`);
}
```
Expand All @@ -520,10 +520,10 @@ Sets a persistent action prompt that remains visible during operations.
export async function run(provider: NetworkProvider) {
const ui = provider.ui();
ui.setActionPrompt('⏳ Waiting for transaction confirmation...');

await contract.send(provider.sender(), { value: toNano('0.01') }, 'increment');
await provider.waitForLastTransaction();

ui.clearActionPrompt();
ui.write('✅ Transaction confirmed');
}
Expand All @@ -543,10 +543,10 @@ Clears the current action prompt, removing it from display.
export async function run(provider: NetworkProvider) {
const ui = provider.ui();
ui.setActionPrompt('🔄 Processing...');

// Perform some operation
await someAsyncOperation();

ui.clearActionPrompt();
ui.write('Operation completed');
}
Expand Down Expand Up @@ -789,10 +789,10 @@ type Explorer = 'tonscan' | 'tonviewer' | 'toncx' | 'dton';

**Supported explorers:**

- `'tonscan'` — TONScan explorer
- `'tonscan'` — Tonscan explorer
- `'tonviewer'` — Tonviewer explorer (default)
- `'toncx'` — TON.cx explorer
- `'dton'` — dton.io explorer
- `'dton'` — dTON.io explorer

## Configuration

Expand Down
4 changes: 2 additions & 2 deletions contract-dev/blueprint/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ npx blueprint run <SCRIPT> <ARGS...>

- `--tonscan` — use Tonscan explorer
- `--tonviewer` — use Tonviewer explorer (default)
- `--toncx` — use Toncx explorer
- `--dton` — use Dton explorer
- `--toncx` — use TON.cx explorer
- `--dton` — use dTON explorer

**Usage examples:**

Expand Down
2 changes: 1 addition & 1 deletion contract-dev/blueprint/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ npm create ton@latest
- `scripts/` — deployment scripts for Mainnet and Testnet, as well as scripts for interacting with live contracts.
- `tests/` — TypeScript test suite for all contracts, using [Sandbox](https://github.com/ton-org/sandbox) for in-process execution.
- `wrappers/` — TypeScript interface classes for all contracts **except Tact**.
- Each wrapper implements the `Contract` interface from [@ton/core](https://www.npmjs.com/package/@ton/core).
- Each wrapper implements the `Contract` interface from [`@ton/core`](https://www.npmjs.com/package/@ton/core).
- Provides message serialization and deserialization, getter wrappers, and compilation helpers.
- Used in both the test suite and client code to interact with contracts from TypeScript.
- `build/` — compilation artifacts generated by the build command.
2 changes: 1 addition & 1 deletion contract-dev/debug.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: "Debugging smart contracts"
import {Aside} from "/snippets/aside.jsx";

<Aside>
All examples from this article are available on [Github](https://github.com/ton-org/docs-examples/tree/main/guidebook/debug).
All examples from this article are available on [GitHub](https://github.com/ton-org/docs-examples/tree/main/guidebook/debug).
</Aside>

Errors in smart contracts can produce an [exit code](/tvm/exit-codes), often indicating a bug in the contract. Use debugging methods to locate and fix the issue.
Expand Down
10 changes: 5 additions & 5 deletions contract-dev/signing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ TVM exposes additional cryptographic primitives beyond Ed25519. These are useful
| [BLS12-381](https://en.wikipedia.org/wiki/BLS_digital_signature) | Pairing-based operations for signature aggregation and zero-knowledge proofs |
| [Ristretto255](https://en.wikipedia.org/wiki/Curve25519#Ristretto) | Prime-order group over Curve25519 for advanced cryptographic constructions |

For details, see crypto instructions in [TVM instructions](/tvm/instructions), [TVM changelog](/tvm/changelog), or [GlobalVersions.md](https://github.com/ton-blockchain/ton/blob/5c0349110bb03dd3a241689f2ab334ae1a554ffb/doc/GlobalVersions.md).
For details, see crypto instructions in [TVM instructions](/tvm/instructions), [TVM changelog](/tvm/changelog), or [`GlobalVersions.md`](https://github.com/ton-blockchain/ton/blob/5c0349110bb03dd3a241689f2ab334ae1a554ffb/doc/GlobalVersions.md).

This guide focuses on Ed25519, usually used for TON.

Expand Down Expand Up @@ -167,7 +167,7 @@ graph
C ~~~ D
D ~~~ E
E ~~~ F

```

Verification in FunC:
Expand Down Expand Up @@ -215,14 +215,14 @@ graph LR
A[**signature**]
B((msg_inner))
end

subgraph Ref["Signed data (next cell)"]
direction LR
C[valid_until]
D[seqno]
E((actions))
end

A ~~~ B
B -.-> Ref
C ~~~ D
Expand Down Expand Up @@ -276,7 +276,7 @@ Gas comparison:
Conclusion:\
With builder hashing optimization, both approaches are gas-efficient. New contracts can choose based on code simplicity and forward fee considerations.

Reference: [GlobalVersions.md — TVM improvements](https://github.com/ton-blockchain/ton/blob/5c0349110bb03dd3a241689f2ab334ae1a554ffb/doc/GlobalVersions.md#new-tvm-instructions-4)
Reference: [`GlobalVersions.md` — TVM improvements](https://github.com/ton-blockchain/ton/blob/5c0349110bb03dd3a241689f2ab334ae1a554ffb/doc/GlobalVersions.md#new-tvm-instructions-4)

## How to sign messages in TypeScript

Expand Down
2 changes: 1 addition & 1 deletion contract-dev/using-onchain-libraries.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ code:(just
...
```

While it is not crucial to understand the exact representation shown on [https://explorer.toncoin.org/](https://explorer.toncoin.org/) ([more about explorers](/ecosystem/explorers/overview)), the key point is that there is only one cell in the contract code, tagged as `SPECIAL` (indicating it is an exotic cell). Following this is the hexadecimal representation of the library cell's internals. The first byte equals 2, indicating that it is a library cell, and the remaining bytes contain the hash of the referenced cell.
While it is not crucial to understand the exact representation shown on the [TON Explorer](https://explorer.toncoin.org/) ([more about explorers](/ecosystem/explorers/overview)), the key point is that there is only one cell in the contract code, tagged as `SPECIAL`, indicating it is an exotic cell. Following this is the hexadecimal representation of the library cell's internals. The first byte equals 2, indicating that it is a library cell, and the remaining bytes contain the hash of the referenced cell.

Here you can see that the entire contract code consists of the 8‑bit tag equal to 2 and a 256‑bit representation hash of the referenced cell.

Expand Down
2 changes: 1 addition & 1 deletion contribute/style-guide-extended.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ Objective. Make sentences easy to parse on first read. (Why: clear, low‑fricti

- Good: “The API returns JSON.”
- Bad: “The API will return JSON.”
- Prefer imperative instructions without addressing the reader (“you”). Avoid first‑person pronouns (“we”, “I”, “our”); when an organization, product, or service is the actor, use its proper name (e.g., “Toncenter”, “TON”). See [§5.8](#58-dont-get-personal) and [§5.10](#510-pronouns-and-person-references). (Why: imperative, neutral phrasing keeps actors clear without personal address.)
- Prefer imperative instructions without addressing the reader (“you”). Avoid first‑person pronouns (“we”, “I”, “our”); when an organization, product, or service is the actor, use its proper name (e.g., “TON Center”, “TON”). See [§5.8](#58-dont-get-personal) and [§5.10](#510-pronouns-and-person-references). (Why: imperative, neutral phrasing keeps actors clear without personal address.)

### 5.2 Plain, precise wording

Expand Down
2 changes: 1 addition & 1 deletion ecosystem/api/price.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Each swap operation, whether between a native asset (Toncoin) and Jetton or betw

The most common use case for the price API is to fetch Jetton info on the web2 backend and use aggregated data inside the service. There are several historical Jetton price providers in TON:

- [dTon](https://docs.dton.io/about-pnl)
- [dTON](https://docs.dton.io/about-pnl)
- [CoinGecko](https://www.coingecko.com/en/api/ton)
- [Dyor.io](https://dyor.io/tonapi)

Expand Down
2 changes: 1 addition & 1 deletion ecosystem/api/toncenter/v2.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
"Accounts"
],
"summary": "Get wallet information",
"description": "Retrieve wallet information. This method parses contract state and currently supports more wallet types than getExtendedAddressInformation: simple wallet, standart wallet, v3 wallet, v4 wallet.",
"description": "Retrieve wallet information. This method parses contract state and currently supports more wallet types than getExtendedAddressInformation: simple wallet, standard wallet, v3 wallet, v4 wallet.",
"operationId": "get_wallet_information_getWalletInformation_get",
"parameters": [
{
Expand Down
2 changes: 1 addition & 1 deletion ecosystem/explorers/tonviewer.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ Transactions in A, B, C, D, and E all completed with exit code 0. No phase error

5. **Find the failure point**

The issue appears in the payload of **E → D**. According to [Ston.fi docs](https://docs.ston.fi/developer-section/dex/smart-contracts/v2/op-codes#transfer-exit-codes), the `exit_code: 962605456` corresponds to _Swap out token amount is less than provided minimum value_.
The issue appears in the payload of **E → D**. According to [STON.fi docs](https://docs.ston.fi/developer-section/dex/smart-contracts/v2/op-codes#transfer-exit-codes), the `exit_code: 962605456` corresponds to _Swap out token amount is less than provided minimum value_.

This explains why, despite all transactions succeeding, the swap reverted: the output did not satisfy the minimum slippage tolerance.

Expand Down
2 changes: 1 addition & 1 deletion ecosystem/node/mytonctrl/core.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ status_settings
- **`sendTelemetry`** (mode `null`, default `true`) — Enables periodic telemetry submission to TON community services.
- **`telemetryLiteUrl`** (mode `null`, default `https://telemetry.toncenter.com/report_status`) — Endpoint used when telemetry is enabled.
- **`overlayTelemetryUrl`** (mode `null`, default `https://telemetry.toncenter.com/report_overlays`) — Endpoint for overlay network telemetry reports.
- **`duplicateApi`** (mode `null`, default `sendTelemetry`) — Controls whether to forward external messages via Toncenter; default follows the `sendTelemetry` flag.
- **`duplicateApi`** (mode `null`, default `sendTelemetry`) — Controls whether to forward external messages via TON Center; default follows the `sendTelemetry` flag.
- **`duplicateApiUrl`** (mode `null`, default `https://[testnet.]toncenter.com/api/v2/sendBoc`) — API endpoint used when `duplicateApi` is active.
- **`checkAdnl`** (mode `null`, default `sendTelemetry`) — Checks local UDP port and ADNL connectivity; default follows the `sendTelemetry` flag.
- **`liteclient_timeout`** (mode `null`, default `3`) — Default timeout, in seconds, for lite-client calls.
Expand Down
6 changes: 3 additions & 3 deletions ecosystem/node/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ A full node is a software that stores the whole blockchain state locally, opposi
## Do you need your own node?

- **Run your own full node** when you need guaranteed uptime or to serve high-volume workloads without third-party rate limits. Validators and staking services need to install a node and activate validator mode.
- **Rely on public endpoints** when building prototypes or light integrations. Community liteservers and APIs such as [Toncenter](/ecosystem/api/toncenter) or other [RPC providers](/ecosystem/api/overview) already expose the blockchain for read access and transaction submission.
- **Rely on public endpoints** when building prototypes or light integrations. Community liteservers and APIs such as [TON Center](/ecosystem/api/toncenter) or other [RPC providers](/ecosystem/api/overview) already expose the blockchain for read access and transaction submission.

## Pick your target environment

Expand Down Expand Up @@ -54,11 +54,11 @@ To be entitled to propose and validate blocks, other participants elect validato

## Interacting with TON nodes

TON nodes can run in **liteserver mode**, which allows external applications to interact with the TON blockchain. In this mode, the nodes process requests from clients, enabling them to access blockchain data, send transactions, and retrieve information about blocks and transactions. Liteserver uses the Abstract Datagram Network Layer (ADNL) protocol, so you generally also use `ton-http-api` (a Toncenter-like API), which acts as an HTTP-to-ADNL frontend and exposes an HTTP API.
TON nodes can run in **liteserver mode**, which allows external applications to interact with the TON blockchain. In this mode, the nodes process requests from clients, enabling them to access blockchain data, send transactions, and retrieve information about blocks and transactions. Liteserver uses the Abstract Datagram Network Layer (ADNL) protocol, so you generally also use `ton-http-api` (a TON Center-like API), which acts as an HTTP-to-ADNL frontend and exposes an HTTP API.

Full and archive nodes typically enable liteserver mode because they store blockchain history and handle external requests. In contrast, validator nodes do not need it as they focus on validating new blocks efficiently without extra workload from external queries.

You have two options to allow your application to interact with the TON blockchain:

1. To have a stable connection, you can set up your own full or archive node with a liteserver mode and ton-http-api enabled using [MyTonCtrl](/ecosystem/node/setup-mytonctrl).
1. If you cannot set up your TON node with a liteserver, you can use [Toncenter](/ecosystem/api/toncenter) or other [RPC providers](/ecosystem/api/overview).
1. If you cannot set up your TON node with a liteserver, you can use [TON Center](/ecosystem/api/toncenter) or other [RPC providers](/ecosystem/api/overview).
Loading