alloy icon indicating copy to clipboard operation
alloy copied to clipboard

[Feature] Infer `EthereumSigner` automatically in the signer layer of the `ProviderBuilder`

Open zerosnacks opened this issue 8 months ago • 3 comments

Component

provider, pubsub, signers

Describe the feature you would like

Given

let signer = LocalWallet::random();

We currently require the signer to be cast into EthereumSigner::from(signer) when using the signer layer in the ProviderBuilder as follows:

let provider = ProviderBuilder::new()
    .with_recommended_fillers()
    .signer(EthereumSigner::from(signer))
    .on_http(rpc_url);

The proposed API:

let provider = ProviderBuilder::new()
    .with_recommended_fillers()
    .signer(signer)
    .on_http(rpc_url);

Additional context

No response

zerosnacks avatar Jun 03 '24 07:06 zerosnacks