def feed_to_exchange(exchange, feed): if exchange == POLONIEX: if feed not in _feed_to_exchange_map: return pair_std_to_exchange(feed, POLONIEX) ret = _feed_to_exchange_map[feed][exchange] if ret == UNSUPPORTED: exception = UnsupportedDataFeed( f"{feed} is not supported on {exchange}") LOG.error("Raise %r", exception) raise exception return ret
def feed_to_exchange(exchange, feed): if exchange == POLONIEX: if feed not in _feed_to_exchange_map: return pair_std_to_exchange(feed, POLONIEX) ret = _feed_to_exchange_map[feed][exchange] if ret == UNSUPPORTED: LOG.error(f"{feed} is not supported on {exchange}") if feed in {LIMIT, MARKET}: raise UnsupportedOrderType else: raise UnsupportedDataFeed(f"{feed} is not supported on {exchange}") return ret
def raise_error(): exception = UnsupportedDataFeed( f"{feed} is not currently supported on {exchange}") if not silent: LOG.error("Error: %r", exception) raise exception
def std_channel_to_exchange(cls, channel: str) -> str: try: return cls.websocket_channels[channel] except KeyError: raise UnsupportedDataFeed(f'{channel} is not supported on {cls.id}')