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
ccxt/digifinex.py CHANGED
@@ -535,9 +535,13 @@ class digifinex(Exchange, ImplicitAPI):
535
535
  def fetch_markets_v2(self, params={}):
536
536
  defaultType = self.safe_string(self.options, 'defaultType')
537
537
  marginMode, query = self.handle_margin_mode_and_params('fetchMarketsV2', params)
538
- method = 'publicSpotGetMarginSymbols' if (marginMode is not None) else 'publicSpotGetTradesSymbols'
539
- promises = [getattr(self, method)(query), self.publicSwapGetPublicInstruments(params)]
540
- promises = promises
538
+ promisesRaw = []
539
+ if marginMode is not None:
540
+ promisesRaw.append(self.publicSpotGetMarginSymbols(query))
541
+ else:
542
+ promisesRaw.append(self.publicSpotGetTradesSymbols(query))
543
+ promisesRaw.append(self.publicSwapGetPublicInstruments(params))
544
+ promises = promisesRaw
541
545
  spotMarkets = promises[0]
542
546
  swapMarkets = promises[1]
543
547
  #
@@ -808,16 +812,17 @@ class digifinex(Exchange, ImplicitAPI):
808
812
  self.load_markets()
809
813
  marketType = None
810
814
  marketType, params = self.handle_market_type_and_params('fetchBalance', None, params)
811
- method = self.get_supported_mapping(marketType, {
812
- 'spot': 'privateSpotGetSpotAssets',
813
- 'margin': 'privateSpotGetMarginAssets',
814
- 'swap': 'privateSwapGetAccountBalance',
815
- })
816
815
  marginMode, query = self.handle_margin_mode_and_params('fetchBalance', params)
817
- if marginMode is not None:
818
- method = 'privateSpotGetMarginAssets'
816
+ response = None
817
+ if marginMode is not None or marketType == 'margin':
819
818
  marketType = 'margin'
820
- response = getattr(self, method)(query)
819
+ response = self.privateSpotGetMarginAssets(query)
820
+ elif marketType == 'spot':
821
+ response = self.privateSpotGetSpotAssets(query)
822
+ elif marketType == 'swap':
823
+ response = self.privateSwapGetAccountBalance(query)
824
+ else:
825
+ raise NotSupported(self.id + ' fetchBalance() not support self market type')
821
826
  #
822
827
  # spot and margin
823
828
  #
@@ -872,16 +877,15 @@ class digifinex(Exchange, ImplicitAPI):
872
877
  market = self.market(symbol)
873
878
  marketType, query = self.handle_market_type_and_params('fetchOrderBook', market, params)
874
879
  request = {}
875
- method = None
880
+ if limit is not None:
881
+ request['limit'] = limit
882
+ response = None
876
883
  if marketType == 'swap':
877
- method = 'publicSwapGetPublicDepth'
878
884
  request['instrument_id'] = market['id']
885
+ response = self.publicSwapGetPublicDepth(self.extend(request, query))
879
886
  else:
880
- method = 'publicSpotGetOrderBook'
881
887
  request['symbol'] = market['id']
882
- if limit is not None:
883
- request['limit'] = limit
884
- response = getattr(self, method)(self.extend(request, query))
888
+ response = self.publicSpotGetOrderBook(self.extend(request, query))
885
889
  #
886
890
  # spot
887
891
  #
@@ -947,11 +951,12 @@ class digifinex(Exchange, ImplicitAPI):
947
951
  market = self.market(first)
948
952
  type = None
949
953
  type, params = self.handle_market_type_and_params('fetchTickers', market, params)
950
- method = 'publicSpotGetTicker'
951
954
  request = {}
955
+ response = None
952
956
  if type == 'swap':
953
- method = 'publicSwapGetPublicTickers'
954
- response = getattr(self, method)(self.extend(request, params))
957
+ response = self.publicSwapGetPublicTickers(self.extend(request, params))
958
+ else:
959
+ response = self.publicSpotGetTicker(self.extend(request, params))
955
960
  #
956
961
  # spot
957
962
  #
@@ -1023,14 +1028,14 @@ class digifinex(Exchange, ImplicitAPI):
1023
1028
  """
1024
1029
  self.load_markets()
1025
1030
  market = self.market(symbol)
1026
- method = 'publicSpotGetTicker'
1027
1031
  request = {}
1032
+ response = None
1028
1033
  if market['swap']:
1029
- method = 'publicSwapGetPublicTicker'
1030
1034
  request['instrument_id'] = market['id']
1035
+ response = self.publicSwapGetPublicTicker(self.extend(request, params))
1031
1036
  else:
1032
1037
  request['symbol'] = market['id']
1033
- response = getattr(self, method)(self.extend(request, params))
1038
+ response = self.publicSpotGetTicker(self.extend(request, params))
1034
1039
  #
1035
1040
  # spot
1036
1041
  #
@@ -1336,16 +1341,16 @@ class digifinex(Exchange, ImplicitAPI):
1336
1341
  """
1337
1342
  self.load_markets()
1338
1343
  market = self.market(symbol)
1339
- method = 'publicSpotGetTrades'
1340
1344
  request = {}
1345
+ if limit is not None:
1346
+ request['limit'] = min(limit, 100) if market['swap'] else limit
1347
+ response = None
1341
1348
  if market['swap']:
1342
- method = 'publicSwapGetPublicTrades'
1343
1349
  request['instrument_id'] = market['id']
1350
+ response = self.publicSwapGetPublicTrades(self.extend(request, params))
1344
1351
  else:
1345
1352
  request['symbol'] = market['id']
1346
- if limit is not None:
1347
- request['limit'] = min(limit, 100) if market['swap'] else limit
1348
- response = getattr(self, method)(self.extend(request, params))
1353
+ response = self.publicSpotGetTrades(self.extend(request, params))
1349
1354
  #
1350
1355
  # spot
1351
1356
  #
@@ -1434,14 +1439,14 @@ class digifinex(Exchange, ImplicitAPI):
1434
1439
  """
1435
1440
  self.load_markets()
1436
1441
  market = self.market(symbol)
1437
- method = 'publicSpotGetKline'
1438
1442
  request = {}
1443
+ response = None
1439
1444
  if market['swap']:
1440
- method = 'publicSwapGetPublicCandles'
1441
1445
  request['instrument_id'] = market['id']
1442
1446
  request['granularity'] = timeframe
1443
1447
  if limit is not None:
1444
1448
  request['limit'] = limit
1449
+ response = self.publicSwapGetPublicCandles(self.extend(request, params))
1445
1450
  else:
1446
1451
  request['symbol'] = market['id']
1447
1452
  request['period'] = self.safe_string(self.timeframes, timeframe, timeframe)
@@ -1455,7 +1460,7 @@ class digifinex(Exchange, ImplicitAPI):
1455
1460
  endTime = self.seconds()
1456
1461
  duration = self.parse_timeframe(timeframe)
1457
1462
  request['start_time'] = self.sum(endTime, -limit * duration)
1458
- response = getattr(self, method)(self.extend(request, params))
1463
+ response = self.publicSpotGetKline(self.extend(request, params))
1459
1464
  #
1460
1465
  # spot
1461
1466
  #
@@ -1550,7 +1555,7 @@ class digifinex(Exchange, ImplicitAPI):
1550
1555
  create a list of trade orders(all orders should be of the same symbol)
1551
1556
  :see: https://docs.digifinex.com/en-ww/spot/v3/rest.html#create-multiple-order
1552
1557
  :see: https://docs.digifinex.com/en-ww/swap/v2/rest.html#batchorder
1553
- :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
1558
+ :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
1554
1559
  :param dict [params]: extra parameters specific to the exchange API endpoint
1555
1560
  :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
1556
1561
  """
@@ -1749,18 +1754,9 @@ class digifinex(Exchange, ImplicitAPI):
1749
1754
  market = None
1750
1755
  if symbol is not None:
1751
1756
  market = self.market(symbol)
1757
+ id = str(id)
1752
1758
  marketType = None
1753
1759
  marketType, params = self.handle_market_type_and_params('cancelOrder', market, params)
1754
- method = self.get_supported_mapping(marketType, {
1755
- 'spot': 'privateSpotPostSpotOrderCancel',
1756
- 'margin': 'privateSpotPostMarginOrderCancel',
1757
- 'swap': 'privateSwapPostTradeCancelOrder',
1758
- })
1759
- marginMode, query = self.handle_margin_mode_and_params('cancelOrder', params)
1760
- if marginMode is not None:
1761
- method = 'privateSpotPostMarginOrderCancel'
1762
- marketType = 'margin'
1763
- id = str(id)
1764
1760
  request = {
1765
1761
  'order_id': id,
1766
1762
  }
@@ -1770,7 +1766,17 @@ class digifinex(Exchange, ImplicitAPI):
1770
1766
  request['instrument_id'] = market['id']
1771
1767
  else:
1772
1768
  request['market'] = marketType
1773
- response = getattr(self, method)(self.extend(request, query))
1769
+ marginMode, query = self.handle_margin_mode_and_params('cancelOrder', params)
1770
+ response = None
1771
+ if marginMode is not None or marketType == 'margin':
1772
+ marketType = 'margin'
1773
+ response = self.privateSpotPostMarginOrderCancel(self.extend(request, query))
1774
+ elif marketType == 'spot':
1775
+ response = self.privateSpotPostSpotOrderCancel(self.extend(request, query))
1776
+ elif marketType == 'swap':
1777
+ response = self.privateSwapPostTradeCancelOrder(self.extend(request, query))
1778
+ else:
1779
+ raise NotSupported(self.id + ' cancelOrder() not support self market type')
1774
1780
  #
1775
1781
  # spot and margin
1776
1782
  #
@@ -1994,15 +2000,7 @@ class digifinex(Exchange, ImplicitAPI):
1994
2000
  market = self.market(symbol)
1995
2001
  marketType = None
1996
2002
  marketType, params = self.handle_market_type_and_params('fetchOpenOrders', market, params)
1997
- method = self.get_supported_mapping(marketType, {
1998
- 'spot': 'privateSpotGetSpotOrderCurrent',
1999
- 'margin': 'privateSpotGetMarginOrderCurrent',
2000
- 'swap': 'privateSwapGetTradeOpenOrders',
2001
- })
2002
2003
  marginMode, query = self.handle_margin_mode_and_params('fetchOpenOrders', params)
2003
- if marginMode is not None:
2004
- method = 'privateSpotGetMarginOrderCurrent'
2005
- marketType = 'margin'
2006
2004
  request = {}
2007
2005
  swap = (marketType == 'swap')
2008
2006
  if swap:
@@ -2015,7 +2013,16 @@ class digifinex(Exchange, ImplicitAPI):
2015
2013
  if market is not None:
2016
2014
  marketIdRequest = 'instrument_id' if swap else 'symbol'
2017
2015
  request[marketIdRequest] = market['id']
2018
- response = getattr(self, method)(self.extend(request, query))
2016
+ response = None
2017
+ if marginMode is not None or marketType == 'margin':
2018
+ marketType = 'margin'
2019
+ response = self.privateSpotGetMarginOrderCurrent(self.extend(request, query))
2020
+ elif marketType == 'spot':
2021
+ response = self.privateSpotGetSpotOrderCurrent(self.extend(request, query))
2022
+ elif marketType == 'swap':
2023
+ response = self.privateSwapGetTradeOpenOrders(self.extend(request, query))
2024
+ else:
2025
+ raise NotSupported(self.id + ' fetchOpenOrders() not support self market type')
2019
2026
  #
2020
2027
  # spot and margin
2021
2028
  #
@@ -2087,15 +2094,7 @@ class digifinex(Exchange, ImplicitAPI):
2087
2094
  market = self.market(symbol)
2088
2095
  marketType = None
2089
2096
  marketType, params = self.handle_market_type_and_params('fetchOrders', market, params)
2090
- method = self.get_supported_mapping(marketType, {
2091
- 'spot': 'privateSpotGetSpotOrderHistory',
2092
- 'margin': 'privateSpotGetMarginOrderHistory',
2093
- 'swap': 'privateSwapGetTradeHistoryOrders',
2094
- })
2095
2097
  marginMode, query = self.handle_margin_mode_and_params('fetchOrders', params)
2096
- if marginMode is not None:
2097
- method = 'privateSpotGetMarginOrderHistory'
2098
- marketType = 'margin'
2099
2098
  request = {}
2100
2099
  if marketType == 'swap':
2101
2100
  if since is not None:
@@ -2109,7 +2108,16 @@ class digifinex(Exchange, ImplicitAPI):
2109
2108
  request[marketIdRequest] = market['id']
2110
2109
  if limit is not None:
2111
2110
  request['limit'] = limit
2112
- response = getattr(self, method)(self.extend(request, query))
2111
+ response = None
2112
+ if marginMode is not None or marketType == 'margin':
2113
+ marketType = 'margin'
2114
+ response = self.privateSpotGetMarginOrderHistory(self.extend(request, query))
2115
+ elif marketType == 'spot':
2116
+ response = self.privateSpotGetSpotOrderHistory(self.extend(request, query))
2117
+ elif marketType == 'swap':
2118
+ response = self.privateSwapGetTradeHistoryOrders(self.extend(request, query))
2119
+ else:
2120
+ raise NotSupported(self.id + ' fetchOrders() not support self market type')
2113
2121
  #
2114
2122
  # spot and margin
2115
2123
  #
@@ -2180,15 +2188,7 @@ class digifinex(Exchange, ImplicitAPI):
2180
2188
  market = self.market(symbol)
2181
2189
  marketType = None
2182
2190
  marketType, params = self.handle_market_type_and_params('fetchOrder', market, params)
2183
- method = self.get_supported_mapping(marketType, {
2184
- 'spot': 'privateSpotGetSpotOrder',
2185
- 'margin': 'privateSpotGetMarginOrder',
2186
- 'swap': 'privateSwapGetTradeOrderInfo',
2187
- })
2188
2191
  marginMode, query = self.handle_margin_mode_and_params('fetchOrder', params)
2189
- if marginMode is not None:
2190
- method = 'privateSpotGetMarginOrder'
2191
- marketType = 'margin'
2192
2192
  request = {
2193
2193
  'order_id': id,
2194
2194
  }
@@ -2197,7 +2197,16 @@ class digifinex(Exchange, ImplicitAPI):
2197
2197
  request['instrument_id'] = market['id']
2198
2198
  else:
2199
2199
  request['market'] = marketType
2200
- response = getattr(self, method)(self.extend(request, query))
2200
+ response = None
2201
+ if (marginMode is not None) or (marketType == 'margin'):
2202
+ marketType = 'margin'
2203
+ response = self.privateSpotGetMarginOrder(self.extend(request, query))
2204
+ elif marketType == 'spot':
2205
+ response = self.privateSpotGetSpotOrder(self.extend(request, query))
2206
+ elif marketType == 'swap':
2207
+ response = self.privateSwapGetTradeOrderInfo(self.extend(request, query))
2208
+ else:
2209
+ raise NotSupported(self.id + ' fetchOrder() not support self market type')
2201
2210
  #
2202
2211
  # spot and margin
2203
2212
  #
@@ -2270,15 +2279,7 @@ class digifinex(Exchange, ImplicitAPI):
2270
2279
  market = self.market(symbol)
2271
2280
  marketType = None
2272
2281
  marketType, params = self.handle_market_type_and_params('fetchMyTrades', market, params)
2273
- method = self.get_supported_mapping(marketType, {
2274
- 'spot': 'privateSpotGetSpotMytrades',
2275
- 'margin': 'privateSpotGetMarginMytrades',
2276
- 'swap': 'privateSwapGetTradeHistoryTrades',
2277
- })
2278
2282
  marginMode, query = self.handle_margin_mode_and_params('fetchMyTrades', params)
2279
- if marginMode is not None:
2280
- method = 'privateSpotGetMarginMytrades'
2281
- marketType = 'margin'
2282
2283
  if marketType == 'swap':
2283
2284
  if since is not None:
2284
2285
  request['start_timestamp'] = since
@@ -2291,7 +2292,16 @@ class digifinex(Exchange, ImplicitAPI):
2291
2292
  request[marketIdRequest] = market['id']
2292
2293
  if limit is not None:
2293
2294
  request['limit'] = limit
2294
- response = getattr(self, method)(self.extend(request, query))
2295
+ response = None
2296
+ if marginMode is not None or marketType == 'margin':
2297
+ marketType = 'margin'
2298
+ response = self.privateSpotGetMarginMytrades(self.extend(request, query))
2299
+ elif marketType == 'spot':
2300
+ response = self.privateSpotGetSpotMytrades(self.extend(request, query))
2301
+ elif marketType == 'swap':
2302
+ response = self.privateSwapGetTradeHistoryTrades(self.extend(request, query))
2303
+ else:
2304
+ raise NotSupported(self.id + ' fetchMyTrades() not support self market type')
2295
2305
  #
2296
2306
  # spot and margin
2297
2307
  #
@@ -2406,15 +2416,7 @@ class digifinex(Exchange, ImplicitAPI):
2406
2416
  request = {}
2407
2417
  marketType = None
2408
2418
  marketType, params = self.handle_market_type_and_params('fetchLedger', None, params)
2409
- method = self.get_supported_mapping(marketType, {
2410
- 'spot': 'privateSpotGetSpotFinancelog',
2411
- 'margin': 'privateSpotGetMarginFinancelog',
2412
- 'swap': 'privateSwapGetAccountFinanceRecord',
2413
- })
2414
2419
  marginMode, query = self.handle_margin_mode_and_params('fetchLedger', params)
2415
- if marginMode is not None:
2416
- method = 'privateSpotGetMarginFinancelog'
2417
- marketType = 'margin'
2418
2420
  if marketType == 'swap':
2419
2421
  if since is not None:
2420
2422
  request['start_timestamp'] = since
@@ -2429,7 +2431,16 @@ class digifinex(Exchange, ImplicitAPI):
2429
2431
  request[currencyIdRequest] = currency['id']
2430
2432
  if limit is not None:
2431
2433
  request['limit'] = limit
2432
- response = getattr(self, method)(self.extend(request, query))
2434
+ response = None
2435
+ if marginMode is not None or marketType == 'margin':
2436
+ marketType = 'margin'
2437
+ response = self.privateSpotGetMarginFinancelog(self.extend(request, query))
2438
+ elif marketType == 'spot':
2439
+ response = self.privateSpotGetSpotFinancelog(self.extend(request, query))
2440
+ elif marketType == 'swap':
2441
+ response = self.privateSwapGetAccountFinanceRecord(self.extend(request, query))
2442
+ else:
2443
+ raise NotSupported(self.id + ' fetchLedger() not support self market type')
2433
2444
  #
2434
2445
  # spot and margin
2435
2446
  #
@@ -2539,8 +2550,11 @@ class digifinex(Exchange, ImplicitAPI):
2539
2550
  request['currency'] = currency['id']
2540
2551
  if limit is not None:
2541
2552
  request['size'] = min(500, limit)
2542
- method = 'privateSpotGetDepositHistory' if (type == 'deposit') else 'privateSpotGetWithdrawHistory'
2543
- response = getattr(self, method)(self.extend(request, params))
2553
+ response = None
2554
+ if type == 'deposit':
2555
+ response = self.privateSpotGetDepositHistory(self.extend(request, params))
2556
+ else:
2557
+ response = self.privateSpotGetWithdrawHistory(self.extend(request, params))
2544
2558
  #
2545
2559
  # {
2546
2560
  # "code": 200,
@@ -3133,12 +3147,13 @@ class digifinex(Exchange, ImplicitAPI):
3133
3147
  if market is not None:
3134
3148
  marketIdRequest = 'instrument_id' if (marketType == 'swap') else 'symbol'
3135
3149
  request[marketIdRequest] = market['id']
3136
- method = self.get_supported_mapping(marketType, {
3137
- 'spot': 'privateSpotGetMarginPositions',
3138
- 'margin': 'privateSpotGetMarginPositions',
3139
- 'swap': 'privateSwapGetAccountPositions',
3140
- })
3141
- response = getattr(self, method)(self.extend(request, query))
3150
+ response = None
3151
+ if marketType == 'spot' or marketType == 'margin':
3152
+ response = self.privateSpotGetMarginPositions(self.extend(request, query))
3153
+ elif marketType == 'swap':
3154
+ response = self.privateSwapGetAccountPositions(self.extend(request, query))
3155
+ else:
3156
+ raise NotSupported(self.id + ' fetchPositions() not support self market type')
3142
3157
  #
3143
3158
  # swap
3144
3159
  #
@@ -3216,14 +3231,15 @@ class digifinex(Exchange, ImplicitAPI):
3216
3231
  marginMode, query = self.handle_margin_mode_and_params('fetchPosition', params)
3217
3232
  if marginMode is not None:
3218
3233
  marketType = 'margin'
3219
- method = self.get_supported_mapping(marketType, {
3220
- 'spot': 'privateSpotGetMarginPositions',
3221
- 'margin': 'privateSpotGetMarginPositions',
3222
- 'swap': 'privateSwapGetAccountPositions',
3223
- })
3224
3234
  marketIdRequest = 'instrument_id' if (marketType == 'swap') else 'symbol'
3225
3235
  request[marketIdRequest] = market['id']
3226
- response = getattr(self, method)(self.extend(request, query))
3236
+ response = None
3237
+ if marketType == 'spot' or marketType == 'margin':
3238
+ response = self.privateSpotGetMarginPositions(self.extend(request, query))
3239
+ elif marketType == 'swap':
3240
+ response = self.privateSwapGetAccountPositions(self.extend(request, query))
3241
+ else:
3242
+ raise NotSupported(self.id + ' fetchPosition() not support self market type')
3227
3243
  #
3228
3244
  # swap
3229
3245
  #
@@ -3634,7 +3650,7 @@ class digifinex(Exchange, ImplicitAPI):
3634
3650
  * @ignore
3635
3651
  marginMode specified by params["marginMode"], self.options["marginMode"], self.options["defaultMarginMode"], params["margin"] = True or self.options["defaultType"] = 'margin'
3636
3652
  :param dict [params]: extra parameters specific to the exchange API endpoint
3637
- :returns array: the marginMode in lowercase
3653
+ :returns Array: the marginMode in lowercase
3638
3654
  """
3639
3655
  defaultType = self.safe_string(self.options, 'defaultType')
3640
3656
  isMargin = self.safe_value(params, 'margin', False)
ccxt/hitbtc.py CHANGED
@@ -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/htx.py CHANGED
@@ -4880,7 +4880,7 @@ class htx(Exchange, ImplicitAPI):
4880
4880
  :see: https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#place-a-batch-of-orders
4881
4881
  :see: https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-place-a-batch-of-orders
4882
4882
  :see: https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-place-a-batch-of-orders
4883
- :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
4883
+ :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
4884
  :param dict [params]: extra parameters specific to the exchange API endpoint
4885
4885
  :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
4886
4886
  """
ccxt/kraken.py CHANGED
@@ -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
  self.load_markets()
2216
2216
  paginate = False
2217
2217
  paginate, params = self.handle_option_and_params(params, 'fetchWithdrawals', 'paginate')
ccxt/krakenfutures.py CHANGED
@@ -657,7 +657,7 @@ class krakenfutures(Exchange, ImplicitAPI):
657
657
  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
  self.load_markets()
ccxt/kucoin.py CHANGED
@@ -507,11 +507,7 @@ class kucoin(Exchange, ImplicitAPI):
507
507
  },
508
508
  'commonCurrencies': {
509
509
  'BIFI': 'BIFIF',
510
- 'EDGE': 'DADI', # https://github.com/ccxt/ccxt/issues/5756
511
- 'HOT': 'HOTNOW',
512
- 'TRY': 'Trias',
513
510
  'VAI': 'VAIOT',
514
- 'WAX': 'WAXP',
515
511
  },
516
512
  'options': {
517
513
  'version': 'v1',
@@ -1881,7 +1877,7 @@ class kucoin(Exchange, ImplicitAPI):
1881
1877
  create a list of trade orders
1882
1878
  :see: https://www.kucoin.com/docs/rest/spot-trading/orders/place-multiple-orders
1883
1879
  :see: https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/place-multiple-hf-orders
1884
- :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
1880
+ :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
1885
1881
  :param dict [params]: extra parameters specific to the exchange API endpoint
1886
1882
  :param bool [params.hf]: False, # True for hf orders
1887
1883
  :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
ccxt/kucoinfutures.py CHANGED
@@ -692,9 +692,6 @@ class kucoinfutures(kucoin, ImplicitAPI):
692
692
  orderbook['nonce'] = self.safe_integer(data, 'sequence')
693
693
  return orderbook
694
694
 
695
- 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
  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
ccxt/latoken.py CHANGED
@@ -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
  self.load_markets()