ccxt 4.3.40__py2.py3-none-any.whl → 4.3.42__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 (68) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/abstract/binance.py +2 -0
  3. ccxt/abstract/binancecoinm.py +2 -0
  4. ccxt/abstract/binanceus.py +2 -0
  5. ccxt/abstract/binanceusdm.py +2 -0
  6. ccxt/abstract/okx.py +7 -0
  7. ccxt/async_support/__init__.py +1 -1
  8. ccxt/async_support/base/exchange.py +1 -1
  9. ccxt/async_support/binance.py +3 -0
  10. ccxt/async_support/bitfinex2.py +1 -1
  11. ccxt/async_support/bithumb.py +9 -1
  12. ccxt/async_support/bitmart.py +191 -100
  13. ccxt/async_support/bitstamp.py +38 -2
  14. ccxt/async_support/blockchaincom.py +11 -7
  15. ccxt/async_support/coinex.py +1 -1
  16. ccxt/async_support/coinlist.py +19 -1
  17. ccxt/async_support/coinmate.py +19 -3
  18. ccxt/async_support/coinone.py +1 -1
  19. ccxt/async_support/coinspot.py +11 -2
  20. ccxt/async_support/independentreserve.py +33 -1
  21. ccxt/async_support/indodax.py +43 -2
  22. ccxt/async_support/kraken.py +30 -3
  23. ccxt/async_support/krakenfutures.py +55 -1
  24. ccxt/async_support/kucoin.py +59 -2
  25. ccxt/async_support/okx.py +7 -0
  26. ccxt/async_support/upbit.py +13 -8
  27. ccxt/async_support/woo.py +6 -2
  28. ccxt/base/exchange.py +1 -1
  29. ccxt/binance.py +3 -0
  30. ccxt/bitfinex2.py +1 -1
  31. ccxt/bithumb.py +9 -1
  32. ccxt/bitmart.py +191 -100
  33. ccxt/bitstamp.py +38 -2
  34. ccxt/blockchaincom.py +11 -7
  35. ccxt/coinex.py +1 -1
  36. ccxt/coinlist.py +19 -1
  37. ccxt/coinmate.py +19 -3
  38. ccxt/coinone.py +1 -1
  39. ccxt/coinspot.py +11 -2
  40. ccxt/independentreserve.py +33 -1
  41. ccxt/indodax.py +43 -2
  42. ccxt/kraken.py +30 -3
  43. ccxt/krakenfutures.py +55 -1
  44. ccxt/kucoin.py +59 -2
  45. ccxt/okx.py +7 -0
  46. ccxt/pro/__init__.py +1 -1
  47. ccxt/pro/alpaca.py +5 -5
  48. ccxt/pro/ascendex.py +3 -3
  49. ccxt/pro/bingx.py +258 -42
  50. ccxt/pro/bitget.py +11 -5
  51. ccxt/pro/bitrue.py +3 -4
  52. ccxt/pro/currencycom.py +6 -5
  53. ccxt/pro/exmo.py +5 -6
  54. ccxt/pro/gemini.py +4 -3
  55. ccxt/pro/independentreserve.py +7 -7
  56. ccxt/pro/lbank.py +4 -4
  57. ccxt/pro/mexc.py +1 -1
  58. ccxt/pro/phemex.py +5 -5
  59. ccxt/pro/probit.py +4 -4
  60. ccxt/pro/upbit.py +299 -4
  61. ccxt/pro/wazirx.py +12 -12
  62. ccxt/pro/woo.py +1 -1
  63. ccxt/upbit.py +13 -8
  64. ccxt/woo.py +6 -2
  65. {ccxt-4.3.40.dist-info → ccxt-4.3.42.dist-info}/METADATA +4 -4
  66. {ccxt-4.3.40.dist-info → ccxt-4.3.42.dist-info}/RECORD +68 -68
  67. {ccxt-4.3.40.dist-info → ccxt-4.3.42.dist-info}/WHEEL +0 -0
  68. {ccxt-4.3.40.dist-info → ccxt-4.3.42.dist-info}/top_level.txt +0 -0
ccxt/indodax.py CHANGED
@@ -641,6 +641,24 @@ class indodax(Exchange, ImplicitAPI):
641
641
  # "order_xrp": "30.45000000",
642
642
  # "remain_xrp": "0.00000000"
643
643
  # }
644
+ #
645
+ # cancelOrder
646
+ #
647
+ # {
648
+ # "order_id": 666883,
649
+ # "client_order_id": "clientx-sj82ks82j",
650
+ # "type": "sell",
651
+ # "pair": "btc_idr",
652
+ # "balance": {
653
+ # "idr": "33605800",
654
+ # "btc": "0.00000000",
655
+ # ...
656
+ # "frozen_idr": "0",
657
+ # "frozen_btc": "0.00000000",
658
+ # ...
659
+ # }
660
+ # }
661
+ #
644
662
  side = None
645
663
  if 'type' in order:
646
664
  side = order['type']
@@ -650,6 +668,8 @@ class indodax(Exchange, ImplicitAPI):
650
668
  price = self.safe_string(order, 'price')
651
669
  amount = None
652
670
  remaining = None
671
+ marketId = self.safe_string(order, 'pair')
672
+ market = self.safe_market(marketId, market)
653
673
  if market is not None:
654
674
  symbol = market['symbol']
655
675
  quoteId = market['quoteId']
@@ -668,7 +688,7 @@ class indodax(Exchange, ImplicitAPI):
668
688
  return self.safe_order({
669
689
  'info': order,
670
690
  'id': id,
671
- 'clientOrderId': None,
691
+ 'clientOrderId': self.safe_string(order, 'client_order_id'),
672
692
  'timestamp': timestamp,
673
693
  'datetime': self.iso8601(timestamp),
674
694
  'lastTradeTimestamp': None,
@@ -825,7 +845,28 @@ class indodax(Exchange, ImplicitAPI):
825
845
  'pair': market['id'],
826
846
  'type': side,
827
847
  }
828
- return self.privatePostCancelOrder(self.extend(request, params))
848
+ response = self.privatePostCancelOrder(self.extend(request, params))
849
+ #
850
+ # {
851
+ # "success": 1,
852
+ # "return": {
853
+ # "order_id": 666883,
854
+ # "client_order_id": "clientx-sj82ks82j",
855
+ # "type": "sell",
856
+ # "pair": "btc_idr",
857
+ # "balance": {
858
+ # "idr": "33605800",
859
+ # "btc": "0.00000000",
860
+ # ...
861
+ # "frozen_idr": "0",
862
+ # "frozen_btc": "0.00000000",
863
+ # ...
864
+ # }
865
+ # }
866
+ # }
867
+ #
868
+ data = self.safe_dict(response, 'return')
869
+ return self.parse_order(data)
829
870
 
830
871
  def fetch_transaction_fee(self, code: str, params={}):
831
872
  """
ccxt/kraken.py CHANGED
@@ -2008,12 +2008,22 @@ class kraken(Exchange, ImplicitAPI):
2008
2008
  params = self.omit(params, ['userref', 'clientOrderId'])
2009
2009
  try:
2010
2010
  response = self.privatePostCancelOrder(self.extend(request, params))
2011
+ #
2012
+ # {
2013
+ # error: [],
2014
+ # result: {
2015
+ # count: '1'
2016
+ # }
2017
+ # }
2018
+ #
2011
2019
  except Exception as e:
2012
2020
  if self.last_http_response:
2013
2021
  if self.last_http_response.find('EOrder:Unknown order') >= 0:
2014
2022
  raise OrderNotFound(self.id + ' cancelOrder() error ' + self.last_http_response)
2015
2023
  raise e
2016
- return response
2024
+ return self.safe_order({
2025
+ 'info': response,
2026
+ })
2017
2027
 
2018
2028
  def cancel_orders(self, ids, symbol: Str = None, params={}):
2019
2029
  """
@@ -2036,7 +2046,11 @@ class kraken(Exchange, ImplicitAPI):
2036
2046
  # }
2037
2047
  # }
2038
2048
  #
2039
- return response
2049
+ return [
2050
+ self.safe_order({
2051
+ 'info': response,
2052
+ }),
2053
+ ]
2040
2054
 
2041
2055
  def cancel_all_orders(self, symbol: Str = None, params={}):
2042
2056
  """
@@ -2047,7 +2061,20 @@ class kraken(Exchange, ImplicitAPI):
2047
2061
  :returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
2048
2062
  """
2049
2063
  self.load_markets()
2050
- return self.privatePostCancelAll(params)
2064
+ response = self.privatePostCancelAll(params)
2065
+ #
2066
+ # {
2067
+ # error: [],
2068
+ # result: {
2069
+ # count: '1'
2070
+ # }
2071
+ # }
2072
+ #
2073
+ return [
2074
+ self.safe_order({
2075
+ 'info': response,
2076
+ }),
2077
+ ]
2051
2078
 
2052
2079
  def cancel_all_orders_after(self, timeout: Int, params={}):
2053
2080
  """
ccxt/krakenfutures.py CHANGED
@@ -1207,7 +1207,45 @@ class krakenfutures(Exchange, ImplicitAPI):
1207
1207
  if symbol is not None:
1208
1208
  request['symbol'] = self.market_id(symbol)
1209
1209
  response = self.privatePostCancelallorders(self.extend(request, params))
1210
- return response
1210
+ #
1211
+ # {
1212
+ # result: 'success',
1213
+ # cancelStatus: {
1214
+ # receivedTime: '2024-06-06T01:12:44.814Z',
1215
+ # cancelOnly: 'PF_XRPUSD',
1216
+ # status: 'cancelled',
1217
+ # cancelledOrders: [{order_id: '272fd0ac-45c0-4003-b84d-d39b9e86bd36'}],
1218
+ # orderEvents: [
1219
+ # {
1220
+ # uid: '272fd0ac-45c0-4003-b84d-d39b9e86bd36',
1221
+ # order: {
1222
+ # orderId: '272fd0ac-45c0-4003-b84d-d39b9e86bd36',
1223
+ # cliOrdId: null,
1224
+ # type: 'lmt',
1225
+ # symbol: 'PF_XRPUSD',
1226
+ # side: 'buy',
1227
+ # quantity: '10',
1228
+ # filled: '0',
1229
+ # limitPrice: '0.4',
1230
+ # reduceOnly: False,
1231
+ # timestamp: '2024-06-06T01:11:16.045Z',
1232
+ # lastUpdateTimestamp: '2024-06-06T01:11:16.045Z'
1233
+ # },
1234
+ # type: 'CANCEL'
1235
+ # }
1236
+ # ]
1237
+ # },
1238
+ # serverTime: '2024-06-06T01:12:44.814Z'
1239
+ # }
1240
+ #
1241
+ cancelStatus = self.safe_dict(response, 'cancelStatus')
1242
+ orderEvents = self.safe_list(cancelStatus, 'orderEvents', [])
1243
+ orders = []
1244
+ for i in range(0, len(orderEvents)):
1245
+ orderEvent = self.safe_dict(orderEvents, 0)
1246
+ order = self.safe_dict(orderEvent, 'order', {})
1247
+ orders.append(order)
1248
+ return self.parse_orders(orders)
1211
1249
 
1212
1250
  def cancel_all_orders_after(self, timeout: Int, params={}):
1213
1251
  """
@@ -1551,6 +1589,22 @@ class krakenfutures(Exchange, ImplicitAPI):
1551
1589
  # ]
1552
1590
  # }
1553
1591
  #
1592
+ # cancelAllOrders
1593
+ #
1594
+ # {
1595
+ # "orderId": "85c40002-3f20-4e87-9302-262626c3531b",
1596
+ # "cliOrdId": null,
1597
+ # "type": "lmt",
1598
+ # "symbol": "pi_xbtusd",
1599
+ # "side": "buy",
1600
+ # "quantity": 1000,
1601
+ # "filled": 0,
1602
+ # "limitPrice": 10144,
1603
+ # "stopPrice": null,
1604
+ # "reduceOnly": False,
1605
+ # "timestamp": "2019-08-01T15:26:27.790Z"
1606
+ # }
1607
+ #
1554
1608
  # FETCH OPEN ORDERS
1555
1609
  #
1556
1610
  # {
ccxt/kucoin.py CHANGED
@@ -2237,19 +2237,76 @@ class kucoin(Exchange, ImplicitAPI):
2237
2237
  request['clientOid'] = clientOrderId
2238
2238
  if stop:
2239
2239
  response = self.privateDeleteStopOrderCancelOrderByClientOid(self.extend(request, params))
2240
+ #
2241
+ # {
2242
+ # code: '200000',
2243
+ # data: {
2244
+ # cancelledOrderId: 'vs8lgpiuao41iaft003khbbk',
2245
+ # clientOid: '123456'
2246
+ # }
2247
+ # }
2248
+ #
2240
2249
  elif hf:
2241
2250
  response = self.privateDeleteHfOrdersClientOrderClientOid(self.extend(request, params))
2251
+ #
2252
+ # {
2253
+ # "code": "200000",
2254
+ # "data": {
2255
+ # "clientOid": "6d539dc614db3"
2256
+ # }
2257
+ # }
2258
+ #
2242
2259
  else:
2243
2260
  response = self.privateDeleteOrderClientOrderClientOid(self.extend(request, params))
2261
+ #
2262
+ # {
2263
+ # code: '200000',
2264
+ # data: {
2265
+ # cancelledOrderId: '665e580f6660500007aba341',
2266
+ # clientOid: '1234567',
2267
+ # cancelledOcoOrderIds: null
2268
+ # }
2269
+ # }
2270
+ #
2271
+ response = self.safe_dict(response, 'data')
2272
+ return self.parse_order(response)
2244
2273
  else:
2245
2274
  request['orderId'] = id
2246
2275
  if stop:
2247
2276
  response = self.privateDeleteStopOrderOrderId(self.extend(request, params))
2277
+ #
2278
+ # {
2279
+ # code: '200000',
2280
+ # data: {cancelledOrderIds: ['vs8lgpiuaco91qk8003vebu9']}
2281
+ # }
2282
+ #
2248
2283
  elif hf:
2249
2284
  response = self.privateDeleteHfOrdersOrderId(self.extend(request, params))
2285
+ #
2286
+ # {
2287
+ # "code": "200000",
2288
+ # "data": {
2289
+ # "orderId": "630625dbd9180300014c8d52"
2290
+ # }
2291
+ # }
2292
+ #
2293
+ response = self.safe_dict(response, 'data')
2294
+ return self.parse_order(response)
2250
2295
  else:
2251
2296
  response = self.privateDeleteOrdersOrderId(self.extend(request, params))
2252
- return response
2297
+ #
2298
+ # {
2299
+ # code: '200000',
2300
+ # data: {cancelledOrderIds: ['665e4fbe28051a0007245c41']}
2301
+ # }
2302
+ #
2303
+ data = self.safe_dict(response, 'data')
2304
+ orderIds = self.safe_list(data, 'cancelledOrderIds', [])
2305
+ orderId = self.safe_string(orderIds, 0)
2306
+ return self.safe_order({
2307
+ 'info': data,
2308
+ 'id': orderId,
2309
+ })
2253
2310
 
2254
2311
  def cancel_all_orders(self, symbol: Str = None, params={}):
2255
2312
  """
@@ -2663,7 +2720,7 @@ class kucoin(Exchange, ImplicitAPI):
2663
2720
  stopPrice = self.safe_number(order, 'stopPrice')
2664
2721
  return self.safe_order({
2665
2722
  'info': order,
2666
- 'id': self.safe_string_n(order, ['id', 'orderId', 'newOrderId']),
2723
+ 'id': self.safe_string_n(order, ['id', 'orderId', 'newOrderId', 'cancelledOrderId']),
2667
2724
  'clientOrderId': self.safe_string(order, 'clientOid'),
2668
2725
  'symbol': self.safe_symbol(marketId, market, '-'),
2669
2726
  'type': self.safe_string(order, 'type'),
ccxt/okx.py CHANGED
@@ -369,6 +369,9 @@ class okx(Exchange, ImplicitAPI):
369
369
  'account/greeks': 2,
370
370
  'account/position-tiers': 2,
371
371
  'account/mmp-config': 4,
372
+ 'account/fixed-loan/borrowing-limit': 4,
373
+ 'account/fixed-loan/borrowing-quote': 5,
374
+ 'account/fixed-loan/borrowing-orders-list': 5,
372
375
  # subaccount
373
376
  'users/subaccount/list': 10,
374
377
  'account/subaccount/balances': 10 / 3,
@@ -494,6 +497,10 @@ class okx(Exchange, ImplicitAPI):
494
497
  'account/set-account-level': 4,
495
498
  'account/mmp-reset': 4,
496
499
  'account/mmp-config': 100,
500
+ 'account/fixed-loan/borrowing-order': 5,
501
+ 'account/fixed-loan/amend-borrowing-order': 5,
502
+ 'account/fixed-loan/manual-reborrow': 5,
503
+ 'account/fixed-loan/repay-borrowing-order': 5,
497
504
  # subaccount
498
505
  'users/subaccount/modify-apikey': 10,
499
506
  'asset/subaccount/transfer': 10,
ccxt/pro/__init__.py CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # ----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.3.40'
7
+ __version__ = '4.3.42'
8
8
 
9
9
  # ----------------------------------------------------------------------------
10
10
 
ccxt/pro/alpaca.py CHANGED
@@ -226,15 +226,15 @@ class alpaca(ccxt.async_support.alpaca):
226
226
  datetime = self.safe_string(message, 't')
227
227
  timestamp = self.parse8601(datetime)
228
228
  isSnapshot = self.safe_bool(message, 'r', False)
229
- orderbook = self.safe_value(self.orderbooks, symbol)
230
- if orderbook is None:
231
- orderbook = self.order_book()
229
+ if not (symbol in self.orderbooks):
230
+ self.orderbooks[symbol] = self.order_book()
231
+ orderbook = self.orderbooks[symbol]
232
232
  if isSnapshot:
233
233
  snapshot = self.parse_order_book(message, symbol, timestamp, 'b', 'a', 'p', 's')
234
234
  orderbook.reset(snapshot)
235
235
  else:
236
- asks = self.safe_value(message, 'a', [])
237
- bids = self.safe_value(message, 'b', [])
236
+ asks = self.safe_list(message, 'a', [])
237
+ bids = self.safe_list(message, 'b', [])
238
238
  self.handle_deltas(orderbook['asks'], asks)
239
239
  self.handle_deltas(orderbook['bids'], bids)
240
240
  orderbook['timestamp'] = timestamp
ccxt/pro/ascendex.py CHANGED
@@ -285,9 +285,9 @@ class ascendex(ccxt.async_support.ascendex):
285
285
  marketId = self.safe_string(message, 'symbol')
286
286
  symbol = self.safe_symbol(marketId)
287
287
  messageHash = channel + ':' + marketId
288
- orderbook = self.safe_value(self.orderbooks, symbol)
289
- if orderbook is None:
290
- orderbook = self.order_book({})
288
+ if not (symbol in self.orderbooks):
289
+ self.orderbooks[symbol] = self.order_book({})
290
+ orderbook = self.orderbooks[symbol]
291
291
  if orderbook['nonce'] is None:
292
292
  orderbook.cache.append(message)
293
293
  else: