exchanges-wrapper 2.1.48__tar.gz → 2.1.50.post1__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.
Files changed (20) hide show
  1. {exchanges_wrapper-2.1.48 → exchanges_wrapper-2.1.50.post1}/PKG-INFO +6 -6
  2. {exchanges_wrapper-2.1.48 → exchanges_wrapper-2.1.50.post1}/exchanges_wrapper/__init__.py +1 -1
  3. {exchanges_wrapper-2.1.48 → exchanges_wrapper-2.1.50.post1}/exchanges_wrapper/client.py +7 -8
  4. {exchanges_wrapper-2.1.48 → exchanges_wrapper-2.1.50.post1}/exchanges_wrapper/exch_srv_cfg.toml.template +1 -2
  5. {exchanges_wrapper-2.1.48 → exchanges_wrapper-2.1.50.post1}/exchanges_wrapper/lib.py +0 -2
  6. {exchanges_wrapper-2.1.48 → exchanges_wrapper-2.1.50.post1}/pyproject.toml +6 -6
  7. {exchanges_wrapper-2.1.48 → exchanges_wrapper-2.1.50.post1}/LICENSE.md +0 -0
  8. {exchanges_wrapper-2.1.48 → exchanges_wrapper-2.1.50.post1}/README.md +0 -0
  9. {exchanges_wrapper-2.1.48 → exchanges_wrapper-2.1.50.post1}/exchanges_wrapper/definitions.py +0 -0
  10. {exchanges_wrapper-2.1.48 → exchanges_wrapper-2.1.50.post1}/exchanges_wrapper/errors.py +0 -0
  11. {exchanges_wrapper-2.1.48 → exchanges_wrapper-2.1.50.post1}/exchanges_wrapper/events.py +0 -0
  12. {exchanges_wrapper-2.1.48 → exchanges_wrapper-2.1.50.post1}/exchanges_wrapper/exch_srv.py +0 -0
  13. {exchanges_wrapper-2.1.48 → exchanges_wrapper-2.1.50.post1}/exchanges_wrapper/http_client.py +0 -0
  14. {exchanges_wrapper-2.1.48 → exchanges_wrapper-2.1.50.post1}/exchanges_wrapper/martin/__init__.py +0 -0
  15. {exchanges_wrapper-2.1.48 → exchanges_wrapper-2.1.50.post1}/exchanges_wrapper/parsers/bitfinex.py +0 -0
  16. {exchanges_wrapper-2.1.48 → exchanges_wrapper-2.1.50.post1}/exchanges_wrapper/parsers/bybit.py +0 -0
  17. {exchanges_wrapper-2.1.48 → exchanges_wrapper-2.1.50.post1}/exchanges_wrapper/parsers/huobi.py +0 -0
  18. {exchanges_wrapper-2.1.48 → exchanges_wrapper-2.1.50.post1}/exchanges_wrapper/parsers/okx.py +0 -0
  19. {exchanges_wrapper-2.1.48 → exchanges_wrapper-2.1.50.post1}/exchanges_wrapper/proto/martin.proto +0 -0
  20. {exchanges_wrapper-2.1.48 → exchanges_wrapper-2.1.50.post1}/exchanges_wrapper/web_sockets.py +0 -0
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: exchanges-wrapper
3
- Version: 2.1.48
3
+ Version: 2.1.50.post1
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
- Requires-Python: >=3.10
6
+ Requires-Python: >=3.12
7
7
  Description-Content-Type: text/markdown
8
8
  Classifier: Programming Language :: Python :: 3
9
9
  Classifier: Development Status :: 5 - Production/Stable
@@ -12,10 +12,10 @@ Classifier: Operating System :: Unix
12
12
  Classifier: Operating System :: Microsoft :: Windows
13
13
  Classifier: Operating System :: MacOS
14
14
  License-File: LICENSE.md
15
- Requires-Dist: crypto-ws-api==2.1.8
16
- Requires-Dist: pyotp==2.9.0
17
- Requires-Dist: simplejson==3.20.2
18
- Requires-Dist: aiohttp~=3.13.4
15
+ Requires-Dist: crypto-ws-api==2.1.9
16
+ Requires-Dist: pyotp==2.10.0
17
+ Requires-Dist: simplejson==4.1.1
18
+ Requires-Dist: aiohttp==3.14.1
19
19
  Requires-Dist: expiringdict~=1.2.2
20
20
  Requires-Dist: betterproto==2.0.0b7
21
21
  Requires-Dist: grpclib~=0.4.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__ = "2.1.48"
15
+ __version__ = "2.1.50post1"
16
16
 
17
17
  from pathlib import Path
18
18
  import shutil
@@ -47,7 +47,7 @@ def any2str(_x) -> str:
47
47
 
48
48
  class Client:
49
49
  __slots__ = (
50
- 'exchange', 'sub_account', 'test_net', 'api_key', 'api_secret',
50
+ 'exchange', 'test_net', 'api_key', 'api_secret',
51
51
  'passphrase', 'endpoint_api_public', 'endpoint_ws_public',
52
52
  'endpoint_api_auth', 'endpoint_ws_auth', 'endpoint_ws_api',
53
53
  'ws_add_on', 'master_email', 'master_name', 'two_fa', 'http',
@@ -61,7 +61,6 @@ class Client:
61
61
 
62
62
  def __init__(self, acc: dict):
63
63
  self.exchange = acc['exchange']
64
- self.sub_account = acc['sub_account']
65
64
  self.test_net = acc['test_net']
66
65
  self.api_key = acc['api_key']
67
66
  self.api_secret = acc['api_secret']
@@ -231,7 +230,7 @@ class Client:
231
230
  raise ExchangePyError(f"Symbol {symbol} is not valid according to the loaded exchange infos")
232
231
 
233
232
  def symbol_to_bfx(self, symbol) -> str:
234
- symbol_info = self.symbols.get(symbol)
233
+ symbol_info = self.symbols.get(symbol, {})
235
234
  base_asset = symbol_info.get('baseAsset')
236
235
  quote_asset = symbol_info.get('quoteAsset')
237
236
  return (
@@ -241,11 +240,11 @@ class Client:
241
240
  )
242
241
 
243
242
  def symbol_to_okx(self, symbol) -> str:
244
- symbol_info = self.symbols.get(symbol)
243
+ symbol_info = self.symbols.get(symbol, {})
245
244
  return f"{symbol_info.get('baseAsset')}-{symbol_info.get('quoteAsset')}"
246
245
 
247
246
  def symbol_to_id(self, symbol) -> int:
248
- return self.symbols.get(symbol).get('instIdCode')
247
+ return self.symbols.get(symbol, {}).get('instIdCode')
249
248
 
250
249
  def active_order(self, order_id: int, quantity="0", executed_qty="0", last_event=None):
251
250
  quantity_decimal = Decimal(quantity)
@@ -344,6 +343,9 @@ class Client:
344
343
  # https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md#exchange-information
345
344
  async def fetch_exchange_info(self, symbol):
346
345
  binance_res = {}
346
+ server_time = {}
347
+ if self.exchange in ('huobi', 'okx', 'bybit'):
348
+ server_time: dict = await self.fetch_server_time()
347
349
  if self.exchange == 'binance':
348
350
  binance_res = await self.http.send_api_call(
349
351
  "/api/v3/exchangeInfo",
@@ -364,20 +366,17 @@ class Client:
364
366
  if symbols_details and tickers:
365
367
  binance_res = bfx.exchange_info(symbols_details, tickers, symbol)
366
368
  elif self.exchange == 'huobi':
367
- server_time = await self.fetch_server_time()
368
369
  params = {'symbols': symbol.lower()}
369
370
  trading_symbol = await self.http.send_api_call("v1/settings/common/market-symbols", **params)
370
371
  await self.set_htx_ids()
371
372
  binance_res = hbp.exchange_info(server_time.get('serverTime'), trading_symbol[0])
372
373
  elif self.exchange == 'okx':
373
374
  params = {'instType': 'SPOT'}
374
- server_time = await self.fetch_server_time()
375
375
  instruments = await self.http.send_api_call("/api/v5/public/instruments", **params)
376
376
  tickers = await self.http.send_api_call("/api/v5/market/tickers", **params)
377
377
  binance_res = okx.exchange_info(server_time.get('serverTime'), instruments, tickers, symbol)
378
378
  elif self.exchange == 'bybit':
379
379
  params = {'category': 'spot', 'symbol': symbol}
380
- server_time = await self.fetch_server_time()
381
380
  instruments, _ = await self.http.send_api_call("/v5/market/instruments-info", **params)
382
381
  binance_res = bbt.exchange_info(server_time.get('serverTime'), instruments.get('list'))
383
382
  # logger.info(f"fetch_exchange_info: binance_res: {binance_res}")
@@ -1,6 +1,6 @@
1
1
  # Parameters for exchanges-wrapper REST API Server exch_srv.py
2
2
  # Copyright © 2021-2025 Jerry Fedorenko aka VM
3
- # __version__ = "2.1.34"
3
+ # __version__ = "2.1.50"
4
4
 
5
5
  # region endpoint
6
6
  [endpoint]
@@ -146,7 +146,6 @@ test_net = true
146
146
  [[accounts]]
147
147
  exchange = 'bybit'
148
148
  name = 'Demo - ByBitSub01'
149
- sub_account_name = 'Demo - ByBitSub01'
150
149
  api_key = '*********** Place API key there ************'
151
150
  api_secret = '*********** Place secret API key there ************'
152
151
  test_net = true
@@ -65,7 +65,6 @@ def get_account(account_name: str) -> dict:
65
65
  for account in accounts:
66
66
  if account.get('name') == account_name:
67
67
  exchange = account['exchange']
68
- sub_account = account.get('sub_account_name')
69
68
  test_net = account['test_net']
70
69
  master_email = account.get('master_email')
71
70
  master_name = account.get('master_name')
@@ -79,7 +78,6 @@ def get_account(account_name: str) -> dict:
79
78
 
80
79
  return {
81
80
  'exchange': exchange,
82
- 'sub_account': sub_account,
83
81
  'test_net': test_net,
84
82
  'api_key': account['api_key'],
85
83
  'api_secret': account['api_secret'],
@@ -1,5 +1,5 @@
1
1
  [build-system]
2
- requires = ["flit_core >=3.2,<4"]
2
+ requires = ["flit_core >=3.12.0,<4"]
3
3
  build-backend = "flit_core.buildapi"
4
4
 
5
5
  [project]
@@ -17,13 +17,13 @@ classifiers=["Programming Language :: Python :: 3",
17
17
  "Operating System :: Microsoft :: Windows",
18
18
  "Operating System :: MacOS"]
19
19
  dynamic = ["version", "description"]
20
- requires-python = ">=3.10"
20
+ requires-python = ">=3.12"
21
21
 
22
22
  dependencies = [
23
- "crypto-ws-api==2.1.8",
24
- "pyotp==2.9.0",
25
- "simplejson==3.20.2",
26
- "aiohttp~=3.13.4",
23
+ "crypto-ws-api==2.1.9",
24
+ "pyotp==2.10.0",
25
+ "simplejson==4.1.1",
26
+ "aiohttp==3.14.1",
27
27
  "expiringdict~=1.2.2",
28
28
  "betterproto==2.0.0b7",
29
29
  "grpclib~=0.4.8"