ccxt 4.1.84__py2.py3-none-any.whl → 4.1.86__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 (65) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/alpaca.py +1 -1
  3. ccxt/ascendex.py +1 -1
  4. ccxt/async_support/__init__.py +1 -1
  5. ccxt/async_support/alpaca.py +1 -1
  6. ccxt/async_support/ascendex.py +1 -1
  7. ccxt/async_support/base/exchange.py +7 -2
  8. ccxt/async_support/binance.py +1 -1
  9. ccxt/async_support/bingx.py +9 -8
  10. ccxt/async_support/bitget.py +1 -2
  11. ccxt/async_support/bithumb.py +2 -2
  12. ccxt/async_support/bitmart.py +90 -73
  13. ccxt/async_support/bitmex.py +1 -1
  14. ccxt/async_support/bitopro.py +2 -2
  15. ccxt/async_support/bybit.py +2 -4
  16. ccxt/async_support/coinex.py +2 -1
  17. ccxt/async_support/cryptocom.py +2 -2
  18. ccxt/async_support/digifinex.py +119 -103
  19. ccxt/async_support/hitbtc.py +1 -1
  20. ccxt/async_support/htx.py +1 -1
  21. ccxt/async_support/kraken.py +1 -1
  22. ccxt/async_support/krakenfutures.py +2 -2
  23. ccxt/async_support/kucoin.py +1 -5
  24. ccxt/async_support/kucoinfutures.py +0 -3
  25. ccxt/async_support/latoken.py +1 -1
  26. ccxt/async_support/mexc.py +76 -49
  27. ccxt/async_support/okx.py +3 -3
  28. ccxt/async_support/p2b.py +0 -2
  29. ccxt/async_support/poloniex.py +42 -42
  30. ccxt/async_support/probit.py +25 -17
  31. ccxt/async_support/tokocrypto.py +6 -3
  32. ccxt/base/exchange.py +21 -8
  33. ccxt/binance.py +1 -1
  34. ccxt/bingx.py +9 -8
  35. ccxt/bitget.py +1 -2
  36. ccxt/bitmart.py +90 -73
  37. ccxt/bitmex.py +1 -1
  38. ccxt/bybit.py +2 -4
  39. ccxt/coinex.py +2 -1
  40. ccxt/cryptocom.py +2 -2
  41. ccxt/digifinex.py +119 -103
  42. ccxt/hitbtc.py +1 -1
  43. ccxt/htx.py +1 -1
  44. ccxt/kraken.py +1 -1
  45. ccxt/krakenfutures.py +2 -2
  46. ccxt/kucoin.py +1 -5
  47. ccxt/kucoinfutures.py +0 -3
  48. ccxt/latoken.py +1 -1
  49. ccxt/mexc.py +76 -49
  50. ccxt/okx.py +3 -3
  51. ccxt/p2b.py +0 -2
  52. ccxt/poloniex.py +42 -42
  53. ccxt/pro/__init__.py +1 -1
  54. ccxt/pro/bitmart.py +965 -247
  55. ccxt/pro/bitmex.py +200 -2
  56. ccxt/pro/krakenfutures.py +4 -4
  57. ccxt/pro/mexc.py +1 -1
  58. ccxt/pro/poloniex.py +1 -1
  59. ccxt/pro/poloniexfutures.py +3 -3
  60. ccxt/probit.py +25 -17
  61. ccxt/tokocrypto.py +6 -3
  62. {ccxt-4.1.84.dist-info → ccxt-4.1.86.dist-info}/METADATA +6 -5
  63. {ccxt-4.1.84.dist-info → ccxt-4.1.86.dist-info}/RECORD +65 -65
  64. {ccxt-4.1.84.dist-info → ccxt-4.1.86.dist-info}/WHEEL +0 -0
  65. {ccxt-4.1.84.dist-info → ccxt-4.1.86.dist-info}/top_level.txt +0 -0
@@ -536,9 +536,13 @@ class digifinex(Exchange, ImplicitAPI):
536
536
  async def fetch_markets_v2(self, params={}):
537
537
  defaultType = self.safe_string(self.options, 'defaultType')
538
538
  marginMode, query = self.handle_margin_mode_and_params('fetchMarketsV2', params)
539
- method = 'publicSpotGetMarginSymbols' if (marginMode is not None) else 'publicSpotGetTradesSymbols'
540
- promises = [getattr(self, method)(query), self.publicSwapGetPublicInstruments(params)]
541
- promises = await asyncio.gather(*promises)
539
+ promisesRaw = []
540
+ if marginMode is not None:
541
+ promisesRaw.append(self.publicSpotGetMarginSymbols(query))
542
+ else:
543
+ promisesRaw.append(self.publicSpotGetTradesSymbols(query))
544
+ promisesRaw.append(self.publicSwapGetPublicInstruments(params))
545
+ promises = await asyncio.gather(*promisesRaw)
542
546
  spotMarkets = promises[0]
543
547
  swapMarkets = promises[1]
544
548
  #
@@ -809,16 +813,17 @@ class digifinex(Exchange, ImplicitAPI):
809
813
  await self.load_markets()
810
814
  marketType = None
811
815
  marketType, params = self.handle_market_type_and_params('fetchBalance', None, params)
812
- method = self.get_supported_mapping(marketType, {
813
- 'spot': 'privateSpotGetSpotAssets',
814
- 'margin': 'privateSpotGetMarginAssets',
815
- 'swap': 'privateSwapGetAccountBalance',
816
- })
817
816
  marginMode, query = self.handle_margin_mode_and_params('fetchBalance', params)
818
- if marginMode is not None:
819
- method = 'privateSpotGetMarginAssets'
817
+ response = None
818
+ if marginMode is not None or marketType == 'margin':
820
819
  marketType = 'margin'
821
- response = await getattr(self, method)(query)
820
+ response = await self.privateSpotGetMarginAssets(query)
821
+ elif marketType == 'spot':
822
+ response = await self.privateSpotGetSpotAssets(query)
823
+ elif marketType == 'swap':
824
+ response = await self.privateSwapGetAccountBalance(query)
825
+ else:
826
+ raise NotSupported(self.id + ' fetchBalance() not support self market type')
822
827
  #
823
828
  # spot and margin
824
829
  #
@@ -873,16 +878,15 @@ class digifinex(Exchange, ImplicitAPI):
873
878
  market = self.market(symbol)
874
879
  marketType, query = self.handle_market_type_and_params('fetchOrderBook', market, params)
875
880
  request = {}
876
- method = None
881
+ if limit is not None:
882
+ request['limit'] = limit
883
+ response = None
877
884
  if marketType == 'swap':
878
- method = 'publicSwapGetPublicDepth'
879
885
  request['instrument_id'] = market['id']
886
+ response = await self.publicSwapGetPublicDepth(self.extend(request, query))
880
887
  else:
881
- method = 'publicSpotGetOrderBook'
882
888
  request['symbol'] = market['id']
883
- if limit is not None:
884
- request['limit'] = limit
885
- response = await getattr(self, method)(self.extend(request, query))
889
+ response = await self.publicSpotGetOrderBook(self.extend(request, query))
886
890
  #
887
891
  # spot
888
892
  #
@@ -948,11 +952,12 @@ class digifinex(Exchange, ImplicitAPI):
948
952
  market = self.market(first)
949
953
  type = None
950
954
  type, params = self.handle_market_type_and_params('fetchTickers', market, params)
951
- method = 'publicSpotGetTicker'
952
955
  request = {}
956
+ response = None
953
957
  if type == 'swap':
954
- method = 'publicSwapGetPublicTickers'
955
- response = await getattr(self, method)(self.extend(request, params))
958
+ response = await self.publicSwapGetPublicTickers(self.extend(request, params))
959
+ else:
960
+ response = await self.publicSpotGetTicker(self.extend(request, params))
956
961
  #
957
962
  # spot
958
963
  #
@@ -1024,14 +1029,14 @@ class digifinex(Exchange, ImplicitAPI):
1024
1029
  """
1025
1030
  await self.load_markets()
1026
1031
  market = self.market(symbol)
1027
- method = 'publicSpotGetTicker'
1028
1032
  request = {}
1033
+ response = None
1029
1034
  if market['swap']:
1030
- method = 'publicSwapGetPublicTicker'
1031
1035
  request['instrument_id'] = market['id']
1036
+ response = await self.publicSwapGetPublicTicker(self.extend(request, params))
1032
1037
  else:
1033
1038
  request['symbol'] = market['id']
1034
- response = await getattr(self, method)(self.extend(request, params))
1039
+ response = await self.publicSpotGetTicker(self.extend(request, params))
1035
1040
  #
1036
1041
  # spot
1037
1042
  #
@@ -1337,16 +1342,16 @@ class digifinex(Exchange, ImplicitAPI):
1337
1342
  """
1338
1343
  await self.load_markets()
1339
1344
  market = self.market(symbol)
1340
- method = 'publicSpotGetTrades'
1341
1345
  request = {}
1346
+ if limit is not None:
1347
+ request['limit'] = min(limit, 100) if market['swap'] else limit
1348
+ response = None
1342
1349
  if market['swap']:
1343
- method = 'publicSwapGetPublicTrades'
1344
1350
  request['instrument_id'] = market['id']
1351
+ response = await self.publicSwapGetPublicTrades(self.extend(request, params))
1345
1352
  else:
1346
1353
  request['symbol'] = market['id']
1347
- if limit is not None:
1348
- request['limit'] = min(limit, 100) if market['swap'] else limit
1349
- response = await getattr(self, method)(self.extend(request, params))
1354
+ response = await self.publicSpotGetTrades(self.extend(request, params))
1350
1355
  #
1351
1356
  # spot
1352
1357
  #
@@ -1435,14 +1440,14 @@ class digifinex(Exchange, ImplicitAPI):
1435
1440
  """
1436
1441
  await self.load_markets()
1437
1442
  market = self.market(symbol)
1438
- method = 'publicSpotGetKline'
1439
1443
  request = {}
1444
+ response = None
1440
1445
  if market['swap']:
1441
- method = 'publicSwapGetPublicCandles'
1442
1446
  request['instrument_id'] = market['id']
1443
1447
  request['granularity'] = timeframe
1444
1448
  if limit is not None:
1445
1449
  request['limit'] = limit
1450
+ response = await self.publicSwapGetPublicCandles(self.extend(request, params))
1446
1451
  else:
1447
1452
  request['symbol'] = market['id']
1448
1453
  request['period'] = self.safe_string(self.timeframes, timeframe, timeframe)
@@ -1456,7 +1461,7 @@ class digifinex(Exchange, ImplicitAPI):
1456
1461
  endTime = self.seconds()
1457
1462
  duration = self.parse_timeframe(timeframe)
1458
1463
  request['start_time'] = self.sum(endTime, -limit * duration)
1459
- response = await getattr(self, method)(self.extend(request, params))
1464
+ response = await self.publicSpotGetKline(self.extend(request, params))
1460
1465
  #
1461
1466
  # spot
1462
1467
  #
@@ -1551,7 +1556,7 @@ class digifinex(Exchange, ImplicitAPI):
1551
1556
  create a list of trade orders(all orders should be of the same symbol)
1552
1557
  :see: https://docs.digifinex.com/en-ww/spot/v3/rest.html#create-multiple-order
1553
1558
  :see: https://docs.digifinex.com/en-ww/swap/v2/rest.html#batchorder
1554
- :param array orders: list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
1559
+ :param Array orders: list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
1555
1560
  :param dict [params]: extra parameters specific to the exchange API endpoint
1556
1561
  :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
1557
1562
  """
@@ -1750,18 +1755,9 @@ class digifinex(Exchange, ImplicitAPI):
1750
1755
  market = None
1751
1756
  if symbol is not None:
1752
1757
  market = self.market(symbol)
1758
+ id = str(id)
1753
1759
  marketType = None
1754
1760
  marketType, params = self.handle_market_type_and_params('cancelOrder', market, params)
1755
- method = self.get_supported_mapping(marketType, {
1756
- 'spot': 'privateSpotPostSpotOrderCancel',
1757
- 'margin': 'privateSpotPostMarginOrderCancel',
1758
- 'swap': 'privateSwapPostTradeCancelOrder',
1759
- })
1760
- marginMode, query = self.handle_margin_mode_and_params('cancelOrder', params)
1761
- if marginMode is not None:
1762
- method = 'privateSpotPostMarginOrderCancel'
1763
- marketType = 'margin'
1764
- id = str(id)
1765
1761
  request = {
1766
1762
  'order_id': id,
1767
1763
  }
@@ -1771,7 +1767,17 @@ class digifinex(Exchange, ImplicitAPI):
1771
1767
  request['instrument_id'] = market['id']
1772
1768
  else:
1773
1769
  request['market'] = marketType
1774
- response = await getattr(self, method)(self.extend(request, query))
1770
+ marginMode, query = self.handle_margin_mode_and_params('cancelOrder', params)
1771
+ response = None
1772
+ if marginMode is not None or marketType == 'margin':
1773
+ marketType = 'margin'
1774
+ response = await self.privateSpotPostMarginOrderCancel(self.extend(request, query))
1775
+ elif marketType == 'spot':
1776
+ response = await self.privateSpotPostSpotOrderCancel(self.extend(request, query))
1777
+ elif marketType == 'swap':
1778
+ response = await self.privateSwapPostTradeCancelOrder(self.extend(request, query))
1779
+ else:
1780
+ raise NotSupported(self.id + ' cancelOrder() not support self market type')
1775
1781
  #
1776
1782
  # spot and margin
1777
1783
  #
@@ -1995,15 +2001,7 @@ class digifinex(Exchange, ImplicitAPI):
1995
2001
  market = self.market(symbol)
1996
2002
  marketType = None
1997
2003
  marketType, params = self.handle_market_type_and_params('fetchOpenOrders', market, params)
1998
- method = self.get_supported_mapping(marketType, {
1999
- 'spot': 'privateSpotGetSpotOrderCurrent',
2000
- 'margin': 'privateSpotGetMarginOrderCurrent',
2001
- 'swap': 'privateSwapGetTradeOpenOrders',
2002
- })
2003
2004
  marginMode, query = self.handle_margin_mode_and_params('fetchOpenOrders', params)
2004
- if marginMode is not None:
2005
- method = 'privateSpotGetMarginOrderCurrent'
2006
- marketType = 'margin'
2007
2005
  request = {}
2008
2006
  swap = (marketType == 'swap')
2009
2007
  if swap:
@@ -2016,7 +2014,16 @@ class digifinex(Exchange, ImplicitAPI):
2016
2014
  if market is not None:
2017
2015
  marketIdRequest = 'instrument_id' if swap else 'symbol'
2018
2016
  request[marketIdRequest] = market['id']
2019
- response = await getattr(self, method)(self.extend(request, query))
2017
+ response = None
2018
+ if marginMode is not None or marketType == 'margin':
2019
+ marketType = 'margin'
2020
+ response = await self.privateSpotGetMarginOrderCurrent(self.extend(request, query))
2021
+ elif marketType == 'spot':
2022
+ response = await self.privateSpotGetSpotOrderCurrent(self.extend(request, query))
2023
+ elif marketType == 'swap':
2024
+ response = await self.privateSwapGetTradeOpenOrders(self.extend(request, query))
2025
+ else:
2026
+ raise NotSupported(self.id + ' fetchOpenOrders() not support self market type')
2020
2027
  #
2021
2028
  # spot and margin
2022
2029
  #
@@ -2088,15 +2095,7 @@ class digifinex(Exchange, ImplicitAPI):
2088
2095
  market = self.market(symbol)
2089
2096
  marketType = None
2090
2097
  marketType, params = self.handle_market_type_and_params('fetchOrders', market, params)
2091
- method = self.get_supported_mapping(marketType, {
2092
- 'spot': 'privateSpotGetSpotOrderHistory',
2093
- 'margin': 'privateSpotGetMarginOrderHistory',
2094
- 'swap': 'privateSwapGetTradeHistoryOrders',
2095
- })
2096
2098
  marginMode, query = self.handle_margin_mode_and_params('fetchOrders', params)
2097
- if marginMode is not None:
2098
- method = 'privateSpotGetMarginOrderHistory'
2099
- marketType = 'margin'
2100
2099
  request = {}
2101
2100
  if marketType == 'swap':
2102
2101
  if since is not None:
@@ -2110,7 +2109,16 @@ class digifinex(Exchange, ImplicitAPI):
2110
2109
  request[marketIdRequest] = market['id']
2111
2110
  if limit is not None:
2112
2111
  request['limit'] = limit
2113
- response = await getattr(self, method)(self.extend(request, query))
2112
+ response = None
2113
+ if marginMode is not None or marketType == 'margin':
2114
+ marketType = 'margin'
2115
+ response = await self.privateSpotGetMarginOrderHistory(self.extend(request, query))
2116
+ elif marketType == 'spot':
2117
+ response = await self.privateSpotGetSpotOrderHistory(self.extend(request, query))
2118
+ elif marketType == 'swap':
2119
+ response = await self.privateSwapGetTradeHistoryOrders(self.extend(request, query))
2120
+ else:
2121
+ raise NotSupported(self.id + ' fetchOrders() not support self market type')
2114
2122
  #
2115
2123
  # spot and margin
2116
2124
  #
@@ -2181,15 +2189,7 @@ class digifinex(Exchange, ImplicitAPI):
2181
2189
  market = self.market(symbol)
2182
2190
  marketType = None
2183
2191
  marketType, params = self.handle_market_type_and_params('fetchOrder', market, params)
2184
- method = self.get_supported_mapping(marketType, {
2185
- 'spot': 'privateSpotGetSpotOrder',
2186
- 'margin': 'privateSpotGetMarginOrder',
2187
- 'swap': 'privateSwapGetTradeOrderInfo',
2188
- })
2189
2192
  marginMode, query = self.handle_margin_mode_and_params('fetchOrder', params)
2190
- if marginMode is not None:
2191
- method = 'privateSpotGetMarginOrder'
2192
- marketType = 'margin'
2193
2193
  request = {
2194
2194
  'order_id': id,
2195
2195
  }
@@ -2198,7 +2198,16 @@ class digifinex(Exchange, ImplicitAPI):
2198
2198
  request['instrument_id'] = market['id']
2199
2199
  else:
2200
2200
  request['market'] = marketType
2201
- response = await getattr(self, method)(self.extend(request, query))
2201
+ response = None
2202
+ if (marginMode is not None) or (marketType == 'margin'):
2203
+ marketType = 'margin'
2204
+ response = await self.privateSpotGetMarginOrder(self.extend(request, query))
2205
+ elif marketType == 'spot':
2206
+ response = await self.privateSpotGetSpotOrder(self.extend(request, query))
2207
+ elif marketType == 'swap':
2208
+ response = await self.privateSwapGetTradeOrderInfo(self.extend(request, query))
2209
+ else:
2210
+ raise NotSupported(self.id + ' fetchOrder() not support self market type')
2202
2211
  #
2203
2212
  # spot and margin
2204
2213
  #
@@ -2271,15 +2280,7 @@ class digifinex(Exchange, ImplicitAPI):
2271
2280
  market = self.market(symbol)
2272
2281
  marketType = None
2273
2282
  marketType, params = self.handle_market_type_and_params('fetchMyTrades', market, params)
2274
- method = self.get_supported_mapping(marketType, {
2275
- 'spot': 'privateSpotGetSpotMytrades',
2276
- 'margin': 'privateSpotGetMarginMytrades',
2277
- 'swap': 'privateSwapGetTradeHistoryTrades',
2278
- })
2279
2283
  marginMode, query = self.handle_margin_mode_and_params('fetchMyTrades', params)
2280
- if marginMode is not None:
2281
- method = 'privateSpotGetMarginMytrades'
2282
- marketType = 'margin'
2283
2284
  if marketType == 'swap':
2284
2285
  if since is not None:
2285
2286
  request['start_timestamp'] = since
@@ -2292,7 +2293,16 @@ class digifinex(Exchange, ImplicitAPI):
2292
2293
  request[marketIdRequest] = market['id']
2293
2294
  if limit is not None:
2294
2295
  request['limit'] = limit
2295
- response = await getattr(self, method)(self.extend(request, query))
2296
+ response = None
2297
+ if marginMode is not None or marketType == 'margin':
2298
+ marketType = 'margin'
2299
+ response = await self.privateSpotGetMarginMytrades(self.extend(request, query))
2300
+ elif marketType == 'spot':
2301
+ response = await self.privateSpotGetSpotMytrades(self.extend(request, query))
2302
+ elif marketType == 'swap':
2303
+ response = await self.privateSwapGetTradeHistoryTrades(self.extend(request, query))
2304
+ else:
2305
+ raise NotSupported(self.id + ' fetchMyTrades() not support self market type')
2296
2306
  #
2297
2307
  # spot and margin
2298
2308
  #
@@ -2407,15 +2417,7 @@ class digifinex(Exchange, ImplicitAPI):
2407
2417
  request = {}
2408
2418
  marketType = None
2409
2419
  marketType, params = self.handle_market_type_and_params('fetchLedger', None, params)
2410
- method = self.get_supported_mapping(marketType, {
2411
- 'spot': 'privateSpotGetSpotFinancelog',
2412
- 'margin': 'privateSpotGetMarginFinancelog',
2413
- 'swap': 'privateSwapGetAccountFinanceRecord',
2414
- })
2415
2420
  marginMode, query = self.handle_margin_mode_and_params('fetchLedger', params)
2416
- if marginMode is not None:
2417
- method = 'privateSpotGetMarginFinancelog'
2418
- marketType = 'margin'
2419
2421
  if marketType == 'swap':
2420
2422
  if since is not None:
2421
2423
  request['start_timestamp'] = since
@@ -2430,7 +2432,16 @@ class digifinex(Exchange, ImplicitAPI):
2430
2432
  request[currencyIdRequest] = currency['id']
2431
2433
  if limit is not None:
2432
2434
  request['limit'] = limit
2433
- response = await getattr(self, method)(self.extend(request, query))
2435
+ response = None
2436
+ if marginMode is not None or marketType == 'margin':
2437
+ marketType = 'margin'
2438
+ response = await self.privateSpotGetMarginFinancelog(self.extend(request, query))
2439
+ elif marketType == 'spot':
2440
+ response = await self.privateSpotGetSpotFinancelog(self.extend(request, query))
2441
+ elif marketType == 'swap':
2442
+ response = await self.privateSwapGetAccountFinanceRecord(self.extend(request, query))
2443
+ else:
2444
+ raise NotSupported(self.id + ' fetchLedger() not support self market type')
2434
2445
  #
2435
2446
  # spot and margin
2436
2447
  #
@@ -2540,8 +2551,11 @@ class digifinex(Exchange, ImplicitAPI):
2540
2551
  request['currency'] = currency['id']
2541
2552
  if limit is not None:
2542
2553
  request['size'] = min(500, limit)
2543
- method = 'privateSpotGetDepositHistory' if (type == 'deposit') else 'privateSpotGetWithdrawHistory'
2544
- response = await getattr(self, method)(self.extend(request, params))
2554
+ response = None
2555
+ if type == 'deposit':
2556
+ response = await self.privateSpotGetDepositHistory(self.extend(request, params))
2557
+ else:
2558
+ response = await self.privateSpotGetWithdrawHistory(self.extend(request, params))
2545
2559
  #
2546
2560
  # {
2547
2561
  # "code": 200,
@@ -3134,12 +3148,13 @@ class digifinex(Exchange, ImplicitAPI):
3134
3148
  if market is not None:
3135
3149
  marketIdRequest = 'instrument_id' if (marketType == 'swap') else 'symbol'
3136
3150
  request[marketIdRequest] = market['id']
3137
- method = self.get_supported_mapping(marketType, {
3138
- 'spot': 'privateSpotGetMarginPositions',
3139
- 'margin': 'privateSpotGetMarginPositions',
3140
- 'swap': 'privateSwapGetAccountPositions',
3141
- })
3142
- response = await getattr(self, method)(self.extend(request, query))
3151
+ response = None
3152
+ if marketType == 'spot' or marketType == 'margin':
3153
+ response = await self.privateSpotGetMarginPositions(self.extend(request, query))
3154
+ elif marketType == 'swap':
3155
+ response = await self.privateSwapGetAccountPositions(self.extend(request, query))
3156
+ else:
3157
+ raise NotSupported(self.id + ' fetchPositions() not support self market type')
3143
3158
  #
3144
3159
  # swap
3145
3160
  #
@@ -3217,14 +3232,15 @@ class digifinex(Exchange, ImplicitAPI):
3217
3232
  marginMode, query = self.handle_margin_mode_and_params('fetchPosition', params)
3218
3233
  if marginMode is not None:
3219
3234
  marketType = 'margin'
3220
- method = self.get_supported_mapping(marketType, {
3221
- 'spot': 'privateSpotGetMarginPositions',
3222
- 'margin': 'privateSpotGetMarginPositions',
3223
- 'swap': 'privateSwapGetAccountPositions',
3224
- })
3225
3235
  marketIdRequest = 'instrument_id' if (marketType == 'swap') else 'symbol'
3226
3236
  request[marketIdRequest] = market['id']
3227
- response = await getattr(self, method)(self.extend(request, query))
3237
+ response = None
3238
+ if marketType == 'spot' or marketType == 'margin':
3239
+ response = await self.privateSpotGetMarginPositions(self.extend(request, query))
3240
+ elif marketType == 'swap':
3241
+ response = await self.privateSwapGetAccountPositions(self.extend(request, query))
3242
+ else:
3243
+ raise NotSupported(self.id + ' fetchPosition() not support self market type')
3228
3244
  #
3229
3245
  # swap
3230
3246
  #
@@ -3635,7 +3651,7 @@ class digifinex(Exchange, ImplicitAPI):
3635
3651
  * @ignore
3636
3652
  marginMode specified by params["marginMode"], self.options["marginMode"], self.options["defaultMarginMode"], params["margin"] = True or self.options["defaultType"] = 'margin'
3637
3653
  :param dict [params]: extra parameters specific to the exchange API endpoint
3638
- :returns array: the marginMode in lowercase
3654
+ :returns Array: the marginMode in lowercase
3639
3655
  """
3640
3656
  defaultType = self.safe_string(self.options, 'defaultType')
3641
3657
  isMargin = self.safe_value(params, 'margin', False)
@@ -3269,7 +3269,7 @@ class hitbtc(Exchange, ImplicitAPI):
3269
3269
  * @ignore
3270
3270
  marginMode specified by params["marginMode"], self.options["marginMode"], self.options["defaultMarginMode"], params["margin"] = True or self.options["defaultType"] = 'margin'
3271
3271
  :param dict [params]: extra parameters specific to the exchange API endpoint
3272
- :returns array: the marginMode in lowercase
3272
+ :returns Array: the marginMode in lowercase
3273
3273
  """
3274
3274
  defaultType = self.safe_string(self.options, 'defaultType')
3275
3275
  isMargin = self.safe_value(params, 'margin', False)
ccxt/async_support/htx.py CHANGED
@@ -4881,7 +4881,7 @@ class htx(Exchange, ImplicitAPI):
4881
4881
  :see: https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#place-a-batch-of-orders
4882
4882
  :see: https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-place-a-batch-of-orders
4883
4883
  :see: https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-place-a-batch-of-orders
4884
- :param array orders: list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
4884
+ :param Array orders: list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
4885
4885
  :param dict [params]: extra parameters specific to the exchange API endpoint
4886
4886
  :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
4887
4887
  """
@@ -2211,7 +2211,7 @@ class kraken(Exchange, ImplicitAPI):
2211
2211
  :param dict [params.end]: End timestamp, withdrawals created strictly after will be not be included in the response
2212
2212
  :param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times
2213
2213
  :returns dict[]: a list of `transaction structures <https://docs.ccxt.com/#/?id=transaction-structure>`
2214
- """
2214
+ """
2215
2215
  await self.load_markets()
2216
2216
  paginate = False
2217
2217
  paginate, params = self.handle_option_and_params(params, 'fetchWithdrawals', 'paginate')
@@ -657,7 +657,7 @@ class krakenfutures(Exchange, ImplicitAPI):
657
657
  async def fetch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
658
658
  """
659
659
  :see: https://docs.futures.kraken.com/#http-api-trading-v3-api-market-data-get-trade-history
660
- * @descriptions Fetch a history of filled trades that self account has made
660
+ Fetch a history of filled trades that self account has made
661
661
  :param str symbol: Unified CCXT market symbol
662
662
  :param int [since]: Timestamp in ms of earliest trade. Not used by krakenfutures except in combination with params.until
663
663
  :param int [limit]: Total number of trades, cannot exceed 100
@@ -903,7 +903,7 @@ class krakenfutures(Exchange, ImplicitAPI):
903
903
  """
904
904
  create a list of trade orders
905
905
  :see: https://docs.futures.kraken.com/#http-api-trading-v3-api-order-management-batch-order-management
906
- :param array orders: list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
906
+ :param Array orders: list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
907
907
  :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
908
908
  """
909
909
  await self.load_markets()
@@ -508,11 +508,7 @@ class kucoin(Exchange, ImplicitAPI):
508
508
  },
509
509
  'commonCurrencies': {
510
510
  'BIFI': 'BIFIF',
511
- 'EDGE': 'DADI', # https://github.com/ccxt/ccxt/issues/5756
512
- 'HOT': 'HOTNOW',
513
- 'TRY': 'Trias',
514
511
  'VAI': 'VAIOT',
515
- 'WAX': 'WAXP',
516
512
  },
517
513
  'options': {
518
514
  'version': 'v1',
@@ -1882,7 +1878,7 @@ class kucoin(Exchange, ImplicitAPI):
1882
1878
  create a list of trade orders
1883
1879
  :see: https://www.kucoin.com/docs/rest/spot-trading/orders/place-multiple-orders
1884
1880
  :see: https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/place-multiple-hf-orders
1885
- :param array orders: list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
1881
+ :param Array orders: list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
1886
1882
  :param dict [params]: extra parameters specific to the exchange API endpoint
1887
1883
  :param bool [params.hf]: False, # True for hf orders
1888
1884
  :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
@@ -692,9 +692,6 @@ class kucoinfutures(kucoin, ImplicitAPI):
692
692
  orderbook['nonce'] = self.safe_integer(data, 'sequence')
693
693
  return orderbook
694
694
 
695
- async def fetch_l3_order_book(self, symbol: str, limit: Int = None, params={}):
696
- raise BadRequest(self.id + ' fetchL3OrderBook() is not supported yet')
697
-
698
695
  async def fetch_ticker(self, symbol: str, params={}) -> Ticker:
699
696
  """
700
697
  fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
@@ -1044,7 +1044,7 @@ class latoken(Exchange, ImplicitAPI):
1044
1044
  :param dict [params]: extra parameters specific to the exchange API endpoint
1045
1045
  :param boolean [params.trigger]: True if fetching trigger orders
1046
1046
  :returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
1047
- """
1047
+ """
1048
1048
  if symbol is None:
1049
1049
  raise ArgumentsRequired(self.id + ' fetchOpenOrders() requires a symbol argument')
1050
1050
  await self.load_markets()