Skip to content

Commit

Permalink
docs(esplora): Simplify crate docs
Browse files Browse the repository at this point in the history
  • Loading branch information
evanlinjin committed Aug 14, 2024
1 parent c93e6fd commit 16c1c2c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 22 deletions.
17 changes: 12 additions & 5 deletions crates/esplora/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# BDK Esplora

BDK Esplora extends [`esplora-client`] to update [`bdk_chain`] structures
from an Esplora server.
BDK Esplora extends [`esplora-client`] (with extension traits: [`EsploraExt`] and
[`EsploraAsyncExt`]) to update [`bdk_chain`] structures from an Esplora server.

## Usage
The extension traits are primarily intended to satisfy [`SyncRequest`]s with [`sync`] and
[`FullScanRequest`]s with [`full_scan`].

There are two versions of the extension trait (blocking and async).
## Usage

For blocking-only:
```toml
Expand All @@ -26,11 +27,17 @@ To use the extension traits:
```rust
// for blocking
use bdk_esplora::EsploraExt;
// for async
// // for async
// use bdk_esplora::EsploraAsyncExt;
```

For full examples, refer to [`example-crates/wallet_esplora_blocking`](https://github.com/bitcoindevkit/bdk/tree/master/example-crates/wallet_esplora_blocking) and [`example-crates/wallet_esplora_async`](https://github.com/bitcoindevkit/bdk/tree/master/example-crates/wallet_esplora_async).

[`esplora-client`]: https://docs.rs/esplora-client/
[`bdk_chain`]: https://docs.rs/bdk-chain/
[`EsploraExt`]: crate::EsploraExt
[`EsploraAsyncExt`]: crate::EsploraAsyncExt
[`SyncRequest`]: bdk_chain::spk_client::SyncRequest
[`FullScanRequest`]: bdk_chain::spk_client::FullScanRequest
[`sync`]: crate::EsploraExt::sync
[`full_scan`]: crate::EsploraExt::full_scan
17 changes: 0 additions & 17 deletions crates/esplora/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,21 +1,4 @@
#![doc = include_str!("../README.md")]

//! # Primary Methods
//!
//! The two primary methods are [`EsploraExt::sync`] and [`EsploraExt::full_scan`].
//!
//! [`EsploraExt::sync`] is used to sync against a subset of wallet data. For example, transaction
//! histories of revealed and unused script from the external (public) keychain and/or statuses of
//! wallet-owned UTXOs and spending transactions from them. The policy of what to sync against can
//! be customized.
//!
//! [`EsploraExt::full_scan`] is designed to be used when importing or restoring a keychain where
//! the range of possibly used scripts is not known. In this case it is necessary to scan all
//! keychain scripts until a number (the `stop_gap`) of unused scripts is discovered.
//!
//! For a sync or full scan, the user receives relevant blockchain data and output updates for
//! [`bdk_chain`] .
//!
//! # Low-Level Methods
//!
//! [`EsploraExt::sync`] and [`EsploraExt::full_scan`] returns updates which are *complete* and can
Expand Down

0 comments on commit 16c1c2c

Please sign in to comment.