alloy_provider

Trait WalletProvider

source
pub trait WalletProvider<N: Network = Ethereum> {
    type Wallet: NetworkWallet<N>;

    // Required methods
    fn wallet(&self) -> &Self::Wallet;
    fn wallet_mut(&mut self) -> &mut Self::Wallet;

    // Provided methods
    fn default_signer_address(&self) -> Address { ... }
    fn has_signer_for(&self, address: &Address) -> bool { ... }
    fn signer_addresses(&self) -> impl Iterator<Item = Address> { ... }
}
Expand description

Trait for Providers, Fill stacks, etc, which contain NetworkWallet.

Required Associated Types§

source

type Wallet: NetworkWallet<N>

The underlying NetworkWallet type contained in this stack.

Required Methods§

source

fn wallet(&self) -> &Self::Wallet

Get a reference to the underlying wallet.

source

fn wallet_mut(&mut self) -> &mut Self::Wallet

Get a mutable reference to the underlying wallet.

Provided Methods§

source

fn default_signer_address(&self) -> Address

Get the default signer address.

source

fn has_signer_for(&self, address: &Address) -> bool

Check if the signer can sign for the given address.

source

fn signer_addresses(&self) -> impl Iterator<Item = Address>

Get an iterator of all signer addresses. Note that because the signer always has at least one address, this iterator will always have at least one element.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

source§

impl<F, P, T, N> WalletProvider<N> for FillProvider<F, P, T, N>
where F: TxFiller<N> + WalletProvider<N>, P: Provider<T, N>, T: Transport + Clone, N: Network,

source§

impl<L, R, N> WalletProvider<N> for JoinFill<L, R>
where R: WalletProvider<N>, N: Network,

source§

impl<W, N> WalletProvider<N> for WalletFiller<W>
where W: NetworkWallet<N> + Clone, N: Network,