@@ -86,6 +86,8 @@ mod peer_store;
86
86
#[ cfg( test) ]
87
87
mod test;
88
88
mod types;
89
+ #[ cfg( feature = "uniffi" ) ]
90
+ mod uniffi_types;
89
91
mod wallet;
90
92
91
93
pub use bip39;
@@ -100,6 +102,9 @@ use error::Error;
100
102
pub use event:: Event ;
101
103
pub use types:: NetAddress ;
102
104
105
+ #[ cfg( feature = "uniffi" ) ]
106
+ use { bitcoin:: OutPoint , lightning:: ln:: PaymentSecret , uniffi_types:: * } ;
107
+
103
108
use event:: { EventHandler , EventQueue } ;
104
109
use gossip:: GossipSource ;
105
110
use io:: fs_store:: FilesystemStore ;
@@ -122,7 +127,7 @@ use lightning::ln::channelmanager::{
122
127
self , ChainParameters , ChannelManagerReadArgs , PaymentId , RecipientOnionFields , Retry ,
123
128
} ;
124
129
use lightning:: ln:: peer_handler:: { IgnoringMessageHandler , MessageHandler } ;
125
- use lightning:: ln:: { PaymentHash , PaymentPreimage , PaymentSecret } ;
130
+ use lightning:: ln:: { PaymentHash , PaymentPreimage } ;
126
131
use lightning:: routing:: scoring:: { ProbabilisticScorer , ProbabilisticScoringParameters } ;
127
132
128
133
use lightning:: util:: config:: { ChannelHandshakeConfig , ChannelHandshakeLimits , UserConfig } ;
@@ -147,7 +152,7 @@ use bitcoin::Network;
147
152
148
153
use bip39:: Mnemonic ;
149
154
150
- use bitcoin:: { Address , BlockHash , OutPoint , Txid } ;
155
+ use bitcoin:: { Address , BlockHash , Txid } ;
151
156
152
157
use rand:: Rng ;
153
158
@@ -159,6 +164,7 @@ use std::sync::atomic::{AtomicBool, Ordering};
159
164
use std:: sync:: { Arc , Mutex , RwLock } ;
160
165
use std:: time:: { Duration , Instant , SystemTime } ;
161
166
167
+ #[ cfg( feature = "uniffi" ) ]
162
168
uniffi:: include_scaffolding!( "ldk_node" ) ;
163
169
164
170
// Config defaults
@@ -703,10 +709,6 @@ impl Builder {
703
709
}
704
710
}
705
711
706
- /// This type alias is required as Uniffi doesn't support generics, i.e., we can only expose the
707
- /// concretized types via this aliasing hack.
708
- type LDKNode = Node < FilesystemStore > ;
709
-
710
712
/// The main interface object of LDK Node, wrapping the necessary LDK and BDK functionalities.
711
713
///
712
714
/// Needs to be initialized and instantiated through [`Builder::build`].
0 commit comments