ccxt 4.4.43__py2.py3-none-any.whl → 4.4.45__py2.py3-none-any.whl

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 (91) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/abstract/binance.py +1 -0
  3. ccxt/abstract/binancecoinm.py +1 -0
  4. ccxt/abstract/binanceus.py +1 -0
  5. ccxt/abstract/binanceusdm.py +1 -0
  6. ccxt/abstract/blofin.py +22 -0
  7. ccxt/async_support/__init__.py +1 -1
  8. ccxt/async_support/base/exchange.py +1 -1
  9. ccxt/async_support/binance.py +235 -107
  10. ccxt/async_support/bingx.py +20 -9
  11. ccxt/async_support/bitfinex.py +7 -3
  12. ccxt/async_support/bitget.py +6 -4
  13. ccxt/async_support/bitmart.py +7 -10
  14. ccxt/async_support/bitmex.py +4 -6
  15. ccxt/async_support/bitstamp.py +5 -0
  16. ccxt/async_support/blofin.py +22 -0
  17. ccxt/async_support/bybit.py +12 -27
  18. ccxt/async_support/coinbase.py +14 -10
  19. ccxt/async_support/coinbaseinternational.py +13 -9
  20. ccxt/async_support/coincatch.py +2 -2
  21. ccxt/async_support/coinex.py +6 -6
  22. ccxt/async_support/cryptocom.py +5 -3
  23. ccxt/async_support/defx.py +2 -2
  24. ccxt/async_support/delta.py +1 -1
  25. ccxt/async_support/exmo.py +16 -8
  26. ccxt/async_support/gate.py +10 -5
  27. ccxt/async_support/gemini.py +5 -0
  28. ccxt/async_support/hashkey.py +15 -10
  29. ccxt/async_support/htx.py +103 -5
  30. ccxt/async_support/hyperliquid.py +6 -1
  31. ccxt/async_support/kraken.py +10 -3
  32. ccxt/async_support/krakenfutures.py +6 -1
  33. ccxt/async_support/kucoin.py +10 -8
  34. ccxt/async_support/kucoinfutures.py +7 -8
  35. ccxt/async_support/lykke.py +1 -1
  36. ccxt/async_support/mexc.py +20 -14
  37. ccxt/async_support/myokx.py +8 -0
  38. ccxt/async_support/ndax.py +1 -1
  39. ccxt/async_support/oceanex.py +1 -1
  40. ccxt/async_support/okx.py +9 -10
  41. ccxt/async_support/onetrading.py +2 -1
  42. ccxt/async_support/whitebit.py +35 -10
  43. ccxt/async_support/woo.py +6 -4
  44. ccxt/async_support/woofipro.py +7 -4
  45. ccxt/base/exchange.py +1 -1
  46. ccxt/binance.py +235 -107
  47. ccxt/bingx.py +20 -9
  48. ccxt/bitfinex.py +7 -3
  49. ccxt/bitget.py +6 -4
  50. ccxt/bitmart.py +7 -10
  51. ccxt/bitmex.py +4 -6
  52. ccxt/bitstamp.py +5 -0
  53. ccxt/blofin.py +22 -0
  54. ccxt/bybit.py +12 -27
  55. ccxt/coinbase.py +14 -10
  56. ccxt/coinbaseinternational.py +13 -9
  57. ccxt/coincatch.py +2 -2
  58. ccxt/coinex.py +6 -6
  59. ccxt/cryptocom.py +5 -3
  60. ccxt/defx.py +2 -2
  61. ccxt/delta.py +1 -1
  62. ccxt/exmo.py +16 -8
  63. ccxt/gate.py +10 -5
  64. ccxt/gemini.py +5 -0
  65. ccxt/hashkey.py +15 -10
  66. ccxt/htx.py +103 -5
  67. ccxt/hyperliquid.py +6 -1
  68. ccxt/kraken.py +10 -3
  69. ccxt/krakenfutures.py +6 -1
  70. ccxt/kucoin.py +10 -8
  71. ccxt/kucoinfutures.py +7 -8
  72. ccxt/lykke.py +1 -1
  73. ccxt/mexc.py +20 -14
  74. ccxt/myokx.py +8 -0
  75. ccxt/ndax.py +1 -1
  76. ccxt/oceanex.py +1 -1
  77. ccxt/okx.py +9 -10
  78. ccxt/onetrading.py +2 -1
  79. ccxt/pro/__init__.py +1 -1
  80. ccxt/pro/binance.py +2 -1
  81. ccxt/pro/bitcoincom.py +4 -1
  82. ccxt/pro/bitopro.py +1 -1
  83. ccxt/pro/myokx.py +5 -0
  84. ccxt/whitebit.py +35 -10
  85. ccxt/woo.py +6 -4
  86. ccxt/woofipro.py +7 -4
  87. {ccxt-4.4.43.dist-info → ccxt-4.4.45.dist-info}/METADATA +4 -4
  88. {ccxt-4.4.43.dist-info → ccxt-4.4.45.dist-info}/RECORD +91 -91
  89. {ccxt-4.4.43.dist-info → ccxt-4.4.45.dist-info}/LICENSE.txt +0 -0
  90. {ccxt-4.4.43.dist-info → ccxt-4.4.45.dist-info}/WHEEL +0 -0
  91. {ccxt-4.4.43.dist-info → ccxt-4.4.45.dist-info}/top_level.txt +0 -0
ccxt/gemini.py CHANGED
@@ -329,6 +329,11 @@ class gemini(Exchange, ImplicitAPI):
329
329
  },
330
330
  'hedged': False,
331
331
  'trailing': False,
332
+ 'leverage': False,
333
+ 'marketBuyByCost': True,
334
+ 'marketBuyRequiresPrice': False,
335
+ 'selfTradePrevention': False,
336
+ 'iceberg': False,
332
337
  },
333
338
  'createOrders': None,
334
339
  'fetchMyTrades': {
ccxt/hashkey.py CHANGED
@@ -380,13 +380,11 @@ class hashkey(Exchange, ImplicitAPI):
380
380
  },
381
381
  'hedged': False,
382
382
  'trailing': False,
383
- # exchange-supported features
384
- # 'marketBuyRequiresPrice': False,
385
- # 'marketBuyByCost': False,
386
- # 'selfTradePrevention': True,
387
- # 'twap': False,
388
- # 'iceberg': False,
389
- # 'oco': False,
383
+ 'leverage': False,
384
+ 'marketBuyByCost': True,
385
+ 'marketBuyRequiresPrice': True, # todo fix
386
+ 'selfTradePrevention': True, # todo implement
387
+ 'iceberg': False,
390
388
  },
391
389
  'createOrders': {
392
390
  'max': 20,
@@ -1456,9 +1454,14 @@ class hashkey(Exchange, ImplicitAPI):
1456
1454
  if isBuyer is not None:
1457
1455
  side = 'buy' if isBuyer else 'sell'
1458
1456
  takerOrMaker = None
1459
- isMaker = self.safe_bool_n(trade, ['isMaker', 'isMarker', 'ibm'])
1457
+ isMaker = self.safe_bool_n(trade, ['isMaker', 'isMarker'])
1460
1458
  if isMaker is not None:
1461
1459
  takerOrMaker = 'maker' if isMaker else 'taker'
1460
+ isBuyerMaker = self.safe_bool(trade, 'ibm')
1461
+ # if public trade
1462
+ if isBuyerMaker is not None:
1463
+ takerOrMaker = 'taker'
1464
+ side = 'sell' if isBuyerMaker else 'buy'
1462
1465
  feeCost = self.safe_string(trade, 'commission')
1463
1466
  feeCurrncyId = self.safe_string(trade, 'commissionAsset')
1464
1467
  feeInfo = self.safe_dict(trade, 'fee')
@@ -2393,8 +2396,10 @@ class hashkey(Exchange, ImplicitAPI):
2393
2396
  market = self.market(symbol)
2394
2397
  if not market['spot']:
2395
2398
  raise NotSupported(self.id + ' createMarketBuyOrderWithCost() is supported for spot markets only')
2396
- params['cost'] = cost
2397
- return self.create_order(symbol, 'market', 'buy', cost, None, params)
2399
+ req = {
2400
+ 'cost': cost,
2401
+ }
2402
+ return self.create_order(symbol, 'market', 'buy', cost, None, self.extend(req, params))
2398
2403
 
2399
2404
  def create_spot_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}) -> Order:
2400
2405
  """
ccxt/htx.py CHANGED
@@ -114,6 +114,7 @@ class htx(Exchange, ImplicitAPI):
114
114
  'fetchOHLCV': True,
115
115
  'fetchOpenInterest': True,
116
116
  'fetchOpenInterestHistory': True,
117
+ 'fetchOpenInterests': True,
117
118
  'fetchOpenOrder': None,
118
119
  'fetchOpenOrders': True,
119
120
  'fetchOrder': True,
@@ -1269,9 +1270,11 @@ class htx(Exchange, ImplicitAPI):
1269
1270
  },
1270
1271
  'hedged': False,
1271
1272
  'trailing': False,
1272
- # exchange-specific features
1273
1273
  'iceberg': False,
1274
- 'selfTradePrevention': True,
1274
+ 'selfTradePrevention': True, # todo implement
1275
+ 'leverage': True, # todo implement
1276
+ 'marketBuyByCost': True,
1277
+ 'marketBuyRequiresPrice': True,
1275
1278
  },
1276
1279
  'createOrders': {
1277
1280
  'max': 10,
@@ -1307,7 +1310,7 @@ class htx(Exchange, ImplicitAPI):
1307
1310
  'trailing': False,
1308
1311
  'untilDays': 2,
1309
1312
  'limit': 500,
1310
- 'daysBackClosed': 180,
1313
+ 'daysBack': 180,
1311
1314
  'daysBackCanceled': 1 / 12,
1312
1315
  },
1313
1316
  'fetchOHLCV': {
@@ -1348,7 +1351,7 @@ class htx(Exchange, ImplicitAPI):
1348
1351
  'trailing': False,
1349
1352
  'untilDays': 2,
1350
1353
  'limit': 50,
1351
- 'daysBackClosed': 90,
1354
+ 'daysBack': 90,
1352
1355
  'daysBackCanceled': 1 / 12,
1353
1356
  },
1354
1357
  'fetchOHLCV': {
@@ -8003,6 +8006,100 @@ class htx(Exchange, ImplicitAPI):
8003
8006
  tick = self.safe_list(data, 'tick')
8004
8007
  return self.parse_open_interests_history(tick, market, since, limit)
8005
8008
 
8009
+ def fetch_open_interests(self, symbols: Strings = None, params={}):
8010
+ """
8011
+ Retrieves the open interest for a list of symbols
8012
+
8013
+ https://huobiapi.github.io/docs/dm/v1/en/#get-contract-open-interest-information
8014
+ https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-swap-open-interest-information
8015
+ https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-get-swap-open-interest-information
8016
+
8017
+ :param str[] [symbols]: a list of unified CCXT market symbols
8018
+ :param dict [params]: exchange specific parameters
8019
+ :returns dict[]: a list of `open interest structures <https://docs.ccxt.com/#/?id=open-interest-structure>`
8020
+ """
8021
+ self.load_markets()
8022
+ symbols = self.market_symbols(symbols)
8023
+ market = None
8024
+ if symbols is not None:
8025
+ symbolsLength = len(symbols)
8026
+ if symbolsLength > 0:
8027
+ first = self.safe_string(symbols, 0)
8028
+ market = self.market(first)
8029
+ request: dict = {}
8030
+ subType = None
8031
+ subType, params = self.handle_sub_type_and_params('fetchPositions', market, params, 'linear')
8032
+ marketType = None
8033
+ marketType, params = self.handle_market_type_and_params('fetchPositions', market, params)
8034
+ response = None
8035
+ if marketType == 'future':
8036
+ response = self.contractPublicGetApiV1ContractOpenInterest(self.extend(request, params))
8037
+ #
8038
+ # {
8039
+ # "status": "ok",
8040
+ # "data": [
8041
+ # {
8042
+ # "volume": 118850.000000000000000000,
8043
+ # "amount": 635.502025211544374189,
8044
+ # "symbol": "BTC",
8045
+ # "contract_type": "self_week",
8046
+ # "contract_code": "BTC220930",
8047
+ # "trade_amount": 1470.9400749347598691119206024033947897351,
8048
+ # "trade_volume": 286286,
8049
+ # "trade_turnover": 28628600.000000000000000000
8050
+ # }
8051
+ # ],
8052
+ # "ts": 1664337928805
8053
+ # }
8054
+ #
8055
+ elif subType == 'inverse':
8056
+ response = self.contractPublicGetSwapApiV1SwapOpenInterest(self.extend(request, params))
8057
+ #
8058
+ # {
8059
+ # "status": "ok",
8060
+ # "data": [
8061
+ # {
8062
+ # "volume": 518018.000000000000000000,
8063
+ # "amount": 2769.675777407074725180,
8064
+ # "symbol": "BTC",
8065
+ # "contract_code": "BTC-USD",
8066
+ # "trade_amount": 9544.4032080046491323463688602729806842458,
8067
+ # "trade_volume": 1848448,
8068
+ # "trade_turnover": 184844800.000000000000000000
8069
+ # }
8070
+ # ],
8071
+ # "ts": 1664337226028
8072
+ # }
8073
+ #
8074
+ else:
8075
+ request['contract_type'] = 'swap'
8076
+ response = self.contractPublicGetLinearSwapApiV1SwapOpenInterest(self.extend(request, params))
8077
+ #
8078
+ # {
8079
+ # "status": "ok",
8080
+ # "data": [
8081
+ # {
8082
+ # "volume": 7192610.000000000000000000,
8083
+ # "amount": 7192.610000000000000000,
8084
+ # "symbol": "BTC",
8085
+ # "value": 134654290.332000000000000000,
8086
+ # "contract_code": "BTC-USDT",
8087
+ # "trade_amount": 70692.804,
8088
+ # "trade_volume": 70692804,
8089
+ # "trade_turnover": 1379302592.9518,
8090
+ # "business_type": "swap",
8091
+ # "pair": "BTC-USDT",
8092
+ # "contract_type": "swap",
8093
+ # "trade_partition": "USDT"
8094
+ # }
8095
+ # ],
8096
+ # "ts": 1664336503144
8097
+ # }
8098
+ #
8099
+ data = self.safe_list(response, 'data', [])
8100
+ result = self.parse_open_interests(data)
8101
+ return self.filter_by_array(result, 'symbol', symbols)
8102
+
8006
8103
  def fetch_open_interest(self, symbol: str, params={}):
8007
8104
  """
8008
8105
  Retrieves the open interest of a currency
@@ -8161,8 +8258,9 @@ class htx(Exchange, ImplicitAPI):
8161
8258
  timestamp = self.safe_integer(interest, 'ts')
8162
8259
  amount = self.safe_number(interest, 'volume')
8163
8260
  value = self.safe_number(interest, 'value')
8261
+ marketId = self.safe_string(interest, 'contract_code')
8164
8262
  return self.safe_open_interest({
8165
- 'symbol': self.safe_string(market, 'symbol'),
8263
+ 'symbol': self.safe_symbol(marketId, market),
8166
8264
  'baseVolume': amount, # deprecated
8167
8265
  'quoteVolume': value, # deprecated
8168
8266
  'openInterestAmount': amount,
ccxt/hyperliquid.py CHANGED
@@ -246,6 +246,11 @@ class hyperliquid(Exchange, ImplicitAPI):
246
246
  },
247
247
  'hedged': False,
248
248
  'trailing': False,
249
+ 'leverage': False,
250
+ 'marketBuyByCost': False,
251
+ 'marketBuyRequiresPrice': False,
252
+ 'selfTradePrevention': False,
253
+ 'iceberg': False,
249
254
  },
250
255
  'createOrders': {
251
256
  'max': 1000,
@@ -278,7 +283,7 @@ class hyperliquid(Exchange, ImplicitAPI):
278
283
  'fetchClosedOrders': {
279
284
  'marginMode': False,
280
285
  'limit': 2000,
281
- 'daysBackClosed': None,
286
+ 'daysBack': None,
282
287
  'daysBackCanceled': None,
283
288
  'untilDays': None,
284
289
  'trigger': False,
ccxt/kraken.py CHANGED
@@ -464,6 +464,11 @@ class kraken(Exchange, ImplicitAPI):
464
464
  },
465
465
  'hedged': False,
466
466
  'trailing': True,
467
+ 'leverage': False,
468
+ 'marketBuyByCost': True,
469
+ 'marketBuyRequiresPrice': False,
470
+ 'selfTradePrevention': True, # todo implement
471
+ 'iceberg': True, # todo implement
467
472
  },
468
473
  'createOrders': None,
469
474
  'fetchMyTrades': {
@@ -487,7 +492,7 @@ class kraken(Exchange, ImplicitAPI):
487
492
  'fetchClosedOrders': {
488
493
  'marginMode': False,
489
494
  'limit': None,
490
- 'daysBackClosed': None,
495
+ 'daysBack': None,
491
496
  'daysBackCanceled': None,
492
497
  'untilDays': 100000,
493
498
  'trigger': False,
@@ -1483,8 +1488,10 @@ class kraken(Exchange, ImplicitAPI):
1483
1488
  """
1484
1489
  self.load_markets()
1485
1490
  # only buy orders are supported by the endpoint
1486
- params['cost'] = cost
1487
- return self.create_order(symbol, 'market', side, cost, None, params)
1491
+ req = {
1492
+ 'cost': cost,
1493
+ }
1494
+ return self.create_order(symbol, 'market', side, 1, None, self.extend(req, params))
1488
1495
 
1489
1496
  def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}):
1490
1497
  """
ccxt/krakenfutures.py CHANGED
@@ -299,6 +299,11 @@ class krakenfutures(Exchange, ImplicitAPI):
299
299
  },
300
300
  'hedged': False,
301
301
  'trailing': False,
302
+ 'leverage': False,
303
+ 'marketBuyByCost': False,
304
+ 'marketBuyRequiresPrice': False,
305
+ 'selfTradePrevention': False,
306
+ 'iceberg': False,
302
307
  },
303
308
  'createOrders': {
304
309
  'max': 100,
@@ -320,7 +325,7 @@ class krakenfutures(Exchange, ImplicitAPI):
320
325
  'fetchClosedOrders': {
321
326
  'marginMode': False,
322
327
  'limit': None,
323
- 'daysBackClosed': None,
328
+ 'daysBack': None,
324
329
  'daysBackCanceled': None,
325
330
  'untilDays': None,
326
331
  'trigger': False,
ccxt/kucoin.py CHANGED
@@ -1025,11 +1025,11 @@ class kucoin(Exchange, ImplicitAPI):
1025
1025
  },
1026
1026
  'hedged': False,
1027
1027
  'trailing': False,
1028
- # exchange-supported features
1029
- # 'iceberg': True,
1030
- # 'selfTradePrevention': True,
1031
- # 'twap': False,
1032
- # 'oco': False,
1028
+ 'leverage': False,
1029
+ 'marketBuyByCost': True,
1030
+ 'marketBuyRequiresPrice': False,
1031
+ 'selfTradePrevention': True, # todo implement
1032
+ 'iceberg': True, # todo implement
1033
1033
  },
1034
1034
  'createOrders': {
1035
1035
  'max': 5,
@@ -1055,7 +1055,7 @@ class kucoin(Exchange, ImplicitAPI):
1055
1055
  'fetchClosedOrders': {
1056
1056
  'marginMode': True,
1057
1057
  'limit': 500,
1058
- 'daysBackClosed': None,
1058
+ 'daysBack': None,
1059
1059
  'daysBackCanceled': None,
1060
1060
  'untilDays': 7,
1061
1061
  'trigger': True,
@@ -2285,8 +2285,10 @@ class kucoin(Exchange, ImplicitAPI):
2285
2285
  :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
2286
2286
  """
2287
2287
  self.load_markets()
2288
- params['cost'] = cost
2289
- return self.create_order(symbol, 'market', side, cost, None, params)
2288
+ req = {
2289
+ 'cost': cost,
2290
+ }
2291
+ return self.create_order(symbol, 'market', side, 0, None, self.extend(req, params))
2290
2292
 
2291
2293
  def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}):
2292
2294
  """
ccxt/kucoinfutures.py CHANGED
@@ -386,9 +386,8 @@ class kucoinfutures(kucoin, ImplicitAPI):
386
386
  'stopLossPrice': True,
387
387
  'takeProfitPrice': True,
388
388
  'attachedStopLossTakeProfit': {
389
- 'triggerPrice': None,
390
389
  'triggerPriceType': None,
391
- 'limitPrice': True,
390
+ 'price': True,
392
391
  },
393
392
  'timeInForce': {
394
393
  'IOC': True,
@@ -398,11 +397,11 @@ class kucoinfutures(kucoin, ImplicitAPI):
398
397
  },
399
398
  'hedged': False,
400
399
  'trailing': False,
401
- # exchange-supported features
402
- # 'iceberg': True,
403
- # 'selfTradePrevention': True,
404
- # 'twap': False,
405
- # 'oco': False,
400
+ 'leverage': True, # todo implement
401
+ 'marketBuyByCost': True,
402
+ 'marketBuyRequiresPrice': False,
403
+ 'selfTradePrevention': True, # todo implement
404
+ 'iceberg': True,
406
405
  },
407
406
  'createOrders': {
408
407
  'max': 20,
@@ -428,7 +427,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
428
427
  'fetchClosedOrders': {
429
428
  'marginMode': False,
430
429
  'limit': 1000,
431
- 'daysBackClosed': None,
430
+ 'daysBack': None,
432
431
  'daysBackCanceled': None,
433
432
  'untilDays': None,
434
433
  'trigger': True,
ccxt/lykke.py CHANGED
@@ -209,7 +209,7 @@ class lykke(Exchange, ImplicitAPI):
209
209
  # {
210
210
  # "payload":[
211
211
  # {
212
- # "assetId":"115a60c2-0da1-40f9-a7f2-41da723b9074",
212
+ # "assetId":"115a60c2-0da1-40f9-a7f2-41da723b9075",
213
213
  # "name":"Monaco Token",
214
214
  # "symbol":"MCO",
215
215
  # "accuracy":6,
ccxt/mexc.py CHANGED
@@ -709,10 +709,12 @@ class mexc(Exchange, ImplicitAPI):
709
709
  'PO': True,
710
710
  'GTD': False,
711
711
  },
712
- 'hedged': False,
713
- # exchange-supported features
714
- 'selfTradePrevention': False,
712
+ 'hedged': True, # todo implement
715
713
  'trailing': False,
714
+ 'leverage': True, # todo implement
715
+ 'marketBuyByCost': True,
716
+ 'marketBuyRequiresPrice': False,
717
+ 'selfTradePrevention': False,
716
718
  'iceberg': False,
717
719
  },
718
720
  'createOrders': {
@@ -746,7 +748,7 @@ class mexc(Exchange, ImplicitAPI):
746
748
  'fetchClosedOrders': {
747
749
  'marginMode': True,
748
750
  'limit': 1000,
749
- 'daysBackClosed': 7,
751
+ 'daysBack': 7,
750
752
  'daysBackCanceled': 7,
751
753
  'untilDays': 7,
752
754
  'trigger': False,
@@ -768,14 +770,14 @@ class mexc(Exchange, ImplicitAPI):
768
770
  'mark': True,
769
771
  'index': True,
770
772
  },
771
- 'triggerDirection': True,
773
+ 'triggerDirection': True, # todo
772
774
  'stopLossPrice': False, # todo
773
- 'takeProfitPrice': False,
775
+ 'takeProfitPrice': False, # todo
774
776
  'hedged': True,
777
+ 'leverage': True, # todo
778
+ 'marketBuyByCost': False,
775
779
  },
776
- 'createOrders': {
777
- 'max': 50,
778
- },
780
+ 'createOrders': None, # todo: needs implementation https://mexcdevelop.github.io/apidocs/contract_v1_en/#order-under-maintenance:~:text=Order%20the%20contract%20in%20batch
779
781
  'fetchMyTrades': {
780
782
  'marginMode': False,
781
783
  'limit': 100,
@@ -802,7 +804,7 @@ class mexc(Exchange, ImplicitAPI):
802
804
  'fetchClosedOrders': {
803
805
  'marginMode': False,
804
806
  'limit': 100,
805
- 'daysBackClosed': 90,
807
+ 'daysBack': 90,
806
808
  'daysBackCanceled': None,
807
809
  'untilDays': 90,
808
810
  'trigger': True,
@@ -2186,8 +2188,10 @@ class mexc(Exchange, ImplicitAPI):
2186
2188
  market = self.market(symbol)
2187
2189
  if not market['spot']:
2188
2190
  raise NotSupported(self.id + ' createMarketBuyOrderWithCost() supports spot orders only')
2189
- params['cost'] = cost
2190
- return self.create_order(symbol, 'market', 'buy', 0, None, params)
2191
+ req = {
2192
+ 'cost': cost,
2193
+ }
2194
+ return self.create_order(symbol, 'market', 'buy', 0, None, self.extend(req, params))
2191
2195
 
2192
2196
  def create_market_sell_order_with_cost(self, symbol: str, cost: float, params={}):
2193
2197
  """
@@ -2204,8 +2208,10 @@ class mexc(Exchange, ImplicitAPI):
2204
2208
  market = self.market(symbol)
2205
2209
  if not market['spot']:
2206
2210
  raise NotSupported(self.id + ' createMarketBuyOrderWithCost() supports spot orders only')
2207
- params['cost'] = cost
2208
- return self.create_order(symbol, 'market', 'sell', 0, None, params)
2211
+ req = {
2212
+ 'cost': cost,
2213
+ }
2214
+ return self.create_order(symbol, 'market', 'sell', 0, None, self.extend(req, params))
2209
2215
 
2210
2216
  def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
2211
2217
  """
ccxt/myokx.py CHANGED
@@ -32,4 +32,12 @@ class myokx(okx, ImplicitAPI):
32
32
  'rest': 'https://{hostname}',
33
33
  },
34
34
  },
35
+ 'has': {
36
+ 'CORS': None,
37
+ 'spot': True,
38
+ 'margin': None,
39
+ 'swap': False,
40
+ 'future': False,
41
+ 'option': False,
42
+ },
35
43
  })
ccxt/ndax.py CHANGED
@@ -355,7 +355,7 @@ class ndax(Exchange, ImplicitAPI):
355
355
  #
356
356
  # {
357
357
  # "Authenticated": True,
358
- # "UserId":57765,
358
+ # "UserId":57764,
359
359
  # "SessionToken":"4a2a5857-c4e5-4fac-b09e-2c4c30b591a0"
360
360
  # }
361
361
  #
ccxt/oceanex.py CHANGED
@@ -497,7 +497,7 @@ class oceanex(Exchange, ImplicitAPI):
497
497
  # "funds":"6.0732952",
498
498
  # "market":"ethusdt",
499
499
  # "created_at":"2022-04-19T19:03:15Z",
500
- # "created_on":1650394995,
500
+ # "created_on":1650394994,
501
501
  # "side":"bid"
502
502
  # },
503
503
  # ]
ccxt/okx.py CHANGED
@@ -1206,7 +1206,6 @@ class okx(Exchange, ImplicitAPI):
1206
1206
  'brokerId': 'e847386590ce4dBC',
1207
1207
  },
1208
1208
  'features': {
1209
- # https://www.okx.com/docs-v5/en/#order-book-trading-trade-post-place-order
1210
1209
  'default': {
1211
1210
  'sandbox': True,
1212
1211
  'createOrder': {
@@ -1226,7 +1225,7 @@ class okx(Exchange, ImplicitAPI):
1226
1225
  'mark': True,
1227
1226
  'index': True,
1228
1227
  },
1229
- 'limitPrice': True,
1228
+ 'price': True,
1230
1229
  },
1231
1230
  'timeInForce': {
1232
1231
  'IOC': True,
@@ -1235,12 +1234,12 @@ class okx(Exchange, ImplicitAPI):
1235
1234
  'GTD': False,
1236
1235
  },
1237
1236
  'hedged': True,
1238
- # even though the below params not unified yet, it's useful metadata for users to know that exchange supports them
1239
- 'selfTradePrevention': True,
1240
1237
  'trailing': True,
1241
- 'twap': True,
1242
- 'iceberg': True,
1243
- 'oco': True,
1238
+ 'iceberg': True, # todo implement
1239
+ 'leverage': False,
1240
+ 'selfTradePrevention': True, # todo implement
1241
+ 'marketBuyByCost': True,
1242
+ 'marketBuyRequiresPrice': False,
1244
1243
  },
1245
1244
  'createOrders': {
1246
1245
  'max': 20,
@@ -1266,7 +1265,7 @@ class okx(Exchange, ImplicitAPI):
1266
1265
  'fetchClosedOrders': {
1267
1266
  'marginMode': False,
1268
1267
  'limit': 100,
1269
- 'daysBackClosed': 90, # 3 months
1268
+ 'daysBack': 90, # 3 months
1270
1269
  'daysBackCanceled': 1 / 12, # 2 hour
1271
1270
  'untilDays': None,
1272
1271
  'trigger': True,
@@ -1636,7 +1635,7 @@ class okx(Exchange, ImplicitAPI):
1636
1635
  'contractSize': self.safe_number(market, 'ctVal') if contract else None,
1637
1636
  'expiry': expiry,
1638
1637
  'expiryDatetime': self.iso8601(expiry),
1639
- 'strike': strikePrice,
1638
+ 'strike': self.parse_number(strikePrice),
1640
1639
  'optionType': optionType,
1641
1640
  'created': self.safe_integer(market, 'listTime'),
1642
1641
  'precision': {
@@ -1835,7 +1834,7 @@ class okx(Exchange, ImplicitAPI):
1835
1834
  }
1836
1835
  firstChain = self.safe_dict(chains, 0, {})
1837
1836
  result[code] = {
1838
- 'info': None,
1837
+ 'info': chains,
1839
1838
  'code': code,
1840
1839
  'id': currencyId,
1841
1840
  'name': self.safe_string(firstChain, 'name'),
ccxt/onetrading.py CHANGED
@@ -865,7 +865,8 @@ class onetrading(Exchange, ImplicitAPI):
865
865
  # {"instrument_code":"BTC_EUR","granularity":{"unit":"HOURS","period":1},"high":"9135.7","low":"9002.59","open":"9055.45","close":"9133.98","total_amount":"26.21919","volume":"238278.8724959","time":"2020-05-09T00:59:59.999Z","last_sequence":461521},
866
866
  # ]
867
867
  #
868
- return self.parse_ohlcvs(response, market, timeframe, since, limit)
868
+ ohlcv = self.safe_list(response, 'candlesticks')
869
+ return self.parse_ohlcvs(ohlcv, market, timeframe, since, limit)
869
870
 
870
871
  def parse_trade(self, trade: dict, market: Market = None) -> Trade:
871
872
  #
ccxt/pro/__init__.py CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # ----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.4.43'
7
+ __version__ = '4.4.45'
8
8
 
9
9
  # ----------------------------------------------------------------------------
10
10
 
ccxt/pro/binance.py CHANGED
@@ -3975,7 +3975,8 @@ class binance(ccxt.async_support.binance):
3975
3975
  if not rejected:
3976
3976
  client.reject(message, id)
3977
3977
  # reset connection if 5xx error
3978
- if self.safe_string(code, 0) == '5':
3978
+ codeString = self.safe_string(error, 'code')
3979
+ if (codeString is not None) and (codeString[0] == '5'):
3979
3980
  client.reset(message)
3980
3981
 
3981
3982
  def handle_message(self, client: Client, message):
ccxt/pro/bitcoincom.py CHANGED
@@ -22,7 +22,10 @@ class bitcoincom(hitbtc):
22
22
  'urls': {
23
23
  'logo': 'https://user-images.githubusercontent.com/1294454/97296144-514fa300-1861-11eb-952b-3d55d492200b.jpg',
24
24
  'api': {
25
- 'ws': 'wss://api.fmfw.io/api/2/ws',
25
+ 'ws': {
26
+ 'public': 'wss://api.fmfw.io/api/3/ws/public',
27
+ 'private': 'wss://api.fmfw.io/api/3/ws/trading',
28
+ },
26
29
  },
27
30
  },
28
31
  'fees': {
ccxt/pro/bitopro.py CHANGED
@@ -77,7 +77,7 @@ class bitopro(ccxt.async_support.bitopro):
77
77
  if limit is None:
78
78
  endPart = market['id']
79
79
  else:
80
- endPart = market['id'] + ':' + limit
80
+ endPart = market['id'] + ':' + self.number_to_string(limit)
81
81
  orderbook = await self.watch_public('order-books', messageHash, endPart)
82
82
  return orderbook.limit()
83
83
 
ccxt/pro/myokx.py CHANGED
@@ -20,4 +20,9 @@ class myokx(okx):
20
20
  'ws': 'wss://wseeapap.okx.com:8443/ws/v5',
21
21
  },
22
22
  },
23
+ 'has': {
24
+ 'swap': False,
25
+ 'future': False,
26
+ 'option': False,
27
+ },
23
28
  })