@@ -152,14 +152,15 @@ use payment::asynchronous::om_mailbox::OnionMessageMailbox;
152152use payment:: asynchronous:: static_invoice_store:: StaticInvoiceStore ;
153153use payment:: {
154154 Bolt11Payment , Bolt12Payment , OnchainPayment , PaymentDetails , SpontaneousPayment ,
155- UnifiedQrPayment ,
155+ UnifiedPayment ,
156156} ;
157157use peer_store:: { PeerInfo , PeerStore } ;
158158use rand:: Rng ;
159159use runtime:: Runtime ;
160160use types:: {
161161 Broadcaster , BumpTransactionEventHandler , ChainMonitor , ChannelManager , DynStore , Graph ,
162- KeysManager , OnionMessenger , PaymentStore , PeerManager , Router , Scorer , Sweeper , Wallet ,
162+ HRNResolver , KeysManager , OnionMessenger , PaymentStore , PeerManager , Router , Scorer , Sweeper ,
163+ Wallet ,
163164} ;
164165pub use types:: { ChannelDetails , CustomTlvRecord , PeerDetails , SyncAndAsyncKVStore , UserChannelId } ;
165166pub use {
@@ -206,6 +207,7 @@ pub struct Node {
206207 node_metrics : Arc < RwLock < NodeMetrics > > ,
207208 om_mailbox : Option < Arc < OnionMessageMailbox > > ,
208209 async_payments_role : Option < AsyncPaymentsRole > ,
210+ hrn_resolver : Arc < HRNResolver > ,
209211}
210212
211213impl Node {
@@ -945,34 +947,42 @@ impl Node {
945947 /// Returns a payment handler allowing to create [BIP 21] URIs with an on-chain, [BOLT 11],
946948 /// and [BOLT 12] payment options.
947949 ///
950+ /// This handler allows you to send payments to these URIs as well as [BIP 353] HRNs.
951+ ///
948952 /// [BOLT 11]: https://github.com/lightning/bolts/blob/master/11-payment-encoding.md
949953 /// [BOLT 12]: https://github.com/lightning/bolts/blob/master/12-offer-encoding.md
950954 /// [BIP 21]: https://github.com/bitcoin/bips/blob/master/bip-0021.mediawiki
955+ /// [BIP 353]: https://github.com/bitcoin/bips/blob/master/bip-0353.mediawiki
951956 #[ cfg( not( feature = "uniffi" ) ) ]
952- pub fn unified_qr_payment ( & self ) -> UnifiedQrPayment {
953- UnifiedQrPayment :: new (
957+ pub fn unified_payment ( & self ) -> UnifiedPayment {
958+ UnifiedPayment :: new (
954959 self . onchain_payment ( ) . into ( ) ,
955960 self . bolt11_payment ( ) . into ( ) ,
956961 self . bolt12_payment ( ) . into ( ) ,
957962 Arc :: clone ( & self . config ) ,
958963 Arc :: clone ( & self . logger ) ,
964+ Arc :: clone ( & self . hrn_resolver ) ,
959965 )
960966 }
961967
962968 /// Returns a payment handler allowing to create [BIP 21] URIs with an on-chain, [BOLT 11],
963969 /// and [BOLT 12] payment options.
964970 ///
971+ /// This handler allows you to send payments to these URIs as well as [BIP 353] HRNs.
972+ ///
965973 /// [BOLT 11]: https://github.com/lightning/bolts/blob/master/11-payment-encoding.md
966974 /// [BOLT 12]: https://github.com/lightning/bolts/blob/master/12-offer-encoding.md
967975 /// [BIP 21]: https://github.com/bitcoin/bips/blob/master/bip-0021.mediawiki
976+ /// [BIP 353]: https://github.com/bitcoin/bips/blob/master/bip-0353.mediawiki
968977 #[ cfg( feature = "uniffi" ) ]
969- pub fn unified_qr_payment ( & self ) -> Arc < UnifiedQrPayment > {
970- Arc :: new ( UnifiedQrPayment :: new (
978+ pub fn unified_payment ( & self ) -> Arc < UnifiedPayment > {
979+ Arc :: new ( UnifiedPayment :: new (
971980 self . onchain_payment ( ) ,
972981 self . bolt11_payment ( ) ,
973982 self . bolt12_payment ( ) ,
974983 Arc :: clone ( & self . config ) ,
975984 Arc :: clone ( & self . logger ) ,
985+ Arc :: clone ( & self . hrn_resolver ) ,
976986 ) )
977987 }
978988
0 commit comments