pub struct Lightning { /* private fields */ }
Implementations§
source§impl Lightning
impl Lightning
pub fn bolt11(&self) -> Arc<Bolt11>
pub fn lnurl(&self) -> Arc<Lnurl>
sourcepub fn determine_max_routing_fee_mode(
&self,
amount_sat: u64,
) -> MaxRoutingFeeMode
pub fn determine_max_routing_fee_mode( &self, amount_sat: u64, ) -> MaxRoutingFeeMode
Determine the max routing fee mode that will be employed to restrict the fees for paying a given amount in sats.
Requires network: no
sourcepub fn determine_payment_affordability(
&self,
amount_sat: u64,
) -> Result<PaymentAffordability>
pub fn determine_payment_affordability( &self, amount_sat: u64, ) -> Result<PaymentAffordability>
Checks if the given amount could be spent on a payment.
Parameters:
amount
- The to be spent amount.
Requires network: no
sourcepub fn determine_receive_amount_limits(&self) -> Result<ReceiveAmountLimits>
pub fn determine_receive_amount_limits(&self) -> Result<ReceiveAmountLimits>
Get the current limits for the amount that can be transferred in a single payment. Currently there are only limits for receiving payments. The limits (partly) depend on the channel situation of the node, so it should be called again every time the user is about to receive a payment. The limits stay the same regardless of what amount wants to receive (= no changes while he’s typing the amount)
Requires network: no
sourcepub fn calculate_lsp_fee_for_amount(
&self,
amount_sat: u64,
) -> Result<CalculateLspFeeResponseV2>
pub fn calculate_lsp_fee_for_amount( &self, amount_sat: u64, ) -> Result<CalculateLspFeeResponseV2>
Calculate the actual LSP fee for the given amount of an incoming payment. If the already existing inbound capacity is enough, no new channel is required.
Parameters:
amount_sat
- amount in sats to compute LSP fee for
For the returned fees to be guaranteed to be accurate, the returned lsp_fee_params
must be
provided to Bolt11::create
For swaps, use Swap::calculate_lsp_fee_for_amount
instead,
which uses fee offer from the LSP that is valid for a longer time period
Requires network: yes
sourcepub fn get_lsp_fee(&self) -> Result<LspFee>
pub fn get_lsp_fee(&self) -> Result<LspFee>
When receiving payments, a new channel MAY be required. A fee will be charged to the user. This does NOT impact sending payments. Get information about the fee charged by the LSP for opening new channels
Requires network: no
Auto Trait Implementations§
impl Freeze for Lightning
impl !RefUnwindSafe for Lightning
impl Send for Lightning
impl Sync for Lightning
impl Unpin for Lightning
impl !UnwindSafe for Lightning
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
§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
§impl<T> Downcast for Twhere
T: AsAny + ?Sized,
impl<T> Downcast for Twhere
T: AsAny + ?Sized,
§fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
Any
.§fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
Any
.§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Arc<>
Read more§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> 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 moresource§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