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,