@@ -481,8 +481,8 @@ impl TryFrom<ParsedOffer> for Offer {
481
481
482
482
fn try_from ( offer : ParsedOffer ) -> Result < Self , Self :: Error > {
483
483
let ParsedOffer ( OfferTlvStream {
484
- chains, currency, amount, description, features, absolute_expiry, paths, issuer ,
485
- quantity_min, quantity_max, node_id, send_invoice, signature,
484
+ chains, metadata , currency, amount, description, features, absolute_expiry, paths,
485
+ issuer , quantity_min, quantity_max, node_id, send_invoice, signature,
486
486
} , data) = offer;
487
487
488
488
let supported_chains = [
@@ -500,6 +500,8 @@ impl TryFrom<ParsedOffer> for Offer {
500
500
} ,
501
501
} ;
502
502
503
+ let metadata = metadata. map ( Into :: into) ;
504
+
503
505
let amount = match ( currency, amount. map ( Into :: into) ) {
504
506
( None , None ) => None ,
505
507
( None , Some ( amount_msats) ) => Some ( Amount :: Bitcoin { amount_msats } ) ,
@@ -555,8 +557,8 @@ impl TryFrom<ParsedOffer> for Offer {
555
557
}
556
558
557
559
Ok ( Offer {
558
- id, chains, amount, description, features, absolute_expiry, issuer, paths, quantity_min ,
559
- quantity_max, node_id, send_invoice, signature,
560
+ id, chains, metadata , amount, description, features, absolute_expiry, issuer, paths,
561
+ quantity_min , quantity_max, node_id, send_invoice, signature,
560
562
} )
561
563
}
562
564
}
0 commit comments