///
/// `update` is a [`tx_graph::TxUpdate<A>`] and the resultant changes is returned as
/// [`ChangeSet`].
+ ///
+ /// **Note**: Transactions in the `update` without temporal context (anchors or seen_ats)
+ /// will be stored but will not be considered canonical. See [`tx_graph::TxUpdate`] for
+ /// more details.
pub fn apply_update(&mut self, update: tx_graph::TxUpdate<A>) -> ChangeSet<A, I::ChangeSet> {
let tx_graph = self.graph.apply_update(update);
let indexer = self.index_tx_graph_changeset(&tx_graph);
///
/// The returned [`ChangeSet`] is the set difference between `update` and `self` (transactions
/// that exist in `update` but not in `self`).
+ ///
+ /// **Note**: Transactions in the `update` without temporal context (anchors or seen_ats)
+ /// will be stored but will not be considered canonical. See [`TxUpdate`] for more details.
pub fn apply_update(&mut self, update: TxUpdate<A>) -> ChangeSet<A> {
let mut changeset = ChangeSet::<A>::default();
for tx in update.txs {
/// tx_update.txs.push(tx);
/// tx_update.anchors.insert((anchor, txid));
/// ```
+/// ## Temporal context
+/// To contribute to a wallet's balance, transactions must have an entry in either:
+/// - [`Self::anchors`]: for confirmed transactions.
+/// - [`Self::seen_ats`]: for unconfirmed transactions.
+///
+/// The built-in chain-source crates (`bdk_electrum`, `bdk_esplora`, `bdk_bitcoind_rpc`) handle this
+/// automatically. Transactions lacking temporal context are stored but ignored by canonicalization.
#[derive(Debug, Clone)]
#[non_exhaustive]
pub struct TxUpdate<A = ()> {