Skip to content

Commit 94faf4e

Browse files
committed
Resolve conflicts
2 parents 1c33d90 + 6f378fd commit 94faf4e

File tree

40 files changed

+1434
-461
lines changed

40 files changed

+1434
-461
lines changed

.github/labeler.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
- i18n/**/*
99

1010
"documentation :book:":
11-
- README.md
11+
- academy-overview.md
1212

1313
"tooling :wrench:":
1414
- .github/**/*

docs/develop/archive/mining.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ Yes, there is a third-party app—[TON Miner Bot](https://t.me/TonMinerBot).
9999
#### <a id="faq-general-stats"></a>Where can I see mining statistics?
100100
[ton.org/mining](https://ton.org/mining)
101101
#### <a id="faq-general-howmany"></a>How many miners are out there?
102-
We cannot say this. All we know is the total hashrate of all miners on the network. However, there are graphs on [ton.org/mining](https://ton.org/mining) that attempt to estimate quantity of machines of certan type needed to provide aproximate total hashrate.
102+
We cannot say this. All we know is the total hashrate of all miners on the network. However, there are graphs on [ton.org/mining](https://ton.org/mining) that attempt to estimate quantity of machines of certain type needed to provide approximate total hashrate.
103103
#### <a id="faq-general-noincome"></a>Do I need Toncoin to start mining?
104104
No, you do not. Anyone can start mining without owning a single Toncoin.
105105
#### <a id="faq-mining-noincome"></a>I mine for hours, why my wallet total does not increase, not even by 1 TON?

docs/develop/blockchain/shards.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Several such <b>AccountChains</b> combined within a single shard form a <b>Shard
4545
These groups of accounts are denoted by a common binary prefix, which serves as a criterion for clustering them in the same shard.
4646
This prefix appears in shard id which presented by a 64-bit integer and has the following structure: `<binary prefix>100000...`. For example, shard with id `1011100000...` contains all accounts started with prefix `1011`.
4747

48-
When number of transactions in some shard growth, it splits into two shards. New shards obtaining the following ids: `<parent prefix>01000...` and `<parent prefix>11000...` and responsible for accounts starting with `<parent prefix>0` and `<parent prefix>1` correspondingly. The seqnos of blocks in shards goes continuously starting from parent last seqno plus 1. After split shards go independently and may have different seqnos.
48+
When number of transactions in some shard grows, this shard splits into two shards. New shards obtain the following ids: `<parent prefix>01000...` and `<parent prefix>11000...` and become responsible for accounts starting with `<parent prefix>0` and `<parent prefix>1` correspondingly. The seqnos of blocks in shards go continuously starting from the parent last seqno plus 1. After split, shards go independently and may have different seqnos.
4949

5050
A simple example:
5151
![](/img/docs/blockchain-fundamentals/shardchains-split.jpg)
@@ -54,12 +54,12 @@ Masterchain block contains information about shards in its header. After the blo
5454

5555
An actual example:
5656
* Masterchain block `seqno=34607821` has 2 shards: `(0,4000000000000000,40485798)` and `(0,c000000000000000,40485843)` (https://toncenter.com/api/v2/shards?seqno=34607821).
57-
* Shard `shard=4000000000000000` was splitted into `shard=2000000000000000` and `shard=6000000000000000` and masterchain block `seqno=34607822` already has 3 shards: `(0,2000000000000000,40485799)` and `(0,6000000000000000,40485799)`. Note, that both new shards has the same seqnos but different shard IDs (https://toncenter.com/api/v2/shards?seqno=34607822).
58-
* New shards go independently and after 100 masterchain blocks (in masterchain block `seqno=34607921`) one shard has last block `(0,2000000000000000,40485901)` and another one has `(0,6000000000000000,40485897)` (https://toncenter.com/api/v2/shards?seqno=34607921).
57+
* Shard `shard=4000000000000000` was splitted into `shard=2000000000000000` and `shard=6000000000000000`, and the masterchain block `seqno=34607822` obtains 3 shards: `(0,2000000000000000,40485799)` and `(0,6000000000000000,40485799)`. Note that both new shards have the same seqnos but different shard IDs (https://toncenter.com/api/v2/shards?seqno=34607822).
58+
* New shards go independently and after 100 masterchain blocks (in masterchain block `seqno=34607921`) one shard has the last block `(0,2000000000000000,40485901)` and another one has `(0,6000000000000000,40485897)` (https://toncenter.com/api/v2/shards?seqno=34607921).
5959

6060
## Merging
61-
When shards load goes down they can merge back as follow:
62-
* Two shards can merge if they have common parent and, therefore, their shard ids are `<parent prefix>010...` and `<parent prefix110...`. Merged shard will have shard id `<parent prefix>10...` (for example `10010...` + `10110...` = `1010...`). The first block of merged shard will have `seqno=max(seqno1, seqno2) + 1`.
61+
If the load on shards goes down they can merge back:
62+
* Two shards can merge if they have a common parent and, therefore, their shard ids are `<parent prefix>010...` and `<parent prefix110...`. Merged shard will have shard id `<parent prefix>10...` (for example `10010...` + `10110...` = `1010...`). The first block of a merged shard will have `seqno=max(seqno1, seqno2) + 1`.
6363

6464
A simple example:
6565
![](/img/docs/blockchain-fundamentals/shardchains-merge.jpg)

docs/develop/companies/outsource.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ Coinvent is a dedicated outsource development team, passionately committed to cr
104104
### softstack
105105

106106
#### Summary
107-
Softstack formerly known as Chainsulting, is a leading provider of comprehensive Web3 solutions, with a focus on software development and smart contract auditing.
107+
Softstack is a leading service provider of comprehensive Web3 solutions, since 2017, with a focus on software development and smart contract auditing. Made in Germany
108108

109109
#### Workstreams
110110
- Smart Contract & dApp Development
@@ -122,7 +122,7 @@ Softstack formerly known as Chainsulting, is a leading provider of comprehensive
122122
#### Contacts
123123
- hello@softstack.io
124124
- [softstack.io](https://softstack.io/)
125-
- Telegram [@softstack](https://t.me/softstack)
125+
- Telegram [@yannikheinze](https://t.me/yannikheinze)
126126

127127
## Add your team
128128

docs/develop/dapps/apis/sdk.mdx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
# SDK list (if you've decided on functionality)
1+
# SDKs
22

3-
Please use the sidebar navigation to choose the preferred programming language!
3+
Instant navigate on preferred language with right sidebar.
44

5-
:::tip
5+
## Overview
66

77
There are different ways to connect to blockchain:
88
1. RPC data provider or other API: in most cases, you have to *rely* on its stability and security.
99
2. ADNL connection: you're connecting to a [liteserver](/participate/run-nodes/liteserver). They might be inaccessible, but with a certain level of validation (implemented in the library), cannot lie.
1010
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.
1111
4. Offchain-only. Such SDKs allow to create and serialize cells, which you can then send to APIs.
1212

13-
:::
1413

1514
### TypeScript / JavaScript
1615

@@ -21,19 +20,24 @@ There are different ways to connect to blockchain:
2120
|[tonkite/adnl](https://github.com/tonkite/adnl)|[ADNL](/develop/network/adnl-tcp) natively / via WebSocket| ADNL TypeScript implementation. |
2221
|[tonutils](https://github.com/thekiba/tonutils)|Native [ADNL](/develop/network/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.|
2322

23+
### Java
24+
| Library | Blockchain connection | Description |
25+
|---------|------------------|--------------|
26+
| [ton4js](https://github.com/neodix42/ton4j) | Tonlib binary | Java SDK for The Open Network (TON) |
27+
2428

2529
### Python
2630

2731
<!-- tonsdk dropped due to invalid cells serialization -->
2832

2933
| Library | Blockchain connection | Description |
3034
|---------|------------------|--------------|
31-
|[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.|
32-
|[pytoniq-core](https://github.com/yungwine/pytoniq-core) | *offchain-only* | Python powerful transport-free SDK |
3335
|[pytoniq](https://github.com/yungwine/pytoniq) |Native ADNL| Python SDK with native LiteClient and other ADNL-based protocols implementations. |
34-
|[tonpy](https://github.com/disintar/tonpy)|Native ADNL| Python package that provides data structures and API to interact with TON blockchain. |
35-
|[mytonlib](https://github.com/igroman787/mytonlib)|Native ADNL| Native Python SDK library for working with The Open Network |
36+
|[pytoniq-core](https://github.com/yungwine/pytoniq-core) | *offchain-only* | Python powerful transport-free SDK |
3637
|[pytonlib](https://github.com/toncenter/pytonlib)|Tonlib binary| This is standalone Python library based on libtonlibjson, brought as a binary dependency from TON monorepo. |
38+
|[mytonlib](https://github.com/igroman787/mytonlib)|Native ADNL| Native Python SDK library for working with The Open Network |
39+
|[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.|
40+
|[tonpy](https://github.com/disintar/tonpy)|Native ADNL| Python package that provides data structures and API to interact with TON blockchain. |
3741
|[tvm_valuetypes](https://github.com/toncenter/tvm_valuetypes)|*offchain-only*| library is collection of utilits for handling TVM types. |
3842
|[pytvm](https://github.com/yungwine/pytvm) | *offchain*, Tonlib | Python TVM emulator using bindings to C++ standard emulator |
3943

docs/develop/dapps/apis/toncenter.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ There are different ways to connect to blockchain:
3434

3535
Indexers allow to list jetton wallets, NFTs, transactions by certain filters, not only retrieve specific ones.
3636

37-
- Public TON Index can be used: tests and development are for free, premium for production - [toncenter.com/api/v3/](https://toncenter.com/api/v3/).
37+
- 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/).
3838
- 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).
3939

4040
### GraphQL Nodes

docs/develop/dapps/asset-processing/README.md

Lines changed: 38 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Button from '@site/src/components/button'
22

3-
# Payments processing
3+
# Processing Global Overview
44

55
This page contains an overview and specific details that explain how to process (send and accept) digital assets on the TON blockchain.
66

@@ -10,75 +10,51 @@ TON transactions are irreversible after just one confirmation. For the best user
1010

1111
## Best Practices
1212

13-
### Fundamentals for Wallet
14-
15-
- [Create a key pair, a wallet and get a wallet address](https://github.com/toncenter/examples/blob/main/common.js)
16-
1713
### Toncoin
1814

1915
#### Toncoin Deposits
16+
2017
:::info
21-
It is suggested to accept deposits across multiple wallets on your side.
18+
It is suggested to set several MEMO deposit wallets for better performance.
2219
:::
23-
- [JS code to accept Toncoin deposits](https://github.com/toncenter/examples/blob/main/deposits.js)
24-
25-
#### Toncoin Withdrawals
26-
- [JS code to withdraw (send) Toncoin from a wallet in batches](https://github.com/toncenter/examples/blob/main/withdrawals-highload-batch.js)
27-
- [JS code to withdraw (send) Toncoins from a wallet](https://github.com/toncenter/examples/blob/main/withdrawals-highload.js)
2820

21+
- [MEMO Deposits](https://github.com/toncenter/examples/blob/main/deposits.js)
2922

30-
- [Detailed info](https://docs.ton.org/develop/dapps/asset-processing#global-overview)
31-
32-
### Jetton
23+
#### Toncoin Withdrawals
3324

34-
#### Jetton Deposits
35-
:::info
36-
It is suggested to accept deposits across multiple wallets on your side.
37-
:::
25+
- [Batched withdrawals](https://github.com/toncenter/examples/blob/main/withdrawals-highload-batch.js)
26+
- [Withdrawals](https://github.com/toncenter/examples/blob/main/withdrawals-highload.js)
3827

39-
- [JS code to accept jettons deposits](https://github.com/toncenter/examples/blob/main/deposits-jettons.js)
4028

41-
#### Jetton Withdrawals
42-
- [JS code to withdraw (send) jettons from a wallet](https://github.com/toncenter/examples/blob/main/withdrawals-jettons-highload.js)
43-
- [JS code to withdraw (send) jettons from a wallet in batches](https://github.com/toncenter/examples/blob/main/withdrawals-jettons-highload-batch.js)
29+
- [Detailed info](/develop/dapps/asset-processing#global-overview)
4430

45-
- [Detailed info](https://docs.ton.org/develop/dapps/asset-processing/jettons)
31+
### Jetton
4632

47-
## Other Examples
33+
- [Read Jetton Proccesing](/develop/dapps/asset-processing/jettons)
4834

49-
### Self-hosted service
5035

51-
#### Made by community
36+
### Made by TON Community
5237

53-
[Gobicycle](https://github.com/gobicycle/bicycle) service is focused on replenishing user balances and sending payments to blockchain accounts. Both TONs and Jettons are supported. The service is written with numerous pitfalls in mind that a developer might encounter (all checks for jettons, correct operations status check, resending messages, performance during high load when blockchain is splitted by shards). Provide simple HTTP API, rabbit and webhook notifications about new payments.
38+
#### GO
5439

55-
### JavaScript
40+
- [Gobicycle](https://github.com/gobicycle/bicycle) - service is focused on replenishing user balances and sending payments to blockchain accounts. Both TONs and Jettons are supported. The service is written with numerous pitfalls in mind that a developer might encounter (all checks for jettons, correct operations status check, resending messages, performance during high load when blockchain is splitted by shards). Provide simple HTTP API, rabbit and webhook notifications about new payments.
41+
- [GO examples](https://github.com/xssnick/tonutils-go#how-to-use)
5642

57-
#### Made by community
43+
#### JavaScript
5844

5945
Using ton.js SDK (supported by TON Community):
6046

47+
- [Create a key pair, a wallet and get a wallet address](https://github.com/toncenter/examples/blob/main/common.js)
6148
- [Create a wallet, get its balance, make a transfer](https://github.com/ton-community/ton#usage)
6249

63-
### Python
64-
65-
#### Made by community
66-
67-
Using psylopunk/pytonlib (Simple Python client for The Open Network):
68-
69-
- [Sending transactions](https://github.com/psylopunk/pytonlib/blob/main/examples/transactions.py)
50+
#### Python
7051

7152
Using tonsdk library (similar to tonweb):
7253

7354
- [Init wallet, create external message to deploy the wallet](https://github.com/tonfactory/tonsdk#create-mnemonic-init-wallet-class-create-external-message-to-deploy-the-wallet)
7455

75-
### Golang
76-
77-
#### Made by community
78-
79-
- [See full list of examples](https://github.com/xssnick/tonutils-go#how-to-use)
8056

81-
## Global overview
57+
## Global Overview
8258
Embodying a fully asynchronous approach, TON Blockchain involves a few concepts which are uncommon to traditional blockchains. Particularly, each interaction of any actor with the blockchain consists of a graph of asynchronously transferred messages between smart contracts and/or the external world. The common path of any interaction starts with an external message sent to a `wallet` smart contract, which authenticates the message sender using public-key cryptography, takes charge of fee payment, and sends inner blockchain messages. That way, transactions on the TON network are not synonymous with user interaction with the blockchain but merely nodes of the message graph: the result of accepting and processing a message by a smart contract, which may or may not lead to the emergence of new messages. The interaction may consist of an arbitrary number of messages and transactions and span a prolonged period of time. Technically, transactions with queues of messages are aggregated into blocks processed by validators. The asynchronous nature of the TON Blockchain **does not allow to predict the hash and lt (logical time) of a transaction** at the stage of sending a message. The transaction accepted to the block is final and cannot be modified.
8359

8460
**Each inner blockchain message is a message from one smart contract to another, which bears some amount of digital assets, as well as an arbitrary portion of data.**
@@ -87,6 +63,12 @@ Smart contract guidelines recommend treating the data payload, which begins with
8763

8864
Smart contracts **pay fees for transactions** (usually from the balance of an incoming message) as well as a **storage fee for the contract's stored code and data**. Fees depend on workchain configs with maximal fees on `masterchain` and substantially lower fees on `basechain`.
8965

66+
![](/img/docs/asset-processing/msg_dag_example.svg)
67+
68+
* `external message` is the input message for `wallet A v4` contract with empty soure (a message from nowhere, such as [Tonkeeper](https://tonkeeper.com/)).
69+
* `outgoing message` is the output message for `wallet A v4` contract and input message for `wallet B v4` contract with `wallet A v4` source and `wallet B v4` destination.
70+
71+
As a result there are 2 transactions with their set of input and output messages.
9072

9173
## Digital assets on TON
9274
TON has three types of digital assets.
@@ -143,6 +125,8 @@ A contract's transactions can be obtained using [getTransactions](https://github
143125
4. Incoming payments are transactions in which the incoming message has a source address; outgoing payments are transactions in which the incoming message has no source address and also presents the outgoing messages. These transactions should be processed accordingly.
144126
5. If all of those 10 transactions are unseen, the next 10 transactions should be loaded and steps 2,3,4,5 should be repeated.
145127

128+
## Checking transactions' flow
129+
It's possible to track messages flow during transaction processing. Since the message flow is a DAG it's enough to get the input `in_msg` or output `out_msgs` messages of current transaction using [getTransactions](https://toncenter.com/api/v2/#/transactions/get_transactions_getTransactions_get) method to find incoming transaction with [tryLocateResultTx](https://testnet.toncenter.com/api/v2/#/transactions/get_try_locate_result_tx_tryLocateResultTx_get) or outgoing transactions with [tryLocateSourceTx](https://testnet.toncenter.com/api/v2/#/transactions/get_try_locate_source_tx_tryLocateSourceTx_get).
146130

147131
## Accepting payments
148132
There are a few approaches to accepting payments that differ in their method of distinguishing users.
@@ -160,13 +144,20 @@ To accept payments based on attached comments, the service should
160144
### Invoices with ton:// link
161145

162146
If you need an easy integration for a simple user flow, it is suitable to use the ton:// link.
163-
Best suited for one-time payments and invoices.
147+
Best suited for one-time payments and invoices with Toncoin.
164148

165-
```bash
149+
```text
166150
ton://transfer/<destination-address>?
167-
[nft=<nft-address>&]
168-
[fee-amount=<nanocoins>&]
169-
[forward-amount=<nanocoins>]
151+
[amount=<toncoin-in-nanocoins>&]
152+
[text=<url-encoded-utf8-comment>]
153+
```
154+
155+
Example of ton:// link generation:
156+
157+
```typescript
158+
const tonLink = `ton://transfer/${address.toString({
159+
urlSafe: true,
160+
})}?amount=${amount}${text ? `&text=${encodeURIComponent(text)}` : ''}`;
170161
```
171162

172163
- ✅ Easy integration
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import Tabs from '@theme/Tabs';
2+
import TabItem from '@theme/TabItem';
3+
4+
# Wallet Address Validation
5+
6+
### How to Check the Validity of a TON Wallet Address?
7+
8+
9+
10+
<Tabs groupId="address-examples">
11+
12+
<TabItem value="Tonweb" label="JS (Tonweb)">
13+
14+
```js
15+
const TonWeb = require("tonweb")
16+
TonWeb.utils.Address.isValid('...')
17+
```
18+
19+
</TabItem>
20+
<TabItem value="GO" label="tonutils-go">
21+
22+
```python
23+
package main
24+
25+
import (
26+
"fmt"
27+
"github.com/xssnick/tonutils-go/address"
28+
)
29+
30+
if _, err := address.ParseAddr("EQCD39VS5j...HUn4bpAOg8xqB2N"); err != nil {
31+
return errors.New("invalid address")
32+
}
33+
```
34+
35+
36+
</TabItem>
37+
<TabItem value="Java" label="Ton4j">
38+
39+
```javascript
40+
try {
41+
Address.of("...");
42+
} catch (e) {
43+
// not valid address
44+
}
45+
```
46+
47+
</TabItem>
48+
<TabItem value="Kotlin" label="ton-kotlin">
49+
50+
```javascript
51+
try {
52+
AddrStd("...")
53+
} catch(e: IllegalArgumentException) {
54+
// not valid address
55+
}
56+
```
57+
58+
</TabItem>
59+
</Tabs>
60+
61+
:::tip
62+
Full Address description on the [Smart Contract Addresses](/learn/overviews/addresses) page.
63+
:::

0 commit comments

Comments
 (0)