exchanges-wrapper 2.1.43__tar.gz → 2.1.46__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.43 → exchanges_wrapper-2.1.46}/PKG-INFO +4 -4
  2. {exchanges_wrapper-2.1.43 → exchanges_wrapper-2.1.46}/README.md +1 -1
  3. {exchanges_wrapper-2.1.43 → exchanges_wrapper-2.1.46}/exchanges_wrapper/__init__.py +1 -1
  4. {exchanges_wrapper-2.1.43 → exchanges_wrapper-2.1.46}/exchanges_wrapper/client.py +22 -12
  5. {exchanges_wrapper-2.1.43 → exchanges_wrapper-2.1.46}/exchanges_wrapper/parsers/okx.py +1 -0
  6. {exchanges_wrapper-2.1.43 → exchanges_wrapper-2.1.46}/pyproject.toml +2 -2
  7. {exchanges_wrapper-2.1.43 → exchanges_wrapper-2.1.46}/LICENSE.md +0 -0
  8. {exchanges_wrapper-2.1.43 → exchanges_wrapper-2.1.46}/exchanges_wrapper/definitions.py +0 -0
  9. {exchanges_wrapper-2.1.43 → exchanges_wrapper-2.1.46}/exchanges_wrapper/errors.py +0 -0
  10. {exchanges_wrapper-2.1.43 → exchanges_wrapper-2.1.46}/exchanges_wrapper/events.py +0 -0
  11. {exchanges_wrapper-2.1.43 → exchanges_wrapper-2.1.46}/exchanges_wrapper/exch_srv.py +0 -0
  12. {exchanges_wrapper-2.1.43 → exchanges_wrapper-2.1.46}/exchanges_wrapper/exch_srv_cfg.toml.template +0 -0
  13. {exchanges_wrapper-2.1.43 → exchanges_wrapper-2.1.46}/exchanges_wrapper/http_client.py +0 -0
  14. {exchanges_wrapper-2.1.43 → exchanges_wrapper-2.1.46}/exchanges_wrapper/lib.py +0 -0
  15. {exchanges_wrapper-2.1.43 → exchanges_wrapper-2.1.46}/exchanges_wrapper/martin/__init__.py +0 -0
  16. {exchanges_wrapper-2.1.43 → exchanges_wrapper-2.1.46}/exchanges_wrapper/parsers/bitfinex.py +0 -0
  17. {exchanges_wrapper-2.1.43 → exchanges_wrapper-2.1.46}/exchanges_wrapper/parsers/bybit.py +0 -0
  18. {exchanges_wrapper-2.1.43 → exchanges_wrapper-2.1.46}/exchanges_wrapper/parsers/huobi.py +0 -0
  19. {exchanges_wrapper-2.1.43 → exchanges_wrapper-2.1.46}/exchanges_wrapper/proto/martin.proto +0 -0
  20. {exchanges_wrapper-2.1.43 → exchanges_wrapper-2.1.46}/exchanges_wrapper/web_sockets.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: exchanges-wrapper
3
- Version: 2.1.43
3
+ Version: 2.1.46
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.10
@@ -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.4
15
+ Requires-Dist: crypto-ws-api==2.1.6
16
16
  Requires-Dist: pyotp==2.9.0
17
17
  Requires-Dist: simplejson==3.20.2
18
- Requires-Dist: aiohttp~=3.13.2
18
+ Requires-Dist: aiohttp~=3.13.3
19
19
  Requires-Dist: expiringdict~=1.2.2
20
20
  Requires-Dist: betterproto==2.0.0b7
21
21
  Requires-Dist: grpclib~=0.4.8
@@ -157,7 +157,7 @@ docker run -itP \
157
157
  *USDT* (TRC20) TN8F3Dz8BU8VwECRh3LTKi7FrsU8eWfsZz
158
158
 
159
159
  ## Powered by exchanges-wrapper
160
- <a><img align="middle" src="https://github.com/DogsTailFarmer/martin-binance/raw/public/doc/Modified%20martingale.svg" width="50"></a>
160
+ <a><img align="middle" src="https://raw.githubusercontent.com/DogsTailFarmer/martin-binance/55758a8d32b08c4deb1b34add01c5e259b88f738/doc/Modified%20martingale.svg" width="50"></a>
161
161
  [martin-binance](https://github.com/DogsTailFarmer/martin-binance)
162
162
 
163
163
  Free trading system for crypto exchanges SPOT markets. Adaptive customizable reverse grid strategy based on martingale.
@@ -134,7 +134,7 @@ docker run -itP \
134
134
  *USDT* (TRC20) TN8F3Dz8BU8VwECRh3LTKi7FrsU8eWfsZz
135
135
 
136
136
  ## Powered by exchanges-wrapper
137
- <a><img align="middle" src="https://github.com/DogsTailFarmer/martin-binance/raw/public/doc/Modified%20martingale.svg" width="50"></a>
137
+ <a><img align="middle" src="https://raw.githubusercontent.com/DogsTailFarmer/martin-binance/55758a8d32b08c4deb1b34add01c5e259b88f738/doc/Modified%20martingale.svg" width="50"></a>
138
138
  [martin-binance](https://github.com/DogsTailFarmer/martin-binance)
139
139
 
140
140
  Free trading system for crypto exchanges SPOT markets. Adaptive customizable reverse grid strategy based on martingale.
@@ -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.43"
15
+ __version__ = "2.1.46"
16
16
 
17
17
  from pathlib import Path
18
18
  import shutil
@@ -244,6 +244,9 @@ class Client:
244
244
  symbol_info = self.symbols.get(symbol)
245
245
  return f"{symbol_info.get('baseAsset')}-{symbol_info.get('quoteAsset')}"
246
246
 
247
+ def symbol_to_id(self, symbol) -> int:
248
+ return self.symbols.get(symbol).get('instIdCode')
249
+
247
250
  def active_order(self, order_id: int, quantity="0", executed_qty="0", last_event=None):
248
251
  quantity_decimal = Decimal(quantity)
249
252
  executed_qty_decimal = Decimal(executed_qty)
@@ -858,7 +861,7 @@ class Client:
858
861
  self.active_order(int(res), quantity, binance_res['executedQty'])
859
862
  elif self.exchange == 'okx':
860
863
  params = {
861
- "instId": self.symbol_to_okx(symbol),
864
+ "instIdCode": self.symbol_to_id(symbol),
862
865
  "tdMode": "cash",
863
866
  "clOrdId": new_client_order_id,
864
867
  "side": side.lower(),
@@ -867,6 +870,7 @@ class Client:
867
870
  "px": price,
868
871
  }
869
872
  res = await self.user_session.handle_request(trade_id, "order", _params=params)
873
+ params["instId"] = self.symbol_to_okx(symbol)
870
874
  if res is None:
871
875
  fallback_warning(self.exchange, symbol)
872
876
  res = await self.http.send_api_call(
@@ -1071,19 +1075,19 @@ class Client:
1071
1075
  _queue = asyncio.Queue()
1072
1076
  self.on_order_update_queues.update({f"{_symbol}{order_id}": _queue})
1073
1077
  params = {
1074
- "instId": _symbol,
1078
+ "instIdCode": self.symbol_to_id(symbol),
1075
1079
  "ordId": str(order_id),
1076
1080
  "clOrdId": str(origin_client_order_id),
1077
1081
  }
1078
- _res = (
1079
- await self.user_session.handle_request(trade_id, "cancel-order", _params=params)
1080
- or await self.http.send_api_call(
1081
- "/api/v5/trade/cancel-order",
1082
- method="POST",
1083
- signed=True,
1084
- **params,
1085
- )
1086
- )
1082
+ _res = await self.user_session.handle_request(trade_id, "cancel-order", _params=params)
1083
+ if _res is None:
1084
+ params["instId"] = self.symbol_to_okx(symbol)
1085
+ _res = await self.http.send_api_call(
1086
+ "/api/v5/trade/cancel-order",
1087
+ method="POST",
1088
+ signed=True,
1089
+ **params,
1090
+ )
1087
1091
  if _res[0].get('sCode') != '0':
1088
1092
  raise UserWarning(_res[0].get('sMsg'))
1089
1093
  try:
@@ -1180,7 +1184,13 @@ class Client:
1180
1184
  for order in orders:
1181
1185
  order['status'] = 'CANCELED'
1182
1186
  orders_canceled.append(order)
1183
- params.append({'instId': _symbol, 'ordId': order.get('orderId')})
1187
+ params.append(
1188
+ {
1189
+ "instIdCode": self.symbol_to_id(symbol),
1190
+ 'instId': _symbol,
1191
+ 'ordId': order.get('orderId')
1192
+ }
1193
+ )
1184
1194
  if i >= 19:
1185
1195
  break
1186
1196
  i += 1
@@ -78,6 +78,7 @@ def exchange_info(server_time: int, trading_symbol: list, tickers: list, symbol_
78
78
  "isMarginTradingAllowed": False,
79
79
  "filters": [_price_filter, _lot_size, _min_notional, _percent_price],
80
80
  "permissions": ["SPOT"],
81
+ "instIdCode": market.get("instIdCode")
81
82
  }
82
83
  symbols.append(symbol)
83
84
 
@@ -20,10 +20,10 @@ dynamic = ["version", "description"]
20
20
  requires-python = ">=3.10"
21
21
 
22
22
  dependencies = [
23
- "crypto-ws-api==2.1.4",
23
+ "crypto-ws-api==2.1.6",
24
24
  "pyotp==2.9.0",
25
25
  "simplejson==3.20.2",
26
- "aiohttp~=3.13.2",
26
+ "aiohttp~=3.13.3",
27
27
  "expiringdict~=1.2.2",
28
28
  "betterproto==2.0.0b7",
29
29
  "grpclib~=0.4.8"