From b1c8298cc54a744aac3e6d6312188977cb2005c0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=9F=D0=B5=D1=81?=
<96211333+shibdev@users.noreply.github.com>
Date: Fri, 15 Dec 2023 17:25:10 +0000
Subject: [PATCH 01/12] Add pytoniq examples to cookbook.md
---
docs/develop/dapps/cookbook.md | 125 ++++++++++++++++++++++++++++-----
1 file changed, 107 insertions(+), 18 deletions(-)
diff --git a/docs/develop/dapps/cookbook.md b/docs/develop/dapps/cookbook.md
index ea30bb7ee8..4446515877 100644
--- a/docs/develop/dapps/cookbook.md
+++ b/docs/develop/dapps/cookbook.md
@@ -313,16 +313,39 @@ runBlocking {
```
+
+
+```py
+from pytoniq import LiteBalancer, WalletV4R2
+import asyncio
+
+mnemonics = ["your", "mnemonics", "here"]
+
+async def main():
+ provider = LiteBalancer.from_mainnet_config(1)
+ await provider.start_up()
+
+ wallet = await WalletV4R2.from_mnemonic(provider=provider, mnemonics=mnemonics)
+ DESTINATION_ADDRESS = "DESTINATION ADDRESS HERE"
+
+
+ await wallet.transfer(destination=DESTINATION_ADDRESS, amount=int(0.05*1e9), body="Example transfer body")
+
+asyncio.run(main())
+```
+
+
+
### How to calculate user's Jetton wallet address?
-To calculate the user's jetton wallet address, we need to call the "get_wallet_address" get-method of the jetton master contract with user address actually. For this task we can easily use getWalletAddress method from JettonMaster or call master contract by ourselves.
+To calculate the user's jetton wallet address, we need to call the "get_wallet_address" get-method of the jetton master contract with user address actually. For this task we can easily use getWalletAddress method from JettonMaster or call master contract by ourselves.
-```js
+```js
const { Address, beginCell } = require("@ton/core")
const { TonClient, JettonMaster } = require("@ton/ton")
@@ -344,14 +367,14 @@ console.log(await jettonMaster.getWalletAddress(userAddress))
const { Address, beginCell } = require("@ton/core")
const { TonClient } = require("@ton/ton")
-async function getUserWalletAddress(userAddress, jettonMasterAddress) {
+async function getUserWalletAddress(userAddress, jettonMasterAddress) {
const client = new TonClient({
endpoint: 'https://toncenter.com/api/v2/jsonRPC',
});
const userAddressCell = beginCell().storeAddress(userAddress).endCell()
-
+
const response = await client.runMethod(jettonMasterAddress, "get_wallet_address", [{type: "slice", cell: userAddressCell}])
- return response.stack.readAddress()
+ return response.stack.readAddress()
}
const jettonMasterAddress = Address.parse('...') // for example EQBlqsm144Dq6SjbPI4jjZvA1hqTIP3CvHovbIfW_t-SCALE
const userAddress = Address.parse('...')
@@ -402,6 +425,28 @@ println(jettonWalletAddress.toString(userFriendly = true))
```
+
+
+```py
+from pytoniq import LiteBalancer, begin_cell
+import asyncio
+
+async def main():
+ provider = LiteBalancer.from_mainnet_config(1)
+ await provider.start_up()
+
+ JETTON_MASTER_ADDRESS = "EQBlqsm144Dq6SjbPI4jjZvA1hqTIP3CvHovbIfW_t-SCALE"
+ USER_ADDRESS = "EQAsl59qOy9C2XL5452lGbHU9bI3l4lhRaopeNZ82NRK8nlA"
+
+
+ jetton_wallet = (await provider.run_get_method(address=JETTON_MASTER_ADDRESS, method="get_wallet_address",
+ stack=[begin_cell().store_address(USER_ADDRESS).end_cell().begin_parse()]))[0].load_address()
+ print(f"Jetton wallet address for {USER_ADDRESS}: {jetton_wallet.to_str(1, 1, 1)}")
+
+asyncio.run(main())
+```
+
+
### How to construct a message for a jetton transfer with a comment?
@@ -417,12 +462,12 @@ import { Address, beginCell, internal, storeMessageRelaxed, toNano } from "@ton/
async function main() {
const jettonWalletAddress = Address.parse('put your jetton wallet address');
const destinationAddress = Address.parse('put destination wallet address');
-
+
const forwardPayload = beginCell()
.storeUint(0, 32) // 0 opcode means we have a comment
.storeStringTail('Hello, TON!')
.endCell();
-
+
const messageBody = beginCell()
.storeUint(0x0f8a7ea5, 32) // opcode for jetton transfer
.storeUint(0, 64) // query id
@@ -469,12 +514,12 @@ async function main() {
forwardPayload.bits.writeString('Hello, TON!');
/*
- Tonweb has a built-in class for interacting with jettons, which has
- a method for creating a transfer. However, it has disadvantages, so
- we manually create the message body. Additionally, this way we have a
+ Tonweb has a built-in class for interacting with jettons, which has
+ a method for creating a transfer. However, it has disadvantages, so
+ we manually create the message body. Additionally, this way we have a
better understanding of what is stored and how it functions.
*/
-
+
const jettonTransferBody = new TonWeb.boc.Cell();
jettonTransferBody.bits.writeUint(0xf8a7ea5, 32); // opcode for jetton transfer
jettonTransferBody.bits.writeUint(0, 64); // query id
@@ -490,8 +535,8 @@ async function main() {
const jettonWallet = new TonWeb.token.ft.JettonWallet(tonweb.provider, {
address: 'put your jetton wallet address'
});
-
- // available wallet types: simpleR1, simpleR2, simpleR3,
+
+ // available wallet types: simpleR1, simpleR2, simpleR3,
// v2R1, v2R2, v3R1, v3R2, v4R1, v4R2
const wallet = new tonweb.wallet.all['v4R2'](tonweb.provider, {
publicKey: keyPair.publicKey,
@@ -512,6 +557,50 @@ main().finally(() => console.log("Exiting..."));
```
+
+
+
+```py
+from pytoniq import LiteBalancer, WalletV4R2, begin_cell
+import asyncio
+
+mnemonics = ["your", "mnemonics", "here"]
+
+async def main():
+ provider = LiteBalancer.from_mainnet_config(1)
+ await provider.start_up()
+
+ wallet = await WalletV4R2.from_mnemonic(provider=provider, mnemonics=mnemonics)
+ USER_ADDRESS = wallet.address
+ JETTON_MASTER_ADDRESS = "EQBlqsm144Dq6SjbPI4jjZvA1hqTIP3CvHovbIfW_t-SCALE"
+ DESTINATION_ADDRESS = "EQAsl59qOy9C2XL5452lGbHU9bI3l4lhRaopeNZ82NRK8nlA"
+
+ USER_JETTON_WALLET = (await provider.run_get_method(address=JETTON_MASTER_ADDRESS,
+ method="get_wallet_address",
+ stack=[begin_cell().store_address(USER_ADDRESS).end_cell().begin_parse()]))[0]
+ forward_payload = (begin_cell()
+ .store_uint(0, 32) # TextComment op-code
+ .store_snake_string("Comment")
+ .end_cell())
+ transfer_cell = (begin_cell()
+ .store_uint(0xf8a7ea5, 32) # Jetton Transfer op-code
+ .store_uint(0, 64) # query_id
+ .store_coins(1) # Jetton amount to transfer in nanojetton
+ .store_address(DESTINATION_ADDRESS) # Destination address
+ .store_address(USER_ADDRESS) # Response address
+ .store_bit(0) # Custom payload is None
+ .store_coins(0) # Ton forward amount in nanoton
+ .store_bit(1) # Store forward_payload as a reference
+ .store_ref(forward_payload) # Forward payload
+ .end_cell())
+
+ await wallet.transfer(destination=USER_JETTON_WALLET, amount=int(0.05*1e9), body=transfer_cell)
+
+asyncio.run(main())
+```
+
+
+
To indicate that we want to include a comment, we specify 32 zero bits and then write our comment. We also specify the `response destination`, which means that a response regarding the successful transfer will be sent to this address. If we don't want a response, we can specify 2 zero bits instead of an address.
@@ -677,8 +766,8 @@ To begin with, let's assume that the minimum amount of TON for the storage fee i
}
/*
- We need to write our custom serialization and deserialization
- functions to store data correctly in the dictionary since the
+ We need to write our custom serialization and deserialization
+ functions to store data correctly in the dictionary since the
built-in functions in the library are not suitable for our case.
*/
const messageBody = beginCell()
@@ -776,7 +865,7 @@ async function main() {
messageBody.bits.writeUint(0, 64); // query id
messageBody.bits.writeAddress(newOwnerAddress);
- // available wallet types: simpleR1, simpleR2, simpleR3,
+ // available wallet types: simpleR1, simpleR2, simpleR3,
// v2R1, v2R2, v3R1, v3R2, v4R1, v4R2
const keyPair = await mnemonicToKeyPair('put your mnemonic'.split(' '));
const wallet = new tonweb.wallet.all['v4R2'](tonweb.provider, {
@@ -929,7 +1018,7 @@ Additionally, we need to include royalty information in our message, as they als
### Processing Snake Cells
-Some times it's necessary to store long strings (or other large information) while cells can hold **maximum 1023 bits**. In this case, we can use snake cells. Snake cells are cells that contain a reference to another cell, which, in turn, contains a reference to another cell, and so on.
+Some times it's necessary to store long strings (or other large information) while cells can hold **maximum 1023 bits**. In this case, we can use snake cells. Snake cells are cells that contain a reference to another cell, which, in turn, contains a reference to another cell, and so on.
@@ -963,7 +1052,7 @@ function readStringTail(cell) {
let cell = new TonWeb.boc.Cell();
const str = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. In euismod, ligula vel lobortis hendrerit, lectus sem efficitur enim, vel efficitur nibh dui a elit. Quisque augue nisi, vulputate vitae mauris sit amet, iaculis lobortis nisi. Aenean molestie ultrices massa eu fermentum. Cras rhoncus ipsum mauris, et egestas nibh interdum in. Maecenas ante ipsum, sodales eget suscipit at, placerat ut turpis. Nunc ac finibus dui. Donec sit amet leo id augue tempus aliquet. Vestibulum eu aliquam ex, sit amet suscipit odio. Vestibulum et arcu dui.";
cell = writeStringTail(str, cell);
-const text = readStringTail(cell);
+const text = readStringTail(cell);
console.log(text);
```
From b345a758da2112d22b25c7ac15172cd6a3f0ce4b Mon Sep 17 00:00:00 2001
From: Anthony Tsivarev
Date: Sat, 16 Dec 2023 20:18:27 +0100
Subject: [PATCH 02/12] Update full-node.mdx
---
docs/participate/run-nodes/full-node.mdx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/participate/run-nodes/full-node.mdx b/docs/participate/run-nodes/full-node.mdx
index 91c5f615a0..8c0854162f 100644
--- a/docs/participate/run-nodes/full-node.mdx
+++ b/docs/participate/run-nodes/full-node.mdx
@@ -117,7 +117,7 @@ Please, check this video step-by-step tutorial to start promtly:
1. Login to your server as a **non-root** user with **sudo** privileges.
-2. If you don't have a non-root user, create it:
+2. If you don't have a non-root user, login as root and create it:
```bash
sudo adduser
@@ -570,4 +570,4 @@ If you encounter an issue where the `out of sync` equals the timestamp after dow
The recommended solution is to reinstall `mytonctrl` again with the new dump.
:::
-If it takes a very long time to sync, there may have been issues with the dump. Please, [contact us](https://t.me/SwiftAdviser) for assistance.
\ No newline at end of file
+If it takes a very long time to sync, there may have been issues with the dump. Please, [contact us](https://t.me/SwiftAdviser) for assistance.
From 61203a513a444e31ba0e32b3ca030a20c05d1258 Mon Sep 17 00:00:00 2001
From: Anthony Tsivarev
Date: Sat, 16 Dec 2023 22:01:30 +0100
Subject: [PATCH 03/12] Update full-node.mdx
---
docs/participate/run-nodes/full-node.mdx | 28 ++++++++++++++----------
1 file changed, 16 insertions(+), 12 deletions(-)
diff --git a/docs/participate/run-nodes/full-node.mdx b/docs/participate/run-nodes/full-node.mdx
index 8c0854162f..842c4a4394 100644
--- a/docs/participate/run-nodes/full-node.mdx
+++ b/docs/participate/run-nodes/full-node.mdx
@@ -3,7 +3,7 @@ import TabItem from '@theme/TabItem';
# Running a Full Node
-To install and manage your own node, use the **MyTonCtrl** open source tool developed by TON Foundation. The majority of TON Nodes are reliable and tested by **mytonctrl**.
+To install and manage your own node, use the **MyTonCtrl** open-source tool developed by the TON Foundation. The majority of TON Nodes are reliable and tested by **mytonctrl**.
[MyTonCtrl](https://github.com/ton-blockchain/mytonctrl) is a console application that serves as a convenient wrapper for fift, lite-client, and validator-engine-console. It has been specifically developed to streamline wallet, domain, and validator management tasks on the Linux operating system.
@@ -11,7 +11,7 @@ We're collecting feedback about the installation process. If you have any questi
## Prerequisites
-We highly recommend install mytonctrl using the supported operating systems:
+We highly recommend installing mytonctrl using the supported operating systems:
* Ubuntu 20.04
* Ubuntu 22.04
* Debian 11
@@ -20,11 +20,15 @@ Please, use a **non-root user** with **sudo** privileges to install and run myto
## Hardware requirements
-This requirements are for a **full node with a validator**. If you want to run a full node without a validator (e.g. liteserver), you can use a less powerful machine.
+These requirements are for a **full node with a validator**. If you want to run a full node without a validator (e.g., liteserver), you can use a less powerful machine.
-- at least 8 cores CPU
+* 16 x Cores CPU
+* 64GB Memory
+* 1TB NVME SSD OR Provisioned 64+k IOPS storage
+
+- at least 16 Cores CPU
- at least 64 GB RAM
-- at least 512 GB NVMe SSD (25k+ IOPS)
+- at least 1 TB NVME SSD OR Provisioned 64K+ IOPS storage
- 1 Gbit/s network connectivity
- public IP address (_fixed IP address_)
@@ -32,7 +36,7 @@ You need a machine with a **fixed IP address** and a **high-bandwidth network co
### Recommended Providers
-The following providers are recommended by the TON Foundation for running a Validator:
+The TON Foundation recommends the following providers for running a Validator:
#### AWS
@@ -105,7 +109,7 @@ The following providers are recommended by the TON Foundation for running a Vali
[//]: # ()
-Please, check this video step-by-step tutorial to start promtly:
+Please, check this video step-by-step tutorial to start promptly:
- ```python
+ ```python
import asyncio
from pytonlib import TonlibClient
from pathlib import Path
@@ -454,7 +456,7 @@ This way, you can open the port in the firewall settings of your server.
if __name__ == '__main__':
asyncio.run(test_client())
- ```
+ ```
From c0dcb7ecb2276ca245a5180dcadff36e10b4e858 Mon Sep 17 00:00:00 2001
From: Anthony Tsivarev
Date: Sun, 17 Dec 2023 12:59:48 +0100
Subject: [PATCH 08/12] Update liteserver requirements
---
docs/participate/run-nodes/full-node.mdx | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/docs/participate/run-nodes/full-node.mdx b/docs/participate/run-nodes/full-node.mdx
index 20641638eb..3b07cb4578 100644
--- a/docs/participate/run-nodes/full-node.mdx
+++ b/docs/participate/run-nodes/full-node.mdx
@@ -251,9 +251,9 @@ When an endpoint is activated in a full node, the node assumes the role of a **L
Compared to a validator, a liteserver mode requires fewer resources. However, it is still recommended to use a powerful machine to run a liteserver.
-- at least 8 cores CPU
-- at least 8 GB RAM
-- at least 512 GB NVMe SSD
+- at least 16 Cores CPU
+- at least 64 GB RAM
+- at least 1 TB NVME SSD or provisioned 32K+ IOPS storage
- 1 Gbit/s network connectivity
- public IP address (_fixed IP address_)
From ab3beb65011bff5afc5b5300b764cae0ddbbac1d Mon Sep 17 00:00:00 2001
From: Anthony Tsivarev
Date: Sun, 17 Dec 2023 13:35:34 +0100
Subject: [PATCH 09/12] Update full-node.mdx
---
docs/participate/run-nodes/full-node.mdx | 36 ++++++++++++------------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/docs/participate/run-nodes/full-node.mdx b/docs/participate/run-nodes/full-node.mdx
index 3b07cb4578..dd713083d8 100644
--- a/docs/participate/run-nodes/full-node.mdx
+++ b/docs/participate/run-nodes/full-node.mdx
@@ -3,20 +3,20 @@ import TabItem from '@theme/TabItem';
# Running a Full Node
-To install and manage your own node, use the **MyTonCtrl** open-source tool developed by the TON Foundation. The majority of TON Nodes are reliable and tested by **mytonctrl**.
+To install and manage your own node, use the **MyTonCtrl** open-source tool developed by the TON Foundation. The majority of TON Nodes are reliable and tested by **MyTonCtrl**.
[MyTonCtrl](https://github.com/ton-blockchain/mytonctrl) is a console application that is a convenient wrapper for fift, lite-client, and validator-engine-console. It has been specifically developed to streamline wallet, domain, and validator management tasks on the Linux operating system.
-We're collecting feedback about the installation process. If you have any questions or suggestions, please, [contact us](https://t.me/SwiftAdviser).
+We are actively seeking feedback about the installation process. If you have any questions or suggestions, please [contact us](https://t.me/SwiftAdviser).
## Prerequisites
-We highly recommend installing mytonctrl using the supported operating systems:
+We highly recommend installing MyTonCtrl using the supported operating systems:
* Ubuntu 20.04
* Ubuntu 22.04
* Debian 11
-Please, use a **non-root user** with **sudo** privileges to install and run mytonctrl.
+Please, use a **non-root user** with **sudo** privileges to install and run MyTonCtrl.
## Hardware requirements
@@ -28,7 +28,7 @@ These requirements are for a **full node with a validator**. If you want to run
- 1 Gbit/s network connectivity
- public IP address (_fixed IP address_)
-You need a machine with a **fixed IP address** and a **high-bandwidth network connection** to run a TON Blockchain Full Node. Typically, you'll need a sufficiently powerful server in a data center with good network connectivity, using at least a 1 Gbit/s connection to reliably accommodate peak loads (the average load is expected to be approximately 100 Mbit/s).
+You need a machine with a **fixed IP address** and a **high-bandwidth network connection** to run a TON Blockchain Full Node. Typically, you'll need a sufficiently powerful server in a data center with reliable network connectivity, utilizing at least a 1 Gbit/s connection to accommodate peak loads reliably (the average load is expected to be approximately 100 Mbit/s).
### Recommended Providers
@@ -98,7 +98,7 @@ The TON Foundation recommends the following providers for running a Validator:
- **Public IP:** Fixed IP address included with instance.
:::info
-**Note:** Prices, configurations, and availability may vary. Always check the respective cloud provider's official documentation and pricing pages before making a decision.
+**Note:** Prices, configurations, and availability may vary. It is advisable to always check the official documentation and pricing pages of the respective cloud provider before making any decisions.
:::
## How to run a Node? (video)
@@ -136,7 +136,7 @@ su -
```
-### Install the mytonctrl
+### Install the MyTonCtrl
Download and run the installation script from the **non-root** user account with **sudo** privileges. Choose your Linux distributive:
@@ -169,13 +169,13 @@ This will reduce synchronization time by several times.
### Run the mytonctrl
-1. Run **mytonctrl** console from the local user account used for installation in step 1:
+1. Run **MyTonCtrl** console from the local user account used for installation in step 1:
```sh
sudo mytonctrl
```
-2. Check the mytonctrl status using the `status` command:
+2. Check the MyTonCtrl status using the `status` command:
```sh
status
@@ -199,7 +199,7 @@ Wait until `Local validator out of sync` becomes less than 20 seconds.
### View the List of Wallets
-Check out the list of available wallets in the **mytonctrl** console using the `wl` command:
+Check out the list of available wallets in the **MyTonCtrl** console using the `wl` command:
```sh
wl
@@ -259,7 +259,7 @@ Compared to a validator, a liteserver mode requires fewer resources. However, it
### Installation of liteserver
-1. Complete the previous steps to install [mytonctrl](/participate/run-nodes/full-node#step-by-step-instructions).
+1. Complete the previous steps to install [MyTonCtrl](/participate/run-nodes/full-node#step-by-step-instructions).
2. Create a config file
@@ -286,7 +286,7 @@ cat ~/config.json
### Check the firewall settings
-First, verify the Liteserver port specified in your `config.json` file. This port changes with each new installation of `mytonctrl`. It is located in the `port` field:
+First, verify the Liteserver port specified in your `config.json` file. This port changes with each new installation of `MyTonCtrl`. It is located in the `port` field:
```json
{
@@ -373,7 +373,7 @@ This way, you can open the port in the firewall settings of your server.
-2. Initialize client and request masterchain info to make sure liteserver is running.
+2. Initialize a client and request masterchain info to ensure the liteserver is running.
@@ -545,10 +545,10 @@ It should allow incoming connections on one specific port and outgoing connectio
### Validator console is not settings
-If you see this error this means that you run `mytonctrl` not from the user you've installed it.
+If you encounter this error, it indicates that you are running `MyTonCtrl` from a user other than the one you used for the installation.
:::tip Solution
-Run `mytonctrl` from the user you've installed it (non-root sudo user).
+Run `MyTonCtrl` from the user you've installed it (non-root sudo user).
```bash
sudo mytonctrl
@@ -567,10 +567,10 @@ Retry request up to three times.
### Out of Sync Issue with -d Flag
-If you encounter an issue where the `out of sync` equals the timestamp after downloading `mytonctrl` with the `-d` flag, it's possible that the dump wasn't installed correctly (or it's already outdated).
+If you encounter an issue where the `out of sync` equals the timestamp after downloading `MyTonCtrl` with the `-d` flag, it's possible that the dump wasn't installed correctly (or it's already outdated).
:::tip Solution
-The recommended solution is to reinstall `mytonctrl` again with the new dump.
+The recommended solution is to reinstall `MyTonCtrl` again with the new dump.
:::
-If it takes a very long time to sync, there may have been issues with the dump. Please, [contact us](https://t.me/SwiftAdviser) for assistance.
+If syncing takes an unusually long time, there may have been issues with the dump. Please [contact us](https://t.me/SwiftAdviser) for assistance.
From 9a7ab30582e719719ab45266a7bbecbb0f5b911a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=9F=D0=B5=D1=81?=
<96211333+shibdev@users.noreply.github.com>
Date: Sun, 17 Dec 2023 13:57:20 +0000
Subject: [PATCH 10/12] Update examples
---
docs/develop/dapps/cookbook.md | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/docs/develop/dapps/cookbook.md b/docs/develop/dapps/cookbook.md
index 4446515877..8c87448985 100644
--- a/docs/develop/dapps/cookbook.md
+++ b/docs/develop/dapps/cookbook.md
@@ -330,6 +330,7 @@ async def main():
await wallet.transfer(destination=DESTINATION_ADDRESS, amount=int(0.05*1e9), body="Example transfer body")
+ await client.close_all()
asyncio.run(main())
```
@@ -442,6 +443,7 @@ async def main():
jetton_wallet = (await provider.run_get_method(address=JETTON_MASTER_ADDRESS, method="get_wallet_address",
stack=[begin_cell().store_address(USER_ADDRESS).end_cell().begin_parse()]))[0].load_address()
print(f"Jetton wallet address for {USER_ADDRESS}: {jetton_wallet.to_str(1, 1, 1)}")
+ await client.close_all()
asyncio.run(main())
```
@@ -589,12 +591,13 @@ async def main():
.store_address(DESTINATION_ADDRESS) # Destination address
.store_address(USER_ADDRESS) # Response address
.store_bit(0) # Custom payload is None
- .store_coins(0) # Ton forward amount in nanoton
+ .store_coins(1) # Ton forward amount in nanoton
.store_bit(1) # Store forward_payload as a reference
.store_ref(forward_payload) # Forward payload
.end_cell())
await wallet.transfer(destination=USER_JETTON_WALLET, amount=int(0.05*1e9), body=transfer_cell)
+ await client.close_all()
asyncio.run(main())
```
From 1bcf9645af3c468c935493f65330a934df235b25 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=9F=D0=B5=D1=81?=
<96211333+shibdev@users.noreply.github.com>
Date: Sun, 17 Dec 2023 13:58:21 +0000
Subject: [PATCH 11/12] Update docs/develop/dapps/cookbook.md
Co-authored-by: Maksim Kurbatov <94808996+yungwine@users.noreply.github.com>
---
docs/develop/dapps/cookbook.md | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/docs/develop/dapps/cookbook.md b/docs/develop/dapps/cookbook.md
index 8c87448985..c79a47d76c 100644
--- a/docs/develop/dapps/cookbook.md
+++ b/docs/develop/dapps/cookbook.md
@@ -440,8 +440,9 @@ async def main():
USER_ADDRESS = "EQAsl59qOy9C2XL5452lGbHU9bI3l4lhRaopeNZ82NRK8nlA"
- jetton_wallet = (await provider.run_get_method(address=JETTON_MASTER_ADDRESS, method="get_wallet_address",
- stack=[begin_cell().store_address(USER_ADDRESS).end_cell().begin_parse()]))[0].load_address()
+ result_stack = await provider.run_get_method(address=JETTON_MASTER_ADDRESS, method="get_wallet_address",
+ stack=[begin_cell().store_address(USER_ADDRESS).end_cell().begin_parse()])
+ jetton_wallet = result_stack[0].load_address()
print(f"Jetton wallet address for {USER_ADDRESS}: {jetton_wallet.to_str(1, 1, 1)}")
await client.close_all()
From 4d94ff531dcee7d099838ee27a74a235e1789f83 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=9F=D0=B5=D1=81?=
<96211333+shibdev@users.noreply.github.com>
Date: Sun, 17 Dec 2023 14:03:03 +0000
Subject: [PATCH 12/12] Update docs/develop/dapps/cookbook.md
Co-authored-by: Maksim Kurbatov <94808996+yungwine@users.noreply.github.com>
---
docs/develop/dapps/cookbook.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/develop/dapps/cookbook.md b/docs/develop/dapps/cookbook.md
index c79a47d76c..bee9f87eb6 100644
--- a/docs/develop/dapps/cookbook.md
+++ b/docs/develop/dapps/cookbook.md
@@ -444,7 +444,7 @@ async def main():
stack=[begin_cell().store_address(USER_ADDRESS).end_cell().begin_parse()])
jetton_wallet = result_stack[0].load_address()
print(f"Jetton wallet address for {USER_ADDRESS}: {jetton_wallet.to_str(1, 1, 1)}")
- await client.close_all()
+ await provider.close_all()
asyncio.run(main())
```