pub struct BlockingClient {
pub proxy: Option<String>,
pub timeout: Option<u64>,
pub headers: HashMap<String, String>,
pub max_retries: usize,
/* private fields */
}Fields§
§proxy: Option<String>The proxy is ignored when targeting wasm32.
timeout: Option<u64>Socket timeout.
headers: HashMap<String, String>HTTP headers to set on every request made to Waterfalls server
max_retries: usizeNumber of times to retry a request
Implementations§
Source§impl BlockingClient
impl BlockingClient
Sourcepub fn from_builder(builder: Builder) -> Self
pub fn from_builder(builder: Builder) -> Self
Build a blocking client from a Builder
Sourcepub fn get_request(&self, path: &str) -> Result<Request, Error>
pub fn get_request(&self, path: &str) -> Result<Request, Error>
Perform a raw HTTP GET request with the given URI path.
Sourcepub fn get_tx(&self, txid: &Txid) -> Result<Option<Transaction>, Error>
pub fn get_tx(&self, txid: &Txid) -> Result<Option<Transaction>, Error>
Get a Transaction option given its Txid
Sourcepub fn get_tx_no_opt(&self, txid: &Txid) -> Result<Transaction, Error>
pub fn get_tx_no_opt(&self, txid: &Txid) -> Result<Transaction, Error>
Get a Transaction given its Txid.
Sourcepub fn waterfalls(&self, descriptor: &str) -> Result<WaterfallResponse, Error>
pub fn waterfalls(&self, descriptor: &str) -> Result<WaterfallResponse, Error>
Query the waterfalls endpoint with a descriptor
Sourcepub fn waterfalls_addresses(
&self,
addresses: &[Address],
) -> Result<WaterfallResponse, Error>
pub fn waterfalls_addresses( &self, addresses: &[Address], ) -> Result<WaterfallResponse, Error>
Query the waterfalls endpoint with addresses
Sourcepub fn waterfalls_version(
&self,
descriptor: &str,
version: u8,
page: Option<u32>,
to_index: Option<u32>,
utxo_only: bool,
) -> Result<WaterfallResponse, Error>
pub fn waterfalls_version( &self, descriptor: &str, version: u8, page: Option<u32>, to_index: Option<u32>, utxo_only: bool, ) -> Result<WaterfallResponse, Error>
Query waterfalls with version-specific parameters
Sourcepub fn get_header_by_hash(
&self,
block_hash: &BlockHash,
) -> Result<BlockHeader, Error>
pub fn get_header_by_hash( &self, block_hash: &BlockHash, ) -> Result<BlockHeader, Error>
Get a BlockHeader given a particular block hash.
Sourcepub fn server_recipient(&self) -> Result<String, Error>
pub fn server_recipient(&self) -> Result<String, Error>
Get the server’s public key for encryption
Sourcepub fn server_address(&self) -> Result<String, Error>
pub fn server_address(&self) -> Result<String, Error>
Get the server’s address for message signing verification
Sourcepub fn time_since_last_block(&self) -> Result<String, Error>
pub fn time_since_last_block(&self) -> Result<String, Error>
Get time since last block with freshness indicator
Sourcepub fn broadcast(&self, transaction: &Transaction) -> Result<(), Error>
pub fn broadcast(&self, transaction: &Transaction) -> Result<(), Error>
Broadcast a Transaction to Waterfalls
Sourcepub fn get_tip_hash(&self) -> Result<BlockHash, Error>
pub fn get_tip_hash(&self) -> Result<BlockHash, Error>
Get the BlockHash of the current blockchain tip.
Trait Implementations§
Source§impl Clone for BlockingClient
impl Clone for BlockingClient
Source§fn clone(&self) -> BlockingClient
fn clone(&self) -> BlockingClient
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for BlockingClient
impl RefUnwindSafe for BlockingClient
impl Send for BlockingClient
impl Sync for BlockingClient
impl Unpin for BlockingClient
impl UnwindSafe for BlockingClient
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