@@ -440,8 +440,8 @@ impl TryFrom<ParsedOffer> for Offer {
440
440
441
441
fn try_from ( offer : ParsedOffer ) -> Result < Self , Self :: Error > {
442
442
let ParsedOffer ( OfferTlvStream {
443
- chains, currency, amount, description, features, absolute_expiry, paths, issuer ,
444
- quantity_min, quantity_max, node_id, send_invoice, signature,
443
+ chains, metadata , currency, amount, description, features, absolute_expiry, paths,
444
+ issuer , quantity_min, quantity_max, node_id, send_invoice, signature,
445
445
} , data) = offer;
446
446
447
447
let supported_chains = [
@@ -459,6 +459,8 @@ impl TryFrom<ParsedOffer> for Offer {
459
459
} ,
460
460
} ;
461
461
462
+ let metadata = metadata. map ( Into :: into) ;
463
+
462
464
let amount = match ( currency, amount. map ( Into :: into) ) {
463
465
( None , None ) => None ,
464
466
( None , Some ( amount_msats) ) => Some ( Amount :: Bitcoin { amount_msats } ) ,
@@ -514,8 +516,8 @@ impl TryFrom<ParsedOffer> for Offer {
514
516
}
515
517
516
518
Ok ( Offer {
517
- id, chains, amount, description, features, absolute_expiry, issuer, paths, quantity_min ,
518
- quantity_max, node_id, send_invoice, signature,
519
+ id, chains, metadata , amount, description, features, absolute_expiry, issuer, paths,
520
+ quantity_min , quantity_max, node_id, send_invoice, signature,
519
521
} )
520
522
}
521
523
}
0 commit comments