@@ -16,6 +16,7 @@ use crate::Error;
16
16
use lightning:: ln:: channelmanager:: PaymentId ;
17
17
use lightning:: ln:: msgs:: DecodeError ;
18
18
use lightning:: offers:: offer:: OfferId ;
19
+ use lightning:: onion_message:: dns_resolution:: HumanReadableName ;
19
20
use lightning:: util:: ser:: { Readable , Writeable } ;
20
21
use lightning:: util:: string:: UntrustedString ;
21
22
use lightning:: {
@@ -436,6 +437,16 @@ pub enum PaymentKind {
436
437
/// The pre-image used by the payment.
437
438
preimage : Option < PaymentPreimage > ,
438
439
} ,
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
+ } ,
439
450
}
440
451
441
452
impl_writeable_tlv_based_enum ! ( PaymentKind ,
@@ -473,6 +484,9 @@ impl_writeable_tlv_based_enum!(PaymentKind,
473
484
( 2 , preimage, option) ,
474
485
( 3 , quantity, option) ,
475
486
( 4 , secret, option) ,
487
+ } ,
488
+ ( 12 , HrnBolt12Offer ) => {
489
+ ( 0 , hrn, required) ,
476
490
}
477
491
) ;
478
492
0 commit comments