@@ -349,6 +349,11 @@ pub enum PaymentContext {
349349 /// [`Offer`]: crate::offers::offer::Offer
350350 Bolt12Offer ( Bolt12OfferContext ) ,
351351
352+ /// The payment was made for a static invoice requested from a BOLT 12 [`Offer`].
353+ ///
354+ /// [`Offer`]: crate::offers::offer::Offer
355+ AsyncBolt12Offer ( AsyncBolt12OfferContext ) ,
356+
352357 /// The payment was made for an invoice sent for a BOLT 12 [`Refund`].
353358 ///
354359 /// [`Refund`]: crate::offers::refund::Refund
@@ -378,6 +383,18 @@ pub struct Bolt12OfferContext {
378383 pub invoice_request : InvoiceRequestFields ,
379384}
380385
386+ /// The context of a payment made for a static invoice requested from a BOLT 12 [`Offer`].
387+ ///
388+ /// [`Offer`]: crate::offers::offer::Offer
389+ #[ derive( Clone , Debug , Eq , PartialEq ) ]
390+ pub struct AsyncBolt12OfferContext {
391+ /// The [`Nonce`] used to verify that an inbound [`InvoiceRequest`] corresponds to this static
392+ /// invoice's offer.
393+ ///
394+ /// [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
395+ pub offer_nonce : Nonce ,
396+ }
397+
381398/// The context of a payment made for an invoice sent for a BOLT 12 [`Refund`].
382399///
383400/// [`Refund`]: crate::offers::refund::Refund
@@ -627,6 +644,7 @@ impl_writeable_tlv_based_enum_legacy!(PaymentContext,
627644 // 0 for Unknown removed in version 0.1.
628645 ( 1 , Bolt12Offer ) ,
629646 ( 2 , Bolt12Refund ) ,
647+ ( 3 , AsyncBolt12Offer ) ,
630648) ;
631649
632650impl < ' a > Writeable for PaymentContextRef < ' a > {
@@ -651,6 +669,10 @@ impl_writeable_tlv_based!(Bolt12OfferContext, {
651669 ( 2 , invoice_request, required) ,
652670} ) ;
653671
672+ impl_writeable_tlv_based ! ( AsyncBolt12OfferContext , {
673+ ( 0 , offer_nonce, required) ,
674+ } ) ;
675+
654676impl_writeable_tlv_based ! ( Bolt12RefundContext , { } ) ;
655677
656678#[ cfg( test) ]
0 commit comments