pub trait Blockchain {
// Required methods
fn send_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
transaction: &'life1 Transaction,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_network(&self) -> Result<Network, Error>;
fn get_blockchain_height<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_block_at_height<'life0, 'async_trait>(
&'life0 self,
height: u64,
) -> Pin<Box<dyn Future<Output = Result<Block, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
tx_id: &'life1 Txid,
) -> Pin<Box<dyn Future<Output = Result<Transaction, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_transaction_confirmations<'life0, 'life1, 'async_trait>(
&'life0 self,
tx_id: &'life1 Txid,
) -> Pin<Box<dyn Future<Output = Result<u32, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Blockchain trait provides access to the bitcoin blockchain.
Required Methods§
Sourcefn send_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
transaction: &'life1 Transaction,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
transaction: &'life1 Transaction,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Broadcast the given transaction to the bitcoin network.
Sourcefn get_network(&self) -> Result<Network, Error>
fn get_network(&self) -> Result<Network, Error>
Returns the network currently used (mainnet, testnet or regtest).
Sourcefn get_blockchain_height<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_blockchain_height<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the height of the blockchain
Sourcefn get_block_at_height<'life0, 'async_trait>(
&'life0 self,
height: u64,
) -> Pin<Box<dyn Future<Output = Result<Block, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_block_at_height<'life0, 'async_trait>(
&'life0 self,
height: u64,
) -> Pin<Box<dyn Future<Output = Result<Block, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the block at given height
Sourcefn get_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
tx_id: &'life1 Txid,
) -> Pin<Box<dyn Future<Output = Result<Transaction, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
tx_id: &'life1 Txid,
) -> Pin<Box<dyn Future<Output = Result<Transaction, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get the transaction with given id.
Sourcefn get_transaction_confirmations<'life0, 'life1, 'async_trait>(
&'life0 self,
tx_id: &'life1 Txid,
) -> Pin<Box<dyn Future<Output = Result<u32, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_transaction_confirmations<'life0, 'life1, 'async_trait>(
&'life0 self,
tx_id: &'life1 Txid,
) -> Pin<Box<dyn Future<Output = Result<u32, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get the number of confirmation for the transaction with given id.