pub struct OfferFromHrn {
pub offer: Offer,
pub hrn: HumanReadableName,
}Expand description
An Offer which was fetched from a human readable name, ie through BIP 353.
Fields§
§offer: OfferThe offer itself.
When you resolve this into an InvoiceRequestBuilder you must call
InvoiceRequestBuilder::sourced_from_human_readable_name.
If you call Self::request_invoice rather than Offer::request_invoice this will be
handled for you.
hrn: HumanReadableNameThe human readable name which was resolved to fetch the Self::offer.
Implementations§
Source§impl OfferFromHrn
impl OfferFromHrn
Sourcepub fn request_invoice<'a, 'b, T: Signing>(
&'a self,
expanded_key: &ExpandedKey,
nonce: Nonce,
secp_ctx: &'b Secp256k1<T>,
payment_id: PaymentId,
) -> Result<InvoiceRequestBuilder<'a, 'b, T>, Bolt12SemanticError>
pub fn request_invoice<'a, 'b, T: Signing>( &'a self, expanded_key: &ExpandedKey, nonce: Nonce, secp_ctx: &'b Secp256k1<T>, payment_id: PaymentId, ) -> Result<InvoiceRequestBuilder<'a, 'b, T>, Bolt12SemanticError>
Creates an InvoiceRequestBuilder for the offer, which
- derives the
InvoiceRequest::payer_signing_pubkeysuch that a different key can be used for each request in order to protect the sender’s privacy, - sets
InvoiceRequest::payer_metadatawhenInvoiceRequestBuilder::build_and_signis called such that it can be used byBolt12Invoice::verify_using_metadatato determine if the invoice was requested using a baseExpandedKeyfrom which the payer id was derived, and - includes the
PaymentIdencrypted inInvoiceRequest::payer_metadataso that it can be used when sending the payment for the requested invoice.
Errors if the offer contains unknown required features.
Auto Trait Implementations§
impl Freeze for OfferFromHrn
impl RefUnwindSafe for OfferFromHrn
impl Send for OfferFromHrn
impl Sync for OfferFromHrn
impl Unpin for OfferFromHrn
impl UnwindSafe for OfferFromHrn
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
Mutably borrows from an owned value. Read more