ton-http-api 2.0.64__tar.gz → 2.0.66__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.64 → ton_http_api-2.0.66}/PKG-INFO +1 -1
- {ton_http_api-2.0.64 → ton_http_api-2.0.66}/pyTON/main.py +11 -6
- {ton_http_api-2.0.64 → ton_http_api-2.0.66}/ton_http_api.egg-info/PKG-INFO +1 -1
- {ton_http_api-2.0.64 → ton_http_api-2.0.66}/README.md +0 -0
- {ton_http_api-2.0.64 → ton_http_api-2.0.66}/pyTON/__init__.py +0 -0
- {ton_http_api-2.0.64 → ton_http_api-2.0.66}/pyTON/__main__.py +0 -0
- {ton_http_api-2.0.64 → ton_http_api-2.0.66}/pyTON/cache.py +0 -0
- {ton_http_api-2.0.64 → ton_http_api-2.0.66}/pyTON/manager.py +0 -0
- {ton_http_api-2.0.64 → ton_http_api-2.0.66}/pyTON/models.py +0 -0
- {ton_http_api-2.0.64 → ton_http_api-2.0.66}/pyTON/settings.py +0 -0
- {ton_http_api-2.0.64 → ton_http_api-2.0.66}/pyTON/worker.py +0 -0
- {ton_http_api-2.0.64 → ton_http_api-2.0.66}/setup.cfg +0 -0
- {ton_http_api-2.0.64 → ton_http_api-2.0.66}/setup.py +0 -0
- {ton_http_api-2.0.64 → ton_http_api-2.0.66}/ton_http_api.egg-info/SOURCES.txt +0 -0
- {ton_http_api-2.0.64 → ton_http_api-2.0.66}/ton_http_api.egg-info/dependency_links.txt +0 -0
- {ton_http_api-2.0.64 → ton_http_api-2.0.66}/ton_http_api.egg-info/entry_points.txt +0 -0
- {ton_http_api-2.0.64 → ton_http_api-2.0.66}/ton_http_api.egg-info/requires.txt +0 -0
- {ton_http_api-2.0.64 → ton_http_api-2.0.66}/ton_http_api.egg-info/top_level.txt +0 -0
- {ton_http_api-2.0.64 → ton_http_api-2.0.66}/ton_http_api.egg-info/zip-safe +0 -0
|
@@ -30,7 +30,7 @@ from pyTON.settings import Settings, RedisCacheSettings
|
|
|
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
32
|
from pytonlib.utils.common import hash_to_hex, hex_to_b64str
|
|
33
|
-
from pytonlib import TonlibException
|
|
33
|
+
from pytonlib import TonlibException, TonlibError
|
|
34
34
|
|
|
35
35
|
from loguru import logger
|
|
36
36
|
|
|
@@ -168,10 +168,12 @@ async def timeout_exception_handler(request, exc):
|
|
|
168
168
|
|
|
169
169
|
|
|
170
170
|
@app.exception_handler(TonlibException)
|
|
171
|
-
async def
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
171
|
+
async def tonlib_exception_result_exception_handler(request, exc):
|
|
172
|
+
status_code = status.HTTP_500_INTERNAL_SERVER_ERROR
|
|
173
|
+
if str(exc) == 'Smart contract is not Jetton or NFT':
|
|
174
|
+
status_code = 409
|
|
175
|
+
res = TonResponse(ok=False, error=str(exc), code=status_code)
|
|
176
|
+
return JSONResponse(res.dict(exclude_none=True), status_code=status_code)
|
|
175
177
|
|
|
176
178
|
@app.exception_handler(Exception)
|
|
177
179
|
async def fastapi_generic_exception_handler(request, exc):
|
|
@@ -555,7 +557,10 @@ async def get_token_data(
|
|
|
555
557
|
Get NFT or Jetton information.
|
|
556
558
|
"""
|
|
557
559
|
address = prepare_address(address)
|
|
558
|
-
|
|
560
|
+
try:
|
|
561
|
+
return await tonlib.get_token_data(address)
|
|
562
|
+
except Exception as exc:
|
|
563
|
+
raise TonlibException(exc)
|
|
559
564
|
|
|
560
565
|
@app.get('/tryLocateTx', response_model=TonResponse, response_model_exclude_none=True, tags=['transactions'])
|
|
561
566
|
@json_rpc('tryLocateTx')
|
|
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
|