tonutils 2.0.1b0__py3-none-any.whl → 2.0.1b2__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.
tonutils/__meta__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "2.0.1b0"
1
+ __version__ = "2.0.1b2"
@@ -262,8 +262,6 @@ class AdnlProvider:
262
262
  except AdnlServerError as e:
263
263
  if e.code != 651:
264
264
  raise
265
- print("missing block!", e.message)
266
- print(self.last_mc_block)
267
265
  error_message = e.message
268
266
  if attempt < max_651_retries - 1:
269
267
  await asyncio.sleep(0.3 * (2**attempt))
@@ -115,6 +115,14 @@ from .telegram.collection import (
115
115
  TelegramGiftsCollection,
116
116
  TelegramUsernamesCollection,
117
117
  )
118
+ from .vanity import (
119
+ Vanity,
120
+ VanityConfig,
121
+ VanityDeployBody,
122
+ VanityInit,
123
+ VanityResult,
124
+ VanitySpecial,
125
+ )
118
126
  from .versions import ContractVersion
119
127
  from .wallet import (
120
128
  BaseMessageBuilder,
@@ -275,6 +283,12 @@ __all__ = [
275
283
  "TONDNSItem",
276
284
  "TONDNSItemData",
277
285
  "TONTransferBuilder",
286
+ "Vanity",
287
+ "VanityConfig",
288
+ "VanityDeployBody",
289
+ "VanityInit",
290
+ "VanityResult",
291
+ "VanitySpecial",
278
292
  "WalletHighloadV2",
279
293
  "WalletHighloadV2Config",
280
294
  "WalletHighloadV2Data",
@@ -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.contracts.base import BaseContract
7
+ from tonutils.contracts.vanity.models import VanityResult
8
+ from tonutils.protocols.client import ClientProtocol
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
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tonutils
3
- Version: 2.0.1b0
3
+ Version: 2.0.1b2
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
@@ -37,10 +37,10 @@ Dynamic: license-file
37
37
 
38
38
  [![TON](https://img.shields.io/badge/TON-grey?logo=TON&logoColor=40AEF0)](https://ton.org)
39
39
  ![Python Versions](https://img.shields.io/badge/Python-3.10%20--%203.14-black?color=FFE873&labelColor=3776AB)
40
- [![PyPI](https://img.shields.io/badge/pypi-2.0.1b0-FFE873?labelColor=3776AB)](https://pypi.org/project/tonutils/2.0.1b0/)
40
+ [![PyPI](https://img.shields.io/badge/pypi-2.0.1b2-FFE873?labelColor=3776AB)](https://pypi.org/project/tonutils/2.0.1b2/)
41
41
  [![License](https://img.shields.io/github/license/nessshon/tonutils)](LICENSE)
42
42
 
43
- ![Image](assets/banner-640x274.png)
43
+ ![Image](assets/banner.png)
44
44
 
45
45
  ![Downloads](https://pepy.tech/badge/tonutils)
46
46
  ![Downloads](https://pepy.tech/badge/tonutils/month)
@@ -1,5 +1,5 @@
1
1
  tonutils/__init__.py,sha256=7GLHTRx0vOD5oyzKcrBbpfyU3dFc8fa1KeCESnT4EJU,260
2
- tonutils/__meta__.py,sha256=OXkjjR3SAQgZTLOB07UO-3s7wFVieV5vwH2KwurStm0,24
2
+ tonutils/__meta__.py,sha256=b5FeWl8NY0gXA3AC5D5ISalgq9puRzzTzY3lg0d3Pk4,24
3
3
  tonutils/exceptions.py,sha256=UE-5XzUUGUndx-AxaIAOiorYMw6wTLO-CYuDY0gfk0U,8405
4
4
  tonutils/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  tonutils/types.py,sha256=0SfJ-ucrxf2BglvGtaNmzAg74TmrP3ljbEb1yAqJ_Eg,10739
@@ -15,7 +15,7 @@ tonutils/clients/adnl/provider/builder.py,sha256=81LHEvM0IjX-wk9u591OdzFdAypH6nv
15
15
  tonutils/clients/adnl/provider/config.py,sha256=eyxC54nnGKGbS3XazqzQTQGGObpoZr350st5vR1l3bU,945
16
16
  tonutils/clients/adnl/provider/limiter.py,sha256=7943NWYZR5UrxMzE0k5LNPmUXZI0zqdxMWaent4-tvw,1781
17
17
  tonutils/clients/adnl/provider/models.py,sha256=uS6W6-jsHK9-xX_mkoaDhw3BLh8mZHTisO4NK1jFAA8,4449
18
- tonutils/clients/adnl/provider/provider.py,sha256=oJ2xCCYvPRpcKC25PW5UPQVr5Af-ztwkmycFnlUwJzo,23509
18
+ tonutils/clients/adnl/provider/provider.py,sha256=hJCHTv_FxpD1doK344HsTAvBMNCOIMPdvdf0lbWWxSE,23416
19
19
  tonutils/clients/adnl/provider/transport.py,sha256=_xRCqKbOiOQqlWRYAr5wnTnLejOXd4i9DZTS5Gu7QO4,10540
20
20
  tonutils/clients/adnl/provider/workers/__init__.py,sha256=M65q7mVfinHImIZNCEaHBJ-SO4DdVBsSkeZFrJs9OoE,177
21
21
  tonutils/clients/adnl/provider/workers/base.py,sha256=o1uYWTisiw4sN2NfAh1yv-2jGk6H8UJscOGm-H7U6eo,2077
@@ -43,7 +43,7 @@ tonutils/clients/http/toncenter/client.py,sha256=P1QpyREzPDzxERLUwZIgJA1S8PEJd3L
43
43
  tonutils/clients/http/toncenter/models.py,sha256=L5SestV2OC5IsOTDSIbO8SCXCMi9W_3nLM2hsKuCrtE,2378
44
44
  tonutils/clients/http/toncenter/provider.py,sha256=feEItRWbC-QAAz7Ia3LX4yXhVrFE3V3eQ5OVKWOOgJ8,4423
45
45
  tonutils/clients/http/toncenter/stack.py,sha256=b_fI9K_dsmYLohYiV-o1-3avdHoeq-nO4hdM3eKR5VE,2576
46
- tonutils/contracts/__init__.py,sha256=SlN_6ybdM42g2plKVB3JmFeMBQx9g6G4w0PU7KkiL2s,9210
46
+ tonutils/contracts/__init__.py,sha256=p0qjfZg4Hh4Sih_MCNetc5syZKyg5T8c8NFDYthdW6c,9456
47
47
  tonutils/contracts/base.py,sha256=vGgOxP5mDjoJJeF2j7pDYgI2PMtMJ7xgwgN6VDgHzX4,10214
48
48
  tonutils/contracts/codes.py,sha256=1Sbbs_izHZHd-i1cjWHRP8VN3Xc2BDPr4pnjojj6mZc,37741
49
49
  tonutils/contracts/opcodes.py,sha256=niPd-pDmtXiEpYX8xvorFmd7O4vkY0i8nX71e3iaJ1s,1001
@@ -68,6 +68,10 @@ tonutils/contracts/telegram/collection.py,sha256=CM3T_8eWmrO_Ovq-crZgesfJ4h6JV4D
68
68
  tonutils/contracts/telegram/item.py,sha256=DhNs5WFjhI1vqMfUg-cm311JTIvSaznc3aTqtLOCr9w,3887
69
69
  tonutils/contracts/telegram/methods.py,sha256=qd0EK6iu4LmxSiw53d-k1jVUjrSjXK4ssigvDZrht6w,4403
70
70
  tonutils/contracts/telegram/tlb.py,sha256=QRYijGDT0YGjRRjYiHjbgyeSxMP9RiSmRvmdhh6itS4,17848
71
+ tonutils/contracts/vanity/__init__.py,sha256=6LvJQxpmtrE3-ju44IsrkYQTx4HSq8nRb3fLyJFwrgE,288
72
+ tonutils/contracts/vanity/models.py,sha256=B6W1TN4CyrMs4SfBDAjuQ8QP-wn5QFhNpcSzO99DCbY,815
73
+ tonutils/contracts/vanity/tlb.py,sha256=gcNYEGPWMUHYbg_Je9QbBUlmVXF5RmobL-FoCMCF1HA,1078
74
+ tonutils/contracts/vanity/vanity.py,sha256=9c05IfPXI7uqQ2jjLTdshPyf3Lb_C5OYqIBNEaPKp2g,1242
71
75
  tonutils/contracts/wallet/__init__.py,sha256=xjsKAfW4A5BqqqgZf8nTaBCP_c79ZnqAqDIeJkkjAOY,3236
72
76
  tonutils/contracts/wallet/base.py,sha256=kKPJwwuWE-ZFtB3x5REuPQtBgY_MYo1Ol_g9ZBu3ScE,15967
73
77
  tonutils/contracts/wallet/configs.py,sha256=yQfuCEGL_fBuc5qGJ93rPIUATTR8V1wpYscgrWb7cEQ,4082
@@ -87,8 +91,8 @@ tonutils/protocols/__init__.py,sha256=1IpH8rcX2SqzzVf1ksWaO_m42o_MgCtjWd-zYwikGP
87
91
  tonutils/protocols/client.py,sha256=4QerYoqBKAAfNZVpyQW2sp5KZZlq8xHCn9yWbbJERPQ,2557
88
92
  tonutils/protocols/contract.py,sha256=sR7poBuvsheADT2a8bSzZt-2MHCPOm02A_Xx8JEvtBU,6182
89
93
  tonutils/protocols/wallet.py,sha256=u_bDUA308QffVdUPH7A7t4M883cBkM1PZmwPaOjoyPM,6183
90
- tonutils-2.0.1b0.dist-info/licenses/LICENSE,sha256=fG-yM-8DSkOTaJ558P7uF5PNXBmineVO9-HC12YbIxs,1060
91
- tonutils-2.0.1b0.dist-info/METADATA,sha256=vdA2RqoE1rqSeI99Nferq3-6QEaSDBEbH_5De7vVqWo,4284
92
- tonutils-2.0.1b0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
93
- tonutils-2.0.1b0.dist-info/top_level.txt,sha256=-7H_mGl8S9HKQrkUiTLmEbtMM-knzRzd_a0cZZnuZIU,9
94
- tonutils-2.0.1b0.dist-info/RECORD,,
94
+ tonutils-2.0.1b2.dist-info/licenses/LICENSE,sha256=fG-yM-8DSkOTaJ558P7uF5PNXBmineVO9-HC12YbIxs,1060
95
+ tonutils-2.0.1b2.dist-info/METADATA,sha256=peDaEb39fmgGcPwp_ZExSmmpR7UcRdcQTKrYu74ZFYI,4276
96
+ tonutils-2.0.1b2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
97
+ tonutils-2.0.1b2.dist-info/top_level.txt,sha256=-7H_mGl8S9HKQrkUiTLmEbtMM-knzRzd_a0cZZnuZIU,9
98
+ tonutils-2.0.1b2.dist-info/RECORD,,