Esempio n. 1
0
 def get_exchange_events(
     self, exchange_address: str, type: str = None, from_block: int = 0
 ) -> List[BlockchainEvent]:
     ethindex_db = self.get_ethindex_db_for_exchange(exchange_address)
     if type is not None:
         events = ethindex_db.get_events(type, from_block=from_block)
     else:
         events = ethindex_db.get_all_events(from_block=from_block)
     return events
Esempio n. 2
0
 def get_network_events(
     self, network_address: str, type: str = None, from_block: int = 0
 ) -> List[BlockchainEvent]:
     ethindex_db = self.get_ethindex_db_for_currency_network(network_address)
     if type is not None:
         events = ethindex_db.get_events(type, from_block=from_block)
     else:
         events = ethindex_db.get_all_events(from_block=from_block)
     return events
Esempio n. 3
0
    def get_token_events(
        self, token_address: str, type: str = None, from_block: int = 0
    ) -> List[BlockchainEvent]:

        if token_address in self.unw_eth_addresses:
            ethindex_db = self.get_ethindex_db_for_unw_eth(token_address)
        else:
            ethindex_db = self.get_ethindex_db_for_token(token_address)

        if type is not None:
            events = ethindex_db.get_events(type, from_block=from_block)
        else:
            events = ethindex_db.get_all_events(from_block=from_block)

        return events