tonutils 1.0.0a2__tar.gz → 1.0.0a4__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 (88) hide show
  1. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/PKG-INFO +2 -2
  2. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/setup.py +2 -2
  3. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/clients/__init__.py +11 -0
  4. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/clients/liteserver/client.py +4 -0
  5. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/contracts/jetton/__init__.py +17 -0
  6. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/contracts/nft/__init__.py +16 -0
  7. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/contracts/nft/item.py +2 -2
  8. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/contracts/wallet/__init__.py +21 -1
  9. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/types/__init__.py +1 -0
  10. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/types/common.py +2 -2
  11. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/types/tlb/content.py +2 -2
  12. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/utils/msg_builders.py +11 -1
  13. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils.egg-info/PKG-INFO +2 -2
  14. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils.egg-info/requires.txt +1 -1
  15. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/LICENSE +0 -0
  16. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/README.md +0 -0
  17. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/setup.cfg +0 -0
  18. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tests/tests_clients.py +0 -0
  19. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tests/tests_utils.py +0 -0
  20. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/__init__.py +0 -0
  21. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/clients/base.py +0 -0
  22. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/clients/liteserver/__init__.py +0 -0
  23. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/clients/liteserver/stub.py +0 -0
  24. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/clients/quicknode/__init__.py +0 -0
  25. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/clients/quicknode/api.py +0 -0
  26. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/clients/quicknode/client.py +0 -0
  27. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/clients/tatum/__init__.py +0 -0
  28. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/clients/tatum/api.py +0 -0
  29. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/clients/tatum/client.py +0 -0
  30. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/clients/tonapi/__init__.py +0 -0
  31. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/clients/tonapi/api.py +0 -0
  32. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/clients/tonapi/client.py +0 -0
  33. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/clients/tonapi/models.py +0 -0
  34. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/clients/toncenter/__init__.py +0 -0
  35. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/clients/toncenter/api.py +0 -0
  36. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/clients/toncenter/client.py +0 -0
  37. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/clients/toncenter/models.py +0 -0
  38. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/contracts/__init__.py +0 -0
  39. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/contracts/base.py +0 -0
  40. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/contracts/codes.py +0 -0
  41. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/contracts/jetton/get_methods.py +0 -0
  42. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/contracts/jetton/master.py +0 -0
  43. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/contracts/jetton/wallet.py +0 -0
  44. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/contracts/nft/collection.py +0 -0
  45. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/contracts/nft/get_methods.py +0 -0
  46. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/contracts/wallet/base.py +0 -0
  47. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/contracts/wallet/get_methods.py +0 -0
  48. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/contracts/wallet/versions/__init__.py +0 -0
  49. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/contracts/wallet/versions/hw.py +0 -0
  50. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/contracts/wallet/versions/pp.py +0 -0
  51. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/contracts/wallet/versions/v1.py +0 -0
  52. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/contracts/wallet/versions/v2.py +0 -0
  53. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/contracts/wallet/versions/v3.py +0 -0
  54. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/contracts/wallet/versions/v4.py +0 -0
  55. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/contracts/wallet/versions/v5.py +0 -0
  56. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/exceptions.py +0 -0
  57. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/protocols/__init__.py +0 -0
  58. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/protocols/client.py +0 -0
  59. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/protocols/contract.py +0 -0
  60. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/protocols/wallet.py +0 -0
  61. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/py.typed +0 -0
  62. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/tonconnect/__init__.py +0 -0
  63. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/types/client.py +0 -0
  64. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/types/configs.py +0 -0
  65. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/types/contract.py +0 -0
  66. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/types/keystructs.py +0 -0
  67. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/types/messages.py +0 -0
  68. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/types/opcodes.py +0 -0
  69. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/types/params.py +0 -0
  70. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/types/stack.py +0 -0
  71. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/types/tlb/__init__.py +0 -0
  72. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/types/tlb/contract.py +0 -0
  73. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/types/tlb/jetton.py +0 -0
  74. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/types/tlb/msg.py +0 -0
  75. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/types/tlb/nft.py +0 -0
  76. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/types/tlb/text.py +0 -0
  77. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/types/tlb/wallet.py +0 -0
  78. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/utils/__init__.py +0 -0
  79. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/utils/converters.py +0 -0
  80. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/utils/parse_config.py +0 -0
  81. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/utils/stack_codec.py +0 -0
  82. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/utils/text_cipher.py +0 -0
  83. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/utils/validations.py +0 -0
  84. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/utils/value_utils.py +0 -0
  85. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils/utils/wallet_utils.py +0 -0
  86. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils.egg-info/SOURCES.txt +0 -0
  87. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils.egg-info/dependency_links.txt +0 -0
  88. {tonutils-1.0.0a2 → tonutils-1.0.0a4}/tonutils.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tonutils
3
- Version: 1.0.0a2
3
+ Version: 1.0.0a4
4
4
  Summary: Tonutils is a high-level, object-oriented Python library designed to facilitate seamless interactions with the TON blockchain.
5
5
  Home-page: https://github.com/nessshon/tonutils
6
6
  Author: nessshon
@@ -24,7 +24,7 @@ Classifier: Environment :: Console
24
24
  Requires-Python: >=3.10
25
25
  Description-Content-Type: text/markdown
26
26
  License-File: LICENSE
27
- Requires-Dist: pyapiq>=0.1.3
27
+ Requires-Dist: pyapiq>=0.1.5
28
28
  Requires-Dist: pytoniq-core>=0.1.44
29
29
  Requires-Dist: PyNaCl~=1.5.0
30
30
  Provides-Extra: pytoniq
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
5
5
 
6
6
  setuptools.setup(
7
7
  name="tonutils",
8
- version="1.0.0a2",
8
+ version="1.0.0a4",
9
9
  author="nessshon",
10
10
  description=(
11
11
  "Tonutils is a high-level, object-oriented Python library "
@@ -24,7 +24,7 @@ setuptools.setup(
24
24
  package_data={"tonutils": ["py.typed"]},
25
25
  python_requires=">=3.10",
26
26
  install_requires=[
27
- "pyapiq>=0.1.3",
27
+ "pyapiq>=0.1.5",
28
28
  "pytoniq-core>=0.1.44",
29
29
  "PyNaCl~=1.5.0",
30
30
  ],
@@ -1,10 +1,21 @@
1
+ import typing as t
2
+
1
3
  from .liteserver import LiteserverClient
2
4
  from .quicknode import QuicknodeClient
3
5
  from .tatum import TatumClient
4
6
  from .tonapi import TonapiClient
5
7
  from .toncenter import ToncenterClient
6
8
 
9
+ ClientLike = t.Union[
10
+ LiteserverClient,
11
+ QuicknodeClient,
12
+ TatumClient,
13
+ ToncenterClient,
14
+ TonapiClient,
15
+ ]
16
+
7
17
  __all__ = [
18
+ "ClientLike",
8
19
  "LiteserverClient",
9
20
  "QuicknodeClient",
10
21
  "TatumClient",
@@ -37,6 +37,10 @@ def _ensure_api_ready(func: F) -> F:
37
37
  raise PytoniqDependencyError()
38
38
  if not self.api.inited:
39
39
  await self.api.start_up()
40
+ if len(self.api.alive_peers_num) == 0:
41
+ if self.api.inited:
42
+ await self.api.close_all()
43
+ await self.api.start_up()
40
44
  return await func(self, *args, **kwargs)
41
45
 
42
46
  return t.cast(F, wrapper)
@@ -1,18 +1,35 @@
1
+ import typing as t
2
+
1
3
  from .get_methods import (
2
4
  JettonMasterGetMethods,
3
5
  JettonWalletGetMethods,
4
6
  )
5
7
  from .master import (
8
+ BaseJettonMaster,
6
9
  JettonMasterStandard,
7
10
  JettonMasterStablecoin,
8
11
  JettonMasterStablecoinV2,
9
12
  )
10
13
  from .wallet import (
14
+ BaseJettonWallet,
11
15
  JettonWalletStandard,
12
16
  JettonWalletStablecoin,
13
17
  JettonWalletStablecoinV2,
14
18
  )
15
19
 
20
+ JettonMasterLike = t.Union[
21
+ BaseJettonMaster,
22
+ JettonMasterStandard,
23
+ JettonMasterStablecoin,
24
+ JettonMasterStablecoinV2,
25
+ ]
26
+ JettonWalletLike = t.Union[
27
+ BaseJettonWallet,
28
+ JettonWalletStandard,
29
+ JettonWalletStablecoin,
30
+ JettonWalletStablecoinV2,
31
+ ]
32
+
16
33
  __all__ = [
17
34
  "JettonMasterGetMethods",
18
35
  "JettonWalletGetMethods",
@@ -1,3 +1,5 @@
1
+ import typing as t
2
+
1
3
  from .collection import (
2
4
  BaseNFTCollection,
3
5
  NFTCollectionEditable,
@@ -14,9 +16,23 @@ from .item import (
14
16
  NFTItemStandard,
15
17
  )
16
18
 
19
+ NFTCollectionLike = t.Union[
20
+ BaseNFTCollection,
21
+ NFTCollectionEditable,
22
+ NFTCollectionStandard,
23
+ ]
24
+ NFTItemLike = t.Union[
25
+ BaseNFTItem,
26
+ NFTItemEditable,
27
+ NFTItemSoulbound,
28
+ NFTItemStandard,
29
+ ]
30
+
17
31
  __all__ = [
18
32
  "BaseNFTCollection",
19
33
  "BaseNFTItem",
34
+ "NFTCollectionLike",
35
+ "NFTItemLike",
20
36
  "NFTCollectionGetMethods",
21
37
  "NFTItemGetMethods",
22
38
  "NFTCollectionEditable",
@@ -81,7 +81,7 @@ class NFTItemStandard(BaseNFTItem[DStandard, C]):
81
81
 
82
82
  class NFTItemEditable(BaseNFTItem[DEditable, C]):
83
83
  _data_model = NFTItemEditableData
84
- VERSION = NFTItemVersion.NFTItemStandard
84
+ VERSION = NFTItemVersion.NFTItemEditable
85
85
 
86
86
  @property
87
87
  def editor_address(self) -> Address:
@@ -96,7 +96,7 @@ class NFTItemEditable(BaseNFTItem[DEditable, C]):
96
96
 
97
97
  class NFTItemSoulbound(BaseNFTItem[DSoulbound, C]):
98
98
  _data_model = NFTItemSoulboundData
99
- VERSION = NFTItemVersion.NFTItemStandard
99
+ VERSION = NFTItemVersion.NFTItemSoulbound
100
100
 
101
101
  @property
102
102
  def authority_address(self) -> t.Optional[Address]:
@@ -1,6 +1,7 @@
1
+ import typing as t
2
+
1
3
  from .base import BaseWallet
2
4
  from .get_methods import WalletGetMethods
3
-
4
5
  from .versions import (
5
6
  WalletHighloadV2,
6
7
  WalletHighloadV3R1,
@@ -18,8 +19,27 @@ from .versions import (
18
19
  WalletV5R1,
19
20
  )
20
21
 
22
+ WalletLike = t.Union[
23
+ BaseWallet,
24
+ WalletHighloadV2,
25
+ WalletHighloadV3R1,
26
+ WalletPreprocessedV2,
27
+ WalletV1R1,
28
+ WalletV1R2,
29
+ WalletV1R3,
30
+ WalletV2R1,
31
+ WalletV2R2,
32
+ WalletV3R1,
33
+ WalletV3R2,
34
+ WalletV4R1,
35
+ WalletV4R2,
36
+ WalletV5Beta,
37
+ WalletV5R1,
38
+ ]
39
+
21
40
  __all__ = [
22
41
  "BaseWallet",
42
+ "WalletLike",
23
43
  "WalletGetMethods",
24
44
  "WalletHighloadV2",
25
45
  "WalletHighloadV3R1",
@@ -139,6 +139,7 @@ __all__ = [
139
139
  "JettonMintBody",
140
140
  "JettonMasterStandardData",
141
141
  "JettonMasterStablecoinData",
142
+ "JettonMasterVersion",
142
143
  "JettonInternalTransferBody",
143
144
  "JettonStandardChangeAdminBody",
144
145
  "JettonStandardChangeContentBody",
@@ -28,8 +28,8 @@ class WorkchainID(int, Enum):
28
28
 
29
29
 
30
30
  class MetadataPrefix(int, Enum):
31
- ONCHAIN = 0x00
32
- OFFCHAIN = 0x01
31
+ ONCHAIN = 0
32
+ OFFCHAIN = 1
33
33
 
34
34
 
35
35
  DEFAULT_SUBWALLET_ID = 698983191
@@ -7,9 +7,9 @@ from pytoniq_core import (
7
7
  Builder,
8
8
  Cell,
9
9
  Slice,
10
+ TlbScheme,
10
11
  HashMap,
11
12
  begin_cell,
12
- TlbScheme,
13
13
  )
14
14
 
15
15
  from ...types.common import MetadataPrefix
@@ -43,7 +43,7 @@ class OnchainContent(TlbScheme):
43
43
  def _value_serializer(v: str, b: Builder) -> Builder:
44
44
  cell = begin_cell()
45
45
  cell.store_uint(MetadataPrefix.ONCHAIN, 8)
46
- cell.store_snake_string(v)
46
+ cell.store_snake_string(str(v))
47
47
  return b.store_ref(cell.end_cell())
48
48
 
49
49
  @staticmethod
@@ -21,6 +21,10 @@ def build_external_msg_any(
21
21
  body: t.Optional[Cell] = None,
22
22
  state_init: t.Optional[StateInit] = None,
23
23
  ) -> MessageAny:
24
+ if isinstance(src, str):
25
+ src = Address(src)
26
+ if isinstance(dest, str):
27
+ dest = Address(dest)
24
28
  info = ExternalMsgInfo(src=src, dest=dest, import_fee=import_fee)
25
29
  return MessageAny(info, state_init, body)
26
30
 
@@ -39,6 +43,10 @@ def build_internal_msg_any(
39
43
  body: t.Optional[Cell] = None,
40
44
  state_init: t.Optional[StateInit] = None,
41
45
  ) -> MessageAny:
46
+ if isinstance(src, str):
47
+ src = Address(src)
48
+ if isinstance(dest, str):
49
+ dest = Address(dest)
42
50
  if isinstance(value, int):
43
51
  value = CurrencyCollection(value)
44
52
  if bounce is None:
@@ -62,13 +70,15 @@ def build_internal_msg_any(
62
70
 
63
71
 
64
72
  def build_internal_wallet_msg(
65
- dest: Address,
73
+ dest: t.Union[Address, str],
66
74
  send_mode: t.Optional[int] = None,
67
75
  value: int = 0,
68
76
  body: t.Optional[Cell] = None,
69
77
  state_init: t.Optional[StateInit] = None,
70
78
  bounce: t.Optional[bool] = None,
71
79
  ) -> WalletMessage:
80
+ if isinstance(dest, str):
81
+ dest = Address(dest)
72
82
  if send_mode is None:
73
83
  send_mode = DEFAULT_SENDMODE
74
84
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tonutils
3
- Version: 1.0.0a2
3
+ Version: 1.0.0a4
4
4
  Summary: Tonutils is a high-level, object-oriented Python library designed to facilitate seamless interactions with the TON blockchain.
5
5
  Home-page: https://github.com/nessshon/tonutils
6
6
  Author: nessshon
@@ -24,7 +24,7 @@ Classifier: Environment :: Console
24
24
  Requires-Python: >=3.10
25
25
  Description-Content-Type: text/markdown
26
26
  License-File: LICENSE
27
- Requires-Dist: pyapiq>=0.1.3
27
+ Requires-Dist: pyapiq>=0.1.5
28
28
  Requires-Dist: pytoniq-core>=0.1.44
29
29
  Requires-Dist: PyNaCl~=1.5.0
30
30
  Provides-Extra: pytoniq
@@ -1,4 +1,4 @@
1
- pyapiq>=0.1.3
1
+ pyapiq>=0.1.5
2
2
  pytoniq-core>=0.1.44
3
3
  PyNaCl~=1.5.0
4
4
 
File without changes
File without changes
File without changes
File without changes