Struct walletd_bitcoin::Blockstream
source · pub struct Blockstream {
pub client: Client,
pub url: String,
}
Expand description
A blockchain connector for Bitcoin which follows the Blockstream API
.
Fields§
§client: Client
The client used to make requests to the API
url: String
The url of the API
Implementations§
source§impl Blockstream
impl Blockstream
sourcepub async fn check_if_past_transactions_exist(
&self,
public_address: &str
) -> Result<bool, Error>
pub async fn check_if_past_transactions_exist( &self, public_address: &str ) -> Result<bool, Error>
Checks if the given address has had an past transactions, returns true if it has and false if it has not Errors if the address is invalid or if the API returns an error
sourcepub fn block_count(&self) -> Result<u64, Error>
pub fn block_count(&self) -> Result<u64, Error>
Fetch the block height
sourcepub async fn fee_estimates(&self) -> Result<FeeEstimates, Error>
pub async fn fee_estimates(&self) -> Result<FeeEstimates, Error>
Fetch fee estimates from blockstream
sourcepub async fn transactions(
&self,
address: &str
) -> Result<Vec<BTransaction>, Error>
pub async fn transactions( &self, address: &str ) -> Result<Vec<BTransaction>, Error>
Fetch transactions from blockstream
sourcepub fn mempool_transactions(
&self,
address: &str
) -> Result<Vec<BTransaction>, Error>
pub fn mempool_transactions( &self, address: &str ) -> Result<Vec<BTransaction>, Error>
Fetch mempool transactions from blockstream
sourcepub async fn raw_transaction_hex(&self, txid: &str) -> Result<String, Error>
pub async fn raw_transaction_hex(&self, txid: &str) -> Result<String, Error>
Fetch raw transaction hex from blockstream for a given txid
sourcepub async fn transaction(&self, txid: &str) -> Result<BTransaction, Error>
pub async fn transaction(&self, txid: &str) -> Result<BTransaction, Error>
Fetch transaction info
Trait Implementations§
source§impl BlockchainConnector for Blockstream
impl BlockchainConnector for Blockstream
source§fn builder() -> BlockchainConnectorBuilder<Self>where
Self: Sized + Clone + BlockchainConnector,
fn builder() -> BlockchainConnectorBuilder<Self>where Self: Sized + Clone + BlockchainConnector,
Returns the builder that can be used to build a BlockchainConnector with custom options.
source§impl Clone for Blockstream
impl Clone for Blockstream
source§fn clone(&self) -> Blockstream
fn clone(&self) -> Blockstream
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Blockstream
impl Debug for Blockstream
source§impl Default for Blockstream
impl Default for Blockstream
source§fn default() -> Blockstream
fn default() -> Blockstream
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for Blockstream
impl Send for Blockstream
impl Sync for Blockstream
impl Unpin for Blockstream
impl !UnwindSafe for Blockstream
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