exchanges-wrapper 1.4.13__tar.gz → 1.4.14__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.13 → exchanges_wrapper-1.4.14}/PKG-INFO +1 -1
- {exchanges_wrapper-1.4.13 → exchanges_wrapper-1.4.14}/exchanges_wrapper/__init__.py +1 -1
- {exchanges_wrapper-1.4.13 → exchanges_wrapper-1.4.14}/exchanges_wrapper/bybit_parser.py +2 -5
- {exchanges_wrapper-1.4.13 → exchanges_wrapper-1.4.14}/exchanges_wrapper/huobi_parser.py +13 -13
- {exchanges_wrapper-1.4.13 → exchanges_wrapper-1.4.14}/exchanges_wrapper/okx_parser.py +10 -10
- {exchanges_wrapper-1.4.13 → exchanges_wrapper-1.4.14}/LICENSE.md +0 -0
- {exchanges_wrapper-1.4.13 → exchanges_wrapper-1.4.14}/README.md +0 -0
- {exchanges_wrapper-1.4.13 → exchanges_wrapper-1.4.14}/exchanges_wrapper/api_pb2.py +0 -0
- {exchanges_wrapper-1.4.13 → exchanges_wrapper-1.4.14}/exchanges_wrapper/api_pb2_grpc.py +0 -0
- {exchanges_wrapper-1.4.13 → exchanges_wrapper-1.4.14}/exchanges_wrapper/bitfinex_parser.py +0 -0
- {exchanges_wrapper-1.4.13 → exchanges_wrapper-1.4.14}/exchanges_wrapper/c_structures.py +0 -0
- {exchanges_wrapper-1.4.13 → exchanges_wrapper-1.4.14}/exchanges_wrapper/client.py +0 -0
- {exchanges_wrapper-1.4.13 → exchanges_wrapper-1.4.14}/exchanges_wrapper/definitions.py +0 -0
- {exchanges_wrapper-1.4.13 → exchanges_wrapper-1.4.14}/exchanges_wrapper/errors.py +0 -0
- {exchanges_wrapper-1.4.13 → exchanges_wrapper-1.4.14}/exchanges_wrapper/events.py +0 -0
- {exchanges_wrapper-1.4.13 → exchanges_wrapper-1.4.14}/exchanges_wrapper/exch_srv.py +0 -0
- {exchanges_wrapper-1.4.13 → exchanges_wrapper-1.4.14}/exchanges_wrapper/exch_srv_cfg.toml.template +0 -0
- {exchanges_wrapper-1.4.13 → exchanges_wrapper-1.4.14}/exchanges_wrapper/http_client.py +0 -0
- {exchanges_wrapper-1.4.13 → exchanges_wrapper-1.4.14}/exchanges_wrapper/proto/exchanges_wrapper/api.proto +0 -0
- {exchanges_wrapper-1.4.13 → exchanges_wrapper-1.4.14}/exchanges_wrapper/web_sockets.py +0 -0
- {exchanges_wrapper-1.4.13 → exchanges_wrapper-1.4.14}/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.14
|
|
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.9
|
|
@@ -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.14"
|
|
16
16
|
|
|
17
17
|
from pathlib import Path
|
|
18
18
|
import shutil
|
|
@@ -516,14 +516,11 @@ def order_trade_list(res: [], order_id: str) -> []:
|
|
|
516
516
|
"price": price,
|
|
517
517
|
"qty": str(qty),
|
|
518
518
|
"quoteQty": quote_qty,
|
|
519
|
+
"commission": str(fee) if fee else '0',
|
|
520
|
+
"commissionAsset": trade['currency'] if fee else '',
|
|
519
521
|
"time": int(trade['transactionTime']),
|
|
520
522
|
"isBuyer": trade['side'] == 'Buy',
|
|
521
523
|
"isMaker": True,
|
|
522
524
|
"isBestMatch": True,
|
|
523
525
|
}
|
|
524
|
-
|
|
525
|
-
if fee:
|
|
526
|
-
trade_rows[trade_id]["commission"] = str(fee)
|
|
527
|
-
trade_rows[trade_id]["commissionAsset"] = str(trade['currency'])
|
|
528
|
-
|
|
529
526
|
return list(trade_rows.values())
|
|
@@ -400,10 +400,10 @@ def on_order_update(_order: {}) -> {}:
|
|
|
400
400
|
#
|
|
401
401
|
if event.get('orderStatus') in ('canceled', 'partial-canceled'):
|
|
402
402
|
status = 'CANCELED'
|
|
403
|
-
elif event.get('orderStatus') == '
|
|
404
|
-
status = 'PARTIALLY_FILLED'
|
|
405
|
-
elif event.get('orderStatus') == 'filled':
|
|
403
|
+
elif event.get('orderStatus') == 'filled' and cumulative_filled_quantity >= Decimal(order_quantity):
|
|
406
404
|
status = 'FILLED'
|
|
405
|
+
elif event.get('orderStatus') == 'partial-filled' or cumulative_filled_quantity > 0:
|
|
406
|
+
status = 'PARTIALLY_FILLED'
|
|
407
407
|
else:
|
|
408
408
|
status = 'NEW'
|
|
409
409
|
return {
|
|
@@ -445,22 +445,22 @@ def on_order_update(_order: {}) -> {}:
|
|
|
445
445
|
def account_trade_list(res: []) -> []:
|
|
446
446
|
binance_trade_list = []
|
|
447
447
|
for trade in res:
|
|
448
|
-
price = trade
|
|
449
|
-
qty = trade
|
|
448
|
+
price = trade['price']
|
|
449
|
+
qty = trade['filled-amount']
|
|
450
450
|
quote_qty = str(Decimal(price) * Decimal(qty))
|
|
451
451
|
binance_trade = {
|
|
452
|
-
"symbol": trade
|
|
453
|
-
"id": trade
|
|
454
|
-
"orderId": trade
|
|
452
|
+
"symbol": trade['symbol'].upper(),
|
|
453
|
+
"id": trade['trade-id'],
|
|
454
|
+
"orderId": int(trade['order-id']),
|
|
455
455
|
"orderListId": -1,
|
|
456
456
|
"price": price,
|
|
457
457
|
"qty": qty,
|
|
458
458
|
"quoteQty": quote_qty,
|
|
459
|
-
"commission": trade
|
|
460
|
-
"commissionAsset": trade
|
|
461
|
-
"time": trade
|
|
462
|
-
"isBuyer": 'buy' in trade
|
|
463
|
-
"isMaker": trade
|
|
459
|
+
"commission": trade['filled-fees'],
|
|
460
|
+
"commissionAsset": trade['fee-currency'],
|
|
461
|
+
"time": trade['created-at'],
|
|
462
|
+
"isBuyer": 'buy' in trade['type'],
|
|
463
|
+
"isMaker": trade['role'] == 'maker',
|
|
464
464
|
"isBestMatch": True,
|
|
465
465
|
}
|
|
466
466
|
binance_trade_list.append(binance_trade)
|
|
@@ -508,22 +508,22 @@ def funding_wallet(res: []) -> []:
|
|
|
508
508
|
def order_trade_list(res: []) -> []:
|
|
509
509
|
binance_trade_list = []
|
|
510
510
|
for trade in res:
|
|
511
|
-
price = trade
|
|
512
|
-
qty = trade
|
|
511
|
+
price = trade['fillPx']
|
|
512
|
+
qty = trade['fillSz']
|
|
513
513
|
quote_qty = str(Decimal(price) * Decimal(qty))
|
|
514
514
|
binance_trade = {
|
|
515
|
-
"symbol": trade
|
|
516
|
-
"id": trade
|
|
517
|
-
"orderId": trade
|
|
515
|
+
"symbol": trade['instId'].replace('-', ''),
|
|
516
|
+
"id": int(trade['tradeId']),
|
|
517
|
+
"orderId": int(trade['ordId']),
|
|
518
518
|
"orderListId": -1,
|
|
519
519
|
"price": price,
|
|
520
520
|
"qty": qty,
|
|
521
521
|
"quoteQty": quote_qty,
|
|
522
|
-
"commission": str(abs(float(trade
|
|
523
|
-
"commissionAsset": trade
|
|
524
|
-
"time": trade
|
|
525
|
-
"isBuyer": trade
|
|
526
|
-
"isMaker": trade
|
|
522
|
+
"commission": str(abs(float(trade['fee']))),
|
|
523
|
+
"commissionAsset": trade['feeCcy'],
|
|
524
|
+
"time": trade['ts'],
|
|
525
|
+
"isBuyer": trade['side'] == 'buy',
|
|
526
|
+
"isMaker": trade['execType'] == 'M',
|
|
527
527
|
"isBestMatch": True,
|
|
528
528
|
}
|
|
529
529
|
binance_trade_list.append(binance_trade)
|
|
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
|
{exchanges_wrapper-1.4.13 → exchanges_wrapper-1.4.14}/exchanges_wrapper/exch_srv_cfg.toml.template
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|