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/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://viabtc.github.io/coinex_api_en_doc/spot/#docsspot001_market002_all_market_info
620
- :see: https://viabtc.github.io/coinex_api_en_doc/futures/#docsfutures001_http006_market_list
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
- promises = [
624
+ promisesUnresolved = [
625
625
  self.fetch_spot_markets(params),
626
626
  self.fetch_contract_markets(params),
627
627
  ]
628
- promises = 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.v1PublicGetMarketInfo(params)
634
+ response = self.v2PublicGetSpotMarket(params)
635
635
  #
636
636
  # {
637
637
  # "code": 0,
638
- # "data": {
639
- # "WAVESBTC": {
640
- # "name": "WAVESBTC",
641
- # "min_amount": "1",
642
- # "maker_fee_rate": "0.001",
643
- # "taker_fee_rate": "0.001",
644
- # "pricing_name": "BTC",
645
- # "pricing_decimal": 8,
646
- # "trading_name": "WAVES",
647
- # "trading_decimal": 8
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.safe_value(response, 'data', {})
655
+ markets = self.safe_list(response, 'data', [])
653
656
  result = []
654
- keys = list(markets.keys())
655
- for i in range(0, len(keys)):
656
- key = keys[i]
657
- market = markets[key]
658
- id = self.safe_string(market, 'name')
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, 'trading_decimal'))),
695
- 'price': self.parse_number(self.parse_precision(self.safe_string(market, 'pricing_decimal'))),
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.v1PerpetualPublicGetMarketList(params)
719
+ response = self.v2PublicGetFuturesMarket(params)
722
720
  #
723
721
  # {
724
722
  # "code": 0,
725
723
  # "data": [
726
724
  # {
727
- # "name": "BTCUSD",
728
- # "type": 2, # 1: USDT-M Contracts, 2: Coin-M Contracts
729
- # "leverages": ["3", "5", "8", "10", "15", "20", "30", "50", "100"],
730
- # "stock": "BTC",
731
- # "money": "USD",
732
- # "fee_prec": 5,
733
- # "stock_prec": 8,
734
- # "money_prec": 1,
735
- # "amount_prec": 0,
736
- # "amount_min": "10",
737
- # "multiplier": "1",
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.safe_value(response, 'data', [])
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.safe_value(entry, 'leverages', [])
751
- subType = self.safe_integer(entry, 'type')
752
- linear = (subType == 1)
753
- inverse = (subType == 2)
754
- id = self.safe_string(entry, 'name')
755
- baseId = self.safe_string(entry, 'stock')
756
- quoteId = self.safe_string(entry, 'money')
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 == 1) else baseId
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': self.safe_value(entry, 'available'),
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.safe_number(entry, 'multiplier'),
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, 'amount_prec'))),
791
- 'price': self.parse_number(self.parse_precision(self.safe_string(entry, 'money_prec'))),
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, 'amount_min'),
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
- # "vol": "293.19415130",
822
- # "low": "38200.00",
823
- # "open": "39514.99",
824
- # "high": "39530.00",
825
- # "last": "38649.57",
826
- # "buy": "38640.20",
827
- # "buy_amount": "0.22800000",
828
- # "sell": "38640.21",
829
- # "sell_amount": "0.02828439"
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
- # "vol": "7714.2175",
836
- # "low": "38200.00",
837
- # "open": "39569.23",
838
- # "high": "39569.23",
839
- # "last": "38681.37",
840
- # "buy": "38681.36",
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
- # "funding_time": 462,
843
- # "position_amount": "296.7552",
844
- # "funding_rate_last": "0.00009395",
845
- # "funding_rate_next": "0.00000649",
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
- timestamp = self.safe_integer(ticker, 'date')
858
- symbol = self.safe_symbol(None, market)
859
- ticker = self.safe_value(ticker, 'ticker', {})
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': timestamp,
864
- 'datetime': self.iso8601(timestamp),
853
+ 'timestamp': None,
854
+ 'datetime': None,
865
855
  'high': self.safe_string(ticker, 'high'),
866
856
  'low': self.safe_string(ticker, 'low'),
867
- 'bid': self.safe_string(ticker, 'buy'),
868
- 'bidVolume': self.safe_string(ticker, 'buy_amount'),
869
- 'ask': self.safe_string(ticker, 'sell'),
870
- 'askVolume': self.safe_string(ticker, 'sell_amount'),
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': last,
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.safe_string_2(ticker, 'vol', 'volume'),
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://viabtc.github.io/coinex_api_en_doc/spot/#docsspot001_market007_single_market_ticker
888
- :see: https://viabtc.github.io/coinex_api_en_doc/futures/#docsfutures001_http008_market_ticker
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.v1PerpetualPublicGetMarketTicker(self.extend(request, params))
890
+ response = self.v2PublicGetFuturesTicker(self.extend(request, params))
901
891
  else:
902
- response = self.v1PublicGetMarketTicker(self.extend(request, params))
892
+ response = self.v2PublicGetSpotTicker(self.extend(request, params))
903
893
  #
904
894
  # Spot
905
895
  #
906
896
  # {
907
897
  # "code": 0,
908
- # "data": {
909
- # "date": 1651306913414,
910
- # "ticker": {
911
- # "vol": "293.19415130",
912
- # "low": "38200.00",
913
- # "open": "39514.99",
914
- # "high": "39530.00",
915
- # "last": "38649.57",
916
- # "buy": "38640.20",
917
- # "buy_amount": "0.22800000",
918
- # "sell": "38640.21",
919
- # "sell_amount": "0.02828439"
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
- # "date": 1651306641500,
931
- # "ticker": {
932
- # "vol": "7714.2175",
933
- # "low": "38200.00",
934
- # "open": "39569.23",
935
- # "high": "39569.23",
936
- # "last": "38681.37",
937
- # "buy": "38681.36",
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
- # "funding_time": 462,
940
- # "position_amount": "296.7552",
941
- # "funding_rate_last": "0.00009395",
942
- # "funding_rate_next": "0.00000649",
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
- return self.parse_ticker(response['data'], market)
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://viabtc.github.io/coinex_api_en_doc/spot/#docsspot001_market008_all_market_ticker
963
- :see: https://viabtc.github.io/coinex_api_en_doc/futures/#docsfutures001_http009_market_ticker_all
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.v1PerpetualPublicGetMarketTickerAll(query)
962
+ response = self.v2PublicGetFuturesTicker(query)
978
963
  else:
979
- response = self.v1PublicGetMarketTickerAll()
964
+ response = self.v2PublicGetSpotTicker(query)
980
965
  #
981
966
  # Spot
982
967
  #
983
968
  # {
984
969
  # "code": 0,
985
- # "data": {
986
- # "date": 1651519857284,
987
- # "ticker": {
988
- # "PSPUSDT": {
989
- # "vol": "127131.55227034",
990
- # "low": "0.0669",
991
- # "open": "0.0688",
992
- # "high": "0.0747",
993
- # "last": "0.0685",
994
- # "buy": "0.0676",
995
- # "buy_amount": "702.70117866",
996
- # "sell": "0.0690",
997
- # "sell_amount": "686.76861562"
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": "Ok"
984
+ # ],
985
+ # "message": "OK"
1002
986
  # }
1003
987
  #
1004
988
  # Swap
1005
989
  #
1006
990
  # {
1007
991
  # "code": 0,
1008
- # "data": {
1009
- # "date": 1651520268644,
1010
- # "ticker": {
1011
- # "KAVAUSDT": {
1012
- # "vol": "834924",
1013
- # "low": "3.9418",
1014
- # "open": "4.1834",
1015
- # "high": "4.4328",
1016
- # "last": "4.0516",
1017
- # "buy": "4.0443",
1018
- # "period": 86400,
1019
- # "funding_time": 262,
1020
- # "position_amount": "16111",
1021
- # "funding_rate_last": "-0.00069514",
1022
- # "funding_rate_next": "-0.00061009",
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": "Ok"
1008
+ # ],
1009
+ # "message": "OK"
1036
1010
  # }
1037
1011
  #
1038
- data = self.safe_value(response, 'data')
1039
- timestamp = self.safe_integer(data, 'date')
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.currency(code)
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.currency(code)
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.currency(code)
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.currency(code)
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.currency(code)
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: