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.
Files changed (70) hide show
  1. {pytonapi-0.3.1 → pytonapi-0.3.3}/PKG-INFO +1 -1
  2. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/async_tonapi/methods/accounts.py +18 -5
  3. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/async_tonapi/methods/inscriptions.py +2 -2
  4. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/async_tonapi/methods/nft.py +1 -1
  5. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/async_tonapi/methods/websocket.py +3 -3
  6. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/schema/traces.py +1 -1
  7. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/tonapi/methods/accounts.py +18 -5
  8. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/tonapi/methods/blockchain.py +2 -2
  9. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/tonapi/methods/inscriptions.py +2 -2
  10. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/tonapi/methods/nft.py +1 -1
  11. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi.egg-info/PKG-INFO +1 -1
  12. {pytonapi-0.3.1 → pytonapi-0.3.3}/setup.py +1 -1
  13. {pytonapi-0.3.1 → pytonapi-0.3.3}/LICENSE +0 -0
  14. {pytonapi-0.3.1 → pytonapi-0.3.3}/README.md +0 -0
  15. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/__init__.py +0 -0
  16. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/async_tonapi/__init__.py +0 -0
  17. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/async_tonapi/client.py +0 -0
  18. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/async_tonapi/methods/__init__.py +0 -0
  19. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/async_tonapi/methods/blockchain.py +0 -0
  20. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/async_tonapi/methods/dns.py +0 -0
  21. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/async_tonapi/methods/emulate.py +0 -0
  22. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/async_tonapi/methods/events.py +0 -0
  23. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/async_tonapi/methods/jettons.py +0 -0
  24. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/async_tonapi/methods/liteserver.py +0 -0
  25. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/async_tonapi/methods/rates.py +0 -0
  26. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/async_tonapi/methods/sse.py +0 -0
  27. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/async_tonapi/methods/staking.py +0 -0
  28. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/async_tonapi/methods/storage.py +0 -0
  29. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/async_tonapi/methods/tonconnect.py +0 -0
  30. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/async_tonapi/methods/traces.py +0 -0
  31. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/async_tonapi/methods/wallet.py +0 -0
  32. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/exceptions.py +0 -0
  33. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/py.typed +0 -0
  34. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/schema/__init__.py +0 -0
  35. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/schema/_address.py +0 -0
  36. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/schema/_balance.py +0 -0
  37. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/schema/accounts.py +0 -0
  38. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/schema/blockchain.py +0 -0
  39. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/schema/dns.py +0 -0
  40. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/schema/domains.py +0 -0
  41. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/schema/events.py +0 -0
  42. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/schema/inscriptions.py +0 -0
  43. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/schema/jettons.py +0 -0
  44. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/schema/liteserver.py +0 -0
  45. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/schema/nft.py +0 -0
  46. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/schema/rates.py +0 -0
  47. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/schema/staking.py +0 -0
  48. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/schema/storage.py +0 -0
  49. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/schema/tonconnect.py +0 -0
  50. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/tonapi/__init__.py +0 -0
  51. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/tonapi/client.py +0 -0
  52. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/tonapi/methods/__init__.py +0 -0
  53. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/tonapi/methods/dns.py +0 -0
  54. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/tonapi/methods/emulate.py +0 -0
  55. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/tonapi/methods/events.py +0 -0
  56. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/tonapi/methods/jettons.py +0 -0
  57. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/tonapi/methods/liteserver.py +0 -0
  58. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/tonapi/methods/rates.py +0 -0
  59. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/tonapi/methods/sse.py +0 -0
  60. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/tonapi/methods/staking.py +0 -0
  61. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/tonapi/methods/storage.py +0 -0
  62. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/tonapi/methods/tonconnect.py +0 -0
  63. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/tonapi/methods/traces.py +0 -0
  64. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/tonapi/methods/wallet.py +0 -0
  65. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi/utils.py +0 -0
  66. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi.egg-info/SOURCES.txt +0 -0
  67. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi.egg-info/dependency_links.txt +0 -0
  68. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi.egg-info/requires.txt +0 -0
  69. {pytonapi-0.3.1 → pytonapi-0.3.3}/pytonapi.egg-info/top_level.txt +0 -0
  70. {pytonapi-0.3.1 → pytonapi-0.3.3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pytonapi
3
- Version: 0.3.1
3
+ Version: 0.3.3
4
4
  Summary: Provide access to indexed TON blockchain.
5
5
  Home-page: https://github.com/tonkeeper/pytonapi/
6
6
  Author: nessshon
@@ -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, List[Any]], Awaitable[Any]],
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, List[Any]], Awaitable[Any]],
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, List[Any]], Awaitable[Any]],
49
+ handler: Callable[[MempoolEventData, ...], Awaitable[Any]],
50
50
  args: Tuple[Any, ...] = (),
51
51
  ) -> None:
52
52
  """
@@ -1,7 +1,7 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  from enum import Enum
4
- from typing import Optional, List, Union, Dict
4
+ from typing import Optional, List, Union
5
5
 
6
6
  from pydantic.v1 import BaseModel
7
7
 
@@ -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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pytonapi
3
- Version: 0.3.1
3
+ Version: 0.3.3
4
4
  Summary: Provide access to indexed TON blockchain.
5
5
  Home-page: https://github.com/tonkeeper/pytonapi/
6
6
  Author: nessshon
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
5
5
 
6
6
  setuptools.setup(
7
7
  name="pytonapi",
8
- version="0.3.1",
8
+ version="0.3.3",
9
9
  author="nessshon",
10
10
  description="Provide access to indexed TON blockchain.",
11
11
  long_description=long_description,
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes