Trait TokenPreProcessor

Source
pub trait TokenPreProcessor: Send + Sync {
    // Required method
    fn get_tokens<'life0, 'async_trait>(
        &'life0 self,
        addresses: Vec<Bytes>,
        token_finder: Arc<dyn TokenOwnerFinding>,
        block: BlockTag,
    ) -> Pin<Box<dyn Future<Output = Vec<Token>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Trait for retrieving additional information about tokens, such as the number of decimals and the token symbol, to help construct CurrencyToken objects.

Required Methods§

Source

fn get_tokens<'life0, 'async_trait>( &'life0 self, addresses: Vec<Bytes>, token_finder: Arc<dyn TokenOwnerFinding>, block: BlockTag, ) -> Pin<Box<dyn Future<Output = Vec<Token>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Given a list of token addresses, this function retrieves additional metadata for each token.

§Parameters
  • addresses - A vector of token addresses to process.
  • token_finder - A reference to a TokenOwnerFinding implementation to help find token owners.
  • block - The block tag at which the information should be retrieved.
§Returns

A vector of CurrencyToken objects, each containing the processed information for the token.

Implementors§