Skip to main content

silent_payments_scan/
lib.rs

1//! # silent-payments-scan
2//!
3//! Pluggable scanning backends for
4//! [BIP 352](https://github.com/bitcoin/bips/blob/master/bip-0352.mediawiki) Silent Payments.
5//!
6//! This crate defines the [`ScanBackend`] trait that all scanning backends
7//! implement, allowing wallet developers to swap infrastructure (Electrum,
8//! Esplora, BIP0352 index server) without changing application code.
9//!
10//! # Feature Flags
11//!
12//! - `electrum` -- Enables `ElectrumBackend` for scanning via Electrum servers
13//! - `index-server` -- Enables `IndexServerBackend` for scanning via BIP0352 index servers
14//!
15//! # Architecture
16//!
17//! The trait is intentionally synchronous (no async runtime). Backends handle
18//! all data fetching internally -- callers provide keys, height range, and
19//! callbacks. Connection errors bubble up immediately; the caller owns retry
20//! policy.
21
22pub mod backend;
23pub mod error;
24
25#[cfg(feature = "electrum")]
26pub mod electrum;
27
28#[cfg(feature = "index-server")]
29pub mod index_server;
30
31pub use backend::{OnMatch, OnProgress, ScanBackend};
32pub use error::ScanError;
33
34#[cfg(feature = "electrum")]
35pub use electrum::ElectrumBackend;
36
37#[cfg(feature = "index-server")]
38pub use index_server::IndexServerBackend;