ccxt 4.1.95__py2.py3-none-any.whl → 4.1.97__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.

Potentially problematic release.


This version of ccxt might be problematic. Click here for more details.

Files changed (163) hide show
  1. ccxt/__init__.py +2 -1
  2. ccxt/abstract/bingx.py +2 -0
  3. ccxt/abstract/kucoin.py +12 -0
  4. ccxt/abstract/kucoinfutures.py +12 -1
  5. ccxt/ace.py +1 -1
  6. ccxt/ascendex.py +1 -1
  7. ccxt/async_support/__init__.py +2 -1
  8. ccxt/async_support/ace.py +1 -1
  9. ccxt/async_support/ascendex.py +1 -1
  10. ccxt/async_support/base/exchange.py +29 -23
  11. ccxt/async_support/bigone.py +2 -2
  12. ccxt/async_support/binance.py +116 -114
  13. ccxt/async_support/bingx.py +46 -7
  14. ccxt/async_support/bit2c.py +2 -3
  15. ccxt/async_support/bitfinex.py +1 -1
  16. ccxt/async_support/bitfinex2.py +3 -4
  17. ccxt/async_support/bitflyer.py +2 -2
  18. ccxt/async_support/bitmart.py +2 -2
  19. ccxt/async_support/bitmex.py +2 -2
  20. ccxt/async_support/bitopro.py +1 -1
  21. ccxt/async_support/bitpanda.py +1 -1
  22. ccxt/async_support/bitvavo.py +1 -1
  23. ccxt/async_support/blockchaincom.py +1 -1
  24. ccxt/async_support/btcalpha.py +2 -2
  25. ccxt/async_support/btcbox.py +3 -4
  26. ccxt/async_support/btcmarkets.py +2 -2
  27. ccxt/async_support/btcturk.py +1 -1
  28. ccxt/async_support/bybit.py +2 -2
  29. ccxt/async_support/cex.py +1 -1
  30. ccxt/async_support/coinbase.py +11 -5
  31. ccxt/async_support/coinbasepro.py +2 -2
  32. ccxt/async_support/coinex.py +1 -1
  33. ccxt/async_support/coinlist.py +1 -1
  34. ccxt/async_support/cryptocom.py +2 -1
  35. ccxt/async_support/delta.py +24 -1
  36. ccxt/async_support/deribit.py +1 -1
  37. ccxt/async_support/digifinex.py +1 -1
  38. ccxt/async_support/gate.py +2 -2
  39. ccxt/async_support/hitbtc.py +1 -1
  40. ccxt/async_support/hollaex.py +2 -2
  41. ccxt/async_support/htx.py +1 -1
  42. ccxt/async_support/huobijp.py +2 -2
  43. ccxt/async_support/idex.py +1 -1
  44. ccxt/async_support/independentreserve.py +1 -1
  45. ccxt/async_support/kraken.py +45 -41
  46. ccxt/async_support/krakenfutures.py +46 -23
  47. ccxt/async_support/kucoin.py +68 -5
  48. ccxt/async_support/kucoinfutures.py +2 -2
  49. ccxt/async_support/kuna.py +1 -1
  50. ccxt/async_support/latoken.py +1 -1
  51. ccxt/async_support/luno.py +2 -2
  52. ccxt/async_support/lykke.py +1 -1
  53. ccxt/async_support/mexc.py +2 -2
  54. ccxt/async_support/ndax.py +1 -1
  55. ccxt/async_support/novadax.py +2 -2
  56. ccxt/async_support/oceanex.py +1 -1
  57. ccxt/async_support/okcoin.py +1 -1
  58. ccxt/async_support/okx.py +1 -1
  59. ccxt/async_support/poloniexfutures.py +1 -1
  60. ccxt/async_support/probit.py +1 -1
  61. ccxt/async_support/timex.py +1 -1
  62. ccxt/async_support/tokocrypto.py +1 -1
  63. ccxt/async_support/upbit.py +1 -1
  64. ccxt/async_support/wavesexchange.py +1 -1
  65. ccxt/async_support/whitebit.py +1 -1
  66. ccxt/async_support/woo.py +1 -1
  67. ccxt/async_support/zaif.py +1 -1
  68. ccxt/base/errors.py +6 -0
  69. ccxt/base/exchange.py +10 -7
  70. ccxt/bigone.py +2 -2
  71. ccxt/binance.py +116 -114
  72. ccxt/bingx.py +46 -7
  73. ccxt/bit2c.py +2 -3
  74. ccxt/bitfinex.py +1 -1
  75. ccxt/bitfinex2.py +3 -4
  76. ccxt/bitflyer.py +2 -2
  77. ccxt/bitmart.py +2 -2
  78. ccxt/bitmex.py +2 -2
  79. ccxt/bitopro.py +1 -1
  80. ccxt/bitpanda.py +1 -1
  81. ccxt/bitvavo.py +1 -1
  82. ccxt/blockchaincom.py +1 -1
  83. ccxt/btcalpha.py +2 -2
  84. ccxt/btcbox.py +3 -4
  85. ccxt/btcmarkets.py +2 -2
  86. ccxt/btcturk.py +1 -1
  87. ccxt/bybit.py +2 -2
  88. ccxt/cex.py +1 -1
  89. ccxt/coinbase.py +11 -5
  90. ccxt/coinbasepro.py +2 -2
  91. ccxt/coinex.py +1 -1
  92. ccxt/coinlist.py +1 -1
  93. ccxt/cryptocom.py +2 -1
  94. ccxt/delta.py +24 -1
  95. ccxt/deribit.py +1 -1
  96. ccxt/digifinex.py +1 -1
  97. ccxt/gate.py +2 -2
  98. ccxt/hitbtc.py +1 -1
  99. ccxt/hollaex.py +2 -2
  100. ccxt/htx.py +1 -1
  101. ccxt/huobijp.py +2 -2
  102. ccxt/idex.py +1 -1
  103. ccxt/independentreserve.py +1 -1
  104. ccxt/kraken.py +45 -41
  105. ccxt/krakenfutures.py +46 -23
  106. ccxt/kucoin.py +68 -5
  107. ccxt/kucoinfutures.py +2 -2
  108. ccxt/kuna.py +1 -1
  109. ccxt/latoken.py +1 -1
  110. ccxt/luno.py +2 -2
  111. ccxt/lykke.py +1 -1
  112. ccxt/mexc.py +2 -2
  113. ccxt/ndax.py +1 -1
  114. ccxt/novadax.py +2 -2
  115. ccxt/oceanex.py +1 -1
  116. ccxt/okcoin.py +1 -1
  117. ccxt/okx.py +1 -1
  118. ccxt/poloniexfutures.py +1 -1
  119. ccxt/pro/__init__.py +1 -1
  120. ccxt/pro/alpaca.py +1 -1
  121. ccxt/pro/ascendex.py +1 -1
  122. ccxt/pro/binance.py +5 -6
  123. ccxt/pro/bingx.py +6 -3
  124. ccxt/pro/bitfinex.py +3 -4
  125. ccxt/pro/bitfinex2.py +1 -1
  126. ccxt/pro/bitmex.py +1 -1
  127. ccxt/pro/bitpanda.py +1 -1
  128. ccxt/pro/blockchaincom.py +1 -1
  129. ccxt/pro/bybit.py +2 -2
  130. ccxt/pro/cex.py +1 -1
  131. ccxt/pro/coinbase.py +1 -1
  132. ccxt/pro/coinbasepro.py +1 -1
  133. ccxt/pro/cryptocom.py +1 -1
  134. ccxt/pro/deribit.py +1 -1
  135. ccxt/pro/gate.py +3 -3
  136. ccxt/pro/gemini.py +1 -1
  137. ccxt/pro/hitbtc.py +1 -1
  138. ccxt/pro/hollaex.py +1 -1
  139. ccxt/pro/htx.py +1 -1
  140. ccxt/pro/idex.py +1 -1
  141. ccxt/pro/kraken.py +3 -4
  142. ccxt/pro/krakenfutures.py +1 -1
  143. ccxt/pro/kucoinfutures.py +1 -1
  144. ccxt/pro/mexc.py +1 -1
  145. ccxt/pro/okcoin.py +1 -1
  146. ccxt/pro/okx.py +4 -4
  147. ccxt/pro/phemex.py +1 -1
  148. ccxt/pro/poloniexfutures.py +1 -1
  149. ccxt/pro/woo.py +2 -3
  150. ccxt/probit.py +1 -1
  151. ccxt/test/test_async.py +3 -1
  152. ccxt/test/test_sync.py +3 -1
  153. ccxt/timex.py +1 -1
  154. ccxt/tokocrypto.py +1 -1
  155. ccxt/upbit.py +1 -1
  156. ccxt/wavesexchange.py +1 -1
  157. ccxt/whitebit.py +1 -1
  158. ccxt/woo.py +1 -1
  159. ccxt/zaif.py +1 -1
  160. {ccxt-4.1.95.dist-info → ccxt-4.1.97.dist-info}/METADATA +4 -4
  161. {ccxt-4.1.95.dist-info → ccxt-4.1.97.dist-info}/RECORD +163 -163
  162. {ccxt-4.1.95.dist-info → ccxt-4.1.97.dist-info}/WHEEL +0 -0
  163. {ccxt-4.1.95.dist-info → ccxt-4.1.97.dist-info}/top_level.txt +0 -0
@@ -815,18 +815,12 @@ class krakenfutures(Exchange, ImplicitAPI):
815
815
  })
816
816
 
817
817
  def create_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
818
+ market = self.market(symbol)
818
819
  type = self.safe_string(params, 'orderType', type)
819
820
  timeInForce = self.safe_string(params, 'timeInForce')
820
- stopPrice = self.safe_string(params, 'stopPrice')
821
821
  postOnly = False
822
822
  postOnly, params = self.handle_post_only(type == 'market', type == 'post', params)
823
- clientOrderId = self.safe_string_2(params, 'clientOrderId', 'cliOrdId')
824
- params = self.omit(params, ['clientOrderId', 'cliOrdId'])
825
- if (type == 'stp' or type == 'take_profit') and stopPrice is None:
826
- raise ArgumentsRequired(self.id + ' createOrder requires params.stopPrice when type is ' + type)
827
- if stopPrice is not None and type != 'take_profit':
828
- type = 'stp'
829
- elif postOnly:
823
+ if postOnly:
830
824
  type = 'post'
831
825
  elif timeInForce == 'ioc':
832
826
  type = 'ioc'
@@ -835,33 +829,62 @@ class krakenfutures(Exchange, ImplicitAPI):
835
829
  elif type == 'market':
836
830
  type = 'mkt'
837
831
  request = {
838
- 'orderType': type,
839
- 'symbol': self.market_id(symbol),
832
+ 'symbol': market['id'],
840
833
  'side': side,
841
834
  'size': amount,
842
835
  }
843
- if price is not None:
844
- request['limitPrice'] = price
836
+ clientOrderId = self.safe_string_2(params, 'clientOrderId', 'cliOrdId')
845
837
  if clientOrderId is not None:
846
838
  request['cliOrdId'] = clientOrderId
839
+ triggerPrice = self.safe_string_2(params, 'triggerPrice', 'stopPrice')
840
+ isTriggerOrder = triggerPrice is not None
841
+ stopLossTriggerPrice = self.safe_string(params, 'stopLossPrice')
842
+ takeProfitTriggerPrice = self.safe_string(params, 'takeProfitPrice')
843
+ isStopLossTriggerOrder = stopLossTriggerPrice is not None
844
+ isTakeProfitTriggerOrder = takeProfitTriggerPrice is not None
845
+ isStopLossOrTakeProfitTrigger = isStopLossTriggerOrder or isTakeProfitTriggerOrder
846
+ triggerSignal = self.safe_string(params, 'triggerSignal', 'last')
847
+ reduceOnly = self.safe_value(params, 'reduceOnly')
848
+ if isStopLossOrTakeProfitTrigger or isTriggerOrder:
849
+ request['triggerSignal'] = triggerSignal
850
+ if isTriggerOrder:
851
+ type = 'stp'
852
+ request['stopPrice'] = self.price_to_precision(symbol, triggerPrice)
853
+ elif isStopLossOrTakeProfitTrigger:
854
+ reduceOnly = True
855
+ if isStopLossTriggerOrder:
856
+ type = 'stp'
857
+ request['stopPrice'] = self.price_to_precision(symbol, stopLossTriggerPrice)
858
+ elif isTakeProfitTriggerOrder:
859
+ type = 'take_profit'
860
+ request['stopPrice'] = self.price_to_precision(symbol, takeProfitTriggerPrice)
861
+ if reduceOnly:
862
+ request['reduceOnly'] = True
863
+ request['orderType'] = type
864
+ if price is not None:
865
+ request['limitPrice'] = price
866
+ params = self.omit(params, ['clientOrderId', 'timeInForce', 'triggerPrice', 'stopLossPrice', 'takeProfitPrice'])
847
867
  return self.extend(request, params)
848
868
 
849
869
  async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
850
870
  """
851
871
  Create an order on the exchange
852
- :param str symbol: market symbol
853
- :param str type: One of 'limit', 'market', 'take_profit'
854
- :param str side: buy or sell
855
- :param int amount: Contract quantity
856
- :param float [price]: Limit order price
857
- :param float [params.stopPrice]: The stop price associated with a stop or take profit order, Required if orderType is stp or take_profit, Must not have more than 2 decimal places, Note that for stop orders, limitPrice denotes the worst price at which the stop or take_profit order can get filled at. If no limitPrice is provided the stop or take_profit order will trigger a market order,
858
- :param bool [params.reduceOnly]: Set if you wish the order to only reduce an existing position, Any order which increases an existing position will be rejected, Default False,
859
- :param bool [params.postOnly]: Set if you wish to make a postOnly order, Default False
860
- :param str [params.triggerSignal]: If placing a stp or take_profit, the signal used for trigger, One of: 'mark', 'index', 'last', last is market price
861
- :param str [params.cliOrdId]: UUID The order identity that is specified from the user, It must be globally unique
872
+ :see: https://docs.futures.kraken.com/#http-api-trading-v3-api-order-management-send-order
873
+ :param str symbol: unified market symbol
874
+ :param str type: 'limit' or 'market'
875
+ :param str side: 'buy' or 'sell'
876
+ :param float amount: number of contracts
877
+ :param float [price]: limit order price
878
+ :param bool [params.reduceOnly]: set if you wish the order to only reduce an existing position, any order which increases an existing position will be rejected, default is False
879
+ :param bool [params.postOnly]: set if you wish to make a postOnly order, default is False
862
880
  :param str [params.clientOrderId]: UUID The order identity that is specified from the user, It must be globally unique
881
+ :param float [params.triggerPrice]: the price that a stop order is triggered at
882
+ :param float [params.stopLossPrice]: the price that a stop loss order is triggered at
883
+ :param float [params.takeProfitPrice]: the price that a take profit order is triggered at
884
+ :param str [params.triggerSignal]: for triggerPrice, stopLossPrice and takeProfitPrice orders, the trigger price type, 'last', 'mark' or 'index', default is 'last'
863
885
  """
864
886
  await self.load_markets()
887
+ market = self.market(symbol)
865
888
  orderRequest = self.create_order_request(symbol, type, side, amount, price, params)
866
889
  response = await self.privatePostSendorder(orderRequest)
867
890
  #
@@ -897,7 +920,7 @@ class krakenfutures(Exchange, ImplicitAPI):
897
920
  sendStatus = self.safe_value(response, 'sendStatus')
898
921
  status = self.safe_string(sendStatus, 'status')
899
922
  self.verify_order_action_success(status, 'createOrder', ['filled'])
900
- return self.parse_order(sendStatus)
923
+ return self.parse_order(sendStatus, market)
901
924
 
902
925
  async def create_orders(self, orders: List[OrderRequest], params={}):
903
926
  """
@@ -57,6 +57,9 @@ class kucoin(Exchange, ImplicitAPI):
57
57
  'closeAllPositions': False,
58
58
  'closePosition': False,
59
59
  'createDepositAddress': True,
60
+ 'createMarketBuyOrderWithCost': True,
61
+ 'createMarketOrderWithCost': True,
62
+ 'createMarketSellOrderWithCost': True,
60
63
  'createOrder': True,
61
64
  'createOrders': True,
62
65
  'createPostOnlyOrder': True,
@@ -224,6 +227,10 @@ class kucoin(Exchange, ImplicitAPI):
224
227
  'stop-order': 8, # 8SW
225
228
  'stop-order/{orderId}': 3, # 3SW
226
229
  'stop-order/queryOrderByClientOid': 3, # 3SW
230
+ 'oco/order/{orderId}': 2, # 2SW
231
+ 'oco/order/details/{orderId}': 2, # 2SW
232
+ 'oco/client-order/{clientOid}': 2, # 2SW
233
+ 'oco/orders': 2, # 2SW
227
234
  # margin trading
228
235
  'hf/margin/orders/active': 4, # 4SW
229
236
  'hf/margin/orders/done': 10, # 10SW
@@ -231,7 +238,8 @@ class kucoin(Exchange, ImplicitAPI):
231
238
  'hf/margin/orders/client-order/{clientOid}': 5, # 5SW
232
239
  'hf/margin/fills': 5, # 5SW
233
240
  'etf/info': 25, # 25SW
234
- 'risk/limit/strategy': 20, # 20SW
241
+ 'margin/currencies': 20, # 20SW
242
+ 'risk/limit/strategy': 20, # 20SW(Deprecate)
235
243
  'isolated/symbols': 20, # 20SW
236
244
  'isolated/account/{symbol}': 50, # 50SW
237
245
  'margin/borrow': 15, # 15SW
@@ -266,6 +274,7 @@ class kucoin(Exchange, ImplicitAPI):
266
274
  'orders/test': 2, # 2SW
267
275
  'orders/multi': 3, # 3SW
268
276
  'stop-order': 2, # 2SW
277
+ 'oco/order': 2, # 2SW
269
278
  # margin trading
270
279
  'hf/margin/order': 5, # 5SW
271
280
  'hf/margin/order/test': 5, # 5SW
@@ -291,12 +300,16 @@ class kucoin(Exchange, ImplicitAPI):
291
300
  'hf/orders/sync/client-order/{clientOid}': 1, # 1SW
292
301
  'hf/orders/cancel/{orderId}': 2, # 2SW
293
302
  'hf/orders': 2, # 2SW
303
+ 'hf/orders/cancelAll': 30, # 30SW
294
304
  'orders/{orderId}': 3, # 3SW
295
305
  'order/client-order/{clientOid}': 5, # 5SW
296
306
  'orders': 20, # 20SW
297
307
  'stop-order/{orderId}': 3, # 3SW
298
308
  'stop-order/cancelOrderByClientOid': 5, # 5SW
299
309
  'stop-order/cancel': 3, # 3SW
310
+ 'oco/order/{orderId}': 3, # 3SW
311
+ 'oco/client-order/{clientOid}': 3, # 3SW
312
+ 'oco/orders': 3, # 3SW
300
313
  # margin trading
301
314
  'hf/margin/orders/{orderId}': 5, # 5SW
302
315
  'hf/margin/orders/client-order/{clientOid}': 5, # 5SW
@@ -317,6 +330,7 @@ class kucoin(Exchange, ImplicitAPI):
317
330
  'index/query': 3, # 2PW
318
331
  'mark-price/{symbol}/current': 4.5, # 3PW
319
332
  'premium/query': 4.5, # 3PW
333
+ 'trade-statistics': 4.5, # 3PW
320
334
  'funding-rate/{symbol}/current': 3, # 2PW
321
335
  'timestamp': 3, # 2PW
322
336
  'status': 6, # 4PW
@@ -365,6 +379,7 @@ class kucoin(Exchange, ImplicitAPI):
365
379
  },
366
380
  'delete': {
367
381
  'orders/{orderId}': 1.5, # 1FW
382
+ 'orders/client-order/{clientOid}': 1.5, # 1FW
368
383
  'orders': 45, # 30FW
369
384
  'stopOrders': 22.5, # 15FW
370
385
  },
@@ -552,6 +567,10 @@ class kucoin(Exchange, ImplicitAPI):
552
567
  'market/orderbook/level2': 'v3',
553
568
  'market/orderbook/level3': 'v3',
554
569
  'market/orderbook/level{level}': 'v3',
570
+ 'oco/order/{orderId}': 'v3',
571
+ 'oco/order/details/{orderId}': 'v3',
572
+ 'oco/client-order/{clientOid}': 'v3',
573
+ 'oco/orders': 'v3',
555
574
  # margin trading
556
575
  'hf/margin/orders/active': 'v3',
557
576
  'hf/margin/orders/done': 'v3',
@@ -559,6 +578,7 @@ class kucoin(Exchange, ImplicitAPI):
559
578
  'hf/margin/orders/client-order/{clientOid}': 'v3',
560
579
  'hf/margin/fills': 'v3',
561
580
  'etf/info': 'v3',
581
+ 'margin/currencies': 'v3',
562
582
  'margin/borrow': 'v3',
563
583
  'margin/repay': 'v3',
564
584
  'project/list': 'v3',
@@ -575,6 +595,7 @@ class kucoin(Exchange, ImplicitAPI):
575
595
  'accounts/inner-transfer': 'v2',
576
596
  'transfer-out': 'v3',
577
597
  # spot trading
598
+ 'oco/order': 'v3',
578
599
  # margin trading
579
600
  'hf/margin/order': 'v3',
580
601
  'hf/margin/order/test': 'v3',
@@ -591,6 +612,9 @@ class kucoin(Exchange, ImplicitAPI):
591
612
  'hf/margin/orders/{orderId}': 'v3',
592
613
  'hf/margin/orders/client-order/{clientOid}': 'v3',
593
614
  'hf/margin/orders': 'v3',
615
+ 'oco/order/{orderId}': 'v3',
616
+ 'oco/client-order/{clientOid}': 'v3',
617
+ 'oco/orders': 'v3',
594
618
  # margin trading
595
619
  },
596
620
  },
@@ -1874,6 +1898,44 @@ class kucoin(Exchange, ImplicitAPI):
1874
1898
  data = self.safe_value(response, 'data', {})
1875
1899
  return self.parse_order(data, market)
1876
1900
 
1901
+ async def create_market_order_with_cost(self, symbol: str, side: OrderSide, cost, params={}):
1902
+ """
1903
+ create a market order by providing the symbol, side and cost
1904
+ :see: https://www.kucoin.com/docs/rest/spot-trading/orders/place-order
1905
+ :param str symbol: unified symbol of the market to create an order in
1906
+ :param str side: 'buy' or 'sell'
1907
+ :param float cost: how much you want to trade in units of the quote currency
1908
+ :param dict [params]: extra parameters specific to the exchange API endpoint
1909
+ :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
1910
+ """
1911
+ await self.load_markets()
1912
+ params['cost'] = cost
1913
+ return await self.create_order(symbol, 'market', side, cost, None, params)
1914
+
1915
+ async def create_market_buy_order_with_cost(self, symbol: str, cost, params={}):
1916
+ """
1917
+ create a market buy order by providing the symbol and cost
1918
+ :see: https://www.kucoin.com/docs/rest/spot-trading/orders/place-order
1919
+ :param str symbol: unified symbol of the market to create an order in
1920
+ :param float cost: how much you want to trade in units of the quote currency
1921
+ :param dict [params]: extra parameters specific to the exchange API endpoint
1922
+ :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
1923
+ """
1924
+ await self.load_markets()
1925
+ return await self.create_market_order_with_cost(symbol, 'buy', cost, params)
1926
+
1927
+ async def create_market_sell_order_with_cost(self, symbol: str, cost, params={}):
1928
+ """
1929
+ create a market sell order by providing the symbol and cost
1930
+ :see: https://www.kucoin.com/docs/rest/spot-trading/orders/place-order
1931
+ :param str symbol: unified symbol of the market to create an order in
1932
+ :param float cost: how much you want to trade in units of the quote currency
1933
+ :param dict [params]: extra parameters specific to the exchange API endpoint
1934
+ :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
1935
+ """
1936
+ await self.load_markets()
1937
+ return await self.create_market_order_with_cost(symbol, 'sell', cost, params)
1938
+
1877
1939
  async def create_orders(self, orders: List[OrderRequest], params={}):
1878
1940
  """
1879
1941
  create a list of trade orders
@@ -2125,8 +2187,9 @@ class kucoin(Exchange, ImplicitAPI):
2125
2187
  response = await self.privateDeleteStopOrderCancel(self.extend(request, query))
2126
2188
  elif hf:
2127
2189
  if symbol is None:
2128
- raise ArgumentsRequired(self.id + ' cancelAllOrders() requires a symbol parameter for hf orders')
2129
- response = await self.privateDeleteHfOrders(self.extend(request, query))
2190
+ response = await self.privateDeleteHfOrdersCancelAll(self.extend(request, query))
2191
+ else:
2192
+ response = await self.privateDeleteHfOrders(self.extend(request, query))
2130
2193
  else:
2131
2194
  response = await self.privateDeleteOrders(self.extend(request, query))
2132
2195
  return response
@@ -2245,7 +2308,7 @@ class kucoin(Exchange, ImplicitAPI):
2245
2308
  :see: https://docs.kucoin.com/spot-hf/#obtain-list-of-filled-hf-orders
2246
2309
  :param str symbol: unified market symbol of the market orders were made in
2247
2310
  :param int [since]: the earliest time in ms to fetch orders for
2248
- :param int [limit]: the maximum number of orde structures to retrieve
2311
+ :param int [limit]: the maximum number of order structures to retrieve
2249
2312
  :param dict [params]: extra parameters specific to the exchange API endpoint
2250
2313
  :param int [params.till]: end time in ms
2251
2314
  :param str [params.side]: buy or sell
@@ -2347,7 +2410,7 @@ class kucoin(Exchange, ImplicitAPI):
2347
2410
  response = await self.privateGetHfOrdersOrderId(self.extend(request, params))
2348
2411
  else:
2349
2412
  response = await self.privateGetOrdersOrderId(self.extend(request, params))
2350
- responseData = self.safe_value(response, 'data')
2413
+ responseData = self.safe_value(response, 'data', {})
2351
2414
  if isinstance(responseData, list):
2352
2415
  responseData = self.safe_value(responseData, 0)
2353
2416
  return self.parse_order(responseData, market)
@@ -1497,7 +1497,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
1497
1497
  :see: https://docs.kucoin.com/futures/#get-order-list
1498
1498
  :param str symbol: unified market symbol of the market orders were made in
1499
1499
  :param int [since]: the earliest time in ms to fetch orders for
1500
- :param int [limit]: the maximum number of orde structures to retrieve
1500
+ :param int [limit]: the maximum number of order structures to retrieve
1501
1501
  :param dict [params]: extra parameters specific to the exchange API endpoint
1502
1502
  :param int [params.till]: end time in ms
1503
1503
  :param str [params.side]: buy or sell
@@ -2319,7 +2319,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
2319
2319
  :param str side: not used by kucoinfutures closePositions
2320
2320
  :param dict [params]: extra parameters specific to the okx api endpoint
2321
2321
  :param str [params.clientOrderId]: client order id of the order
2322
- :returns [dict]: `A list of position structures <https://docs.ccxt.com/#/?id=position-structure>`
2322
+ :returns dict[]: `A list of position structures <https://docs.ccxt.com/#/?id=position-structure>`
2323
2323
  """
2324
2324
  await self.load_markets()
2325
2325
  market = self.market(symbol)
@@ -1225,7 +1225,7 @@ class kuna(Exchange, ImplicitAPI):
1225
1225
  :see: https://docs.kuna.io/docs/get-private-orders-history
1226
1226
  :param str symbol: unified market symbol of the market orders were made in
1227
1227
  :param int [since]: the earliest time in ms to fetch orders for
1228
- :param int [limit]: the maximum number of orde structures to retrieve
1228
+ :param int [limit]: the maximum number of order structures to retrieve
1229
1229
  :param dict [params]: extra parameters specific to the exchange API endpoint
1230
1230
  :param int [params.until]: the latest time in ms to fetch orders for
1231
1231
  *
@@ -1094,7 +1094,7 @@ class latoken(Exchange, ImplicitAPI):
1094
1094
  :see: https://api.latoken.com/doc/v2/#tag/StopOrder/operation/getMyStopOrdersByPair # stop
1095
1095
  :param str symbol: unified market symbol of the market orders were made in
1096
1096
  :param int [since]: the earliest time in ms to fetch orders for
1097
- :param int [limit]: the maximum number of orde structures to retrieve
1097
+ :param int [limit]: the maximum number of order structures to retrieve
1098
1098
  :param dict [params]: extra parameters specific to the exchange API endpoint
1099
1099
  :param boolean [params.trigger]: True if fetching trigger orders
1100
1100
  :returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
@@ -449,7 +449,7 @@ class luno(Exchange, ImplicitAPI):
449
449
  fetches information on multiple orders made by the user
450
450
  :param str symbol: unified market symbol of the market orders were made in
451
451
  :param int [since]: the earliest time in ms to fetch orders for
452
- :param int [limit]: the maximum number of orde structures to retrieve
452
+ :param int [limit]: the maximum number of order structures to retrieve
453
453
  :param dict [params]: extra parameters specific to the exchange API endpoint
454
454
  :returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
455
455
  """
@@ -471,7 +471,7 @@ class luno(Exchange, ImplicitAPI):
471
471
  fetches information on multiple closed orders made by the user
472
472
  :param str symbol: unified market symbol of the market orders were made in
473
473
  :param int [since]: the earliest time in ms to fetch orders for
474
- :param int [limit]: the maximum number of orde structures to retrieve
474
+ :param int [limit]: the maximum number of order structures to retrieve
475
475
  :param dict [params]: extra parameters specific to the exchange API endpoint
476
476
  :returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
477
477
  """
@@ -943,7 +943,7 @@ class lykke(Exchange, ImplicitAPI):
943
943
  fetches information on multiple closed orders made by the user
944
944
  :param str symbol: unified market symbol of the market orders were made in
945
945
  :param int [since]: the earliest time in ms to fetch orders for
946
- :param int [limit]: the maximum number of orde structures to retrieve
946
+ :param int [limit]: the maximum number of order structures to retrieve
947
947
  :param dict [params]: extra parameters specific to the exchange API endpoint
948
948
  :returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
949
949
  """
@@ -2375,7 +2375,7 @@ class mexc(Exchange, ImplicitAPI):
2375
2375
  fetches information on multiple orders made by the user
2376
2376
  :param str symbol: unified market symbol of the market orders were made in
2377
2377
  :param int [since]: the earliest time in ms to fetch orders for
2378
- :param int [limit]: the maximum number of orde structures to retrieve
2378
+ :param int [limit]: the maximum number of order structures to retrieve
2379
2379
  :param dict [params]: extra parameters specific to the exchange API endpoint
2380
2380
  :param str [params.marginMode]: only 'isolated' is supported, for spot-margin trading
2381
2381
  :returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
@@ -2670,7 +2670,7 @@ class mexc(Exchange, ImplicitAPI):
2670
2670
  fetches information on multiple closed orders made by the user
2671
2671
  :param str symbol: unified market symbol of the market orders were made in
2672
2672
  :param int [since]: the earliest time in ms to fetch orders for
2673
- :param int [limit]: the maximum number of orde structures to retrieve
2673
+ :param int [limit]: the maximum number of order structures to retrieve
2674
2674
  :param dict [params]: extra parameters specific to the exchange API endpoint
2675
2675
  :returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
2676
2676
  """
@@ -1609,7 +1609,7 @@ class ndax(Exchange, ImplicitAPI):
1609
1609
  fetches information on multiple orders made by the user
1610
1610
  :param str symbol: unified market symbol of the market orders were made in
1611
1611
  :param int [since]: the earliest time in ms to fetch orders for
1612
- :param int [limit]: the maximum number of orde structures to retrieve
1612
+ :param int [limit]: the maximum number of order structures to retrieve
1613
1613
  :param dict [params]: extra parameters specific to the exchange API endpoint
1614
1614
  :returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
1615
1615
  """
@@ -872,7 +872,7 @@ class novadax(Exchange, ImplicitAPI):
872
872
  :see: https://doc.novadax.com/en-US/#get-order-history
873
873
  :param str symbol: unified market symbol of the market orders were made in
874
874
  :param int [since]: the earliest time in ms to fetch orders for
875
- :param int [limit]: the maximum number of orde structures to retrieve
875
+ :param int [limit]: the maximum number of order structures to retrieve
876
876
  :param dict [params]: extra parameters specific to the exchange API endpoint
877
877
  :returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
878
878
  """
@@ -942,7 +942,7 @@ class novadax(Exchange, ImplicitAPI):
942
942
  :see: https://doc.novadax.com/en-US/#get-order-history
943
943
  :param str symbol: unified market symbol of the market orders were made in
944
944
  :param int [since]: the earliest time in ms to fetch orders for
945
- :param int [limit]: the maximum number of orde structures to retrieve
945
+ :param int [limit]: the maximum number of order structures to retrieve
946
946
  :param dict [params]: extra parameters specific to the exchange API endpoint
947
947
  :returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
948
948
  """
@@ -667,7 +667,7 @@ class oceanex(Exchange, ImplicitAPI):
667
667
  :see: https://api.oceanex.pro/doc/v1/#order-status-get
668
668
  :param str symbol: unified market symbol of the market orders were made in
669
669
  :param int [since]: the earliest time in ms to fetch orders for
670
- :param int [limit]: the maximum number of orde structures to retrieve
670
+ :param int [limit]: the maximum number of order structures to retrieve
671
671
  :param dict [params]: extra parameters specific to the exchange API endpoint
672
672
  :returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
673
673
  """
@@ -1918,7 +1918,7 @@ class okcoin(Exchange, ImplicitAPI):
1918
1918
  fetches information on multiple closed orders made by the user
1919
1919
  :param str symbol: unified market symbol of the market orders were made in
1920
1920
  :param int [since]: the earliest time in ms to fetch orders for
1921
- :param int [limit]: the maximum number of orde structures to retrieve
1921
+ :param int [limit]: the maximum number of order structures to retrieve
1922
1922
  :param dict [params]: extra parameters specific to the exchange API endpoint
1923
1923
  :param bool [params.stop]: True if fetching trigger or conditional orders
1924
1924
  :param str [params.ordType]: "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"
ccxt/async_support/okx.py CHANGED
@@ -3676,7 +3676,7 @@ class okx(Exchange, ImplicitAPI):
3676
3676
  :see: https://www.okx.com/docs-v5/en/#order-book-trading-algo-trading-get-algo-order-history
3677
3677
  :param str symbol: unified market symbol of the market orders were made in
3678
3678
  :param int [since]: the earliest time in ms to fetch orders for
3679
- :param int [limit]: the maximum number of orde structures to retrieve
3679
+ :param int [limit]: the maximum number of order structures to retrieve
3680
3680
  :param dict [params]: extra parameters specific to the exchange API endpoint
3681
3681
  :param bool [params.stop]: True if fetching trigger or conditional orders
3682
3682
  :param str [params.ordType]: "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"
@@ -1301,7 +1301,7 @@ class poloniexfutures(Exchange, ImplicitAPI):
1301
1301
  :see: https://futures-docs.poloniex.com/#get-untriggered-stop-order-list
1302
1302
  :param str symbol: unified market symbol of the market orders were made in
1303
1303
  :param int [since]: the earliest time in ms to fetch orders for
1304
- :param int [limit]: the maximum number of orde structures to retrieve
1304
+ :param int [limit]: the maximum number of order structures to retrieve
1305
1305
  :param dict [params]: extra parameters specific to the exchange API endpoint
1306
1306
  :param int [params.till]: end time in ms
1307
1307
  :param str [params.side]: buy or sell
@@ -1015,7 +1015,7 @@ class probit(Exchange, ImplicitAPI):
1015
1015
  fetches information on multiple closed orders made by the user
1016
1016
  :param str symbol: unified market symbol of the market orders were made in
1017
1017
  :param int [since]: the earliest time in ms to fetch orders for
1018
- :param int [limit]: the maximum number of orde structures to retrieve
1018
+ :param int [limit]: the maximum number of order structures to retrieve
1019
1019
  :param dict [params]: extra parameters specific to the exchange API endpoint
1020
1020
  :returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
1021
1021
  """
@@ -957,7 +957,7 @@ class timex(Exchange, ImplicitAPI):
957
957
  fetches information on multiple closed orders made by the user
958
958
  :param str symbol: unified market symbol of the market orders were made in
959
959
  :param int [since]: the earliest time in ms to fetch orders for
960
- :param int [limit]: the maximum number of orde structures to retrieve
960
+ :param int [limit]: the maximum number of order structures to retrieve
961
961
  :param dict [params]: extra parameters specific to the exchange API endpoint
962
962
  :returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
963
963
  """
@@ -1827,7 +1827,7 @@ class tokocrypto(Exchange, ImplicitAPI):
1827
1827
  fetches information on multiple closed orders made by the user
1828
1828
  :param str symbol: unified market symbol of the market orders were made in
1829
1829
  :param int [since]: the earliest time in ms to fetch orders for
1830
- :param int [limit]: the maximum number of orde structures to retrieve
1830
+ :param int [limit]: the maximum number of order structures to retrieve
1831
1831
  :param dict [params]: extra parameters specific to the exchange API endpoint
1832
1832
  :returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
1833
1833
  """
@@ -1446,7 +1446,7 @@ class upbit(Exchange, ImplicitAPI):
1446
1446
  fetches information on multiple closed orders made by the user
1447
1447
  :param str symbol: unified market symbol of the market orders were made in
1448
1448
  :param int [since]: the earliest time in ms to fetch orders for
1449
- :param int [limit]: the maximum number of orde structures to retrieve
1449
+ :param int [limit]: the maximum number of order structures to retrieve
1450
1450
  :param dict [params]: extra parameters specific to the exchange API endpoint
1451
1451
  :returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
1452
1452
  """
@@ -1544,7 +1544,7 @@ class wavesexchange(Exchange, ImplicitAPI):
1544
1544
  fetches information on multiple closed orders made by the user
1545
1545
  :param str symbol: unified market symbol of the market orders were made in
1546
1546
  :param int [since]: the earliest time in ms to fetch orders for
1547
- :param int [limit]: the maximum number of orde structures to retrieve
1547
+ :param int [limit]: the maximum number of order structures to retrieve
1548
1548
  :param dict [params]: extra parameters specific to the exchange API endpoint
1549
1549
  :returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
1550
1550
  """
@@ -1334,7 +1334,7 @@ class whitebit(Exchange, ImplicitAPI):
1334
1334
  :see: https://docs.whitebit.com/private/http-trade-v4/#query-executed-orders
1335
1335
  :param str symbol: unified market symbol of the market orders were made in
1336
1336
  :param int [since]: the earliest time in ms to fetch orders for
1337
- :param int [limit]: the maximum number of orde structures to retrieve
1337
+ :param int [limit]: the maximum number of order structures to retrieve
1338
1338
  :param dict [params]: extra parameters specific to the exchange API endpoint
1339
1339
  :returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
1340
1340
  """
ccxt/async_support/woo.py CHANGED
@@ -1118,7 +1118,7 @@ class woo(Exchange, ImplicitAPI):
1118
1118
  fetches information on multiple orders made by the user
1119
1119
  :param str symbol: unified market symbol of the market orders were made in
1120
1120
  :param int [since]: the earliest time in ms to fetch orders for
1121
- :param int [limit]: the maximum number of orde structures to retrieve
1121
+ :param int [limit]: the maximum number of order structures to retrieve
1122
1122
  :param dict [params]: extra parameters specific to the exchange API endpoint
1123
1123
  :param boolean [params.stop]: whether the order is a stop/algo order
1124
1124
  :param boolean [params.isTriggered]: whether the order has been triggered(False by default)
@@ -535,7 +535,7 @@ class zaif(Exchange, ImplicitAPI):
535
535
  fetches information on multiple closed orders made by the user
536
536
  :param str symbol: unified market symbol of the market orders were made in
537
537
  :param int [since]: the earliest time in ms to fetch orders for
538
- :param int [limit]: the maximum number of orde structures to retrieve
538
+ :param int [limit]: the maximum number of order structures to retrieve
539
539
  :param dict [params]: extra parameters specific to the exchange API endpoint
540
540
  :returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
541
541
  """
ccxt/base/errors.py CHANGED
@@ -31,6 +31,7 @@ error_hierarchy = {
31
31
  'ContractUnavailable': {},
32
32
  },
33
33
  'NotSupported': {},
34
+ 'ProxyError': {},
34
35
  },
35
36
  'OperationFailed': {
36
37
  'NetworkError': {
@@ -152,6 +153,10 @@ class NotSupported(ExchangeError):
152
153
  pass
153
154
 
154
155
 
156
+ class ProxyError(ExchangeError):
157
+ pass
158
+
159
+
155
160
  class OperationFailed(BaseError):
156
161
  pass
157
162
 
@@ -212,6 +217,7 @@ __all__ = [
212
217
  'DuplicateOrderId',
213
218
  'ContractUnavailable',
214
219
  'NotSupported',
220
+ 'ProxyError',
215
221
  'OperationFailed',
216
222
  'NetworkError',
217
223
  'DDoSProtection',