pub trait Transaction {
// Required methods
fn prepare_transaction<'life0, 'async_trait>(
&'life0 self,
tx: TransactionRepoModel,
) -> Pin<Box<dyn Future<Output = Result<TransactionRepoModel, TransactionError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn submit_transaction<'life0, 'async_trait>(
&'life0 self,
tx: TransactionRepoModel,
) -> Pin<Box<dyn Future<Output = Result<TransactionRepoModel, TransactionError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn resubmit_transaction<'life0, 'async_trait>(
&'life0 self,
tx: TransactionRepoModel,
) -> Pin<Box<dyn Future<Output = Result<TransactionRepoModel, TransactionError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn handle_transaction_status<'life0, 'async_trait>(
&'life0 self,
tx: TransactionRepoModel,
context: Option<StatusCheckContext>,
) -> Pin<Box<dyn Future<Output = Result<TransactionRepoModel, TransactionError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn cancel_transaction<'life0, 'async_trait>(
&'life0 self,
tx: TransactionRepoModel,
) -> Pin<Box<dyn Future<Output = Result<TransactionRepoModel, TransactionError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn replace_transaction<'life0, 'async_trait>(
&'life0 self,
old_tx: TransactionRepoModel,
new_tx_request: NetworkTransactionRequest,
) -> Pin<Box<dyn Future<Output = Result<TransactionRepoModel, TransactionError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn sign_transaction<'life0, 'async_trait>(
&'life0 self,
tx: TransactionRepoModel,
) -> Pin<Box<dyn Future<Output = Result<TransactionRepoModel, TransactionError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn validate_transaction<'life0, 'async_trait>(
&'life0 self,
tx: TransactionRepoModel,
) -> Pin<Box<dyn Future<Output = Result<bool, TransactionError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
A trait that defines the operations for handling transactions across different networks.
Required Methods§
Sourcefn prepare_transaction<'life0, 'async_trait>(
&'life0 self,
tx: TransactionRepoModel,
) -> Pin<Box<dyn Future<Output = Result<TransactionRepoModel, TransactionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn prepare_transaction<'life0, 'async_trait>(
&'life0 self,
tx: TransactionRepoModel,
) -> Pin<Box<dyn Future<Output = Result<TransactionRepoModel, TransactionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn submit_transaction<'life0, 'async_trait>(
&'life0 self,
tx: TransactionRepoModel,
) -> Pin<Box<dyn Future<Output = Result<TransactionRepoModel, TransactionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn submit_transaction<'life0, 'async_trait>(
&'life0 self,
tx: TransactionRepoModel,
) -> Pin<Box<dyn Future<Output = Result<TransactionRepoModel, TransactionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn resubmit_transaction<'life0, 'async_trait>(
&'life0 self,
tx: TransactionRepoModel,
) -> Pin<Box<dyn Future<Output = Result<TransactionRepoModel, TransactionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn resubmit_transaction<'life0, 'async_trait>(
&'life0 self,
tx: TransactionRepoModel,
) -> Pin<Box<dyn Future<Output = Result<TransactionRepoModel, TransactionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn handle_transaction_status<'life0, 'async_trait>(
&'life0 self,
tx: TransactionRepoModel,
context: Option<StatusCheckContext>,
) -> Pin<Box<dyn Future<Output = Result<TransactionRepoModel, TransactionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_transaction_status<'life0, 'async_trait>(
&'life0 self,
tx: TransactionRepoModel,
context: Option<StatusCheckContext>,
) -> Pin<Box<dyn Future<Output = Result<TransactionRepoModel, TransactionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handles the status of a transaction.
§Arguments
tx- ATransactionRepoModelrepresenting the transaction whose status is to be handled.context- OptionalStatusCheckContextcontaining failure tracking information for circuit breaker decisions. When provided, handlers can use this to decide whether to force-finalize a transaction that has exceeded retry limits.
§Returns
A Result containing the updated TransactionRepoModel or a TransactionError.