ton-http-api 2.0.57__py3-none-any.whl → 2.0.59__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.
pyTON/main.py CHANGED
@@ -29,6 +29,7 @@ from pyTON.settings import Settings, RedisCacheSettings
29
29
 
30
30
  from pytonlib.utils.address import detect_address as __detect_address, prepare_address as _prepare_address
31
31
  from pytonlib.utils.wallet import wallets as known_wallets, sha256
32
+ from pytonlib.utils.common import hash_to_hex, hex_to_b64str
32
33
  from pytonlib import TonlibException
33
34
 
34
35
  from loguru import logger
@@ -499,6 +500,19 @@ async def get_config_param(
499
500
  """
500
501
  return await tonlib.get_config_param(config_id, seqno)
501
502
 
503
+
504
+ @app.get('/getLibraries', response_model=TonResponse, response_model_exclude_none=True, tags=['get config'])
505
+ @json_rpc('getLibraries')
506
+ @wrap_result
507
+ async def get_libraries(
508
+ libraries: List[str] = Query(..., description="List of base64 encoded libraries hashes")
509
+ ):
510
+ """
511
+ Get libraries codes.
512
+ """
513
+ lib_hashes = [hex_to_b64str(hash_to_hex(l)) for l in libraries]
514
+ return await tonlib.getLibraries(lib_hashes)
515
+
502
516
  @app.get('/getTokenData', response_model=TonResponse, response_model_exclude_none=True, tags=['accounts'])
503
517
  @json_rpc('getTokenData')
504
518
  @wrap_result
pyTON/manager.py CHANGED
@@ -82,6 +82,7 @@ class TonlibManager:
82
82
  self.getBlockTransactions = self.cache_manager.cached(expire=600)(self.getBlockTransactions)
83
83
  self.getBlockHeader = self.cache_manager.cached(expire=600)(self.getBlockHeader)
84
84
  self.get_config_param = self.cache_manager.cached(expire=5)(self.get_config_param)
85
+ self.getLibraries = self.cache_manager.cached(expire=600)(self.getLibraries)
85
86
  self.get_token_data = self.cache_manager.cached(expire=15)(self.get_token_data)
86
87
  self.tryLocateTxByOutcomingMessage = self.cache_manager.cached(expire=600, check_error=False)(self.tryLocateTxByOutcomingMessage)
87
88
  self.tryLocateTxByIncomingMessage = self.cache_manager.cached(expire=600, check_error=False)(self.tryLocateTxByIncomingMessage)
@@ -434,6 +435,12 @@ class TonlibManager:
434
435
  else:
435
436
  return await self.dispatch_archival_request(method, config_id, seqno)
436
437
 
438
+ async def getLibraries(self, lib_hashes: list):
439
+ try:
440
+ return await self.dispatch_request('get_libraries', lib_hashes)
441
+ except TonlibError:
442
+ return await self.dispatch_archival_request('get_libraries', lib_hashes)
443
+
437
444
  async def tryLocateTxByOutcomingMessage(self, source, destination, creation_lt):
438
445
  return await self.dispatch_archival_request('try_locate_tx_by_outcoming_message', source, destination, creation_lt)
439
446
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ton-http-api
3
- Version: 2.0.57
3
+ Version: 2.0.59
4
4
  Summary: HTTP API for TON (The Open Network)
5
5
  Home-page: https://github.com/toncenter/ton-http-api
6
6
  Author: K-Dimentional Tree
@@ -0,0 +1,14 @@
1
+ pyTON/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ pyTON/__main__.py,sha256=s38Hio4NMli_rdk4BMFsvFVjRvjn6-ue8BmrEpVAxHI,3425
3
+ pyTON/cache.py,sha256=EmOG2sZtbQno4p40ugf9XagdmWfdCopW4eTIGCpsO9Y,1219
4
+ pyTON/main.py,sha256=qYTxcSLF696ND7uHHD0IJYL5wRjXM6JHITiC_ZhGKEg,32657
5
+ pyTON/manager.py,sha256=1Trd_DzPs8-iXa2yxzbP529vtcqmNv60BgZWpPp5EZE,22862
6
+ pyTON/models.py,sha256=y0qc3OLCxKCp4kcnphAQG6ytbWdz_VuqcmbbDfv8Qdk,958
7
+ pyTON/settings.py,sha256=1_ni1WfiDDFoGLkxyMriuMJiEzSrxi8lDOt06QyeuxE,4217
8
+ pyTON/worker.py,sha256=R6IK4ANuJowq8NfUmd8oTOxMLmJGoU9SdRu5iMl8wms,7937
9
+ ton_http_api-2.0.59.dist-info/METADATA,sha256=zNK9PwCulCK_yh0uV3RBl5Fdw8Jo9y5YspfSP3NTomI,7703
10
+ ton_http_api-2.0.59.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
11
+ ton_http_api-2.0.59.dist-info/entry_points.txt,sha256=SXjqOmzFEXVLM3twuvRooW5-o2F9qxuz_ReR8DR3-Ho,53
12
+ ton_http_api-2.0.59.dist-info/top_level.txt,sha256=3YNL3CNQpsgajYJ8rlVECgL2taXsBxUgXSA5rJSF2RQ,6
13
+ ton_http_api-2.0.59.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
14
+ ton_http_api-2.0.59.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.8.0)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,14 +0,0 @@
1
- pyTON/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- pyTON/__main__.py,sha256=s38Hio4NMli_rdk4BMFsvFVjRvjn6-ue8BmrEpVAxHI,3425
3
- pyTON/cache.py,sha256=EmOG2sZtbQno4p40ugf9XagdmWfdCopW4eTIGCpsO9Y,1219
4
- pyTON/main.py,sha256=CBqoo3FXK7hJQj-u1jR8SzBHk_UXDD-CTZ1u5aMXxzY,32163
5
- pyTON/manager.py,sha256=PwX7Di2b2tqnKptoOs90WNme45iSAVIbSJDP9SijUNc,22522
6
- pyTON/models.py,sha256=y0qc3OLCxKCp4kcnphAQG6ytbWdz_VuqcmbbDfv8Qdk,958
7
- pyTON/settings.py,sha256=1_ni1WfiDDFoGLkxyMriuMJiEzSrxi8lDOt06QyeuxE,4217
8
- pyTON/worker.py,sha256=R6IK4ANuJowq8NfUmd8oTOxMLmJGoU9SdRu5iMl8wms,7937
9
- ton_http_api-2.0.57.dist-info/METADATA,sha256=DiAwIqKEGwYN0xeKMuoM57KgB5tG5oBckrv05P5q-lo,7703
10
- ton_http_api-2.0.57.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
11
- ton_http_api-2.0.57.dist-info/entry_points.txt,sha256=SXjqOmzFEXVLM3twuvRooW5-o2F9qxuz_ReR8DR3-Ho,53
12
- ton_http_api-2.0.57.dist-info/top_level.txt,sha256=3YNL3CNQpsgajYJ8rlVECgL2taXsBxUgXSA5rJSF2RQ,6
13
- ton_http_api-2.0.57.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
14
- ton_http_api-2.0.57.dist-info/RECORD,,