Skip to content

Commit

Permalink
Expose build_with_vss_* methods in bindings.
Browse files Browse the repository at this point in the history
  • Loading branch information
G8XSU committed Oct 17, 2024
1 parent 9a24a29 commit d53f7cf
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
20 changes: 20 additions & 0 deletions bindings/ldk_node.udl
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ interface Builder {
Node build();
[Throws=BuildError]
Node build_with_fs_store();
[Throws=BuildError]
Node build_with_vss_store(string vss_url, string store_id, string lnurl_auth_server_url, record<string, string> fixed_headers);
[Throws=BuildError]
Node build_with_vss_store_and_fixed_headers(string vss_url, string store_id, record<string, string> fixed_headers);
[Throws=BuildError]
Node build_with_vss_store_and_header_provider(string vss_url, string store_id, VssHeaderProvider header_provider);
};

interface Node {
Expand Down Expand Up @@ -251,6 +257,20 @@ enum BuildError {
"LoggerSetupFailed",
};

[Trait]
interface VssHeaderProvider {
[Async, Throws=VssHeaderProviderError]
record<string, string> get_headers([ByRef]sequence<u8> request);
};

[Error]
enum VssHeaderProviderError {
"InvalidData",
"RequestError",
"AuthorizationError",
"InternalError",
};

[Enum]
interface Event {
PaymentSuccessful(PaymentId? payment_id, PaymentHash payment_hash, u64? fee_paid_msat);
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ pub use io::utils::generate_entropy_mnemonic;

#[cfg(feature = "uniffi")]
use uniffi_types::*;
#[cfg(feature = "uniffi")]
use vss_client::headers::{VssHeaderProvider, VssHeaderProviderError};

#[cfg(feature = "uniffi")]
pub use builder::ArcedNodeBuilder as Builder;
Expand Down

0 comments on commit d53f7cf

Please sign in to comment.