tonutils 2.0.1b5__py3-none-any.whl → 2.0.1b7__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 (58) hide show
  1. tonutils/__meta__.py +1 -1
  2. tonutils/clients/__init__.py +10 -10
  3. tonutils/clients/adnl/balancer.py +135 -361
  4. tonutils/clients/adnl/client.py +35 -208
  5. tonutils/clients/adnl/mixin.py +268 -0
  6. tonutils/clients/adnl/provider/config.py +22 -7
  7. tonutils/clients/adnl/provider/provider.py +61 -16
  8. tonutils/clients/adnl/provider/transport.py +13 -4
  9. tonutils/clients/adnl/provider/workers/pinger.py +1 -1
  10. tonutils/clients/adnl/utils.py +5 -5
  11. tonutils/clients/base.py +61 -95
  12. tonutils/clients/http/__init__.py +11 -11
  13. tonutils/clients/http/balancer.py +103 -100
  14. tonutils/clients/http/clients/__init__.py +10 -10
  15. tonutils/clients/http/clients/chainstack.py +3 -3
  16. tonutils/clients/http/clients/quicknode.py +2 -3
  17. tonutils/clients/http/clients/tatum.py +4 -3
  18. tonutils/clients/http/clients/tonapi.py +20 -33
  19. tonutils/clients/http/clients/toncenter.py +64 -55
  20. tonutils/clients/http/{providers → provider}/__init__.py +4 -1
  21. tonutils/clients/http/{providers → provider}/base.py +140 -61
  22. tonutils/clients/http/{providers/toncenter → provider}/models.py +44 -2
  23. tonutils/clients/http/{providers/tonapi/provider.py → provider/tonapi.py} +8 -13
  24. tonutils/clients/http/{providers/toncenter/provider.py → provider/toncenter.py} +25 -21
  25. tonutils/clients/limiter.py +61 -59
  26. tonutils/clients/protocol.py +8 -8
  27. tonutils/contracts/base.py +32 -32
  28. tonutils/contracts/protocol.py +9 -9
  29. tonutils/contracts/wallet/base.py +7 -8
  30. tonutils/contracts/wallet/messages.py +4 -8
  31. tonutils/contracts/wallet/versions/v5.py +2 -2
  32. tonutils/exceptions.py +29 -13
  33. tonutils/tonconnect/bridge/__init__.py +0 -0
  34. tonutils/tonconnect/events.py +0 -0
  35. tonutils/tonconnect/models/__init__.py +0 -0
  36. tonutils/tonconnect/storage.py +0 -0
  37. tonutils/tonconnect/tonconnect.py +0 -0
  38. tonutils/tools/block_scanner/__init__.py +2 -5
  39. tonutils/tools/block_scanner/events.py +48 -7
  40. tonutils/tools/block_scanner/scanner.py +316 -222
  41. tonutils/tools/block_scanner/storage.py +11 -0
  42. tonutils/tools/status_monitor/monitor.py +6 -6
  43. tonutils/types.py +2 -2
  44. tonutils/utils.py +0 -48
  45. {tonutils-2.0.1b5.dist-info → tonutils-2.0.1b7.dist-info}/METADATA +3 -18
  46. {tonutils-2.0.1b5.dist-info → tonutils-2.0.1b7.dist-info}/RECORD +50 -51
  47. {tonutils-2.0.1b5.dist-info → tonutils-2.0.1b7.dist-info}/WHEEL +1 -1
  48. tonutils/clients/http/providers/response.py +0 -85
  49. tonutils/clients/http/providers/tonapi/__init__.py +0 -3
  50. tonutils/clients/http/providers/tonapi/models.py +0 -47
  51. tonutils/clients/http/providers/toncenter/__init__.py +0 -3
  52. tonutils/tools/block_scanner/annotations.py +0 -23
  53. tonutils/tools/block_scanner/dispatcher.py +0 -141
  54. tonutils/tools/block_scanner/traversal.py +0 -97
  55. tonutils/tools/block_scanner/where.py +0 -53
  56. {tonutils-2.0.1b5.dist-info → tonutils-2.0.1b7.dist-info}/entry_points.txt +0 -0
  57. {tonutils-2.0.1b5.dist-info → tonutils-2.0.1b7.dist-info}/licenses/LICENSE +0 -0
  58. {tonutils-2.0.1b5.dist-info → tonutils-2.0.1b7.dist-info}/top_level.txt +0 -0
@@ -114,7 +114,7 @@ class LiteServerMonitor:
114
114
  self._tasks.append(asyncio.create_task(slow))
115
115
 
116
116
  async def _ensure_connected(self, index: int, client: LiteClient) -> bool:
117
- if client.provider.is_connected:
117
+ if client.provider.connected:
118
118
  return True
119
119
 
120
120
  now = time.monotonic()
@@ -124,7 +124,7 @@ class LiteServerMonitor:
124
124
 
125
125
  self._last_connect[index] = now
126
126
  await self._connect(index, client)
127
- return client.provider.is_connected
127
+ return client.provider.connected
128
128
 
129
129
  async def _fast_update_loop(self, index: int, client: LiteClient) -> None:
130
130
  while not self._stop.is_set():
@@ -141,7 +141,7 @@ class LiteServerMonitor:
141
141
 
142
142
  async def _medium_update_loop(self, index: int, client: LiteClient) -> None:
143
143
  while not self._stop.is_set():
144
- if not client.is_connected:
144
+ if not client.connected:
145
145
  await self._sleep(1.0)
146
146
  continue
147
147
 
@@ -154,7 +154,7 @@ class LiteServerMonitor:
154
154
 
155
155
  async def _slow_update_loop(self, index: int, client: LiteClient) -> None:
156
156
  while not self._stop.is_set():
157
- if not client.is_connected:
157
+ if not client.connected:
158
158
  await self._sleep(1.0)
159
159
  continue
160
160
 
@@ -223,14 +223,14 @@ class LiteServerMonitor:
223
223
  return
224
224
 
225
225
  mc_txs, shards = await asyncio.gather(
226
- client.get_block_transactions_ext(mc_block),
226
+ client.get_block_transactions(mc_block),
227
227
  client.get_all_shards_info(mc_block),
228
228
  )
229
229
  last_mc_block = BlockInfo(seqno=mc_block.seqno, txs_count=len(mc_txs))
230
230
 
231
231
  if shards:
232
232
  bc_block = max(shards, key=lambda b: b.seqno)
233
- bc_txs = await client.get_block_transactions_ext(bc_block)
233
+ bc_txs = await client.get_block_transactions(bc_block)
234
234
  last_bc_block = BlockInfo(seqno=bc_block.seqno, txs_count=len(bc_txs))
235
235
  await self._set_status(
236
236
  index,
tonutils/types.py CHANGED
@@ -16,7 +16,7 @@ __all__ = [
16
16
  "BinaryLike",
17
17
  "ClientType",
18
18
  "ContractState",
19
- "ContractStateInfo",
19
+ "ContractInfo",
20
20
  "DNSCategory",
21
21
  "DNSPrefix",
22
22
  "MetadataPrefix",
@@ -189,7 +189,7 @@ class ContractState(str, Enum):
189
189
  NONEXIST = "nonexist"
190
190
 
191
191
 
192
- class ContractStateInfo:
192
+ class ContractInfo:
193
193
  """
194
194
  TON smart contract state information.
195
195
 
tonutils/utils.py CHANGED
@@ -30,13 +30,8 @@ from tonutils.types import (
30
30
  AddressLike,
31
31
  PrivateKey,
32
32
  PublicKey,
33
- DNSCategory,
34
33
  )
35
34
 
36
- if t.TYPE_CHECKING:
37
- from tonutils.clients.protocol import ClientProtocol
38
-
39
-
40
35
  __all__ = [
41
36
  "TextCipher",
42
37
  "calc_valid_until",
@@ -50,7 +45,6 @@ __all__ = [
50
45
  "norm_stack_num",
51
46
  "normalize_hash",
52
47
  "parse_stack_config",
53
- "resolve_wallet_address",
54
48
  "slice_hash",
55
49
  "string_hash",
56
50
  "to_amount",
@@ -310,48 +304,6 @@ def calc_valid_until(seqno: int, ttl: int = 60) -> int:
310
304
  return 0xFFFFFFFF if seqno == 0 else now + ttl
311
305
 
312
306
 
313
- async def resolve_wallet_address(
314
- client: ClientProtocol,
315
- domain: AddressLike,
316
- ) -> Address:
317
- """
318
- Resolve a TON address from domain name or address string.
319
-
320
- Supports:
321
- - Direct Address objects (returned as-is)
322
- - Address strings in any format (EQ..., UQ..., 0:...)
323
- - TON DNS domains (.ton, .t.me) - queries wallet record
324
-
325
- :param client: TON client for DNS resolution
326
- :param domain: Address object, address string, or DNS domain
327
- """
328
- from tonutils.contracts.dns.tlb import ALLOWED_DNS_ZONES
329
-
330
- if isinstance(domain, Address):
331
- return domain
332
-
333
- if isinstance(domain, str):
334
- try:
335
- return Address(domain)
336
- except (Exception,):
337
- if not domain.endswith(ALLOWED_DNS_ZONES):
338
- allowed = ", ".join(ALLOWED_DNS_ZONES)
339
- raise ValueError(
340
- f"Invalid DNS domain: {domain}. Supported zones: {allowed}."
341
- )
342
-
343
- record = await client.dnsresolve(
344
- domain=domain,
345
- category=DNSCategory.WALLET,
346
- )
347
- if record is None:
348
- raise ValueError(f"DNS record not found for: {domain}.")
349
-
350
- return record.value
351
-
352
- raise TypeError(f"Invalid domain type: {type(domain)!r}. Expected Address or str.")
353
-
354
-
355
307
  class TextCipher:
356
308
  """
357
309
  End-to-end encryption for TON wallet text comments.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tonutils
3
- Version: 2.0.1b5
3
+ Version: 2.0.1b7
4
4
  Summary: Tonutils is a high-level, object-oriented Python library designed to facilitate seamless interactions with the TON blockchain.
5
5
  Author: nessshon
6
6
  Maintainer: nessshon
@@ -69,27 +69,13 @@ pip install --pre tonutils
69
69
 
70
70
  ## Usage
71
71
 
72
- Practical feature examples can be found in the **[examples](examples)** directory.\
73
- Each script demonstrates real-world usage and can be used as a reference when integrating `tonutils` into your project.
74
-
75
- ## Contribution
76
-
77
- We welcome your contributions! If you have ideas for improvement or have identified a bug, please create an issue or
78
- submit a pull request.
72
+ Practical feature examples can be found in the **[examples](examples)** directory.
79
73
 
80
74
  ## Donations
81
75
 
82
76
  Your contributions help me continue developing and improving this project!
83
77
 
84
- - **TON**: `UQCZq3_Vd21-4y4m7Wc-ej9NFOhh_qvdfAkAYAOHoQ__Ness`
85
-
86
- - **BTC**: `1JXHbB5kE1DfkHdv5dsNygRkNC3unJdU8M`
87
-
88
- - **USDT** (TRC-20): `TU4fCFdWufKb4rd25ihksiNDZZdyEYqro6`
89
-
90
- - **Crypto Bot**: [Donate through Crypto Bot](https://t.me/send?start=IVW1cyG3DYqG)
91
-
92
- - **xRocket Bot**: [Donate through xRocket](https://t.me/xrocket?start=inv_R4llrClZtPjovVe)
78
+ **TON**: `UQCZq3_Vd21-4y4m7Wc-ej9NFOhh_qvdfAkAYAOHoQ__Ness`
93
79
 
94
80
  ## Support
95
81
 
@@ -99,4 +85,3 @@ With special thanks to [Igroman787](https://github.com/Igroman787) for the suppo
99
85
  ## License
100
86
 
101
87
  This repository is distributed under the [MIT License](LICENSE).
102
- Feel free to use, modify, and distribute the code in accordance with the terms of the license.
@@ -1,51 +1,48 @@
1
1
  tonutils/__init__.py,sha256=ueJrDkU1JBlZiX0q8roQfzYOZY62Of_CiHZlxIIQFO0,228
2
- tonutils/__meta__.py,sha256=uHnZdT43kWVuqeXaVY86NLU06cIBG4SuxsLdEUaX6v8,24
2
+ tonutils/__meta__.py,sha256=pnBUMwEiE3Otdl5pbcYM2yy-aa5fTg4NFSVHb1eXhG4,24
3
3
  tonutils/cli.py,sha256=WGir-ihgPuKTgKGmhjPZeKk9wgsm64jiJciOnVlsdco,2645
4
- tonutils/exceptions.py,sha256=67jXCFPyOnVnd8EaqYg1osVIXg34VZX-aJHPunpc-oI,6462
4
+ tonutils/exceptions.py,sha256=64TSU9LCTSEH70o1-qHTNIL-HXpxXv1xcsRklizJEGU,6929
5
5
  tonutils/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- tonutils/types.py,sha256=ORevKllLjb7pmL3AQTMeSoiZQ4KFhoB_rA7KpGqZZjU,14542
7
- tonutils/utils.py,sha256=w2sXvVMA2Erz_JSSN2WuYSi7RAPDAOOwWYiThu8Q0Ps,16499
8
- tonutils/clients/__init__.py,sha256=PvHsOHOtkVonfiowEPi6P7ggDeQeQorXcksujru6efQ,561
9
- tonutils/clients/base.py,sha256=DjNhFd_p82Osqn0qWIjflpt9S1NVZc3MQIEj5U5E9-k,9631
10
- tonutils/clients/limiter.py,sha256=d2WO7Dx-ksg3gvl05WuDMu1KycuQj0XrmiG67Q7wnFo,3592
11
- tonutils/clients/protocol.py,sha256=4QerYoqBKAAfNZVpyQW2sp5KZZlq8xHCn9yWbbJERPQ,2557
6
+ tonutils/types.py,sha256=amHTnp1Mp7Z8G_mWscu10hufeIVjYbkaxKEYixXoKH4,14532
7
+ tonutils/utils.py,sha256=10R2eGjzNMEN9glngcJhZ36O76ec55NodH-c8IgN6yw,15062
8
+ tonutils/clients/__init__.py,sha256=F0aPLPOI8-HcqcweeCSG_fr2VArxiZxfsWHuzHDwE4k,521
9
+ tonutils/clients/base.py,sha256=FHKDJCUDNoLUuE4W0J3SGEtgJudW_6zFIAaP6zTKr_4,8207
10
+ tonutils/clients/limiter.py,sha256=lSUo6AhEuWUlo0y2sUc-P4YltRI2zjbicelYKkMTrls,3896
11
+ tonutils/clients/protocol.py,sha256=JCd0lBZwrosogmc4rQ5mmL_oBy3XYQoX_d2wyson0lU,2534
12
12
  tonutils/clients/adnl/__init__.py,sha256=shkczPIYlTrOHjpnOBIoRwEYRQ4rVGfLnOZvnQY0a5U,174
13
- tonutils/clients/adnl/balancer.py,sha256=L5tvSwklgsp1QGBypMcxta_vhGdCXrOahi33-EFMPfs,26877
14
- tonutils/clients/adnl/client.py,sha256=hClnodq57bi6Q2p-9vbmh89GKpRDwXdIABUM8BEtKUs,14111
15
- tonutils/clients/adnl/utils.py,sha256=rKLbTiGbZQ0ozvh5jYjjaFEKsmqEschjuUiHOX9e6ps,5154
13
+ tonutils/clients/adnl/balancer.py,sha256=DoMiFtLA4rrCYeyhiFuhlxVBZbffttq9ewrFPSDEnKo,19917
14
+ tonutils/clients/adnl/client.py,sha256=2tUr6YxxoNXdc0c0iRkyT1xpZkIKIM-DwgNTKJn-qMo,8994
15
+ tonutils/clients/adnl/mixin.py,sha256=GVakCui_0yso0VCOsycZsvq55Ng6JyIdotrQ_0bIohM,8260
16
+ tonutils/clients/adnl/utils.py,sha256=pyrU0vLuR9qnOFlHtheOfch8u1FP4Q_5Ah2UuX_m7Jk,5129
16
17
  tonutils/clients/adnl/provider/__init__.py,sha256=lLwFEEgCifMlYozwSzQbvq97R6Du7TzgGFnTgUnk4gw,63
17
- tonutils/clients/adnl/provider/config.py,sha256=nhe9jwDeN6d4yTlgaVHGKk5TaALYSvIfaok2myvIJXY,894
18
+ tonutils/clients/adnl/provider/config.py,sha256=jMeCdg14KjS6Zh7sgcjop4LdLtrHA91PbWm1zD1mnt0,1655
18
19
  tonutils/clients/adnl/provider/models.py,sha256=3dn4oZv7PIgiwlP2lGs0O6VckC19ejxCFlSPhzU0wX8,4537
19
- tonutils/clients/adnl/provider/provider.py,sha256=Er5RNR490RIQlRTI5KMxVarshHRNVseAbUYGM48fcbg,24180
20
- tonutils/clients/adnl/provider/transport.py,sha256=lgp1N0LGjYYIKWiwBIm-pnF064TkkCsSTDAFKt8_U-I,10983
20
+ tonutils/clients/adnl/provider/provider.py,sha256=J7wIGtv_ZeS5j6AdYafAQ0m3q4z8Sd5V_LcpfeSi7JM,25633
21
+ tonutils/clients/adnl/provider/transport.py,sha256=bT_a7h0nCBGKCfPNOg79CW04UIdyZCfQ_7-nFvpfWK0,11241
21
22
  tonutils/clients/adnl/provider/workers/__init__.py,sha256=M65q7mVfinHImIZNCEaHBJ-SO4DdVBsSkeZFrJs9OoE,177
22
23
  tonutils/clients/adnl/provider/workers/base.py,sha256=8RenR2MU_B-b8mevzCytLJmPgjLCJ8bVI-4q-wx78Q8,2031
23
- tonutils/clients/adnl/provider/workers/pinger.py,sha256=lBpy4TU8L-I_6sxEft-Bn9XmntJhMg5Rm2o2tN2Mp0A,2443
24
+ tonutils/clients/adnl/provider/workers/pinger.py,sha256=ndA2ToCiukTav0s1mVrUwfFEjxdK9Wucq5ONxB1wpAw,2440
24
25
  tonutils/clients/adnl/provider/workers/reader.py,sha256=qvkaBBrRNu_nLTQOd0w6lDdN_wPOnzPbfAa3UToJWd8,1944
25
26
  tonutils/clients/adnl/provider/workers/updater.py,sha256=r7NrZXDg3nY4jAF-sYkX1ZvxTE8sN99qSFctbAmHTME,1978
26
- tonutils/clients/http/__init__.py,sha256=UIhIb0jLFmM73FabLHHZV-kxM3pq02P4WfCviBPHDPY,476
27
- tonutils/clients/http/balancer.py,sha256=tDQBRvwnwoUdceYyVVuJpJnTI__x02J-4oP1_-rFgTs,12376
27
+ tonutils/clients/http/__init__.py,sha256=M05D4r8sLZk1dY_LZa6-LhPZdzCzyCJ3MJnCxwE9xk8,435
28
+ tonutils/clients/http/balancer.py,sha256=AdK9hHAreQJginHxpjIG9fhQiMOQq-wCsgby1jMsqII,12539
28
29
  tonutils/clients/http/utils.py,sha256=mv9kCwLu8qjayy03E524WZ3q7Zf96t5VCE6H9j5kHRE,4994
29
- tonutils/clients/http/clients/__init__.py,sha256=DBUfGpJIDqHDzTLMLtJatT7pKusnMSLGYiTek7Hf6i4,347
30
- tonutils/clients/http/clients/chainstack.py,sha256=jH0alNZMAkRSBb4U6MoiFa_FiQ9ZTvjqDbwjFvidsiI,1749
31
- tonutils/clients/http/clients/quicknode.py,sha256=4bh8QebatFGHpIINiQFNIuYnHW8FW3aTzZIf-rAL0PI,1668
32
- tonutils/clients/http/clients/tatum.py,sha256=pRIUJvzmKJBJUPocedGo6fsQ-CZUDm-7DIQwOJQWXCk,2025
33
- tonutils/clients/http/clients/tonapi.py,sha256=hhcYjs6foDfsoBgBGAptQq58WSQ18x_kupA8nlAORU8,5769
34
- tonutils/clients/http/clients/toncenter.py,sha256=2cni37OIZ9IRMxF54YwMV3sMacksJbumYseAhHE4-Sg,7319
35
- tonutils/clients/http/providers/__init__.py,sha256=psOTidJ5Zc1qhNYmHgZaiDbht4BvEWZ5r_xgrcrmipQ,143
36
- tonutils/clients/http/providers/base.py,sha256=D4RkgmG713JIc2LPbUamr1-RIN3kuwdToPumdx7o0Sg,6447
37
- tonutils/clients/http/providers/response.py,sha256=G0kAInKJ4nOIkqMB5dac2Ugnsj3YDxS06awK7RrQPNk,2265
38
- tonutils/clients/http/providers/tonapi/__init__.py,sha256=A4-axY0GZZ-NtB0F9h9Mh3PFoosmHpt0nS2HU8GOLcE,75
39
- tonutils/clients/http/providers/tonapi/models.py,sha256=0ldcEaw_ReT4Zns0HSCBwe3RFUhcUsjdKhrBorN9_qY,1204
40
- tonutils/clients/http/providers/tonapi/provider.py,sha256=iPquCsJglbgxtnHbUrkGYbiJG1rf5zmyh4XKMsncj-4,3727
41
- tonutils/clients/http/providers/toncenter/__init__.py,sha256=PSzpwMrwcs_LY2Aw5omErjaLSVzy_9LB5EpRjtITyTs,81
42
- tonutils/clients/http/providers/toncenter/models.py,sha256=ZPx6EhjhrNWFMWF_055EIolMwaLfQAGio0fqTUmljy8,2397
43
- tonutils/clients/http/providers/toncenter/provider.py,sha256=QoNrobRgytG0Gc9Lo-QXrdMCtyJk1rOS-B2nPzGwaV0,3391
30
+ tonutils/clients/http/clients/__init__.py,sha256=RpoIk4KaVC3pBlxkatSozMN6cMY_UW1cR8PxA1d0Xyo,307
31
+ tonutils/clients/http/clients/chainstack.py,sha256=U_UaEDM8_KB8SHRA6l22utDfGqZ4dLvKJ-VLgbg86s0,1737
32
+ tonutils/clients/http/clients/quicknode.py,sha256=TZOwVZTLjTHHd1OiOZkdAzkM91vyX6_1vEV-bUqCjmE,1655
33
+ tonutils/clients/http/clients/tatum.py,sha256=2REsdMDwedvM_Fq8fBICPGJfxHxEkEnJ21QeOj2OYQ8,2014
34
+ tonutils/clients/http/clients/tonapi.py,sha256=3uWV9hQef5Yo57VYX2Lg_JM8XJcfzCdpXHJQaWU-_lg,5388
35
+ tonutils/clients/http/clients/toncenter.py,sha256=MhVyUVd_4NFcqJ1dVuZAy_DJZ2J58_mWcSLJXFY-sL4,7780
36
+ tonutils/clients/http/provider/__init__.py,sha256=V4JOQuTqLU7taZojxvXo0yVAXESbbyQR9O5iDPyp5x8,154
37
+ tonutils/clients/http/provider/base.py,sha256=JqhtFwLLGyTbTVXO6V8_TJf-nZtYjFrSXR4OZPhQXNY,8867
38
+ tonutils/clients/http/provider/models.py,sha256=HFB3xL9B7DHdahw9-qCdMv0pVCvOsVaklTM0Yz0pU-M,3510
39
+ tonutils/clients/http/provider/tonapi.py,sha256=IgEiz8VwZ3rKLAVB8Aq3RxUDcC2HMD2NIX4m_j1tk6U,3495
40
+ tonutils/clients/http/provider/toncenter.py,sha256=m_wLe778ibe0LMFBV2iIuULbrSxSoPOd-OmTNSXm5lE,3461
44
41
  tonutils/contracts/__init__.py,sha256=KZm3_rQwoY0kO6zFGpPcjrN9XBTjDDvpB2dfaHjwjjw,9561
45
- tonutils/contracts/base.py,sha256=7AVjsBmcM30Y1fKIIKMVXGr58ZmMfpublunecsSn2W4,10521
42
+ tonutils/contracts/base.py,sha256=CvTKWVJEvm07HThCenJ0T-QDYne_CgRD02Nyo29Exfg,10332
46
43
  tonutils/contracts/codes.py,sha256=1Sbbs_izHZHd-i1cjWHRP8VN3Xc2BDPr4pnjojj6mZc,37741
47
44
  tonutils/contracts/opcodes.py,sha256=niPd-pDmtXiEpYX8xvorFmd7O4vkY0i8nX71e3iaJ1s,1001
48
- tonutils/contracts/protocol.py,sha256=WLqDUmcgHGRYlKQWQGDWm-2pI2L9iTYg4tAxsehPNLE,6210
45
+ tonutils/contracts/protocol.py,sha256=Z4EdZn4J_TixBRpXfakt73FSM4B4Gnqh1UQ49ybT6wQ,6193
49
46
  tonutils/contracts/versions.py,sha256=V1rJECQSQuAVYwDmXl4lZzLzDeqZ9OChOgipzAlTPQE,1705
50
47
  tonutils/contracts/dns/__init__.py,sha256=H57OtOeohbQlcNTHZS5YI7wtZjlqlpKg4wVso2kPRrU,987
51
48
  tonutils/contracts/dns/collection.py,sha256=wSpKGOyCnmXBq1IITjjq5oOt2OZO3u5ckibDcacbJ9I,3089
@@ -72,9 +69,9 @@ tonutils/contracts/vanity/models.py,sha256=B6W1TN4CyrMs4SfBDAjuQ8QP-wn5QFhNpcSzO
72
69
  tonutils/contracts/vanity/tlb.py,sha256=gcNYEGPWMUHYbg_Je9QbBUlmVXF5RmobL-FoCMCF1HA,1078
73
70
  tonutils/contracts/vanity/vanity.py,sha256=uYH1zybcOTQQBPciUFxAS6wksBwawKx06YES2tLuguI,1242
74
71
  tonutils/contracts/wallet/__init__.py,sha256=Ho3-3C09JNk53ySnQaUnNscchfCtbUdyA2kpWAFzOf4,3295
75
- tonutils/contracts/wallet/base.py,sha256=hKkvbeL4uG165k4_iWR4CjIUQsAtaUgQh9hwt1ZcUY8,15960
72
+ tonutils/contracts/wallet/base.py,sha256=Ue0WMTtjQ55s3o1_67KHdqGIsjjFrgdoLjCiMwA1y1Q,15806
76
73
  tonutils/contracts/wallet/configs.py,sha256=yQfuCEGL_fBuc5qGJ93rPIUATTR8V1wpYscgrWb7cEQ,4082
77
- tonutils/contracts/wallet/messages.py,sha256=jUHQyejAS1x9uMzDW6BArifCmniODebxwrTSxceDgT4,13904
74
+ tonutils/contracts/wallet/messages.py,sha256=MDzM3HdRYIc_vhmsjeHZcF9z1zpcfSdSh3_s4ecSx7o,13610
78
75
  tonutils/contracts/wallet/methods.py,sha256=x7aPt71v3PUFNYHStWQrjLK7_SWPC2MiTG0c15X5TRI,10732
79
76
  tonutils/contracts/wallet/params.py,sha256=hqinZJmhWiZUywDcmolvRxB0HYJgMAPDWYJiTmgjZ7w,4569
80
77
  tonutils/contracts/wallet/protocol.py,sha256=DCu3CNbcZJ_wwROEK3GlpnwxNY2ZLdE0D2Z23WiyVDY,6200
@@ -86,23 +83,25 @@ tonutils/contracts/wallet/versions/v1.py,sha256=BYRWXdM0OlSeCfayHAUBj_wM4bb3WTVY
86
83
  tonutils/contracts/wallet/versions/v2.py,sha256=pwrlan-utZo_WmnzDwSbnzV8ibkPEWx2WU1uOjkdrrA,2452
87
84
  tonutils/contracts/wallet/versions/v3.py,sha256=d7cM8wjmW-1H7jGuY3AuUd7eTY3wq9ZYpJ4f5OeYX08,2470
88
85
  tonutils/contracts/wallet/versions/v4.py,sha256=2sAsjJ8_3oYAj5JwWH3PiMyoGbgl6-f7-p6T5X7MGTI,2713
89
- tonutils/contracts/wallet/versions/v5.py,sha256=1J6KXPOc7Q5S5EdFM9WXQzNGRZrw5EgxDZ9dmyHwsXE,8890
86
+ tonutils/contracts/wallet/versions/v5.py,sha256=fvOEdKLVbHGj1jyxd05xLuerZgZD1s3sMa0FnZ1Ds2U,8872
90
87
  tonutils/tonconnect/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
88
+ tonutils/tonconnect/events.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
89
+ tonutils/tonconnect/storage.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
90
+ tonutils/tonconnect/tonconnect.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
91
+ tonutils/tonconnect/bridge/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
92
+ tonutils/tonconnect/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
91
93
  tonutils/tools/__init__.py,sha256=QYOVuGY50FFkWlgIvHc2RPU3xiEWSbwnwZ6wuZPQnCA,102
92
- tonutils/tools/block_scanner/__init__.py,sha256=NRZ2XuDL3VwXJJ0iMe6ETh5w1aX4pCMMIv9UmmOj5yE,260
93
- tonutils/tools/block_scanner/annotations.py,sha256=i6Xsu_rBERr7qEmhGGcwlYYkqf8cLjNJlZ4rXUf51WY,795
94
- tonutils/tools/block_scanner/dispatcher.py,sha256=lgrs0MPnnyx0VibVQGYXU6s5mpqV_lO47yhO0uOCV30,4393
95
- tonutils/tools/block_scanner/events.py,sha256=6M80JoiVMRy7kBBuT8-KlHJ5Dx3GHUjIKmZVPaXXeaA,727
96
- tonutils/tools/block_scanner/scanner.py,sha256=2arPhNPu-6Klcj-PnSnP3DBVWekhlYjn2iqvN-1wigU,9929
97
- tonutils/tools/block_scanner/traversal.py,sha256=Zp0Uon0OTvLTsZi-zviMyvJHBsZRUx9XExxLU6LMkVA,3101
98
- tonutils/tools/block_scanner/where.py,sha256=sZUuabQ5joATkJqUh5R3N5r4P9WblmRrVYEVdZeJvZw,1239
94
+ tonutils/tools/block_scanner/__init__.py,sha256=yYARZYo4LlePo7DWrrYlejGE4NLInfNeU9Ipln8oFFA,209
95
+ tonutils/tools/block_scanner/events.py,sha256=02K85PR3Jfe6qK-Ve1Mbukk4AWkxCJv1d-C-0tGdH_s,1881
96
+ tonutils/tools/block_scanner/scanner.py,sha256=abGhDbLUsdfzp9ipMpGpsdovIakP_ISfABTML4cPpck,14166
97
+ tonutils/tools/block_scanner/storage.py,sha256=7Kw6rdyLkPpBF5Y1mp2qkVZLnexyPumv2hMl9gNk_EI,357
99
98
  tonutils/tools/status_monitor/__init__.py,sha256=QnMlA0IDLtCGgXsEgB9q3EJTBo2s5js6lSJk0oZkQZQ,72
100
99
  tonutils/tools/status_monitor/console.py,sha256=UX3BzjjzeS_nKFGg4NkZJpu9fR_IAJZdQUMz0HcJCdg,5036
101
100
  tonutils/tools/status_monitor/models.py,sha256=yHuiEuij4h2kVoOK3sbhNq6SwiGDW_evZmzUwMy1GQs,608
102
- tonutils/tools/status_monitor/monitor.py,sha256=8zUwNwFScmcjK9ES7XX1LZWjw49lk8CSUQATcUYM57E,10085
103
- tonutils-2.0.1b5.dist-info/licenses/LICENSE,sha256=fG-yM-8DSkOTaJ558P7uF5PNXBmineVO9-HC12YbIxs,1060
104
- tonutils-2.0.1b5.dist-info/METADATA,sha256=1Wvi3Vlsb0IYwLaKlchY-OdFZ_TYNmHmZIzuyDQj55w,4181
105
- tonutils-2.0.1b5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
106
- tonutils-2.0.1b5.dist-info/entry_points.txt,sha256=qijo1cqvbbzLVbXp-PCYh19Pgmd7duH6yljmnUPd55I,47
107
- tonutils-2.0.1b5.dist-info/top_level.txt,sha256=-7H_mGl8S9HKQrkUiTLmEbtMM-knzRzd_a0cZZnuZIU,9
108
- tonutils-2.0.1b5.dist-info/RECORD,,
101
+ tonutils/tools/status_monitor/monitor.py,sha256=OXs-J5RCUp4VbnBZuGd-4LythGUGakxwGSYM1Ipw-4s,10065
102
+ tonutils-2.0.1b7.dist-info/licenses/LICENSE,sha256=fG-yM-8DSkOTaJ558P7uF5PNXBmineVO9-HC12YbIxs,1060
103
+ tonutils-2.0.1b7.dist-info/METADATA,sha256=l-mwZF3Co184WoWPM8cnuk3Nj9-Doj3i3wy3P87oEPY,3519
104
+ tonutils-2.0.1b7.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
105
+ tonutils-2.0.1b7.dist-info/entry_points.txt,sha256=qijo1cqvbbzLVbXp-PCYh19Pgmd7duH6yljmnUPd55I,47
106
+ tonutils-2.0.1b7.dist-info/top_level.txt,sha256=-7H_mGl8S9HKQrkUiTLmEbtMM-knzRzd_a0cZZnuZIU,9
107
+ tonutils-2.0.1b7.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: setuptools (80.10.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,85 +0,0 @@
1
- from __future__ import annotations
2
-
3
- import json
4
- import typing as t
5
-
6
- import aiohttp
7
-
8
- from tonutils.exceptions import ProviderResponseError, CDN_CHALLENGE_MARKERS
9
-
10
-
11
- class HttpResponse:
12
-
13
- @classmethod
14
- async def read(cls, resp: aiohttp.ClientResponse) -> t.Any:
15
- body = await resp.read()
16
- if not body:
17
- return ""
18
-
19
- data = body.decode("utf-8", errors="replace").strip()
20
- if not data:
21
- return ""
22
-
23
- try:
24
- return json.loads(data)
25
- except (Exception,):
26
- return data
27
-
28
- @classmethod
29
- def raise_error(
30
- cls,
31
- *,
32
- status: int,
33
- url: str,
34
- data: t.Any,
35
- ) -> None:
36
- exc = cls._detect_proxy_error(data, status=status, url=url)
37
- if exc is not None:
38
- raise exc
39
-
40
- message = cls._extract_error_message(data)
41
- raise ProviderResponseError(
42
- code=status,
43
- message=message,
44
- endpoint=url,
45
- )
46
-
47
- @classmethod
48
- def _detect_proxy_error(
49
- cls,
50
- data: t.Any,
51
- *,
52
- status: int,
53
- url: str,
54
- ) -> t.Optional[ProviderResponseError]:
55
- body = (
56
- " ".join(str(v) for v in data.values())
57
- if isinstance(data, dict)
58
- else str(data)
59
- ).lower()
60
-
61
- for marker, message in CDN_CHALLENGE_MARKERS.items():
62
- if marker in body:
63
- return ProviderResponseError(
64
- code=status,
65
- message=message,
66
- endpoint=url,
67
- )
68
-
69
- return None
70
-
71
- @staticmethod
72
- def _extract_error_message(data: t.Any) -> str:
73
- if isinstance(data, dict):
74
- lowered = {k.lower(): v for k, v in data.items()}
75
- for key in ("error", "message", "detail", "description"):
76
- if key in lowered and isinstance(lowered[key], str):
77
- return lowered[key]
78
- string_values = [str(v) for v in data.values() if isinstance(v, str)]
79
- return "; ".join(string_values) if string_values else str(data)
80
-
81
- if isinstance(data, list):
82
- return "; ".join(map(str, data))
83
- if isinstance(data, str):
84
- return data
85
- return repr(data)
@@ -1,3 +0,0 @@
1
- from .provider import TonapiHttpProvider
2
-
3
- __all__ = ["TonapiHttpProvider"]
@@ -1,47 +0,0 @@
1
- import typing as t
2
-
3
- from pydantic import BaseModel
4
-
5
- from tonutils.types import ContractState
6
-
7
-
8
- class BlockchainMessagePayload(BaseModel):
9
- """Payload for /blockchain/message endpoint."""
10
-
11
- boc: str
12
-
13
-
14
- class BlockchainConfigResult(BaseModel):
15
- """Result model for /blockchain/config."""
16
-
17
- raw: t.Optional[str] = None
18
-
19
-
20
- class BlockchainAccountResult(BaseModel):
21
- """Result model for /blockchain/accounts/{address}."""
22
-
23
- balance: int = 0
24
- status: str = ContractState.NONEXIST.value
25
- code: t.Optional[str] = None
26
- data: t.Optional[str] = None
27
- last_transaction_lt: t.Optional[int] = None
28
- last_transaction_hash: t.Optional[str] = None
29
-
30
-
31
- class _BlockchainAccountTransaction(BaseModel):
32
- """Single account transaction with raw BoC payload."""
33
-
34
- raw: t.Optional[str] = None
35
-
36
-
37
- class BlockchainAccountTransactionsResult(BaseModel):
38
- """Result model for /blockchain/accounts/{address}/transactions."""
39
-
40
- transactions: t.Optional[t.List[_BlockchainAccountTransaction]] = None
41
-
42
-
43
- class BlockchainAccountMethodResult(BaseModel):
44
- """Result model for /blockchain/accounts/{address}/methods/{method_name}."""
45
-
46
- stack: t.Optional[t.List[t.Any]] = None
47
- exit_code: int
@@ -1,3 +0,0 @@
1
- from .provider import ToncenterHttpProvider
2
-
3
- __all__ = ["ToncenterHttpProvider"]
@@ -1,23 +0,0 @@
1
- import typing as t
2
-
3
- from tonutils.tools.block_scanner.events import (
4
- BlockEvent,
5
- EventBase,
6
- TransactionEvent,
7
- TransactionsEvent,
8
- )
9
-
10
- TEvent = t.TypeVar("TEvent", bound=EventBase)
11
-
12
- Handler = t.Callable[[TEvent], t.Awaitable[None]]
13
- Where = t.Callable[[TEvent], t.Union[bool, t.Awaitable[bool]]]
14
-
15
- BlockWhere = t.Callable[[BlockEvent], t.Union[bool, t.Awaitable[bool]]]
16
- TransactionWhere = t.Callable[[TransactionEvent], t.Union[bool, t.Awaitable[bool]]]
17
- TransactionsWhere = t.Callable[[TransactionsEvent], t.Union[bool, t.Awaitable[bool]]]
18
-
19
- AnyHandler = t.Callable[[EventBase], t.Awaitable[None]]
20
- AnyWhere = t.Callable[[EventBase], t.Union[bool, t.Awaitable[bool]]]
21
-
22
- HandlerEntry = t.Tuple[AnyHandler, t.Optional[AnyWhere]]
23
- Decorator = t.Callable[[Handler[TEvent]], Handler[TEvent]]
@@ -1,141 +0,0 @@
1
- import asyncio
2
- import inspect
3
- import traceback
4
- import typing as t
5
-
6
- from tonutils.tools.block_scanner.annotations import (
7
- AnyHandler,
8
- AnyWhere,
9
- Decorator,
10
- Handler,
11
- HandlerEntry,
12
- TEvent,
13
- Where,
14
- )
15
- from tonutils.tools.block_scanner.events import EventBase
16
-
17
-
18
- class EventDispatcher:
19
- """Dispatches events to registered handlers asynchronously."""
20
-
21
- def __init__(self, max_concurrency: int = 1000) -> None:
22
- """
23
- Initialize EventDispatcher.
24
-
25
- :param max_concurrency: maximum number of concurrent handler tasks.
26
- """
27
- self._handlers: t.Dict[t.Type[EventBase], t.List[HandlerEntry]] = {}
28
- self._sem = asyncio.Semaphore(max(1, max_concurrency))
29
- self._tasks: t.Set[asyncio.Task[None]] = set()
30
- self._closed = False
31
-
32
- def register(
33
- self,
34
- event_type: t.Type[TEvent],
35
- handler: Handler[TEvent],
36
- *,
37
- where: t.Optional[Where[TEvent]] = None,
38
- ) -> None:
39
- """
40
- Register a handler for a specific event type.
41
-
42
- :param event_type: subclass of EventBase to handle.
43
- :param handler: callable receiving the event.
44
- :param where: optional filter predicate. Handler is invoked only if predicate returns True.
45
- """
46
- if not callable(handler):
47
- raise TypeError("handler must be callable")
48
-
49
- entry: HandlerEntry = (
50
- t.cast(AnyHandler, handler),
51
- t.cast(t.Optional[AnyWhere], where),
52
- )
53
- self._handlers.setdefault(event_type, []).append(entry)
54
-
55
- def on(
56
- self,
57
- event_type: t.Type[TEvent],
58
- *,
59
- where: t.Optional[Where[TEvent]] = None,
60
- ) -> Decorator[TEvent]:
61
- """
62
- Decorator to register a handler for an event type.
63
-
64
- :param event_type: event class to handle.
65
- :param where: optional filter predicate.
66
- :return: Decorator that registers the handler.
67
- """
68
-
69
- def decorator(fn: Handler[TEvent]) -> Handler[TEvent]:
70
- self.register(event_type=event_type, handler=fn, where=where)
71
- return fn
72
-
73
- return decorator
74
-
75
- def _iter_handlers(self, event: EventBase) -> t.Sequence[HandlerEntry]:
76
- """Return all handlers matching the type of `event`."""
77
- out: t.List[HandlerEntry] = []
78
- for tp in type(event).mro():
79
- if tp is EventBase:
80
- break
81
- entries = self._handlers.get(t.cast(t.Type[EventBase], tp))
82
- if entries:
83
- out.extend(entries)
84
- return out
85
-
86
- def _on_task_done(self, task: asyncio.Task[None]) -> None:
87
- """Callback to handle task completion and print exceptions."""
88
- self._tasks.discard(task)
89
- try:
90
- exc = task.exception()
91
- except asyncio.CancelledError:
92
- return
93
- if exc is not None:
94
- traceback.print_exception(type(exc), exc, exc.__traceback__)
95
-
96
- async def _run_task(
97
- self,
98
- handler: AnyHandler,
99
- event: EventBase,
100
- where: t.Optional[AnyWhere] = None,
101
- ) -> None:
102
- """
103
- Run a single handler task with optional 'where' filtering.
104
-
105
- :param handler: async callable to execute.
106
- :param event: event instance to pass.
107
- :param where: optional predicate, skip handler if False.
108
- """
109
- async with self._sem:
110
- if where is not None:
111
- result = where(event)
112
- if inspect.isawaitable(result):
113
- result = await result
114
- if not result:
115
- return
116
- await handler(event)
117
-
118
- def emit(self, event: EventBase) -> None:
119
- """
120
- Emit an event to all matching handlers.
121
-
122
- Handlers are executed asynchronously.
123
- """
124
- if self._closed:
125
- return
126
-
127
- for handler, where in self._iter_handlers(event):
128
- task = asyncio.create_task(self._run_task(handler, event, where))
129
- self._tasks.add(task)
130
- task.add_done_callback(self._on_task_done)
131
-
132
- async def aclose(self) -> None:
133
- """
134
- Close the dispatcher and wait for all running handler tasks.
135
-
136
- After calling, no new events will be dispatched.
137
- """
138
- self._closed = True
139
- if self._tasks:
140
- await asyncio.gather(*self._tasks, return_exceptions=True)
141
- self._tasks.clear()