Expand description
§BDK Esplora
BDK Esplora extends esplora-client
(with extension traits: EsploraExt
and
EsploraAsyncExt
) to update bdk_chain
structures from an Esplora server.
The extension traits are primarily intended to satisfy SyncRequest
s with sync
and
FullScanRequest
s with full_scan
.
§Usage
For blocking-only:
bdk_esplora = { version = "0.19", features = ["blocking"] }
For async-only:
bdk_esplora = { version = "0.19", features = ["async"] }
For async-only (with https):
You can additionally specify to use either rustls or native-tls, e.g. async-https-native
, and this applies to both async and blocking features.
bdk_esplora = { version = "0.19", features = ["async-https"] }
For async-only (with tokio):
bdk_esplora = { version = "0.19", features = ["async", "tokio"] }
To use the extension traits:
// for blocking
#[cfg(feature = "blocking")]
use bdk_esplora::EsploraExt;
// for async
#[cfg(feature = "async")]
use bdk_esplora::EsploraAsyncExt;
For full examples, refer to example_wallet_esplora_blocking
and example_wallet_esplora_async
.
§Stop Gap
EsploraExt::full_scan
takes in a stop_gap
input which is defined as the maximum number of
consecutive unused script pubkeys to scan transactions for before stopping.
For example, with a stop_gap
of 3, full_scan
will keep scanning until it encounters 3
consecutive script pubkeys with no associated transactions.
This follows the same approach as other Bitcoin-related software, such as Electrum, BTCPay Server, and Sparrow.
A stop_gap
of 0 will be treated as a stop_gap
of 1.
§Async
Just like how EsploraExt
extends the functionality of an
esplora_client::BlockingClient
, EsploraAsyncExt
is the async version which extends
esplora_client::AsyncClient
.
Re-exports§
pub use esplora_client;
Traits§
- Trait to extend the functionality of
esplora_client::AsyncClient
. - Trait to extend the functionality of
esplora_client::BlockingClient
.