def get_exchange_pair(self, pair) -> str: try: return symbol_util.convert_symbol( symbol=pair, symbol_separator=octobot_commons.MARKET_SEPARATOR, new_symbol_separator=self.CRYPTOFEED_DEFAULT_MARKET_SEPARATOR, should_uppercase=True, ) except Exception: self.logger.error(f"Failed to get market of {pair}") return ""
def get_exchange_pair(self, pair) -> str: """ Convert an uniformized symbol format to a cryptofeed symbol format :param pair: the pair to format :return: the cryptofeed pair when success else an empty string """ try: return symbol_util.convert_symbol( symbol=pair, symbol_separator=octobot_commons.MARKET_SEPARATOR, new_symbol_separator=self.CRYPTOFEED_DEFAULT_MARKET_SEPARATOR, should_uppercase=True, ) except Exception: self.logger.error(f"Failed to get market of {pair}") return ""
def test_convert_symbol(): assert convert_symbol("BTC-USDT", symbol_separator="-") == "BTC/USDT"