Struct ethers_flashbots::BundleRequest
source · [−]pub struct BundleRequest { /* private fields */ }Expand description
A bundle that can be submitted to a Flashbots relay.
The bundle can include your own transactions and transactions from the mempool.
Additionally, this bundle can be simulated through a relay if simulation
parameters are provided using BundleRequest::set_simulation_block and
BundleRequest::set_simulation_timestamp.
Please note that some parameters are required, and submitting a bundle without them will get it rejected pre-flight. The required parameters include:
- At least one transaction (
BundleRequest::push_transaction) - A target block (
BundleRequest::set_block)
Implementations
sourceimpl BundleRequest
impl BundleRequest
sourcepub fn push_transaction<T: Into<BundleTransaction>>(self, tx: T) -> Self
pub fn push_transaction<T: Into<BundleTransaction>>(self, tx: T) -> Self
Adds a transaction to the bundle request.
Transactions added to the bundle can either be novel transactions, i.e. transactions that you have crafted, or they can be from one of the mempool APIs.
sourcepub fn push_revertible_transaction<T: Into<BundleTransaction>>(
self,
tx: T
) -> Self
pub fn push_revertible_transaction<T: Into<BundleTransaction>>(
self,
tx: T
) -> Self
Adds a revertible transaction to the bundle request.
This differs from BundleRequest::push_transaction in that the bund will still be
considered valid if the transaction reverts.
sourcepub fn transactions(&self) -> &Vec<BundleTransaction>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn transactions(&self) -> &Vec<BundleTransaction>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Get a reference to the transactions currently in the bundle request.
sourcepub fn transaction_hashes(&self) -> Vec<TxHash>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn transaction_hashes(&self) -> Vec<TxHash>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Get a list of transaction hashes in the bundle request.
sourcepub fn simulation_block(&self) -> Option<U64>
pub fn simulation_block(&self) -> Option<U64>
Get the block that determines the state for bundle simulation (if any).
See eth_callBundle in the Flashbots documentation
for more information on bundle simulations.
sourcepub fn set_simulation_block(self, block: U64) -> Self
pub fn set_simulation_block(self, block: U64) -> Self
Set the block that determines the state for bundle simulation.
sourcepub fn simulation_timestamp(&self) -> Option<u64>
pub fn simulation_timestamp(&self) -> Option<u64>
Get the UNIX timestamp used for bundle simulation (if any).
See eth_callBundle in the Flashbots documentation
for more information on bundle simulations.
sourcepub fn set_simulation_timestamp(self, timestamp: u64) -> Self
pub fn set_simulation_timestamp(self, timestamp: u64) -> Self
Set the UNIX timestamp used for bundle simulation.
sourcepub fn simulation_basefee(&self) -> Option<u64>
pub fn simulation_basefee(&self) -> Option<u64>
Get the base gas fee for bundle simulation (if any).
See eth_callBundle in the Flashbots documentation
for more information on bundle simulations.
sourcepub fn set_simulation_basefee(self, basefee: u64) -> Self
pub fn set_simulation_basefee(self, basefee: u64) -> Self
Set the base gas fee for bundle simulation (if any). Optional: will default to a value chosen by the node if not specified.
sourcepub fn min_timestamp(&self) -> Option<u64>
pub fn min_timestamp(&self) -> Option<u64>
Get the minimum timestamp for which this bundle is valid (if any), in seconds since the UNIX epoch.
sourcepub fn set_min_timestamp(self, timestamp: u64) -> Self
pub fn set_min_timestamp(self, timestamp: u64) -> Self
Set the minimum timestamp for which this bundle is valid (if any), in seconds since the UNIX epoch.
sourcepub fn max_timestamp(&self) -> Option<u64>
pub fn max_timestamp(&self) -> Option<u64>
Get the maximum timestamp for which this bundle is valid (if any), in seconds since the UNIX epoch.
sourcepub fn set_max_timestamp(self, timestamp: u64) -> Self
pub fn set_max_timestamp(self, timestamp: u64) -> Self
Set the maximum timestamp for which this bundle is valid (if any), in seconds since the UNIX epoch.
Trait Implementations
sourceimpl Clone for BundleRequest
impl Clone for BundleRequest
sourcefn clone(&self) -> BundleRequest
fn clone(&self) -> BundleRequest
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for BundleRequest
impl Debug for BundleRequest
sourceimpl Default for BundleRequest
impl Default for BundleRequest
sourcefn default() -> BundleRequest
fn default() -> BundleRequest
Returns the “default value” for a type. Read more
sourceimpl Serialize for BundleRequest
impl Serialize for BundleRequest
Auto Trait Implementations
impl RefUnwindSafe for BundleRequest
impl Send for BundleRequest
impl Sync for BundleRequest
impl Unpin for BundleRequest
impl UnwindSafe for BundleRequest
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn 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>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more