Implement get_pair_base_curr and get_pair_quote_curr

This commit is contained in:
Matthias
2020-02-24 21:50:27 +01:00
parent 3e4f663418
commit 61037ab7b8
6 changed files with 70 additions and 25 deletions

View File

@@ -228,6 +228,18 @@ class Exchange:
markets = self.markets
return sorted(set([x['quote'] for _, x in markets.items()]))
def get_pair_quote_currency(self, pair: str) -> str:
"""
Return a pair's quote currency
"""
return self.markets[pair].get('quote')
def get_pair_base_currency(self, pair: str) -> str:
"""
Return a pair's quote currency
"""
return self.markets[pair].get('base')
def klines(self, pair_interval: Tuple[str, str], copy: bool = True) -> DataFrame:
if pair_interval in self._klines:
return self._klines[pair_interval].copy() if copy else self._klines[pair_interval]