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