BlokliTransactionClient

Trait BlokliTransactionClient 

pub trait BlokliTransactionClient {
    // Required methods
    fn submit_transaction<'life0, 'life1, 'async_trait>(
        &'life0 self,
        signed_tx: &'life1 [u8],
    ) -> Pin<Box<dyn Future<Output = Result<[u8; 32], BlokliClientError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn submit_and_track_transaction<'life0, 'life1, 'async_trait>(
        &'life0 self,
        signed_tx: &'life1 [u8],
    ) -> Pin<Box<dyn Future<Output = Result<String, BlokliClientError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn submit_and_confirm_transaction<'life0, 'life1, 'async_trait>(
        &'life0 self,
        signed_tx: &'life1 [u8],
        num_confirmations: usize,
    ) -> Pin<Box<dyn Future<Output = Result<[u8; 32], BlokliClientError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn track_transaction<'life0, 'async_trait>(
        &'life0 self,
        tx_id: String,
        client_timeout: Duration,
    ) -> Pin<Box<dyn Future<Output = Result<Transaction, BlokliClientError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
}
Expand description

Trait defining Blokli API for signed transaction submission to the chain.

Required Methods§

fn submit_transaction<'life0, 'life1, 'async_trait>( &'life0 self, signed_tx: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<[u8; 32], BlokliClientError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Submits a signed transaction to the chain without waiting for confirmation.

fn submit_and_track_transaction<'life0, 'life1, 'async_trait>( &'life0 self, signed_tx: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<String, BlokliClientError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Submits a signed transaction to the chain and returns an ID that can be used to track the transaction status via subscription or query.

fn submit_and_confirm_transaction<'life0, 'life1, 'async_trait>( &'life0 self, signed_tx: &'life1 [u8], num_confirmations: usize, ) -> Pin<Box<dyn Future<Output = Result<[u8; 32], BlokliClientError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Submits a signed transaction to the chain and waits for the given number of confirmations.

fn track_transaction<'life0, 'async_trait>( &'life0 self, tx_id: String, client_timeout: Duration, ) -> Pin<Box<dyn Future<Output = Result<Transaction, BlokliClientError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Tracks the transaction given the tx_id previously returned by submit_and_track_transaction until it is confirmed or fails.

Implementors§