tonutils 2.0.1b2__tar.gz → 2.0.1b4__tar.gz

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 (139) hide show
  1. {tonutils-2.0.1b2/tonutils.egg-info → tonutils-2.0.1b4}/PKG-INFO +2 -5
  2. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/pyproject.toml +5 -5
  3. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/__init__.py +0 -2
  4. tonutils-2.0.1b4/tonutils/__meta__.py +1 -0
  5. tonutils-2.0.1b4/tonutils/cli.py +111 -0
  6. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/clients/__init__.py +7 -11
  7. tonutils-2.0.1b4/tonutils/clients/adnl/__init__.py +9 -0
  8. tonutils-2.0.1b4/tonutils/clients/adnl/balancer.py +800 -0
  9. tonutils-2.0.1b4/tonutils/clients/adnl/client.py +412 -0
  10. tonutils-2.0.1b4/tonutils/clients/adnl/provider/config.py +33 -0
  11. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/clients/adnl/provider/models.py +4 -0
  12. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/clients/adnl/provider/provider.py +203 -160
  13. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/clients/adnl/provider/transport.py +44 -33
  14. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/clients/adnl/provider/workers/base.py +0 -2
  15. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/clients/adnl/provider/workers/pinger.py +1 -1
  16. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/clients/adnl/provider/workers/reader.py +3 -2
  17. tonutils-2.0.1b2/tonutils/clients/adnl/provider/builder.py → tonutils-2.0.1b4/tonutils/clients/adnl/utils.py +62 -2
  18. tonutils-2.0.1b4/tonutils/clients/http/__init__.py +23 -0
  19. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/clients/http/balancer.py +75 -63
  20. tonutils-2.0.1b4/tonutils/clients/http/clients/__init__.py +13 -0
  21. tonutils-2.0.1b4/tonutils/clients/http/clients/chainstack.py +48 -0
  22. tonutils-2.0.1b4/tonutils/clients/http/clients/quicknode.py +47 -0
  23. tonutils-2.0.1b4/tonutils/clients/http/clients/tatum.py +56 -0
  24. tonutils-2.0.1b2/tonutils/clients/http/tonapi/client.py → tonutils-2.0.1b4/tonutils/clients/http/clients/tonapi.py +31 -31
  25. tonutils-2.0.1b2/tonutils/clients/http/toncenter/client.py → tonutils-2.0.1b4/tonutils/clients/http/clients/toncenter.py +59 -48
  26. tonutils-2.0.1b4/tonutils/clients/http/providers/__init__.py +4 -0
  27. tonutils-2.0.1b4/tonutils/clients/http/providers/base.py +201 -0
  28. tonutils-2.0.1b4/tonutils/clients/http/providers/response.py +85 -0
  29. tonutils-2.0.1b4/tonutils/clients/http/providers/tonapi/__init__.py +3 -0
  30. {tonutils-2.0.1b2/tonutils/clients/http → tonutils-2.0.1b4/tonutils/clients/http/providers}/tonapi/models.py +1 -0
  31. tonutils-2.0.1b4/tonutils/clients/http/providers/tonapi/provider.py +125 -0
  32. tonutils-2.0.1b4/tonutils/clients/http/providers/toncenter/__init__.py +3 -0
  33. {tonutils-2.0.1b2/tonutils/clients/http → tonutils-2.0.1b4/tonutils/clients/http/providers}/toncenter/models.py +1 -0
  34. tonutils-2.0.1b4/tonutils/clients/http/providers/toncenter/provider.py +119 -0
  35. tonutils-2.0.1b4/tonutils/clients/http/utils.py +140 -0
  36. tonutils-2.0.1b4/tonutils/clients/limiter.py +115 -0
  37. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/contracts/__init__.py +4 -0
  38. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/contracts/base.py +33 -20
  39. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/contracts/dns/methods.py +2 -2
  40. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/contracts/jetton/methods.py +2 -2
  41. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/contracts/nft/methods.py +2 -2
  42. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/contracts/nft/tlb.py +1 -1
  43. tonutils-2.0.1b2/tonutils/protocols/contract.py → tonutils-2.0.1b4/tonutils/contracts/protocol.py +29 -29
  44. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/contracts/telegram/methods.py +2 -2
  45. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/contracts/vanity/vanity.py +1 -1
  46. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/contracts/wallet/__init__.py +2 -0
  47. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/contracts/wallet/base.py +3 -3
  48. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/contracts/wallet/messages.py +1 -1
  49. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/contracts/wallet/methods.py +2 -2
  50. tonutils-2.0.1b2/tonutils/protocols/wallet.py → tonutils-2.0.1b4/tonutils/contracts/wallet/protocol.py +35 -35
  51. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/contracts/wallet/versions/v5.py +3 -3
  52. tonutils-2.0.1b4/tonutils/exceptions.py +212 -0
  53. tonutils-2.0.1b4/tonutils/tonconnect/__init__.py +0 -0
  54. tonutils-2.0.1b4/tonutils/tools/__init__.py +6 -0
  55. tonutils-2.0.1b4/tonutils/tools/block_scanner/__init__.py +26 -0
  56. tonutils-2.0.1b4/tonutils/tools/block_scanner/annotations.py +23 -0
  57. tonutils-2.0.1b4/tonutils/tools/block_scanner/dispatcher.py +141 -0
  58. tonutils-2.0.1b4/tonutils/tools/block_scanner/events.py +31 -0
  59. tonutils-2.0.1b4/tonutils/tools/block_scanner/scanner.py +315 -0
  60. tonutils-2.0.1b4/tonutils/tools/block_scanner/traversal.py +96 -0
  61. tonutils-2.0.1b4/tonutils/tools/block_scanner/where.py +151 -0
  62. tonutils-2.0.1b4/tonutils/tools/status_monitor/__init__.py +3 -0
  63. tonutils-2.0.1b4/tonutils/tools/status_monitor/console.py +157 -0
  64. tonutils-2.0.1b4/tonutils/tools/status_monitor/models.py +27 -0
  65. tonutils-2.0.1b4/tonutils/tools/status_monitor/monitor.py +295 -0
  66. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/types.py +125 -2
  67. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/utils.py +3 -3
  68. {tonutils-2.0.1b2 → tonutils-2.0.1b4/tonutils.egg-info}/PKG-INFO +2 -5
  69. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils.egg-info/SOURCES.txt +36 -26
  70. tonutils-2.0.1b4/tonutils.egg-info/entry_points.txt +2 -0
  71. tonutils-2.0.1b4/tonutils.egg-info/requires.txt +3 -0
  72. tonutils-2.0.1b2/tonutils/__meta__.py +0 -1
  73. tonutils-2.0.1b2/tonutils/clients/adnl/__init__.py +0 -5
  74. tonutils-2.0.1b2/tonutils/clients/adnl/balancer.py +0 -606
  75. tonutils-2.0.1b2/tonutils/clients/adnl/client.py +0 -276
  76. tonutils-2.0.1b2/tonutils/clients/adnl/provider/config.py +0 -34
  77. tonutils-2.0.1b2/tonutils/clients/adnl/provider/limiter.py +0 -56
  78. tonutils-2.0.1b2/tonutils/clients/adnl/stack.py +0 -64
  79. tonutils-2.0.1b2/tonutils/clients/http/__init__.py +0 -20
  80. tonutils-2.0.1b2/tonutils/clients/http/chainstack/__init__.py +0 -4
  81. tonutils-2.0.1b2/tonutils/clients/http/chainstack/client.py +0 -63
  82. tonutils-2.0.1b2/tonutils/clients/http/chainstack/provider.py +0 -44
  83. tonutils-2.0.1b2/tonutils/clients/http/quicknode/__init__.py +0 -4
  84. tonutils-2.0.1b2/tonutils/clients/http/quicknode/client.py +0 -60
  85. tonutils-2.0.1b2/tonutils/clients/http/quicknode/provider.py +0 -42
  86. tonutils-2.0.1b2/tonutils/clients/http/tatum/__init__.py +0 -4
  87. tonutils-2.0.1b2/tonutils/clients/http/tatum/client.py +0 -66
  88. tonutils-2.0.1b2/tonutils/clients/http/tatum/provider.py +0 -53
  89. tonutils-2.0.1b2/tonutils/clients/http/tonapi/__init__.py +0 -4
  90. tonutils-2.0.1b2/tonutils/clients/http/tonapi/provider.py +0 -150
  91. tonutils-2.0.1b2/tonutils/clients/http/tonapi/stack.py +0 -71
  92. tonutils-2.0.1b2/tonutils/clients/http/toncenter/__init__.py +0 -4
  93. tonutils-2.0.1b2/tonutils/clients/http/toncenter/provider.py +0 -145
  94. tonutils-2.0.1b2/tonutils/clients/http/toncenter/stack.py +0 -73
  95. tonutils-2.0.1b2/tonutils/exceptions.py +0 -294
  96. tonutils-2.0.1b2/tonutils/protocols/__init__.py +0 -9
  97. tonutils-2.0.1b2/tonutils.egg-info/requires.txt +0 -6
  98. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/LICENSE +0 -0
  99. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/README.md +0 -0
  100. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/setup.cfg +0 -0
  101. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/clients/adnl/provider/__init__.py +0 -0
  102. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/clients/adnl/provider/workers/__init__.py +0 -0
  103. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/clients/adnl/provider/workers/updater.py +0 -0
  104. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/clients/base.py +0 -0
  105. /tonutils-2.0.1b2/tonutils/protocols/client.py → /tonutils-2.0.1b4/tonutils/clients/protocol.py +0 -0
  106. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/contracts/codes.py +0 -0
  107. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/contracts/dns/__init__.py +0 -0
  108. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/contracts/dns/collection.py +0 -0
  109. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/contracts/dns/item.py +0 -0
  110. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/contracts/dns/tlb.py +0 -0
  111. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/contracts/jetton/__init__.py +0 -0
  112. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/contracts/jetton/master.py +0 -0
  113. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/contracts/jetton/tlb.py +0 -0
  114. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/contracts/jetton/wallet.py +0 -0
  115. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/contracts/nft/__init__.py +0 -0
  116. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/contracts/nft/collection.py +0 -0
  117. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/contracts/nft/item.py +0 -0
  118. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/contracts/opcodes.py +0 -0
  119. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/contracts/telegram/__init__.py +0 -0
  120. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/contracts/telegram/collection.py +0 -0
  121. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/contracts/telegram/item.py +0 -0
  122. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/contracts/telegram/tlb.py +0 -0
  123. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/contracts/vanity/__init__.py +0 -0
  124. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/contracts/vanity/models.py +0 -0
  125. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/contracts/vanity/tlb.py +0 -0
  126. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/contracts/versions.py +0 -0
  127. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/contracts/wallet/configs.py +0 -0
  128. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/contracts/wallet/params.py +0 -0
  129. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/contracts/wallet/tlb.py +0 -0
  130. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/contracts/wallet/versions/__init__.py +0 -0
  131. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/contracts/wallet/versions/hw.py +0 -0
  132. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/contracts/wallet/versions/pp.py +0 -0
  133. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/contracts/wallet/versions/v1.py +0 -0
  134. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/contracts/wallet/versions/v2.py +0 -0
  135. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/contracts/wallet/versions/v3.py +0 -0
  136. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/contracts/wallet/versions/v4.py +0 -0
  137. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils/py.typed +0 -0
  138. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils.egg-info/dependency_links.txt +0 -0
  139. {tonutils-2.0.1b2 → tonutils-2.0.1b4}/tonutils.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tonutils
3
- Version: 2.0.1b2
3
+ Version: 2.0.1b4
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
@@ -26,11 +26,8 @@ Requires-Python: <3.15,>=3.10
26
26
  Description-Content-Type: text/markdown
27
27
  License-File: LICENSE
28
28
  Requires-Dist: aiohttp>=3.7.0
29
- Requires-Dist: pyapiq>=0.2.1
30
- Requires-Dist: pycryptodomex~=3.23.0
31
29
  Requires-Dist: pydantic<3.0,>=2.0
32
- Requires-Dist: pynacl~=1.6.0
33
- Requires-Dist: pytoniq-core~=0.1.45
30
+ Requires-Dist: pytoniq-core~=0.1.46
34
31
  Dynamic: license-file
35
32
 
36
33
  # 📦 Tonutils 2.0 [BETA]
@@ -14,11 +14,8 @@ maintainers = [
14
14
  ]
15
15
  dependencies = [
16
16
  "aiohttp>=3.7.0",
17
- "pyapiq>=0.2.1",
18
- "pycryptodomex~=3.23.0",
19
17
  "pydantic>=2.0,<3.0",
20
- "pynacl~=1.6.0",
21
- "pytoniq-core~=0.1.45",
18
+ "pytoniq-core~=0.1.46",
22
19
  ]
23
20
  keywords = [
24
21
  "AsyncIO",
@@ -59,5 +56,8 @@ include = ["tonutils", "tonutils.*"]
59
56
  [tool.setuptools.package-data]
60
57
  tonutils = ["py.typed"]
61
58
 
59
+ [project.scripts]
60
+ tonutils = "tonutils.cli:main"
61
+
62
62
  [tool.setuptools.dynamic]
63
- version = { attr = "tonutils.__meta__.__version__" }
63
+ version = { attr = "tonutils.__meta__.__version__" }
@@ -1,7 +1,6 @@
1
1
  from . import (
2
2
  clients,
3
3
  contracts,
4
- protocols,
5
4
  exceptions,
6
5
  types,
7
6
  utils,
@@ -12,7 +11,6 @@ __all__ = [
12
11
  "__version__",
13
12
  "clients",
14
13
  "contracts",
15
- "protocols",
16
14
  "exceptions",
17
15
  "types",
18
16
  "utils",
@@ -0,0 +1 @@
1
+ __version__ = "2.0.1b4"
@@ -0,0 +1,111 @@
1
+ import argparse
2
+ import asyncio
3
+ import typing as t
4
+
5
+ from tonutils.__meta__ import __version__
6
+ from tonutils.clients.adnl.provider.config import (
7
+ get_mainnet_global_config,
8
+ get_testnet_global_config,
9
+ load_global_config,
10
+ )
11
+ from tonutils.tools.status_monitor import LiteServerMonitor
12
+ from tonutils.types import NetworkGlobalID
13
+
14
+ NETWORK_MAP: t.Dict[str, NetworkGlobalID] = {
15
+ "mainnet": NetworkGlobalID.MAINNET,
16
+ "testnet": NetworkGlobalID.TESTNET,
17
+ }
18
+
19
+
20
+ def parse_network(value: str) -> NetworkGlobalID:
21
+ value = value.lower().strip()
22
+ if value not in NETWORK_MAP:
23
+ raise argparse.ArgumentTypeError(f"Unknown network: {value}")
24
+ return NETWORK_MAP[value]
25
+
26
+
27
+ def cmd_status(args: argparse.Namespace) -> None:
28
+ if args.config:
29
+ config = load_global_config(args.config)
30
+ else:
31
+ config_getter = {
32
+ NetworkGlobalID.MAINNET: get_mainnet_global_config,
33
+ NetworkGlobalID.TESTNET: get_testnet_global_config,
34
+ }
35
+ config = config_getter[args.network]()
36
+
37
+ async def _run() -> None:
38
+ monitor = LiteServerMonitor.from_config(
39
+ config=config,
40
+ network=args.network,
41
+ rps_limit=args.rps,
42
+ )
43
+ try:
44
+ await monitor.run()
45
+ finally:
46
+ await monitor.stop()
47
+
48
+ try:
49
+ asyncio.run(_run())
50
+ except KeyboardInterrupt:
51
+ pass
52
+
53
+
54
+ def _create_parser() -> argparse.ArgumentParser:
55
+ parser = argparse.ArgumentParser(
56
+ prog="tonutils",
57
+ description="Tonutils CLI.",
58
+ )
59
+ parser.add_argument(
60
+ "-v",
61
+ "--version",
62
+ action="version",
63
+ version=f"tonutils {__version__}",
64
+ )
65
+
66
+ subs = parser.add_subparsers(dest="command", metavar="command")
67
+
68
+ status = subs.add_parser(
69
+ "status",
70
+ help="Monitor lite-servers status.",
71
+ )
72
+ status.add_argument(
73
+ "-n",
74
+ "--network",
75
+ type=parse_network,
76
+ metavar="NET",
77
+ default=NetworkGlobalID.MAINNET,
78
+ help="mainnet (default) or testnet",
79
+ )
80
+ status.add_argument(
81
+ "-c",
82
+ "--config",
83
+ type=str,
84
+ metavar="PATH",
85
+ help="Config file path or URL",
86
+ )
87
+ status.add_argument(
88
+ "-r",
89
+ "--rps",
90
+ type=int,
91
+ metavar="N",
92
+ default=100,
93
+ help="Requests per second (default: 100)",
94
+ )
95
+ status.set_defaults(func=cmd_status)
96
+
97
+ return parser
98
+
99
+
100
+ def main() -> None:
101
+ parser = _create_parser()
102
+ args = parser.parse_args()
103
+
104
+ if hasattr(args, "func"):
105
+ args.func(args)
106
+ else:
107
+ parser.print_help()
108
+
109
+
110
+ if __name__ == "__main__":
111
+ main()
@@ -1,13 +1,13 @@
1
- from .adnl import AdnlBalancer, AdnlClient, AdnlProvider
2
- from .base import BaseClient
1
+ from .adnl import (
2
+ LiteBalancer,
3
+ LiteClient,
4
+ AdnlProvider,
5
+ )
3
6
  from .http import (
4
7
  HttpBalancer,
5
8
  ChainstackHttpClient,
6
- ChainstackHttpProvider,
7
9
  QuicknodeHttpClient,
8
- QuicknodeHttpProvider,
9
10
  TatumHttpClient,
10
- TatumHttpProvider,
11
11
  TonapiHttpClient,
12
12
  TonapiHttpProvider,
13
13
  ToncenterHttpClient,
@@ -15,17 +15,13 @@ from .http import (
15
15
  )
16
16
 
17
17
  __all__ = [
18
- "BaseClient",
19
- "AdnlBalancer",
20
- "AdnlClient",
18
+ "LiteBalancer",
19
+ "LiteClient",
21
20
  "AdnlProvider",
22
21
  "HttpBalancer",
23
22
  "ChainstackHttpClient",
24
- "ChainstackHttpProvider",
25
23
  "QuicknodeHttpClient",
26
- "QuicknodeHttpProvider",
27
24
  "TatumHttpClient",
28
- "TatumHttpProvider",
29
25
  "TonapiHttpClient",
30
26
  "TonapiHttpProvider",
31
27
  "ToncenterHttpClient",
@@ -0,0 +1,9 @@
1
+ from .balancer import LiteBalancer
2
+ from .client import LiteClient
3
+ from .provider import AdnlProvider
4
+
5
+ __all__ = [
6
+ "LiteBalancer",
7
+ "LiteClient",
8
+ "AdnlProvider",
9
+ ]