diff --git a/crates/provider/src/provider/trait.rs b/crates/provider/src/provider/trait.rs index d04fa821786..2a8a11305c1 100644 --- a/crates/provider/src/provider/trait.rs +++ b/crates/provider/src/provider/trait.rs @@ -17,6 +17,7 @@ use alloy_primitives::{ }; use alloy_rpc_client::{ClientRef, NoParams, PollerBuilder, WeakClient}; use alloy_rpc_types_eth::{ + simulate::{SimulatePayload, SimulatedBlock}, AccessListResult, BlockId, BlockNumberOrTag, EIP1186AccountProofResponse, FeeHistory, Filter, FilterChanges, Log, SyncStatus, }; @@ -152,6 +153,17 @@ pub trait Provider: EthCall::new(self.weak_client(), tx) } + /// Executes an arbitrary number of transactions on top of the requested state. + /// + /// The transactions are packed into individual blocks. Overrides can be provided. + #[doc(alias = "eth_simulateV1")] + fn simulate<'req>( + &self, + payload: &'req SimulatePayload, + ) -> RpcWithBlock>> { + self.client().request("eth_simulateV1", payload).into() + } + /// Gets the chain ID. fn get_chain_id(&self) -> ProviderCall { self.client()