pub struct StaticInvoice { /* private fields */ }Expand description
A StaticInvoice is a reusable payment request corresponding to an Offer.
A static invoice may be sent in response to an InvoiceRequest and includes all the
information needed to pay the recipient. However, unlike Bolt12Invoices, static invoices do
not provide proof-of-payment. Therefore, Bolt12Invoices should be preferred when the
recipient is online to provide one.
Implementations§
Source§impl StaticInvoice
impl StaticInvoice
Sourcepub fn payment_paths(&self) -> &[BlindedPaymentPath]
pub fn payment_paths(&self) -> &[BlindedPaymentPath]
Paths to the recipient originating from publicly reachable nodes, including information needed for routing payments across them.
Blinded paths provide recipient privacy by obfuscating its node id. Note, however, that this
privacy is lost if a public node id is used for
StaticInvoice::signing_pubkey.
Sourcepub fn created_at(&self) -> Duration
pub fn created_at(&self) -> Duration
Duration since the Unix epoch when the invoice was created.
Sourcepub fn relative_expiry(&self) -> Duration
pub fn relative_expiry(&self) -> Duration
Duration since
StaticInvoice::created_at
when the invoice has expired and therefore should no longer be paid.
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Whether the invoice has expired.
Sourcepub fn is_expired_no_std(&self, duration_since_epoch: Duration) -> bool
pub fn is_expired_no_std(&self, duration_since_epoch: Duration) -> bool
Whether the invoice has expired given the current time as duration since the Unix epoch.
Sourcepub fn fallbacks(&self) -> Vec<Address>
pub fn fallbacks(&self) -> Vec<Address>
Fallback addresses for paying the invoice on-chain, in order of most-preferred to least-preferred.
Sourcepub fn invoice_features(&self) -> &Bolt12InvoiceFeatures
pub fn invoice_features(&self) -> &Bolt12InvoiceFeatures
Features pertaining to paying an invoice.
Sourcepub fn signing_pubkey(&self) -> PublicKey
pub fn signing_pubkey(&self) -> PublicKey
The public key corresponding to the key used to sign the invoice.
This will be:
Offer::issuer_signing_pubkeyif it’sSome, otherwise- the final blinded node id from a
BlindedMessagePathinOffer::pathsifNone.
Sourcepub fn chain(&self) -> ChainHash
pub fn chain(&self) -> ChainHash
The chain that must be used when paying the invoice. StaticInvoices currently can only be
created from offers that support a single chain.
Sourcepub fn metadata(&self) -> Option<&Vec<u8>>
pub fn metadata(&self) -> Option<&Vec<u8>>
Opaque bytes set by the originating Offer::metadata.
Sourcepub fn amount(&self) -> Option<Amount>
pub fn amount(&self) -> Option<Amount>
The minimum amount required for a successful payment of a single item.
From Offer::amount.
Sourcepub fn offer_features(&self) -> &OfferFeatures
pub fn offer_features(&self) -> &OfferFeatures
Features pertaining to the originating Offer, from Offer::offer_features.
Sourcepub fn description(&self) -> Option<PrintableString<'_>>
pub fn description(&self) -> Option<PrintableString<'_>>
A complete description of the purpose of the originating offer, from Offer::description.
Sourcepub fn absolute_expiry(&self) -> Option<Duration>
pub fn absolute_expiry(&self) -> Option<Duration>
Duration since the Unix epoch when an invoice should no longer be requested, from
Offer::absolute_expiry.
Sourcepub fn issuer(&self) -> Option<PrintableString<'_>>
pub fn issuer(&self) -> Option<PrintableString<'_>>
The issuer of the offer, from Offer::issuer.
Sourcepub fn offer_message_paths(&self) -> &[BlindedMessagePath]
pub fn offer_message_paths(&self) -> &[BlindedMessagePath]
Paths to the node that may supply the invoice on the recipient’s behalf, originating from
publicly reachable nodes. Taken from Offer::paths.
Sourcepub fn message_paths(&self) -> &[BlindedMessagePath]
pub fn message_paths(&self) -> &[BlindedMessagePath]
Paths to the recipient for indicating that a held HTLC is available to claim when they next come online.
Sourcepub fn supported_quantity(&self) -> Quantity
pub fn supported_quantity(&self) -> Quantity
The quantity of items supported, from Offer::supported_quantity.
Sourcepub fn issuer_signing_pubkey(&self) -> Option<PublicKey>
pub fn issuer_signing_pubkey(&self) -> Option<PublicKey>
The public key used by the recipient to sign invoices, from
Offer::issuer_signing_pubkey.
Sourcepub fn signature(&self) -> Signature
pub fn signature(&self) -> Signature
Signature of the invoice verified using StaticInvoice::signing_pubkey.
Sourcepub fn is_offer_expired(&self) -> bool
pub fn is_offer_expired(&self) -> bool
Whether the Offer that this invoice is based on is expired.
Sourcepub fn is_offer_expired_no_std(&self, duration_since_epoch: Duration) -> bool
pub fn is_offer_expired_no_std(&self, duration_since_epoch: Duration) -> bool
Whether the Offer that this invoice is based on is expired, given the current time as
duration since the Unix epoch.
Trait Implementations§
Source§impl Clone for StaticInvoice
impl Clone for StaticInvoice
Source§fn clone(&self) -> StaticInvoice
fn clone(&self) -> StaticInvoice
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StaticInvoice
impl Debug for StaticInvoice
Source§impl Hash for StaticInvoice
impl Hash for StaticInvoice
Source§impl LengthReadable for StaticInvoice
impl LengthReadable for StaticInvoice
Source§fn read_from_fixed_length_buffer<R: LengthLimitedRead>(
r: &mut R,
) -> Result<Self, DecodeError>
fn read_from_fixed_length_buffer<R: LengthLimitedRead>( r: &mut R, ) -> Result<Self, DecodeError>
Self in from the given LengthLimitedRead.