1212
1313pub use crate :: config:: {
1414 default_config, AnchorChannelsConfig , BackgroundSyncConfig , ElectrumSyncConfig ,
15- EsploraSyncConfig , MaxDustHTLCExposure ,
15+ EsploraSyncConfig , HumanReadableNamesConfig , MaxDustHTLCExposure ,
1616} ;
1717pub use crate :: graph:: { ChannelInfo , ChannelUpdateInfo , NodeAnnouncementInfo , NodeInfo } ;
1818pub use crate :: liquidity:: { LSPS1OrderStatus , LSPS2ServiceConfig , OnchainPaymentInfo , PaymentInfo } ;
@@ -36,6 +36,8 @@ pub use lightning_invoice::{Description, SignedRawBolt11Invoice};
3636pub use lightning_liquidity:: lsps1:: msgs:: ChannelInfo as ChannelOrderInfo ;
3737pub use lightning_liquidity:: lsps1:: msgs:: { OrderId , OrderParameters , PaymentState } ;
3838
39+ pub use lightning:: onion_message:: dns_resolution:: HumanReadableName as LdkHumanReadableName ;
40+
3941pub use bitcoin:: { Address , BlockHash , FeeRate , Network , OutPoint , Txid } ;
4042
4143pub use bip39:: Mnemonic ;
@@ -1117,6 +1119,59 @@ impl UniffiCustomTypeConverter for DateTime {
11171119 }
11181120}
11191121
1122+ pub struct HumanReadableName {
1123+ pub ( crate ) inner : LdkHumanReadableName ,
1124+ }
1125+
1126+ impl HumanReadableName {
1127+ /// Returns the underlying HumanReadableName [`LdkHumanReadableName`]
1128+ pub fn into_inner ( & self ) -> LdkHumanReadableName {
1129+ self . inner . clone ( )
1130+ }
1131+
1132+ pub fn from_encoded ( encoded : & str ) -> Result < Self , Error > {
1133+ let hrn = match LdkHumanReadableName :: from_encoded ( encoded) {
1134+ Ok ( hrn) => Ok ( hrn) ,
1135+ Err ( _) => Err ( Error :: HrnParsingFailed ) ,
1136+ } ?;
1137+
1138+ Ok ( Self { inner : hrn } )
1139+ }
1140+
1141+ pub fn user ( & self ) -> String {
1142+ self . inner . user ( ) . to_string ( )
1143+ }
1144+
1145+ pub fn domain ( & self ) -> String {
1146+ self . inner . domain ( ) . to_string ( )
1147+ }
1148+ }
1149+
1150+ impl From < LdkHumanReadableName > for HumanReadableName {
1151+ fn from ( ldk_hrn : LdkHumanReadableName ) -> Self {
1152+ HumanReadableName { inner : ldk_hrn }
1153+ }
1154+ }
1155+
1156+ impl From < HumanReadableName > for LdkHumanReadableName {
1157+ fn from ( wrapper : HumanReadableName ) -> Self {
1158+ wrapper. into_inner ( )
1159+ }
1160+ }
1161+
1162+ impl Deref for HumanReadableName {
1163+ type Target = LdkHumanReadableName ;
1164+ fn deref ( & self ) -> & Self :: Target {
1165+ & self . inner
1166+ }
1167+ }
1168+
1169+ impl AsRef < LdkHumanReadableName > for HumanReadableName {
1170+ fn as_ref ( & self ) -> & LdkHumanReadableName {
1171+ self . deref ( )
1172+ }
1173+ }
1174+
11201175#[ cfg( test) ]
11211176mod tests {
11221177 use std:: {
0 commit comments