Skip to content

Commit 674a690

Browse files
committed
Add HrnBolt12Offer PaymentKind variant
1 parent 7f86b36 commit 674a690

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/payment/store.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use crate::Error;
1616
use lightning::ln::channelmanager::PaymentId;
1717
use lightning::ln::msgs::DecodeError;
1818
use lightning::offers::offer::OfferId;
19+
use lightning::onion_message::dns_resolution::HumanReadableName;
1920
use lightning::util::ser::{Readable, Writeable};
2021
use lightning::util::string::UntrustedString;
2122
use 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

441452
impl_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

Comments
 (0)