Skip to content

Commit 3f3bc4a

Browse files
committed
WIP Expose custom AuthMethod in bindings
1 parent dbf44f3 commit 3f3bc4a

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

bindings/ldk_node.udl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ interface Builder {
3838
[Throws=BuildError]
3939
Node build_with_fs_store();
4040
[Throws=BuildError]
41-
Node build_with_vss_store(string url, string store_id);
41+
Node build_with_vss_store(string url, string store_id, AuthMethod auth_custom);
4242
};
4343

4444
interface Node {
@@ -355,6 +355,11 @@ enum LogLevel {
355355
"Error",
356356
};
357357

358+
[Trait]
359+
interface AuthMethod {
360+
record<string, string> get([ByRef]sequence<u8> request_body);
361+
};
362+
358363
[Custom]
359364
typedef string Txid;
360365

src/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ impl ArcedNodeBuilder {
522522
pub fn build_with_vss_store(
523523
&self, url: String, store_id: String, auth_custom: Arc<dyn AuthMethod>,
524524
) -> Result<Arc<Node>, BuildError> {
525-
self.inner.read().unwrap().build_with_vss_store(url, store_id).map(Arc::new)
525+
self.inner.read().unwrap().build_with_vss_store(url, store_id, auth_custom).map(Arc::new)
526526
}
527527

528528
/// Builds a [`Node`] instance according to the options previously configured.

src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ pub use bip39;
101101
pub use bitcoin;
102102
pub use lightning;
103103
pub use lightning_invoice;
104+
#[cfg(vss)]
105+
pub use vss_client;
104106

105107
pub use balance::{BalanceDetails, LightningBalance, PendingSweepBalance};
106108
pub use config::{default_config, Config};
@@ -112,6 +114,8 @@ pub use types::ChannelConfig;
112114

113115
pub use io::utils::generate_entropy_mnemonic;
114116

117+
#[cfg(all(vss, feature = "uniffi"))]
118+
pub use vss_client::client::AuthMethod;
115119
#[cfg(feature = "uniffi")]
116120
use uniffi_types::*;
117121

0 commit comments

Comments
 (0)