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
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
from ccxt.async_support.kucoin import kucoin
|
7
7
|
from ccxt.abstract.kucoinfutures import ImplicitAPI
|
8
|
-
from ccxt.base.types import Balances, Currency, Int, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Trade, Transaction, TransferEntry
|
8
|
+
from ccxt.base.types import Balances, Currency, Int, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
9
9
|
from typing import List
|
10
10
|
from ccxt.base.errors import PermissionDenied
|
11
11
|
from ccxt.base.errors import AccountSuspended
|
@@ -95,7 +95,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
95
95
|
'fetchPremiumIndexOHLCV': False,
|
96
96
|
'fetchStatus': True,
|
97
97
|
'fetchTicker': True,
|
98
|
-
'fetchTickers':
|
98
|
+
'fetchTickers': True,
|
99
99
|
'fetchTime': True,
|
100
100
|
'fetchTrades': True,
|
101
101
|
'fetchTransactionFee': False,
|
@@ -368,7 +368,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
368
368
|
'info': response,
|
369
369
|
}
|
370
370
|
|
371
|
-
async def fetch_markets(self, params={}):
|
371
|
+
async def fetch_markets(self, params={}) -> List[Market]:
|
372
372
|
"""
|
373
373
|
retrieves data on all markets for kucoinfutures
|
374
374
|
:see: https://www.kucoin.com/docs/rest/futures-trading/market-data/get-symbols-list
|
@@ -735,6 +735,83 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
735
735
|
#
|
736
736
|
return self.parse_ticker(response['data'], market)
|
737
737
|
|
738
|
+
async def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
|
739
|
+
"""
|
740
|
+
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
741
|
+
:see: https://www.kucoin.com/docs/rest/futures-trading/market-data/get-symbols-list
|
742
|
+
:param str[] [symbols]: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
743
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
744
|
+
:returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
|
745
|
+
"""
|
746
|
+
await self.load_markets()
|
747
|
+
symbols = self.market_symbols(symbols)
|
748
|
+
response = await self.futuresPublicGetContractsActive(params)
|
749
|
+
#
|
750
|
+
# {
|
751
|
+
# "code": "200000",
|
752
|
+
# "data": {
|
753
|
+
# "symbol": "ETHUSDTM",
|
754
|
+
# "rootSymbol": "USDT",
|
755
|
+
# "type": "FFWCSX",
|
756
|
+
# "firstOpenDate": 1591086000000,
|
757
|
+
# "expireDate": null,
|
758
|
+
# "settleDate": null,
|
759
|
+
# "baseCurrency": "ETH",
|
760
|
+
# "quoteCurrency": "USDT",
|
761
|
+
# "settleCurrency": "USDT",
|
762
|
+
# "maxOrderQty": 1000000,
|
763
|
+
# "maxPrice": 1000000.0000000000,
|
764
|
+
# "lotSize": 1,
|
765
|
+
# "tickSize": 0.05,
|
766
|
+
# "indexPriceTickSize": 0.01,
|
767
|
+
# "multiplier": 0.01,
|
768
|
+
# "initialMargin": 0.01,
|
769
|
+
# "maintainMargin": 0.005,
|
770
|
+
# "maxRiskLimit": 1000000,
|
771
|
+
# "minRiskLimit": 1000000,
|
772
|
+
# "riskStep": 500000,
|
773
|
+
# "makerFeeRate": 0.00020,
|
774
|
+
# "takerFeeRate": 0.00060,
|
775
|
+
# "takerFixFee": 0.0000000000,
|
776
|
+
# "makerFixFee": 0.0000000000,
|
777
|
+
# "settlementFee": null,
|
778
|
+
# "isDeleverage": True,
|
779
|
+
# "isQuanto": True,
|
780
|
+
# "isInverse": False,
|
781
|
+
# "markMethod": "FairPrice",
|
782
|
+
# "fairMethod": "FundingRate",
|
783
|
+
# "fundingBaseSymbol": ".ETHINT8H",
|
784
|
+
# "fundingQuoteSymbol": ".USDTINT8H",
|
785
|
+
# "fundingRateSymbol": ".ETHUSDTMFPI8H",
|
786
|
+
# "indexSymbol": ".KETHUSDT",
|
787
|
+
# "settlementSymbol": "",
|
788
|
+
# "status": "Open",
|
789
|
+
# "fundingFeeRate": 0.000535,
|
790
|
+
# "predictedFundingFeeRate": 0.002197,
|
791
|
+
# "openInterest": "8724443",
|
792
|
+
# "turnoverOf24h": 341156641.03354263,
|
793
|
+
# "volumeOf24h": 74833.54000000,
|
794
|
+
# "markPrice": 4534.07,
|
795
|
+
# "indexPrice":4531.92,
|
796
|
+
# "lastTradePrice": 4545.4500000000,
|
797
|
+
# "nextFundingRateTime": 25481884,
|
798
|
+
# "maxLeverage": 100,
|
799
|
+
# "sourceExchanges": ["huobi", "Okex", "Binance", "Kucoin", "Poloniex", "Hitbtc"],
|
800
|
+
# "premiumsSymbol1M": ".ETHUSDTMPI",
|
801
|
+
# "premiumsSymbol8H": ".ETHUSDTMPI8H",
|
802
|
+
# "fundingBaseSymbol1M": ".ETHINT",
|
803
|
+
# "fundingQuoteSymbol1M": ".USDTINT",
|
804
|
+
# "lowPrice": 4456.90,
|
805
|
+
# "highPrice": 4674.25,
|
806
|
+
# "priceChgPct": 0.0046,
|
807
|
+
# "priceChg": 21.15
|
808
|
+
# }
|
809
|
+
# }
|
810
|
+
#
|
811
|
+
data = self.safe_list(response, 'data', [])
|
812
|
+
tickers = self.parse_tickers(data, symbols)
|
813
|
+
return self.filter_by_array_tickers(tickers, 'symbol', symbols)
|
814
|
+
|
738
815
|
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
739
816
|
#
|
740
817
|
# {
|
@@ -754,16 +831,76 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
754
831
|
# }
|
755
832
|
# }
|
756
833
|
#
|
757
|
-
|
834
|
+
# from fetchTickers
|
835
|
+
#
|
836
|
+
# {
|
837
|
+
# symbol: "XBTUSDTM",
|
838
|
+
# rootSymbol: "USDT",
|
839
|
+
# type: "FFWCSX",
|
840
|
+
# firstOpenDate: 1585555200000,
|
841
|
+
# expireDate: null,
|
842
|
+
# settleDate: null,
|
843
|
+
# baseCurrency: "XBT",
|
844
|
+
# quoteCurrency: "USDT",
|
845
|
+
# settleCurrency: "USDT",
|
846
|
+
# maxOrderQty: 1000000,
|
847
|
+
# maxPrice: 1000000,
|
848
|
+
# lotSize: 1,
|
849
|
+
# tickSize: 0.1,
|
850
|
+
# indexPriceTickSize: 0.01,
|
851
|
+
# multiplier: 0.001,
|
852
|
+
# initialMargin: 0.008,
|
853
|
+
# maintainMargin: 0.004,
|
854
|
+
# maxRiskLimit: 100000,
|
855
|
+
# minRiskLimit: 100000,
|
856
|
+
# riskStep: 50000,
|
857
|
+
# makerFeeRate: 0.0002,
|
858
|
+
# takerFeeRate: 0.0006,
|
859
|
+
# takerFixFee: 0,
|
860
|
+
# makerFixFee: 0,
|
861
|
+
# settlementFee: null,
|
862
|
+
# isDeleverage: True,
|
863
|
+
# isQuanto: True,
|
864
|
+
# isInverse: False,
|
865
|
+
# markMethod: "FairPrice",
|
866
|
+
# fairMethod: "FundingRate",
|
867
|
+
# fundingBaseSymbol: ".XBTINT8H",
|
868
|
+
# fundingQuoteSymbol: ".USDTINT8H",
|
869
|
+
# fundingRateSymbol: ".XBTUSDTMFPI8H",
|
870
|
+
# indexSymbol: ".KXBTUSDT",
|
871
|
+
# settlementSymbol: "",
|
872
|
+
# status: "Open",
|
873
|
+
# fundingFeeRate: 0.000297,
|
874
|
+
# predictedFundingFeeRate: 0.000327,
|
875
|
+
# fundingRateGranularity: 28800000,
|
876
|
+
# openInterest: "8033200",
|
877
|
+
# turnoverOf24h: 659795309.2524643,
|
878
|
+
# volumeOf24h: 9998.54,
|
879
|
+
# markPrice: 67193.51,
|
880
|
+
# indexPrice: 67184.81,
|
881
|
+
# lastTradePrice: 67191.8,
|
882
|
+
# nextFundingRateTime: 20022985,
|
883
|
+
# maxLeverage: 125,
|
884
|
+
# premiumsSymbol1M: ".XBTUSDTMPI",
|
885
|
+
# premiumsSymbol8H: ".XBTUSDTMPI8H",
|
886
|
+
# fundingBaseSymbol1M: ".XBTINT",
|
887
|
+
# fundingQuoteSymbol1M: ".USDTINT",
|
888
|
+
# lowPrice: 64041.6,
|
889
|
+
# highPrice: 67737.3,
|
890
|
+
# priceChgPct: 0.0447,
|
891
|
+
# priceChg: 2878.7
|
892
|
+
# }
|
893
|
+
#
|
758
894
|
marketId = self.safe_string(ticker, 'symbol')
|
759
895
|
market = self.safe_market(marketId, market, '-')
|
896
|
+
last = self.safe_string_2(ticker, 'price', 'lastTradePrice')
|
760
897
|
timestamp = self.safe_integer_product(ticker, 'ts', 0.000001)
|
761
898
|
return self.safe_ticker({
|
762
899
|
'symbol': market['symbol'],
|
763
900
|
'timestamp': timestamp,
|
764
901
|
'datetime': self.iso8601(timestamp),
|
765
|
-
'high':
|
766
|
-
'low':
|
902
|
+
'high': self.safe_string(ticker, 'highPrice'),
|
903
|
+
'low': self.safe_string(ticker, 'lowPrice'),
|
767
904
|
'bid': self.safe_string(ticker, 'bestBidPrice'),
|
768
905
|
'bidVolume': self.safe_string(ticker, 'bestBidSize'),
|
769
906
|
'ask': self.safe_string(ticker, 'bestAskPrice'),
|
@@ -773,11 +910,11 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
773
910
|
'close': last,
|
774
911
|
'last': last,
|
775
912
|
'previousClose': None,
|
776
|
-
'change':
|
777
|
-
'percentage':
|
913
|
+
'change': self.safe_string(ticker, 'priceChg'),
|
914
|
+
'percentage': self.safe_string(ticker, 'priceChgPct'),
|
778
915
|
'average': None,
|
779
|
-
'baseVolume':
|
780
|
-
'quoteVolume':
|
916
|
+
'baseVolume': self.safe_string(ticker, 'volumeOf24h'),
|
917
|
+
'quoteVolume': self.safe_string(ticker, 'turnoverOf24h'),
|
781
918
|
'info': ticker,
|
782
919
|
}, market)
|
783
920
|
|
ccxt/async_support/kuna.py
CHANGED
@@ -517,7 +517,7 @@ class kuna(Exchange, ImplicitAPI):
|
|
517
517
|
'networks': {},
|
518
518
|
}
|
519
519
|
|
520
|
-
async def fetch_markets(self, params={}):
|
520
|
+
async def fetch_markets(self, params={}) -> List[Market]:
|
521
521
|
"""
|
522
522
|
retrieves data on all markets for kuna
|
523
523
|
:see: https://docs.kuna.io/docs/get-all-traded-markets
|
ccxt/async_support/latoken.py
CHANGED
@@ -256,7 +256,7 @@ class latoken(Exchange, ImplicitAPI):
|
|
256
256
|
#
|
257
257
|
return self.safe_integer(response, 'serverTime')
|
258
258
|
|
259
|
-
async def fetch_markets(self, params={}):
|
259
|
+
async def fetch_markets(self, params={}) -> List[Market]:
|
260
260
|
"""
|
261
261
|
retrieves data on all markets for latoken
|
262
262
|
:see: https://api.latoken.com/doc/v2/#tag/Pair/operation/getActivePairs
|
ccxt/async_support/lbank.py
CHANGED
@@ -345,7 +345,7 @@ class lbank(Exchange, ImplicitAPI):
|
|
345
345
|
#
|
346
346
|
return self.safe_integer(response, 'data')
|
347
347
|
|
348
|
-
async def fetch_markets(self, params={}):
|
348
|
+
async def fetch_markets(self, params={}) -> List[Market]:
|
349
349
|
"""
|
350
350
|
retrieves data on all markets for lbank
|
351
351
|
:see: https://www.lbank.com/en-US/docs/index.html#trading-pairs
|
ccxt/async_support/luno.py
CHANGED
@@ -180,7 +180,7 @@ class luno(Exchange, ImplicitAPI):
|
|
180
180
|
'precisionMode': TICK_SIZE,
|
181
181
|
})
|
182
182
|
|
183
|
-
async def fetch_markets(self, params={}):
|
183
|
+
async def fetch_markets(self, params={}) -> List[Market]:
|
184
184
|
"""
|
185
185
|
retrieves data on all markets for luno
|
186
186
|
:see: https://www.luno.com/en/developers/api#tag/Market/operation/Markets
|
ccxt/async_support/lykke.py
CHANGED
@@ -263,7 +263,7 @@ class lykke(Exchange, ImplicitAPI):
|
|
263
263
|
}
|
264
264
|
return result
|
265
265
|
|
266
|
-
async def fetch_markets(self, params={}):
|
266
|
+
async def fetch_markets(self, params={}) -> List[Market]:
|
267
267
|
"""
|
268
268
|
retrieves data on all markets for lykke
|
269
269
|
:see: https://lykkecity.github.io/Trading-API/#get-asset-by-id
|
ccxt/async_support/mercado.py
CHANGED
@@ -161,7 +161,7 @@ class mercado(Exchange, ImplicitAPI):
|
|
161
161
|
'precisionMode': TICK_SIZE,
|
162
162
|
})
|
163
163
|
|
164
|
-
async def fetch_markets(self, params={}):
|
164
|
+
async def fetch_markets(self, params={}) -> List[Market]:
|
165
165
|
"""
|
166
166
|
retrieves data on all markets for mercado
|
167
167
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
ccxt/async_support/mexc.py
CHANGED
@@ -1132,7 +1132,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
1132
1132
|
}
|
1133
1133
|
return result
|
1134
1134
|
|
1135
|
-
async def fetch_markets(self, params={}):
|
1135
|
+
async def fetch_markets(self, params={}) -> List[Market]:
|
1136
1136
|
"""
|
1137
1137
|
retrieves data on all markets for mexc
|
1138
1138
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
ccxt/async_support/ndax.py
CHANGED
@@ -395,7 +395,7 @@ class ndax(Exchange, ImplicitAPI):
|
|
395
395
|
}
|
396
396
|
return result
|
397
397
|
|
398
|
-
async def fetch_markets(self, params={}):
|
398
|
+
async def fetch_markets(self, params={}) -> List[Market]:
|
399
399
|
"""
|
400
400
|
retrieves data on all markets for ndax
|
401
401
|
:see: https://apidoc.ndax.io/#getinstruments
|
ccxt/async_support/novadax.py
CHANGED
@@ -238,7 +238,7 @@ class novadax(Exchange, ImplicitAPI):
|
|
238
238
|
#
|
239
239
|
return self.safe_integer(response, 'data')
|
240
240
|
|
241
|
-
async def fetch_markets(self, params={}):
|
241
|
+
async def fetch_markets(self, params={}) -> List[Market]:
|
242
242
|
"""
|
243
243
|
retrieves data on all markets for novadax
|
244
244
|
:see: https://doc.novadax.com/en-US/#get-all-supported-trading-symbol
|
ccxt/async_support/oceanex.py
CHANGED
@@ -156,7 +156,7 @@ class oceanex(Exchange, ImplicitAPI):
|
|
156
156
|
},
|
157
157
|
})
|
158
158
|
|
159
|
-
async def fetch_markets(self, params={}):
|
159
|
+
async def fetch_markets(self, params={}) -> List[Market]:
|
160
160
|
"""
|
161
161
|
retrieves data on all markets for oceanex
|
162
162
|
:see: https://api.oceanex.pro/doc/v1/#markets-post
|
ccxt/async_support/okcoin.py
CHANGED
@@ -629,7 +629,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
629
629
|
#
|
630
630
|
return self.parse8601(self.safe_string(response, 'iso'))
|
631
631
|
|
632
|
-
async def fetch_markets(self, params={}):
|
632
|
+
async def fetch_markets(self, params={}) -> List[Market]:
|
633
633
|
"""
|
634
634
|
:see: https://www.okcoin.com/docs-v5/en/#rest-api-public-data-get-instruments
|
635
635
|
retrieves data on all markets for okcoin
|
ccxt/async_support/okx.py
CHANGED
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
|
|
7
7
|
from ccxt.abstract.okx import ImplicitAPI
|
8
8
|
import asyncio
|
9
9
|
import hashlib
|
10
|
-
from ccxt.base.types import Account, Balances, Currency, Greeks, Int, Leverage, Market, MarketInterface, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
10
|
+
from ccxt.base.types import Account, Balances, Currency, Greeks, Int, Leverage, Market, MarketInterface, Num, Option, OptionChain, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import ExchangeError
|
13
13
|
from ccxt.base.errors import PermissionDenied
|
@@ -117,6 +117,8 @@ class okx(Exchange, ImplicitAPI):
|
|
117
117
|
'fetchOpenInterestHistory': True,
|
118
118
|
'fetchOpenOrder': None,
|
119
119
|
'fetchOpenOrders': True,
|
120
|
+
'fetchOption': True,
|
121
|
+
'fetchOptionChain': True,
|
120
122
|
'fetchOrder': True,
|
121
123
|
'fetchOrderBook': True,
|
122
124
|
'fetchOrderBooks': False,
|
@@ -1328,7 +1330,7 @@ class okx(Exchange, ImplicitAPI):
|
|
1328
1330
|
})
|
1329
1331
|
return result
|
1330
1332
|
|
1331
|
-
async def fetch_markets(self, params={}):
|
1333
|
+
async def fetch_markets(self, params={}) -> List[Market]:
|
1332
1334
|
"""
|
1333
1335
|
retrieves data on all markets for okx
|
1334
1336
|
:see: https://www.okx.com/docs-v5/en/#rest-api-public-data-get-instruments
|
@@ -6910,6 +6912,139 @@ class okx(Exchange, ImplicitAPI):
|
|
6910
6912
|
order = self.safe_value(data, 0)
|
6911
6913
|
return self.parse_order(order, market)
|
6912
6914
|
|
6915
|
+
async def fetch_option(self, symbol: str, params={}) -> Option:
|
6916
|
+
"""
|
6917
|
+
fetches option data that is commonly found in an option chain
|
6918
|
+
:see: https://www.okx.com/docs-v5/en/#order-book-trading-market-data-get-ticker
|
6919
|
+
:param str symbol: unified market symbol
|
6920
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
6921
|
+
:returns dict: an `option chain structure <https://docs.ccxt.com/#/?id=option-chain-structure>`
|
6922
|
+
"""
|
6923
|
+
await self.load_markets()
|
6924
|
+
market = self.market(symbol)
|
6925
|
+
request = {
|
6926
|
+
'instId': market['id'],
|
6927
|
+
}
|
6928
|
+
response = await self.publicGetMarketTicker(self.extend(request, params))
|
6929
|
+
#
|
6930
|
+
# {
|
6931
|
+
# "code": "0",
|
6932
|
+
# "msg": "",
|
6933
|
+
# "data": [
|
6934
|
+
# {
|
6935
|
+
# "instType": "OPTION",
|
6936
|
+
# "instId": "BTC-USD-241227-60000-P",
|
6937
|
+
# "last": "",
|
6938
|
+
# "lastSz": "0",
|
6939
|
+
# "askPx": "",
|
6940
|
+
# "askSz": "0",
|
6941
|
+
# "bidPx": "",
|
6942
|
+
# "bidSz": "0",
|
6943
|
+
# "open24h": "",
|
6944
|
+
# "high24h": "",
|
6945
|
+
# "low24h": "",
|
6946
|
+
# "volCcy24h": "0",
|
6947
|
+
# "vol24h": "0",
|
6948
|
+
# "ts": "1711176035035",
|
6949
|
+
# "sodUtc0": "",
|
6950
|
+
# "sodUtc8": ""
|
6951
|
+
# }
|
6952
|
+
# ]
|
6953
|
+
# }
|
6954
|
+
#
|
6955
|
+
result = self.safe_list(response, 'data', [])
|
6956
|
+
chain = self.safe_dict(result, 0, {})
|
6957
|
+
return self.parse_option(chain, None, market)
|
6958
|
+
|
6959
|
+
async def fetch_option_chain(self, code: str, params={}) -> OptionChain:
|
6960
|
+
"""
|
6961
|
+
fetches data for an underlying asset that is commonly found in an option chain
|
6962
|
+
:see: https://www.okx.com/docs-v5/en/#order-book-trading-market-data-get-tickers
|
6963
|
+
:param str currency: base currency to fetch an option chain for
|
6964
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
6965
|
+
:param str [params.uly]: the underlying asset, can be obtained from fetchUnderlyingAssets()
|
6966
|
+
:returns dict: a list of `option chain structures <https://docs.ccxt.com/#/?id=option-chain-structure>`
|
6967
|
+
"""
|
6968
|
+
await self.load_markets()
|
6969
|
+
currency = self.currency(code)
|
6970
|
+
request = {
|
6971
|
+
'uly': currency['code'] + '-USD',
|
6972
|
+
'instType': 'OPTION',
|
6973
|
+
}
|
6974
|
+
response = await self.publicGetMarketTickers(self.extend(request, params))
|
6975
|
+
#
|
6976
|
+
# {
|
6977
|
+
# "code": "0",
|
6978
|
+
# "msg": "",
|
6979
|
+
# "data": [
|
6980
|
+
# {
|
6981
|
+
# "instType": "OPTION",
|
6982
|
+
# "instId": "BTC-USD-240323-52000-C",
|
6983
|
+
# "last": "",
|
6984
|
+
# "lastSz": "0",
|
6985
|
+
# "askPx": "",
|
6986
|
+
# "askSz": "0",
|
6987
|
+
# "bidPx": "",
|
6988
|
+
# "bidSz": "0",
|
6989
|
+
# "open24h": "",
|
6990
|
+
# "high24h": "",
|
6991
|
+
# "low24h": "",
|
6992
|
+
# "volCcy24h": "0",
|
6993
|
+
# "vol24h": "0",
|
6994
|
+
# "ts": "1711176207008",
|
6995
|
+
# "sodUtc0": "",
|
6996
|
+
# "sodUtc8": ""
|
6997
|
+
# },
|
6998
|
+
# ]
|
6999
|
+
# }
|
7000
|
+
#
|
7001
|
+
result = self.safe_list(response, 'data', [])
|
7002
|
+
return self.parse_option_chain(result, None, 'instId')
|
7003
|
+
|
7004
|
+
def parse_option(self, chain, currency: Currency = None, market: Market = None):
|
7005
|
+
#
|
7006
|
+
# {
|
7007
|
+
# "instType": "OPTION",
|
7008
|
+
# "instId": "BTC-USD-241227-60000-P",
|
7009
|
+
# "last": "",
|
7010
|
+
# "lastSz": "0",
|
7011
|
+
# "askPx": "",
|
7012
|
+
# "askSz": "0",
|
7013
|
+
# "bidPx": "",
|
7014
|
+
# "bidSz": "0",
|
7015
|
+
# "open24h": "",
|
7016
|
+
# "high24h": "",
|
7017
|
+
# "low24h": "",
|
7018
|
+
# "volCcy24h": "0",
|
7019
|
+
# "vol24h": "0",
|
7020
|
+
# "ts": "1711176035035",
|
7021
|
+
# "sodUtc0": "",
|
7022
|
+
# "sodUtc8": ""
|
7023
|
+
# }
|
7024
|
+
#
|
7025
|
+
marketId = self.safe_string(chain, 'instId')
|
7026
|
+
market = self.safe_market(marketId, market)
|
7027
|
+
timestamp = self.safe_integer(chain, 'ts')
|
7028
|
+
return {
|
7029
|
+
'info': chain,
|
7030
|
+
'currency': None,
|
7031
|
+
'symbol': market['symbol'],
|
7032
|
+
'timestamp': timestamp,
|
7033
|
+
'datetime': self.iso8601(timestamp),
|
7034
|
+
'impliedVolatility': None,
|
7035
|
+
'openInterest': None,
|
7036
|
+
'bidPrice': self.safe_number(chain, 'bidPx'),
|
7037
|
+
'askPrice': self.safe_number(chain, 'askPx'),
|
7038
|
+
'midPrice': None,
|
7039
|
+
'markPrice': None,
|
7040
|
+
'lastPrice': self.safe_number(chain, 'last'),
|
7041
|
+
'underlyingPrice': None,
|
7042
|
+
'change': None,
|
7043
|
+
'percentage': None,
|
7044
|
+
'baseVolume': self.safe_number(chain, 'volCcy24h'),
|
7045
|
+
'quoteVolume': None,
|
7046
|
+
}
|
7047
|
+
|
6913
7048
|
def handle_errors(self, httpCode, reason, url, method, headers, body, response, requestHeaders, requestBody):
|
6914
7049
|
if not response:
|
6915
7050
|
return None # fallback to default error handler
|
ccxt/async_support/onetrading.py
CHANGED
@@ -363,7 +363,7 @@ class onetrading(Exchange, ImplicitAPI):
|
|
363
363
|
}
|
364
364
|
return result
|
365
365
|
|
366
|
-
async def fetch_markets(self, params={}):
|
366
|
+
async def fetch_markets(self, params={}) -> List[Market]:
|
367
367
|
"""
|
368
368
|
retrieves data on all markets for onetrading
|
369
369
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
ccxt/async_support/p2b.py
CHANGED
@@ -236,7 +236,7 @@ class p2b(Exchange, ImplicitAPI):
|
|
236
236
|
},
|
237
237
|
})
|
238
238
|
|
239
|
-
async def fetch_markets(self, params={}):
|
239
|
+
async def fetch_markets(self, params={}) -> List[Market]:
|
240
240
|
"""
|
241
241
|
retrieves data on all markets for bigone
|
242
242
|
:see: https://github.com/P2B-team/p2b-api-docs/blob/master/api-doc.md#markets
|
ccxt/async_support/phemex.py
CHANGED
@@ -747,7 +747,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
747
747
|
'info': market,
|
748
748
|
})
|
749
749
|
|
750
|
-
async def fetch_markets(self, params={}):
|
750
|
+
async def fetch_markets(self, params={}) -> List[Market]:
|
751
751
|
"""
|
752
752
|
retrieves data on all markets for phemex
|
753
753
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
ccxt/async_support/poloniex.py
CHANGED
@@ -480,7 +480,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
480
480
|
self.options['currenciesByNumericId'] = self.index_by(self.currencies, 'numericId')
|
481
481
|
return markets
|
482
482
|
|
483
|
-
async def fetch_markets(self, params={}):
|
483
|
+
async def fetch_markets(self, params={}) -> List[Market]:
|
484
484
|
"""
|
485
485
|
retrieves data on all markets for poloniex
|
486
486
|
:see: https://docs.poloniex.com/#public-endpoints-reference-data-symbol-information
|
@@ -215,7 +215,7 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
215
215
|
},
|
216
216
|
})
|
217
217
|
|
218
|
-
async def fetch_markets(self, params={}):
|
218
|
+
async def fetch_markets(self, params={}) -> List[Market]:
|
219
219
|
"""
|
220
220
|
retrieves data on all markets for poloniexfutures
|
221
221
|
:see: https://futures-docs.poloniex.com/#symbol-2
|
ccxt/async_support/probit.py
CHANGED
@@ -256,7 +256,7 @@ class probit(Exchange, ImplicitAPI):
|
|
256
256
|
},
|
257
257
|
})
|
258
258
|
|
259
|
-
async def fetch_markets(self, params={}):
|
259
|
+
async def fetch_markets(self, params={}) -> List[Market]:
|
260
260
|
"""
|
261
261
|
:see: https://docs-en.probit.com/reference/market
|
262
262
|
retrieves data on all markets for probit
|
ccxt/async_support/timex.py
CHANGED
@@ -292,7 +292,7 @@ class timex(Exchange, ImplicitAPI):
|
|
292
292
|
#
|
293
293
|
return self.parse_to_int(response) * 1000
|
294
294
|
|
295
|
-
async def fetch_markets(self, params={}):
|
295
|
+
async def fetch_markets(self, params={}) -> List[Market]:
|
296
296
|
"""
|
297
297
|
retrieves data on all markets for timex
|
298
298
|
:see: https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Public/listMarkets
|
ccxt/async_support/tokocrypto.py
CHANGED
@@ -637,7 +637,7 @@ class tokocrypto(Exchange, ImplicitAPI):
|
|
637
637
|
#
|
638
638
|
return self.safe_integer(response, 'serverTime')
|
639
639
|
|
640
|
-
async def fetch_markets(self, params={}):
|
640
|
+
async def fetch_markets(self, params={}) -> List[Market]:
|
641
641
|
"""
|
642
642
|
:see: https://www.tokocrypto.com/apidocs/#get-all-supported-trading-symbol
|
643
643
|
retrieves data on all markets for tokocrypto
|
ccxt/async_support/tradeogre.py
CHANGED
@@ -6,6 +6,7 @@
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.tradeogre import ImplicitAPI
|
8
8
|
from ccxt.base.types import IndexType, Int, Market, Num, Order, OrderSide, OrderType, Str, Ticker
|
9
|
+
from typing import List
|
9
10
|
from ccxt.base.errors import ExchangeError
|
10
11
|
from ccxt.base.errors import BadRequest
|
11
12
|
from ccxt.base.errors import InsufficientFunds
|
@@ -162,7 +163,7 @@ class tradeogre(Exchange, ImplicitAPI):
|
|
162
163
|
},
|
163
164
|
})
|
164
165
|
|
165
|
-
async def fetch_markets(self, params={}):
|
166
|
+
async def fetch_markets(self, params={}) -> List[Market]:
|
166
167
|
"""
|
167
168
|
retrieves data on all markets for bigone
|
168
169
|
:see: https://github.com/P2B-team/p2b-api-docs/blob/master/api-doc.md#markets
|
ccxt/async_support/upbit.py
CHANGED
@@ -403,7 +403,7 @@ class upbit(Exchange, ImplicitAPI):
|
|
403
403
|
},
|
404
404
|
})
|
405
405
|
|
406
|
-
async def fetch_markets(self, params={}):
|
406
|
+
async def fetch_markets(self, params={}) -> List[Market]:
|
407
407
|
"""
|
408
408
|
:see: https://docs.upbit.com/reference/%EB%A7%88%EC%BC%93-%EC%BD%94%EB%93%9C-%EC%A1%B0%ED%9A%8C
|
409
409
|
retrieves data on all markets for upbit
|
@@ -495,7 +495,7 @@ class wavesexchange(Exchange, ImplicitAPI):
|
|
495
495
|
self.options['quotes'] = quotes
|
496
496
|
return quotes
|
497
497
|
|
498
|
-
async def fetch_markets(self, params={}):
|
498
|
+
async def fetch_markets(self, params={}) -> List[Market]:
|
499
499
|
"""
|
500
500
|
retrieves data on all markets for wavesexchange
|
501
501
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
ccxt/async_support/wazirx.py
CHANGED
@@ -196,7 +196,7 @@ class wazirx(Exchange, ImplicitAPI):
|
|
196
196
|
},
|
197
197
|
})
|
198
198
|
|
199
|
-
async def fetch_markets(self, params={}):
|
199
|
+
async def fetch_markets(self, params={}) -> List[Market]:
|
200
200
|
"""
|
201
201
|
:see: https://docs.wazirx.com/#exchange-info
|
202
202
|
retrieves data on all markets for wazirx
|
ccxt/async_support/whitebit.py
CHANGED
@@ -281,7 +281,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
281
281
|
},
|
282
282
|
})
|
283
283
|
|
284
|
-
async def fetch_markets(self, params={}):
|
284
|
+
async def fetch_markets(self, params={}) -> List[Market]:
|
285
285
|
"""
|
286
286
|
retrieves data on all markets for whitebit
|
287
287
|
:see: https://docs.whitebit.com/public/http-v4/#market-info
|
ccxt/async_support/woo.py
CHANGED
@@ -387,7 +387,7 @@ class woo(Exchange, ImplicitAPI):
|
|
387
387
|
#
|
388
388
|
return self.safe_integer(response, 'timestamp')
|
389
389
|
|
390
|
-
async def fetch_markets(self, params={}):
|
390
|
+
async def fetch_markets(self, params={}) -> List[Market]:
|
391
391
|
"""
|
392
392
|
retrieves data on all markets for woo
|
393
393
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
ccxt/async_support/yobit.py
CHANGED
@@ -347,7 +347,7 @@ class yobit(Exchange, ImplicitAPI):
|
|
347
347
|
#
|
348
348
|
return self.parse_balance(response)
|
349
349
|
|
350
|
-
async def fetch_markets(self, params={}):
|
350
|
+
async def fetch_markets(self, params={}) -> List[Market]:
|
351
351
|
"""
|
352
352
|
:see: https://yobit.net/en/api
|
353
353
|
retrieves data on all markets for yobit
|
ccxt/async_support/zaif.py
CHANGED
@@ -143,7 +143,7 @@ class zaif(Exchange, ImplicitAPI):
|
|
143
143
|
},
|
144
144
|
})
|
145
145
|
|
146
|
-
async def fetch_markets(self, params={}):
|
146
|
+
async def fetch_markets(self, params={}) -> List[Market]:
|
147
147
|
"""
|
148
148
|
:see: https://zaif-api-document.readthedocs.io/ja/latest/PublicAPI.html#id12
|
149
149
|
retrieves data on all markets for zaif
|