pub struct BreezSdk { /* private fields */ }
Expand description
BreezSDK
is a wrapper around SparkSDK
that provides a more structured API
with request/response objects and comprehensive error handling.
Implementations§
Source§impl BreezSdk
impl BreezSdk
Sourcepub fn add_event_listener(&self, listener: Box<dyn EventListener>) -> String
pub fn add_event_listener(&self, listener: Box<dyn EventListener>) -> String
Sourcepub fn remove_event_listener(&self, id: &str) -> bool
pub fn remove_event_listener(&self, id: &str) -> bool
Sourcepub fn disconnect(&self) -> Result<(), SdkError>
pub fn disconnect(&self) -> Result<(), SdkError>
Stops the SDK’s background tasks
This method stops the background tasks started by the start()
method.
It should be called before your application terminates to ensure proper cleanup.
§Returns
Result containing either success or an SdkError
if the background task couldn’t be stopped
Sourcepub async fn get_info(
&self,
request: GetInfoRequest,
) -> Result<GetInfoResponse, SdkError>
pub async fn get_info( &self, request: GetInfoRequest, ) -> Result<GetInfoResponse, SdkError>
Returns the balance of the wallet in satoshis
pub async fn receive_payment( &self, request: ReceivePaymentRequest, ) -> Result<ReceivePaymentResponse, SdkError>
pub async fn prepare_lnurl_pay( &self, request: PrepareLnurlPayRequest, ) -> Result<PrepareLnurlPayResponse, SdkError>
pub async fn lnurl_pay( &self, request: LnurlPayRequest, ) -> Result<LnurlPayResponse, SdkError>
pub async fn prepare_send_payment( &self, request: PrepareSendPaymentRequest, ) -> Result<PrepareSendPaymentResponse, SdkError>
pub async fn send_payment( &self, request: SendPaymentRequest, ) -> Result<SendPaymentResponse, SdkError>
Sourcepub fn sync_wallet(
&self,
request: SyncWalletRequest,
) -> Result<SyncWalletResponse, SdkError>
pub fn sync_wallet( &self, request: SyncWalletRequest, ) -> Result<SyncWalletResponse, SdkError>
Synchronizes the wallet with the Spark network
Sourcepub async fn list_payments(
&self,
request: ListPaymentsRequest,
) -> Result<ListPaymentsResponse, SdkError>
pub async fn list_payments( &self, request: ListPaymentsRequest, ) -> Result<ListPaymentsResponse, SdkError>
Lists payments from the storage with pagination
This method provides direct access to the payment history stored in the database. It returns payments in reverse chronological order (newest first).
§Arguments
request
- Contains pagination parameters (offset and limit)
§Returns
Ok(ListPaymentsResponse)
- Contains the list of payments if successfulErr(SdkError)
- If there was an error accessing the storage
pub async fn get_payment( &self, request: GetPaymentRequest, ) -> Result<GetPaymentResponse, SdkError>
pub async fn claim_deposit( &self, request: ClaimDepositRequest, ) -> Result<ClaimDepositResponse, SdkError>
pub async fn refund_deposit( &self, request: RefundDepositRequest, ) -> Result<RefundDepositResponse, SdkError>
pub async fn list_unclaimed_deposits( &self, request: ListUnclaimedDepositsRequest, ) -> Result<ListUnclaimedDepositsResponse, SdkError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BreezSdk
impl !RefUnwindSafe for BreezSdk
impl Send for BreezSdk
impl Sync for BreezSdk
impl Unpin for BreezSdk
impl !UnwindSafe for BreezSdk
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Wrap the input message
T
in a tonic::Request