ccxt 4.4.39__py2.py3-none-any.whl → 4.4.41__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 (137) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/abstract/bitmart.py +2 -0
  3. ccxt/abstract/okx.py +5 -0
  4. ccxt/ascendex.py +9 -9
  5. ccxt/async_support/__init__.py +1 -1
  6. ccxt/async_support/ascendex.py +9 -9
  7. ccxt/async_support/base/exchange.py +10 -3
  8. ccxt/async_support/base/ws/aiohttp_client.py +2 -2
  9. ccxt/async_support/binance.py +37 -41
  10. ccxt/async_support/bingx.py +4 -3
  11. ccxt/async_support/bit2c.py +0 -1
  12. ccxt/async_support/bitbank.py +0 -1
  13. ccxt/async_support/bitbns.py +0 -1
  14. ccxt/async_support/bitfinex.py +16 -17
  15. ccxt/async_support/bitfinex1.py +0 -1
  16. ccxt/async_support/bitflyer.py +0 -1
  17. ccxt/async_support/bitget.py +2 -2
  18. ccxt/async_support/bithumb.py +0 -1
  19. ccxt/async_support/bitmart.py +246 -6
  20. ccxt/async_support/bitmex.py +5 -6
  21. ccxt/async_support/bitopro.py +4 -5
  22. ccxt/async_support/bitrue.py +5 -7
  23. ccxt/async_support/bitso.py +1 -2
  24. ccxt/async_support/bitstamp.py +1 -2
  25. ccxt/async_support/bitteam.py +1 -3
  26. ccxt/async_support/bitvavo.py +2 -4
  27. ccxt/async_support/blockchaincom.py +5 -5
  28. ccxt/async_support/blofin.py +10 -10
  29. ccxt/async_support/btcalpha.py +0 -1
  30. ccxt/async_support/btcbox.py +0 -1
  31. ccxt/async_support/btcmarkets.py +1 -3
  32. ccxt/async_support/bybit.py +10 -11
  33. ccxt/async_support/cex.py +1 -1
  34. ccxt/async_support/coinbase.py +77 -1
  35. ccxt/async_support/coinbaseexchange.py +1 -1
  36. ccxt/async_support/coinbaseinternational.py +62 -0
  37. ccxt/async_support/coincatch.py +1 -1
  38. ccxt/async_support/coinex.py +9 -9
  39. ccxt/async_support/coinlist.py +1 -1
  40. ccxt/async_support/coinmetro.py +1 -1
  41. ccxt/async_support/cryptocom.py +91 -2
  42. ccxt/async_support/currencycom.py +1 -1
  43. ccxt/async_support/defx.py +1 -2
  44. ccxt/async_support/delta.py +1 -1
  45. ccxt/async_support/digifinex.py +1 -1
  46. ccxt/async_support/exmo.py +62 -6
  47. ccxt/async_support/gate.py +2 -2
  48. ccxt/async_support/hashkey.py +3 -5
  49. ccxt/async_support/htx.py +2 -2
  50. ccxt/async_support/hyperliquid.py +61 -2
  51. ccxt/async_support/kraken.py +124 -26
  52. ccxt/async_support/kucoin.py +29 -25
  53. ccxt/async_support/luno.py +1 -1
  54. ccxt/async_support/mexc.py +137 -1
  55. ccxt/async_support/ndax.py +1 -1
  56. ccxt/async_support/okcoin.py +18 -18
  57. ccxt/async_support/okx.py +27 -22
  58. ccxt/async_support/phemex.py +12 -8
  59. ccxt/async_support/poloniex.py +1 -1
  60. ccxt/async_support/poloniexfutures.py +6 -6
  61. ccxt/async_support/vertex.py +11 -11
  62. ccxt/async_support/woo.py +33 -33
  63. ccxt/async_support/woofipro.py +24 -24
  64. ccxt/async_support/xt.py +29 -27
  65. ccxt/async_support/zonda.py +1 -1
  66. ccxt/base/exchange.py +31 -19
  67. ccxt/base/types.py +10 -0
  68. ccxt/binance.py +37 -41
  69. ccxt/bingx.py +4 -3
  70. ccxt/bit2c.py +0 -1
  71. ccxt/bitbank.py +0 -1
  72. ccxt/bitbns.py +0 -1
  73. ccxt/bitfinex.py +16 -17
  74. ccxt/bitfinex1.py +0 -1
  75. ccxt/bitflyer.py +0 -1
  76. ccxt/bitget.py +2 -2
  77. ccxt/bithumb.py +0 -1
  78. ccxt/bitmart.py +246 -6
  79. ccxt/bitmex.py +5 -6
  80. ccxt/bitopro.py +4 -5
  81. ccxt/bitrue.py +5 -7
  82. ccxt/bitso.py +1 -2
  83. ccxt/bitstamp.py +1 -2
  84. ccxt/bitteam.py +1 -3
  85. ccxt/bitvavo.py +2 -4
  86. ccxt/blockchaincom.py +5 -5
  87. ccxt/blofin.py +10 -10
  88. ccxt/btcalpha.py +0 -1
  89. ccxt/btcbox.py +0 -1
  90. ccxt/btcmarkets.py +1 -3
  91. ccxt/bybit.py +10 -11
  92. ccxt/cex.py +1 -1
  93. ccxt/coinbase.py +77 -1
  94. ccxt/coinbaseexchange.py +1 -1
  95. ccxt/coinbaseinternational.py +62 -0
  96. ccxt/coincatch.py +1 -1
  97. ccxt/coinex.py +9 -9
  98. ccxt/coinlist.py +1 -1
  99. ccxt/coinmetro.py +1 -1
  100. ccxt/cryptocom.py +91 -2
  101. ccxt/currencycom.py +1 -1
  102. ccxt/defx.py +1 -2
  103. ccxt/delta.py +1 -1
  104. ccxt/digifinex.py +1 -1
  105. ccxt/exmo.py +62 -6
  106. ccxt/gate.py +2 -2
  107. ccxt/hashkey.py +3 -5
  108. ccxt/htx.py +2 -2
  109. ccxt/hyperliquid.py +61 -2
  110. ccxt/kraken.py +124 -26
  111. ccxt/kucoin.py +29 -25
  112. ccxt/luno.py +1 -1
  113. ccxt/mexc.py +137 -1
  114. ccxt/ndax.py +1 -1
  115. ccxt/okcoin.py +18 -18
  116. ccxt/okx.py +27 -22
  117. ccxt/phemex.py +12 -8
  118. ccxt/poloniex.py +1 -1
  119. ccxt/poloniexfutures.py +6 -6
  120. ccxt/pro/__init__.py +1 -1
  121. ccxt/pro/bitget.py +1 -1
  122. ccxt/pro/bybit.py +12 -1
  123. ccxt/pro/coinex.py +2 -2
  124. ccxt/pro/gate.py +6 -6
  125. ccxt/pro/kucoin.py +3 -3
  126. ccxt/pro/okx.py +11 -11
  127. ccxt/pro/upbit.py +2 -2
  128. ccxt/vertex.py +11 -11
  129. ccxt/woo.py +33 -33
  130. ccxt/woofipro.py +24 -24
  131. ccxt/xt.py +29 -27
  132. ccxt/zonda.py +1 -1
  133. {ccxt-4.4.39.dist-info → ccxt-4.4.41.dist-info}/METADATA +4 -4
  134. {ccxt-4.4.39.dist-info → ccxt-4.4.41.dist-info}/RECORD +137 -137
  135. {ccxt-4.4.39.dist-info → ccxt-4.4.41.dist-info}/LICENSE.txt +0 -0
  136. {ccxt-4.4.39.dist-info → ccxt-4.4.41.dist-info}/WHEEL +0 -0
  137. {ccxt-4.4.39.dist-info → ccxt-4.4.41.dist-info}/top_level.txt +0 -0
@@ -1129,7 +1129,7 @@ class kraken(Exchange, ImplicitAPI):
1129
1129
  :param dict [params]: extra parameters specific to the exchange API endpoint
1130
1130
  :param int [params.until]: timestamp in ms of the latest ledger entry
1131
1131
  :param int [params.end]: timestamp in seconds of the latest ledger entry
1132
- :returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger-structure>`
1132
+ :returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
1133
1133
  """
1134
1134
  # https://www.kraken.com/features/api#get-ledgers-info
1135
1135
  await self.load_markets()
@@ -1621,6 +1621,37 @@ class kraken(Exchange, ImplicitAPI):
1621
1621
  # }
1622
1622
  # }
1623
1623
  #
1624
+ # fetchOpenOrders
1625
+ #
1626
+ # {
1627
+ # "refid": null,
1628
+ # "userref": null,
1629
+ # "cl_ord_id": "1234",
1630
+ # "status": "open",
1631
+ # "opentm": 1733815269.370054,
1632
+ # "starttm": 0,
1633
+ # "expiretm": 0,
1634
+ # "descr": {
1635
+ # "pair": "XBTUSD",
1636
+ # "type": "buy",
1637
+ # "ordertype": "limit",
1638
+ # "price": "70000.0",
1639
+ # "price2": "0",
1640
+ # "leverage": "none",
1641
+ # "order": "buy 0.00010000 XBTUSD @ limit 70000.0",
1642
+ # "close": ""
1643
+ # },
1644
+ # "vol": "0.00010000",
1645
+ # "vol_exec": "0.00000000",
1646
+ # "cost": "0.00000",
1647
+ # "fee": "0.00000",
1648
+ # "price": "0.00000",
1649
+ # "stopprice": "0.00000",
1650
+ # "limitprice": "0.00000",
1651
+ # "misc": "",
1652
+ # "oflags": "fciq"
1653
+ # }
1654
+ #
1624
1655
  description = self.safe_dict(order, 'descr', {})
1625
1656
  orderDescriptionObj = self.safe_dict(order, 'descr') # can be null
1626
1657
  orderDescription = None
@@ -1694,7 +1725,8 @@ class kraken(Exchange, ImplicitAPI):
1694
1725
  if (id is None) or (id.startswith('[')):
1695
1726
  txid = self.safe_list(order, 'txid')
1696
1727
  id = self.safe_string(txid, 0)
1697
- clientOrderId = self.safe_string(order, 'userref')
1728
+ userref = self.safe_string(order, 'userref')
1729
+ clientOrderId = self.safe_string(order, 'cl_ord_id', userref)
1698
1730
  rawTrades = self.safe_value(order, 'trades', [])
1699
1731
  trades = []
1700
1732
  for i in range(0, len(rawTrades)):
@@ -1888,10 +1920,10 @@ class kraken(Exchange, ImplicitAPI):
1888
1920
  request: dict = {
1889
1921
  'txid': id,
1890
1922
  }
1891
- clientOrderId = self.safe_string(params, 'clientOrderId')
1923
+ clientOrderId = self.safe_string_2(params, 'clientOrderId', 'cl_ord_id')
1892
1924
  if clientOrderId is not None:
1893
1925
  request['cl_ord_id'] = clientOrderId
1894
- params = self.omit(params, 'clientOrderId')
1926
+ params = self.omit(params, ['clientOrderId', 'cl_ord_id'])
1895
1927
  request = self.omit(request, 'txid')
1896
1928
  isMarket = (type == 'market')
1897
1929
  postOnly = None
@@ -2158,20 +2190,27 @@ class kraken(Exchange, ImplicitAPI):
2158
2190
  """
2159
2191
  cancels an open order
2160
2192
 
2161
- https://docs.kraken.com/rest/#tag/Spot-Trading/operation/cancelOrder
2193
+ https://docs.kraken.com/api/docs/rest-api/cancel-order
2162
2194
 
2163
2195
  :param str id: order id
2164
- :param str symbol: unified symbol of the market the order was made in
2196
+ :param str [symbol]: unified symbol of the market the order was made in
2165
2197
  :param dict [params]: extra parameters specific to the exchange API endpoint
2166
- :returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
2198
+ :param str [params.clientOrderId]: the orders client order id
2199
+ :param int [params.userref]: the orders user reference id
2200
+ :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
2167
2201
  """
2168
2202
  await self.load_markets()
2169
2203
  response = None
2170
- clientOrderId = self.safe_value_2(params, 'userref', 'clientOrderId', id)
2204
+ requestId = self.safe_value(params, 'userref', id) # string or integer
2205
+ params = self.omit(params, 'userref')
2171
2206
  request: dict = {
2172
- 'txid': clientOrderId, # order id or userref
2207
+ 'txid': requestId, # order id or userref
2173
2208
  }
2174
- params = self.omit(params, ['userref', 'clientOrderId'])
2209
+ clientOrderId = self.safe_string_2(params, 'clientOrderId', 'cl_ord_id')
2210
+ if clientOrderId is not None:
2211
+ request['cl_ord_id'] = clientOrderId
2212
+ params = self.omit(params, ['clientOrderId', 'cl_ord_id'])
2213
+ request = self.omit(request, 'txid')
2175
2214
  try:
2176
2215
  response = await self.privatePostCancelOrder(self.extend(request, params))
2177
2216
  #
@@ -2278,55 +2317,108 @@ class kraken(Exchange, ImplicitAPI):
2278
2317
  """
2279
2318
  fetch all unfilled currently open orders
2280
2319
 
2281
- https://docs.kraken.com/rest/#tag/Account-Data/operation/getOpenOrders
2320
+ https://docs.kraken.com/api/docs/rest-api/get-open-orders
2282
2321
 
2283
- :param str symbol: unified market symbol
2322
+ :param str [symbol]: unified market symbol
2284
2323
  :param int [since]: the earliest time in ms to fetch open orders for
2285
2324
  :param int [limit]: the maximum number of open orders structures to retrieve
2286
2325
  :param dict [params]: extra parameters specific to the exchange API endpoint
2326
+ :param str [params.clientOrderId]: the orders client order id
2327
+ :param int [params.userref]: the orders user reference id
2287
2328
  :returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
2288
2329
  """
2289
2330
  await self.load_markets()
2290
2331
  request: dict = {}
2291
2332
  if since is not None:
2292
2333
  request['start'] = self.parse_to_int(since / 1000)
2293
- query = params
2294
- clientOrderId = self.safe_value_2(params, 'userref', 'clientOrderId')
2334
+ userref = self.safe_integer(params, 'userref')
2335
+ if userref is not None:
2336
+ request['userref'] = userref
2337
+ params = self.omit(params, 'userref')
2338
+ clientOrderId = self.safe_string(params, 'clientOrderId')
2295
2339
  if clientOrderId is not None:
2296
- request['userref'] = clientOrderId
2297
- query = self.omit(params, ['userref', 'clientOrderId'])
2298
- response = await self.privatePostOpenOrders(self.extend(request, query))
2340
+ request['cl_ord_id'] = clientOrderId
2341
+ params = self.omit(params, 'clientOrderId')
2342
+ response = await self.privatePostOpenOrders(self.extend(request, params))
2343
+ #
2344
+ # {
2345
+ # "error": [],
2346
+ # "result": {
2347
+ # "open": {
2348
+ # "O45M52-BFD5S-YXKQOU": {
2349
+ # "refid": null,
2350
+ # "userref": null,
2351
+ # "cl_ord_id": "1234",
2352
+ # "status": "open",
2353
+ # "opentm": 1733815269.370054,
2354
+ # "starttm": 0,
2355
+ # "expiretm": 0,
2356
+ # "descr": {
2357
+ # "pair": "XBTUSD",
2358
+ # "type": "buy",
2359
+ # "ordertype": "limit",
2360
+ # "price": "70000.0",
2361
+ # "price2": "0",
2362
+ # "leverage": "none",
2363
+ # "order": "buy 0.00010000 XBTUSD @ limit 70000.0",
2364
+ # "close": ""
2365
+ # },
2366
+ # "vol": "0.00010000",
2367
+ # "vol_exec": "0.00000000",
2368
+ # "cost": "0.00000",
2369
+ # "fee": "0.00000",
2370
+ # "price": "0.00000",
2371
+ # "stopprice": "0.00000",
2372
+ # "limitprice": "0.00000",
2373
+ # "misc": "",
2374
+ # "oflags": "fciq"
2375
+ # }
2376
+ # }
2377
+ # }
2378
+ # }
2379
+ #
2299
2380
  market = None
2300
2381
  if symbol is not None:
2301
2382
  market = self.market(symbol)
2302
2383
  result = self.safe_dict(response, 'result', {})
2303
- orders = self.safe_dict(result, 'open', {})
2384
+ open = self.safe_dict(result, 'open', {})
2385
+ orders = []
2386
+ orderIds = list(open.keys())
2387
+ for i in range(0, len(orderIds)):
2388
+ id = orderIds[i]
2389
+ item = open[id]
2390
+ orders.append(self.extend({'id': id}, item))
2304
2391
  return self.parse_orders(orders, market, since, limit)
2305
2392
 
2306
2393
  async def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
2307
2394
  """
2308
2395
  fetches information on multiple closed orders made by the user
2309
2396
 
2310
- https://docs.kraken.com/rest/#tag/Account-Data/operation/getClosedOrders
2397
+ https://docs.kraken.com/api/docs/rest-api/get-closed-orders
2311
2398
 
2312
- :param str symbol: unified market symbol of the market orders were made in
2399
+ :param str [symbol]: unified market symbol of the market orders were made in
2313
2400
  :param int [since]: the earliest time in ms to fetch orders for
2314
2401
  :param int [limit]: the maximum number of order structures to retrieve
2315
2402
  :param dict [params]: extra parameters specific to the exchange API endpoint
2316
2403
  :param int [params.until]: timestamp in ms of the latest entry
2404
+ :param str [params.clientOrderId]: the orders client order id
2405
+ :param int [params.userref]: the orders user reference id
2317
2406
  :returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
2318
2407
  """
2319
2408
  await self.load_markets()
2320
2409
  request: dict = {}
2321
2410
  if since is not None:
2322
2411
  request['start'] = self.parse_to_int(since / 1000)
2323
- query = params
2324
- clientOrderId = self.safe_value_2(params, 'userref', 'clientOrderId')
2412
+ userref = self.safe_integer(params, 'userref')
2413
+ if userref is not None:
2414
+ request['userref'] = userref
2415
+ params = self.omit(params, 'userref')
2416
+ clientOrderId = self.safe_string(params, 'clientOrderId')
2325
2417
  if clientOrderId is not None:
2326
- request['userref'] = clientOrderId
2327
- query = self.omit(params, ['userref', 'clientOrderId'])
2418
+ request['cl_ord_id'] = clientOrderId
2419
+ params = self.omit(params, 'clientOrderId')
2328
2420
  request, params = self.handle_until_option('end', request, params)
2329
- response = await self.privatePostClosedOrders(self.extend(request, query))
2421
+ response = await self.privatePostClosedOrders(self.extend(request, params))
2330
2422
  #
2331
2423
  # {
2332
2424
  # "error":[],
@@ -2370,7 +2462,13 @@ class kraken(Exchange, ImplicitAPI):
2370
2462
  if symbol is not None:
2371
2463
  market = self.market(symbol)
2372
2464
  result = self.safe_dict(response, 'result', {})
2373
- orders = self.safe_dict(result, 'closed', {})
2465
+ closed = self.safe_dict(result, 'closed', {})
2466
+ orders = []
2467
+ orderIds = list(closed.keys())
2468
+ for i in range(0, len(orderIds)):
2469
+ id = orderIds[i]
2470
+ item = closed[id]
2471
+ orders.append(self.extend({'id': id}, item))
2374
2472
  return self.parse_orders(orders, market, since, limit)
2375
2473
 
2376
2474
  def parse_transaction_status(self, status: Str):
@@ -660,6 +660,8 @@ class kucoin(Exchange, ImplicitAPI):
660
660
  'version': 'v1',
661
661
  'symbolSeparator': '-',
662
662
  'fetchMyTradesMethod': 'private_get_fills',
663
+ 'timeDifference': 0, # the difference between system clock and Binance clock
664
+ 'adjustForTimeDifference': False, # controls the adjustment logic upon instantiation
663
665
  'fetchCurrencies': {
664
666
  'webApiEnable': True, # fetches from WEB
665
667
  'webApiRetries': 1,
@@ -1076,7 +1078,7 @@ class kucoin(Exchange, ImplicitAPI):
1076
1078
  })
1077
1079
 
1078
1080
  def nonce(self):
1079
- return self.milliseconds()
1081
+ return self.milliseconds() - self.options['timeDifference']
1080
1082
 
1081
1083
  async def fetch_time(self, params={}):
1082
1084
  """
@@ -1313,6 +1315,8 @@ class kucoin(Exchange, ImplicitAPI):
1313
1315
  'created': None,
1314
1316
  'info': market,
1315
1317
  })
1318
+ if self.options['adjustForTimeDifference']:
1319
+ await self.load_time_difference()
1316
1320
  return result
1317
1321
 
1318
1322
  async def load_migration_status(self, force: bool = False):
@@ -2214,7 +2218,7 @@ class kucoin(Exchange, ImplicitAPI):
2214
2218
  market orders --------------------------------------------------
2215
2219
  :param str [params.funds]: # Amount of quote currency to use
2216
2220
  stop orders ----------------------------------------------------
2217
- :param str [params.stop]: Either loss or entry, the default is loss. Requires stopPrice to be defined
2221
+ :param str [params.stop]: Either loss or entry, the default is loss. Requires triggerPrice to be defined
2218
2222
  margin orders --------------------------------------------------
2219
2223
  :param float [params.leverage]: Leverage size of the order
2220
2224
  :param str [params.stp]: '', # self trade prevention, CN, CO, CB or DC
@@ -2519,7 +2523,7 @@ class kucoin(Exchange, ImplicitAPI):
2519
2523
  :param str id: order id
2520
2524
  :param str symbol: unified symbol of the market the order was made in
2521
2525
  :param dict [params]: extra parameters specific to the exchange API endpoint
2522
- :param bool [params.stop]: True if cancelling a stop order
2526
+ :param bool [params.trigger]: True if cancelling a stop order
2523
2527
  :param bool [params.hf]: False, # True for hf order
2524
2528
  :param bool [params.sync]: False, # True to use the hf sync call
2525
2529
  :returns: Response from the exchange
@@ -2527,7 +2531,7 @@ class kucoin(Exchange, ImplicitAPI):
2527
2531
  await self.load_markets()
2528
2532
  request: dict = {}
2529
2533
  clientOrderId = self.safe_string_2(params, 'clientOid', 'clientOrderId')
2530
- stop = self.safe_bool_2(params, 'stop', 'trigger', False)
2534
+ trigger = self.safe_bool_2(params, 'stop', 'trigger', False)
2531
2535
  hf = None
2532
2536
  hf, params = self.handle_hf_and_params(params)
2533
2537
  useSync = False
@@ -2541,7 +2545,7 @@ class kucoin(Exchange, ImplicitAPI):
2541
2545
  params = self.omit(params, ['clientOid', 'clientOrderId', 'stop', 'trigger'])
2542
2546
  if clientOrderId is not None:
2543
2547
  request['clientOid'] = clientOrderId
2544
- if stop:
2548
+ if trigger:
2545
2549
  response = await self.privateDeleteStopOrderCancelOrderByClientOid(self.extend(request, params))
2546
2550
  #
2547
2551
  # {
@@ -2580,7 +2584,7 @@ class kucoin(Exchange, ImplicitAPI):
2580
2584
  return self.parse_order(response)
2581
2585
  else:
2582
2586
  request['orderId'] = id
2583
- if stop:
2587
+ if trigger:
2584
2588
  response = await self.privateDeleteStopOrderOrderId(self.extend(request, params))
2585
2589
  #
2586
2590
  # {
@@ -2628,7 +2632,7 @@ class kucoin(Exchange, ImplicitAPI):
2628
2632
 
2629
2633
  :param str symbol: unified market symbol, only orders in the market of self symbol are cancelled when symbol is not None
2630
2634
  :param dict [params]: extra parameters specific to the exchange API endpoint
2631
- :param bool [params.stop]: *invalid for isolated margin* True if cancelling all stop orders
2635
+ :param bool [params.trigger]: *invalid for isolated margin* True if cancelling all stop orders
2632
2636
  :param str [params.marginMode]: 'cross' or 'isolated'
2633
2637
  :param str [params.orderIds]: *stop orders only* Comma seperated order IDs
2634
2638
  :param bool [params.hf]: False, # True for hf order
@@ -2636,7 +2640,7 @@ class kucoin(Exchange, ImplicitAPI):
2636
2640
  """
2637
2641
  await self.load_markets()
2638
2642
  request: dict = {}
2639
- stop = self.safe_bool(params, 'stop', False)
2643
+ trigger = self.safe_bool(params, 'stop', False)
2640
2644
  hf = None
2641
2645
  hf, params = self.handle_hf_and_params(params)
2642
2646
  params = self.omit(params, 'stop')
@@ -2645,10 +2649,10 @@ class kucoin(Exchange, ImplicitAPI):
2645
2649
  request['symbol'] = self.market_id(symbol)
2646
2650
  if marginMode is not None:
2647
2651
  request['tradeType'] = self.options['marginModes'][marginMode]
2648
- if marginMode == 'isolated' and stop:
2652
+ if marginMode == 'isolated' and trigger:
2649
2653
  raise BadRequest(self.id + ' cancelAllOrders does not support isolated margin for stop orders')
2650
2654
  response = None
2651
- if stop:
2655
+ if trigger:
2652
2656
  response = await self.privateDeleteStopOrderCancel(self.extend(request, query))
2653
2657
  elif hf:
2654
2658
  if symbol is None:
@@ -2677,9 +2681,9 @@ class kucoin(Exchange, ImplicitAPI):
2677
2681
  :param str [params.side]: buy or sell
2678
2682
  :param str [params.type]: limit, market, limit_stop or market_stop
2679
2683
  :param str [params.tradeType]: TRADE for spot trading, MARGIN_TRADE for Margin Trading
2680
- :param int [params.currentPage]: *stop orders only* current page
2681
- :param str [params.orderIds]: *stop orders only* comma seperated order ID list
2682
- :param bool [params.stop]: True if fetching a stop order
2684
+ :param int [params.currentPage]: *trigger orders only* current page
2685
+ :param str [params.orderIds]: *trigger orders only* comma seperated order ID list
2686
+ :param bool [params.trigger]: True if fetching a trigger order
2683
2687
  :param bool [params.hf]: False, # True for hf order
2684
2688
  :returns: An `array of order structures <https://docs.ccxt.com/#/?id=order-structure>`
2685
2689
  """
@@ -2788,7 +2792,7 @@ class kucoin(Exchange, ImplicitAPI):
2788
2792
  :param str [params.side]: buy or sell
2789
2793
  :param str [params.type]: limit, market, limit_stop or market_stop
2790
2794
  :param str [params.tradeType]: TRADE for spot trading, MARGIN_TRADE for Margin Trading
2791
- :param bool [params.stop]: True if fetching a stop order
2795
+ :param bool [params.trigger]: True if fetching a trigger order
2792
2796
  :param bool [params.hf]: False, # True for hf order
2793
2797
  :param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
2794
2798
  :returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
@@ -2814,12 +2818,12 @@ class kucoin(Exchange, ImplicitAPI):
2814
2818
  :param int [limit]: the maximum number of open orders structures to retrieve
2815
2819
  :param dict [params]: extra parameters specific to the exchange API endpoint
2816
2820
  :param int [params.until]: end time in ms
2817
- :param bool [params.stop]: True if fetching stop orders
2821
+ :param bool [params.trigger]: True if fetching trigger orders
2818
2822
  :param str [params.side]: buy or sell
2819
2823
  :param str [params.type]: limit, market, limit_stop or market_stop
2820
2824
  :param str [params.tradeType]: TRADE for spot trading, MARGIN_TRADE for Margin Trading
2821
- :param int [params.currentPage]: *stop orders only* current page
2822
- :param str [params.orderIds]: *stop orders only* comma seperated order ID list
2825
+ :param int [params.currentPage]: *trigger orders only* current page
2826
+ :param str [params.orderIds]: *trigger orders only* comma seperated order ID list
2823
2827
  :param bool [params.hf]: False, # True for hf order
2824
2828
  :param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
2825
2829
  :returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
@@ -2843,9 +2847,9 @@ class kucoin(Exchange, ImplicitAPI):
2843
2847
  https://docs.kucoin.com/spot-hf/#obtain-details-of-a-single-hf-order-using-clientoid
2844
2848
 
2845
2849
  :param str id: Order id
2846
- :param str symbol: not sent to exchange except for stop orders with clientOid, but used internally by CCXT to filter
2850
+ :param str symbol: not sent to exchange except for trigger orders with clientOid, but used internally by CCXT to filter
2847
2851
  :param dict [params]: exchange specific parameters
2848
- :param bool [params.stop]: True if fetching a stop order
2852
+ :param bool [params.trigger]: True if fetching a trigger order
2849
2853
  :param bool [params.hf]: False, # True for hf order
2850
2854
  :param bool [params.clientOid]: unique order id created by users to identify their orders
2851
2855
  :returns: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
@@ -2853,7 +2857,7 @@ class kucoin(Exchange, ImplicitAPI):
2853
2857
  await self.load_markets()
2854
2858
  request: dict = {}
2855
2859
  clientOrderId = self.safe_string_2(params, 'clientOid', 'clientOrderId')
2856
- stop = self.safe_bool_2(params, 'stop', 'trigger', False)
2860
+ trigger = self.safe_bool_2(params, 'stop', 'trigger', False)
2857
2861
  hf = None
2858
2862
  hf, params = self.handle_hf_and_params(params)
2859
2863
  market = None
@@ -2867,7 +2871,7 @@ class kucoin(Exchange, ImplicitAPI):
2867
2871
  response = None
2868
2872
  if clientOrderId is not None:
2869
2873
  request['clientOid'] = clientOrderId
2870
- if stop:
2874
+ if trigger:
2871
2875
  if symbol is not None:
2872
2876
  request['symbol'] = market['id']
2873
2877
  response = await self.privateGetStopOrderQueryOrderByClientOid(self.extend(request, params))
@@ -2882,7 +2886,7 @@ class kucoin(Exchange, ImplicitAPI):
2882
2886
  if id is None:
2883
2887
  raise InvalidOrder(self.id + ' fetchOrder() requires an order id')
2884
2888
  request['orderId'] = id
2885
- if stop:
2889
+ if trigger:
2886
2890
  response = await self.privateGetStopOrderOrderId(self.extend(request, params))
2887
2891
  elif hf:
2888
2892
  response = await self.privateGetHfOrdersOrderId(self.extend(request, params))
@@ -3020,7 +3024,7 @@ class kucoin(Exchange, ImplicitAPI):
3020
3024
  feeCurrencyId = self.safe_string(order, 'feeCurrency')
3021
3025
  cancelExist = self.safe_bool(order, 'cancelExist', False)
3022
3026
  responseStop = self.safe_string(order, 'stop')
3023
- stop = responseStop is not None
3027
+ trigger = responseStop is not None
3024
3028
  stopTriggered = self.safe_bool(order, 'stopTriggered', False)
3025
3029
  isActive = self.safe_bool_2(order, 'isActive', 'active')
3026
3030
  responseStatus = self.safe_string(order, 'status')
@@ -3030,7 +3034,7 @@ class kucoin(Exchange, ImplicitAPI):
3030
3034
  status = 'open'
3031
3035
  else:
3032
3036
  status = 'closed'
3033
- if stop:
3037
+ if trigger:
3034
3038
  if responseStatus == 'NEW':
3035
3039
  status = 'open'
3036
3040
  elif not isActive and not stopTriggered:
@@ -4183,7 +4187,7 @@ class kucoin(Exchange, ImplicitAPI):
4183
4187
  :param boolean [params.hf]: default False, when True will fetch ledger entries for the high frequency trading account
4184
4188
  :param int [params.until]: the latest time in ms to fetch entries for
4185
4189
  :param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
4186
- :returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger-structure>`
4190
+ :returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
4187
4191
  """
4188
4192
  await self.load_markets()
4189
4193
  await self.load_accounts()
@@ -963,7 +963,7 @@ class luno(Exchange, ImplicitAPI):
963
963
  :param int [since]: timestamp in ms of the earliest ledger entry, default is None
964
964
  :param int [limit]: max number of ledger entries to return, default is None
965
965
  :param dict [params]: extra parameters specific to the exchange API endpoint
966
- :returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger-structure>`
966
+ :returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
967
967
  """
968
968
  await self.load_markets()
969
969
  await self.load_accounts()
@@ -689,6 +689,143 @@ class mexc(Exchange, ImplicitAPI):
689
689
  'maxTimeTillEnd': 90 * 86400 * 1000 - 1, # 90 days
690
690
  'broker': 'CCXT',
691
691
  },
692
+ 'features': {
693
+ 'default': {
694
+ 'sandbox': False,
695
+ 'createOrder': {
696
+ 'marginMode': True,
697
+ 'triggerPrice': False,
698
+ 'triggerDirection': False,
699
+ 'triggerPriceType': {
700
+ 'last': False,
701
+ 'mark': False,
702
+ 'index': False,
703
+ },
704
+ 'stopLossPrice': False, # todo
705
+ 'takeProfitPrice': False,
706
+ 'attachedStopLossTakeProfit': None,
707
+ 'timeInForce': {
708
+ 'IOC': True,
709
+ 'FOK': True,
710
+ 'PO': True,
711
+ 'GTD': False,
712
+ },
713
+ 'hedged': False,
714
+ # exchange-supported features
715
+ 'selfTradePrevention': False,
716
+ 'trailing': False,
717
+ 'iceberg': False,
718
+ },
719
+ 'createOrders': {
720
+ 'max': 20,
721
+ },
722
+ 'fetchMyTrades': {
723
+ 'marginMode': False,
724
+ 'limit': 100,
725
+ 'daysBack': 30,
726
+ 'untilDays': None,
727
+ },
728
+ 'fetchOrder': {
729
+ 'marginMode': False,
730
+ 'trigger': False,
731
+ 'trailing': False,
732
+ },
733
+ 'fetchOpenOrders': {
734
+ 'marginMode': True,
735
+ 'limit': None,
736
+ 'trigger': False,
737
+ 'trailing': False,
738
+ },
739
+ 'fetchOrders': {
740
+ 'marginMode': True,
741
+ 'limit': 1000,
742
+ 'daysBack': 7,
743
+ 'untilDays': 7,
744
+ 'trigger': False,
745
+ 'trailing': False,
746
+ },
747
+ 'fetchClosedOrders': {
748
+ 'marginMode': True,
749
+ 'limit': 1000,
750
+ 'daysBackClosed': 7,
751
+ 'daysBackCanceled': 7,
752
+ 'untilDays': 7,
753
+ 'trigger': False,
754
+ 'trailing': False,
755
+ },
756
+ 'fetchOHLCV': {
757
+ 'limit': 1000,
758
+ },
759
+ },
760
+ 'spot': {
761
+ 'extends': 'default',
762
+ },
763
+ 'forDerivs': {
764
+ 'extends': 'default',
765
+ 'createOrder': {
766
+ 'triggerPrice': True,
767
+ 'triggerPriceType': {
768
+ 'last': True,
769
+ 'mark': True,
770
+ 'index': True,
771
+ },
772
+ 'triggerDirection': True,
773
+ 'stopLossPrice': False, # todo
774
+ 'takeProfitPrice': False,
775
+ 'hedged': True,
776
+ },
777
+ 'createOrders': {
778
+ 'max': 50,
779
+ },
780
+ 'fetchMyTrades': {
781
+ 'marginMode': False,
782
+ 'limit': 100,
783
+ 'daysBack': 90,
784
+ 'untilDays': 90,
785
+ },
786
+ 'fetchOrder': {
787
+ 'marginMode': False,
788
+ },
789
+ 'fetchOpenOrders': {
790
+ 'marginMode': False,
791
+ 'limit': 100,
792
+ 'trigger': True,
793
+ 'trailing': False,
794
+ },
795
+ 'fetchOrders': {
796
+ 'marginMode': False,
797
+ 'limit': 100,
798
+ 'daysBack': 90,
799
+ 'untilDays': 90,
800
+ 'trigger': True,
801
+ 'trailing': False,
802
+ },
803
+ 'fetchClosedOrders': {
804
+ 'marginMode': False,
805
+ 'limit': 100,
806
+ 'daysBackClosed': 90,
807
+ 'daysBackCanceled': None,
808
+ 'untilDays': 90,
809
+ 'trigger': True,
810
+ 'trailing': False,
811
+ },
812
+ 'fetchOHLCV': {
813
+ 'limit': 2000,
814
+ },
815
+ },
816
+ 'swap': {
817
+ 'linear': {
818
+ 'extends': 'forDerivs',
819
+ },
820
+ 'inverse': {
821
+ 'extends': 'forDerivs',
822
+ },
823
+ },
824
+ 'future': {
825
+ 'linear': None,
826
+ 'inverse': None,
827
+ },
828
+ },
692
829
  'commonCurrencies': {
693
830
  'BEYONDPROTOCOL': 'BEYOND',
694
831
  'BIFI': 'BIFIF',
@@ -2161,7 +2298,6 @@ class mexc(Exchange, ImplicitAPI):
2161
2298
  :param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
2162
2299
  :param str [marginMode]: only 'isolated' is supported for spot-margin trading
2163
2300
  :param dict [params]: extra parameters specific to the exchange API endpoint
2164
- :param float [params.triggerPrice]: The price at which a trigger order is triggered at
2165
2301
  :param bool [params.postOnly]: if True, the order will only be posted if it will be a maker order
2166
2302
  :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
2167
2303
  """
@@ -1194,7 +1194,7 @@ class ndax(Exchange, ImplicitAPI):
1194
1194
  :param int [since]: timestamp in ms of the earliest ledger entry, default is None
1195
1195
  :param int [limit]: max number of ledger entries to return, default is None
1196
1196
  :param dict [params]: extra parameters specific to the exchange API endpoint
1197
- :returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger-structure>`
1197
+ :returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
1198
1198
  """
1199
1199
  omsId = self.safe_integer(self.options, 'omsId', 1)
1200
1200
  await self.load_markets()