示例#1
0
    def info(cls) -> dict:
        """
        Return information about the Exchange - what trading pairs are supported, what data channels, etc
        """
        pairs, info = get_exchange_info(cls.id)
        data = {'pairs': list(pairs.keys()), 'channels': []}
        for channel in (LIQUIDATIONS, OPEN_INTEREST, FUNDING, VOLUME, TICKER, L2_BOOK, L3_BOOK, TRADES, FUTURES_INDEX):
            try:
                feed_to_exchange(cls.id, channel, silent=True)
                data['channels'].append(channel)
            except UnsupportedDataFeed:
                pass

        data.update(info)

        return data
示例#2
0
    def info(cls, key_id: str = None) -> dict:
        """
        Return information about the Exchange - what trading pairs are supported, what data channels, etc

        key_id: str
            API key to query the feed, required when requesting supported coins/pairs.
        """
        pairs, info = get_exchange_info(cls.id, key_id=key_id)
        data = {'pairs': list(pairs.keys()), 'channels': []}
        for channel in (FUNDING, FUTURES_INDEX, LIQUIDATIONS, L2_BOOK, L3_BOOK, OPEN_INTEREST, MARKET_INFO, TICKER, TRADES, TRANSACTIONS, VOLUME):
            try:
                feed_to_exchange(cls.id, channel, silent=True)
                data['channels'].append(channel)
            except UnsupportedDataFeed:
                pass

        data.update(info)
        return data