tonutils 2.0.1b1__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.
Files changed (79) hide show
  1. tonutils/__init__.py +0 -2
  2. tonutils/__meta__.py +1 -1
  3. tonutils/clients/__init__.py +5 -9
  4. tonutils/clients/adnl/__init__.py +5 -1
  5. tonutils/clients/adnl/balancer.py +319 -125
  6. tonutils/clients/adnl/client.py +187 -51
  7. tonutils/clients/adnl/provider/config.py +19 -25
  8. tonutils/clients/adnl/provider/models.py +4 -0
  9. tonutils/clients/adnl/provider/provider.py +191 -145
  10. tonutils/clients/adnl/provider/transport.py +38 -32
  11. tonutils/clients/adnl/provider/workers/base.py +0 -2
  12. tonutils/clients/adnl/provider/workers/pinger.py +1 -1
  13. tonutils/clients/adnl/provider/workers/reader.py +3 -2
  14. tonutils/clients/adnl/{provider/builder.py → utils.py} +62 -2
  15. tonutils/clients/http/__init__.py +11 -8
  16. tonutils/clients/http/balancer.py +75 -63
  17. tonutils/clients/http/clients/__init__.py +13 -0
  18. tonutils/clients/http/clients/chainstack.py +48 -0
  19. tonutils/clients/http/clients/quicknode.py +47 -0
  20. tonutils/clients/http/clients/tatum.py +56 -0
  21. tonutils/clients/http/{tonapi/client.py → clients/tonapi.py} +31 -31
  22. tonutils/clients/http/{toncenter/client.py → clients/toncenter.py} +59 -48
  23. tonutils/clients/http/providers/__init__.py +4 -0
  24. tonutils/clients/http/providers/base.py +201 -0
  25. tonutils/clients/http/providers/response.py +85 -0
  26. tonutils/clients/http/providers/tonapi/__init__.py +3 -0
  27. tonutils/clients/http/{tonapi → providers/tonapi}/models.py +1 -0
  28. tonutils/clients/http/providers/tonapi/provider.py +125 -0
  29. tonutils/clients/http/providers/toncenter/__init__.py +3 -0
  30. tonutils/clients/http/{toncenter → providers/toncenter}/models.py +1 -0
  31. tonutils/clients/http/providers/toncenter/provider.py +119 -0
  32. tonutils/clients/http/utils.py +140 -0
  33. tonutils/clients/limiter.py +115 -0
  34. tonutils/contracts/__init__.py +18 -0
  35. tonutils/contracts/base.py +33 -20
  36. tonutils/contracts/dns/methods.py +2 -2
  37. tonutils/contracts/jetton/methods.py +2 -2
  38. tonutils/contracts/nft/methods.py +2 -2
  39. tonutils/contracts/nft/tlb.py +1 -1
  40. tonutils/{protocols/contract.py → contracts/protocol.py} +29 -29
  41. tonutils/contracts/telegram/methods.py +2 -2
  42. tonutils/contracts/vanity/__init__.py +17 -0
  43. tonutils/contracts/vanity/models.py +39 -0
  44. tonutils/contracts/vanity/tlb.py +40 -0
  45. tonutils/contracts/vanity/vanity.py +40 -0
  46. tonutils/contracts/wallet/__init__.py +2 -0
  47. tonutils/contracts/wallet/base.py +3 -3
  48. tonutils/contracts/wallet/messages.py +1 -1
  49. tonutils/contracts/wallet/methods.py +2 -2
  50. tonutils/{protocols/wallet.py → contracts/wallet/protocol.py} +35 -35
  51. tonutils/contracts/wallet/versions/v5.py +3 -3
  52. tonutils/exceptions.py +134 -226
  53. tonutils/types.py +115 -0
  54. tonutils/utils.py +3 -3
  55. {tonutils-2.0.1b1.dist-info → tonutils-2.0.1b3.dist-info}/METADATA +4 -4
  56. tonutils-2.0.1b3.dist-info/RECORD +93 -0
  57. tonutils/clients/adnl/provider/limiter.py +0 -56
  58. tonutils/clients/adnl/stack.py +0 -64
  59. tonutils/clients/http/chainstack/__init__.py +0 -4
  60. tonutils/clients/http/chainstack/client.py +0 -63
  61. tonutils/clients/http/chainstack/provider.py +0 -44
  62. tonutils/clients/http/quicknode/__init__.py +0 -4
  63. tonutils/clients/http/quicknode/client.py +0 -60
  64. tonutils/clients/http/quicknode/provider.py +0 -42
  65. tonutils/clients/http/tatum/__init__.py +0 -4
  66. tonutils/clients/http/tatum/client.py +0 -66
  67. tonutils/clients/http/tatum/provider.py +0 -53
  68. tonutils/clients/http/tonapi/__init__.py +0 -4
  69. tonutils/clients/http/tonapi/provider.py +0 -150
  70. tonutils/clients/http/tonapi/stack.py +0 -71
  71. tonutils/clients/http/toncenter/__init__.py +0 -4
  72. tonutils/clients/http/toncenter/provider.py +0 -145
  73. tonutils/clients/http/toncenter/stack.py +0 -73
  74. tonutils/protocols/__init__.py +0 -9
  75. tonutils-2.0.1b1.dist-info/RECORD +0 -94
  76. /tonutils/{protocols/client.py → clients/protocol.py} +0 -0
  77. {tonutils-2.0.1b1.dist-info → tonutils-2.0.1b3.dist-info}/WHEEL +0 -0
  78. {tonutils-2.0.1b1.dist-info → tonutils-2.0.1b3.dist-info}/licenses/LICENSE +0 -0
  79. {tonutils-2.0.1b1.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.protocols.client import ClientProtocol
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.protocols.client import ClientProtocol
6
- from tonutils.protocols.contract import ContractProtocol
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
 
@@ -0,0 +1,17 @@
1
+ from .models import (
2
+ VanityConfig,
3
+ VanityInit,
4
+ VanityResult,
5
+ VanitySpecial,
6
+ )
7
+ from .tlb import VanityDeployBody
8
+ from .vanity import Vanity
9
+
10
+ __all__ = [
11
+ "Vanity",
12
+ "VanityConfig",
13
+ "VanityDeployBody",
14
+ "VanityInit",
15
+ "VanityResult",
16
+ "VanitySpecial",
17
+ ]
@@ -0,0 +1,39 @@
1
+ import base64
2
+ import typing as t
3
+
4
+ from pydantic import BaseModel, Field
5
+ from pytoniq_core import Cell
6
+
7
+
8
+ class VanitySpecial(BaseModel):
9
+ tick: bool
10
+ tock: bool
11
+
12
+
13
+ class VanityConfig(BaseModel):
14
+ owner: str
15
+ start: t.Optional[str] = None
16
+ end: t.Optional[str] = None
17
+ masterchain: bool
18
+ non_bounceable: bool
19
+ testnet: bool
20
+ case_sensitive: bool
21
+ only_one: bool
22
+
23
+
24
+ class VanityInit(BaseModel):
25
+ code: str
26
+ split_depth: t.Optional[int] = Field(default=None, alias="fixedPrefixLength")
27
+ special: t.Optional[VanitySpecial] = None
28
+
29
+ @property
30
+ def code_cell(self) -> Cell:
31
+ raw = base64.urlsafe_b64decode(self.code)
32
+ return Cell.one_from_boc(raw)
33
+
34
+
35
+ class VanityResult(BaseModel):
36
+ address: str
37
+ init: VanityInit
38
+ config: VanityConfig
39
+ timestamp: float
@@ -0,0 +1,40 @@
1
+ from __future__ import annotations
2
+
3
+ from pytoniq_core import Cell, Slice, TlbScheme, begin_cell
4
+
5
+
6
+ class VanityDeployBody(TlbScheme):
7
+ """Message body structure for deploying contracts via Vanity."""
8
+
9
+ def __init__(self, code: Cell, data: Cell) -> None:
10
+ """
11
+ Initialize Vanity deploy message body.
12
+
13
+ :param code: Contract code cell to deploy
14
+ :param data: Contract initial data cell
15
+ """
16
+ self.code = code
17
+ self.data = data
18
+
19
+ def serialize(self) -> Cell:
20
+ """
21
+ Serialize deploy body to Cell.
22
+
23
+ Layout: code:^Cell data:^Cell
24
+
25
+ :return: Serialized message body cell
26
+ """
27
+ cell = begin_cell()
28
+ cell.store_ref(self.code)
29
+ cell.store_ref(self.data)
30
+ return cell.end_cell()
31
+
32
+ @classmethod
33
+ def deserialize(cls, cs: Slice) -> VanityDeployBody:
34
+ """
35
+ Deserialize deploy body from Cell slice.
36
+
37
+ :param cs: Cell slice to deserialize from
38
+ :return: Deserialized VanityDeployBody instance
39
+ """
40
+ raise NotImplementedError
@@ -0,0 +1,40 @@
1
+ from __future__ import annotations
2
+
3
+ from pytoniq_core import StateInit, Address
4
+ from pytoniq_core.tlb.account import TickTock
5
+
6
+ from tonutils.clients.protocol import ClientProtocol
7
+ from tonutils.contracts.base import BaseContract
8
+ from tonutils.contracts.vanity.models import VanityResult
9
+
10
+
11
+ class Vanity(BaseContract):
12
+ """Vanity contract."""
13
+
14
+ @classmethod
15
+ def from_result(
16
+ cls,
17
+ client: ClientProtocol,
18
+ result: VanityResult,
19
+ ) -> Vanity:
20
+ """
21
+ Construct Vanity contract wrapper from generated result.
22
+
23
+ :param client: TON client to bind to the contract
24
+ :param result: Vanity generation result with address and init data
25
+ :return: Vanity contract instance
26
+ """
27
+ address = Address(result.address)
28
+ state_init = StateInit(code=result.init.code_cell)
29
+ if result.init.split_depth:
30
+ state_init.split_depth = result.init.split_depth
31
+ if result.init.special:
32
+ state_init.special = TickTock(
33
+ tick=result.init.special.tick,
34
+ tock=result.init.special.tock,
35
+ )
36
+ return cls(
37
+ client=client,
38
+ address=address,
39
+ state_init=state_init,
40
+ )
@@ -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 (default: auto)
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.protocols.client import ClientProtocol
6
- from tonutils.protocols.contract import ContractProtocol
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.protocols.client import ClientProtocol
8
- from tonutils.protocols.contract import ContractProtocol
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 (default: auto)
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 NotRefreshedError
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 NotRefreshedError(self, "state_data")
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