Skip to main content

BitcoinChainService

Trait BitcoinChainService 

Source
pub trait BitcoinChainService: Send + Sync {
    // Required methods
    fn get_address_utxos<'life0, 'async_trait>(
        &'life0 self,
        address: String,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Utxo>, ChainServiceError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_address_txos<'life0, 'async_trait>(
        &'life0 self,
        address: String,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Utxo>, ChainServiceError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_transaction_status<'life0, 'async_trait>(
        &'life0 self,
        txid: String,
    ) -> Pin<Box<dyn Future<Output = Result<TxStatus, ChainServiceError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_transaction_hex<'life0, 'async_trait>(
        &'life0 self,
        txid: String,
    ) -> Pin<Box<dyn Future<Output = Result<String, ChainServiceError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_outspend<'life0, 'async_trait>(
        &'life0 self,
        txid: String,
        vout: u32,
    ) -> Pin<Box<dyn Future<Output = Result<Outspend, ChainServiceError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn broadcast_transaction<'life0, 'async_trait>(
        &'life0 self,
        tx: String,
    ) -> Pin<Box<dyn Future<Output = Result<(), ChainServiceError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn recommended_fees<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<RecommendedFees, ChainServiceError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

Source

fn get_address_utxos<'life0, 'async_trait>( &'life0 self, address: String, ) -> Pin<Box<dyn Future<Output = Result<Vec<Utxo>, ChainServiceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_address_txos<'life0, 'async_trait>( &'life0 self, address: String, ) -> Pin<Box<dyn Future<Output = Result<Vec<Utxo>, ChainServiceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Every output ever paid to address, spent or not, unlike get_address_utxos which omits spent ones. Recovers an output’s outpoint and value after it has been spent, so a swept refund can still be distinguished from one never broadcast.

Source

fn get_transaction_status<'life0, 'async_trait>( &'life0 self, txid: String, ) -> Pin<Box<dyn Future<Output = Result<TxStatus, ChainServiceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_transaction_hex<'life0, 'async_trait>( &'life0 self, txid: String, ) -> Pin<Box<dyn Future<Output = Result<String, ChainServiceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_outspend<'life0, 'async_trait>( &'life0 self, txid: String, vout: u32, ) -> Pin<Box<dyn Future<Output = Result<Outspend, ChainServiceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn broadcast_transaction<'life0, 'async_trait>( &'life0 self, tx: String, ) -> Pin<Box<dyn Future<Output = Result<(), ChainServiceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn recommended_fees<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<RecommendedFees, ChainServiceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§