Skip to content

Commit 2a698f5

Browse files
authored
Merge pull request #553 from ton-community/weekly_update_24-17
Weekly update 24 17
2 parents 3d59f83 + 92e4d97 commit 2a698f5

File tree

20 files changed

+443
-101
lines changed

20 files changed

+443
-101
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/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: 18 additions & 42 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)
2420

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)
21+
- [MEMO Deposits](https://github.com/toncenter/examples/blob/main/deposits.js)
2822

23+
#### Toncoin Withdrawals
2924

30-
- [Detailed info](https://docs.ton.org/develop/dapps/asset-processing#global-overview)
31-
32-
### Jetton
33-
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.**
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+
:::

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

Lines changed: 45 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,51 @@ import Tabs from '@theme/Tabs';
22
import TabItem from '@theme/TabItem';
33
import Button from '@site/src/components/button';
44

5-
# TON Jetton processing
5+
# Jetton Processing
66

7-
Best practices with comments on jettons processing:
7+
## Best Practices on Jettons Processing
88

9-
- [JS algo to accept jettons deposits](https://github.com/toncenter/examples/blob/main/deposits-jettons.js)
9+
Jettons are tokens on TON Blockchain - one can consider them similarly to ERC-20 tokens on Ethereum.
1010

11-
- [JS algo to jettons withdrawals](https://github.com/toncenter/examples/blob/main/withdrawals-jettons-highload.js)
11+
:::info Transaction Confirmation
12+
TON transactions are irreversible after just one confirmation. For the best UX/UI avoid additional waiting.
13+
:::
1214

13-
- [JS code to withdraw (send) jettons from a wallet in batches](https://github.com/toncenter/examples/blob/main/withdrawals-jettons-highload-batch.js)
15+
#### Withdrawal
1416

15-
:::info Transaction Confirmation
16-
TON transactions are irreversible after just one confirmation. For the best user experience, it is suggested to avoid waiting on additional blocks once transactions are finalized on the TON Blockchain. Read more in the [Catchain.pdf](https://docs.ton.org/catchain.pdf#page=3).
17+
[Highload Wallet v3](/participate/wallets/contracts#highload-wallet-v3) - this is TON Blockchain latest solution which is the gold standard for jetton withdrawals. It allows you to take advantage of batched withdrawals.
18+
19+
[Batched withdrawals](https://github.com/toncenter/examples/blob/main/withdrawals-jettons-highload-batch.js) - Meaning that multiple withdrawals are sent in batches, allowing for quick and cheap withdrawals.
20+
21+
#### Deposits
22+
:::info
23+
It is suggested to set several MEMO deposit wallets for better performance.
24+
:::
25+
26+
[Memo Deposits](https://github.com/toncenter/examples/blob/main/deposits-jettons.js) - This allows you to keep one deposit wallet, and users add a memo in order to be identified by your system. This means that you don’t need to scan the entire blockchain, but is slightly less easy for users.
27+
28+
[Memo-less deposits](https://github.com/gobicycle/bicycle) - This solution also exists, but is more difficult to integrate. However, we can assist with this, if you would prefer to take this route. Please notify us before deciding to implement this approach.
29+
30+
### Additional Info
31+
32+
:::caution Transaction Notification
33+
if you will be allowing your users set a custom memo when withdrawing jettons - make sure to set forwardAmount to 0.000000001 TON (1 nanoton) whenever a memo (text comment) is attached, otherwise the transfer will not be standard compliant and will not be able to be processed by other CEXes and other such services.
1734
:::
1835

19-
In most cases, this should be enough for you, if not, you can find detailed information below.
36+
- Please find the JS lib example - [tonweb](https://github.com/toncenter/tonweb) - which is the official JS library from the TON Foundation.
37+
38+
- If you want to use Java, you can look into [ton4j](https://github.com/neodix42/ton4j/tree/main).
39+
40+
- For Go, one should consider [tonutils-go](https://github.com/xssnick/tonutils-go). At the moment, we recommend the JS lib.
41+
2042

2143
## Content List
2244

45+
46+
:::tip
47+
In following docs offers details about Jettons architecture generally, as well as core concepts of TON which may be different from EVM-like and other blockchains. This is crucial reading in order for one to grasp a good understanding of TON, and will greatly help you.
48+
:::
49+
2350
This document describes the following in order:
2451
1. Overview
2552
2. Architecture
@@ -34,9 +61,14 @@ This document describes the following in order:
3461
## Overview
3562

3663
:::info
64+
TON transactions are irreversible after just one confirmation.
3765
For clear understanding, the reader should be familiar with the basic principles of asset processing described in [this section of our documentation](/develop/dapps/asset-processing/). In particular, it is important to be familiar with [contracts](/learn/overviews/addresses#everything-is-a-smart-contract), [wallets](/develop/smart-contracts/tutorials/wallet), [messages](/develop/smart-contracts/guidelines/message-delivery-guarantees) and deployment process.
3866
:::
3967

68+
:::Info
69+
For the best user experience, it is suggested to avoid waiting on additional blocks once transactions are finalized on the TON Blockchain. Read more in the [Catchain.pdf](https://docs.ton.org/catchain.pdf#page=3).
70+
:::
71+
4072
Quick jump to the core description of jetton processing:
4173

4274
<Button href="/develop/dapps/asset-processing/jettons#accepting-jettons-from-users-through-a-centralized-wallet" colorType={'primary'} sizeType={'sm'}>Centralized Proccessing</Button>
@@ -342,6 +374,11 @@ If they match, it’s ideal. If not, then you likely received a scam token that
342374
To prevent a bottleneck in incoming transactions to a single wallet, it is suggested to accept deposits across multiple wallets and to expand the number of these wallets as needed.
343375
:::
344376

377+
378+
:::caution Transaction Notification
379+
if you will be allowing your users set a custom memo when withdrawing jettons - make sure to set forwardAmount to 0.000000001 TON (1 nanoton) whenever a memo (text comment) is attached, otherwise the transfer will not be standard compliant and will not be able to be processed by other CEXes and other such services.
380+
:::
381+
345382
In this scenario, the payment service creates a unique memo identifier for each sender disclosing
346383
the address of the centralized wallet and the amounts being sent. The sender sends the tokens
347384
to the specified centralized address with the obligatory memo in the comment.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# TON Metadata Parsing
1+
# Metadata Parsing
22

33
The metadata standard, which covers NFTs, NFT Collections, and Jettons, is outlined in TON Enhancement Proposal 64 [TEP-64](https://github.com/ton-blockchain/TEPs/blob/master/text/0064-token-data-standard.md).
44

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# TON NFT processing
1+
# NFT Processing
22

33
## Overview
44

0 commit comments

Comments
 (0)