Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it easier to configure a wallet in a provider #2094

Open
mattsse opened this issue Feb 21, 2025 · 0 comments · May be fixed by #2120
Open

Make it easier to configure a wallet in a provider #2094

mattsse opened this issue Feb 21, 2025 · 0 comments · May be fixed by #2120
Assignees
Labels
c-network Pertaining to the network crate c-provider c-signers Pertaining to the signers such as local, aws, gcp etc. needs design P-high High Priority

Comments

@mattsse
Copy link
Member

mattsse commented Feb 21, 2025

this currently requires

/// Add a wallet layer to the stack being built.
///
/// See [`WalletFiller`].
pub fn wallet<W>(self, wallet: W) -> ProviderBuilder<L, JoinFill<F, WalletFiller<W>>, N> {
self.filler(WalletFiller::new(wallet))
}

 let wallet = EthereumWallet::from(signer);

which is usually initialized like this:

let signer: PrivateKeySigner =
"0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80".parse().unwrap();
let wallet = EthereumWallet::from(signer);

it would be easier if this could be directly initialized which a Privatekeysigner.

to make this more ergonomic, we can introduce a helper trait that serves as a specialization for PrivateKeysigner so we can accept something like impl IntoWallet or similar.

@mattsse mattsse added this to Alloy Feb 21, 2025
@github-project-automation github-project-automation bot moved this to Todo in Alloy Feb 21, 2025
@yash-atreya yash-atreya self-assigned this Feb 24, 2025
@yash-atreya yash-atreya added P-high High Priority c-provider c-network Pertaining to the network crate c-signers Pertaining to the signers such as local, aws, gcp etc. labels Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c-network Pertaining to the network crate c-provider c-signers Pertaining to the signers such as local, aws, gcp etc. needs design P-high High Priority
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

2 participants