Expand description
An extensible blocking/async Esplora client
This library provides an extensible blocking and async Esplora client to query Esplora’s backend.
The library provides the possibility to build a blocking
client using minreq
and an async client using reqwest
.
The library supports communicating to Esplora via a proxy
and also using TLS (SSL) for secure communication.
§Usage
You can create a blocking client as follows:
use esplora_client::Builder;
let builder = Builder::new("https://blockstream.info/testnet/api");
let blocking_client = builder.build_blocking();
Here is an example of how to create an asynchronous client.
use esplora_client::Builder;
let builder = Builder::new("https://blockstream.info/testnet/api");
let async_client = builder.build_async();
§Features
By default the library enables all features. To specify
specific features, set default-features
to false
in your Cargo.toml
and specify the features you want. This will look like this:
esplora-client = { version = "*", default-features = false, features = ["blocking"] }
blocking
enablesminreq
, the blocking client with proxy.blocking-https
enablesminreq
, the blocking client with proxy and TLS (SSL) capabilities using the defaultminreq
backend.blocking-https-rustls
enablesminreq
, the blocking client with proxy and TLS (SSL) capabilities using therustls
backend.blocking-https-native
enablesminreq
, the blocking client with proxy and TLS (SSL) capabilities using the platform’s native TLS backend (likely OpenSSL).blocking-https-bundled
enablesminreq
, the blocking client with proxy and TLS (SSL) capabilities using a bundled OpenSSL library backend.async
enablesreqwest
, the async client with proxy capabilities.async-https
enablesreqwest
, the async client with support for proxying and TLS (SSL) using the defaultreqwest
TLS backend.async-https-native
enablesreqwest
, the async client with support for proxying and TLS (SSL) using the platform’s native TLS backend (likely OpenSSL).async-https-rustls
enablesreqwest
, the async client with support for proxying and TLS (SSL) using therustls
TLS backend.async-https-rustls-manual-roots
enablesreqwest
, the async client with support for proxying and TLS (SSL) using therustls
TLS backend without using its the default root certificates.
Re-exports§
pub use async::Sleeper;
pub use blocking::BlockingClient;
pub use async::AsyncClient;
pub use api::*;
Modules§
- Structs from the Esplora API
- Esplora by way of
reqwest
HTTP client. - Esplora by way of
minreq
HTTP client.
Structs§
Enums§
- Errors that can happen during a request to
Esplora
servers.
Functions§
- Get a fee value in sats/vbytes from the estimates that matches the confirmation target set as parameter.