foundry_common::ens

Trait ProviderEnsExt

Source
pub trait ProviderEnsExt<T: Transport + Clone, N: Network, P: Provider<T, N>> {
    // Required method
    fn get_resolver<'life0, 'life1, 'async_trait>(
        &'life0 self,
        node: B256,
        error_name: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<EnsResolverInstance<T, &P, N>, EnsError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided methods
    fn resolve_name<'life0, 'life1, 'async_trait>(
        &'life0 self,
        name: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Address, EnsError>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn lookup_address<'life0, 'life1, 'async_trait>(
        &'life0 self,
        address: &'life1 Address,
    ) -> Pin<Box<dyn Future<Output = Result<String, EnsError>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

Extension trait for ENS contract calls.

Required Methods§

Source

fn get_resolver<'life0, 'life1, 'async_trait>( &'life0 self, node: B256, error_name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<EnsResolverInstance<T, &P, N>, EnsError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns the resolver for the specified node. The &str is only used for error messages.

Provided Methods§

Source

fn resolve_name<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Address, EnsError>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Performs a forward lookup of an ENS name to an address.

Source

fn lookup_address<'life0, 'life1, 'async_trait>( &'life0 self, address: &'life1 Address, ) -> Pin<Box<dyn Future<Output = Result<String, EnsError>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Performs a reverse lookup of an address to an ENS name.

Implementors§

Source§

impl<T, N, P> ProviderEnsExt<T, N, P> for P
where P: Provider<T, N>, N: Network, T: Transport + Clone,