Struct lightning::offers::invoice_request::VerifiedInvoiceRequest
source · pub struct VerifiedInvoiceRequest {
pub keys: Option<KeyPair>,
/* private fields */
}
Expand description
An InvoiceRequest
that has been verified by InvoiceRequest::verify
and exposes different
ways to respond depending on whether the signing keys were derived.
Fields§
§keys: Option<KeyPair>
Keys used for signing a Bolt12Invoice
if they can be derived.
If Some
, must call respond_using_derived_keys
when responding. Otherwise, call
respond_with
.
Implementations§
source§impl VerifiedInvoiceRequest
impl VerifiedInvoiceRequest
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) -> PrintableString<'_>
pub fn description(&self) -> 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) -> &[BlindedPath]
pub fn paths(&self) -> &[BlindedPath]
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 signing_pubkey(&self) -> PublicKey
pub fn signing_pubkey(&self) -> PublicKey
The public key used by the recipient to sign invoices.
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_id
.
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 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_id(&self) -> PublicKey
pub fn payer_id(&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 respond_with(
&self,
payment_paths: Vec<(BlindedPayInfo, BlindedPath)>,
payment_hash: PaymentHash
) -> Result<InvoiceBuilder<'_, ExplicitSigningPubkey>, Bolt12SemanticError>
Available on crate feature std
only.
pub fn respond_with( &self, payment_paths: Vec<(BlindedPayInfo, BlindedPath)>, payment_hash: PaymentHash ) -> Result<InvoiceBuilder<'_, ExplicitSigningPubkey>, Bolt12SemanticError>
std
only.Creates an InvoiceBuilder
for the request with the given required fields and using the
Duration
since std::time::SystemTime::UNIX_EPOCH
as the creation time.
See InvoiceRequest::respond_with_no_std
for further details.
This is not exported to bindings users as builder patterns don’t map outside of move semantics.
sourcepub fn respond_with_no_std(
&self,
payment_paths: Vec<(BlindedPayInfo, BlindedPath)>,
payment_hash: PaymentHash,
created_at: Duration
) -> Result<InvoiceBuilder<'_, ExplicitSigningPubkey>, Bolt12SemanticError>
pub fn respond_with_no_std( &self, payment_paths: Vec<(BlindedPayInfo, BlindedPath)>, payment_hash: PaymentHash, created_at: Duration ) -> Result<InvoiceBuilder<'_, ExplicitSigningPubkey>, Bolt12SemanticError>
Creates an InvoiceBuilder
for the request with the given required fields.
See InvoiceRequest::respond_with_no_std
for further details.
This is not exported to bindings users as builder patterns don’t map outside of move semantics.
sourcepub fn respond_using_derived_keys(
&self,
payment_paths: Vec<(BlindedPayInfo, BlindedPath)>,
payment_hash: PaymentHash
) -> Result<InvoiceBuilder<'_, DerivedSigningPubkey>, Bolt12SemanticError>
Available on crate feature std
only.
pub fn respond_using_derived_keys( &self, payment_paths: Vec<(BlindedPayInfo, BlindedPath)>, payment_hash: PaymentHash ) -> Result<InvoiceBuilder<'_, DerivedSigningPubkey>, Bolt12SemanticError>
std
only.Creates an InvoiceBuilder
for the request using the given required fields and that uses
derived signing keys from the originating Offer
to sign the Bolt12Invoice
. Must use
the same ExpandedKey
as the one used to create the offer.
See InvoiceRequest::respond_with
for further details.
This is not exported to bindings users as builder patterns don’t map outside of move semantics.
sourcepub fn respond_using_derived_keys_no_std(
&self,
payment_paths: Vec<(BlindedPayInfo, BlindedPath)>,
payment_hash: PaymentHash,
created_at: Duration
) -> Result<InvoiceBuilder<'_, DerivedSigningPubkey>, Bolt12SemanticError>
pub fn respond_using_derived_keys_no_std( &self, payment_paths: Vec<(BlindedPayInfo, BlindedPath)>, payment_hash: PaymentHash, created_at: Duration ) -> Result<InvoiceBuilder<'_, DerivedSigningPubkey>, Bolt12SemanticError>
Creates an InvoiceBuilder
for the request using the given required fields and that uses
derived signing keys from the originating Offer
to sign the Bolt12Invoice
. Must use
the same ExpandedKey
as the one used to create the offer.
See InvoiceRequest::respond_with_no_std
for further details.
This is not exported to bindings users as builder patterns don’t map outside of move semantics.
Trait Implementations§
source§impl Clone for VerifiedInvoiceRequest
impl Clone for VerifiedInvoiceRequest
source§fn clone(&self) -> VerifiedInvoiceRequest
fn clone(&self) -> VerifiedInvoiceRequest
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more