ccxt 4.2.100__py2.py3-none-any.whl → 4.3.2__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/async_support/__init__.py +1 -1
- ccxt/async_support/base/exchange.py +5 -2
- ccxt/async_support/binance.py +55 -1
- ccxt/async_support/bingx.py +3 -2
- ccxt/async_support/bitget.py +65 -5
- ccxt/async_support/bybit.py +1 -1
- ccxt/async_support/coinbase.py +2 -1
- ccxt/async_support/coinbasepro.py +1 -1
- ccxt/async_support/coinex.py +163 -203
- ccxt/async_support/cryptocom.py +5 -5
- ccxt/async_support/hyperliquid.py +69 -1
- ccxt/async_support/kraken.py +6 -3
- ccxt/async_support/kucoin.py +13 -11
- ccxt/async_support/okx.py +74 -5
- ccxt/async_support/woo.py +38 -0
- ccxt/base/exchange.py +5 -2
- ccxt/base/types.py +4 -0
- ccxt/binance.py +55 -1
- ccxt/bingx.py +3 -2
- ccxt/bitget.py +65 -5
- ccxt/bybit.py +1 -1
- ccxt/coinbase.py +2 -1
- ccxt/coinbasepro.py +1 -1
- ccxt/coinex.py +163 -203
- ccxt/cryptocom.py +5 -5
- ccxt/hyperliquid.py +69 -1
- ccxt/kraken.py +6 -3
- ccxt/kucoin.py +13 -11
- ccxt/okx.py +74 -5
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/kraken.py +2 -2
- ccxt/woo.py +38 -0
- {ccxt-4.2.100.dist-info → ccxt-4.3.2.dist-info}/METADATA +7 -6
- {ccxt-4.2.100.dist-info → ccxt-4.3.2.dist-info}/RECORD +37 -37
- {ccxt-4.2.100.dist-info → ccxt-4.3.2.dist-info}/WHEEL +0 -0
- {ccxt-4.2.100.dist-info → ccxt-4.3.2.dist-info}/top_level.txt +0 -0
ccxt/async_support/coinex.py
CHANGED
@@ -617,54 +617,52 @@ class coinex(Exchange, ImplicitAPI):
|
|
617
617
|
async def fetch_markets(self, params={}) -> List[Market]:
|
618
618
|
"""
|
619
619
|
retrieves data on all markets for coinex
|
620
|
-
:see: https://
|
621
|
-
:see: https://
|
620
|
+
:see: https://docs.coinex.com/api/v2/spot/market/http/list-market
|
621
|
+
:see: https://docs.coinex.com/api/v2/futures/market/http/list-market
|
622
622
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
623
623
|
:returns dict[]: an array of objects representing market data
|
624
624
|
"""
|
625
|
-
|
625
|
+
promisesUnresolved = [
|
626
626
|
self.fetch_spot_markets(params),
|
627
627
|
self.fetch_contract_markets(params),
|
628
628
|
]
|
629
|
-
promises = await asyncio.gather(*
|
629
|
+
promises = await asyncio.gather(*promisesUnresolved)
|
630
630
|
spotMarkets = promises[0]
|
631
631
|
swapMarkets = promises[1]
|
632
632
|
return self.array_concat(spotMarkets, swapMarkets)
|
633
633
|
|
634
634
|
async def fetch_spot_markets(self, params):
|
635
|
-
response = await self.
|
635
|
+
response = await self.v2PublicGetSpotMarket(params)
|
636
636
|
#
|
637
637
|
# {
|
638
638
|
# "code": 0,
|
639
|
-
# "data":
|
640
|
-
#
|
641
|
-
# "
|
642
|
-
# "
|
643
|
-
# "
|
644
|
-
# "
|
645
|
-
# "
|
646
|
-
# "
|
647
|
-
# "
|
648
|
-
# "
|
649
|
-
#
|
650
|
-
#
|
639
|
+
# "data": [
|
640
|
+
# {
|
641
|
+
# "base_ccy": "SORA",
|
642
|
+
# "base_ccy_precision": 8,
|
643
|
+
# "is_amm_available": True,
|
644
|
+
# "is_margin_available": False,
|
645
|
+
# "maker_fee_rate": "0.003",
|
646
|
+
# "market": "SORAUSDT",
|
647
|
+
# "min_amount": "500",
|
648
|
+
# "quote_ccy": "USDT",
|
649
|
+
# "quote_ccy_precision": 6,
|
650
|
+
# "taker_fee_rate": "0.003"
|
651
|
+
# },
|
652
|
+
# ],
|
653
|
+
# "message": "OK"
|
651
654
|
# }
|
652
655
|
#
|
653
|
-
markets = self.
|
656
|
+
markets = self.safe_list(response, 'data', [])
|
654
657
|
result = []
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
tradingName = self.safe_string(market, 'trading_name')
|
661
|
-
baseId = tradingName
|
662
|
-
quoteId = self.safe_string(market, 'pricing_name')
|
658
|
+
for i in range(0, len(markets)):
|
659
|
+
market = markets[i]
|
660
|
+
id = self.safe_string(market, 'market')
|
661
|
+
baseId = self.safe_string(market, 'base_ccy')
|
662
|
+
quoteId = self.safe_string(market, 'quote_ccy')
|
663
663
|
base = self.safe_currency_code(baseId)
|
664
664
|
quote = self.safe_currency_code(quoteId)
|
665
665
|
symbol = base + '/' + quote
|
666
|
-
if tradingName == id:
|
667
|
-
symbol = id
|
668
666
|
result.append({
|
669
667
|
'id': id,
|
670
668
|
'symbol': symbol,
|
@@ -692,8 +690,8 @@ class coinex(Exchange, ImplicitAPI):
|
|
692
690
|
'strike': None,
|
693
691
|
'optionType': None,
|
694
692
|
'precision': {
|
695
|
-
'amount': self.parse_number(self.parse_precision(self.safe_string(market, '
|
696
|
-
'price': self.parse_number(self.parse_precision(self.safe_string(market, '
|
693
|
+
'amount': self.parse_number(self.parse_precision(self.safe_string(market, 'base_ccy_precision'))),
|
694
|
+
'price': self.parse_number(self.parse_precision(self.safe_string(market, 'quote_ccy_precision'))),
|
697
695
|
},
|
698
696
|
'limits': {
|
699
697
|
'leverage': {
|
@@ -719,45 +717,43 @@ class coinex(Exchange, ImplicitAPI):
|
|
719
717
|
return result
|
720
718
|
|
721
719
|
async def fetch_contract_markets(self, params):
|
722
|
-
response = await self.
|
720
|
+
response = await self.v2PublicGetFuturesMarket(params)
|
723
721
|
#
|
724
722
|
# {
|
725
723
|
# "code": 0,
|
726
724
|
# "data": [
|
727
725
|
# {
|
728
|
-
# "
|
729
|
-
# "
|
730
|
-
# "
|
731
|
-
# "
|
732
|
-
# "
|
733
|
-
# "
|
734
|
-
# "
|
735
|
-
# "
|
736
|
-
# "
|
737
|
-
# "
|
738
|
-
# "
|
739
|
-
# "tick_size": "0.1", # Min. Price Increment
|
740
|
-
# "available": True
|
726
|
+
# "base_ccy": "BTC",
|
727
|
+
# "base_ccy_precision": 8,
|
728
|
+
# "contract_type": "inverse",
|
729
|
+
# "leverage": ["1","2","3","5","8","10","15","20","30","50","100"],
|
730
|
+
# "maker_fee_rate": "0",
|
731
|
+
# "market": "BTCUSD",
|
732
|
+
# "min_amount": "10",
|
733
|
+
# "open_interest_volume": "2566879",
|
734
|
+
# "quote_ccy": "USD",
|
735
|
+
# "quote_ccy_precision": 2,
|
736
|
+
# "taker_fee_rate": "0"
|
741
737
|
# },
|
742
738
|
# ],
|
743
739
|
# "message": "OK"
|
744
740
|
# }
|
745
741
|
#
|
746
|
-
markets = self.
|
742
|
+
markets = self.safe_list(response, 'data', [])
|
747
743
|
result = []
|
748
744
|
for i in range(0, len(markets)):
|
749
745
|
entry = markets[i]
|
750
746
|
fees = self.fees
|
751
|
-
leverages = self.
|
752
|
-
subType = self.
|
753
|
-
linear = (subType ==
|
754
|
-
inverse = (subType ==
|
755
|
-
id = self.safe_string(entry, '
|
756
|
-
baseId = self.safe_string(entry, '
|
757
|
-
quoteId = self.safe_string(entry, '
|
747
|
+
leverages = self.safe_list(entry, 'leverage', [])
|
748
|
+
subType = self.safe_string(entry, 'contract_type')
|
749
|
+
linear = (subType == 'linear')
|
750
|
+
inverse = (subType == 'inverse')
|
751
|
+
id = self.safe_string(entry, 'market')
|
752
|
+
baseId = self.safe_string(entry, 'base_ccy')
|
753
|
+
quoteId = self.safe_string(entry, 'quote_ccy')
|
758
754
|
base = self.safe_currency_code(baseId)
|
759
755
|
quote = self.safe_currency_code(quoteId)
|
760
|
-
settleId = 'USDT' if (subType ==
|
756
|
+
settleId = 'USDT' if (subType == 'linear') else baseId
|
761
757
|
settle = self.safe_currency_code(settleId)
|
762
758
|
symbol = base + '/' + quote + ':' + settle
|
763
759
|
leveragesLength = len(leverages)
|
@@ -776,20 +772,20 @@ class coinex(Exchange, ImplicitAPI):
|
|
776
772
|
'swap': True,
|
777
773
|
'future': False,
|
778
774
|
'option': False,
|
779
|
-
'active':
|
775
|
+
'active': None,
|
780
776
|
'contract': True,
|
781
777
|
'linear': linear,
|
782
778
|
'inverse': inverse,
|
783
779
|
'taker': fees['trading']['taker'],
|
784
780
|
'maker': fees['trading']['maker'],
|
785
|
-
'contractSize': self.
|
781
|
+
'contractSize': self.parse_number('1'),
|
786
782
|
'expiry': None,
|
787
783
|
'expiryDatetime': None,
|
788
784
|
'strike': None,
|
789
785
|
'optionType': None,
|
790
786
|
'precision': {
|
791
|
-
'amount': self.parse_number(self.parse_precision(self.safe_string(entry, '
|
792
|
-
'price': self.parse_number(self.parse_precision(self.safe_string(entry, '
|
787
|
+
'amount': self.parse_number(self.parse_precision(self.safe_string(entry, 'base_ccy_precision'))),
|
788
|
+
'price': self.parse_number(self.parse_precision(self.safe_string(entry, 'quote_ccy_precision'))),
|
793
789
|
},
|
794
790
|
'limits': {
|
795
791
|
'leverage': {
|
@@ -797,7 +793,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
797
793
|
'max': self.safe_number(leverages, leveragesLength - 1),
|
798
794
|
},
|
799
795
|
'amount': {
|
800
|
-
'min': self.safe_number(entry, '
|
796
|
+
'min': self.safe_number(entry, 'min_amount'),
|
801
797
|
'max': None,
|
802
798
|
},
|
803
799
|
'price': {
|
@@ -819,65 +815,59 @@ class coinex(Exchange, ImplicitAPI):
|
|
819
815
|
# Spot fetchTicker, fetchTickers
|
820
816
|
#
|
821
817
|
# {
|
822
|
-
# "
|
823
|
-
# "
|
824
|
-
# "
|
825
|
-
# "
|
826
|
-
# "
|
827
|
-
# "
|
828
|
-
# "
|
829
|
-
# "
|
830
|
-
# "
|
818
|
+
# "close": "62393.47",
|
819
|
+
# "high": "64106.41",
|
820
|
+
# "last": "62393.47",
|
821
|
+
# "low": "59650.01",
|
822
|
+
# "market": "BTCUSDT",
|
823
|
+
# "open": "61616.15",
|
824
|
+
# "period": 86400,
|
825
|
+
# "value": "28711273.4065667262",
|
826
|
+
# "volume": "461.76557205",
|
827
|
+
# "volume_buy": "11.41506354",
|
828
|
+
# "volume_sell": "7.3240169"
|
831
829
|
# }
|
832
830
|
#
|
833
831
|
# Swap fetchTicker, fetchTickers
|
834
832
|
#
|
835
833
|
# {
|
836
|
-
# "
|
837
|
-
# "
|
838
|
-
# "
|
839
|
-
# "
|
840
|
-
# "
|
841
|
-
# "
|
834
|
+
# "close": "62480.08",
|
835
|
+
# "high": "64100",
|
836
|
+
# "index_price": "62443.05",
|
837
|
+
# "last": "62480.08",
|
838
|
+
# "low": "59600",
|
839
|
+
# "mark_price": "62443.05",
|
840
|
+
# "market": "BTCUSDT",
|
841
|
+
# "open": "61679.98",
|
842
842
|
# "period": 86400,
|
843
|
-
# "
|
844
|
-
# "
|
845
|
-
# "
|
846
|
-
# "
|
847
|
-
# "funding_rate_predict": "-0.00007176",
|
848
|
-
# "insurance": "16464465.09431942163278132918",
|
849
|
-
# "sign_price": "38681.93",
|
850
|
-
# "index_price": "38681.69500000",
|
851
|
-
# "sell_total": "16.6039",
|
852
|
-
# "buy_total": "19.8481",
|
853
|
-
# "buy_amount": "4.6315",
|
854
|
-
# "sell": "38681.37",
|
855
|
-
# "sell_amount": "11.4044"
|
843
|
+
# "value": "180226025.69791713065326633165",
|
844
|
+
# "volume": "2900.2218",
|
845
|
+
# "volume_buy": "7.3847",
|
846
|
+
# "volume_sell": "6.1249"
|
856
847
|
# }
|
857
848
|
#
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
last = self.safe_string(ticker, 'last')
|
849
|
+
marketType = 'swap' if ('mark_price' in ticker) else 'spot'
|
850
|
+
marketId = self.safe_string(ticker, 'market')
|
851
|
+
symbol = self.safe_symbol(marketId, market, None, marketType)
|
862
852
|
return self.safe_ticker({
|
863
853
|
'symbol': symbol,
|
864
|
-
'timestamp':
|
865
|
-
'datetime':
|
854
|
+
'timestamp': None,
|
855
|
+
'datetime': None,
|
866
856
|
'high': self.safe_string(ticker, 'high'),
|
867
857
|
'low': self.safe_string(ticker, 'low'),
|
868
|
-
'bid':
|
869
|
-
'bidVolume': self.safe_string(ticker, '
|
870
|
-
'ask':
|
871
|
-
'askVolume': self.safe_string(ticker, '
|
858
|
+
'bid': None,
|
859
|
+
'bidVolume': self.safe_string(ticker, 'volume_buy'),
|
860
|
+
'ask': None,
|
861
|
+
'askVolume': self.safe_string(ticker, 'volume_sell'),
|
872
862
|
'vwap': None,
|
873
863
|
'open': self.safe_string(ticker, 'open'),
|
874
|
-
'close':
|
875
|
-
'last': last,
|
864
|
+
'close': self.safe_string(ticker, 'close'),
|
865
|
+
'last': self.safe_string(ticker, 'last'),
|
876
866
|
'previousClose': None,
|
877
867
|
'change': None,
|
878
868
|
'percentage': None,
|
879
869
|
'average': None,
|
880
|
-
'baseVolume': self.
|
870
|
+
'baseVolume': self.safe_string(ticker, 'volume'),
|
881
871
|
'quoteVolume': None,
|
882
872
|
'info': ticker,
|
883
873
|
}, market)
|
@@ -885,8 +875,8 @@ class coinex(Exchange, ImplicitAPI):
|
|
885
875
|
async def fetch_ticker(self, symbol: str, params={}) -> Ticker:
|
886
876
|
"""
|
887
877
|
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
888
|
-
:see: https://
|
889
|
-
:see: https://
|
878
|
+
:see: https://docs.coinex.com/api/v2/spot/market/http/list-market-ticker
|
879
|
+
:see: https://docs.coinex.com/api/v2/futures/market/http/list-market-ticker
|
890
880
|
:param str symbol: unified symbol of the market to fetch the ticker for
|
891
881
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
892
882
|
:returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
|
@@ -898,28 +888,29 @@ class coinex(Exchange, ImplicitAPI):
|
|
898
888
|
}
|
899
889
|
response = None
|
900
890
|
if market['swap']:
|
901
|
-
response = await self.
|
891
|
+
response = await self.v2PublicGetFuturesTicker(self.extend(request, params))
|
902
892
|
else:
|
903
|
-
response = await self.
|
893
|
+
response = await self.v2PublicGetSpotTicker(self.extend(request, params))
|
904
894
|
#
|
905
895
|
# Spot
|
906
896
|
#
|
907
897
|
# {
|
908
898
|
# "code": 0,
|
909
|
-
# "data":
|
910
|
-
#
|
911
|
-
#
|
912
|
-
# "
|
913
|
-
# "
|
914
|
-
# "
|
915
|
-
# "
|
916
|
-
# "
|
917
|
-
# "
|
918
|
-
# "
|
919
|
-
# "
|
920
|
-
# "
|
899
|
+
# "data": [
|
900
|
+
# {
|
901
|
+
# "close": "62393.47",
|
902
|
+
# "high": "64106.41",
|
903
|
+
# "last": "62393.47",
|
904
|
+
# "low": "59650.01",
|
905
|
+
# "market": "BTCUSDT",
|
906
|
+
# "open": "61616.15",
|
907
|
+
# "period": 86400,
|
908
|
+
# "value": "28711273.4065667262",
|
909
|
+
# "volume": "461.76557205",
|
910
|
+
# "volume_buy": "11.41506354",
|
911
|
+
# "volume_sell": "7.3240169"
|
921
912
|
# }
|
922
|
-
#
|
913
|
+
# ],
|
923
914
|
# "message": "OK"
|
924
915
|
# }
|
925
916
|
#
|
@@ -927,41 +918,35 @@ class coinex(Exchange, ImplicitAPI):
|
|
927
918
|
#
|
928
919
|
# {
|
929
920
|
# "code": 0,
|
930
|
-
# "data":
|
931
|
-
#
|
932
|
-
#
|
933
|
-
# "
|
934
|
-
# "
|
935
|
-
# "
|
936
|
-
# "
|
937
|
-
# "
|
938
|
-
# "
|
921
|
+
# "data": [
|
922
|
+
# {
|
923
|
+
# "close": "62480.08",
|
924
|
+
# "high": "64100",
|
925
|
+
# "index_price": "62443.05",
|
926
|
+
# "last": "62480.08",
|
927
|
+
# "low": "59600",
|
928
|
+
# "mark_price": "62443.05",
|
929
|
+
# "market": "BTCUSDT",
|
930
|
+
# "open": "61679.98",
|
939
931
|
# "period": 86400,
|
940
|
-
# "
|
941
|
-
# "
|
942
|
-
# "
|
943
|
-
# "
|
944
|
-
# "funding_rate_predict": "-0.00007176",
|
945
|
-
# "insurance": "16464465.09431942163278132918",
|
946
|
-
# "sign_price": "38681.93",
|
947
|
-
# "index_price": "38681.69500000",
|
948
|
-
# "sell_total": "16.6039",
|
949
|
-
# "buy_total": "19.8481",
|
950
|
-
# "buy_amount": "4.6315",
|
951
|
-
# "sell": "38681.37",
|
952
|
-
# "sell_amount": "11.4044"
|
932
|
+
# "value": "180226025.69791713065326633165",
|
933
|
+
# "volume": "2900.2218",
|
934
|
+
# "volume_buy": "7.3847",
|
935
|
+
# "volume_sell": "6.1249"
|
953
936
|
# }
|
954
|
-
#
|
937
|
+
# ],
|
955
938
|
# "message": "OK"
|
956
939
|
# }
|
957
940
|
#
|
958
|
-
|
941
|
+
data = self.safe_list(response, 'data', [])
|
942
|
+
result = self.safe_dict(data, 0, {})
|
943
|
+
return self.parse_ticker(result, market)
|
959
944
|
|
960
945
|
async def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
|
961
946
|
"""
|
962
947
|
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
963
|
-
:see: https://
|
964
|
-
:see: https://
|
948
|
+
:see: https://docs.coinex.com/api/v2/spot/market/http/list-market-ticker
|
949
|
+
:see: https://docs.coinex.com/api/v2/futures/market/http/list-market-ticker
|
965
950
|
:param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
966
951
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
967
952
|
:returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
|
@@ -975,83 +960,58 @@ class coinex(Exchange, ImplicitAPI):
|
|
975
960
|
marketType, query = self.handle_market_type_and_params('fetchTickers', market, params)
|
976
961
|
response = None
|
977
962
|
if marketType == 'swap':
|
978
|
-
response = await self.
|
963
|
+
response = await self.v2PublicGetFuturesTicker(query)
|
979
964
|
else:
|
980
|
-
response = await self.
|
965
|
+
response = await self.v2PublicGetSpotTicker(query)
|
981
966
|
#
|
982
967
|
# Spot
|
983
968
|
#
|
984
969
|
# {
|
985
970
|
# "code": 0,
|
986
|
-
# "data":
|
987
|
-
#
|
988
|
-
#
|
989
|
-
# "
|
990
|
-
#
|
991
|
-
#
|
992
|
-
#
|
993
|
-
#
|
994
|
-
#
|
995
|
-
#
|
996
|
-
#
|
997
|
-
#
|
998
|
-
#
|
999
|
-
# },
|
971
|
+
# "data": [
|
972
|
+
# {
|
973
|
+
# "close": "62393.47",
|
974
|
+
# "high": "64106.41",
|
975
|
+
# "last": "62393.47",
|
976
|
+
# "low": "59650.01",
|
977
|
+
# "market": "BTCUSDT",
|
978
|
+
# "open": "61616.15",
|
979
|
+
# "period": 86400,
|
980
|
+
# "value": "28711273.4065667262",
|
981
|
+
# "volume": "461.76557205",
|
982
|
+
# "volume_buy": "11.41506354",
|
983
|
+
# "volume_sell": "7.3240169"
|
1000
984
|
# }
|
1001
|
-
#
|
1002
|
-
# "message": "
|
985
|
+
# ],
|
986
|
+
# "message": "OK"
|
1003
987
|
# }
|
1004
988
|
#
|
1005
989
|
# Swap
|
1006
990
|
#
|
1007
991
|
# {
|
1008
992
|
# "code": 0,
|
1009
|
-
# "data":
|
1010
|
-
#
|
1011
|
-
#
|
1012
|
-
# "
|
1013
|
-
#
|
1014
|
-
#
|
1015
|
-
#
|
1016
|
-
#
|
1017
|
-
#
|
1018
|
-
#
|
1019
|
-
#
|
1020
|
-
#
|
1021
|
-
#
|
1022
|
-
#
|
1023
|
-
#
|
1024
|
-
# "funding_rate_predict": "-0.00055812",
|
1025
|
-
# "insurance": "16532425.53026084124483989548",
|
1026
|
-
# "sign_price": "4.0516",
|
1027
|
-
# "index_price": "4.0530",
|
1028
|
-
# "sell_total": "59446",
|
1029
|
-
# "buy_total": "62423",
|
1030
|
-
# "buy_amount": "959",
|
1031
|
-
# "sell": "4.0466",
|
1032
|
-
# "sell_amount": "141"
|
1033
|
-
# },
|
993
|
+
# "data": [
|
994
|
+
# {
|
995
|
+
# "close": "62480.08",
|
996
|
+
# "high": "64100",
|
997
|
+
# "index_price": "62443.05",
|
998
|
+
# "last": "62480.08",
|
999
|
+
# "low": "59600",
|
1000
|
+
# "mark_price": "62443.05",
|
1001
|
+
# "market": "BTCUSDT",
|
1002
|
+
# "open": "61679.98",
|
1003
|
+
# "period": 86400,
|
1004
|
+
# "value": "180226025.69791713065326633165",
|
1005
|
+
# "volume": "2900.2218",
|
1006
|
+
# "volume_buy": "7.3847",
|
1007
|
+
# "volume_sell": "6.1249"
|
1034
1008
|
# }
|
1035
|
-
#
|
1036
|
-
# "message": "
|
1009
|
+
# ],
|
1010
|
+
# "message": "OK"
|
1037
1011
|
# }
|
1038
1012
|
#
|
1039
|
-
data = self.
|
1040
|
-
|
1041
|
-
tickers = self.safe_value(data, 'ticker', {})
|
1042
|
-
marketIds = list(tickers.keys())
|
1043
|
-
result = {}
|
1044
|
-
for i in range(0, len(marketIds)):
|
1045
|
-
marketId = marketIds[i]
|
1046
|
-
marketInner = self.safe_market(marketId, None, None, marketType)
|
1047
|
-
symbol = marketInner['symbol']
|
1048
|
-
ticker = self.parse_ticker({
|
1049
|
-
'date': timestamp,
|
1050
|
-
'ticker': tickers[marketId],
|
1051
|
-
}, marketInner)
|
1052
|
-
ticker['symbol'] = symbol
|
1053
|
-
result[symbol] = ticker
|
1054
|
-
return self.filter_by_array_tickers(result, 'symbol', symbols)
|
1013
|
+
data = self.safe_list(response, 'data', [])
|
1014
|
+
return self.parse_tickers(data, symbols)
|
1055
1015
|
|
1056
1016
|
async def fetch_time(self, params={}):
|
1057
1017
|
"""
|
ccxt/async_support/cryptocom.py
CHANGED
@@ -1500,7 +1500,7 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
1500
1500
|
"""
|
1501
1501
|
tag, params = self.handle_withdraw_tag_and_params(tag, params)
|
1502
1502
|
await self.load_markets()
|
1503
|
-
currency = self.
|
1503
|
+
currency = self.safe_currency(code) # for instance, USDC is not inferred from markets but it's still available
|
1504
1504
|
request = {
|
1505
1505
|
'currency': currency['id'],
|
1506
1506
|
'amount': amount,
|
@@ -1542,7 +1542,7 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
1542
1542
|
:returns dict: a dictionary of `address structures <https://docs.ccxt.com/#/?id=address-structure>` indexed by the network
|
1543
1543
|
"""
|
1544
1544
|
await self.load_markets()
|
1545
|
-
currency = self.
|
1545
|
+
currency = self.safe_currency(code)
|
1546
1546
|
request = {
|
1547
1547
|
'currency': currency['id'],
|
1548
1548
|
}
|
@@ -1633,7 +1633,7 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
1633
1633
|
currency = None
|
1634
1634
|
request = {}
|
1635
1635
|
if code is not None:
|
1636
|
-
currency = self.
|
1636
|
+
currency = self.safe_currency(code)
|
1637
1637
|
request['currency'] = currency['id']
|
1638
1638
|
if since is not None:
|
1639
1639
|
# 90 days date range
|
@@ -1686,7 +1686,7 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
1686
1686
|
currency = None
|
1687
1687
|
request = {}
|
1688
1688
|
if code is not None:
|
1689
|
-
currency = self.
|
1689
|
+
currency = self.safe_currency(code)
|
1690
1690
|
request['currency'] = currency['id']
|
1691
1691
|
if since is not None:
|
1692
1692
|
# 90 days date range
|
@@ -2179,7 +2179,7 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
2179
2179
|
request = {}
|
2180
2180
|
currency = None
|
2181
2181
|
if code is not None:
|
2182
|
-
currency = self.
|
2182
|
+
currency = self.safe_currency(code)
|
2183
2183
|
if since is not None:
|
2184
2184
|
request['start_time'] = since
|
2185
2185
|
if limit is not None:
|