@@ -16,6 +16,7 @@ use crate::Error;
1616use lightning:: ln:: channelmanager:: PaymentId ;
1717use lightning:: ln:: msgs:: DecodeError ;
1818use lightning:: offers:: offer:: OfferId ;
19+ use lightning:: onion_message:: dns_resolution:: HumanReadableName ;
1920use lightning:: util:: ser:: { Readable , Writeable } ;
2021use lightning:: util:: string:: UntrustedString ;
2122use lightning:: {
@@ -436,6 +437,16 @@ pub enum PaymentKind {
436437 /// The pre-image used by the payment.
437438 preimage : Option < PaymentPreimage > ,
438439 } ,
440+ /// A payment to a [BOLT 12] 'offer' resolved from a [HumanReadableName] as outlined in [BIP 353] and [bLIP 32].
441+ ///
442+ /// [BOLT 12]: https://github.com/lightning/bolts/blob/master/12-offer-encoding.md
443+ /// [HumanReadableName]: crate::lightning::onion_message::dns_resolution::HumanReadableName
444+ /// [BIP 353]: https://github.com/bitcoin/bips/blob/master/bip-0353.mediawiki
445+ /// [bLIP 32]: https://github.com/lightning/blips/blob/master/blip-0032.md
446+ HrnBolt12Offer {
447+ /// The human-readable name used to initiate the payment.
448+ hrn : HumanReadableName ,
449+ } ,
439450}
440451
441452impl_writeable_tlv_based_enum ! ( PaymentKind ,
@@ -473,6 +484,9 @@ impl_writeable_tlv_based_enum!(PaymentKind,
473484 ( 2 , preimage, option) ,
474485 ( 3 , quantity, option) ,
475486 ( 4 , secret, option) ,
487+ } ,
488+ ( 12 , HrnBolt12Offer ) => {
489+ ( 0 , hrn, required) ,
476490 }
477491) ;
478492
0 commit comments