Struct electrum_client::client::Client [−][src]
pub struct Client { /* fields omitted */ }Expand description
Generalized Electrum client that supports multiple backends. Can re-instantiate client_type if connections drops
Implementations
Default constructor supporting multiple backends by providing a prefix
Supported prefixes are:
- tcp:// for a TCP plaintext client.
- ssl:// for an SSL-encrypted client. The server certificate will be verified.
If no prefix is specified, then tcp:// is assumed.
See Client::from_config for more configuration options
Trait Implementations
Subscribes to notifications for new block headers, by sending a blockchain.headers.subscribe call and
returns the current tip as raw bytes instead of deserializing them. Read more
Tries to pop one queued notification for a new block header that we might have received. Returns a the header in raw bytes if a notification is found in the queue, None otherwise. Read more
Gets the raw bytes of block header for height height.
Tries to fetch count block headers starting from start_height.
Estimates the fee required in Satoshis per kilobyte to confirm a transaction in number blocks.
Returns the minimum accepted fee by the server’s node in Bitcoin, not Satoshi.
Subscribes to notifications for activity on a specific scriptPubKey. Read more
Subscribes to notifications for activity on a specific scriptPubKey. Read more
Tries to pop one queued notification for a the requested script. Returns None if there are no items in the queue.
Returns the balance for a scriptPubKey.
fn batch_script_get_balance<'s, I>(
&self,
scripts: I
) -> Result<Vec<GetBalanceRes>, Error> where
I: IntoIterator<Item = &'s Script> + Clone,
fn batch_script_get_balance<'s, I>(
&self,
scripts: I
) -> Result<Vec<GetBalanceRes>, Error> where
I: IntoIterator<Item = &'s Script> + Clone,
Batch version of script_get_balance. Read more
Returns the history for a scriptPubKey
fn batch_script_get_history<'s, I>(
&self,
scripts: I
) -> Result<Vec<Vec<GetHistoryRes>>, Error> where
I: IntoIterator<Item = &'s Script> + Clone,
fn batch_script_get_history<'s, I>(
&self,
scripts: I
) -> Result<Vec<Vec<GetHistoryRes>>, Error> where
I: IntoIterator<Item = &'s Script> + Clone,
Batch version of script_get_history. Read more
Returns the list of unspent outputs for a scriptPubKey
fn batch_script_list_unspent<'s, I>(
&self,
scripts: I
) -> Result<Vec<Vec<ListUnspentRes>>, Error> where
I: IntoIterator<Item = &'s Script> + Clone,
fn batch_script_list_unspent<'s, I>(
&self,
scripts: I
) -> Result<Vec<Vec<ListUnspentRes>>, Error> where
I: IntoIterator<Item = &'s Script> + Clone,
Batch version of script_list_unspent. Read more
Gets the raw bytes of a transaction with txid. Returns an error if not found.
fn batch_transaction_get_raw<'t, I>(
&self,
txids: I
) -> Result<Vec<Vec<u8>>, Error> where
I: IntoIterator<Item = &'t Txid> + Clone,
fn batch_transaction_get_raw<'t, I>(
&self,
txids: I
) -> Result<Vec<Vec<u8>>, Error> where
I: IntoIterator<Item = &'t Txid> + Clone,
Batch version of transaction_get_raw. Read more
fn batch_block_header_raw<'s, I>(
&self,
heights: I
) -> Result<Vec<Vec<u8>>, Error> where
I: IntoIterator<Item = u32> + Clone,
fn batch_block_header_raw<'s, I>(
&self,
heights: I
) -> Result<Vec<Vec<u8>>, Error> where
I: IntoIterator<Item = u32> + Clone,
Batch version of block_header_raw. Read more
fn batch_estimate_fee<'s, I>(&self, numbers: I) -> Result<Vec<f64>, Error> where
I: IntoIterator<Item = usize> + Clone,
fn batch_estimate_fee<'s, I>(&self, numbers: I) -> Result<Vec<f64>, Error> where
I: IntoIterator<Item = usize> + Clone,
Batch version of estimate_fee. Read more
Broadcasts the raw bytes of a transaction to the network.
Returns the merkle path for the transaction txid confirmed in the block at height.
Returns the capabilities of the server.
Pings the server. This method can also be used as a “dummy” call to trigger the processing of incoming block header or script notifications. Read more
Gets the block header for height height.
Subscribes to notifications for new block headers, by sending a blockchain.headers.subscribe call.
Tries to pop one queued notification for a new block header that we might have received.
Returns None if there are no items in the queue. Read more
Gets the transaction with txid. Returns an error if not found.
fn batch_transaction_get<'t, I>(
&self,
txids: I
) -> Result<Vec<Transaction>, Error> where
I: IntoIterator<Item = &'t Txid> + Clone,
fn batch_transaction_get<'t, I>(
&self,
txids: I
) -> Result<Vec<Transaction>, Error> where
I: IntoIterator<Item = &'t Txid> + Clone,
Batch version of transaction_get. Read more
fn batch_block_header<I>(&self, heights: I) -> Result<Vec<BlockHeader>, Error> where
I: IntoIterator<Item = u32> + Clone,
fn batch_block_header<I>(&self, heights: I) -> Result<Vec<BlockHeader>, Error> where
I: IntoIterator<Item = u32> + Clone,
Batch version of block_header. Read more
Broadcasts a transaction to the network.