pub struct UnsignedInvoiceRequest { /* private fields */ }Expand description
A semantically valid InvoiceRequest 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 UnsignedInvoiceRequest
impl UnsignedInvoiceRequest
Sourcepub fn tagged_hash(&self) -> &TaggedHash
pub fn tagged_hash(&self) -> &TaggedHash
Returns the TaggedHash of the invoice to sign.
Source§impl UnsignedInvoiceRequest
impl UnsignedInvoiceRequest
Sourcepub fn sign<F: SignInvoiceRequestFn>(
self,
sign: F,
) -> Result<InvoiceRequest, SignError>
Available on non-c_bindings only.
pub fn sign<F: SignInvoiceRequestFn>( self, sign: F, ) -> Result<InvoiceRequest, SignError>
c_bindings only.Signs the TaggedHash of the invoice request using the given function.
Note: The hash computation may have included unknown, odd TLV records.
Source§impl UnsignedInvoiceRequest
impl UnsignedInvoiceRequest
Sourcepub fn chains(&self) -> Vec<ChainHash>
pub fn chains(&self) -> Vec<ChainHash>
The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet). Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats) for the selected chain.
Sourcepub fn metadata(&self) -> Option<&Vec<u8>>
pub fn metadata(&self) -> Option<&Vec<u8>>
Opaque bytes set by the originator. Useful for authentication and validating fields since it
is reflected in invoice_request messages along with all the other fields from the offer.
Sourcepub fn amount(&self) -> Option<Amount>
pub fn amount(&self) -> Option<Amount>
The minimum amount required for a successful payment of a single item.
Sourcepub fn description(&self) -> Option<PrintableString<'_>>
pub fn description(&self) -> Option<PrintableString<'_>>
A complete description of the purpose of the payment. Intended to be displayed to the user but with the caveat that it has not been verified in any way.
Sourcepub fn offer_features(&self) -> &OfferFeatures
pub fn offer_features(&self) -> &OfferFeatures
Features pertaining to the offer.
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.
If None, the offer does not expire.
Sourcepub fn issuer(&self) -> Option<PrintableString<'_>>
pub fn issuer(&self) -> Option<PrintableString<'_>>
The issuer of the offer, possibly beginning with user@domain or domain. Intended to be
displayed to the user but with the caveat that it has not been verified in any way.
Sourcepub fn paths(&self) -> &[BlindedMessagePath]
pub fn paths(&self) -> &[BlindedMessagePath]
Paths to the recipient originating from publicly reachable nodes. Blinded paths provide recipient privacy by obfuscating its node id.
Sourcepub fn supported_quantity(&self) -> Quantity
pub fn supported_quantity(&self) -> Quantity
The quantity of items supported.
Sourcepub fn issuer_signing_pubkey(&self) -> Option<PublicKey>
pub fn issuer_signing_pubkey(&self) -> Option<PublicKey>
The public key corresponding to the key used by the recipient to sign invoices.
- If
Offer::pathsis empty, MUST beSomeand contain the recipient’s node id for sending anInvoiceRequest. - If
Offer::pathsis not empty, MAY beSomeand contain a transient id. - If
None, the signing pubkey will be the final blinded node id from theBlindedMessagePathinOffer::pathsused to send theInvoiceRequest.
See also Bolt12Invoice::signing_pubkey.
Sourcepub fn payer_metadata(&self) -> &[u8] ⓘ
pub fn payer_metadata(&self) -> &[u8] ⓘ
An unpredictable series of bytes, typically containing information about the derivation of
payer_signing_pubkey.
Sourcepub fn chain(&self) -> ChainHash
pub fn chain(&self) -> ChainHash
A chain from Offer::chains that the offer is valid for.
Sourcepub fn amount_msats(&self) -> Option<u64>
pub fn amount_msats(&self) -> Option<u64>
The amount to pay in msats (i.e., the minimum lightning-payable unit for chain), which
must be greater than or equal to Offer::amount, converted if necessary.
Sourcepub fn has_amount_msats(&self) -> bool
pub fn has_amount_msats(&self) -> bool
Returns whether an amount was set in the request; otherwise, if amount_msats is Some
then it was inferred from the Offer::amount and quantity.
Sourcepub fn invoice_request_features(&self) -> &InvoiceRequestFeatures
pub fn invoice_request_features(&self) -> &InvoiceRequestFeatures
Features pertaining to requesting an invoice.
Sourcepub fn quantity(&self) -> Option<u64>
pub fn quantity(&self) -> Option<u64>
The quantity of the offer’s item conforming to Offer::is_valid_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.
Sourcepub fn payer_note(&self) -> Option<PrintableString<'_>>
pub fn payer_note(&self) -> Option<PrintableString<'_>>
A payer-provided note which will be seen by the recipient and reflected back in the invoice response.
Sourcepub fn offer_from_hrn(&self) -> &Option<HumanReadableName>
pub fn offer_from_hrn(&self) -> &Option<HumanReadableName>
If the Offer was sourced from a BIP 353 Human Readable Name, this should be set by the
builder to indicate the original HumanReadableName which was resolved.
Trait Implementations§
Source§impl AsRef<TaggedHash> for UnsignedInvoiceRequest
impl AsRef<TaggedHash> for UnsignedInvoiceRequest
Source§fn as_ref(&self) -> &TaggedHash
fn as_ref(&self) -> &TaggedHash
Source§impl Clone for UnsignedInvoiceRequest
impl Clone for UnsignedInvoiceRequest
Source§fn clone(&self) -> UnsignedInvoiceRequest
fn clone(&self) -> UnsignedInvoiceRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more