Esempio n. 1
0
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
Esempio n. 2
0
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
Esempio n. 3
0
 def raise_error():
     exception = UnsupportedDataFeed(
         f"{feed} is not currently supported on {exchange}")
     if not silent:
         LOG.error("Error: %r", exception)
     raise exception
Esempio n. 4
0
 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}')