pub struct FlashbotsMiddleware<P, T> {
provider: P,
relay: Relay,
simulation_relay: Option<Relay>,
_t: PhantomData<T>,
}
Fields§
§provider: P
§relay: Relay
§simulation_relay: Option<Relay>
§_t: PhantomData<T>
Implementations§
Source§impl<P, T> FlashbotsMiddleware<P, T>
impl<P, T> FlashbotsMiddleware<P, T>
Sourcepub fn new(relay_url: impl Into<Url>, provider: P) -> Self
pub fn new(relay_url: impl Into<Url>, provider: P) -> Self
Initialize a new Flashbots middleware.
The signer is used to sign requests to the relay.
pub fn new_no_signer(relay_url: impl Into<Url>, provider: P) -> Self
Sourcepub fn simulation_relay(&self) -> Option<&Relay>
pub fn simulation_relay(&self) -> Option<&Relay>
Get the relay client used by the middleware to simulate bundles if set.
Sourcepub fn set_simulation_relay(&mut self, relay_url: impl Into<Url>)
pub fn set_simulation_relay(&mut self, relay_url: impl Into<Url>)
Set a separate relay to use for simulating bundles.
This can either be a full Flashbots relay or a node that implements
the eth_callBundle
remote procedure call.
Sourcepub async fn simulate_bundle(
&self,
bundle: &BundleRequest,
) -> Result<SimulatedBundle, FlashbotsMiddlewareError>
pub async fn simulate_bundle( &self, bundle: &BundleRequest, ) -> Result<SimulatedBundle, FlashbotsMiddlewareError>
Simulate a bundle.
See eth_callBundle
for more information.
pub async fn simulate_local_bundle( &self, bundle: &BundleRequest, ) -> Result<SimulatedBundle, FlashbotsMiddlewareError>
Sourcepub async fn send_bundle(
&self,
bundle: &BundleRequest,
) -> Result<(), FlashbotsMiddlewareError>
pub async fn send_bundle( &self, bundle: &BundleRequest, ) -> Result<(), FlashbotsMiddlewareError>
Send a bundle to the relayer.
See eth_sendBundle
for more information.
Trait Implementations§
Source§impl<P: Clone, T: Clone> Clone for FlashbotsMiddleware<P, T>
impl<P: Clone, T: Clone> Clone for FlashbotsMiddleware<P, T>
Source§fn clone(&self) -> FlashbotsMiddleware<P, T>
fn clone(&self) -> FlashbotsMiddleware<P, T>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<P, T> Freeze for FlashbotsMiddleware<P, T>where
P: Freeze,
impl<P, T> !RefUnwindSafe for FlashbotsMiddleware<P, T>
impl<P, T> Send for FlashbotsMiddleware<P, T>
impl<P, T> Sync for FlashbotsMiddleware<P, T>
impl<P, T> Unpin for FlashbotsMiddleware<P, T>
impl<P, T> !UnwindSafe for FlashbotsMiddleware<P, T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> MaybeSendSync for T
Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.