pub struct UnsignedBolt12Invoice { /* private fields */ }Expand description
A semantically valid Bolt12Invoice that hasn’t been signed.
§Serialization
This is serialized as a TLV stream, which includes TLV records from the originating message. As such, it may include unknown, odd TLV records.
Implementations§
Source§impl UnsignedBolt12Invoice
impl UnsignedBolt12Invoice
Sourcepub fn tagged_hash(&self) -> &TaggedHash
pub fn tagged_hash(&self) -> &TaggedHash
Returns the TaggedHash of the invoice to sign.
Source§impl UnsignedBolt12Invoice
impl UnsignedBolt12Invoice
Sourcepub fn sign<F>(self, sign: F) -> Result<Bolt12Invoice, SignError>where
F: SignBolt12InvoiceFn,
pub fn sign<F>(self, sign: F) -> Result<Bolt12Invoice, SignError>where
F: SignBolt12InvoiceFn,
Signs the TaggedHash of the invoice using the given function.
Note: The hash computation may have included unknown, odd TLV records.
Source§impl UnsignedBolt12Invoice
impl UnsignedBolt12Invoice
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
UnsignedBolt12Invoice::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
UnsignedBolt12Invoice::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 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) -> &Features<Bolt12InvoiceContext>
pub fn invoice_features(&self) -> &Features<Bolt12InvoiceContext>
Features pertaining to paying an invoice.
Sourcepub fn signing_pubkey(&self) -> PublicKey
pub fn signing_pubkey(&self) -> PublicKey
A typically transient public key corresponding to the key used to sign the invoice.
If the invoices was created in response to an Offer, then this will be:
Offer::issuer_signing_pubkeyif it’sSome, otherwise- the final blinded node id from a
BlindedMessagePathinOffer::pathsifNone.
If the invoice was created in response to a Refund, then it is a valid pubkey chosen by
the recipient.
Sourcepub fn offer_chains(&self) -> Option<Vec<ChainHash>>
pub fn offer_chains(&self) -> Option<Vec<ChainHash>>
The chains that may be used when paying a requested invoice.
From Offer::chains; None if the invoice was created in response to a Refund.
Sourcepub fn chain(&self) -> ChainHash
pub fn chain(&self) -> ChainHash
The chain that must be used when paying the invoice; selected from offer_chains if the
invoice originated from an offer.
From InvoiceRequest::chain or Refund::chain.
Sourcepub fn metadata(&self) -> Option<&Vec<u8>>
pub fn metadata(&self) -> Option<&Vec<u8>>
Opaque bytes set by the originating Offer.
From Offer::metadata; None if the invoice was created in response to a Refund or
if the Offer did not set it.
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; None if the invoice was created in response to a Refund or if
the Offer did not set it.
Sourcepub fn offer_features(&self) -> Option<&Features<OfferContext>>
pub fn offer_features(&self) -> Option<&Features<OfferContext>>
Features pertaining to the originating Offer.
From Offer::offer_features; None if the invoice was created in response to a
Refund.
Sourcepub fn description(&self) -> Option<PrintableString<'_>>
pub fn description(&self) -> Option<PrintableString<'_>>
A complete description of the purpose of the originating offer or refund.
From Offer::description or Refund::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.
Sourcepub fn issuer(&self) -> Option<PrintableString<'_>>
pub fn issuer(&self) -> Option<PrintableString<'_>>
The issuer of the offer or refund.
From Offer::issuer or Refund::issuer.
Sourcepub fn message_paths(&self) -> &[BlindedMessagePath]
pub fn message_paths(&self) -> &[BlindedMessagePath]
Paths to the recipient originating from publicly reachable nodes.
From Offer::paths or Refund::paths.
Sourcepub fn supported_quantity(&self) -> Option<Quantity>
pub fn supported_quantity(&self) -> Option<Quantity>
The quantity of items supported.
From Offer::supported_quantity; None if the invoice was created in response to a
Refund.
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 and may be None; also None if the invoice was
created in response to a Refund.
Sourcepub fn payer_metadata(&self) -> &[u8] ⓘ
pub fn payer_metadata(&self) -> &[u8] ⓘ
An unpredictable series of bytes from the payer.
From InvoiceRequest::payer_metadata or Refund::payer_metadata.
Sourcepub fn invoice_request_features(&self) -> &Features<InvoiceRequestContext>
pub fn invoice_request_features(&self) -> &Features<InvoiceRequestContext>
Features pertaining to requesting an invoice.
From InvoiceRequest::invoice_request_features or Refund::features.
Sourcepub fn quantity(&self) -> Option<u64>
pub fn quantity(&self) -> Option<u64>
The quantity of items requested or refunded for.
From InvoiceRequest::quantity or Refund::quantity.
Sourcepub fn payer_signing_pubkey(&self) -> PublicKey
pub fn payer_signing_pubkey(&self) -> PublicKey
A possibly transient pubkey used to sign the invoice request or to send an invoice for a
refund in case there are no message_paths.
Sourcepub fn payer_note(&self) -> Option<PrintableString<'_>>
pub fn payer_note(&self) -> Option<PrintableString<'_>>
A payer-provided note reflected back in the invoice.
Sourcepub fn payment_hash(&self) -> PaymentHash
pub fn payment_hash(&self) -> PaymentHash
SHA256 hash of the payment preimage that will be given in return for paying the invoice.
Sourcepub fn amount_msats(&self) -> u64
pub fn amount_msats(&self) -> u64
The minimum amount required for a successful payment of the invoice.
Trait Implementations§
Source§impl AsRef<TaggedHash> for UnsignedBolt12Invoice
impl AsRef<TaggedHash> for UnsignedBolt12Invoice
Source§fn as_ref(&self) -> &TaggedHash
fn as_ref(&self) -> &TaggedHash
Source§impl Clone for UnsignedBolt12Invoice
impl Clone for UnsignedBolt12Invoice
Source§fn clone(&self) -> UnsignedBolt12Invoice
fn clone(&self) -> UnsignedBolt12Invoice
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Writeable for UnsignedBolt12Invoice
impl Writeable for UnsignedBolt12Invoice
Source§fn write<W>(&self, writer: &mut W) -> Result<(), Error>where
W: Writer,
fn write<W>(&self, writer: &mut W) -> Result<(), Error>where
W: Writer,
self out to the given Writer.Source§fn serialized_length(&self) -> usize
fn serialized_length(&self) -> usize
Auto Trait Implementations§
impl Freeze for UnsignedBolt12Invoice
impl RefUnwindSafe for UnsignedBolt12Invoice
impl Send for UnsignedBolt12Invoice
impl Sync for UnsignedBolt12Invoice
impl Unpin for UnsignedBolt12Invoice
impl UnwindSafe for UnsignedBolt12Invoice
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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 more