2023-03-01 11:20:00 +01:00
|
|
|
//! This crate is used for updating structures of the [`bdk_chain`] crate with data from electrum.
|
|
|
|
//!
|
|
|
|
//! The star of the show is the [`ElectrumExt::scan`] method, which scans for relevant blockchain
|
2023-08-26 20:29:46 +08:00
|
|
|
//! data (via electrum) and outputs updates for [`bdk_chain`] structures as a tuple of form:
|
2023-03-01 11:20:00 +01:00
|
|
|
//!
|
2023-08-26 20:29:46 +08:00
|
|
|
//! ([`bdk_chain::local_chain::Update`], [`IncompleteTxGraph`], `keychain_update`)
|
|
|
|
//!
|
|
|
|
//! An [`IncompleteTxGraph`] only includes `txid`s and no full transactions. The caller is
|
|
|
|
//! responsible for obtaining full transactions before applying. This can be done with
|
2023-03-01 11:20:00 +01:00
|
|
|
//! these steps:
|
|
|
|
//!
|
|
|
|
//! 1. Determine which full transactions are missing. The method [`missing_full_txs`] of
|
2023-08-26 20:29:46 +08:00
|
|
|
//! [`IncompleteTxGraph`] can be used.
|
2023-03-01 11:20:00 +01:00
|
|
|
//!
|
|
|
|
//! 2. Obtaining the full transactions. To do this via electrum, the method
|
|
|
|
//! [`batch_transaction_get`] can be used.
|
|
|
|
//!
|
|
|
|
//! Refer to [`bdk_electrum_example`] for a complete example.
|
|
|
|
//!
|
2023-07-19 17:42:52 +08:00
|
|
|
//! [`ElectrumClient::scan`]: electrum_client::ElectrumClient::scan
|
2023-08-26 20:29:46 +08:00
|
|
|
//! [`missing_full_txs`]: IncompleteTxGraph::missing_full_txs
|
2023-07-19 17:42:52 +08:00
|
|
|
//! [`batch_transaction_get`]: electrum_client::ElectrumApi::batch_transaction_get
|
2023-03-01 11:20:00 +01:00
|
|
|
//! [`bdk_electrum_example`]: https://github.com/LLFourn/bdk_core_staging/tree/master/bdk_electrum_example
|
|
|
|
|
2023-07-19 17:42:52 +08:00
|
|
|
#![warn(missing_docs)]
|
|
|
|
|
2023-05-24 11:37:26 +08:00
|
|
|
mod electrum_ext;
|
2023-05-12 00:08:16 +08:00
|
|
|
pub use bdk_chain;
|
|
|
|
pub use electrum_client;
|
2023-05-24 11:37:26 +08:00
|
|
|
pub use electrum_ext::*;
|