| 6680 | return self.safe_string(self.commonCurrencies, code, code) |
| 6681 | |
| 6682 | def currency(self, code: str): |
| 6683 | keys = list(self.currencies.keys()) |
| 6684 | numCurrencies = len(keys) |
| 6685 | if numCurrencies == 0: |
| 6686 | raise ExchangeError(self.id + ' currencies not loaded') |
| 6687 | if isinstance(code, str): |
| 6688 | if code in self.currencies: |
| 6689 | return self.currencies[code] |
| 6690 | elif code in self.currencies_by_id: |
| 6691 | return self.currencies_by_id[code] |
| 6692 | raise ExchangeError(self.id + ' does not have currency code ' + code) |
| 6693 | |
| 6694 | def market(self, symbol: str): |
| 6695 | if self.markets is None: |