Struct UnsignedStaticInvoice

Source
pub struct UnsignedStaticInvoice { /* private fields */ }
Expand description

A semantically valid StaticInvoice that hasn’t been signed.

Implementations§

Source§

impl UnsignedStaticInvoice

Source

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.

Source

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.

Source

pub fn created_at(&self) -> Duration

Duration since the Unix epoch when the invoice was created.

Source

pub fn relative_expiry(&self) -> Duration

Duration since UnsignedStaticInvoice::created_at when the invoice has expired and therefore should no longer be paid.

Source

pub fn is_expired(&self) -> bool

Whether the invoice has expired.

Source

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.

Source

pub fn fallbacks(&self) -> Vec<Address>

Fallback addresses for paying the invoice on-chain, in order of most-preferred to least-preferred.

Source

pub fn invoice_features(&self) -> &Bolt12InvoiceFeatures

Features pertaining to paying an invoice.

Source

pub fn signing_pubkey(&self) -> PublicKey

The public key corresponding to the key used to sign the invoice.

This will be:

Source

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.

Source

pub fn metadata(&self) -> Option<&Vec<u8>>

Opaque bytes set by the originating Offer::metadata.

Source

pub fn amount(&self) -> Option<Amount>

The minimum amount required for a successful payment of a single item.

From Offer::amount.

Source

pub fn offer_features(&self) -> &OfferFeatures

Features pertaining to the originating Offer, from Offer::offer_features.

Source

pub fn description(&self) -> Option<PrintableString<'_>>

A complete description of the purpose of the originating offer, from Offer::description.

Source

pub fn absolute_expiry(&self) -> Option<Duration>

Duration since the Unix epoch when an invoice should no longer be requested, from Offer::absolute_expiry.

Source

pub fn issuer(&self) -> Option<PrintableString<'_>>

The issuer of the offer, from Offer::issuer.

Source

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.

Source

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.

Source

pub fn supported_quantity(&self) -> Quantity

The quantity of items supported, from Offer::supported_quantity.

Source

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

Source§

fn as_ref(&self) -> &TaggedHash

Converts this type into a shared reference of the (usually inferred) input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<F> SignFn<UnsignedStaticInvoice> for F

Source§

fn sign(&self, message: &UnsignedStaticInvoice) -> Result<Signature, ()>

Signs a TaggedHash computed over the merkle root of message’s TLV stream.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V