Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync: l10n_main to mandarin_preview #106

Open
wants to merge 241 commits into
base: mandarin_preview
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
241 commits
Select commit Hold shift + click to select a range
3919aa3
Added split and merge shard algorithm
vkokosh Jun 11, 2024
f9804da
Removed block size formula
vkokosh Jun 13, 2024
4a63b01
update inline specifier explanation
RyanHolanda Jul 4, 2024
8724745
Remove tonsdk from bot
Full-Hat Jul 8, 2024
bf7c2af
chore: rollback previous example
RyanHolanda Jul 9, 2024
604a420
Update code from tonsdk to pytoniq
Full-Hat Jul 9, 2024
67ddad0
fix typos
omahs Jul 12, 2024
9cc1131
fix typo
omahs Jul 12, 2024
5240da1
fix typo
omahs Jul 12, 2024
2401c59
fix typos
omahs Jul 12, 2024
db3107c
fix typo
omahs Jul 12, 2024
b2c553b
fix typos
omahs Jul 12, 2024
b996be1
fix typos
omahs Jul 12, 2024
7b1608d
fix typo
omahs Jul 12, 2024
8fe3392
fix typo
omahs Jul 12, 2024
45cc860
fix typo
omahs Jul 12, 2024
bc572e1
fix typo
omahs Jul 12, 2024
a6aa4fa
fix typos
omahs Jul 12, 2024
6f9afa2
fix typo
omahs Jul 12, 2024
36a6953
Update to mytonctrl2 links in FullNode
Full-Hat Jul 14, 2024
eb0a767
Add tip on how to use testnet config in Full Node
Full-Hat Jul 14, 2024
d55b9d9
Add tip about status fast in testnet
Full-Hat Jul 14, 2024
4e2f6d5
Refactor
Full-Hat Jul 14, 2024
7cc340b
Add link for testnet dump for archive node
Full-Hat Jul 14, 2024
772efba
Fix number of outgoing messages
Full-Hat Jul 16, 2024
1abe41d
Remove duplicated
Full-Hat Jul 16, 2024
8bbdc41
Add tlb-parsers.md & Add tlb-codegen & fix link
Full-Hat Jul 16, 2024
fb9fa19
Separate parsers and tl-b generator
Full-Hat Jul 16, 2024
4e8a037
Update academy-overview.md
memearchivarius Jul 20, 2024
f41859b
Add AWS instance description
fmira21 Jul 20, 2024
44c20ed
ecosystem_messages_layout_init
AiramGol Jul 21, 2024
47a715d
ecosystem_messages_layuot_2
AiramGol Jul 21, 2024
7a3a781
ecosystem-messages-layout_3
AiramGol Jul 21, 2024
c33a788
ecosystem-messages-layout_4
AiramGol Jul 21, 2024
edc2681
chrore: add info about gasless transactions
mlikhtar Jul 22, 2024
9ecdce5
Add information about node setup timings
Full-Hat Jul 22, 2024
dd62b91
Revert "ecosystem-messages-layout_4"
AiramGol Jul 23, 2024
96f6968
ecosystem_messages_layout_4
AiramGol Jul 23, 2024
a23f870
cookbook_schemes_update
AiramGol Jul 23, 2024
096dded
Cookbook_update
AiramGol Jul 23, 2024
a820dd4
Cookbook_update_3
AiramGol Jul 23, 2024
d3288fb
Update jetton_transfer_dark.svg
AiramGol Jul 23, 2024
b8ddaf7
Merge pull request #681 from AiramGol/scheme_update_2
reveloper Jul 23, 2024
1ee3866
Fix non latin symbol
Full-Hat Jul 23, 2024
c5eaff9
Scheme_Visio_added
AiramGol Jul 23, 2024
9034cef
Merge pull request #689 from AiramGol/scheme_update_2
reveloper Jul 24, 2024
c1a383d
Update archive-node.md
reveloper Jul 24, 2024
ca3306e
Update enable-liteserver-node.md
reveloper Jul 24, 2024
bf14c7d
Merge pull request #680 from fmira21/main
reveloper Jul 24, 2024
6dc13ab
sidebar_fix
reveloper Jul 25, 2024
c47d9c0
Delete public proxy and C++ compile page
memearchivarius Jul 26, 2024
8db2af4
Merge pull request #690 from memearchivarius/public-proxy
reveloper Jul 26, 2024
4adc61a
Delete public proxy and C++ instruction
memearchivarius Jul 26, 2024
1b3e30d
Revert "Delete public proxy and C++ instruction"
memearchivarius Jul 26, 2024
fb35540
tons_sites_for_apps_page_added
reveloper Jul 27, 2024
e9de32a
Merge pull request #692 from ton-community/ton-sites-fix
reveloper Jul 27, 2024
8760003
Updated after review
vkokosh Jul 30, 2024
70cf5fb
Merge pull request #626 from pixelplex/merge-split-algorithm
reveloper Jul 30, 2024
8b83165
cut_jetton_text
reveloper Jul 31, 2024
7b7bbac
Update how-to-run-ton-site.md
xssnick Jul 31, 2024
e0ea835
Merge pull request #696 from xssnick/patch-1
tsivarev Jul 31, 2024
e8f587a
Update how-to-run-ton-site.md
xssnick Aug 1, 2024
bc55df2
Merge pull request #698 from xssnick/patch-2
tsivarev Aug 1, 2024
69a1d6c
Merge pull request #655 from RyanHolanda/main
reveloper Aug 1, 2024
89ce715
Merge pull request #658 from pixelplex/remove-tonsdk
reveloper Aug 1, 2024
cdf7741
Merge pull request #668 from pixelplex/test-nodes
reveloper Aug 1, 2024
c3e9994
Revert wallet.md typo fix
omahs Aug 1, 2024
bf4aa60
Add error of wrong user usage for nodes
Full-Hat Aug 1, 2024
a5269a9
Merge branch 'main' into patch-1
reveloper Aug 2, 2024
423f20c
Merge pull request #662 from omahs/patch-1
reveloper Aug 2, 2024
097e0e3
Merge pull request #669 from pixelplex/archive-test-node
reveloper Aug 2, 2024
f2cc181
Merge pull request #675 from pixelplex/add-tlb-codegen-link
reveloper Aug 2, 2024
c6278b9
docs(cookbook): update Go address parsing example
70sh1 Aug 2, 2024
c43b84f
Merge pull request #686 from pixelplex/node_wait_time
reveloper Aug 2, 2024
f094a07
Merge pull request #679 from memearchivarius/main
reveloper Aug 2, 2024
c4673c3
Merge pull request #676 from 70sh1/main
reveloper Aug 2, 2024
7845b1c
Merge pull request #682 from pixelplex/page/zero-fees-faq
reveloper Aug 2, 2024
b3a9c90
feat: ton connect tg bot integration archived
IVerhusha Jul 16, 2024
ede0d65
Merge pull request #671 from pixelplex/tg-bot-archived
reveloper Aug 2, 2024
aa24ed8
Merge pull request #702 from pixelplex/node-troubleshooting
reveloper Aug 4, 2024
366027c
Update single-nominator.mdx (#710)
yungwine Aug 6, 2024
43c9ee9
Update single-nominator.mdx (#711)
yungwine Aug 6, 2024
13b7582
collectiong_minging_fix
reveloper Aug 7, 2024
15e8a51
:bug: Fix link in doc (#685)
mar-heaven Aug 7, 2024
8089395
Add some explanation for effective stake (#687)
pixelplex Aug 7, 2024
b2902ee
feat: Add tonconnect vue sdk link (#688)
TonSquare Aug 7, 2024
c2b1f4d
feat: upd wallets switch testnet info (#694)
pixelplex Aug 7, 2024
a754492
Add Error parsing dependencies to troubleshooting (#695)
pixelplex Aug 7, 2024
926314f
Fix typo in mode 0 of send_raw_message (#699)
Jimsparkle Aug 7, 2024
95cd0c2
Update how-to-run-ton-site.md (#700)
xssnick Aug 7, 2024
8c2a184
update ton connect docs, add video (#701)
pixelplex Aug 7, 2024
5c1fecb
Update cookbook.md date->data (#703)
studyzy Aug 7, 2024
c37c623
Update messages.md (#706)
glcanvas Aug 7, 2024
4dd8d49
fix_node_troubleshooting
reveloper Aug 7, 2024
e9db9bc
update troubleshooting (#712)
yungwine Aug 7, 2024
918fd87
update_ton_connect_button
reveloper Aug 7, 2024
d3edb37
Merge branch 'main' of https://github.com/ton-community/ton-docs
reveloper Aug 7, 2024
66aaad2
remove mytonctrl2 branch mentions (#714)
yungwine Aug 8, 2024
17451c8
Scheme update 2 (#707)
AiramGol Aug 9, 2024
413e173
New translations readme.md (Russian)
TonSquare Aug 12, 2024
a12dcca
New translations how-it-works.md (Korean)
TonSquare Aug 12, 2024
3b0c433
New translations how-to-contribute.md (Korean)
TonSquare Aug 12, 2024
27305ea
New translations overview.md (Korean)
TonSquare Aug 12, 2024
ceadb2b
New translations overview.md (Polish)
TonSquare Aug 12, 2024
79b3137
New translations overview.md (Russian)
TonSquare Aug 12, 2024
27a9e20
New translations overview.md (Ukrainian)
TonSquare Aug 12, 2024
d9ca6e0
New translations translation-style-guide.md (Korean)
TonSquare Aug 12, 2024
77e0baf
New translations participate.md (Korean)
TonSquare Aug 12, 2024
9fd737d
New translations participate.md (Chinese Simplified)
TonSquare Aug 12, 2024
cf826dc
New translations guidelines.md (Korean)
TonSquare Aug 12, 2024
1de966b
New translations guidelines.md (Chinese Simplified)
TonSquare Aug 12, 2024
bd91130
New translations sample-tutorial.md (Korean)
TonSquare Aug 12, 2024
75b618d
New translations sample-tutorial.md (Chinese Simplified)
TonSquare Aug 12, 2024
4135339
New translations shards.mdx (Korean)
TonSquare Aug 12, 2024
f56d24d
New translations auditors.mdx (Chinese Simplified)
TonSquare Aug 12, 2024
019af97
New translations outsource.mdx (Chinese Simplified)
TonSquare Aug 12, 2024
4ba4f0b
New translations readme.md (Korean)
TonSquare Aug 12, 2024
117f0a3
New translations getblock-ton-api.md (Korean)
TonSquare Aug 12, 2024
64e72ac
New translations sdk.mdx (Chinese Simplified)
TonSquare Aug 12, 2024
3cf62af
New translations toncenter.md (Korean)
TonSquare Aug 12, 2024
6c5fc11
New translations readme.md (Polish)
TonSquare Aug 12, 2024
832fb0b
New translations readme.md (Russian)
TonSquare Aug 12, 2024
55cea02
New translations readme.md (Ukrainian)
TonSquare Aug 12, 2024
d1ed99b
New translations jettons.md (Polish)
TonSquare Aug 12, 2024
b29ff90
New translations jettons.md (Russian)
TonSquare Aug 12, 2024
52cea04
New translations jettons.md (Ukrainian)
TonSquare Aug 12, 2024
8d49d5f
New translations nfts.md (Chinese Simplified)
TonSquare Aug 12, 2024
ecba40b
New translations ton-payments.md (Chinese Simplified)
TonSquare Aug 12, 2024
c35c22d
New translations design-guidelines.mdx (Chinese Simplified)
TonSquare Aug 12, 2024
ece1822
New translations comparison.md (Chinese Simplified)
TonSquare Aug 12, 2024
95d3c24
New translations integration.md (Chinese Simplified)
TonSquare Aug 12, 2024
430cc18
New translations tg-bot-tonapi-nft.md (Chinese Simplified)
TonSquare Aug 12, 2024
073032f
New translations accept-payments-in-a-telegram-bot.md (Chinese Simpli…
TonSquare Aug 12, 2024
dccf513
New translations send-transactions-from-highload.md (Chinese Simplified)
TonSquare Aug 12, 2024
7d0bfcb
New translations overview.mdx (Polish)
TonSquare Aug 12, 2024
d39017b
New translations overview.mdx (Russian)
TonSquare Aug 12, 2024
a0b80c2
New translations overview.mdx (Ukrainian)
TonSquare Aug 12, 2024
7027135
New translations compiler_directives.md (Chinese Simplified)
TonSquare Aug 12, 2024
1199482
New translations overview.mdx (Polish)
TonSquare Aug 12, 2024
afcc12c
New translations overview.mdx (Ukrainian)
TonSquare Aug 12, 2024
135349e
New translations about_blockchain_oracles.md (Chinese Simplified)
TonSquare Aug 12, 2024
8d65f84
New translations overview.mdx (Polish)
TonSquare Aug 12, 2024
8651ca4
New translations overview.mdx (Russian)
TonSquare Aug 12, 2024
b824cee
New translations overview.mdx (Ukrainian)
TonSquare Aug 12, 2024
25443df
New translations readme.md (Chinese Simplified)
TonSquare Aug 12, 2024
4baedd0
New translations examples.md (Chinese Simplified)
TonSquare Aug 12, 2024
b0cc5b0
New translations governance.md (Chinese Simplified)
TonSquare Aug 12, 2024
2592b9d
New translations overview.mdx (Polish)
TonSquare Aug 12, 2024
aa827df
New translations overview.mdx (Russian)
TonSquare Aug 12, 2024
767f63e
New translations overview.mdx (Ukrainian)
TonSquare Aug 12, 2024
f1707ab
New translations tonstarter.md (Chinese Simplified)
TonSquare Aug 12, 2024
7349bfa
New translations introduction.mdx (Polish)
TonSquare Aug 12, 2024
4e35389
New translations introduction.mdx (Russian)
TonSquare Aug 12, 2024
e031776
New translations introduction.mdx (Ukrainian)
TonSquare Aug 12, 2024
ef0b332
New translations low-level-adnl.md (Chinese Simplified)
TonSquare Aug 12, 2024
a3d66d5
New translations overview.md (Polish)
TonSquare Aug 12, 2024
1650966
New translations overview.md (Russian)
TonSquare Aug 12, 2024
0358d9a
New translations overview.md (Ukrainian)
TonSquare Aug 12, 2024
a7fa49d
New translations addresses.md (Polish)
TonSquare Aug 12, 2024
736844d
New translations addresses.md (Russian)
TonSquare Aug 12, 2024
c6a4e45
New translations addresses.md (Ukrainian)
TonSquare Aug 12, 2024
a9d1687
New translations cells.md (Polish)
TonSquare Aug 12, 2024
85f0839
New translations cells.md (Russian)
TonSquare Aug 12, 2024
615acff
New translations cells.md (Ukrainian)
TonSquare Aug 12, 2024
17d46bc
New translations ton-blockchain.md (Polish)
TonSquare Aug 12, 2024
2198efb
New translations ton-blockchain.md (Russian)
TonSquare Aug 12, 2024
89aa7c5
New translations ton-blockchain.md (Ukrainian)
TonSquare Aug 12, 2024
3de76bf
New translations tvm-initialization.md (Chinese Simplified)
TonSquare Aug 12, 2024
e8c7597
New translations tvm-overview.mdx (Polish)
TonSquare Aug 12, 2024
263e5cd
New translations tvm-overview.mdx (Russian)
TonSquare Aug 12, 2024
16ad77d
New translations tvm-overview.mdx (Ukrainian)
TonSquare Aug 12, 2024
2057893
New translations tvm-upgrade-2023-07.md (Chinese Simplified)
TonSquare Aug 12, 2024
4f3bd41
New translations readme.md (Polish)
TonSquare Aug 12, 2024
8a1406d
New translations readme.md (Russian)
TonSquare Aug 12, 2024
baea5db
New translations readme.md (Ukrainian)
TonSquare Aug 12, 2024
ef9ac86
New translations overview.md (Polish)
TonSquare Aug 12, 2024
676b85a
New translations overview.md (Russian)
TonSquare Aug 12, 2024
70bc245
New translations overview.md (Ukrainian)
TonSquare Aug 12, 2024
ecedfa8
New translations persistent-states.md (Chinese Simplified)
TonSquare Aug 12, 2024
8299c11
New translations overview.mdx (Polish)
TonSquare Aug 12, 2024
63f4398
New translations overview.mdx (Russian)
TonSquare Aug 12, 2024
17a582d
New translations overview.mdx (Ukrainian)
TonSquare Aug 12, 2024
48e16aa
New translations setting-proxy.md (Chinese Simplified)
TonSquare Aug 12, 2024
dddc849
Update nodes-troubleshooting.md
yungwine Aug 12, 2024
deff1cc
Merge pull request #717 from yungwine/patch-8
tsivarev Aug 12, 2024
8f55676
SAP list update
reveloper Aug 13, 2024
d85cc21
New translations jettons.md (Korean)
TonSquare Aug 14, 2024
fe5179c
added contributors wall
SwiftAdviser Aug 14, 2024
8ecb8b2
Merge pull request #110 from ton-community/main
sansx Aug 22, 2024
c850605
New translations overview.mdx (Russian)
TonSquare Sep 18, 2024
a6ad13a
New translations overview.mdx (Russian)
TonSquare Sep 18, 2024
19f60a9
New translations metadata.md (Korean)
TonSquare Sep 25, 2024
a498fb5
New translations nfts.md (Korean)
TonSquare Sep 25, 2024
05f2429
New translations overview.md (Korean)
TonSquare Sep 29, 2024
32f5bb9
New translations readme.md (Korean)
TonSquare Sep 29, 2024
2716666
New translations usdt.md (Korean)
TonSquare Sep 29, 2024
7e77090
New translations jettons.md (Korean)
TonSquare Sep 29, 2024
19f8c24
New translations schemes-guidelines.mdx (Korean)
TonSquare Oct 7, 2024
f3375cd
New translations overview.mdx (Polish)
TonSquare Oct 7, 2024
5be46b2
New translations overview.mdx (Polish)
TonSquare Oct 7, 2024
97a44ef
New translations overview.mdx (Polish)
TonSquare Oct 7, 2024
a212e59
New translations overview.mdx (Ukrainian)
TonSquare Oct 7, 2024
dc5012d
New translations overview.mdx (Ukrainian)
TonSquare Oct 7, 2024
3bc7737
New translations overview.mdx (Ukrainian)
TonSquare Oct 7, 2024
1f8e7e1
New translations overview.mdx (Ukrainian)
TonSquare Oct 7, 2024
9c23094
New translations cell-boc.mdx (Chinese Simplified)
TonSquare Oct 7, 2024
d4951e2
New translations compiler_directives.md (Chinese Simplified)
TonSquare Oct 7, 2024
63cbc84
New translations writing-test-examples.mdx (Chinese Simplified)
TonSquare Oct 7, 2024
8b5a22a
New translations tvm-exit-codes.md (Chinese Simplified)
TonSquare Oct 7, 2024
3ba34e9
New translations tvm-upgrade-2023-07.md (Chinese Simplified)
TonSquare Oct 7, 2024
f25187b
New translations subresolvers.md (Chinese Simplified)
TonSquare Oct 25, 2024
7eb488f
New translations storage-daemon.md (Chinese Simplified)
TonSquare Oct 25, 2024
371d21a
New translations translation-style-guide.md (Korean)
TonSquare Oct 31, 2024
16cd87d
New translations maintainers.md (Korean)
TonSquare Oct 31, 2024
ddde13b
New translations principles-of-a-good-tutorial.md (Korean)
TonSquare Oct 31, 2024
0fac5f3
New translations getblock-ton-api.md (Korean)
TonSquare Oct 31, 2024
daa5bf0
New translations blockchain-of-blockchains.md (Polish)
TonSquare Oct 31, 2024
237d3f1
New translations blockchain-of-blockchains.md (Russian)
TonSquare Oct 31, 2024
d0a4b41
New translations blockchain-of-blockchains.md (Ukrainian)
TonSquare Oct 31, 2024
48028ab
New translations translation-style-guide.md (Chinese Simplified)
TonSquare Oct 31, 2024
1ef4517
New translations maintainers.md (Chinese Simplified)
TonSquare Oct 31, 2024
5ed62d9
New translations principles-of-a-good-tutorial.md (Chinese Simplified)
TonSquare Oct 31, 2024
14f8dc0
New translations subscriptions.md (Chinese Simplified)
TonSquare Oct 31, 2024
d9bc8e5
New translations ton-connect-for-business.md (Chinese Simplified)
TonSquare Oct 31, 2024
47270d2
New translations ton-connect-for-security.md (Chinese Simplified)
TonSquare Oct 31, 2024
527d576
New translations accept-payments-in-a-telegram-bot-2.md (Chinese Simp…
TonSquare Oct 31, 2024
508bfc3
New translations accept-payments-in-a-telegram-bot-js.md (Chinese Sim…
TonSquare Oct 31, 2024
9f67b0c
New translations crc32.md (Chinese Simplified)
TonSquare Oct 31, 2024
a5bc696
New translations fift-deep-dive.md (Chinese Simplified)
TonSquare Oct 31, 2024
0c87299
New translations comments.md (Chinese Simplified)
TonSquare Oct 31, 2024
cf1a3c1
New translations instructions-low-memory.md (Chinese Simplified)
TonSquare Oct 31, 2024
928aef8
New translations minter-flow.md (Chinese Simplified)
TonSquare Oct 31, 2024
c0f0dc4
New translations ide-plugins.md (Chinese Simplified)
TonSquare Oct 31, 2024
0a37614
New translations forward-fees.md (Chinese Simplified)
TonSquare Oct 31, 2024
f9badfb
New translations libraries.md (Chinese Simplified)
TonSquare Oct 31, 2024
7406687
New translations blockchain-of-blockchains.md (Chinese Simplified)
TonSquare Oct 31, 2024
1909623
New translations persistent-states.md (Chinese Simplified)
TonSquare Oct 31, 2024
8ce3d38
New translations running-a-local-ton.md (Chinese Simplified)
TonSquare Oct 31, 2024
8f92e9f
New translations dns.md (Chinese Simplified)
TonSquare Oct 31, 2024
fd01568
New translations connect-with-ton-proxy.md (Chinese Simplified)
TonSquare Oct 31, 2024
77ead9b
New translations overview.md (Russian)
TonSquare Nov 6, 2024
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
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,16 @@ Use Gitpod (a free, online VS code-like IDE) for contributing. It will launch a

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

## Contributors Wall
<a href="https://github.com/ton-community/ton-docs/graphs/contributors">
<img src="https://contrib.rocks/image?repo=ton-community/ton-docs&max=204" />
</a>

<p align="right" style="font-size: 14px; color: #555; margin-top: 20px;">
<a href="#readme-top" style="text-decoration: none; color: blue; font-weight: bold;">
↑ Back to Top ↑
</a>
</p>
## License

[GPL-3.0](https://choosealicense.com/licenses/gpl-3.0/)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import Button from '@site/src/components/button'

# TON Connect for Telegram Bots - Python

:::warning deprecated
This tutorial describes an outdated approach to integrating TON Connect with Telegram bots. We strongly recommend using [Telegram Mini Apps](/develop/dapps/telegram-apps) for a more modern and secure integration.
:::

In this tutorial, we’ll create a sample telegram bot that supports TON Connect 2.0 authentication using Python TON Connect SDK [pytonconnect](https://github.com/XaBbl4/pytonconnect).
We will analyze connecting a wallet, sending a transaction, getting data about the connected wallet, and disconnecting a wallet.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import Button from '@site/src/components/button'

# TON Connect for Telegram Bots

:::warning deprecated
This tutorial describes an outdated approach to integrating TON Connect with Telegram bots. We strongly recommend using [Telegram Mini Apps](/develop/dapps/telegram-apps) for a more modern and secure integration.
:::

In this tutorial, we’ll create a sample telegram bot that supports TON Connect 2.0 authentication using Javascript TON Connect SDK.
We will analyze connecting a wallet, sending a transaction, getting data about the connected wallet, and disconnecting a wallet.

Expand Down Expand Up @@ -206,7 +210,7 @@ import { IStorage } from '@tonconnect/sdk';
const storage = new Map<string, string>(); // temporary storage implementation. We will replace it with the redis later

export class TonConnectStorage implements IStorage {
constructor(private readonly chatId: number) {} // we need to have different stores for different users
constructor(private readonly chatId: number) {} // we need to have different stores for different users

private getKey(key: string): string {
return this.chatId.toString() + key; // we will simply have different keys prefixes for different users
Expand Down Expand Up @@ -269,7 +273,7 @@ Let's analyze what we are doing here. Firstly we fetch the wallets list and crea
After that we subscribe to wallet change. When user connects a wallet, bot will send a message `${wallet.device.appName} wallet connected!`.
Next we find the Tonkeeper wallet and create connection link. In the end we generate a QR code with the link and send it as a photo to the user.

Now you can run the bot (`npm run compile` and `npm run start` then) and send `/connect` message to the bot. Bot should reply with the QR. Scan it with the Tonkeeper wallet. You will see a message `Tonkeeper wallet connected!` in the chat.
Now you can run the bot (`npm run compile` and `npm run start` then) and send `/connect` message to the bot. Bot should reply with the QR. Scan it with the Tonkeeper wallet. You will see a message `Tonkeeper wallet connected!` in the chat.


We will use connector in many places, so let's move connector creating code to a separate file:
Expand Down Expand Up @@ -351,17 +355,17 @@ We will implement following UX for wallet connection:
```text
First screen:
<Unified QR>
<Open @wallet>, <Choose a wallet button (opens second screen)>, <Open wallet unified link>
<Open @wallet>, <Choose a wallet button (opens second screen)>, <Open wallet unified link>

Second screen:
<Unified QR>
<Back (opens first screen)>
<@wallet button (opens third screen)>, <Tonkeeper button (opens third screen)>, <Tonhub button (opens third screen)>, <...>
<@wallet button (opens third screen)>, <Tonkeeper button (opens third screen)>, <Tonhub button (opens third screen)>, <...>

Third screen:
<Selected wallet QR>
<Back (opens second screen)>
<Open selected wallet link>
<Open selected wallet link>
```

Let's start with adding inline keyboard to the `/connect` command handler in the `main.ts`
Expand Down Expand Up @@ -408,7 +412,7 @@ bot.onText(/\/connect/, async msg => {
We need to wrap TonConnect deeplink as https://ton-connect.github.io/open-tc?connect=${encodeURIComponent(link)} because only `http` links are allowed in the Telegram inline keyboard.
Website https://ton-connect.github.io/open-tc just redirects user to link passed in the `connect` query param, so it's only workaround to open `tc://` link in the Telegram.

Note that we replaced `connector.connect` call arguments. Now we are generating a unified link for all wallets.
Note that we replaced `connector.connect` call arguments. Now we are generating a unified link for all wallets.

Next we tell Telegram to call `callback_query` handler with `{ "method": "chose_wallet" }` value when user clicks to the `Choose a Wallet` button.

Expand Down Expand Up @@ -461,7 +465,7 @@ export const walletMenuCallbacks = { // Define buttons callbacks
chose_wallet: onChooseWalletClick
};

bot.on('callback_query', query => { // Parse callback data and execute corresponing function
bot.on('callback_query', query => { // Parse callback data and execute corresponing function
if (!query.data) {
return;
}
Expand All @@ -485,14 +489,14 @@ bot.on('callback_query', query => { // Parse callback data and execute correspon
async function onChooseWalletClick ...
```

Here we define buttons handlers list and `callback_query` parser. Unfortunately callback data is always string, so we have to pass JSON to the `callback_data` and parse it later in the `callback_query` handler.
Here we define buttons handlers list and `callback_query` parser. Unfortunately callback data is always string, so we have to pass JSON to the `callback_data` and parse it later in the `callback_query` handler.
Then we are looking for the requested method and call it with passed parameters.

Now we should add `conenct-wallet-menu.ts` import to the `main.ts`
```ts
// src/main.ts

// ... other imports
// ... other imports

import './connect-wallet-menu';

Expand Down Expand Up @@ -675,7 +679,7 @@ export const walletMenuCallbacks = {
universal_qr: onOpenUniversalQRClick
};

bot.on('callback_query', query => { // Parse callback data and execute corresponing function
bot.on('callback_query', query => { // Parse callback data and execute corresponing function
if (!query.data) {
return;
}
Expand Down Expand Up @@ -830,7 +834,7 @@ async function editQR(message: TelegramBot.Message, link: string): Promise<void>

Compile and run the bot to check how wallet connection works now.

You may note that we haven't considered QR code expiration and stopping connectors yet. We will handle it later.
You may note that we haven't considered QR code expiration and stopping connectors yet. We will handle it later.


At the moment we have the following files structure:
Expand Down Expand Up @@ -951,7 +955,7 @@ export const walletMenuCallbacks = {
};

async function onChooseWalletClick(query: CallbackQuery, _: string): Promise<void> {

// ... other code
```

Expand Down Expand Up @@ -1121,8 +1125,8 @@ bot.onText(/\/my_wallet/, handleShowMyWalletCommand);
Compile and run the bot to check that commands above works correctly.

## Optimisation
We've done all basic commands. But it is important to keep in mind that each connector keeps SSE connection opened until it is paused.
Also, we didn't handle case when user calls `/connect` multiple times, or calls `/connect` or `/send_tx` and doesn't scan the QR. We should set a timeout and close the connection to save server resources.
We've done all basic commands. But it is important to keep in mind that each connector keeps SSE connection opened until it is paused.
Also, we didn't handle case when user calls `/connect` multiple times, or calls `/connect` or `/send_tx` and doesn't scan the QR. We should set a timeout and close the connection to save server resources.
Then we should notify user that QR / transaction request is expired.

### Send transaction optimisation
Expand Down Expand Up @@ -1339,10 +1343,10 @@ export function getConnector(

</details>

This code may look a little tricky, but here we go.
This code may look a little tricky, but here we go.
Here we store a connector, it's cleaning timeout and list of callback that should be executed after the timeout for each user.

When `getConnector` is called we check if there is an existing connector for this `chatId` (user) it the cache. If it exists we reset the cleaning timeout and return the connector.
When `getConnector` is called we check if there is an existing connector for this `chatId` (user) it the cache. If it exists we reset the cleaning timeout and return the connector.
That allows keep active users connectors in cache. It there is no connector in the cache we create a new one, register a timeout clean function and return this connector.

To make it works we have to add a new parameter to the `.env`
Expand Down Expand Up @@ -1396,7 +1400,7 @@ export async function handleConnectCommand(msg: TelegramBot.Message): Promise<vo
const connectedName =
(await getWalletInfo(connector.wallet!.device.appName))?.name ||
connector.wallet!.device.appName;

await bot.sendMessage(
chatId,
`You have already connect ${connectedName} wallet\nYour address: ${toUserFriendlyAddress(
Expand Down Expand Up @@ -1465,9 +1469,9 @@ export async function handleConnectCommand(msg: TelegramBot.Message): Promise<vo

</details>

We defined `newConnectRequestListenersMap` to store cleanup callback for the last connect request for each user.
If user calls `/connect` multiple times, bot will delete previous message with QR.
Also, we subscribed to the connector expiration timeout to delete the QR-code message when it is expired.
We defined `newConnectRequestListenersMap` to store cleanup callback for the last connect request for each user.
If user calls `/connect` multiple times, bot will delete previous message with QR.
Also, we subscribed to the connector expiration timeout to delete the QR-code message when it is expired.


Now we should remove `connector.onStatusChange` subscription from the `connect-wallet-menu.ts` functions,
Expand Down Expand Up @@ -1641,7 +1645,7 @@ export async function buildUniversalKeyboard(
}
```

Here we are adding separate button for @wallet to the First screen (Universal QR screen). All that remains is to use this function in
Here we are adding separate button for @wallet to the First screen (Universal QR screen). All that remains is to use this function in
connect-wallet-menu and command-handlers:


Expand Down Expand Up @@ -1825,7 +1829,7 @@ async function onWalletClick(query: CallbackQuery, data: string): Promise<void>

</details>

Note that we place different links to the QR and button-link (`qrLink` and `buttonLink`),
Note that we place different links to the QR and button-link (`qrLink` and `buttonLink`),
because we don't need redirection when user scans QR by @wallet, and at the same time we need redirect back to the bot when user connects @wallet using button-link.


Expand Down Expand Up @@ -1917,7 +1921,7 @@ export async function handleSendTXCommand(msg: TelegramBot.Message): Promise<voi

</details>

That is it. Now user is able to connect @wallet using special button on the main screen, also we have provided proper return strategy for TG links.
That is it. Now user is able to connect @wallet using special button on the main screen, also we have provided proper return strategy for TG links.

## Add a permanent storage
At this moment we store TonConnect sessions in the Map object. But you may want to store it to the database or other permanent storage to save the sessions when you restart the server.
Expand Down
69 changes: 69 additions & 0 deletions docs/develop/blockchain/sharding-lifecycle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,75 @@ ISP underpins the TON Blockchain's design, treating each account as part of its

Each shardchain, or more precisely, each shardchain block, is identified by a combination of `workchain_id` and a binary prefix `s` of the account_id.

## Algorithm for deciding whether to split or merge

Validators decide whether to split or merge shards in the following way:
1. For each block, block size, gas consumption and lt delta are calculated.
2. Using these values, blocks can be considered overloaded or underloaded.
3. Each shard keeps underload and overload history. If enough recent blocks were underloaded or overloaded, `want_merge` or `want_split` flag is set.
4. Validators merge or split shards using these flags.

### 1. Assessment of the current state of the block

Each block has the following parameters. They are used to determine overload and underload.
1. *Block size estimation* - not an actual block size, but an estimation calculated during collation.
2. *Gas consumption* - total gas consumed in all transactions (excluding ticktock and mint/recover special transactions).
3. *Lt delta* - difference between start and end lt of the block.

### 2. Block limits and classification

Block limits are loaded from the [configuration parameters 22 and 23](/develop/howto/blockchain-configs#param-22-and-23).
Each of the three parameters has three limits: underload, soft, hard:
1. *Block size*: `128/256/512 KiB`.
2. *Gas consumption*: `2M/10M/20M` in basechain, `200K/1M/2.5M` in masterchain.
3. *Lt delta*: `1000/5000/10000`.
Also, there is a medium limit, which is equal to `(soft + hard) / 2`.

We classify the three parameters (size, gas, and lt delta) into categories:
- `0` - underload limit is not reached.
- `1` - underload limit is exceeded.
- `2` - soft limit is exceeded.
- `3` - medium limit is exceeded.
- `4` - hard limit is exceeded.

Block classification is max(`Classification of size`, `Classification of gas`, `Classification of lt delta`). For example: if classification of size is 2, classification of gas is 3, classification of lt delta is 1, then the final block classification is 3.

- When classification of the block is 0 (underload), the block is inclined to merge with its sibling.
- When classification of the block is 2 (soft limit reached), collator stops processing internal messages. The block is inclined to split.
- When classification of the block is 3 (medium limit reached), collator stops processing external messages.

### 3. Determination of overload or underload

After classifying the block, collator checks overload and underload conditions.
Size of the outbound message queue and status of dispatch queue processing is also taken into consideration.
- If the block class is ≥ `2` (soft) and message queue size ≤ `SPLIT_MAX_QUEUE_SIZE = 100000` then the block is overloaded.
- If limit for total processed messages from dispatch queue was reached and message queue size ≤ `SPLIT_MAX_QUEUE_SIZE = 100000` then the block is overloaded.
- If the block class is `0` (underload) and message queue size ≤ `MERGE_MAX_QUEUE_SIZE = 2047` then the block is underloaded.
- If message queue size is ≥ `FORCE_SPLIT_QUEUE_SIZE = 4096` and ≤ `SPLIT_MAX_QUEUE_SIZE = 100000` then the block is overloaded.

### 4. Deciding whether to split or merge

Each block keeps underload and overload history - it is a 64-bit mask of the underload/overload status of the last 64 blocks.
It is used to decide whether to split or merge.

Underload and overload history has a weight, which is calculated as follows:
`one_bits(mask & 0xffff) * 3 + one_bits(mask & 0xffff0000) * 2 + one_bits(mask & 0xffff00000000) - (3 + 2 + 1) * 16 * 2 / 3`
(here `one_bits` is the number of `1`-bits in a mask, and the lower bits correspond to the most recent blocks).

When underload or overload history has a non-negative weight, the flag `want_merge` or `want_split` is set.

### 5. Final decision

Validators decide to split or merge shards using `want_split` and `want_merge` flags and [workchain configuration parameters](/develop/howto/blockchain-configs#param-12).

- If the shard has depth < `min_split` then it will split.
- If the shard has depth > `max_split` then it will merge.
- Shards with depth `min_split` cannot merge, shards with depth `max_split` cannot split.
- If the block has `want_split` flag, the shard will split.
- If the block and its sibling have `want_merge` flag, the shards will merge.

Shards split and merge in `split_merge_delay = 100` seconds after the decision is made.

## Messages and Instant Hypercube Routing (Instant Hypercube Routing)

In the infinite sharding paradigm, each account (or smart-contract) is treated as if it were itself in a separate shardchain.
Expand Down
5 changes: 3 additions & 2 deletions docs/develop/companies/auditors.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,19 @@ Test your software with the following quality assurance providers.

## Primary TON Blockchain SAP

* [certik.com](certik.com)
* [quantstamp.com](https://quantstamp.com/)
* [trailofbits.com](https://www.trailofbits.com/)
* [zellic.io](https://www.zellic.io/)

## TON Ecosystem SAP

* [beosin.com](https://beosin.com/)
* [hackenproof.com](https://hackenproof.com/)
* [hexens.io](https://hexens.io/)
* [scalebit](https://www.scalebit.xyz/)
* [skynet.certik.com](https://skynet.certik.com/)
* [slowmist.com](https://slowmist.com/)
* [softstack.io formerly Chainsulting](https://softstack.io/)
* [trailofbits.com](https://www.trailofbits.com/)
* [vidma.io](https://vidma.io/)


Expand Down
2 changes: 1 addition & 1 deletion docs/develop/dapps/apis/sdk.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ There are different ways to connect to blockchain:

### Python

<!-- tonsdk dropped due to invalid cells serialization -->
<!-- tonsdk dropped due to invalid cells serialization, it is deprecated now -->

| Library | Blockchain connection | Description |
|---------|------------------|--------------|
Expand Down
2 changes: 1 addition & 1 deletion docs/develop/dapps/asset-processing/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Here you can find a **short overview** on [how TON transfers work](/develop/dapp

## Overview on messages and transactions

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](/develop/smart-contracts/guidelines/message-delivery-guarantees) between smart contracts and/or the external world. Each transaction consists of one incoming message and up to 512 outgoing messages.
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](/develop/smart-contracts/guidelines/message-delivery-guarantees) between smart contracts and/or the external world. Each transaction consists of one incoming message and up to 255 outgoing messages.

There are 3 types of messages, that are fully described [here](/develop/smart-contracts/messages#types-of-messages). To put it briefly:
* [external message](/develop/smart-contracts/guidelines/external-messages):
Expand Down
Loading
Loading