From 16c1c2cf012c3a2d197aa845218df3d1aebad435 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BF=97=E5=AE=87?= Date: Sun, 21 Jul 2024 13:51:00 +0000 Subject: [PATCH] docs(esplora): Simplify crate docs --- crates/esplora/README.md | 17 ++++++++++++----- crates/esplora/src/lib.rs | 17 ----------------- 2 files changed, 12 insertions(+), 22 deletions(-) diff --git a/crates/esplora/README.md b/crates/esplora/README.md index 96d92c76c..d61b09aa6 100644 --- a/crates/esplora/README.md +++ b/crates/esplora/README.md @@ -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 @@ -26,7 +27,7 @@ To use the extension traits: ```rust // for blocking use bdk_esplora::EsploraExt; -// for async +// // for async // use bdk_esplora::EsploraAsyncExt; ``` @@ -34,3 +35,9 @@ For full examples, refer to [`example-crates/wallet_esplora_blocking`](https://g [`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 diff --git a/crates/esplora/src/lib.rs b/crates/esplora/src/lib.rs index 2c0e62b7e..9ce0c7be1 100644 --- a/crates/esplora/src/lib.rs +++ b/crates/esplora/src/lib.rs @@ -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