pub struct TransactionSequencer<C, R> {
sender: Sender<(R, Sender<Result<TxId>>)>,
client: Arc<C>,
}Expand description
Takes care of sequencing transactions, nonce management, and submitting the transactions to the blockchain in-order.
This object is meant to be a singleton and cannot be cloned.
Fields§
§sender: Sender<(R, Sender<Result<TxId>>)>§client: Arc<C>Implementations§
Source§impl<C, R> TransactionSequencer<C, R>where
C: BlokliQueryClient + BlokliTransactionClient + Send + Sync + 'static,
R: SignableTransaction + Send + Sync + 'static,
impl<C, R> TransactionSequencer<C, R>where
C: BlokliQueryClient + BlokliTransactionClient + Send + Sync + 'static,
R: SignableTransaction + Send + Sync + 'static,
pub fn new(signer: ChainKeypair, client: Arc<C>) -> Self
Source§impl<C, R> TransactionSequencer<C, R>
impl<C, R> TransactionSequencer<C, R>
Sourcepub async fn enqueue_transaction(
&self,
transaction: R,
timeout_until_finalized: Duration,
) -> Result<impl Future<Output = Result<Transaction>>>
pub async fn enqueue_transaction( &self, transaction: R, timeout_until_finalized: Duration, ) -> Result<impl Future<Output = Result<Transaction>>>
Adds the transaction to the TransactionSequencer queue.
The timeout_until_finalized is a total time until the TX is submitted and either confirmed or rejected.
Trait Implementations§
Auto Trait Implementations§
impl<C, R> Freeze for TransactionSequencer<C, R>
impl<C, R> !RefUnwindSafe for TransactionSequencer<C, R>
impl<C, R> Send for TransactionSequencer<C, R>
impl<C, R> Sync for TransactionSequencer<C, R>
impl<C, R> Unpin for TransactionSequencer<C, R>
impl<C, R> !UnwindSafe for TransactionSequencer<C, R>
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
§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