pub struct LNBitsClient { /* private fields */ }
Expand description
The LNBitsClient struct
Implementations§
Source§impl LNBitsClient
impl LNBitsClient
Sourcepub async fn create_invoice(
&self,
params: &CreateInvoiceRequest,
) -> Result<CreateInvoiceResponse>
pub async fn create_invoice( &self, params: &CreateInvoiceRequest, ) -> Result<CreateInvoiceResponse>
Create an invoice
Sourcepub async fn pay_invoice(
&self,
bolt11: &str,
_amount_sats: Option<u64>,
) -> Result<PayInvoiceResponse>
pub async fn pay_invoice( &self, bolt11: &str, _amount_sats: Option<u64>, ) -> Result<PayInvoiceResponse>
Pay an invoice
Sourcepub async fn decode_invoice(
&self,
invoice: &str,
) -> Result<DecodeInvoiceResponse>
pub async fn decode_invoice( &self, invoice: &str, ) -> Result<DecodeInvoiceResponse>
Decode invoice
Sourcepub async fn is_invoice_paid(&self, payment_hash: &str) -> Result<bool>
pub async fn is_invoice_paid(&self, payment_hash: &str) -> Result<bool>
Check if invoice paid
Source§impl LNBitsClient
impl LNBitsClient
Sourcepub async fn get_payment_info(&self, payment_hash: &str) -> Result<Payment>
pub async fn get_payment_info(&self, payment_hash: &str) -> Result<Payment>
Check if invoice paid
Source§impl LNBitsClient
impl LNBitsClient
Sourcepub async fn get_wallet_details(&self) -> Result<WalletDetails>
pub async fn get_wallet_details(&self) -> Result<WalletDetails>
Get wallet details
Source§impl LNBitsClient
impl LNBitsClient
Sourcepub async fn create_invoice_webhook_router(
&self,
webhook_endpoint: &str,
) -> Result<Router>
pub async fn create_invoice_webhook_router( &self, webhook_endpoint: &str, ) -> Result<Router>
Create invoice webhook
Source§impl LNBitsClient
impl LNBitsClient
Sourcepub async fn subscribe_to_websocket(&self) -> Result<()>
pub async fn subscribe_to_websocket(&self) -> Result<()>
Subscribe to websocket updates
Source§impl LNBitsClient
impl LNBitsClient
Sourcepub async fn make_get(
&self,
endpoint: LNBitsEndpoint,
key: LNBitsRequestKey,
) -> Result<String>
pub async fn make_get( &self, endpoint: LNBitsEndpoint, key: LNBitsRequestKey, ) -> Result<String>
Make get request
Sourcepub async fn make_post(
&self,
endpoint: LNBitsEndpoint,
key: LNBitsRequestKey,
body: &str,
) -> Result<String>
pub async fn make_post( &self, endpoint: LNBitsEndpoint, key: LNBitsRequestKey, body: &str, ) -> Result<String>
Make post request
Trait Implementations§
Source§impl Clone for LNBitsClient
impl Clone for LNBitsClient
Source§fn clone(&self) -> LNBitsClient
fn clone(&self) -> LNBitsClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for LNBitsClient
impl !RefUnwindSafe for LNBitsClient
impl Send for LNBitsClient
impl Sync for LNBitsClient
impl Unpin for LNBitsClient
impl !UnwindSafe for LNBitsClient
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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