pub struct UnsignedStaticInvoice { /* private fields */ }Expand description
A semantically valid StaticInvoice that hasn’t been signed.
Implementations§
Source§impl UnsignedStaticInvoice
impl UnsignedStaticInvoice
Sourcepub fn sign<F: SignStaticInvoiceFn>(
self,
sign: F,
) -> Result<StaticInvoice, SignError>
pub fn sign<F: SignStaticInvoiceFn>( self, sign: F, ) -> Result<StaticInvoice, SignError>
Signs the TaggedHash of the invoice using the given function.
Note: The hash computation may have included unknown, odd TLV records.
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
UnsignedStaticInvoice::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
UnsignedStaticInvoice::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.
Trait Implementations§
Source§impl AsRef<TaggedHash> for UnsignedStaticInvoice
impl AsRef<TaggedHash> for UnsignedStaticInvoice
Source§fn as_ref(&self) -> &TaggedHash
fn as_ref(&self) -> &TaggedHash
Auto Trait Implementations§
impl Freeze for UnsignedStaticInvoice
impl RefUnwindSafe for UnsignedStaticInvoice
impl Send for UnsignedStaticInvoice
impl Sync for UnsignedStaticInvoice
impl Unpin for UnsignedStaticInvoice
impl UnwindSafe for UnsignedStaticInvoice
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
Source§impl<F> SignFn<UnsignedStaticInvoice> for Fwhere
F: SignStaticInvoiceFn,
impl<F> SignFn<UnsignedStaticInvoice> for Fwhere
F: SignStaticInvoiceFn,
Source§fn sign(&self, message: &UnsignedStaticInvoice) -> Result<Signature, ()>
fn sign(&self, message: &UnsignedStaticInvoice) -> Result<Signature, ()>
TaggedHash computed over the merkle root of message’s TLV stream.