pytonapi 0.3.1__tar.gz → 0.3.3__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.
- {pytonapi-0.3.1 → pytonapi-0.3.3}/PKG-INFO +1 -1
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/async_tonapi/methods/accounts.py +18 -5
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/async_tonapi/methods/inscriptions.py +2 -2
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/async_tonapi/methods/nft.py +1 -1
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/async_tonapi/methods/websocket.py +3 -3
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/schema/traces.py +1 -1
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/tonapi/methods/accounts.py +18 -5
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/tonapi/methods/blockchain.py +2 -2
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/tonapi/methods/inscriptions.py +2 -2
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/tonapi/methods/nft.py +1 -1
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi.egg-info/PKG-INFO +1 -1
- {pytonapi-0.3.1 → pytonapi-0.3.3}/setup.py +1 -1
- {pytonapi-0.3.1 → pytonapi-0.3.3}/LICENSE +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/README.md +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/__init__.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/async_tonapi/__init__.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/async_tonapi/client.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/async_tonapi/methods/__init__.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/async_tonapi/methods/blockchain.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/async_tonapi/methods/dns.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/async_tonapi/methods/emulate.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/async_tonapi/methods/events.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/async_tonapi/methods/jettons.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/async_tonapi/methods/liteserver.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/async_tonapi/methods/rates.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/async_tonapi/methods/sse.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/async_tonapi/methods/staking.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/async_tonapi/methods/storage.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/async_tonapi/methods/tonconnect.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/async_tonapi/methods/traces.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/async_tonapi/methods/wallet.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/exceptions.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/py.typed +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/schema/__init__.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/schema/_address.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/schema/_balance.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/schema/accounts.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/schema/blockchain.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/schema/dns.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/schema/domains.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/schema/events.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/schema/inscriptions.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/schema/jettons.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/schema/liteserver.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/schema/nft.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/schema/rates.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/schema/staking.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/schema/storage.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/schema/tonconnect.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/tonapi/__init__.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/tonapi/client.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/tonapi/methods/__init__.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/tonapi/methods/dns.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/tonapi/methods/emulate.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/tonapi/methods/events.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/tonapi/methods/jettons.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/tonapi/methods/liteserver.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/tonapi/methods/rates.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/tonapi/methods/sse.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/tonapi/methods/staking.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/tonapi/methods/storage.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/tonapi/methods/tonconnect.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/tonapi/methods/traces.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/tonapi/methods/wallet.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/utils.py +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi.egg-info/SOURCES.txt +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi.egg-info/dependency_links.txt +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi.egg-info/requires.txt +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi.egg-info/top_level.txt +0 -0
- {pytonapi-0.3.1 → pytonapi-0.3.3}/setup.cfg +0 -0
|
@@ -13,7 +13,7 @@ from pytonapi.schema.accounts import (
|
|
|
13
13
|
)
|
|
14
14
|
from pytonapi.schema.domains import DomainNames
|
|
15
15
|
from pytonapi.schema.events import AccountEvents, AccountEvent
|
|
16
|
-
from pytonapi.schema.jettons import JettonsBalances
|
|
16
|
+
from pytonapi.schema.jettons import JettonBalance, JettonsBalances
|
|
17
17
|
from pytonapi.schema.nft import NftItems, NftItem
|
|
18
18
|
from pytonapi.schema.traces import TraceIds
|
|
19
19
|
|
|
@@ -81,6 +81,19 @@ class AccountsMethod(AsyncTonapiClient):
|
|
|
81
81
|
|
|
82
82
|
return JettonsBalances(**response)
|
|
83
83
|
|
|
84
|
+
async def get_jetton_balance(self, account_id: str, jetton_id: str) -> JettonBalance:
|
|
85
|
+
"""
|
|
86
|
+
Get Jetton balance by owner address
|
|
87
|
+
|
|
88
|
+
:param account_id: account ID
|
|
89
|
+
:param jetton_id: jetton ID
|
|
90
|
+
:return: :class:`JettonBalance`
|
|
91
|
+
"""
|
|
92
|
+
method = f"v2/accounts/{account_id}/jettons/{jetton_id}"
|
|
93
|
+
response = await self._get(method=method)
|
|
94
|
+
|
|
95
|
+
return JettonBalance(**response)
|
|
96
|
+
|
|
84
97
|
async def get_jettons_history(
|
|
85
98
|
self,
|
|
86
99
|
account_id: str,
|
|
@@ -105,7 +118,7 @@ class AccountsMethod(AsyncTonapiClient):
|
|
|
105
118
|
"""
|
|
106
119
|
method = f"v2/accounts/{account_id}/jettons/history"
|
|
107
120
|
params = {"limit": limit}
|
|
108
|
-
if before_lt:
|
|
121
|
+
if before_lt is not None:
|
|
109
122
|
params["before_lt"] = before_lt
|
|
110
123
|
if subject_only:
|
|
111
124
|
params["subject_only"] = "true"
|
|
@@ -145,7 +158,7 @@ class AccountsMethod(AsyncTonapiClient):
|
|
|
145
158
|
"""
|
|
146
159
|
method = f"v2/accounts/{account_id}/jettons/{jetton_id}/history"
|
|
147
160
|
params = {"limit": limit}
|
|
148
|
-
if before_lt:
|
|
161
|
+
if before_lt is not None:
|
|
149
162
|
params["before_lt"] = before_lt
|
|
150
163
|
if subject_only:
|
|
151
164
|
params["subject_only"] = "true"
|
|
@@ -251,7 +264,7 @@ class AccountsMethod(AsyncTonapiClient):
|
|
|
251
264
|
"""
|
|
252
265
|
method = f"v2/accounts/{account_id}/events"
|
|
253
266
|
params = {"limit": limit}
|
|
254
|
-
if before_lt:
|
|
267
|
+
if before_lt is not None:
|
|
255
268
|
params["before_lt"] = before_lt
|
|
256
269
|
if subject_only:
|
|
257
270
|
params["subject_only"] = "true"
|
|
@@ -325,7 +338,7 @@ class AccountsMethod(AsyncTonapiClient):
|
|
|
325
338
|
"""
|
|
326
339
|
method = f"v2/accounts/{account_id}/nfts/history"
|
|
327
340
|
params = {"limit": limit}
|
|
328
|
-
if before_lt:
|
|
341
|
+
if before_lt is not None:
|
|
329
342
|
params["before_lt"] = before_lt
|
|
330
343
|
if subject_only:
|
|
331
344
|
params["subject_only"] = "true"
|
|
@@ -44,7 +44,7 @@ class InscriptionsMethod(AsyncTonapiClient):
|
|
|
44
44
|
"""
|
|
45
45
|
method = f"v2/experimental/accounts/{account_id}/inscriptions/history"
|
|
46
46
|
params = {"limit": limit}
|
|
47
|
-
if before_lt:
|
|
47
|
+
if before_lt is not None:
|
|
48
48
|
params["before_lt"] = before_lt
|
|
49
49
|
headers = {"Accept-Language": accept_language}
|
|
50
50
|
response = await self._get(method=method, params=params, headers=headers)
|
|
@@ -70,7 +70,7 @@ class InscriptionsMethod(AsyncTonapiClient):
|
|
|
70
70
|
"""
|
|
71
71
|
method = f"v2/experimental/accounts/{account_id}/inscriptions/{ticker}/history"
|
|
72
72
|
params = {"limit": limit}
|
|
73
|
-
if before_lt:
|
|
73
|
+
if before_lt is not None:
|
|
74
74
|
params["before_lt"] = before_lt
|
|
75
75
|
headers = {"Accept-Language": accept_language}
|
|
76
76
|
response = await self._get(method=method, params=params, headers=headers)
|
|
@@ -124,7 +124,7 @@ class NftMethod(AsyncTonapiClient):
|
|
|
124
124
|
"""
|
|
125
125
|
method = f"v2/nfts/{account_id}/history"
|
|
126
126
|
params = {"limit": limit}
|
|
127
|
-
if before_lt:
|
|
127
|
+
if before_lt is not None:
|
|
128
128
|
params["before_lt"] = before_lt
|
|
129
129
|
if subject_only:
|
|
130
130
|
params["subject_only"] = "true"
|
|
@@ -9,7 +9,7 @@ class WebSocketMethod(AsyncTonapiClient):
|
|
|
9
9
|
async def subscribe_to_transactions(
|
|
10
10
|
self,
|
|
11
11
|
accounts: List[str],
|
|
12
|
-
handler: Callable[[TransactionEventData,
|
|
12
|
+
handler: Callable[[TransactionEventData, ...], Awaitable[Any]],
|
|
13
13
|
args: Tuple[Any, ...] = (),
|
|
14
14
|
) -> None:
|
|
15
15
|
"""
|
|
@@ -28,7 +28,7 @@ class WebSocketMethod(AsyncTonapiClient):
|
|
|
28
28
|
async def subscribe_to_traces(
|
|
29
29
|
self,
|
|
30
30
|
accounts: List[str],
|
|
31
|
-
handler: Callable[[TraceEventData,
|
|
31
|
+
handler: Callable[[TraceEventData, ...], Awaitable[Any]],
|
|
32
32
|
args: Tuple[Any, ...] = (),
|
|
33
33
|
) -> None:
|
|
34
34
|
"""
|
|
@@ -46,7 +46,7 @@ class WebSocketMethod(AsyncTonapiClient):
|
|
|
46
46
|
async def subscribe_to_mempool(
|
|
47
47
|
self,
|
|
48
48
|
accounts: List[str],
|
|
49
|
-
handler: Callable[[MempoolEventData,
|
|
49
|
+
handler: Callable[[MempoolEventData, ...], Awaitable[Any]],
|
|
50
50
|
args: Tuple[Any, ...] = (),
|
|
51
51
|
) -> None:
|
|
52
52
|
"""
|
|
@@ -13,7 +13,7 @@ from pytonapi.schema.accounts import (
|
|
|
13
13
|
BalanceChange,
|
|
14
14
|
)
|
|
15
15
|
from pytonapi.schema.domains import DomainNames
|
|
16
|
-
from pytonapi.schema.jettons import JettonsBalances
|
|
16
|
+
from pytonapi.schema.jettons import JettonBalance, JettonsBalances
|
|
17
17
|
from pytonapi.schema.nft import NftItems, NftItem
|
|
18
18
|
from pytonapi.schema.traces import TraceIds
|
|
19
19
|
|
|
@@ -81,6 +81,19 @@ class AccountsMethod(TonapiClient):
|
|
|
81
81
|
|
|
82
82
|
return JettonsBalances(**response)
|
|
83
83
|
|
|
84
|
+
def get_jetton_balance(self, account_id: str, jetton_id: str) -> JettonBalance:
|
|
85
|
+
"""
|
|
86
|
+
Get Jetton balance by owner address
|
|
87
|
+
|
|
88
|
+
:param account_id: account ID
|
|
89
|
+
:param jetton_id: jetton ID
|
|
90
|
+
:return: :class:`JettonBalance`
|
|
91
|
+
"""
|
|
92
|
+
method = f"v2/accounts/{account_id}/jettons/{jetton_id}"
|
|
93
|
+
response = self._get(method=method)
|
|
94
|
+
|
|
95
|
+
return JettonBalance(**response)
|
|
96
|
+
|
|
84
97
|
def get_jettons_history(
|
|
85
98
|
self,
|
|
86
99
|
account_id: str,
|
|
@@ -105,7 +118,7 @@ class AccountsMethod(TonapiClient):
|
|
|
105
118
|
"""
|
|
106
119
|
method = f"v2/accounts/{account_id}/jettons/history"
|
|
107
120
|
params = {"limit": limit}
|
|
108
|
-
if before_lt:
|
|
121
|
+
if before_lt is not None:
|
|
109
122
|
params["before_lt"] = before_lt
|
|
110
123
|
if subject_only:
|
|
111
124
|
params["subject_only"] = "true"
|
|
@@ -145,7 +158,7 @@ class AccountsMethod(TonapiClient):
|
|
|
145
158
|
"""
|
|
146
159
|
method = f"v2/accounts/{account_id}/jettons/{jetton_id}/history"
|
|
147
160
|
params = {"limit": limit}
|
|
148
|
-
if before_lt:
|
|
161
|
+
if before_lt is not None:
|
|
149
162
|
params["before_lt"] = before_lt
|
|
150
163
|
if subject_only:
|
|
151
164
|
params["subject_only"] = "true"
|
|
@@ -251,7 +264,7 @@ class AccountsMethod(TonapiClient):
|
|
|
251
264
|
"""
|
|
252
265
|
method = f"v2/accounts/{account_id}/events"
|
|
253
266
|
params = {"limit": limit}
|
|
254
|
-
if before_lt:
|
|
267
|
+
if before_lt is not None:
|
|
255
268
|
params["before_lt"] = before_lt
|
|
256
269
|
if subject_only:
|
|
257
270
|
params["subject_only"] = "true"
|
|
@@ -325,7 +338,7 @@ class AccountsMethod(TonapiClient):
|
|
|
325
338
|
"""
|
|
326
339
|
method = f"v2/accounts/{account_id}/nfts/history"
|
|
327
340
|
params = {"limit": limit}
|
|
328
|
-
if before_lt:
|
|
341
|
+
if before_lt is not None:
|
|
329
342
|
params["before_lt"] = before_lt
|
|
330
343
|
if subject_only:
|
|
331
344
|
params["subject_only"] = "true"
|
|
@@ -197,8 +197,8 @@ class BlockchainMethod(TonapiClient):
|
|
|
197
197
|
"""
|
|
198
198
|
method = f"v2/blockchain/accounts/{account_id}/transactions"
|
|
199
199
|
params = {"limit": limit}
|
|
200
|
-
if before_lt: params["before_lt"] = before_lt # noqa E701
|
|
201
|
-
if after_lt: params["after_lt"] = after_lt # noqa E701
|
|
200
|
+
if before_lt is not None: params["before_lt"] = before_lt # noqa E701
|
|
201
|
+
if after_lt is not None: params["after_lt"] = after_lt # noqa E701
|
|
202
202
|
response = self._get(method=method, params=params)
|
|
203
203
|
|
|
204
204
|
return Transactions(**response)
|
|
@@ -44,7 +44,7 @@ class InscriptionsMethod(TonapiClient):
|
|
|
44
44
|
"""
|
|
45
45
|
method = f"v2/experimental/accounts/{account_id}/inscriptions/history"
|
|
46
46
|
params = {"limit": limit}
|
|
47
|
-
if before_lt:
|
|
47
|
+
if before_lt is not None:
|
|
48
48
|
params["before_lt"] = before_lt
|
|
49
49
|
headers = {"Accept-Language": accept_language}
|
|
50
50
|
response = self._get(method=method, params=params, headers=headers)
|
|
@@ -70,7 +70,7 @@ class InscriptionsMethod(TonapiClient):
|
|
|
70
70
|
"""
|
|
71
71
|
method = f"v2/experimental/accounts/{account_id}/inscriptions/{ticker}/history"
|
|
72
72
|
params = {"limit": limit}
|
|
73
|
-
if before_lt:
|
|
73
|
+
if before_lt is not None:
|
|
74
74
|
params["before_lt"] = before_lt
|
|
75
75
|
headers = {"Accept-Language": accept_language}
|
|
76
76
|
response = self._get(method=method, params=params, headers=headers)
|
|
@@ -120,7 +120,7 @@ class NftMethod(TonapiClient):
|
|
|
120
120
|
"""
|
|
121
121
|
method = f"v2/nfts/{account_id}/history"
|
|
122
122
|
params = {"limit": limit}
|
|
123
|
-
if before_lt: params["before_lt"] = before_lt # noqa:E701
|
|
123
|
+
if before_lt is not None: params["before_lt"] = before_lt # noqa:E701
|
|
124
124
|
if subject_only: params["subject_only"] = "true" # noqa:E701
|
|
125
125
|
if start_date: params["start_date"] = start_date # noqa:E701
|
|
126
126
|
if end_date: params["end_date"] = end_date # noqa:E701
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|