pub struct RawClient<S> where
    S: Read + Write
{ /* private fields */ }
Expand description

Instance of an Electrum client

A Client maintains a constant connection with an Electrum server and exposes methods to interact with it. It can also subscribe and receive notifictations from the server about new blocks or activity on a specific scriptPubKey.

The Client is modeled in such a way that allows the external caller to have full control over its functionality: no threads or tasks are spawned internally to monitor the state of the connection.

More transport methods can be used by manually creating an instance of this struct with an arbitray S type.

Implementations

Creates a new plaintext client and tries to connect to socket_addr.

Creates a new SSL client and tries to connect to socket_addr. Optionally, if validate_domain is true, validate the server’s certificate.

Create a new SSL client using an existing TcpStream

Creates a new socks client and tries to connect to target_addr using proxy_addr as a socks proxy server. The DNS resolution of target_addr, if required, is done through the proxy. This allows to specify, for instance, .onion addresses.

Creates a new TLS client that connects to target_addr using proxy_addr as a socks proxy server. The DNS resolution of target_addr, if required, is done through the proxy. This allows to specify, for instance, .onion addresses.

Trait Implementations

Formats the value using the given formatter. Read more

Executes the requested API call returning the raw answer.

Execute a queue of calls stored in a Batch struct. Returns Ok() only if all of the calls are successful. The order of the JSON Values returned reflects the order in which the calls were made on the Batch struct. Read more

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 Bitcoin 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.

Batch version of script_get_balance. Read more

Returns the history for a scriptPubKey

Batch version of script_get_history. Read more

Returns the list of unspent outputs for a scriptPubKey

Batch version of script_list_unspent. Read more

Gets the raw bytes of a transaction with txid. Returns an error if not found.

Batch version of transaction_get_raw. Read more

Batch version of block_header_raw. Read more

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.

Batch version of transaction_get. Read more

Batch version of block_header. Read more

Broadcasts a transaction to the network.

Converts to this type from the input type.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Converts to this type from the input type.

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.