ton-http-api 2.0.58__tar.gz → 2.0.59__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.
- {ton_http_api-2.0.58 → ton_http_api-2.0.59}/PKG-INFO +1 -1
- {ton_http_api-2.0.58 → ton_http_api-2.0.59}/pyTON/main.py +14 -0
- {ton_http_api-2.0.58 → ton_http_api-2.0.59}/pyTON/manager.py +7 -0
- {ton_http_api-2.0.58 → ton_http_api-2.0.59}/ton_http_api.egg-info/PKG-INFO +1 -1
- {ton_http_api-2.0.58 → ton_http_api-2.0.59}/README.md +0 -0
- {ton_http_api-2.0.58 → ton_http_api-2.0.59}/pyTON/__init__.py +0 -0
- {ton_http_api-2.0.58 → ton_http_api-2.0.59}/pyTON/__main__.py +0 -0
- {ton_http_api-2.0.58 → ton_http_api-2.0.59}/pyTON/cache.py +0 -0
- {ton_http_api-2.0.58 → ton_http_api-2.0.59}/pyTON/models.py +0 -0
- {ton_http_api-2.0.58 → ton_http_api-2.0.59}/pyTON/settings.py +0 -0
- {ton_http_api-2.0.58 → ton_http_api-2.0.59}/pyTON/worker.py +0 -0
- {ton_http_api-2.0.58 → ton_http_api-2.0.59}/setup.cfg +0 -0
- {ton_http_api-2.0.58 → ton_http_api-2.0.59}/setup.py +0 -0
- {ton_http_api-2.0.58 → ton_http_api-2.0.59}/ton_http_api.egg-info/SOURCES.txt +0 -0
- {ton_http_api-2.0.58 → ton_http_api-2.0.59}/ton_http_api.egg-info/dependency_links.txt +0 -0
- {ton_http_api-2.0.58 → ton_http_api-2.0.59}/ton_http_api.egg-info/entry_points.txt +0 -0
- {ton_http_api-2.0.58 → ton_http_api-2.0.59}/ton_http_api.egg-info/requires.txt +0 -0
- {ton_http_api-2.0.58 → ton_http_api-2.0.59}/ton_http_api.egg-info/top_level.txt +0 -0
- {ton_http_api-2.0.58 → ton_http_api-2.0.59}/ton_http_api.egg-info/zip-safe +0 -0
@@ -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
|
@@ -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
|
|
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
|