tonutils 2.0.1b4__py3-none-any.whl → 2.0.1b6__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 (47) hide show
  1. tonutils/__meta__.py +1 -1
  2. tonutils/clients/__init__.py +10 -10
  3. tonutils/clients/adnl/balancer.py +21 -24
  4. tonutils/clients/adnl/client.py +21 -24
  5. tonutils/clients/adnl/provider/config.py +22 -7
  6. tonutils/clients/base.py +22 -12
  7. tonutils/clients/http/__init__.py +11 -11
  8. tonutils/clients/http/balancer.py +11 -11
  9. tonutils/clients/http/clients/__init__.py +10 -10
  10. tonutils/clients/http/clients/chainstack.py +3 -3
  11. tonutils/clients/http/clients/quicknode.py +2 -3
  12. tonutils/clients/http/clients/tatum.py +3 -3
  13. tonutils/clients/http/clients/tonapi.py +9 -10
  14. tonutils/clients/http/clients/toncenter.py +50 -23
  15. tonutils/clients/http/{providers → provider}/__init__.py +4 -1
  16. tonutils/clients/http/{providers → provider}/base.py +71 -7
  17. tonutils/clients/http/{providers/toncenter → provider}/models.py +43 -1
  18. tonutils/clients/http/{providers/tonapi/provider.py → provider/tonapi.py} +8 -8
  19. tonutils/clients/http/{providers/toncenter/provider.py → provider/toncenter.py} +22 -14
  20. tonutils/clients/limiter.py +61 -59
  21. tonutils/clients/protocol.py +2 -2
  22. tonutils/contracts/wallet/base.py +2 -3
  23. tonutils/contracts/wallet/messages.py +4 -8
  24. tonutils/tonconnect/bridge/__init__.py +0 -0
  25. tonutils/tonconnect/events.py +0 -0
  26. tonutils/tonconnect/models/__init__.py +0 -0
  27. tonutils/tonconnect/storage.py +0 -0
  28. tonutils/tonconnect/tonconnect.py +0 -0
  29. tonutils/tools/block_scanner/__init__.py +2 -19
  30. tonutils/tools/block_scanner/events.py +48 -7
  31. tonutils/tools/block_scanner/scanner.py +315 -223
  32. tonutils/tools/block_scanner/storage.py +11 -0
  33. tonutils/utils.py +0 -48
  34. {tonutils-2.0.1b4.dist-info → tonutils-2.0.1b6.dist-info}/METADATA +1 -1
  35. {tonutils-2.0.1b4.dist-info → tonutils-2.0.1b6.dist-info}/RECORD +39 -41
  36. {tonutils-2.0.1b4.dist-info → tonutils-2.0.1b6.dist-info}/WHEEL +1 -1
  37. tonutils/clients/http/providers/response.py +0 -85
  38. tonutils/clients/http/providers/tonapi/__init__.py +0 -3
  39. tonutils/clients/http/providers/tonapi/models.py +0 -47
  40. tonutils/clients/http/providers/toncenter/__init__.py +0 -3
  41. tonutils/tools/block_scanner/annotations.py +0 -23
  42. tonutils/tools/block_scanner/dispatcher.py +0 -141
  43. tonutils/tools/block_scanner/traversal.py +0 -96
  44. tonutils/tools/block_scanner/where.py +0 -151
  45. {tonutils-2.0.1b4.dist-info → tonutils-2.0.1b6.dist-info}/entry_points.txt +0 -0
  46. {tonutils-2.0.1b4.dist-info → tonutils-2.0.1b6.dist-info}/licenses/LICENSE +0 -0
  47. {tonutils-2.0.1b4.dist-info → tonutils-2.0.1b6.dist-info}/top_level.txt +0 -0
@@ -1,26 +1,9 @@
1
- from .events import (
2
- BlockEvent,
3
- TransactionEvent,
4
- TransactionsEvent,
5
- )
1
+ from .events import BlockEvent, ErrorEvent, TransactionsEvent
6
2
  from .scanner import BlockScanner
7
- from .where import (
8
- Where,
9
- comment,
10
- destination,
11
- opcode,
12
- sender,
13
- )
14
-
15
3
 
16
4
  __all__ = [
17
5
  "BlockScanner",
18
6
  "BlockEvent",
19
- "TransactionEvent",
7
+ "ErrorEvent",
20
8
  "TransactionsEvent",
21
- "Where",
22
- "comment",
23
- "destination",
24
- "opcode",
25
- "sender",
26
9
  ]
@@ -8,24 +8,65 @@ from tonutils.clients import LiteBalancer, LiteClient
8
8
 
9
9
 
10
10
  @dataclass(frozen=True, slots=True)
11
- class EventBase:
11
+ class _BaseEvent:
12
+ """Base event for BlockScanner.
13
+
14
+ Attributes:
15
+ client: Lite client/balancer.
16
+ mc_block: Masterchain block being processed.
17
+ context: Shared user context.
18
+ """
19
+
12
20
  client: t.Union[LiteBalancer, LiteClient]
13
21
  mc_block: BlockIdExt
14
- context: t.Dict[str, t.Any]
22
+ context: t.Mapping[str, t.Any]
15
23
 
16
24
 
17
25
  @dataclass(frozen=True, slots=True)
18
- class BlockEvent(EventBase):
19
- block: BlockIdExt
26
+ class ErrorEvent(_BaseEvent):
27
+ """Error raised during scanning or handler execution.
28
+
29
+ Attributes:
30
+ client: Lite client/balancer.
31
+ mc_block: Masterchain block being processed.
32
+ context: Shared user context.
33
+ error: Raised exception.
34
+ event: Related event (if any).
35
+ handler: Handler/callable that raised (if any).
36
+ block: Related shard block (if any).
37
+ """
38
+
39
+ error: BaseException
40
+ event: t.Any = None
41
+ handler: t.Any = None
42
+ block: t.Optional[BlockIdExt] = None
20
43
 
21
44
 
22
45
  @dataclass(frozen=True, slots=True)
23
- class TransactionEvent(EventBase):
46
+ class BlockEvent(_BaseEvent):
47
+ """Shard block event.
48
+
49
+ Attributes:
50
+ client: Lite client/balancer.
51
+ mc_block: Masterchain block being processed.
52
+ context: Shared user context.
53
+ block: Shard block identifier.
54
+ """
55
+
24
56
  block: BlockIdExt
25
- transaction: Transaction
26
57
 
27
58
 
28
59
  @dataclass(frozen=True, slots=True)
29
- class TransactionsEvent(EventBase):
60
+ class TransactionsEvent(_BaseEvent):
61
+ """Transactions event for a shard block.
62
+
63
+ Attributes:
64
+ client: Lite client/balancer.
65
+ mc_block: Masterchain block being processed.
66
+ context: Shared user context.
67
+ block: Shard block identifier.
68
+ transactions: Transactions from this block.
69
+ """
70
+
30
71
  block: BlockIdExt
31
72
  transactions: t.List[Transaction] = field(default_factory=list)