ccxt 4.2.81__py2.py3-none-any.whl → 4.2.83__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 (189) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/abstract/bitstamp.py +1 -1
  3. ccxt/ace.py +1 -1
  4. ccxt/alpaca.py +1 -1
  5. ccxt/ascendex.py +1 -1
  6. ccxt/async_support/__init__.py +1 -1
  7. ccxt/async_support/ace.py +1 -1
  8. ccxt/async_support/alpaca.py +1 -1
  9. ccxt/async_support/ascendex.py +1 -1
  10. ccxt/async_support/base/exchange.py +1 -1
  11. ccxt/async_support/bigone.py +1 -1
  12. ccxt/async_support/binance.py +1 -1
  13. ccxt/async_support/bingx.py +1 -1
  14. ccxt/async_support/bitbank.py +1 -1
  15. ccxt/async_support/bitbns.py +1 -1
  16. ccxt/async_support/bitfinex.py +1 -1
  17. ccxt/async_support/bitfinex2.py +1 -1
  18. ccxt/async_support/bitflyer.py +1 -1
  19. ccxt/async_support/bitget.py +2 -1
  20. ccxt/async_support/bithumb.py +2 -1
  21. ccxt/async_support/bitmart.py +1 -1
  22. ccxt/async_support/bitmex.py +1 -1
  23. ccxt/async_support/bitopro.py +1 -1
  24. ccxt/async_support/bitrue.py +2 -2
  25. ccxt/async_support/bitso.py +1 -1
  26. ccxt/async_support/bitstamp.py +43 -16
  27. ccxt/async_support/bitteam.py +1 -1
  28. ccxt/async_support/bitvavo.py +1 -1
  29. ccxt/async_support/blockchaincom.py +1 -1
  30. ccxt/async_support/blofin.py +1 -1
  31. ccxt/async_support/btcalpha.py +1 -1
  32. ccxt/async_support/btcmarkets.py +1 -1
  33. ccxt/async_support/btcturk.py +1 -1
  34. ccxt/async_support/bybit.py +1 -1
  35. ccxt/async_support/cex.py +1 -1
  36. ccxt/async_support/coinbase.py +1 -1
  37. ccxt/async_support/coinbaseinternational.py +1 -1
  38. ccxt/async_support/coinbasepro.py +1 -1
  39. ccxt/async_support/coinex.py +1 -1
  40. ccxt/async_support/coinlist.py +1 -1
  41. ccxt/async_support/coinmate.py +1 -1
  42. ccxt/async_support/coinmetro.py +1 -1
  43. ccxt/async_support/coinone.py +1 -1
  44. ccxt/async_support/coinsph.py +1 -1
  45. ccxt/async_support/cryptocom.py +1 -1
  46. ccxt/async_support/currencycom.py +1 -1
  47. ccxt/async_support/delta.py +147 -2
  48. ccxt/async_support/deribit.py +18 -3
  49. ccxt/async_support/digifinex.py +1 -1
  50. ccxt/async_support/exmo.py +1 -1
  51. ccxt/async_support/gate.py +1 -1
  52. ccxt/async_support/gemini.py +2 -1
  53. ccxt/async_support/hitbtc.py +1 -1
  54. ccxt/async_support/hollaex.py +1 -1
  55. ccxt/async_support/htx.py +1 -1
  56. ccxt/async_support/huobijp.py +1 -1
  57. ccxt/async_support/hyperliquid.py +10 -9
  58. ccxt/async_support/idex.py +1 -1
  59. ccxt/async_support/independentreserve.py +1 -1
  60. ccxt/async_support/indodax.py +1 -1
  61. ccxt/async_support/kraken.py +1 -1
  62. ccxt/async_support/krakenfutures.py +1 -1
  63. ccxt/async_support/kucoin.py +1 -1
  64. ccxt/async_support/kucoinfutures.py +147 -10
  65. ccxt/async_support/kuna.py +1 -1
  66. ccxt/async_support/latoken.py +1 -1
  67. ccxt/async_support/lbank.py +1 -1
  68. ccxt/async_support/luno.py +1 -1
  69. ccxt/async_support/lykke.py +1 -1
  70. ccxt/async_support/mercado.py +1 -1
  71. ccxt/async_support/mexc.py +1 -1
  72. ccxt/async_support/ndax.py +1 -1
  73. ccxt/async_support/novadax.py +1 -1
  74. ccxt/async_support/oceanex.py +1 -1
  75. ccxt/async_support/okcoin.py +1 -1
  76. ccxt/async_support/okx.py +137 -2
  77. ccxt/async_support/onetrading.py +1 -1
  78. ccxt/async_support/p2b.py +1 -1
  79. ccxt/async_support/phemex.py +1 -1
  80. ccxt/async_support/poloniex.py +1 -1
  81. ccxt/async_support/poloniexfutures.py +1 -1
  82. ccxt/async_support/probit.py +1 -1
  83. ccxt/async_support/timex.py +1 -1
  84. ccxt/async_support/tokocrypto.py +1 -1
  85. ccxt/async_support/tradeogre.py +2 -1
  86. ccxt/async_support/upbit.py +1 -1
  87. ccxt/async_support/wavesexchange.py +1 -1
  88. ccxt/async_support/wazirx.py +1 -1
  89. ccxt/async_support/whitebit.py +1 -1
  90. ccxt/async_support/woo.py +1 -1
  91. ccxt/async_support/yobit.py +1 -1
  92. ccxt/async_support/zaif.py +1 -1
  93. ccxt/async_support/zonda.py +1 -1
  94. ccxt/base/exchange.py +1 -1
  95. ccxt/bigone.py +1 -1
  96. ccxt/binance.py +1 -1
  97. ccxt/bingx.py +1 -1
  98. ccxt/bitbank.py +1 -1
  99. ccxt/bitbns.py +1 -1
  100. ccxt/bitfinex.py +1 -1
  101. ccxt/bitfinex2.py +1 -1
  102. ccxt/bitflyer.py +1 -1
  103. ccxt/bitget.py +2 -1
  104. ccxt/bithumb.py +2 -1
  105. ccxt/bitmart.py +1 -1
  106. ccxt/bitmex.py +1 -1
  107. ccxt/bitopro.py +1 -1
  108. ccxt/bitrue.py +2 -2
  109. ccxt/bitso.py +1 -1
  110. ccxt/bitstamp.py +43 -16
  111. ccxt/bitteam.py +1 -1
  112. ccxt/bitvavo.py +1 -1
  113. ccxt/blockchaincom.py +1 -1
  114. ccxt/blofin.py +1 -1
  115. ccxt/btcalpha.py +1 -1
  116. ccxt/btcmarkets.py +1 -1
  117. ccxt/btcturk.py +1 -1
  118. ccxt/bybit.py +1 -1
  119. ccxt/cex.py +1 -1
  120. ccxt/coinbase.py +1 -1
  121. ccxt/coinbaseinternational.py +1 -1
  122. ccxt/coinbasepro.py +1 -1
  123. ccxt/coinex.py +1 -1
  124. ccxt/coinlist.py +1 -1
  125. ccxt/coinmate.py +1 -1
  126. ccxt/coinmetro.py +1 -1
  127. ccxt/coinone.py +1 -1
  128. ccxt/coinsph.py +1 -1
  129. ccxt/cryptocom.py +1 -1
  130. ccxt/currencycom.py +1 -1
  131. ccxt/delta.py +147 -2
  132. ccxt/deribit.py +18 -3
  133. ccxt/digifinex.py +1 -1
  134. ccxt/exmo.py +1 -1
  135. ccxt/gate.py +1 -1
  136. ccxt/gemini.py +2 -1
  137. ccxt/hitbtc.py +1 -1
  138. ccxt/hollaex.py +1 -1
  139. ccxt/htx.py +1 -1
  140. ccxt/huobijp.py +1 -1
  141. ccxt/hyperliquid.py +10 -9
  142. ccxt/idex.py +1 -1
  143. ccxt/independentreserve.py +1 -1
  144. ccxt/indodax.py +1 -1
  145. ccxt/kraken.py +1 -1
  146. ccxt/krakenfutures.py +1 -1
  147. ccxt/kucoin.py +1 -1
  148. ccxt/kucoinfutures.py +147 -10
  149. ccxt/kuna.py +1 -1
  150. ccxt/latoken.py +1 -1
  151. ccxt/lbank.py +1 -1
  152. ccxt/luno.py +1 -1
  153. ccxt/lykke.py +1 -1
  154. ccxt/mercado.py +1 -1
  155. ccxt/mexc.py +1 -1
  156. ccxt/ndax.py +1 -1
  157. ccxt/novadax.py +1 -1
  158. ccxt/oceanex.py +1 -1
  159. ccxt/okcoin.py +1 -1
  160. ccxt/okx.py +137 -2
  161. ccxt/onetrading.py +1 -1
  162. ccxt/p2b.py +1 -1
  163. ccxt/phemex.py +1 -1
  164. ccxt/poloniex.py +1 -1
  165. ccxt/poloniexfutures.py +1 -1
  166. ccxt/pro/__init__.py +3 -1
  167. ccxt/pro/bithumb.py +368 -0
  168. ccxt/pro/bitmart.py +1 -1
  169. ccxt/pro/bybit.py +1 -1
  170. ccxt/pro/cex.py +15 -5
  171. ccxt/pro/okx.py +2 -1
  172. ccxt/pro/p2b.py +14 -4
  173. ccxt/pro/woo.py +1 -1
  174. ccxt/probit.py +1 -1
  175. ccxt/timex.py +1 -1
  176. ccxt/tokocrypto.py +1 -1
  177. ccxt/tradeogre.py +2 -1
  178. ccxt/upbit.py +1 -1
  179. ccxt/wavesexchange.py +1 -1
  180. ccxt/wazirx.py +1 -1
  181. ccxt/whitebit.py +1 -1
  182. ccxt/woo.py +1 -1
  183. ccxt/yobit.py +1 -1
  184. ccxt/zaif.py +1 -1
  185. ccxt/zonda.py +1 -1
  186. {ccxt-4.2.81.dist-info → ccxt-4.2.83.dist-info}/METADATA +5 -5
  187. {ccxt-4.2.81.dist-info → ccxt-4.2.83.dist-info}/RECORD +189 -188
  188. {ccxt-4.2.81.dist-info → ccxt-4.2.83.dist-info}/WHEEL +0 -0
  189. {ccxt-4.2.81.dist-info → ccxt-4.2.83.dist-info}/top_level.txt +0 -0
ccxt/delta.py CHANGED
@@ -6,7 +6,7 @@
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.delta import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Currency, Greeks, Int, Leverage, MarginMode, Market, MarketInterface, Num, Order, OrderBook, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade
9
+ from ccxt.base.types import Balances, Currency, Greeks, Int, Leverage, MarginMode, Market, MarketInterface, Num, Option, Order, OrderBook, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade
10
10
  from typing import List
11
11
  from ccxt.base.errors import ExchangeError
12
12
  from ccxt.base.errors import ArgumentsRequired
@@ -71,6 +71,8 @@ class delta(Exchange, ImplicitAPI):
71
71
  'fetchOHLCV': True,
72
72
  'fetchOpenInterest': True,
73
73
  'fetchOpenOrders': True,
74
+ 'fetchOption': True,
75
+ 'fetchOptionChain': False,
74
76
  'fetchOrderBook': True,
75
77
  'fetchPosition': True,
76
78
  'fetchPositionMode': False,
@@ -511,7 +513,7 @@ class delta(Exchange, ImplicitAPI):
511
513
  result[numericIdString] = item
512
514
  return result
513
515
 
514
- def fetch_markets(self, params={}):
516
+ def fetch_markets(self, params={}) -> List[Market]:
515
517
  """
516
518
  retrieves data on all markets for delta
517
519
  :see: https://docs.delta.exchange/#get-list-of-products
@@ -3192,6 +3194,149 @@ class delta(Exchange, ImplicitAPI):
3192
3194
  'marginMode': self.safe_string(marginMode, 'margin_mode'),
3193
3195
  }
3194
3196
 
3197
+ def fetch_option(self, symbol: str, params={}) -> Option:
3198
+ """
3199
+ fetches option data that is commonly found in an option chain
3200
+ :see: https://docs.delta.exchange/#get-ticker-for-a-product-by-symbol
3201
+ :param str symbol: unified market symbol
3202
+ :param dict [params]: extra parameters specific to the exchange API endpoint
3203
+ :returns dict: an `option chain structure <https://docs.ccxt.com/#/?id=option-chain-structure>`
3204
+ """
3205
+ self.load_markets()
3206
+ market = self.market(symbol)
3207
+ request = {
3208
+ 'symbol': market['id'],
3209
+ }
3210
+ response = self.publicGetTickersSymbol(self.extend(request, params))
3211
+ #
3212
+ # {
3213
+ # "result": {
3214
+ # "close": 6793.0,
3215
+ # "contract_type": "call_options",
3216
+ # "greeks": {
3217
+ # "delta": "0.94739174",
3218
+ # "gamma": "0.00002206",
3219
+ # "rho": "11.00890725",
3220
+ # "spot": "36839.58124652",
3221
+ # "theta": "-18.18365310",
3222
+ # "vega": "7.85209698"
3223
+ # },
3224
+ # "high": 7556.0,
3225
+ # "low": 6793.0,
3226
+ # "mark_price": "6955.70698909",
3227
+ # "mark_vol": "0.66916863",
3228
+ # "oi": "1.8980",
3229
+ # "oi_change_usd_6h": "110.4600",
3230
+ # "oi_contracts": "1898",
3231
+ # "oi_value": "1.8980",
3232
+ # "oi_value_symbol": "BTC",
3233
+ # "oi_value_usd": "69940.7319",
3234
+ # "open": 7.2e3,
3235
+ # "price_band": {
3236
+ # "lower_limit": "5533.89814767",
3237
+ # "upper_limit": "11691.37688371"
3238
+ # },
3239
+ # "product_id": 129508,
3240
+ # "quotes": {
3241
+ # "ask_iv": "0.90180438",
3242
+ # "ask_size": "1898",
3243
+ # "best_ask": "7210",
3244
+ # "best_bid": "6913",
3245
+ # "bid_iv": "0.60881706",
3246
+ # "bid_size": "3163",
3247
+ # "impact_mid_price": null,
3248
+ # "mark_iv": "0.66973549"
3249
+ # },
3250
+ # "size": 5,
3251
+ # "spot_price": "36839.58153868",
3252
+ # "strike_price": "30000",
3253
+ # "symbol": "C-BTC-30000-241123",
3254
+ # "timestamp": 1699584998504530,
3255
+ # "turnover": 184.41206804,
3256
+ # "turnover_symbol": "USDT",
3257
+ # "turnover_usd": 184.41206804,
3258
+ # "volume": 0.005
3259
+ # },
3260
+ # "success": True
3261
+ # }
3262
+ #
3263
+ result = self.safe_dict(response, 'result', {})
3264
+ return self.parse_option(result, None, market)
3265
+
3266
+ def parse_option(self, chain, currency: Currency = None, market: Market = None):
3267
+ #
3268
+ # {
3269
+ # "close": 6793.0,
3270
+ # "contract_type": "call_options",
3271
+ # "greeks": {
3272
+ # "delta": "0.94739174",
3273
+ # "gamma": "0.00002206",
3274
+ # "rho": "11.00890725",
3275
+ # "spot": "36839.58124652",
3276
+ # "theta": "-18.18365310",
3277
+ # "vega": "7.85209698"
3278
+ # },
3279
+ # "high": 7556.0,
3280
+ # "low": 6793.0,
3281
+ # "mark_price": "6955.70698909",
3282
+ # "mark_vol": "0.66916863",
3283
+ # "oi": "1.8980",
3284
+ # "oi_change_usd_6h": "110.4600",
3285
+ # "oi_contracts": "1898",
3286
+ # "oi_value": "1.8980",
3287
+ # "oi_value_symbol": "BTC",
3288
+ # "oi_value_usd": "69940.7319",
3289
+ # "open": 7.2e3,
3290
+ # "price_band": {
3291
+ # "lower_limit": "5533.89814767",
3292
+ # "upper_limit": "11691.37688371"
3293
+ # },
3294
+ # "product_id": 129508,
3295
+ # "quotes": {
3296
+ # "ask_iv": "0.90180438",
3297
+ # "ask_size": "1898",
3298
+ # "best_ask": "7210",
3299
+ # "best_bid": "6913",
3300
+ # "bid_iv": "0.60881706",
3301
+ # "bid_size": "3163",
3302
+ # "impact_mid_price": null,
3303
+ # "mark_iv": "0.66973549"
3304
+ # },
3305
+ # "size": 5,
3306
+ # "spot_price": "36839.58153868",
3307
+ # "strike_price": "30000",
3308
+ # "symbol": "C-BTC-30000-241123",
3309
+ # "timestamp": 1699584998504530,
3310
+ # "turnover": 184.41206804,
3311
+ # "turnover_symbol": "USDT",
3312
+ # "turnover_usd": 184.41206804,
3313
+ # "volume": 0.005
3314
+ # }
3315
+ #
3316
+ marketId = self.safe_string(chain, 'symbol')
3317
+ market = self.safe_market(marketId, market)
3318
+ quotes = self.safe_dict(chain, 'quotes', {})
3319
+ timestamp = self.safe_integer_product(chain, 'timestamp', 0.001)
3320
+ return {
3321
+ 'info': chain,
3322
+ 'currency': None,
3323
+ 'symbol': market['symbol'],
3324
+ 'timestamp': timestamp,
3325
+ 'datetime': self.iso8601(timestamp),
3326
+ 'impliedVolatility': self.safe_number(quotes, 'mark_iv'),
3327
+ 'openInterest': self.safe_number(chain, 'oi'),
3328
+ 'bidPrice': self.safe_number(quotes, 'best_bid'),
3329
+ 'askPrice': self.safe_number(quotes, 'best_ask'),
3330
+ 'midPrice': self.safe_number(quotes, 'impact_mid_price'),
3331
+ 'markPrice': self.safe_number(chain, 'mark_price'),
3332
+ 'lastPrice': None,
3333
+ 'underlyingPrice': self.safe_number(chain, 'spot_price'),
3334
+ 'change': None,
3335
+ 'percentage': None,
3336
+ 'baseVolume': self.safe_number(chain, 'volume'),
3337
+ 'quoteVolume': None,
3338
+ }
3339
+
3195
3340
  def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
3196
3341
  requestPath = '/' + self.version + '/' + self.implode_params(path, params)
3197
3342
  url = self.urls['api'][api] + requestPath
ccxt/deribit.py CHANGED
@@ -752,7 +752,7 @@ class deribit(Exchange, ImplicitAPI):
752
752
  'code': self.safe_currency_code(None, currency),
753
753
  }
754
754
 
755
- def fetch_markets(self, params={}):
755
+ def fetch_markets(self, params={}) -> List[Market]:
756
756
  """
757
757
  retrieves data on all markets for deribit
758
758
  :see: https://docs.deribit.com/#public-get_currencies
@@ -1297,9 +1297,15 @@ class deribit(Exchange, ImplicitAPI):
1297
1297
  :param int [since]: timestamp in ms of the earliest candle to fetch
1298
1298
  :param int [limit]: the maximum amount of candles to fetch
1299
1299
  :param dict [params]: extra parameters specific to the exchange API endpoint
1300
+ :param boolean [params.paginate]: whether to paginate the results, set to False by default
1301
+ :param int [params.until]: the latest time in ms to fetch ohlcv for
1300
1302
  :returns int[][]: A list of candles ordered, open, high, low, close, volume
1301
1303
  """
1302
1304
  self.load_markets()
1305
+ paginate = False
1306
+ paginate, params = self.handle_option_and_params(params, 'fetchOHLCV', 'paginate')
1307
+ if paginate:
1308
+ return self.fetch_paginated_call_deterministic('fetchOHLCV', symbol, since, limit, timeframe, params, 5000)
1303
1309
  market = self.market(symbol)
1304
1310
  request = {
1305
1311
  'instrument_name': market['id'],
@@ -1319,6 +1325,10 @@ class deribit(Exchange, ImplicitAPI):
1319
1325
  request['end_timestamp'] = now
1320
1326
  else:
1321
1327
  request['end_timestamp'] = self.sum(since, limit * duration * 1000)
1328
+ until = self.safe_integer(params, 'until')
1329
+ if until is not None:
1330
+ params = self.omit(params, 'until')
1331
+ request['end_timestamp'] = until
1322
1332
  response = self.publicGetGetTradingviewChartData(self.extend(request, params))
1323
1333
  #
1324
1334
  # {
@@ -1438,6 +1448,7 @@ class deribit(Exchange, ImplicitAPI):
1438
1448
  :param int [since]: timestamp in ms of the earliest trade to fetch
1439
1449
  :param int [limit]: the maximum amount of trades to fetch
1440
1450
  :param dict [params]: extra parameters specific to the exchange API endpoint
1451
+ :param int [params.until]: the latest time in ms to fetch trades for
1441
1452
  :returns Trade[]: a list of `trade structures <https://docs.ccxt.com/#/?id=public-trades>`
1442
1453
  """
1443
1454
  self.load_markets()
@@ -1450,8 +1461,12 @@ class deribit(Exchange, ImplicitAPI):
1450
1461
  request['start_timestamp'] = since
1451
1462
  if limit is not None:
1452
1463
  request['count'] = min(limit, 1000) # default 10
1464
+ until = self.safe_integer_2(params, 'until', 'end_timestamp')
1465
+ if until is not None:
1466
+ params = self.omit(params, ['until'])
1467
+ request['end_timestamp'] = until
1453
1468
  response = None
1454
- if since is None:
1469
+ if (since is None) and not ('end_timestamp' in request):
1455
1470
  response = self.publicGetGetLastTradesByInstrument(self.extend(request, params))
1456
1471
  else:
1457
1472
  response = self.publicGetGetLastTradesByInstrumentAndTime(self.extend(request, params))
@@ -3403,7 +3418,7 @@ class deribit(Exchange, ImplicitAPI):
3403
3418
  timestamp = self.safe_integer(chain, 'timestamp')
3404
3419
  return {
3405
3420
  'info': chain,
3406
- 'currency': code['code'],
3421
+ 'currency': code,
3407
3422
  'symbol': market['symbol'],
3408
3423
  'timestamp': timestamp,
3409
3424
  'datetime': self.iso8601(timestamp),
ccxt/digifinex.py CHANGED
@@ -522,7 +522,7 @@ class digifinex(Exchange, ImplicitAPI):
522
522
  result[code]['precision'] = precision if (result[code]['precision'] is None) else max(result[code]['precision'], precision)
523
523
  return result
524
524
 
525
- def fetch_markets(self, params={}):
525
+ def fetch_markets(self, params={}) -> List[Market]:
526
526
  """
527
527
  retrieves data on all markets for digifinex
528
528
  :param dict [params]: extra parameters specific to the exchange API endpoint
ccxt/exmo.py CHANGED
@@ -683,7 +683,7 @@ class exmo(Exchange, ImplicitAPI):
683
683
  }
684
684
  return result
685
685
 
686
- def fetch_markets(self, params={}):
686
+ def fetch_markets(self, params={}) -> List[Market]:
687
687
  """
688
688
  retrieves data on all markets for exmo
689
689
  :see: https://documenter.getpostman.com/view/10287440/SzYXWKPi#7de7e75c-5833-45a8-b937-c2276d235aaa
ccxt/gate.py CHANGED
@@ -966,7 +966,7 @@ class gate(Exchange, ImplicitAPI):
966
966
  return self.create_expired_option_market(marketId)
967
967
  return super(gate, self).safe_market(marketId, market, delimiter, marketType)
968
968
 
969
- def fetch_markets(self, params={}):
969
+ def fetch_markets(self, params={}) -> List[Market]:
970
970
  """
971
971
  retrieves data on all markets for gate
972
972
  :see: https://www.gate.io/docs/developers/apiv4/en/#list-all-currency-pairs-supported # spot
ccxt/gemini.py CHANGED
@@ -263,6 +263,7 @@ class gemini(Exchange, ImplicitAPI):
263
263
  'broad': {
264
264
  'The Gemini Exchange is currently undergoing maintenance.': OnMaintenance, # The Gemini Exchange is currently undergoing maintenance. Please check https://status.gemini.com/ for more information.
265
265
  'We are investigating technical issues with the Gemini Exchange.': ExchangeNotAvailable, # We are investigating technical issues with the Gemini Exchange. Please check https://status.gemini.com/ for more information.
266
+ 'Internal Server Error': ExchangeNotAvailable,
266
267
  },
267
268
  },
268
269
  'options': {
@@ -399,7 +400,7 @@ class gemini(Exchange, ImplicitAPI):
399
400
  }
400
401
  return result
401
402
 
402
- def fetch_markets(self, params={}):
403
+ def fetch_markets(self, params={}) -> List[Market]:
403
404
  """
404
405
  retrieves data on all markets for gemini
405
406
  :see: https://docs.gemini.com/rest-api/#symbols
ccxt/hitbtc.py CHANGED
@@ -665,7 +665,7 @@ class hitbtc(Exchange, ImplicitAPI):
665
665
  def nonce(self):
666
666
  return self.milliseconds()
667
667
 
668
- def fetch_markets(self, params={}):
668
+ def fetch_markets(self, params={}) -> List[Market]:
669
669
  """
670
670
  retrieves data on all markets for hitbtc
671
671
  :see: https://api.hitbtc.com/#symbols
ccxt/hollaex.py CHANGED
@@ -215,7 +215,7 @@ class hollaex(Exchange, ImplicitAPI):
215
215
  },
216
216
  })
217
217
 
218
- def fetch_markets(self, params={}):
218
+ def fetch_markets(self, params={}) -> List[Market]:
219
219
  """
220
220
  retrieves data on all markets for hollaex
221
221
  :see: https://apidocs.hollaex.com/#constants
ccxt/htx.py CHANGED
@@ -1600,7 +1600,7 @@ class htx(Exchange, ImplicitAPI):
1600
1600
  def cost_to_precision(self, symbol, cost):
1601
1601
  return self.decimal_to_precision(cost, TRUNCATE, self.markets[symbol]['precision']['cost'], self.precisionMode)
1602
1602
 
1603
- def fetch_markets(self, params={}):
1603
+ def fetch_markets(self, params={}) -> List[Market]:
1604
1604
  """
1605
1605
  retrieves data on all markets for huobi
1606
1606
  :param dict [params]: extra parameters specific to the exchange API endpoint
ccxt/huobijp.py CHANGED
@@ -419,7 +419,7 @@ class huobijp(Exchange, ImplicitAPI):
419
419
  def cost_to_precision(self, symbol, cost):
420
420
  return self.decimal_to_precision(cost, TRUNCATE, self.markets[symbol]['precision']['cost'], self.precisionMode)
421
421
 
422
- def fetch_markets(self, params={}):
422
+ def fetch_markets(self, params={}) -> List[Market]:
423
423
  """
424
424
  retrieves data on all markets for huobijp
425
425
  :param dict [params]: extra parameters specific to the exchange API endpoint
ccxt/hyperliquid.py CHANGED
@@ -50,7 +50,7 @@ class hyperliquid(Exchange, ImplicitAPI):
50
50
  'createMarketSellOrderWithCost': False,
51
51
  'createOrder': True,
52
52
  'createOrders': True,
53
- 'createReduceOnlyOrder': False,
53
+ 'createReduceOnlyOrder': True,
54
54
  'editOrder': True,
55
55
  'fetchAccounts': False,
56
56
  'fetchBalance': True,
@@ -250,7 +250,7 @@ class hyperliquid(Exchange, ImplicitAPI):
250
250
  }
251
251
  return result
252
252
 
253
- def fetch_markets(self, params={}):
253
+ def fetch_markets(self, params={}) -> List[Market]:
254
254
  """
255
255
  retrieves data on all markets for hyperliquid
256
256
  :see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-asset-contexts-includes-mark-price-current-funding-open-interest-etc
@@ -851,7 +851,7 @@ class hyperliquid(Exchange, ImplicitAPI):
851
851
  orderType['limit'] = {
852
852
  'tif': timeInForce,
853
853
  }
854
- orderParams = self.omit(orderParams, ['clientOrderId', 'slippage', 'triggerPrice', 'stopPrice', 'stopLossPrice', 'takeProfitPrice', 'timeInForce', 'client_id'])
854
+ orderParams = self.omit(orderParams, ['clientOrderId', 'slippage', 'triggerPrice', 'stopPrice', 'stopLossPrice', 'takeProfitPrice', 'timeInForce', 'client_id', 'reduceOnly', 'postOnly'])
855
855
  orderObj = {
856
856
  'a': self.parse_to_int(market['baseId']),
857
857
  'b': isBuy,
@@ -1691,7 +1691,7 @@ class hyperliquid(Exchange, ImplicitAPI):
1691
1691
  if leverage is None:
1692
1692
  raise ArgumentsRequired(self.id + ' setMarginMode() requires a leverage parameter')
1693
1693
  asset = self.parse_to_int(market['baseId'])
1694
- isCross = (marginMode == 'isolated')
1694
+ isCross = (marginMode == 'cross')
1695
1695
  nonce = self.milliseconds()
1696
1696
  params = self.omit(params, ['leverage'])
1697
1697
  updateAction = {
@@ -1705,16 +1705,17 @@ class hyperliquid(Exchange, ImplicitAPI):
1705
1705
  params = self.omit(params, 'vaultAddress')
1706
1706
  if vaultAddress.startswith('0x'):
1707
1707
  vaultAddress = vaultAddress.replace('0x', '')
1708
- signature = self.sign_l1_action(updateAction, nonce, vaultAddress)
1708
+ extendedAction = self.extend(updateAction, params)
1709
+ signature = self.sign_l1_action(extendedAction, nonce, vaultAddress)
1709
1710
  request = {
1710
- 'action': updateAction,
1711
+ 'action': extendedAction,
1711
1712
  'nonce': nonce,
1712
1713
  'signature': signature,
1713
1714
  # 'vaultAddress': vaultAddress,
1714
1715
  }
1715
1716
  if vaultAddress is not None:
1716
1717
  request['vaultAddress'] = vaultAddress
1717
- response = self.privatePostExchange(self.extend(request, params))
1718
+ response = self.privatePostExchange(request)
1718
1719
  #
1719
1720
  # {
1720
1721
  # 'response': {
@@ -1920,9 +1921,9 @@ class hyperliquid(Exchange, ImplicitAPI):
1920
1921
  userAux, params = self.handle_option_and_params(params, methodName, 'user')
1921
1922
  user = userAux
1922
1923
  user, params = self.handle_option_and_params(params, methodName, 'address', userAux)
1923
- if user is not None:
1924
+ if (user is not None) and (user != ''):
1924
1925
  return [user, params]
1925
- if self.walletAddress is not None:
1926
+ if (self.walletAddress is not None) and (self.walletAddress != ''):
1926
1927
  return [self.walletAddress, params]
1927
1928
  raise ArgumentsRequired(self.id + ' ' + methodName + '() requires a user parameter inside \'params\' or the wallet address set')
1928
1929
 
ccxt/idex.py CHANGED
@@ -204,7 +204,7 @@ class idex(Exchange, ImplicitAPI):
204
204
  price = self.decimal_to_precision(price, ROUND, market['precision']['price'], self.precisionMode)
205
205
  return self.decimal_to_precision(price, TRUNCATE, quoteAssetPrecision, DECIMAL_PLACES, PAD_WITH_ZERO)
206
206
 
207
- def fetch_markets(self, params={}):
207
+ def fetch_markets(self, params={}) -> List[Market]:
208
208
  """
209
209
  retrieves data on all markets for idex
210
210
  :see: https://api-docs-v3.idex.io/#get-markets
@@ -143,7 +143,7 @@ class independentreserve(Exchange, ImplicitAPI):
143
143
  'precisionMode': TICK_SIZE,
144
144
  })
145
145
 
146
- def fetch_markets(self, params={}):
146
+ def fetch_markets(self, params={}) -> List[Market]:
147
147
  """
148
148
  retrieves data on all markets for independentreserve
149
149
  :param dict [params]: extra parameters specific to the exchange API endpoint
ccxt/indodax.py CHANGED
@@ -229,7 +229,7 @@ class indodax(Exchange, ImplicitAPI):
229
229
  #
230
230
  return self.safe_integer(response, 'server_time')
231
231
 
232
- def fetch_markets(self, params={}):
232
+ def fetch_markets(self, params={}) -> List[Market]:
233
233
  """
234
234
  retrieves data on all markets for indodax
235
235
  :see: https://github.com/btcid/indodax-official-api-docs/blob/master/Public-RestAPI.md#pairs
ccxt/kraken.py CHANGED
@@ -465,7 +465,7 @@ class kraken(Exchange, ImplicitAPI):
465
465
  def fee_to_precision(self, symbol, fee):
466
466
  return self.decimal_to_precision(fee, TRUNCATE, self.markets[symbol]['precision']['amount'], self.precisionMode)
467
467
 
468
- def fetch_markets(self, params={}):
468
+ def fetch_markets(self, params={}) -> List[Market]:
469
469
  """
470
470
  retrieves data on all markets for kraken
471
471
  :see: https://docs.kraken.com/rest/#tag/Spot-Market-Data/operation/getTradableAssetPairs
ccxt/krakenfutures.py CHANGED
@@ -280,7 +280,7 @@ class krakenfutures(Exchange, ImplicitAPI):
280
280
  },
281
281
  })
282
282
 
283
- def fetch_markets(self, params={}):
283
+ def fetch_markets(self, params={}) -> List[Market]:
284
284
  """
285
285
  Fetches the available trading markets from the exchange, Multi-collateral markets are returned markets, but can be settled in multiple currencies
286
286
  :see: https://docs.futures.kraken.com/#http-api-trading-v3-api-instrument-details-get-instruments
ccxt/kucoin.py CHANGED
@@ -991,7 +991,7 @@ class kucoin(Exchange, ImplicitAPI):
991
991
  'info': response,
992
992
  }
993
993
 
994
- def fetch_markets(self, params={}):
994
+ def fetch_markets(self, params={}) -> List[Market]:
995
995
  """
996
996
  retrieves data on all markets for kucoin
997
997
  :see: https://docs.kucoin.com/#get-symbols-list-deprecated