diff --git a/freqtrade/exchange/__init__.py b/freqtrade/exchange/__init__.py index c72a67991..fb5f8c7ba 100644 --- a/freqtrade/exchange/__init__.py +++ b/freqtrade/exchange/__init__.py @@ -175,8 +175,8 @@ def get_pair_detail_url(pair: str) -> str: return _API.get_pair_detail_url(pair) -def get_markets() -> List[str]: - return _API.get_markets() +def get_markets() -> List[dict]: + return _API.fetch_markets() def get_market_summaries() -> List[Dict]: @@ -189,15 +189,3 @@ def get_name() -> str: def get_fee() -> float: return _API.calculate_fee('ETH/BTC', '', '', 1, 1)['rate'] - - -def get_wallet_health() -> List[Dict]: - data = _API.request('Currencies/GetWalletHealth', api='v2') - if not data['success']: - raise OperationalException('{}'.format(data['message'])) - return [{ - 'Currency': entry['Health']['Currency'], - 'IsActive': entry['Health']['IsActive'], - 'LastChecked': entry['Health']['LastChecked'], - 'Notice': entry['Currency'].get('Notice'), - } for entry in data['result']] diff --git a/freqtrade/exchange/interface.py b/freqtrade/exchange/interface.py index 894c42f12..8417d4704 100644 --- a/freqtrade/exchange/interface.py +++ b/freqtrade/exchange/interface.py @@ -156,17 +156,3 @@ class Exchange(ABC): ... ] """ - - @abstractmethod - def get_wallet_health(self) -> List[Dict]: - """ - Returns a list of all wallet health information - :return: list, format: [ - { - 'Currency': str, - 'IsActive': bool, - 'LastChecked': str, - 'Notice': str - }, - ... - """ diff --git a/freqtrade/main.py b/freqtrade/main.py index 8a1397d94..700d8f5d9 100755 --- a/freqtrade/main.py +++ b/freqtrade/main.py @@ -33,21 +33,23 @@ def refresh_whitelist(whitelist: List[str]) -> List[str]: :return: the list of pairs the user wants to trade without the one unavailable or black_listed """ sanitized_whitelist = whitelist - health = exchange.get_wallet_health() + markets = exchange.get_markets() + + markets = [m for m in markets if m['quote'] == _CONF['stake_currency']] known_pairs = set() - for status in health: - pair = '{}_{}'.format(_CONF['stake_currency'], status['Currency']) + for market in markets: + pair = market['symbol'] # pair is not int the generated dynamic market, or in the blacklist ... ignore it if pair not in whitelist or pair in _CONF['exchange'].get('pair_blacklist', []): continue # else the pair is valid known_pairs.add(pair) # Market is not active - if not status['IsActive']: + if not market['active']: sanitized_whitelist.remove(pair) logger.info( - 'Ignoring %s from whitelist (reason: %s).', - pair, status.get('Notice') or 'wallet is not active' + 'Ignoring %s from whitelist. Market is not active.', + pair ) # We need to remove pairs that are unknown