diff --git a/CHANGELOG.md b/CHANGELOG.md index 8fdc7fa..117763e 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## v1.4.5 2024-01-05 +### Fix +* `exch_client.py` init error + +### Update +* replacing json with ujson to improve performance +* Dependency: Up requirements for crypto-ws-api==2.0.6 + ## v1.4.4 2023-12-13 ### Update * Before send cancel order result checking if it was be executed and generating trade event diff --git a/exchanges_wrapper/__init__.py b/exchanges_wrapper/__init__.py index 86775d2..01c224c 100644 --- a/exchanges_wrapper/__init__.py +++ b/exchanges_wrapper/__init__.py @@ -12,7 +12,7 @@ __contact__ = "https://github.com/DogsTailFarmer" __email__ = "jerry.fedorenko@yahoo.com" __credits__ = ["https://github.com/DanyaSWorlD"] -__version__ = "1.4.4" +__version__ = "1.4.5" from pathlib import Path import shutil diff --git a/exchanges_wrapper/exch_srv.py b/exchanges_wrapper/exch_srv.py index 2d41d7b..afad113 100755 --- a/exchanges_wrapper/exch_srv.py +++ b/exchanges_wrapper/exch_srv.py @@ -7,7 +7,7 @@ import traceback import asyncio import functools -import json +import ujson as json import logging.handlers import toml # noinspection PyPackageRequirements @@ -579,20 +579,21 @@ async def OnKlinesUpdate(self, request: api_pb2.FetchKlinesRequest, # logger.info(f"OnKlinesUpdate.event: {exchange}:{_event.symbol}:{_event.kline_interval}") response.symbol = _event.symbol response.interval = _event.kline_interval - candle = [_event.kline_start_time, - _event.kline_open_price, - _event.kline_high_price, - _event.kline_low_price, - _event.kline_close_price, - _event.kline_base_asset_volume, - _event.kline_close_time, - _event.kline_quote_asset_volume, - _event.kline_trades_number, - _event.kline_taker_buy_base_asset_volume, - _event.kline_taker_buy_quote_asset_volume, - _event.kline_ignore - ] - response.candle = json.dumps(candle) + response.candle = json.dumps( + [_event.kline_start_time, + _event.kline_open_price, + _event.kline_high_price, + _event.kline_low_price, + _event.kline_close_price, + _event.kline_base_asset_volume, + _event.kline_close_time, + _event.kline_quote_asset_volume, + _event.kline_trades_number, + _event.kline_taker_buy_base_asset_volume, + _event.kline_taker_buy_quote_asset_volume, + _event.kline_ignore + ] + ) yield response _queue.task_done() diff --git a/exchanges_wrapper/http_client.py b/exchanges_wrapper/http_client.py index 6af4504..0a8065d 100644 --- a/exchanges_wrapper/http_client.py +++ b/exchanges_wrapper/http_client.py @@ -1,5 +1,5 @@ import asyncio -import json +import ujson as json from urllib.parse import urlencode, urlparse import aiohttp diff --git a/exchanges_wrapper/web_sockets.py b/exchanges_wrapper/web_sockets.py index e4ab461..88e1888 100644 --- a/exchanges_wrapper/web_sockets.py +++ b/exchanges_wrapper/web_sockets.py @@ -1,6 +1,6 @@ import sys import asyncio -import json +import ujson as json import logging import time from decimal import Decimal diff --git a/pyproject.toml b/pyproject.toml index 0253817..eb3e517 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,7 +17,7 @@ dynamic = ["version", "description"] requires-python = ">=3.8" dependencies = [ - "crypto-ws-api==2.0.5.post3", + "crypto-ws-api==2.0.6", "grpcio==1.48.2", "grpcio-tools==1.48.2", "idna==3.4", @@ -26,7 +26,8 @@ dependencies = [ "aiohttp==3.9.0", "Pympler~=1.0.1", "websockets~=12.0", - "expiringdict~=1.2.2" + "expiringdict~=1.2.2", + "ujson~=5.9.0" ] [tool.flit.module] diff --git a/requirements.txt b/requirements.txt index 60225c6..923f836 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -crypto-ws-api==2.0.5.post3 +crypto-ws-api==2.0.6 grpcio==1.48.2 grpcio-tools==1.48.2 idna==3.4 @@ -8,4 +8,5 @@ toml~=0.10.2 aiohttp==3.9.0 Pympler~=1.0.1 websockets==12.0 -expiringdict~=1.2.2 \ No newline at end of file +expiringdict~=1.2.2 +ujson~=5.9.0 \ No newline at end of file