exchanges-wrapper 1.4.3__tar.gz → 1.4.4__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.
- {exchanges_wrapper-1.4.3 → exchanges_wrapper-1.4.4}/PKG-INFO +1 -1
- {exchanges_wrapper-1.4.3 → exchanges_wrapper-1.4.4}/exchanges_wrapper/__init__.py +1 -1
- {exchanges_wrapper-1.4.3 → exchanges_wrapper-1.4.4}/exchanges_wrapper/client.py +1 -1
- {exchanges_wrapper-1.4.3 → exchanges_wrapper-1.4.4}/exchanges_wrapper/exch_srv.py +19 -12
- {exchanges_wrapper-1.4.3 → exchanges_wrapper-1.4.4}/LICENSE.md +0 -0
- {exchanges_wrapper-1.4.3 → exchanges_wrapper-1.4.4}/README.md +0 -0
- {exchanges_wrapper-1.4.3 → exchanges_wrapper-1.4.4}/exchanges_wrapper/api_pb2.py +0 -0
- {exchanges_wrapper-1.4.3 → exchanges_wrapper-1.4.4}/exchanges_wrapper/api_pb2_grpc.py +0 -0
- {exchanges_wrapper-1.4.3 → exchanges_wrapper-1.4.4}/exchanges_wrapper/bitfinex_parser.py +0 -0
- {exchanges_wrapper-1.4.3 → exchanges_wrapper-1.4.4}/exchanges_wrapper/bybit_parser.py +0 -0
- {exchanges_wrapper-1.4.3 → exchanges_wrapper-1.4.4}/exchanges_wrapper/c_structures.py +0 -0
- {exchanges_wrapper-1.4.3 → exchanges_wrapper-1.4.4}/exchanges_wrapper/definitions.py +0 -0
- {exchanges_wrapper-1.4.3 → exchanges_wrapper-1.4.4}/exchanges_wrapper/errors.py +0 -0
- {exchanges_wrapper-1.4.3 → exchanges_wrapper-1.4.4}/exchanges_wrapper/events.py +0 -0
- {exchanges_wrapper-1.4.3 → exchanges_wrapper-1.4.4}/exchanges_wrapper/exch_srv_cfg.toml.template +0 -0
- {exchanges_wrapper-1.4.3 → exchanges_wrapper-1.4.4}/exchanges_wrapper/http_client.py +0 -0
- {exchanges_wrapper-1.4.3 → exchanges_wrapper-1.4.4}/exchanges_wrapper/huobi_parser.py +0 -0
- {exchanges_wrapper-1.4.3 → exchanges_wrapper-1.4.4}/exchanges_wrapper/okx_parser.py +0 -0
- {exchanges_wrapper-1.4.3 → exchanges_wrapper-1.4.4}/exchanges_wrapper/proto/exchanges_wrapper/api.proto +0 -0
- {exchanges_wrapper-1.4.3 → exchanges_wrapper-1.4.4}/exchanges_wrapper/web_sockets.py +0 -0
- {exchanges_wrapper-1.4.3 → exchanges_wrapper-1.4.4}/pyproject.toml +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: exchanges-wrapper
|
|
3
|
-
Version: 1.4.
|
|
3
|
+
Version: 1.4.4
|
|
4
4
|
Summary: REST API and WebSocket asyncio wrapper with grpc powered multiplexer server
|
|
5
5
|
Author-email: Thomas Marchand <thomas.marchand@tuta.io>, Jerry Fedorenko <jerry.fedorenko@yahoo.com>
|
|
6
6
|
Requires-Python: >=3.8
|
|
@@ -12,7 +12,7 @@ __maintainer__ = "Jerry Fedorenko"
|
|
|
12
12
|
__contact__ = "https://github.com/DogsTailFarmer"
|
|
13
13
|
__email__ = "jerry.fedorenko@yahoo.com"
|
|
14
14
|
__credits__ = ["https://github.com/DanyaSWorlD"]
|
|
15
|
-
__version__ = "1.4.
|
|
15
|
+
__version__ = "1.4.4"
|
|
16
16
|
|
|
17
17
|
from pathlib import Path
|
|
18
18
|
import shutil
|
|
@@ -316,20 +316,23 @@ class Martin(api_pb2_grpc.MartinServicer):
|
|
|
316
316
|
f"{event.order_status}")
|
|
317
317
|
await _queue.put(weakref.ref(event)())
|
|
318
318
|
elif res.get('status') == 'PARTIALLY_FILLED':
|
|
319
|
-
|
|
320
|
-
trades = await client.fetch_order_trade_list(request.trade_id, request.symbol, request.order_id)
|
|
321
|
-
except asyncio.CancelledError:
|
|
322
|
-
pass # Task cancellation should not be logged as an error
|
|
323
|
-
except Exception as _ex:
|
|
324
|
-
logger.error(f"Fetch order trades for {open_client.name}: {request.symbol} exception: {_ex}")
|
|
325
|
-
else:
|
|
326
|
-
logger.debug(f"FetchOrder.trades: {trades}")
|
|
327
|
-
for trade in trades:
|
|
328
|
-
event = OrderTradesEvent(trade)
|
|
329
|
-
await _queue.put(weakref.ref(event)())
|
|
319
|
+
await self.create_trade_stream_event(_queue, client, open_client, request)
|
|
330
320
|
json_format.ParseDict(res, response, ignore_unknown_fields=True)
|
|
331
321
|
return response
|
|
332
322
|
|
|
323
|
+
async def create_trade_stream_event(self, _queue, client, open_client, request):
|
|
324
|
+
try:
|
|
325
|
+
trades = await client.fetch_order_trade_list(request.trade_id, request.symbol, request.order_id)
|
|
326
|
+
except asyncio.CancelledError:
|
|
327
|
+
pass # Task cancellation should not be logged as an error
|
|
328
|
+
except Exception as _ex:
|
|
329
|
+
logger.error(f"Fetch order trades for {open_client.name}: {request.symbol} exception: {_ex}")
|
|
330
|
+
else:
|
|
331
|
+
logger.debug(f"FetchOrder.trades: {trades}")
|
|
332
|
+
for trade in trades:
|
|
333
|
+
event = OrderTradesEvent(trade)
|
|
334
|
+
await _queue.put(weakref.ref(event)())
|
|
335
|
+
|
|
333
336
|
async def CancelAllOrders(self, request: api_pb2.MarketRequest,
|
|
334
337
|
_context: grpc.aio.ServicerContext) -> api_pb2.SimpleResponse():
|
|
335
338
|
open_client = OpenClient.get_client(request.client_id)
|
|
@@ -360,7 +363,7 @@ class Martin(api_pb2_grpc.MartinServicer):
|
|
|
360
363
|
else:
|
|
361
364
|
raise UserWarning(f"Symbol {request.symbol} not exist")
|
|
362
365
|
await self.rate_limit_control(open_client)
|
|
363
|
-
# logger.
|
|
366
|
+
# logger.debug(f"exchange_info_symbol: {exchange_info_symbol}")
|
|
364
367
|
open_client.ts_rlc = time.time()
|
|
365
368
|
filters_res = exchange_info_symbol.pop('filters', [])
|
|
366
369
|
json_format.ParseDict(exchange_info_symbol, response, ignore_unknown_fields=True)
|
|
@@ -842,6 +845,7 @@ class Martin(api_pb2_grpc.MartinServicer):
|
|
|
842
845
|
response = api_pb2.CancelOrderResponse()
|
|
843
846
|
open_client = OpenClient.get_client(request.client_id)
|
|
844
847
|
client = open_client.client
|
|
848
|
+
_queue = client.on_order_update_queues.get(request.trade_id)
|
|
845
849
|
try:
|
|
846
850
|
res = await client.cancel_order(
|
|
847
851
|
request.trade_id,
|
|
@@ -862,6 +866,9 @@ class Martin(api_pb2_grpc.MartinServicer):
|
|
|
862
866
|
_context.set_details(f"{ex}")
|
|
863
867
|
_context.set_code(grpc.StatusCode.UNKNOWN)
|
|
864
868
|
else:
|
|
869
|
+
if float(res['executedQty']):
|
|
870
|
+
await self.create_trade_stream_event(_queue, client, open_client, request)
|
|
871
|
+
await asyncio.sleep(HEARTBEAT)
|
|
865
872
|
json_format.ParseDict(res, response, ignore_unknown_fields=True)
|
|
866
873
|
return response
|
|
867
874
|
|
|
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
|
{exchanges_wrapper-1.4.3 → exchanges_wrapper-1.4.4}/exchanges_wrapper/exch_srv_cfg.toml.template
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|