55// http://opensource.org/licenses/MIT>, at your option. You may not use this file except in
66// accordance with one or both of these licenses.
77
8- //! Holds a payment handler allowing to create [BIP 21] URIs with an on-chain, [BOLT 11], and [BOLT 12] payment
8+ //! Holds a payment handler allowing to create [BIP 21] URIs with on-chain, [BOLT 11], and [BOLT 12] payment
99//! options.
1010//!
11+ //! Also allows to send payments using these URIs as well as [BIP 353] HRNs.
12+ //!
1113//! [BIP 21]: https://github.com/bitcoin/bips/blob/master/bip-0021.mediawiki
14+ //! [BIP 353]: https://github.com/bitcoin/bips/blob/master/bip-0353.mediawiki
1215//! [BOLT 11]: https://github.com/lightning/bolts/blob/master/11-payment-encoding.md
1316//! [BOLT 12]: https://github.com/lightning/bolts/blob/master/12-offer-encoding.md
1417use crate :: error:: Error ;
1518use crate :: ffi:: maybe_wrap;
1619use crate :: logger:: { log_error, LdkLogger , Logger } ;
1720use crate :: payment:: { Bolt11Payment , Bolt12Payment , OnchainPayment } ;
21+ use crate :: types:: HRNResolver ;
1822use crate :: Config ;
1923
2024use lightning:: ln:: channelmanager:: PaymentId ;
@@ -40,26 +44,31 @@ struct Extras {
4044/// A payment handler allowing to create [BIP 21] URIs with an on-chain, [BOLT 11], and [BOLT 12] payment
4145/// option.
4246///
43- /// Should be retrieved by calling [`Node::unified_qr_payment`]
47+ /// Should be retrieved by calling [`Node::unified_payment`]
48+ ///
49+ /// This handler allows you to send payments to these URIs as well as [BIP 353] HRNs.
4450///
4551/// [BIP 21]: https://github.com/bitcoin/bips/blob/master/bip-0021.mediawiki
52+ /// [BIP 353]: https://github.com/bitcoin/bips/blob/master/bip-0353.mediawiki
4653/// [BOLT 11]: https://github.com/lightning/bolts/blob/master/11-payment-encoding.md
4754/// [BOLT 12]: https://github.com/lightning/bolts/blob/master/12-offer-encoding.md
48- /// [`Node::unified_qr_payment `]: crate::Node::unified_qr_payment
55+ /// [`Node::unified_payment `]: crate::Node::unified_payment
4956pub struct UnifiedPayment {
5057 onchain_payment : Arc < OnchainPayment > ,
5158 bolt11_invoice : Arc < Bolt11Payment > ,
5259 bolt12_payment : Arc < Bolt12Payment > ,
5360 config : Arc < Config > ,
5461 logger : Arc < Logger > ,
62+ hrn_resolver : Arc < HRNResolver > ,
5563}
5664
5765impl UnifiedPayment {
5866 pub ( crate ) fn new (
5967 onchain_payment : Arc < OnchainPayment > , bolt11_invoice : Arc < Bolt11Payment > ,
6068 bolt12_payment : Arc < Bolt12Payment > , config : Arc < Config > , logger : Arc < Logger > ,
69+ hrn_resolver : Arc < HRNResolver > ,
6170 ) -> Self {
62- Self { onchain_payment, bolt11_invoice, bolt12_payment, config, logger }
71+ Self { onchain_payment, bolt11_invoice, bolt12_payment, config, logger, hrn_resolver }
6372 }
6473
6574 /// Generates a URI with an on-chain address, [BOLT 11] invoice and [BOLT 12] offer.
0 commit comments