Struct LxInvoice
pub struct LxInvoice(pub Bolt11Invoice);Expand description
Tuple Fields§
§0: Bolt11InvoiceImplementations§
§impl LxInvoice
impl LxInvoice
pub fn payment_hash(&self) -> LxPaymentHash
pub fn payment_hash(&self) -> LxPaymentHash
The invoice payment hash. The payer will receive the preimage to this hash upon successful payment, as proof-of-payment.
pub fn payment_secret(&self) -> LxPaymentSecret
pub fn payment_secret(&self) -> LxPaymentSecret
The invoice payment secret, used to authenticate the payer to the payee and tie MPP HTLCs together.
pub fn payment_id(&self) -> LxPaymentId
pub fn payment_id(&self) -> LxPaymentId
Lexe’s main identifier for this payment, which for BOLT11 invoice
payments is just the LxInvoice::payment_hash.
pub fn network(&self) -> Network
pub fn supports_network(&self, network: LxNetwork) -> bool
pub fn description_str(&self) -> Option<&str>
pub fn description_str(&self) -> Option<&str>
If the invoice contains a non-empty, inline description, then return that as a string. Otherwise return None.
pub fn description_hash(&self) -> Option<&[u8; 32]>
pub fn description_hash(&self) -> Option<&[u8; 32]>
If the invoice uses a description hash, return that. Otherwise return None.
pub fn amount(&self) -> Option<Amount>
pub fn amount(&self) -> Option<Amount>
Return the invoice’s requested amount, if present. An invoice may leave the final amount up to the payer, in which case this field will be None.
pub fn amount_sats(&self) -> Option<u64>
pub fn amount_sats(&self) -> Option<u64>
The invoice amount in satoshis, if included.
pub fn created_at(&self) -> Result<TimestampMs, Error>
pub fn created_at(&self) -> Result<TimestampMs, Error>
Get the invoice creation timestamp. Returns an error if the timestamp is several hundred million years in the future.
pub fn saturating_created_at(&self) -> TimestampMs
pub fn saturating_created_at(&self) -> TimestampMs
Get the invoice creation timestamp unconditionally.
pub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Returns true if the invoice has expired.
pub fn is_expired_at(&self, ts: TimestampMs) -> bool
pub fn is_expired_at(&self, ts: TimestampMs) -> bool
Returns true if the invoice expires before the given timestamp.
pub fn expires_at(&self) -> Result<TimestampMs, Error>
pub fn expires_at(&self) -> Result<TimestampMs, Error>
Get the invoice expiration timestamp. Returns an error if the timestamp is several hundred million years in the future.
pub fn saturating_expires_at(&self) -> TimestampMs
pub fn saturating_expires_at(&self) -> TimestampMs
Get the invoice expiration timestamp unconditionally.
pub fn payee_node_pk(&self) -> NodePk
pub fn payee_node_pk(&self) -> NodePk
Get the invoice payee’s NodePk.
If the pubkey is not included directly in the invoice, we have to
ecrecover the pubkey, which is somewhat more expensive (~20-40 us).
pub fn min_final_cltv_expiry_delta_u32(&self) -> Result<u32, Error>
pub fn min_final_cltv_expiry_delta_u32(&self) -> Result<u32, Error>
Returns the invoice’s min_final_cltv_expiry_delta time, if present,
otherwise [lightning_invoice::DEFAULT_MIN_FINAL_CLTV_EXPIRY_DELTA].
pub fn onchain_fallbacks(&self) -> Vec<Address>
pub fn onchain_fallbacks(&self) -> Vec<Address>
BOLT11 Invoices can attach optional onchain addresses for a payee to use if the lightning payment is not feasible. This fn returns those addresses.
pub fn matches_hrp_prefix(s: &str) -> bool
pub fn matches_hrp_prefix(s: &str) -> bool
Returns true if the input string starts with a valid bech32 hrp prefix
for a BOLT11 invoice.
Trait Implementations§
§impl<'de> Deserialize<'de> for LxInvoice
impl<'de> Deserialize<'de> for LxInvoice
§fn deserialize<__D>(
deserializer: __D,
) -> Result<LxInvoice, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
deserializer: __D,
) -> Result<LxInvoice, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl Serialize for LxInvoice
impl Serialize for LxInvoice
§fn serialize<__S>(
&self,
serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Eq for LxInvoice
impl StructuralPartialEq for LxInvoice
Auto Trait Implementations§
impl Freeze for LxInvoice
impl RefUnwindSafe for LxInvoice
impl Send for LxInvoice
impl Sync for LxInvoice
impl Unpin for LxInvoice
impl UnwindSafe for LxInvoice
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§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>
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.