Skip to content

Commit

Permalink
WIP Expose custom AuthMethod in bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
tnull committed May 16, 2024
1 parent dbf44f3 commit 3f3bc4a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion bindings/ldk_node.udl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ interface Builder {
[Throws=BuildError]
Node build_with_fs_store();
[Throws=BuildError]
Node build_with_vss_store(string url, string store_id);
Node build_with_vss_store(string url, string store_id, AuthMethod auth_custom);
};

interface Node {
Expand Down Expand Up @@ -355,6 +355,11 @@ enum LogLevel {
"Error",
};

[Trait]
interface AuthMethod {
record<string, string> get([ByRef]sequence<u8> request_body);
};

[Custom]
typedef string Txid;

Expand Down
2 changes: 1 addition & 1 deletion src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ impl ArcedNodeBuilder {
pub fn build_with_vss_store(
&self, url: String, store_id: String, auth_custom: Arc<dyn AuthMethod>,
) -> Result<Arc<Node>, BuildError> {
self.inner.read().unwrap().build_with_vss_store(url, store_id).map(Arc::new)
self.inner.read().unwrap().build_with_vss_store(url, store_id, auth_custom).map(Arc::new)
}

/// Builds a [`Node`] instance according to the options previously configured.
Expand Down
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ pub use bip39;
pub use bitcoin;
pub use lightning;
pub use lightning_invoice;
#[cfg(vss)]
pub use vss_client;

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

pub use io::utils::generate_entropy_mnemonic;

#[cfg(all(vss, feature = "uniffi"))]
pub use vss_client::client::AuthMethod;
#[cfg(feature = "uniffi")]
use uniffi_types::*;

Expand Down

0 comments on commit 3f3bc4a

Please sign in to comment.