ccxt 4.2.82__py2.py3-none-any.whl → 4.2.84__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.
- ccxt/__init__.py +1 -1
- ccxt/abstract/bitstamp.py +1 -1
- ccxt/abstract/bybit.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 +12 -5
- 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 +1 -1
- 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 +5 -5
- 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 +2 -3
- 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 +1 -1
- ccxt/async_support/deribit.py +17 -2
- 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 +6 -28
- ccxt/async_support/huobijp.py +1 -1
- ccxt/async_support/hyperliquid.py +6 -5
- 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 +11 -2
- 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 +1 -1
- 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 +12 -5
- ccxt/bithumb.py +2 -1
- ccxt/bitmart.py +1 -1
- ccxt/bitmex.py +1 -1
- ccxt/bitopro.py +1 -1
- ccxt/bitrue.py +1 -1
- 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 +5 -5
- ccxt/cex.py +1 -1
- ccxt/coinbase.py +1 -1
- ccxt/coinbaseinternational.py +1 -1
- ccxt/coinbasepro.py +1 -1
- ccxt/coinex.py +2 -3
- 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 +1 -1
- ccxt/deribit.py +17 -2
- 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 +6 -28
- ccxt/huobijp.py +1 -1
- ccxt/hyperliquid.py +6 -5
- 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 +11 -2
- 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 +1 -1
- 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/test/base/test_market.py +3 -0
- 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.82.dist-info → ccxt-4.2.84.dist-info}/METADATA +5 -5
- {ccxt-4.2.82.dist-info → ccxt-4.2.84.dist-info}/RECORD +191 -190
- {ccxt-4.2.82.dist-info → ccxt-4.2.84.dist-info}/WHEEL +0 -0
- {ccxt-4.2.82.dist-info → ccxt-4.2.84.dist-info}/top_level.txt +0 -0
ccxt/btcturk.py
CHANGED
@@ -149,7 +149,7 @@ class btcturk(Exchange, ImplicitAPI):
|
|
149
149
|
'precisionMode': TICK_SIZE,
|
150
150
|
})
|
151
151
|
|
152
|
-
def fetch_markets(self, params={}):
|
152
|
+
def fetch_markets(self, params={}) -> List[Market]:
|
153
153
|
"""
|
154
154
|
retrieves data on all markets for btcturk
|
155
155
|
:see: https://docs.btcturk.com/public-endpoints/exchange-info
|
ccxt/bybit.py
CHANGED
@@ -36,7 +36,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
36
36
|
'version': 'v5',
|
37
37
|
'userAgent': None,
|
38
38
|
'rateLimit': 20,
|
39
|
-
'hostname': 'bybit.com', # bybit.com, bytick.com
|
39
|
+
'hostname': 'bybit.com', # bybit.com, bytick.com, bybit.nl, bybit.com.hk
|
40
40
|
'pro': True,
|
41
41
|
'certified': True,
|
42
42
|
'has': {
|
@@ -482,7 +482,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
482
482
|
'v5/account/mmp-modify': 5,
|
483
483
|
'v5/account/mmp-reset': 5,
|
484
484
|
# asset
|
485
|
-
'v5/asset/transfer/inter-transfer':
|
485
|
+
'v5/asset/transfer/inter-transfer': 50, # 1/s => cost = 50 / 1 = 50
|
486
486
|
'v5/asset/transfer/save-transfer-sub-member': 150, # 1/3/s => cost = 50 / 1/3 = 150
|
487
487
|
'v5/asset/transfer/universal-transfer': 10, # 5/s => cost = 50 / 5 = 10
|
488
488
|
'v5/asset/deposit/deposit-to-account': 5,
|
@@ -1420,7 +1420,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
1420
1420
|
}
|
1421
1421
|
return result
|
1422
1422
|
|
1423
|
-
def fetch_markets(self, params={}):
|
1423
|
+
def fetch_markets(self, params={}) -> List[Market]:
|
1424
1424
|
"""
|
1425
1425
|
retrieves data on all markets for bybit
|
1426
1426
|
:see: https://bybit-exchange.github.io/docs/v5/market/instrument
|
@@ -2715,10 +2715,10 @@ class bybit(Exchange, ImplicitAPI):
|
|
2715
2715
|
# limit: [1, 25]. Default: 1
|
2716
2716
|
request['category'] = 'option'
|
2717
2717
|
elif market['linear']:
|
2718
|
-
# limit: [1,
|
2718
|
+
# limit: [1, 500]. Default: 25
|
2719
2719
|
request['category'] = 'linear'
|
2720
2720
|
elif market['inverse']:
|
2721
|
-
# limit: [1,
|
2721
|
+
# limit: [1, 500]. Default: 25
|
2722
2722
|
request['category'] = 'inverse'
|
2723
2723
|
request['limit'] = limit if (limit is not None) else defaultLimit
|
2724
2724
|
response = self.publicGetV5MarketOrderbook(self.extend(request, params))
|
ccxt/cex.py
CHANGED
@@ -340,7 +340,7 @@ class cex(Exchange, ImplicitAPI):
|
|
340
340
|
}
|
341
341
|
return result
|
342
342
|
|
343
|
-
def fetch_markets(self, params={}):
|
343
|
+
def fetch_markets(self, params={}) -> List[Market]:
|
344
344
|
"""
|
345
345
|
retrieves data on all markets for cex
|
346
346
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
ccxt/coinbase.py
CHANGED
@@ -1030,7 +1030,7 @@ class coinbase(Exchange, ImplicitAPI):
|
|
1030
1030
|
},
|
1031
1031
|
})
|
1032
1032
|
|
1033
|
-
def fetch_markets(self, params={}):
|
1033
|
+
def fetch_markets(self, params={}) -> List[Market]:
|
1034
1034
|
"""
|
1035
1035
|
:see: https://docs.cloud.coinbase.com/advanced-trade-api/reference/retailbrokerageapi_getproducts
|
1036
1036
|
:see: https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-currencies#get-fiat-currencies
|
ccxt/coinbaseinternational.py
CHANGED
@@ -894,7 +894,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
894
894
|
},
|
895
895
|
})
|
896
896
|
|
897
|
-
def fetch_markets(self, params={}):
|
897
|
+
def fetch_markets(self, params={}) -> List[Market]:
|
898
898
|
"""
|
899
899
|
:see: https://docs.cloud.coinbase.com/intx/reference/getinstruments
|
900
900
|
retrieves data on all markets for coinbaseinternational
|
ccxt/coinbasepro.py
CHANGED
@@ -307,7 +307,7 @@ class coinbasepro(Exchange, ImplicitAPI):
|
|
307
307
|
}
|
308
308
|
return result
|
309
309
|
|
310
|
-
def fetch_markets(self, params={}):
|
310
|
+
def fetch_markets(self, params={}) -> List[Market]:
|
311
311
|
"""
|
312
312
|
retrieves data on all markets for coinbasepro
|
313
313
|
:see: https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getproducts
|
ccxt/coinex.py
CHANGED
@@ -488,7 +488,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
488
488
|
result[code]['limits']['withdraw']['min'] = self.parse_number(minWithdrawString)
|
489
489
|
return result
|
490
490
|
|
491
|
-
def fetch_markets(self, params={}):
|
491
|
+
def fetch_markets(self, params={}) -> List[Market]:
|
492
492
|
"""
|
493
493
|
retrieves data on all markets for coinex
|
494
494
|
:see: https://viabtc.github.io/coinex_api_en_doc/spot/#docsspot001_market002_all_market_info
|
@@ -3514,8 +3514,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3514
3514
|
# }
|
3515
3515
|
#
|
3516
3516
|
marketId = self.safe_string(position, 'market')
|
3517
|
-
|
3518
|
-
market = self.safe_market(marketId, market, None, defaultType)
|
3517
|
+
market = self.safe_market(marketId, market, None, 'swap')
|
3519
3518
|
symbol = market['symbol']
|
3520
3519
|
positionId = self.safe_integer(position, 'position_id')
|
3521
3520
|
marginModeInteger = self.safe_integer(position, 'type')
|
ccxt/coinlist.py
CHANGED
@@ -397,7 +397,7 @@ class coinlist(Exchange, ImplicitAPI):
|
|
397
397
|
}
|
398
398
|
return result
|
399
399
|
|
400
|
-
def fetch_markets(self, params={}):
|
400
|
+
def fetch_markets(self, params={}) -> List[Market]:
|
401
401
|
"""
|
402
402
|
retrieves data on all markets for coinlist
|
403
403
|
:see: https://trade-docs.coinlist.co/?javascript--nodejs#list-symbols
|
ccxt/coinmate.py
CHANGED
@@ -230,7 +230,7 @@ class coinmate(Exchange, ImplicitAPI):
|
|
230
230
|
'precisionMode': TICK_SIZE,
|
231
231
|
})
|
232
232
|
|
233
|
-
def fetch_markets(self, params={}):
|
233
|
+
def fetch_markets(self, params={}) -> List[Market]:
|
234
234
|
"""
|
235
235
|
retrieves data on all markets for coinmate
|
236
236
|
:see: https://coinmate.docs.apiary.io/#reference/trading-pairs/get-trading-pairs/get
|
ccxt/coinmetro.py
CHANGED
@@ -339,7 +339,7 @@ class coinmetro(Exchange, ImplicitAPI):
|
|
339
339
|
self.options['currencyIdsListForParseMarket'] = list(currenciesById.keys())
|
340
340
|
return result
|
341
341
|
|
342
|
-
def fetch_markets(self, params={}):
|
342
|
+
def fetch_markets(self, params={}) -> List[Market]:
|
343
343
|
"""
|
344
344
|
retrieves data on all markets for coinmetro
|
345
345
|
:see: https://documenter.getpostman.com/view/3653795/SVfWN6KS#9fd18008-338e-4863-b07d-722878a46832
|
ccxt/coinone.py
CHANGED
@@ -268,7 +268,7 @@ class coinone(Exchange, ImplicitAPI):
|
|
268
268
|
}
|
269
269
|
return result
|
270
270
|
|
271
|
-
def fetch_markets(self, params={}):
|
271
|
+
def fetch_markets(self, params={}) -> List[Market]:
|
272
272
|
"""
|
273
273
|
retrieves data on all markets for coinone
|
274
274
|
:see: https://docs.coinone.co.kr/v1.0/reference/tickers
|
ccxt/coinsph.py
CHANGED
@@ -478,7 +478,7 @@ class coinsph(Exchange, ImplicitAPI):
|
|
478
478
|
#
|
479
479
|
return self.safe_integer(response, 'serverTime')
|
480
480
|
|
481
|
-
def fetch_markets(self, params={}):
|
481
|
+
def fetch_markets(self, params={}) -> List[Market]:
|
482
482
|
"""
|
483
483
|
retrieves data on all markets for coinsph
|
484
484
|
:see: https://coins-docs.github.io/rest-api/#exchange-information
|
ccxt/cryptocom.py
CHANGED
@@ -390,7 +390,7 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
390
390
|
},
|
391
391
|
})
|
392
392
|
|
393
|
-
def fetch_markets(self, params={}):
|
393
|
+
def fetch_markets(self, params={}) -> List[Market]:
|
394
394
|
"""
|
395
395
|
:see: https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#public-get-instruments
|
396
396
|
retrieves data on all markets for cryptocom
|
ccxt/currencycom.py
CHANGED
@@ -395,7 +395,7 @@ class currencycom(Exchange, ImplicitAPI):
|
|
395
395
|
}
|
396
396
|
return result
|
397
397
|
|
398
|
-
def fetch_markets(self, params={}):
|
398
|
+
def fetch_markets(self, params={}) -> List[Market]:
|
399
399
|
"""
|
400
400
|
retrieves data on all markets for currencycom
|
401
401
|
:see: https://apitradedoc.currency.com/swagger-ui.html#/rest-api/exchangeInfoUsingGET
|
ccxt/delta.py
CHANGED
@@ -513,7 +513,7 @@ class delta(Exchange, ImplicitAPI):
|
|
513
513
|
result[numericIdString] = item
|
514
514
|
return result
|
515
515
|
|
516
|
-
def fetch_markets(self, params={}):
|
516
|
+
def fetch_markets(self, params={}) -> List[Market]:
|
517
517
|
"""
|
518
518
|
retrieves data on all markets for delta
|
519
519
|
:see: https://docs.delta.exchange/#get-list-of-products
|
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))
|
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
|
@@ -2140,7 +2140,7 @@ class htx(Exchange, ImplicitAPI):
|
|
2140
2140
|
# "ts":1639547261293
|
2141
2141
|
# }
|
2142
2142
|
#
|
2143
|
-
#
|
2143
|
+
# linear swap, linear future, inverse swap, inverse future
|
2144
2144
|
#
|
2145
2145
|
# {
|
2146
2146
|
# "status":"ok",
|
@@ -2157,37 +2157,15 @@ class htx(Exchange, ImplicitAPI):
|
|
2157
2157
|
# "high":"0.10725",
|
2158
2158
|
# "amount":"2340267.415144052378486261756692535687481566",
|
2159
2159
|
# "count":882,
|
2160
|
-
# "vol":"24706"
|
2160
|
+
# "vol":"24706",
|
2161
|
+
# "trade_turnover":"840726.5048", # only in linear futures
|
2162
|
+
# "business_type":"futures", # only in linear futures
|
2163
|
+
# "contract_code":"BTC-USDT-CW", # only in linear futures, instead of 'symbol'
|
2161
2164
|
# }
|
2162
2165
|
# ],
|
2163
2166
|
# "ts":1637504679376
|
2164
2167
|
# }
|
2165
2168
|
#
|
2166
|
-
# linear futures
|
2167
|
-
#
|
2168
|
-
# {
|
2169
|
-
# "status":"ok",
|
2170
|
-
# "ticks":[
|
2171
|
-
# {
|
2172
|
-
# "id":1640745627,
|
2173
|
-
# "ts":1640745627957,
|
2174
|
-
# "ask":[48079.1,20],
|
2175
|
-
# "bid":[47713.8,125],
|
2176
|
-
# "business_type":"futures",
|
2177
|
-
# "contract_code":"BTC-USDT-CW",
|
2178
|
-
# "open":"49011.8",
|
2179
|
-
# "close":"47934",
|
2180
|
-
# "low":"47292.3",
|
2181
|
-
# "high":"49011.8",
|
2182
|
-
# "amount":"17.398",
|
2183
|
-
# "count":1515,
|
2184
|
-
# "vol":"17398",
|
2185
|
-
# "trade_turnover":"840726.5048"
|
2186
|
-
# }
|
2187
|
-
# ],
|
2188
|
-
# "ts":1640745627988
|
2189
|
-
# }
|
2190
|
-
#
|
2191
2169
|
tickers = self.safe_value_2(response, 'data', 'ticks', [])
|
2192
2170
|
timestamp = self.safe_integer(response, 'ts')
|
2193
2171
|
result = {}
|
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
@@ -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
|
@@ -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': {
|
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
@@ -25,6 +25,7 @@ from ccxt.base.errors import RateLimitExceeded
|
|
25
25
|
from ccxt.base.errors import ExchangeNotAvailable
|
26
26
|
from ccxt.base.errors import InvalidNonce
|
27
27
|
from ccxt.base.errors import AuthenticationError
|
28
|
+
from ccxt.base.decimal_to_precision import TRUNCATE
|
28
29
|
from ccxt.base.decimal_to_precision import TICK_SIZE
|
29
30
|
from ccxt.base.precise import Precise
|
30
31
|
|
@@ -441,6 +442,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
441
442
|
'Order size below the minimum requirement.': InvalidOrder, # {"code":"400100","msg":"Order size below the minimum requirement."}
|
442
443
|
'The withdrawal amount is below the minimum requirement.': ExchangeError, # {"code":"400100","msg":"The withdrawal amount is below the minimum requirement."}
|
443
444
|
'Unsuccessful! Exceeded the max. funds out-transfer limit': InsufficientFunds, # {"code":"200000","msg":"Unsuccessful! Exceeded the max. funds out-transfer limit"}
|
445
|
+
'The amount increment is invalid.': BadRequest,
|
444
446
|
'400': BadRequest,
|
445
447
|
'401': AuthenticationError,
|
446
448
|
'403': NotSupported,
|
@@ -991,7 +993,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
991
993
|
'info': response,
|
992
994
|
}
|
993
995
|
|
994
|
-
def fetch_markets(self, params={}):
|
996
|
+
def fetch_markets(self, params={}) -> List[Market]:
|
995
997
|
"""
|
996
998
|
retrieves data on all markets for kucoin
|
997
999
|
:see: https://docs.kucoin.com/#get-symbols-list-deprecated
|
@@ -2091,6 +2093,13 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2091
2093
|
data = self.safe_list(data, 'data', [])
|
2092
2094
|
return self.parse_orders(data)
|
2093
2095
|
|
2096
|
+
def market_order_amount_to_precision(self, symbol: str, amount):
|
2097
|
+
market = self.market(symbol)
|
2098
|
+
result = self.decimal_to_precision(amount, TRUNCATE, market['info']['quoteIncrement'], self.precisionMode, self.paddingMode)
|
2099
|
+
if result == '0':
|
2100
|
+
raise InvalidOrder(self.id + ' amount of ' + market['symbol'] + ' must be greater than minimum amount precision of ' + self.number_to_string(market['precision']['amount']))
|
2101
|
+
return result
|
2102
|
+
|
2094
2103
|
def create_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
2095
2104
|
market = self.market(symbol)
|
2096
2105
|
# required param, cannot be used twice
|
@@ -2111,7 +2120,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2111
2120
|
if quoteAmount is not None:
|
2112
2121
|
params = self.omit(params, ['cost', 'funds'])
|
2113
2122
|
# kucoin uses base precision even for quote values
|
2114
|
-
costString = self.
|
2123
|
+
costString = self.market_order_amount_to_precision(symbol, quoteAmount)
|
2115
2124
|
request['funds'] = costString
|
2116
2125
|
else:
|
2117
2126
|
amountString = self.amount_to_precision(symbol, amount)
|