exchanges-wrapper 1.3.4b0__tar.gz → 1.3.4.post2__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.3.4b0 → exchanges-wrapper-1.3.4.post2}/CHANGELOG.md +19 -1
- {exchanges-wrapper-1.3.4b0 → exchanges-wrapper-1.3.4.post2}/PKG-INFO +3 -2
- {exchanges-wrapper-1.3.4b0 → exchanges-wrapper-1.3.4.post2}/exchanges_wrapper/__init__.py +4 -2
- {exchanges-wrapper-1.3.4b0 → exchanges-wrapper-1.3.4.post2}/exchanges_wrapper/bitfinex_parser.py +2 -2
- {exchanges-wrapper-1.3.4b0 → exchanges-wrapper-1.3.4.post2}/exchanges_wrapper/client.py +8 -2
- {exchanges-wrapper-1.3.4b0 → exchanges-wrapper-1.3.4.post2}/exchanges_wrapper/exch_srv.py +0 -2
- {exchanges-wrapper-1.3.4b0 → exchanges-wrapper-1.3.4.post2}/exchanges_wrapper/huobi_parser.py +3 -3
- {exchanges-wrapper-1.3.4b0 → exchanges-wrapper-1.3.4.post2}/pyproject.toml +2 -1
- {exchanges-wrapper-1.3.4b0 → exchanges-wrapper-1.3.4.post2}/requirements.txt +2 -1
- {exchanges-wrapper-1.3.4b0 → exchanges-wrapper-1.3.4.post2}/.deepsource.toml +0 -0
- {exchanges-wrapper-1.3.4b0 → exchanges-wrapper-1.3.4.post2}/.dockerignore +0 -0
- {exchanges-wrapper-1.3.4b0 → exchanges-wrapper-1.3.4.post2}/.github/FUNDING.yml +0 -0
- {exchanges-wrapper-1.3.4b0 → exchanges-wrapper-1.3.4.post2}/.github/dependabot.yml +0 -0
- {exchanges-wrapper-1.3.4b0 → exchanges-wrapper-1.3.4.post2}/.github/workflows/docker-image.yml +0 -0
- {exchanges-wrapper-1.3.4b0 → exchanges-wrapper-1.3.4.post2}/.github/workflows/python-publish.yml +0 -0
- {exchanges-wrapper-1.3.4b0 → exchanges-wrapper-1.3.4.post2}/Dockerfile +0 -0
- {exchanges-wrapper-1.3.4b0 → exchanges-wrapper-1.3.4.post2}/LICENSE.md +0 -0
- {exchanges-wrapper-1.3.4b0 → exchanges-wrapper-1.3.4.post2}/README.md +0 -0
- {exchanges-wrapper-1.3.4b0 → exchanges-wrapper-1.3.4.post2}/example/exch_client.py +0 -0
- {exchanges-wrapper-1.3.4b0 → exchanges-wrapper-1.3.4.post2}/example/ms_cfg.toml +0 -0
- {exchanges-wrapper-1.3.4b0 → exchanges-wrapper-1.3.4.post2}/exchanges_wrapper/api_pb2.py +0 -0
- {exchanges-wrapper-1.3.4b0 → exchanges-wrapper-1.3.4.post2}/exchanges_wrapper/api_pb2_grpc.py +0 -0
- {exchanges-wrapper-1.3.4b0 → exchanges-wrapper-1.3.4.post2}/exchanges_wrapper/c_structures.py +0 -0
- {exchanges-wrapper-1.3.4b0 → exchanges-wrapper-1.3.4.post2}/exchanges_wrapper/definitions.py +0 -0
- {exchanges-wrapper-1.3.4b0 → exchanges-wrapper-1.3.4.post2}/exchanges_wrapper/errors.py +0 -0
- {exchanges-wrapper-1.3.4b0 → exchanges-wrapper-1.3.4.post2}/exchanges_wrapper/events.py +0 -0
- {exchanges-wrapper-1.3.4b0 → exchanges-wrapper-1.3.4.post2}/exchanges_wrapper/exch_srv_cfg.toml.template +0 -0
- {exchanges-wrapper-1.3.4b0 → exchanges-wrapper-1.3.4.post2}/exchanges_wrapper/http_client.py +0 -0
- {exchanges-wrapper-1.3.4b0 → exchanges-wrapper-1.3.4.post2}/exchanges_wrapper/okx_parser.py +0 -0
- {exchanges-wrapper-1.3.4b0 → exchanges-wrapper-1.3.4.post2}/exchanges_wrapper/proto/exchanges_wrapper/api.proto +0 -0
- {exchanges-wrapper-1.3.4b0 → exchanges-wrapper-1.3.4.post2}/exchanges_wrapper/web_sockets.py +0 -0
|
@@ -1,5 +1,23 @@
|
|
|
1
|
-
## v1.3.
|
|
1
|
+
## v1.3.4-1 2023-07-19
|
|
2
|
+
### Fix
|
|
3
|
+
```
|
|
4
|
+
ERROR: Cannot install crypto_ws_api and grpcio==1.56.0 because these package versions have conflicting dependencies.
|
|
5
|
+
|
|
6
|
+
The conflict is caused by:
|
|
7
|
+
The user requested grpcio==1.56.0
|
|
8
|
+
exchanges-wrapper 1.3.3 depends on grpcio==1.48.1
|
|
9
|
+
The user requested grpcio==1.56.0
|
|
10
|
+
exchanges-wrapper 1.3.2 depends on grpcio==1.48.1
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## v1.3.4 2023-07-17
|
|
2
15
|
### Update
|
|
16
|
+
* Up requirements for grpcio to 1.56.0
|
|
17
|
+
```bazaar
|
|
18
|
+
Known security vulnerabilities detected
|
|
19
|
+
Dependency grpcio Version < 1.53.0 Upgrade to ~> 1.53.0
|
|
20
|
+
```
|
|
3
21
|
* Bitfinex: `exchanges_wrapper.client.Client.cancel_all_orders()`: removed unnecessary status check after cancel request
|
|
4
22
|
|
|
5
23
|
## v1.3.3 2023-07-04
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: exchanges-wrapper
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.4.post2
|
|
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
|
|
@@ -13,12 +13,13 @@ Classifier: Operating System :: Microsoft :: Windows
|
|
|
13
13
|
Classifier: Operating System :: MacOS
|
|
14
14
|
Requires-Dist: aiohttp==3.8.4
|
|
15
15
|
Requires-Dist: grpcio==1.56.0
|
|
16
|
+
Requires-Dist: grpcio-tools==1.56.0
|
|
16
17
|
Requires-Dist: toml==0.10.2
|
|
17
18
|
Requires-Dist: idna==3.4
|
|
18
19
|
Requires-Dist: pyotp~=2.8.0
|
|
19
20
|
Requires-Dist: simplejson==3.19.1
|
|
20
21
|
Requires-Dist: shortuuid~=1.0.11
|
|
21
|
-
Requires-Dist:
|
|
22
|
+
Requires-Dist: crypto-ws-api==1.0.1.post3
|
|
22
23
|
Project-URL: Source, https://github.com/DogsTailFarmer/exchanges-wrapper
|
|
23
24
|
|
|
24
25
|
<h1 align="center"><img align="center" src="https://raw.githubusercontent.com/gist/DogsTailFarmer/167eaf65cebfe95d954082c7f181a2cc/raw/a67270de8663ad3de4733330ff64c9ba3153f87d/Logo%202v3.svg" width="75">Crypto exchanges API/WSS wrapper with grpc powered server</h1>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
"""
|
|
4
4
|
REST API and WebSocket asyncio wrapper with grpc powered multiplexer server
|
|
5
|
-
for crypto exchanges (Binance, Bitfinex, OKX, Huobi
|
|
5
|
+
for crypto exchanges (Binance, Bitfinex, OKX, Huobi)
|
|
6
6
|
Utilizes one connection for many accounts and trading pairs.
|
|
7
7
|
For SPOT market only
|
|
8
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.3.
|
|
15
|
+
__version__ = "1.3.4-2"
|
|
16
16
|
|
|
17
17
|
from pathlib import Path
|
|
18
18
|
import shutil
|
|
@@ -23,6 +23,7 @@ CONFIG_FILE = Path(CONFIG_PATH, "exch_srv_cfg.toml")
|
|
|
23
23
|
LOG_PATH = Path(WORK_PATH, "exch_srv_log")
|
|
24
24
|
LOG_FILE = Path(LOG_PATH, "exch_srv.log")
|
|
25
25
|
|
|
26
|
+
|
|
26
27
|
def init():
|
|
27
28
|
if CONFIG_FILE.exists():
|
|
28
29
|
print(f"Server config found at {CONFIG_FILE}")
|
|
@@ -34,5 +35,6 @@ def init():
|
|
|
34
35
|
print(f"Before first run place account(s) API key into {CONFIG_FILE}")
|
|
35
36
|
raise SystemExit(1)
|
|
36
37
|
|
|
38
|
+
|
|
37
39
|
if __name__ == '__main__':
|
|
38
40
|
init()
|
{exchanges-wrapper-1.3.4b0 → exchanges-wrapper-1.3.4.post2}/exchanges_wrapper/bitfinex_parser.py
RENAMED
|
@@ -212,7 +212,7 @@ def order(res: [], response_type=None, wss_te=None, cancelled=False) -> {}:
|
|
|
212
212
|
status = 'CANCELED'
|
|
213
213
|
elif Decimal(orig_qty) > Decimal(executed_qty) > 0:
|
|
214
214
|
status = 'PARTIALLY_FILLED'
|
|
215
|
-
elif
|
|
215
|
+
elif Decimal(executed_qty) >= Decimal(orig_qty):
|
|
216
216
|
status = 'FILLED'
|
|
217
217
|
elif cancelled:
|
|
218
218
|
status = 'CANCELED'
|
|
@@ -534,7 +534,7 @@ def on_order_update(res: [], last_event: tuple) -> {}:
|
|
|
534
534
|
status = 'CANCELED'
|
|
535
535
|
elif Decimal(order_quantity) > Decimal(cumulative_filled_quantity) > 0:
|
|
536
536
|
status = 'PARTIALLY_FILLED'
|
|
537
|
-
elif
|
|
537
|
+
elif Decimal(cumulative_filled_quantity) >= Decimal(order_quantity):
|
|
538
538
|
status = 'FILLED'
|
|
539
539
|
else:
|
|
540
540
|
status = 'NEW'
|
|
@@ -159,8 +159,14 @@ class Client:
|
|
|
159
159
|
start_list.append(market_data_stream.start())
|
|
160
160
|
else:
|
|
161
161
|
for channel in _events:
|
|
162
|
+
# TODO Remove to config
|
|
163
|
+
if self.exchange == 'okx' and 'kline' in channel:
|
|
164
|
+
_endpoint = 'wss://ws.okx.com:8443/ws/v5/business'
|
|
165
|
+
else:
|
|
166
|
+
_endpoint = self.endpoint_ws_public
|
|
167
|
+
#
|
|
162
168
|
market_data_stream = MarketEventsDataStream(self,
|
|
163
|
-
|
|
169
|
+
_endpoint,
|
|
164
170
|
self.exchange, _trade_id,
|
|
165
171
|
channel)
|
|
166
172
|
self.data_streams[_trade_id] |= {market_data_stream}
|
|
@@ -229,7 +235,7 @@ class Client:
|
|
|
229
235
|
.rstrip("0")
|
|
230
236
|
.rstrip(".")
|
|
231
237
|
)
|
|
232
|
-
return price
|
|
238
|
+
return decimal.Decimal(price)
|
|
233
239
|
|
|
234
240
|
def assert_symbol(self, symbol):
|
|
235
241
|
if not symbol:
|
|
@@ -32,12 +32,10 @@ formatter = logging.Formatter(fmt="[%(asctime)s: %(levelname)s] %(message)s")
|
|
|
32
32
|
fh = logging.handlers.RotatingFileHandler(LOG_FILE, maxBytes=1000000, backupCount=10)
|
|
33
33
|
fh.setFormatter(formatter)
|
|
34
34
|
fh.setLevel(logging.DEBUG)
|
|
35
|
-
# logger.addHandler(fh)
|
|
36
35
|
#
|
|
37
36
|
sh = logging.StreamHandler()
|
|
38
37
|
sh.setFormatter(formatter)
|
|
39
38
|
sh.setLevel(logging.INFO)
|
|
40
|
-
# logger.addHandler(sh)
|
|
41
39
|
#
|
|
42
40
|
root_logger = logging.getLogger()
|
|
43
41
|
root_logger.setLevel(min([fh.level, sh.level]))
|
{exchanges-wrapper-1.3.4b0 → exchanges-wrapper-1.3.4.post2}/exchanges_wrapper/huobi_parser.py
RENAMED
|
@@ -302,7 +302,7 @@ def ticker(res: {}, symbol: str = None) -> {}:
|
|
|
302
302
|
return msg_binance
|
|
303
303
|
|
|
304
304
|
|
|
305
|
-
def interval(_interval
|
|
305
|
+
def interval(_interval) -> str:
|
|
306
306
|
resolution = {
|
|
307
307
|
'1m': '1min',
|
|
308
308
|
'5m': '5min',
|
|
@@ -314,10 +314,10 @@ def interval(_interval: str) -> str:
|
|
|
314
314
|
'1w': '1week',
|
|
315
315
|
'1M': '1mon'
|
|
316
316
|
}
|
|
317
|
-
return resolution.get(_interval,
|
|
317
|
+
return resolution.get(_interval, 'unresolved')
|
|
318
318
|
|
|
319
319
|
|
|
320
|
-
def interval2value(_interval
|
|
320
|
+
def interval2value(_interval) -> int:
|
|
321
321
|
resolution = {
|
|
322
322
|
'1min': 60,
|
|
323
323
|
'5min': 5 * 60,
|
|
@@ -19,12 +19,13 @@ requires-python = ">=3.8"
|
|
|
19
19
|
dependencies = [
|
|
20
20
|
"aiohttp==3.8.4",
|
|
21
21
|
"grpcio==1.56.0",
|
|
22
|
+
"grpcio-tools==1.56.0",
|
|
22
23
|
"toml==0.10.2",
|
|
23
24
|
"idna==3.4",
|
|
24
25
|
"pyotp~=2.8.0",
|
|
25
26
|
"simplejson==3.19.1",
|
|
26
27
|
"shortuuid~=1.0.11",
|
|
27
|
-
"
|
|
28
|
+
"crypto-ws-api==1.0.1.post3",
|
|
28
29
|
]
|
|
29
30
|
|
|
30
31
|
[tool.flit.module]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{exchanges-wrapper-1.3.4b0 → exchanges-wrapper-1.3.4.post2}/.github/workflows/docker-image.yml
RENAMED
|
File without changes
|
{exchanges-wrapper-1.3.4b0 → exchanges-wrapper-1.3.4.post2}/.github/workflows/python-publish.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{exchanges-wrapper-1.3.4b0 → exchanges-wrapper-1.3.4.post2}/exchanges_wrapper/api_pb2_grpc.py
RENAMED
|
File without changes
|
{exchanges-wrapper-1.3.4b0 → exchanges-wrapper-1.3.4.post2}/exchanges_wrapper/c_structures.py
RENAMED
|
File without changes
|
{exchanges-wrapper-1.3.4b0 → exchanges-wrapper-1.3.4.post2}/exchanges_wrapper/definitions.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{exchanges-wrapper-1.3.4b0 → exchanges-wrapper-1.3.4.post2}/exchanges_wrapper/http_client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{exchanges-wrapper-1.3.4b0 → exchanges-wrapper-1.3.4.post2}/exchanges_wrapper/web_sockets.py
RENAMED
|
File without changes
|