SeismicWallet
Multi-signer wallet generic over SeismicNetwork
SeismicWallet<N> is the signing wallet used by SeismicSignedProvider. It holds one or more signers, tracks a default signer, and implements Alloy's NetworkWallet<N> trait so the filler pipeline can request transaction signatures.
Overview
SeismicWallet is generic over N: SeismicNetwork, meaning the same wallet type works transparently with SeismicReth (production) and SeismicFoundry (local development). Internally, it stores signers in an address-indexed map and maintains a default signer address.
Definition
pub struct SeismicWallet<N: SeismicNetwork>
where
N::UnsignedTx: Send + Sync,
{
default: Address,
signers: AddressHashMap<Arc<dyn TxSigner<Signature> + Send + Sync>>,
_network: std::marker::PhantomData<N>,
}default
Address
Address of the default signer
signers
AddressHashMap<Arc<dyn TxSigner<Signature> + Send + Sync>>
Map of registered signers by address
_network
PhantomData<N>
Marker for the network type (zero-sized)
Creating a Wallet
From a Single Signer
The most common pattern is to create a wallet from a PrivateKeySigner:
The From implementation is available for any type that implements TxSigner<Signature> + Send + Sync + 'static. The provided signer becomes both the default and the only registered signer.
With new()
This is equivalent to using From — the signer is registered and set as the default.
Methods
new
Create a new wallet with a single signer that becomes the default.
signer
impl TxSigner<Signature> + Send + Sync + 'static
Yes
The signer to register as default
Returns: A new SeismicWallet with the given signer.
register_signer
Add an additional signer to the wallet without changing the default.
signer
impl TxSigner<Signature> + Send + Sync + 'static
Yes
The signer to add
register_default_signer
Add a signer and set it as the new default.
signer
impl TxSigner<Signature> + Send + Sync + 'static
Yes
The signer to add and set as default
set_default_signer
Change the default signer to an already-registered address. Panics if the address is not registered.
address
Address
Yes
Address of an already-registered signer
default_signer
Get an Arc reference to the default signer.
Returns: Arc<dyn TxSigner<Signature> + Send + Sync> — The default signer.
signer_by_address
Look up a signer by its address.
address
Address
Yes
The address to look up
Returns: Option<Arc<dyn TxSigner<Signature> + Send + Sync>> — The signer if registered, None otherwise.
Trait Implementations
NetworkWallet<N>
SeismicWallet<N> implements Alloy's NetworkWallet<N> trait, which is how the WalletFiller interacts with it during the filler pipeline:
default_signer_address()— returns the default signer's addresshas_signer_for(address)— checks if a signer is registered for the given addresssigner_addresses()— returns an iterator over all registered signer addresses
From<S> for SeismicWallet<N>
Any type S that implements TxSigner<Signature> + Send + Sync + 'static can be converted into a SeismicWallet via From:
This is the most ergonomic way to create a wallet from a single signer.
Examples
Basic Wallet Creation
Multi-Account Wallet
Switching Default Signer
Local Development with SeismicFoundry
Notes
SeismicWalletis generic overN: SeismicNetworkso the same API works for both production and testing networksSigners are stored as
Arc<dyn TxSigner<Signature>>, allowing heterogeneous signer types in a single walletThe
PhantomData<N>field ensures type safety — aSeismicWallet<SeismicReth>cannot be used with aSeismicSignedProvider<SeismicFoundry>set_default_signerpanics on unregistered addresses; check withsigner_by_addressfirst if unsureThe wallet does not handle encryption — that is the responsibility of
SeismicElementsFiller
See Also
Wallet Overview - High-level wallet concepts
SeismicSignedProvider - Provider that uses the wallet
SeismicNetwork Trait - The trait constraining the
NparameterSeismicElementsFiller - Encryption filler in the pipeline
Installation - Cargo setup and prerequisites
Last updated

