pub struct WatchSetBuilder { /* private fields */ }Expand description
The canonical watch-set declared by a watch_set_loader on every
(re)connect. It is a thin recording facade over a fresh [WatchSetMirror]:
each add_* / set_categories call records interest
the way the matching ResilientWatch method would, so the populated set
renders to exactly the same control messages a manual replay would. The
wrapper adopts the builder’s set as the mirror once the loader returns, then
re-registers it and re-anchors as usual.
Only declarative add_* methods are exposed (no remove_*): the loader
builds a complete set from the integrator’s source-of-truth into an empty
mirror, where a removal has nothing to act on. Methods are synchronous —
they only record — so a loader does its own awaiting against its truth
(DB, config, upstream service) between calls.
Implementations§
Source§impl WatchSetBuilder
impl WatchSetBuilder
Sourcepub fn add_scripts(
&self,
items: impl IntoIterator<Item = ([u8; 32], Option<u64>)>,
)
pub fn add_scripts( &self, items: impl IntoIterator<Item = ([u8; 32], Option<u64>)>, )
Declare scripthashes (each sha256(scriptPubKey)) with an optional
per-script min_value floor. See ResilientWatch::add_scripts.
Sourcepub fn add_outpoints(
&self,
outpoints: impl IntoIterator<Item = ([u8; 32], u32)>,
)
pub fn add_outpoints( &self, outpoints: impl IntoIterator<Item = ([u8; 32], u32)>, )
Declare outpoints (txid:vout). See ResilientWatch::add_outpoints.
Sourcepub fn add_tx_lifecycle(
&self,
txids: impl IntoIterator<Item = [u8; 32]>,
auto_close: AutoClose,
)
pub fn add_tx_lifecycle( &self, txids: impl IntoIterator<Item = [u8; 32]>, auto_close: AutoClose, )
Declare lifecycle watches on txids. See ResilientWatch::add_tx_lifecycle.
Sourcepub fn add_depth_alarms(
&self,
txids: impl IntoIterator<Item = [u8; 32]>,
depths: impl IntoIterator<Item = u32>,
)
pub fn add_depth_alarms( &self, txids: impl IntoIterator<Item = [u8; 32]>, depths: impl IntoIterator<Item = u32>, )
Arm single-shot depth alarms over the cross product of txids and
depths (depths < 1 dropped). See ResilientWatch::add_depth_alarms.
Sourcepub fn add_descriptor(
&self,
descriptor: impl Into<String>,
gap_limit: u32,
start: u32,
)
pub fn add_descriptor( &self, descriptor: impl Into<String>, gap_limit: u32, start: u32, )
Declare a public output descriptor’s (gap_limit, start) watch window.
See ResilientWatch::add_descriptor.
Sourcepub fn add_script_prefixes(
&self,
prefixes: impl IntoIterator<Item = (Vec<u8>, u32)>,
) -> Result<(), StreamError>
pub fn add_script_prefixes( &self, prefixes: impl IntoIterator<Item = (Vec<u8>, u32)>, ) -> Result<(), StreamError>
Declare script-prefix buckets (validated client-side, same as the live
path). An invalid (prefix, bits) aborts the load with
StreamError::InvalidArgument, which the loader propagates as a
(retryable) loader failure. See ResilientWatch::add_script_prefixes.
Sourcepub fn add_silent_payments(
&self,
targets: impl IntoIterator<Item = SilentPaymentTarget>,
) -> Result<(), StreamError>
Available on crate feature bitcoin only.
pub fn add_silent_payments( &self, targets: impl IntoIterator<Item = SilentPaymentTarget>, ) -> Result<(), StreamError>
bitcoin only.Declare BIP 352 scan-key watch targets. Each target’s identity b_scan·G
is derived once (hence the bitcoin feature and the fallible return) and
recorded so it re-registers on every reconnect — the D3 custody model.
See ResilientWatch::add_silent_payments.
Sourcepub fn set_categories(&self, categories: u32)
pub fn set_categories(&self, categories: u32)
Declare the live category filter. See ResilientWatch::set_categories.
Sourcepub fn set_watch_options(&self, include_raw_tx: bool)
pub fn set_watch_options(&self, include_raw_tx: bool)
Declare the raw-tx opt-in. See
ResilientWatch::set_watch_options. A loader that wants
raw_tx on ScriptMatched must re-declare this each rebuild, exactly like
set_categories — the loader is canonical.
Auto Trait Implementations§
impl Freeze for WatchSetBuilder
impl RefUnwindSafe for WatchSetBuilder
impl Send for WatchSetBuilder
impl Sync for WatchSetBuilder
impl Unpin for WatchSetBuilder
impl UnsafeUnpin for WatchSetBuilder
impl UnwindSafe for WatchSetBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request