tonutils 2.0.1b2__py3-none-any.whl → 2.0.1b3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tonutils/__init__.py +0 -2
- tonutils/__meta__.py +1 -1
- tonutils/clients/__init__.py +5 -9
- tonutils/clients/adnl/__init__.py +5 -1
- tonutils/clients/adnl/balancer.py +319 -125
- tonutils/clients/adnl/client.py +187 -51
- tonutils/clients/adnl/provider/config.py +19 -25
- tonutils/clients/adnl/provider/models.py +4 -0
- tonutils/clients/adnl/provider/provider.py +191 -145
- tonutils/clients/adnl/provider/transport.py +38 -32
- tonutils/clients/adnl/provider/workers/base.py +0 -2
- tonutils/clients/adnl/provider/workers/pinger.py +1 -1
- tonutils/clients/adnl/provider/workers/reader.py +3 -2
- tonutils/clients/adnl/{provider/builder.py → utils.py} +62 -2
- tonutils/clients/http/__init__.py +11 -8
- tonutils/clients/http/balancer.py +75 -63
- tonutils/clients/http/clients/__init__.py +13 -0
- tonutils/clients/http/clients/chainstack.py +48 -0
- tonutils/clients/http/clients/quicknode.py +47 -0
- tonutils/clients/http/clients/tatum.py +56 -0
- tonutils/clients/http/{tonapi/client.py → clients/tonapi.py} +31 -31
- tonutils/clients/http/{toncenter/client.py → clients/toncenter.py} +59 -48
- tonutils/clients/http/providers/__init__.py +4 -0
- tonutils/clients/http/providers/base.py +201 -0
- tonutils/clients/http/providers/response.py +85 -0
- tonutils/clients/http/providers/tonapi/__init__.py +3 -0
- tonutils/clients/http/{tonapi → providers/tonapi}/models.py +1 -0
- tonutils/clients/http/providers/tonapi/provider.py +125 -0
- tonutils/clients/http/providers/toncenter/__init__.py +3 -0
- tonutils/clients/http/{toncenter → providers/toncenter}/models.py +1 -0
- tonutils/clients/http/providers/toncenter/provider.py +119 -0
- tonutils/clients/http/utils.py +140 -0
- tonutils/clients/limiter.py +115 -0
- tonutils/contracts/__init__.py +4 -0
- tonutils/contracts/base.py +33 -20
- tonutils/contracts/dns/methods.py +2 -2
- tonutils/contracts/jetton/methods.py +2 -2
- tonutils/contracts/nft/methods.py +2 -2
- tonutils/contracts/nft/tlb.py +1 -1
- tonutils/{protocols/contract.py → contracts/protocol.py} +29 -29
- tonutils/contracts/telegram/methods.py +2 -2
- tonutils/contracts/vanity/vanity.py +1 -1
- tonutils/contracts/wallet/__init__.py +2 -0
- tonutils/contracts/wallet/base.py +3 -3
- tonutils/contracts/wallet/messages.py +1 -1
- tonutils/contracts/wallet/methods.py +2 -2
- tonutils/{protocols/wallet.py → contracts/wallet/protocol.py} +35 -35
- tonutils/contracts/wallet/versions/v5.py +3 -3
- tonutils/exceptions.py +134 -226
- tonutils/types.py +115 -0
- tonutils/utils.py +3 -3
- {tonutils-2.0.1b2.dist-info → tonutils-2.0.1b3.dist-info}/METADATA +2 -2
- tonutils-2.0.1b3.dist-info/RECORD +93 -0
- tonutils/clients/adnl/provider/limiter.py +0 -56
- tonutils/clients/adnl/stack.py +0 -64
- tonutils/clients/http/chainstack/__init__.py +0 -4
- tonutils/clients/http/chainstack/client.py +0 -63
- tonutils/clients/http/chainstack/provider.py +0 -44
- tonutils/clients/http/quicknode/__init__.py +0 -4
- tonutils/clients/http/quicknode/client.py +0 -60
- tonutils/clients/http/quicknode/provider.py +0 -42
- tonutils/clients/http/tatum/__init__.py +0 -4
- tonutils/clients/http/tatum/client.py +0 -66
- tonutils/clients/http/tatum/provider.py +0 -53
- tonutils/clients/http/tonapi/__init__.py +0 -4
- tonutils/clients/http/tonapi/provider.py +0 -150
- tonutils/clients/http/tonapi/stack.py +0 -71
- tonutils/clients/http/toncenter/__init__.py +0 -4
- tonutils/clients/http/toncenter/provider.py +0 -145
- tonutils/clients/http/toncenter/stack.py +0 -73
- tonutils/protocols/__init__.py +0 -9
- tonutils-2.0.1b2.dist-info/RECORD +0 -98
- /tonutils/{protocols/client.py → clients/protocol.py} +0 -0
- {tonutils-2.0.1b2.dist-info → tonutils-2.0.1b3.dist-info}/WHEEL +0 -0
- {tonutils-2.0.1b2.dist-info → tonutils-2.0.1b3.dist-info}/licenses/LICENSE +0 -0
- {tonutils-2.0.1b2.dist-info → tonutils-2.0.1b3.dist-info}/top_level.txt +0 -0
|
@@ -4,7 +4,7 @@ import typing as t
|
|
|
4
4
|
|
|
5
5
|
from pytoniq_core import Address, Cell, StateInit
|
|
6
6
|
|
|
7
|
-
from tonutils.
|
|
7
|
+
from tonutils.clients.protocol import ClientProtocol
|
|
8
8
|
from tonutils.types import AddressLike, ContractState, ContractStateInfo, WorkchainID
|
|
9
9
|
|
|
10
10
|
if t.TYPE_CHECKING:
|
|
@@ -32,7 +32,7 @@ class ContractProtocol(t.Protocol[_D]):
|
|
|
32
32
|
Implementations usually resolve compiled code from a global registry
|
|
33
33
|
(e.g. CONTRACT_CODES) by using cls.VERSION as a key.
|
|
34
34
|
|
|
35
|
-
:return: Compiled contract code cell
|
|
35
|
+
:return: Compiled contract code cell.
|
|
36
36
|
"""
|
|
37
37
|
|
|
38
38
|
@property
|
|
@@ -70,7 +70,7 @@ class ContractProtocol(t.Protocol[_D]):
|
|
|
70
70
|
"""
|
|
71
71
|
Current contract balance in nanotons.
|
|
72
72
|
|
|
73
|
-
:return: Balance from the latest known state
|
|
73
|
+
:return: Balance from the latest known state.
|
|
74
74
|
"""
|
|
75
75
|
|
|
76
76
|
@property
|
|
@@ -78,7 +78,7 @@ class ContractProtocol(t.Protocol[_D]):
|
|
|
78
78
|
"""
|
|
79
79
|
Current lifecycle state of the contract.
|
|
80
80
|
|
|
81
|
-
:return: One of ContractState values
|
|
81
|
+
:return: One of ContractState values.
|
|
82
82
|
"""
|
|
83
83
|
|
|
84
84
|
@property
|
|
@@ -86,7 +86,7 @@ class ContractProtocol(t.Protocol[_D]):
|
|
|
86
86
|
"""
|
|
87
87
|
Check whether the contract is active.
|
|
88
88
|
|
|
89
|
-
:return: True if state is ACTIVE
|
|
89
|
+
:return: True if state is ACTIVE.
|
|
90
90
|
"""
|
|
91
91
|
|
|
92
92
|
@property
|
|
@@ -94,7 +94,7 @@ class ContractProtocol(t.Protocol[_D]):
|
|
|
94
94
|
"""
|
|
95
95
|
Check whether the contract is frozen.
|
|
96
96
|
|
|
97
|
-
:return: True if state is FROZEN
|
|
97
|
+
:return: True if state is FROZEN.
|
|
98
98
|
"""
|
|
99
99
|
|
|
100
100
|
@property
|
|
@@ -102,7 +102,7 @@ class ContractProtocol(t.Protocol[_D]):
|
|
|
102
102
|
"""
|
|
103
103
|
Check whether the contract is uninitialized.
|
|
104
104
|
|
|
105
|
-
:return: True if state is UNINIT
|
|
105
|
+
:return: True if state is UNINIT.
|
|
106
106
|
"""
|
|
107
107
|
|
|
108
108
|
@property
|
|
@@ -110,7 +110,7 @@ class ContractProtocol(t.Protocol[_D]):
|
|
|
110
110
|
"""
|
|
111
111
|
Check whether the contract does not exist on-chain.
|
|
112
112
|
|
|
113
|
-
:return: True if state is NONEXIST
|
|
113
|
+
:return: True if state is NONEXIST.
|
|
114
114
|
"""
|
|
115
115
|
|
|
116
116
|
@property
|
|
@@ -118,7 +118,7 @@ class ContractProtocol(t.Protocol[_D]):
|
|
|
118
118
|
"""
|
|
119
119
|
Logical time of the last known transaction for this contract.
|
|
120
120
|
|
|
121
|
-
:return: Transaction LT or None if unknown
|
|
121
|
+
:return: Transaction LT or None if unknown.
|
|
122
122
|
"""
|
|
123
123
|
|
|
124
124
|
@property
|
|
@@ -126,7 +126,7 @@ class ContractProtocol(t.Protocol[_D]):
|
|
|
126
126
|
"""
|
|
127
127
|
Hash of the last known transaction for this contract.
|
|
128
128
|
|
|
129
|
-
:return: Transaction hash as hex string or None if unknown
|
|
129
|
+
:return: Transaction hash as hex string or None if unknown.
|
|
130
130
|
"""
|
|
131
131
|
|
|
132
132
|
@property
|
|
@@ -134,7 +134,7 @@ class ContractProtocol(t.Protocol[_D]):
|
|
|
134
134
|
"""
|
|
135
135
|
Contract code cell from the latest known state.
|
|
136
136
|
|
|
137
|
-
:return: Code cell
|
|
137
|
+
:return: Code cell.
|
|
138
138
|
"""
|
|
139
139
|
|
|
140
140
|
@property
|
|
@@ -142,7 +142,7 @@ class ContractProtocol(t.Protocol[_D]):
|
|
|
142
142
|
"""
|
|
143
143
|
Contract data cell from the latest known state.
|
|
144
144
|
|
|
145
|
-
:return: Data cell
|
|
145
|
+
:return: Data cell.
|
|
146
146
|
"""
|
|
147
147
|
|
|
148
148
|
async def refresh(self) -> None:
|
|
@@ -158,10 +158,10 @@ class ContractProtocol(t.Protocol[_D]):
|
|
|
158
158
|
"""
|
|
159
159
|
Construct a contract wrapper from a StateInit object.
|
|
160
160
|
|
|
161
|
-
:param client: TON client to bind to the contract
|
|
162
|
-
:param state_init: StateInit containing code and data
|
|
163
|
-
:param workchain: Target workchain (default: BASECHAIN)
|
|
164
|
-
:return: New contract instance
|
|
161
|
+
:param client: TON client to bind to the contract.
|
|
162
|
+
:param state_init: StateInit containing code and data.
|
|
163
|
+
:param workchain: Target workchain (default: BASECHAIN).
|
|
164
|
+
:return: New contract instance.
|
|
165
165
|
"""
|
|
166
166
|
|
|
167
167
|
@classmethod
|
|
@@ -178,11 +178,11 @@ class ContractProtocol(t.Protocol[_D]):
|
|
|
178
178
|
Implementations usually compose a StateInit from code and data and then
|
|
179
179
|
delegate to from_state_init().
|
|
180
180
|
|
|
181
|
-
:param client: TON client to bind to the contract
|
|
182
|
-
:param code: Contract code cell
|
|
183
|
-
:param data: Contract data cell
|
|
184
|
-
:param workchain: Target workchain (default: BASECHAIN)
|
|
185
|
-
:return: New contract instance
|
|
181
|
+
:param client: TON client to bind to the contract.
|
|
182
|
+
:param code: Contract code cell.
|
|
183
|
+
:param data: Contract data cell.
|
|
184
|
+
:param workchain: Target workchain (default: BASECHAIN).
|
|
185
|
+
:return: New contract instance.
|
|
186
186
|
"""
|
|
187
187
|
|
|
188
188
|
@classmethod
|
|
@@ -198,10 +198,10 @@ class ContractProtocol(t.Protocol[_D]):
|
|
|
198
198
|
Composes StateInit by combining default code with the provided data,
|
|
199
199
|
then delegates to from_state_init().
|
|
200
200
|
|
|
201
|
-
:param client: TON client to bind to the contract
|
|
202
|
-
:param data: Typed data object conforming to _data_model
|
|
203
|
-
:param workchain: Target workchain (default: BASECHAIN)
|
|
204
|
-
:return: New contract instance
|
|
201
|
+
:param client: TON client to bind to the contract.
|
|
202
|
+
:param data: Typed data object conforming to _data_model.
|
|
203
|
+
:param workchain: Target workchain (default: BASECHAIN).
|
|
204
|
+
:return: New contract instance.
|
|
205
205
|
"""
|
|
206
206
|
|
|
207
207
|
@classmethod
|
|
@@ -216,8 +216,8 @@ class ContractProtocol(t.Protocol[_D]):
|
|
|
216
216
|
|
|
217
217
|
Optionally fetches and caches the current contract state from the blockchain.
|
|
218
218
|
|
|
219
|
-
:param client: TON client to bind to the contract
|
|
220
|
-
:param address: Address of the deployed contract
|
|
221
|
-
:param load_state: Whether to fetch current state from blockchain (default: True)
|
|
222
|
-
:return: Contract instance bound to the specified address
|
|
219
|
+
:param client: TON client to bind to the contract.
|
|
220
|
+
:param address: Address of the deployed contract.
|
|
221
|
+
:param load_state: Whether to fetch current state from blockchain (default: True).
|
|
222
|
+
:return: Contract instance bound to the specified address.
|
|
223
223
|
"""
|
|
@@ -2,8 +2,8 @@ import typing as t
|
|
|
2
2
|
|
|
3
3
|
from pytoniq_core import Cell
|
|
4
4
|
|
|
5
|
-
from tonutils.
|
|
6
|
-
from tonutils.
|
|
5
|
+
from tonutils.clients.protocol import ClientProtocol
|
|
6
|
+
from tonutils.contracts.protocol import ContractProtocol
|
|
7
7
|
from tonutils.types import AddressLike
|
|
8
8
|
|
|
9
9
|
|
|
@@ -3,9 +3,9 @@ from __future__ import annotations
|
|
|
3
3
|
from pytoniq_core import StateInit, Address
|
|
4
4
|
from pytoniq_core.tlb.account import TickTock
|
|
5
5
|
|
|
6
|
+
from tonutils.clients.protocol import ClientProtocol
|
|
6
7
|
from tonutils.contracts.base import BaseContract
|
|
7
8
|
from tonutils.contracts.vanity.models import VanityResult
|
|
8
|
-
from tonutils.protocols.client import ClientProtocol
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
class Vanity(BaseContract):
|
|
@@ -44,6 +44,7 @@ from .params import (
|
|
|
44
44
|
WalletV5BetaParams,
|
|
45
45
|
WalletV5Params,
|
|
46
46
|
)
|
|
47
|
+
from .protocol import WalletProtocol
|
|
47
48
|
from .tlb import (
|
|
48
49
|
EncryptedTextCommentBody,
|
|
49
50
|
OutActionSendMsg,
|
|
@@ -96,6 +97,7 @@ __all__ = [
|
|
|
96
97
|
"WalletHighloadV3Data",
|
|
97
98
|
"WalletHighloadV3Params",
|
|
98
99
|
"WalletHighloadV3R1",
|
|
100
|
+
"WalletProtocol",
|
|
99
101
|
"WalletPreprocessedV2",
|
|
100
102
|
"WalletPreprocessedV2Config",
|
|
101
103
|
"WalletPreprocessedV2Data",
|
|
@@ -7,6 +7,7 @@ from pytoniq_core import Address, Cell, StateInit, WalletMessage, begin_cell
|
|
|
7
7
|
from pytoniq_core.crypto.keys import mnemonic_new, mnemonic_to_private_key, words
|
|
8
8
|
from pytoniq_core.crypto.signature import sign_message
|
|
9
9
|
|
|
10
|
+
from tonutils.clients.protocol import ClientProtocol
|
|
10
11
|
from tonutils.contracts.base import BaseContract
|
|
11
12
|
from tonutils.contracts.codes import CONTRACT_CODES
|
|
12
13
|
from tonutils.contracts.wallet.configs import BaseWalletConfig
|
|
@@ -16,10 +17,9 @@ from tonutils.contracts.wallet.messages import (
|
|
|
16
17
|
TONTransferBuilder,
|
|
17
18
|
)
|
|
18
19
|
from tonutils.contracts.wallet.params import BaseWalletParams
|
|
20
|
+
from tonutils.contracts.wallet.protocol import WalletProtocol
|
|
19
21
|
from tonutils.contracts.wallet.tlb import BaseWalletData
|
|
20
22
|
from tonutils.exceptions import ContractError
|
|
21
|
-
from tonutils.protocols.client import ClientProtocol
|
|
22
|
-
from tonutils.protocols.wallet import WalletProtocol
|
|
23
23
|
from tonutils.types import (
|
|
24
24
|
AddressLike,
|
|
25
25
|
ContractStateInfo,
|
|
@@ -330,7 +330,7 @@ class BaseWallet(BaseContract, WalletProtocol[_D, _C, _P], abc.ABC):
|
|
|
330
330
|
:param body: Optional message body (Cell or text comment)
|
|
331
331
|
:param state_init: Optional StateInit for contract deployment
|
|
332
332
|
:param send_mode: Message send mode (default: pay fees separately)
|
|
333
|
-
:param bounce: Whether message should bounce on error
|
|
333
|
+
:param bounce: Whether message should bounce on error
|
|
334
334
|
:param params: Optional transaction parameters
|
|
335
335
|
:return: Signed external message that was sent
|
|
336
336
|
"""
|
|
@@ -15,8 +15,8 @@ from pytoniq_core import (
|
|
|
15
15
|
from tonutils.contracts.jetton.methods import get_wallet_address_get_method
|
|
16
16
|
from tonutils.contracts.jetton.tlb import JettonTransferBody
|
|
17
17
|
from tonutils.contracts.nft.tlb import NFTTransferBody
|
|
18
|
+
from tonutils.contracts.wallet.protocol import WalletProtocol
|
|
18
19
|
from tonutils.contracts.wallet.tlb import TextCommentBody
|
|
19
|
-
from tonutils.protocols.wallet import WalletProtocol
|
|
20
20
|
from tonutils.types import AddressLike, SendMode, DEFAULT_SENDMODE
|
|
21
21
|
from tonutils.utils import (
|
|
22
22
|
cell_to_hex,
|
|
@@ -2,8 +2,8 @@ import typing as t
|
|
|
2
2
|
|
|
3
3
|
from pytoniq_core import Address, Cell
|
|
4
4
|
|
|
5
|
-
from tonutils.
|
|
6
|
-
from tonutils.
|
|
5
|
+
from tonutils.clients.protocol import ClientProtocol
|
|
6
|
+
from tonutils.contracts.protocol import ContractProtocol
|
|
7
7
|
from tonutils.types import AddressLike, Binary, PublicKey
|
|
8
8
|
|
|
9
9
|
|
|
@@ -4,8 +4,8 @@ import typing as t
|
|
|
4
4
|
|
|
5
5
|
from pytoniq_core import Cell, StateInit, WalletMessage
|
|
6
6
|
|
|
7
|
-
from tonutils.
|
|
8
|
-
from tonutils.
|
|
7
|
+
from tonutils.clients.protocol import ClientProtocol
|
|
8
|
+
from tonutils.contracts.protocol import ContractProtocol
|
|
9
9
|
from tonutils.types import (
|
|
10
10
|
AddressLike,
|
|
11
11
|
PublicKey,
|
|
@@ -71,11 +71,11 @@ class WalletProtocol(ContractProtocol, t.Protocol[_D, _C, _P]):
|
|
|
71
71
|
"""
|
|
72
72
|
Create wallet instance from a private key.
|
|
73
73
|
|
|
74
|
-
:param client: TON client for blockchain interactions
|
|
75
|
-
:param private_key: Ed25519 PrivateKey instance
|
|
76
|
-
:param workchain: Target workchain (default: BASECHAIN)
|
|
77
|
-
:param config: Optional wallet configuration
|
|
78
|
-
:return: New wallet instance
|
|
74
|
+
:param client: TON client for blockchain interactions.
|
|
75
|
+
:param private_key: Ed25519 PrivateKey instance.
|
|
76
|
+
:param workchain: Target workchain (default: BASECHAIN).
|
|
77
|
+
:param config: Optional wallet configuration.
|
|
78
|
+
:return: New wallet instance.
|
|
79
79
|
"""
|
|
80
80
|
|
|
81
81
|
@classmethod
|
|
@@ -90,12 +90,12 @@ class WalletProtocol(ContractProtocol, t.Protocol[_D, _C, _P]):
|
|
|
90
90
|
"""
|
|
91
91
|
Create wallet instance from a mnemonic phrase.
|
|
92
92
|
|
|
93
|
-
:param client: TON client for blockchain interactions
|
|
94
|
-
:param mnemonic: BIP39 mnemonic phrase (list or space-separated string)
|
|
95
|
-
:param validate: Whether to validate mnemonic checksum (default: True)
|
|
96
|
-
:param workchain: Target workchain (default: BASECHAIN)
|
|
97
|
-
:param config: Optional wallet configuration
|
|
98
|
-
:return: Tuple of (wallet, public_key, private_key, mnemonic_list)
|
|
93
|
+
:param client: TON client for blockchain interactions.
|
|
94
|
+
:param mnemonic: BIP39 mnemonic phrase (list or space-separated string).
|
|
95
|
+
:param validate: Whether to validate mnemonic checksum (default: True).
|
|
96
|
+
:param workchain: Target workchain (default: BASECHAIN).
|
|
97
|
+
:param config: Optional wallet configuration.
|
|
98
|
+
:return: Tuple of (wallet, public_key, private_key, mnemonic_list).
|
|
99
99
|
"""
|
|
100
100
|
|
|
101
101
|
@classmethod
|
|
@@ -109,11 +109,11 @@ class WalletProtocol(ContractProtocol, t.Protocol[_D, _C, _P]):
|
|
|
109
109
|
"""
|
|
110
110
|
Create a new wallet with a randomly generated mnemonic.
|
|
111
111
|
|
|
112
|
-
:param client: TON client for blockchain interactions
|
|
113
|
-
:param mnemonic_length: Number of words in mnemonic (12, 18, or 24; default: 24)
|
|
114
|
-
:param workchain: Target workchain (default: BASECHAIN)
|
|
115
|
-
:param config: Optional wallet configuration
|
|
116
|
-
:return: Tuple of (wallet, public_key, private_key, mnemonic_list)
|
|
112
|
+
:param client: TON client for blockchain interactions.
|
|
113
|
+
:param mnemonic_length: Number of words in mnemonic (12, 18, or 24; default: 24).
|
|
114
|
+
:param workchain: Target workchain (default: BASECHAIN).
|
|
115
|
+
:param config: Optional wallet configuration.
|
|
116
|
+
:return: Tuple of (wallet, public_key, private_key, mnemonic_list).
|
|
117
117
|
"""
|
|
118
118
|
|
|
119
119
|
async def build_external_message(
|
|
@@ -126,9 +126,9 @@ class WalletProtocol(ContractProtocol, t.Protocol[_D, _C, _P]):
|
|
|
126
126
|
|
|
127
127
|
Constructs a signed external message but does not send it.
|
|
128
128
|
|
|
129
|
-
:param messages: List of internal messages or message builders
|
|
130
|
-
:param params: Optional transaction parameters (seqno, timeout, etc.)
|
|
131
|
-
:return: Signed external message ready for sending
|
|
129
|
+
:param messages: List of internal messages or message builders.
|
|
130
|
+
:param params: Optional transaction parameters (seqno, timeout, etc.).
|
|
131
|
+
:return: Signed external message ready for sending.
|
|
132
132
|
"""
|
|
133
133
|
|
|
134
134
|
async def batch_transfer_message(
|
|
@@ -139,9 +139,9 @@ class WalletProtocol(ContractProtocol, t.Protocol[_D, _C, _P]):
|
|
|
139
139
|
"""
|
|
140
140
|
Build and send a batch transfer message with multiple recipients.
|
|
141
141
|
|
|
142
|
-
:param messages: List of internal messages or message builders
|
|
143
|
-
:param params: Optional transaction parameters
|
|
144
|
-
:return: Signed external message that was sent
|
|
142
|
+
:param messages: List of internal messages or message builders.
|
|
143
|
+
:param params: Optional transaction parameters.
|
|
144
|
+
:return: Signed external message that was sent.
|
|
145
145
|
"""
|
|
146
146
|
|
|
147
147
|
async def transfer_message(
|
|
@@ -152,9 +152,9 @@ class WalletProtocol(ContractProtocol, t.Protocol[_D, _C, _P]):
|
|
|
152
152
|
"""
|
|
153
153
|
Build and send a transfer message for a single recipient.
|
|
154
154
|
|
|
155
|
-
:param message: Internal message or message builder
|
|
156
|
-
:param params: Optional transaction parameters
|
|
157
|
-
:return: Signed external message that was sent
|
|
155
|
+
:param message: Internal message or message builder.
|
|
156
|
+
:param params: Optional transaction parameters.
|
|
157
|
+
:return: Signed external message that was sent.
|
|
158
158
|
"""
|
|
159
159
|
|
|
160
160
|
async def transfer(
|
|
@@ -170,12 +170,12 @@ class WalletProtocol(ContractProtocol, t.Protocol[_D, _C, _P]):
|
|
|
170
170
|
"""
|
|
171
171
|
Build and send a transfer to a single destination.
|
|
172
172
|
|
|
173
|
-
:param destination: Recipient address (Address, string, or domain)
|
|
174
|
-
:param amount: Amount to send in nanotons
|
|
175
|
-
:param body: Optional message body (Cell or text comment)
|
|
176
|
-
:param state_init: Optional StateInit for contract deployment
|
|
177
|
-
:param send_mode: Message send mode (default: pay fees separately)
|
|
178
|
-
:param bounce: Whether message should bounce on error
|
|
179
|
-
:param params: Optional transaction parameters
|
|
180
|
-
:return: Signed external message that was sent
|
|
173
|
+
:param destination: Recipient address (Address, string, or domain).
|
|
174
|
+
:param amount: Amount to send in nanotons.
|
|
175
|
+
:param body: Optional message body (Cell or text comment).
|
|
176
|
+
:param state_init: Optional StateInit for contract deployment.
|
|
177
|
+
:param send_mode: Message send mode (default: pay fees separately).
|
|
178
|
+
:param bounce: Whether message should bounce on error.
|
|
179
|
+
:param params: Optional transaction parameters.
|
|
180
|
+
:return: Signed external message that was sent.
|
|
181
181
|
"""
|
|
@@ -3,6 +3,7 @@ import typing as t
|
|
|
3
3
|
|
|
4
4
|
from pytoniq_core import Cell, WalletMessage, begin_cell
|
|
5
5
|
|
|
6
|
+
from tonutils.clients.protocol import ClientProtocol
|
|
6
7
|
from tonutils.contracts.versions import ContractVersion
|
|
7
8
|
from tonutils.contracts.wallet.base import BaseWallet
|
|
8
9
|
from tonutils.contracts.wallet.configs import (
|
|
@@ -19,8 +20,7 @@ from tonutils.contracts.wallet.methods import (
|
|
|
19
20
|
from tonutils.contracts.wallet.params import WalletV5BetaParams, WalletV5Params
|
|
20
21
|
from tonutils.contracts.wallet.tlb import OutActionSendMsg, WalletV5SubwalletID
|
|
21
22
|
from tonutils.contracts.wallet.tlb import WalletV5BetaData, WalletV5Data
|
|
22
|
-
from tonutils.exceptions import
|
|
23
|
-
from tonutils.protocols.client import ClientProtocol
|
|
23
|
+
from tonutils.exceptions import StateNotLoadedError
|
|
24
24
|
from tonutils.types import NetworkGlobalID, PrivateKey, WorkchainID
|
|
25
25
|
from tonutils.utils import calc_valid_until
|
|
26
26
|
|
|
@@ -220,7 +220,7 @@ class WalletV5R1(
|
|
|
220
220
|
:return: Typed wallet data
|
|
221
221
|
"""
|
|
222
222
|
if not (self._state_info and self._state_info.data):
|
|
223
|
-
raise
|
|
223
|
+
raise StateNotLoadedError(self, missing="state_data")
|
|
224
224
|
|
|
225
225
|
network_global_id = (
|
|
226
226
|
NetworkGlobalID.TESTNET if self.client.network else NetworkGlobalID.MAINNET
|