@@ -187,7 +187,7 @@ macro_rules! invoice_request_builder_methods { (
187187 InvoiceRequestContentsWithoutPayerSigningPubkey {
188188 payer: PayerContents ( metadata) , offer, chain: None , amount_msats: None ,
189189 features: InvoiceRequestFeatures :: empty( ) , quantity: None , payer_note: None ,
190- offer_from_hrn: None , invreq_contact_secret: None ,
190+ offer_from_hrn: None , invreq_contact_secret: None , invreq_payer_offer : None ,
191191 #[ cfg( test) ]
192192 experimental_bar: None ,
193193 }
@@ -704,6 +704,7 @@ pub(super) struct InvoiceRequestContentsWithoutPayerSigningPubkey {
704704 payer_note : Option < String > ,
705705 offer_from_hrn : Option < HumanReadableName > ,
706706 invreq_contact_secret : Option < Vec < u8 > > ,
707+ invreq_payer_offer : Option < Vec < u8 > > ,
707708 #[ cfg( test) ]
708709 experimental_bar : Option < u64 > ,
709710}
@@ -770,6 +771,11 @@ macro_rules! invoice_request_accessors { ($self: ident, $contents: expr) => {
770771 pub fn contact_secret( & $self) -> Option <& [ u8 ] > {
771772 $contents. contact_secret( )
772773 }
774+
775+ /// Returns the payer offer if present in the invoice request.
776+ pub fn payer_offer( & $self) -> Option <& [ u8 ] > {
777+ $contents. payer_offer( )
778+ }
773779} }
774780
775781impl UnsignedInvoiceRequest {
@@ -1206,6 +1212,10 @@ impl InvoiceRequestContents {
12061212 self . inner . invreq_contact_secret . as_ref ( ) . map ( |secret| secret. as_slice ( ) )
12071213 }
12081214
1215+ pub ( super ) fn payer_offer ( & self ) -> Option < & [ u8 ] > {
1216+ self . inner . invreq_payer_offer . as_ref ( ) . map ( |offer| offer. as_slice ( ) )
1217+ }
1218+
12091219 pub ( super ) fn as_tlv_stream ( & self ) -> PartialInvoiceRequestTlvStreamRef < ' _ > {
12101220 let ( payer, offer, mut invoice_request, experimental_offer, experimental_invoice_request) =
12111221 self . inner . as_tlv_stream ( ) ;
@@ -1253,7 +1263,7 @@ impl InvoiceRequestContentsWithoutPayerSigningPubkey {
12531263
12541264 let experimental_invoice_request = ExperimentalInvoiceRequestTlvStreamRef {
12551265 invreq_contact_secret : self . invreq_contact_secret . as_ref ( ) ,
1256- invreq_payer_offer : None ,
1266+ invreq_payer_offer : self . invreq_payer_offer . as_ref ( ) ,
12571267 invreq_payer_bip_353_name : None ,
12581268 #[ cfg( test) ]
12591269 experimental_bar : self . experimental_bar ,
@@ -1494,7 +1504,7 @@ impl TryFrom<PartialInvoiceRequestTlvStream> for InvoiceRequestContents {
14941504 experimental_offer_tlv_stream,
14951505 ExperimentalInvoiceRequestTlvStream {
14961506 invreq_contact_secret,
1497- invreq_payer_offer : _ ,
1507+ invreq_payer_offer,
14981508 invreq_payer_bip_353_name : _,
14991509 #[ cfg( test) ]
15001510 experimental_bar,
@@ -1540,6 +1550,7 @@ impl TryFrom<PartialInvoiceRequestTlvStream> for InvoiceRequestContents {
15401550 payer_note,
15411551 offer_from_hrn,
15421552 invreq_contact_secret,
1553+ invreq_payer_offer,
15431554 #[ cfg( test) ]
15441555 experimental_bar,
15451556 } ,
0 commit comments