Skip to content

Commit 8c94253

Browse files
committed
Expose build_with_vss_* methods in bindings.
1 parent b83f644 commit 8c94253

File tree

4 files changed

+25
-3
lines changed

4 files changed

+25
-3
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ chrono = { version = "0.4", default-features = false, features = ["clock"] }
7070
tokio = { version = "1.37", default-features = false, features = [ "rt-multi-thread", "time", "sync", "macros" ] }
7171
esplora-client = { version = "0.9", default-features = false }
7272
libc = "0.2"
73-
uniffi = { version = "0.26.0", features = ["build"], optional = true }
73+
uniffi = { version = "0.27.3", features = ["build"], optional = true }
7474

7575
vss-client = "0.3"
7676
prost = { version = "0.11.6", default-features = false}
@@ -96,7 +96,7 @@ electrsd = { version = "0.29.0", features = ["legacy"] }
9696
clightningrpc = { version = "0.3.0-beta.8", default-features = false }
9797

9898
[build-dependencies]
99-
uniffi = { version = "0.26.0", features = ["build"], optional = true }
99+
uniffi = { version = "0.27.3", features = ["build"], optional = true }
100100

101101
[profile.release]
102102
panic = "abort"

bindings/ldk_node.udl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ interface Builder {
4949
Node build();
5050
[Throws=BuildError]
5151
Node build_with_fs_store();
52+
[Throws=BuildError]
53+
Node build_with_vss_store(string vss_url, string store_id, string lnurl_auth_server_url, record<string, string> fixed_headers);
54+
[Throws=BuildError]
55+
Node build_with_vss_store_and_fixed_headers(string vss_url, string store_id, record<string, string> fixed_headers);
56+
[Throws=BuildError]
57+
Node build_with_vss_store_and_header_provider(string vss_url, string store_id, VssHeaderProvider header_provider);
5258
};
5359

5460
interface Node {
@@ -250,6 +256,20 @@ enum BuildError {
250256
"LoggerSetupFailed",
251257
};
252258

259+
[Trait]
260+
interface VssHeaderProvider {
261+
[Async, Throws=VssHeaderProviderError]
262+
record<string, string> get_headers([ByRef]sequence<u8> request);
263+
};
264+
265+
[Error]
266+
enum VssHeaderProviderError {
267+
"InvalidData",
268+
"RequestError",
269+
"AuthorizationError",
270+
"InternalError",
271+
};
272+
253273
[Enum]
254274
interface Event {
255275
PaymentSuccessful(PaymentId? payment_id, PaymentHash payment_hash, u64? fee_paid_msat);

bindings/uniffi-bindgen/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ edition = "2021"
66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
77

88
[dependencies]
9-
uniffi = { version = "0.26.0", features = ["cli"] }
9+
uniffi = { version = "0.27.3", features = ["cli"] }

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ pub use io::utils::generate_entropy_mnemonic;
112112

113113
#[cfg(feature = "uniffi")]
114114
use uniffi_types::*;
115+
#[cfg(feature = "uniffi")]
116+
use vss_client::headers::{VssHeaderProvider, VssHeaderProviderError};
115117

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

0 commit comments

Comments
 (0)