From 903456ea4ce85a6a45cf2becb38090dff8f759a9 Mon Sep 17 00:00:00 2001 From: K-Dimentional Tree Date: Fri, 21 Feb 2025 22:09:28 +0300 Subject: [PATCH] Extra currency support --- ton-http-api/.docker/Dockerfile | 7 +++---- ton-http-api/pyTON/main.py | 3 ++- ton-http-api/requirements.txt | 2 +- ton-http-api/setup.py | 9 +++++---- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/ton-http-api/.docker/Dockerfile b/ton-http-api/.docker/Dockerfile index 8d00fe5..83271eb 100644 --- a/ton-http-api/.docker/Dockerfile +++ b/ton-http-api/.docker/Dockerfile @@ -1,8 +1,7 @@ -FROM ubuntu:20.04 +FROM ubuntu:22.04 -RUN apt-get update -RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata -RUN apt-get install -y git cmake wget python3 python3-pip libsecp256k1-dev libsodium-dev libc6 +RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get update && apt-get -y install tzdata +RUN apt-get update && apt-get install -y git cmake wget python3 python3-pip # python requirements ADD ./requirements.txt /tmp/requirements.txt diff --git a/ton-http-api/pyTON/main.py b/ton-http-api/pyTON/main.py index 40b85e2..fcd6bc5 100644 --- a/ton-http-api/pyTON/main.py +++ b/ton-http-api/pyTON/main.py @@ -281,9 +281,10 @@ async def get_wallet_information( """ address = prepare_address(address) result = await tonlib.raw_get_account_state(address) - res = {'wallet': False, 'balance': 0, 'account_state': None, 'wallet_type': None, 'seqno': None} + res = {'wallet': False, 'balance': 0, 'extra_currencies': [], 'account_state': None, 'wallet_type': None, 'seqno': None} res["account_state"] = address_state(result) res["balance"] = result["balance"] if (result["balance"] and int(result["balance"]) > 0) else 0 + res["extra_currencies"] = result["extra_currencies"] if "last_transaction_id" in result: res["last_transaction_id"] = result["last_transaction_id"] ci = sha256(result["code"]) diff --git a/ton-http-api/requirements.txt b/ton-http-api/requirements.txt index fcb9f79..9192458 100644 --- a/ton-http-api/requirements.txt +++ b/ton-http-api/requirements.txt @@ -6,5 +6,5 @@ requests==2.28.0 ring==0.10.1 uvicorn==0.17.6 gunicorn==20.1.0 -pytonlib==0.0.63 +pytonlib==0.0.64 inject==4.3.1 diff --git a/ton-http-api/setup.py b/ton-http-api/setup.py index d85bfcb..f9551c4 100644 --- a/ton-http-api/setup.py +++ b/ton-http-api/setup.py @@ -24,18 +24,19 @@ 'ring==0.10.1', 'uvicorn==0.17.6', 'gunicorn==20.1.0', - 'pytonlib==0.0.58', + 'pytonlib==0.0.64', 'inject==4.3.1' ], package_data={}, zip_safe=True, - python_requires='>=3.7', + python_requires='>=3.9', classifiers=[ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "License :: Other/Proprietary License", "Topic :: Software Development :: Libraries" ],