pub struct ElectrumClient { /* private fields */ }Expand description
A client to issue TCP requests to an electrum server.
Implementations§
Source§impl ElectrumClient
impl ElectrumClient
Sourcepub fn new(
electrum_url: &str,
tls: bool,
validate_domain: bool,
) -> Result<Arc<Self>, LwkError>
pub fn new( electrum_url: &str, tls: bool, validate_domain: bool, ) -> Result<Arc<Self>, LwkError>
Construct an Electrum client
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 ElectrumClient
impl Debug for ElectrumClient
Source§impl<UT> LiftRef<UT> for ElectrumClient
impl<UT> LiftRef<UT> for ElectrumClient
type LiftType = Arc<ElectrumClient>
Source§impl<UT> LowerError<UT> for ElectrumClient
impl<UT> LowerError<UT> for ElectrumClient
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Source§impl<UT> LowerReturn<UT> for ElectrumClient
impl<UT> LowerReturn<UT> for ElectrumClient
Source§type ReturnType = <Arc<ElectrumClient> as LowerReturn<UniFfiTag>>::ReturnType
type ReturnType = <Arc<ElectrumClient> 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 ElectrumClient
impl<UT> TypeId<UT> for ElectrumClient
Auto Trait Implementations§
impl !Freeze for ElectrumClient
impl RefUnwindSafe for ElectrumClient
impl Send for ElectrumClient
impl Sync for ElectrumClient
impl Unpin for ElectrumClient
impl UnwindSafe for ElectrumClient
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