pub struct BundleRequest {
transactions: Vec<BundleTransaction>,
revertible_transaction_hashes: Vec<TxHash>,
access_list_hashes: Option<Vec<TxHash>>,
target_block: Option<U64>,
min_timestamp: Option<u64>,
max_timestamp: Option<u64>,
simulation_block: Option<U64>,
simulation_timestamp: Option<u64>,
simulation_basefee: Option<u64>,
}
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_target_block
)
Fields§
§transactions: Vec<BundleTransaction>
§revertible_transaction_hashes: Vec<TxHash>
§access_list_hashes: Option<Vec<TxHash>>
§target_block: Option<U64>
§min_timestamp: Option<u64>
§max_timestamp: Option<u64>
§simulation_block: Option<U64>
§simulation_timestamp: Option<u64>
§simulation_basefee: Option<u64>
Implementations§
Source§impl 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 add_transaction<T: Into<BundleTransaction>>(&mut self, tx: T)
pub fn add_transaction<T: Into<BundleTransaction>>(&mut self, tx: T)
Adds a transaction to the bundle request.
This function takes a mutable reference to self
and adds the specified
transaction to the transactions
vector. The added transaction can either
be a novel transaction that you have crafted, or it 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 bundle will still be
considered valid if the transaction reverts.
Sourcepub fn add_revertible_transaction<T: Into<BundleTransaction>>(&mut self, tx: T)
pub fn add_revertible_transaction<T: Into<BundleTransaction>>(&mut self, tx: T)
Adds a revertible transaction to the bundle request.
This function takes a mutable reference to self
and adds the specified
revertible transaction to the transactions
vector. The added transaction can either
be a novel transaction that you have crafted, or it can be from one of the
mempool APIs. Unlike the push_transaction
method, the bundle will still be considered
valid even if the added transaction reverts.
Sourcepub fn transactions(&self) -> &Vec<BundleTransaction>
pub fn transactions(&self) -> &Vec<BundleTransaction>
Get a reference to the transactions currently in the bundle request.
Sourcepub fn target_block(&self) -> Option<U64>
pub fn target_block(&self) -> Option<U64>
Get the target block (if any).
Sourcepub fn set_target_block(self, target_block: U64) -> Self
pub fn set_target_block(self, target_block: U64) -> Self
Set the target block of the bundle.
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.
pub fn set_access_list_hashes(self, hashes: Option<Vec<TxHash>>) -> Self
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§
Source§impl Clone for BundleRequest
impl Clone for BundleRequest
Source§fn clone(&self) -> BundleRequest
fn clone(&self) -> BundleRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for BundleRequest
impl Debug for BundleRequest
Source§impl Default for BundleRequest
impl Default for BundleRequest
Source§fn default() -> BundleRequest
fn default() -> BundleRequest
Auto Trait Implementations§
impl Freeze for BundleRequest
impl RefUnwindSafe for BundleRequest
impl Send for BundleRequest
impl Sync for BundleRequest
impl Unpin for BundleRequest
impl UnwindSafe for BundleRequest
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
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>
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>
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
impl<T> RpcParam for T
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 168 bytes