ccxt 4.2.89__py2.py3-none-any.whl → 4.2.91__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 (71) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/abstract/bingx.py +2 -0
  3. ccxt/abstract/bybit.py +2 -0
  4. ccxt/ascendex.py +1 -0
  5. ccxt/async_support/__init__.py +1 -1
  6. ccxt/async_support/ascendex.py +1 -0
  7. ccxt/async_support/base/exchange.py +13 -1
  8. ccxt/async_support/binance.py +81 -9
  9. ccxt/async_support/bingx.py +94 -1
  10. ccxt/async_support/bitfinex2.py +1 -0
  11. ccxt/async_support/bitget.py +2 -0
  12. ccxt/async_support/bitmex.py +1 -0
  13. ccxt/async_support/bitrue.py +1 -0
  14. ccxt/async_support/bybit.py +50 -0
  15. ccxt/async_support/coinbase.py +43 -21
  16. ccxt/async_support/coinbaseinternational.py +1 -0
  17. ccxt/async_support/coinex.py +96 -8
  18. ccxt/async_support/cryptocom.py +1 -0
  19. ccxt/async_support/delta.py +1 -0
  20. ccxt/async_support/digifinex.py +1 -0
  21. ccxt/async_support/exmo.py +1 -0
  22. ccxt/async_support/gate.py +2 -0
  23. ccxt/async_support/gemini.py +11 -9
  24. ccxt/async_support/hitbtc.py +1 -0
  25. ccxt/async_support/htx.py +1 -0
  26. ccxt/async_support/hyperliquid.py +1 -0
  27. ccxt/async_support/kraken.py +11 -8
  28. ccxt/async_support/kucoin.py +1 -0
  29. ccxt/async_support/kucoinfutures.py +32 -4
  30. ccxt/async_support/mexc.py +1 -0
  31. ccxt/async_support/okx.py +173 -38
  32. ccxt/async_support/phemex.py +1 -0
  33. ccxt/async_support/woo.py +1 -0
  34. ccxt/base/exchange.py +53 -14
  35. ccxt/base/types.py +1 -0
  36. ccxt/binance.py +81 -9
  37. ccxt/bingx.py +94 -1
  38. ccxt/bitfinex2.py +1 -0
  39. ccxt/bitget.py +2 -0
  40. ccxt/bitmex.py +1 -0
  41. ccxt/bitrue.py +1 -0
  42. ccxt/bybit.py +50 -0
  43. ccxt/coinbase.py +43 -21
  44. ccxt/coinbaseinternational.py +1 -0
  45. ccxt/coinex.py +96 -8
  46. ccxt/cryptocom.py +1 -0
  47. ccxt/delta.py +1 -0
  48. ccxt/digifinex.py +1 -0
  49. ccxt/exmo.py +1 -0
  50. ccxt/gate.py +2 -0
  51. ccxt/gemini.py +11 -9
  52. ccxt/hitbtc.py +1 -0
  53. ccxt/htx.py +1 -0
  54. ccxt/hyperliquid.py +1 -0
  55. ccxt/kraken.py +11 -8
  56. ccxt/kucoin.py +1 -0
  57. ccxt/kucoinfutures.py +32 -4
  58. ccxt/mexc.py +1 -0
  59. ccxt/okx.py +173 -38
  60. ccxt/phemex.py +1 -0
  61. ccxt/pro/__init__.py +1 -1
  62. ccxt/pro/bitmex.py +35 -17
  63. ccxt/pro/kucoin.py +85 -0
  64. ccxt/pro/kucoinfutures.py +141 -76
  65. ccxt/test/test_async.py +15 -1
  66. ccxt/test/test_sync.py +15 -1
  67. ccxt/woo.py +1 -0
  68. {ccxt-4.2.89.dist-info → ccxt-4.2.91.dist-info}/METADATA +4 -4
  69. {ccxt-4.2.89.dist-info → ccxt-4.2.91.dist-info}/RECORD +71 -71
  70. {ccxt-4.2.89.dist-info → ccxt-4.2.91.dist-info}/WHEEL +0 -0
  71. {ccxt-4.2.89.dist-info → ccxt-4.2.91.dist-info}/top_level.txt +0 -0
ccxt/cryptocom.py CHANGED
@@ -81,6 +81,7 @@ class cryptocom(Exchange, ImplicitAPI):
81
81
  'fetchLedger': True,
82
82
  'fetchLeverage': False,
83
83
  'fetchLeverageTiers': False,
84
+ 'fetchMarginAdjustmentHistory': False,
84
85
  'fetchMarginMode': False,
85
86
  'fetchMarketLeverageTiers': False,
86
87
  'fetchMarkets': True,
ccxt/delta.py CHANGED
@@ -2566,6 +2566,7 @@ class delta(Exchange, ImplicitAPI):
2566
2566
  'info': data,
2567
2567
  'symbol': market['symbol'],
2568
2568
  'type': None,
2569
+ 'marginMode': 'isolated',
2569
2570
  'amount': None,
2570
2571
  'total': self.safe_number(data, 'margin'),
2571
2572
  'code': None,
ccxt/digifinex.py CHANGED
@@ -3850,6 +3850,7 @@ class digifinex(Exchange, ImplicitAPI):
3850
3850
  'info': data,
3851
3851
  'symbol': self.safe_symbol(marketId, market, None, 'swap'),
3852
3852
  'type': 'add' if (rawType == 1) else 'reduce',
3853
+ 'marginMode': 'isolated',
3853
3854
  'amount': self.safe_number(data, 'amount'),
3854
3855
  'total': None,
3855
3856
  'code': market['settle'],
ccxt/exmo.py CHANGED
@@ -273,6 +273,7 @@ class exmo(Exchange, ImplicitAPI):
273
273
  'info': data,
274
274
  'symbol': self.safe_symbol(None, market),
275
275
  'type': None,
276
+ 'marginMode': 'isolated',
276
277
  'amount': None,
277
278
  'total': None,
278
279
  'code': self.safe_value(market, 'quote'),
ccxt/gate.py CHANGED
@@ -138,6 +138,7 @@ class gate(Exchange, ImplicitAPI):
138
138
  'fetchLeverages': True,
139
139
  'fetchLeverageTiers': True,
140
140
  'fetchLiquidations': True,
141
+ 'fetchMarginAdjustmentHistory': False,
141
142
  'fetchMarginMode': False,
142
143
  'fetchMarketLeverageTiers': True,
143
144
  'fetchMarkets': True,
@@ -5687,6 +5688,7 @@ class gate(Exchange, ImplicitAPI):
5687
5688
  'info': data,
5688
5689
  'symbol': market['symbol'],
5689
5690
  'type': None,
5691
+ 'marginMode': 'isolated',
5690
5692
  'amount': None,
5691
5693
  'total': total,
5692
5694
  'code': self.safe_value(market, 'quote'),
ccxt/gemini.py CHANGED
@@ -121,6 +121,7 @@ class gemini(Exchange, ImplicitAPI):
121
121
  # https://github.com/ccxt/ccxt/issues/7874
122
122
  # https://github.com/ccxt/ccxt/issues/7894
123
123
  'web': 'https://docs.gemini.com',
124
+ 'webExchange': 'https://exchange.gemini.com',
124
125
  },
125
126
  'fees': [
126
127
  'https://gemini.com/api-fee-schedule',
@@ -443,6 +444,7 @@ class gemini(Exchange, ImplicitAPI):
443
444
  # '</tr>'
444
445
  # ]
445
446
  marketId = cells[0].replace('<td>', '')
447
+ marketId = marketId.replace('*', '')
446
448
  # base = self.safe_currency_code(baseId)
447
449
  minAmountString = cells[1].replace('<td>', '')
448
450
  minAmountParts = minAmountString.split(' ')
@@ -629,7 +631,7 @@ class gemini(Exchange, ImplicitAPI):
629
631
  quoteId = None
630
632
  settleId = None
631
633
  tickSize = None
632
- increment = None
634
+ amountPrecision = None
633
635
  minSize = None
634
636
  status = None
635
637
  swap = False
@@ -640,9 +642,9 @@ class gemini(Exchange, ImplicitAPI):
640
642
  isArray = (isinstance(response, list))
641
643
  if not isString and not isArray:
642
644
  marketId = self.safe_string_lower(response, 'symbol')
645
+ amountPrecision = self.safe_number(response, 'tick_size') # right, exchange has an imperfect naming and self turns out to be an amount-precision
646
+ tickSize = self.safe_number(response, 'quote_increment') # self is tick-size actually
643
647
  minSize = self.safe_number(response, 'min_order_size')
644
- tickSize = self.safe_number(response, 'tick_size')
645
- increment = self.safe_number(response, 'quote_increment')
646
648
  status = self.parse_market_active(self.safe_string(response, 'status'))
647
649
  baseId = self.safe_string(response, 'base_currency')
648
650
  quoteId = self.safe_string(response, 'quote_currency')
@@ -653,9 +655,9 @@ class gemini(Exchange, ImplicitAPI):
653
655
  marketId = response
654
656
  else:
655
657
  marketId = self.safe_string_lower(response, 0)
656
- minSize = self.safe_number(response, 3)
657
- tickSize = self.parse_number(self.parse_precision(self.safe_string(response, 1)))
658
- increment = self.parse_number(self.parse_precision(self.safe_string(response, 2)))
658
+ tickSize = self.parse_number(self.parse_precision(self.safe_string(response, 1))) # priceTickDecimalPlaces
659
+ amountPrecision = self.parse_number(self.parse_precision(self.safe_string(response, 2))) # quantityTickDecimalPlaces
660
+ minSize = self.safe_number(response, 3) # quantityMinimum
659
661
  marketIdUpper = marketId.upper()
660
662
  isPerp = (marketIdUpper.find('PERP') >= 0)
661
663
  marketIdWithoutPerp = marketIdUpper.replace('PERP', '')
@@ -704,8 +706,8 @@ class gemini(Exchange, ImplicitAPI):
704
706
  'strike': None,
705
707
  'optionType': None,
706
708
  'precision': {
707
- 'price': increment,
708
- 'amount': tickSize,
709
+ 'price': tickSize,
710
+ 'amount': amountPrecision,
709
711
  },
710
712
  'limits': {
711
713
  'leverage': {
@@ -1707,7 +1709,7 @@ class gemini(Exchange, ImplicitAPI):
1707
1709
  apiKey = self.apiKey
1708
1710
  if apiKey.find('account') < 0:
1709
1711
  raise AuthenticationError(self.id + ' sign() requires an account-key, master-keys are not-supported')
1710
- nonce = self.nonce()
1712
+ nonce = str(self.nonce())
1711
1713
  request = self.extend({
1712
1714
  'request': url,
1713
1715
  'nonce': nonce,
ccxt/hitbtc.py CHANGED
@@ -3082,6 +3082,7 @@ class hitbtc(Exchange, ImplicitAPI):
3082
3082
  'info': data,
3083
3083
  'symbol': market['symbol'],
3084
3084
  'type': None,
3085
+ 'marginMode': 'isolated',
3085
3086
  'amount': None,
3086
3087
  'total': None,
3087
3088
  'code': self.safe_string(currencyInfo, 'code'),
ccxt/htx.py CHANGED
@@ -102,6 +102,7 @@ class htx(Exchange, ImplicitAPI):
102
102
  'fetchLeverage': False,
103
103
  'fetchLeverageTiers': True,
104
104
  'fetchLiquidations': True,
105
+ 'fetchMarginAdjustmentHistory': False,
105
106
  'fetchMarketLeverageTiers': True,
106
107
  'fetchMarkets': True,
107
108
  'fetchMarkOHLCV': True,
ccxt/hyperliquid.py CHANGED
@@ -2024,6 +2024,7 @@ class hyperliquid(Exchange, ImplicitAPI):
2024
2024
  'info': data,
2025
2025
  'symbol': self.safe_symbol(None, market),
2026
2026
  'type': None,
2027
+ 'marginMode': 'isolated',
2027
2028
  'amount': None,
2028
2029
  'total': None,
2029
2030
  'code': self.safe_string(market, 'settle'),
ccxt/kraken.py CHANGED
@@ -609,9 +609,7 @@ class kraken(Exchange, ImplicitAPI):
609
609
  if currencyId is not None:
610
610
  if len(currencyId) > 3:
611
611
  if (currencyId.find('X') == 0) or (currencyId.find('Z') == 0):
612
- if currencyId.find('.') > 0:
613
- return super(kraken, self).safe_currency(currencyId, currency)
614
- else:
612
+ if not (currencyId.find('.') > 0):
615
613
  currencyId = currencyId[1:]
616
614
  return super(kraken, self).safe_currency(currencyId, currency)
617
615
 
@@ -653,8 +651,13 @@ class kraken(Exchange, ImplicitAPI):
653
651
  # {
654
652
  # "error": [],
655
653
  # "result": {
656
- # "ADA": {"aclass": "currency", "altname": "ADA", "decimals": 8, "display_decimals": 6},
657
- # "BCH": {"aclass": "currency", "altname": "BCH", "decimals": 10, "display_decimals": 5},
654
+ # "BCH": {
655
+ # "aclass": "currency",
656
+ # "altname": "BCH",
657
+ # "decimals": 10,
658
+ # "display_decimals": 5
659
+ # "status": "enabled",
660
+ # },
658
661
  # ...
659
662
  # },
660
663
  # }
@@ -669,15 +672,15 @@ class kraken(Exchange, ImplicitAPI):
669
672
  # see: https://support.kraken.com/hc/en-us/articles/201893608-What-are-the-withdrawal-fees-
670
673
  # to add support for multiple withdrawal/deposit methods and
671
674
  # differentiated fees for each particular method
672
- code = self.safe_currency_code(self.safe_string(currency, 'altname'))
675
+ code = self.safe_currency_code(id)
673
676
  precision = self.parse_number(self.parse_precision(self.safe_string(currency, 'decimals')))
674
677
  # assumes all currencies are active except those listed above
675
- active = not self.in_array(code, self.options['inactiveCurrencies'])
678
+ active = self.safe_string(currency, 'status') == 'enabled'
676
679
  result[code] = {
677
680
  'id': id,
678
681
  'code': code,
679
682
  'info': currency,
680
- 'name': code,
683
+ 'name': self.safe_string(currency, 'altname'),
681
684
  'active': active,
682
685
  'deposit': None,
683
686
  'withdraw': None,
ccxt/kucoin.py CHANGED
@@ -92,6 +92,7 @@ class kucoin(Exchange, ImplicitAPI):
92
92
  'fetchL3OrderBook': True,
93
93
  'fetchLedger': True,
94
94
  'fetchLeverageTiers': False,
95
+ 'fetchMarginAdjustmentHistory': False,
95
96
  'fetchMarginMode': False,
96
97
  'fetchMarketLeverageTiers': False,
97
98
  'fetchMarkets': True,
ccxt/kucoinfutures.py CHANGED
@@ -80,6 +80,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
80
80
  'fetchL3OrderBook': True,
81
81
  'fetchLedger': True,
82
82
  'fetchLeverageTiers': False,
83
+ 'fetchMarginAdjustmentHistory': False,
83
84
  'fetchMarginMode': False,
84
85
  'fetchMarketLeverageTiers': True,
85
86
  'fetchMarkets': True,
@@ -1497,7 +1498,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
1497
1498
  'direction': 'in',
1498
1499
  })
1499
1500
 
1500
- def parse_margin_modification(self, info, market: Market = None):
1501
+ def parse_margin_modification(self, info, market: Market = None) -> MarginModification:
1501
1502
  #
1502
1503
  # {
1503
1504
  # "id": "62311d26064e8f00013f2c6d",
@@ -1549,14 +1550,18 @@ class kucoinfutures(kucoin, ImplicitAPI):
1549
1550
  crossMode = self.safe_value(info, 'crossMode')
1550
1551
  mode = 'cross' if crossMode else 'isolated'
1551
1552
  marketId = self.safe_string(market, 'symbol')
1553
+ timestamp = self.safe_integer(info, 'currentTimestamp')
1552
1554
  return {
1553
1555
  'info': info,
1554
- 'direction': None,
1555
- 'mode': mode,
1556
+ 'symbol': self.safe_symbol(marketId, market),
1557
+ 'type': None,
1558
+ 'marginMode': mode,
1556
1559
  'amount': None,
1560
+ 'total': None,
1557
1561
  'code': self.safe_currency_code(currencyId),
1558
- 'symbol': self.safe_symbol(marketId, market),
1559
1562
  'status': None,
1563
+ 'timestamp': timestamp,
1564
+ 'datetime': self.iso8601(timestamp),
1560
1565
  }
1561
1566
 
1562
1567
  def fetch_orders_by_status(self, status, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
@@ -1682,6 +1687,29 @@ class kucoinfutures(kucoin, ImplicitAPI):
1682
1687
  return self.fetch_paginated_call_dynamic('fetchClosedOrders', symbol, since, limit, params)
1683
1688
  return self.fetch_orders_by_status('done', symbol, since, limit, params)
1684
1689
 
1690
+ def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
1691
+ """
1692
+ fetches information on multiple open orders made by the user
1693
+ :see: https://docs.kucoin.com/futures/#get-order-list
1694
+ :see: https://docs.kucoin.com/futures/#get-untriggered-stop-order-list
1695
+ :param str symbol: unified market symbol of the market orders were made in
1696
+ :param int [since]: the earliest time in ms to fetch orders for
1697
+ :param int [limit]: the maximum number of order structures to retrieve
1698
+ :param dict [params]: extra parameters specific to the exchange API endpoint
1699
+ :param int [params.till]: end time in ms
1700
+ :param str [params.side]: buy or sell
1701
+ :param str [params.type]: limit, or market
1702
+ :param boolean [params.trigger]: set to True to retrieve untriggered stop orders
1703
+ :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)
1704
+ :returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
1705
+ """
1706
+ self.load_markets()
1707
+ paginate = False
1708
+ paginate, params = self.handle_option_and_params(params, 'fetchOpenOrders', 'paginate')
1709
+ if paginate:
1710
+ return self.fetch_paginated_call_dynamic('fetchOpenOrders', symbol, since, limit, params)
1711
+ return self.fetch_orders_by_status('open', symbol, since, limit, params)
1712
+
1685
1713
  def fetch_order(self, id: Str = None, symbol: Str = None, params={}):
1686
1714
  """
1687
1715
  fetches information on an order made by the user
ccxt/mexc.py CHANGED
@@ -89,6 +89,7 @@ class mexc(Exchange, ImplicitAPI):
89
89
  'fetchLeverage': True,
90
90
  'fetchLeverages': False,
91
91
  'fetchLeverageTiers': True,
92
+ 'fetchMarginAdjustmentHistory': False,
92
93
  'fetchMarginMode': False,
93
94
  'fetchMarketLeverageTiers': None,
94
95
  'fetchMarkets': True,