pub struct EsploraClient { /* private fields */ }Expand description
A blockchain backend implementation based on the esplora HTTP API But can also use the waterfalls endpoint to speed up the scan if supported by the server.
Implementations§
Source§impl EsploraClient
impl EsploraClient
Sourcepub fn new(url: &str, network: &Network) -> Result<Arc<Self>, LwkError>
pub fn new(url: &str, network: &Network) -> Result<Arc<Self>, LwkError>
Construct an Esplora Client
Sourcepub fn new_waterfalls(
url: &str,
network: &Network,
) -> Result<Arc<Self>, LwkError>
pub fn new_waterfalls( url: &str, network: &Network, ) -> Result<Arc<Self>, LwkError>
Construct an Esplora Client using Waterfalls endpoint
Sourcepub fn from_builder(
builder: EsploraClientBuilder,
) -> Result<Arc<Self>, LwkError>
pub fn from_builder( builder: EsploraClientBuilder, ) -> Result<Arc<Self>, LwkError>
Construct an Esplora Client from an EsploraClientBuilder
Sourcepub fn broadcast(&self, tx: &Transaction) -> Result<Arc<Txid>, LwkError>
pub fn broadcast(&self, tx: &Transaction) -> Result<Arc<Txid>, LwkError>
Broadcast a transaction to the network so that a miner can include it in a block.
Sourcepub fn full_scan(
&self,
wollet: &Wollet,
) -> Result<Option<Arc<Update>>, LwkError>
pub fn full_scan( &self, wollet: &Wollet, ) -> Result<Option<Arc<Update>>, LwkError>
Scan the blockchain for the scripts generated by a watch-only wallet
This method scans both external and internal address chains, stopping after finding 20 consecutive unused addresses (the gap limit) as recommended by BIP44.
Returns Some(Update) if any changes were found during scanning, or None if no changes
were detected.
To scan beyond the gap limit use full_scan_to_index() instead.
Sourcepub fn full_scan_to_index(
&self,
wollet: &Wollet,
index: u32,
) -> Result<Option<Arc<Update>>, LwkError>
pub fn full_scan_to_index( &self, wollet: &Wollet, index: u32, ) -> Result<Option<Arc<Update>>, LwkError>
Scan the blockchain for the scripts generated by a watch-only wallet up to a specified derivation index
While full_scan() stops after finding 20 consecutive unused addresses (the gap limit),
this method will scan at least up to the given derivation index. This is useful to prevent
missing funds in cases where outputs exist beyond the gap limit.
Will scan both external and internal address chains up to the given index for maximum safety, even though internal addresses may not need such deep scanning.
If transactions are found beyond the gap limit during this scan, subsequent calls to
full_scan() will automatically scan up to the highest used index, preventing any
previously-found transactions from being missed.
Trait Implementations§
Source§impl Debug for EsploraClient
impl Debug for EsploraClient
Source§impl<UT> LiftRef<UT> for EsploraClient
impl<UT> LiftRef<UT> for EsploraClient
type LiftType = Arc<EsploraClient>
Source§impl<UT> LowerError<UT> for EsploraClient
impl<UT> LowerError<UT> for EsploraClient
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Source§impl<UT> LowerReturn<UT> for EsploraClient
impl<UT> LowerReturn<UT> for EsploraClient
Source§type ReturnType = <Arc<EsploraClient> as LowerReturn<UniFfiTag>>::ReturnType
type ReturnType = <Arc<EsploraClient> as LowerReturn<UniFfiTag>>::ReturnType
Source§fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
Source§fn handle_failed_lift(
error: LiftArgsError,
) -> Result<Self::ReturnType, RustCallError>
fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>
Source§impl<UT> TypeId<UT> for EsploraClient
impl<UT> TypeId<UT> for EsploraClient
Auto Trait Implementations§
impl !Freeze for EsploraClient
impl RefUnwindSafe for EsploraClient
impl Send for EsploraClient
impl Sync for EsploraClient
impl Unpin for EsploraClient
impl UnwindSafe for EsploraClient
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, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for 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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more