@@ -349,6 +349,11 @@ pub enum PaymentContext {
349
349
/// [`Offer`]: crate::offers::offer::Offer
350
350
Bolt12Offer ( Bolt12OfferContext ) ,
351
351
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
+
352
357
/// The payment was made for an invoice sent for a BOLT 12 [`Refund`].
353
358
///
354
359
/// [`Refund`]: crate::offers::refund::Refund
@@ -378,6 +383,18 @@ pub struct Bolt12OfferContext {
378
383
pub invoice_request : InvoiceRequestFields ,
379
384
}
380
385
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
+
381
398
/// The context of a payment made for an invoice sent for a BOLT 12 [`Refund`].
382
399
///
383
400
/// [`Refund`]: crate::offers::refund::Refund
@@ -627,6 +644,7 @@ impl_writeable_tlv_based_enum_legacy!(PaymentContext,
627
644
// 0 for Unknown removed in version 0.1.
628
645
( 1 , Bolt12Offer ) ,
629
646
( 2 , Bolt12Refund ) ,
647
+ ( 3 , AsyncBolt12Offer ) ,
630
648
) ;
631
649
632
650
impl < ' a > Writeable for PaymentContextRef < ' a > {
@@ -651,6 +669,10 @@ impl_writeable_tlv_based!(Bolt12OfferContext, {
651
669
( 2 , invoice_request, required) ,
652
670
} ) ;
653
671
672
+ impl_writeable_tlv_based ! ( AsyncBolt12OfferContext , {
673
+ ( 0 , offer_nonce, required) ,
674
+ } ) ;
675
+
654
676
impl_writeable_tlv_based ! ( Bolt12RefundContext , { } ) ;
655
677
656
678
#[ cfg( test) ]
0 commit comments