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.
- ccxt/__init__.py +1 -1
- ccxt/abstract/bitstamp.py +1 -1
- ccxt/ace.py +1 -1
- ccxt/alpaca.py +1 -1
- ccxt/ascendex.py +1 -1
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/ace.py +1 -1
- ccxt/async_support/alpaca.py +1 -1
- ccxt/async_support/ascendex.py +1 -1
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/bigone.py +1 -1
- ccxt/async_support/binance.py +1 -1
- ccxt/async_support/bingx.py +1 -1
- ccxt/async_support/bitbank.py +1 -1
- ccxt/async_support/bitbns.py +1 -1
- ccxt/async_support/bitfinex.py +1 -1
- ccxt/async_support/bitfinex2.py +1 -1
- ccxt/async_support/bitflyer.py +1 -1
- ccxt/async_support/bitget.py +2 -1
- ccxt/async_support/bithumb.py +2 -1
- ccxt/async_support/bitmart.py +1 -1
- ccxt/async_support/bitmex.py +1 -1
- ccxt/async_support/bitopro.py +1 -1
- ccxt/async_support/bitrue.py +2 -2
- ccxt/async_support/bitso.py +1 -1
- ccxt/async_support/bitstamp.py +43 -16
- ccxt/async_support/bitteam.py +1 -1
- ccxt/async_support/bitvavo.py +1 -1
- ccxt/async_support/blockchaincom.py +1 -1
- ccxt/async_support/blofin.py +1 -1
- ccxt/async_support/btcalpha.py +1 -1
- ccxt/async_support/btcmarkets.py +1 -1
- ccxt/async_support/btcturk.py +1 -1
- ccxt/async_support/bybit.py +1 -1
- ccxt/async_support/cex.py +1 -1
- ccxt/async_support/coinbase.py +1 -1
- ccxt/async_support/coinbaseinternational.py +1 -1
- ccxt/async_support/coinbasepro.py +1 -1
- ccxt/async_support/coinex.py +1 -1
- ccxt/async_support/coinlist.py +1 -1
- ccxt/async_support/coinmate.py +1 -1
- ccxt/async_support/coinmetro.py +1 -1
- ccxt/async_support/coinone.py +1 -1
- ccxt/async_support/coinsph.py +1 -1
- ccxt/async_support/cryptocom.py +1 -1
- ccxt/async_support/currencycom.py +1 -1
- ccxt/async_support/delta.py +147 -2
- ccxt/async_support/deribit.py +18 -3
- ccxt/async_support/digifinex.py +1 -1
- ccxt/async_support/exmo.py +1 -1
- ccxt/async_support/gate.py +1 -1
- ccxt/async_support/gemini.py +2 -1
- ccxt/async_support/hitbtc.py +1 -1
- ccxt/async_support/hollaex.py +1 -1
- ccxt/async_support/htx.py +1 -1
- ccxt/async_support/huobijp.py +1 -1
- ccxt/async_support/hyperliquid.py +10 -9
- ccxt/async_support/idex.py +1 -1
- ccxt/async_support/independentreserve.py +1 -1
- ccxt/async_support/indodax.py +1 -1
- ccxt/async_support/kraken.py +1 -1
- ccxt/async_support/krakenfutures.py +1 -1
- ccxt/async_support/kucoin.py +1 -1
- ccxt/async_support/kucoinfutures.py +147 -10
- ccxt/async_support/kuna.py +1 -1
- ccxt/async_support/latoken.py +1 -1
- ccxt/async_support/lbank.py +1 -1
- ccxt/async_support/luno.py +1 -1
- ccxt/async_support/lykke.py +1 -1
- ccxt/async_support/mercado.py +1 -1
- ccxt/async_support/mexc.py +1 -1
- ccxt/async_support/ndax.py +1 -1
- ccxt/async_support/novadax.py +1 -1
- ccxt/async_support/oceanex.py +1 -1
- ccxt/async_support/okcoin.py +1 -1
- ccxt/async_support/okx.py +137 -2
- ccxt/async_support/onetrading.py +1 -1
- ccxt/async_support/p2b.py +1 -1
- ccxt/async_support/phemex.py +1 -1
- ccxt/async_support/poloniex.py +1 -1
- ccxt/async_support/poloniexfutures.py +1 -1
- ccxt/async_support/probit.py +1 -1
- ccxt/async_support/timex.py +1 -1
- ccxt/async_support/tokocrypto.py +1 -1
- ccxt/async_support/tradeogre.py +2 -1
- ccxt/async_support/upbit.py +1 -1
- ccxt/async_support/wavesexchange.py +1 -1
- ccxt/async_support/wazirx.py +1 -1
- ccxt/async_support/whitebit.py +1 -1
- ccxt/async_support/woo.py +1 -1
- ccxt/async_support/yobit.py +1 -1
- ccxt/async_support/zaif.py +1 -1
- ccxt/async_support/zonda.py +1 -1
- ccxt/base/exchange.py +1 -1
- ccxt/bigone.py +1 -1
- ccxt/binance.py +1 -1
- ccxt/bingx.py +1 -1
- ccxt/bitbank.py +1 -1
- ccxt/bitbns.py +1 -1
- ccxt/bitfinex.py +1 -1
- ccxt/bitfinex2.py +1 -1
- ccxt/bitflyer.py +1 -1
- ccxt/bitget.py +2 -1
- ccxt/bithumb.py +2 -1
- ccxt/bitmart.py +1 -1
- ccxt/bitmex.py +1 -1
- ccxt/bitopro.py +1 -1
- ccxt/bitrue.py +2 -2
- ccxt/bitso.py +1 -1
- ccxt/bitstamp.py +43 -16
- ccxt/bitteam.py +1 -1
- ccxt/bitvavo.py +1 -1
- ccxt/blockchaincom.py +1 -1
- ccxt/blofin.py +1 -1
- ccxt/btcalpha.py +1 -1
- ccxt/btcmarkets.py +1 -1
- ccxt/btcturk.py +1 -1
- ccxt/bybit.py +1 -1
- ccxt/cex.py +1 -1
- ccxt/coinbase.py +1 -1
- ccxt/coinbaseinternational.py +1 -1
- ccxt/coinbasepro.py +1 -1
- ccxt/coinex.py +1 -1
- ccxt/coinlist.py +1 -1
- ccxt/coinmate.py +1 -1
- ccxt/coinmetro.py +1 -1
- ccxt/coinone.py +1 -1
- ccxt/coinsph.py +1 -1
- ccxt/cryptocom.py +1 -1
- ccxt/currencycom.py +1 -1
- ccxt/delta.py +147 -2
- ccxt/deribit.py +18 -3
- ccxt/digifinex.py +1 -1
- ccxt/exmo.py +1 -1
- ccxt/gate.py +1 -1
- ccxt/gemini.py +2 -1
- ccxt/hitbtc.py +1 -1
- ccxt/hollaex.py +1 -1
- ccxt/htx.py +1 -1
- ccxt/huobijp.py +1 -1
- ccxt/hyperliquid.py +10 -9
- ccxt/idex.py +1 -1
- ccxt/independentreserve.py +1 -1
- ccxt/indodax.py +1 -1
- ccxt/kraken.py +1 -1
- ccxt/krakenfutures.py +1 -1
- ccxt/kucoin.py +1 -1
- ccxt/kucoinfutures.py +147 -10
- ccxt/kuna.py +1 -1
- ccxt/latoken.py +1 -1
- ccxt/lbank.py +1 -1
- ccxt/luno.py +1 -1
- ccxt/lykke.py +1 -1
- ccxt/mercado.py +1 -1
- ccxt/mexc.py +1 -1
- ccxt/ndax.py +1 -1
- ccxt/novadax.py +1 -1
- ccxt/oceanex.py +1 -1
- ccxt/okcoin.py +1 -1
- ccxt/okx.py +137 -2
- ccxt/onetrading.py +1 -1
- ccxt/p2b.py +1 -1
- ccxt/phemex.py +1 -1
- ccxt/poloniex.py +1 -1
- ccxt/poloniexfutures.py +1 -1
- ccxt/pro/__init__.py +3 -1
- ccxt/pro/bithumb.py +368 -0
- ccxt/pro/bitmart.py +1 -1
- ccxt/pro/bybit.py +1 -1
- ccxt/pro/cex.py +15 -5
- ccxt/pro/okx.py +2 -1
- ccxt/pro/p2b.py +14 -4
- ccxt/pro/woo.py +1 -1
- ccxt/probit.py +1 -1
- ccxt/timex.py +1 -1
- ccxt/tokocrypto.py +1 -1
- ccxt/tradeogre.py +2 -1
- ccxt/upbit.py +1 -1
- ccxt/wavesexchange.py +1 -1
- ccxt/wazirx.py +1 -1
- ccxt/whitebit.py +1 -1
- ccxt/woo.py +1 -1
- ccxt/yobit.py +1 -1
- ccxt/zaif.py +1 -1
- ccxt/zonda.py +1 -1
- {ccxt-4.2.81.dist-info → ccxt-4.2.83.dist-info}/METADATA +5 -5
- {ccxt-4.2.81.dist-info → ccxt-4.2.83.dist-info}/RECORD +189 -188
- {ccxt-4.2.81.dist-info → ccxt-4.2.83.dist-info}/WHEEL +0 -0
- {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
|
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':
|
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 == '
|
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
|
-
|
1708
|
+
extendedAction = self.extend(updateAction, params)
|
1709
|
+
signature = self.sign_l1_action(extendedAction, nonce, vaultAddress)
|
1709
1710
|
request = {
|
1710
|
-
'action':
|
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(
|
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
|
ccxt/independentreserve.py
CHANGED
@@ -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
|