@bennyblader/ddk-rn 0.2.6 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DdkRn.podspec +3 -0
- package/android/build.gradle +0 -1
- package/cpp/bennyblader-ddk-rn.cpp +1 -1
- package/cpp/ddk_ffi.cpp +114 -28
- package/cpp/ddk_ffi.hpp +6 -2
- package/ddk-ffi/Cargo.lock +69 -9
- package/ddk-ffi/Cargo.toml +5 -1
- package/ddk-ffi/src/ddk_ffi.udl +23 -3
- package/ddk-ffi/src/lib.rs +129 -15
- package/lib/commonjs/ddk_ffi-ffi.js.map +1 -1
- package/lib/commonjs/ddk_ffi.js +200 -19
- package/lib/commonjs/ddk_ffi.js.map +1 -1
- package/lib/module/ddk_ffi-ffi.js.map +1 -1
- package/lib/module/ddk_ffi.js +197 -18
- package/lib/module/ddk_ffi.js.map +1 -1
- package/lib/typescript/commonjs/src/ddk_ffi-ffi.d.ts +6 -2
- package/lib/typescript/commonjs/src/ddk_ffi-ffi.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/ddk_ffi.d.ts +210 -5
- package/lib/typescript/commonjs/src/ddk_ffi.d.ts.map +1 -1
- package/lib/typescript/module/src/ddk_ffi-ffi.d.ts +6 -2
- package/lib/typescript/module/src/ddk_ffi-ffi.d.ts.map +1 -1
- package/lib/typescript/module/src/ddk_ffi.d.ts +210 -5
- package/lib/typescript/module/src/ddk_ffi.d.ts.map +1 -1
- package/package.json +2 -1
- package/scripts/apply-hotfix.js +96 -0
- package/scripts/postinstall.js +4 -0
- package/src/ddk_ffi-ffi.ts +20 -4
- package/src/ddk_ffi.ts +289 -22
- package/ubrn.config.yaml +1 -0
- package/ddk-ffi/scratchpad.txt +0 -243
package/DdkRn.podspec
CHANGED
|
@@ -17,6 +17,9 @@ Pod::Spec.new do |s|
|
|
|
17
17
|
|
|
18
18
|
s.source_files = "ios/**/*.{h,m,mm,swift}", "ios/generated/**/*.{h,m,mm}", "cpp/**/*.{hpp,cpp,c,h}", "cpp/**/*.{hpp,cpp,c,h}"
|
|
19
19
|
s.vendored_frameworks = "ios/DdkRn.xcframework"
|
|
20
|
+
s.xcconfig = {
|
|
21
|
+
'LIBRARY_SEARCH_PATHS' => '$(SRCROOT)/../node_modules/@bennyblader/ddk-rn/ios/DdkRn.xcframework/ios-arm64-simulator $(SRCROOT)/../node_modules/@bennyblader/ddk-rn/ios/DdkRn.xcframework/ios-arm64 $(SRCROOT)/../node_modules/@bennyblader/ddk-rn/ios/DdkRn.xcframework/ios-x86_64-simulator $(SRCROOT)/../node_modules/@bennyblader/ddk-rn/ios/DdkRn.xcframework/ios-x86_64'
|
|
22
|
+
}
|
|
20
23
|
s.dependency "uniffi-bindgen-react-native", "0.29.3-1"
|
|
21
24
|
|
|
22
25
|
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
|
package/android/build.gradle
CHANGED
|
@@ -133,7 +133,6 @@ dependencies {
|
|
|
133
133
|
//noinspection GradleDynamicVersion
|
|
134
134
|
implementation "com.facebook.react:react-native:+"
|
|
135
135
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
136
|
-
implementation "net.java.dev.jna:jna:5.17.0@aar"
|
|
137
136
|
}
|
|
138
137
|
|
|
139
138
|
if (isNewArchitectureEnabled()) {
|
package/cpp/ddk_ffi.cpp
CHANGED
|
@@ -133,6 +133,11 @@ extern "C" {
|
|
|
133
133
|
uint64_t callback_data,
|
|
134
134
|
UniffiForeignFutureStructVoid result
|
|
135
135
|
);
|
|
136
|
+
RustBuffer uniffi_ddk_ffi_fn_func_convert_mnemonic_to_seed(
|
|
137
|
+
RustBuffer mnemonic,
|
|
138
|
+
RustBuffer passphrase,
|
|
139
|
+
RustCallStatus *uniffi_out_err
|
|
140
|
+
);
|
|
136
141
|
RustBuffer uniffi_ddk_ffi_fn_func_create_cet(
|
|
137
142
|
RustBuffer local_output,
|
|
138
143
|
uint64_t local_payout_serial_id,
|
|
@@ -200,6 +205,13 @@ extern "C" {
|
|
|
200
205
|
uint64_t fund_output_serial_id,
|
|
201
206
|
RustCallStatus *uniffi_out_err
|
|
202
207
|
);
|
|
208
|
+
RustBuffer uniffi_ddk_ffi_fn_func_create_xpriv_from_parent_path(
|
|
209
|
+
RustBuffer xpriv,
|
|
210
|
+
RustBuffer base_derivation_path,
|
|
211
|
+
RustBuffer network,
|
|
212
|
+
RustBuffer path,
|
|
213
|
+
RustCallStatus *uniffi_out_err
|
|
214
|
+
);
|
|
203
215
|
RustBuffer uniffi_ddk_ffi_fn_func_get_change_output_and_fees(
|
|
204
216
|
RustBuffer params,
|
|
205
217
|
uint64_t fee_rate,
|
|
@@ -217,12 +229,15 @@ extern "C" {
|
|
|
217
229
|
RustBuffer inputs,
|
|
218
230
|
RustCallStatus *uniffi_out_err
|
|
219
231
|
);
|
|
232
|
+
RustBuffer uniffi_ddk_ffi_fn_func_get_xpub_from_xpriv(
|
|
233
|
+
RustBuffer xpriv,
|
|
234
|
+
RustBuffer network,
|
|
235
|
+
RustCallStatus *uniffi_out_err
|
|
236
|
+
);
|
|
220
237
|
int8_t uniffi_ddk_ffi_fn_func_is_dust_output(
|
|
221
238
|
RustBuffer output,
|
|
222
239
|
RustCallStatus *uniffi_out_err
|
|
223
240
|
);
|
|
224
|
-
RustBuffer uniffi_ddk_ffi_fn_func_plz_work(RustCallStatus *uniffi_out_err
|
|
225
|
-
);
|
|
226
241
|
RustBuffer uniffi_ddk_ffi_fn_func_sign_fund_transaction_input(
|
|
227
242
|
RustBuffer fund_transaction,
|
|
228
243
|
RustBuffer privkey,
|
|
@@ -454,6 +469,8 @@ extern "C" {
|
|
|
454
469
|
/*handle*/ uint64_t handle,
|
|
455
470
|
RustCallStatus *uniffi_out_err
|
|
456
471
|
);
|
|
472
|
+
uint16_t uniffi_ddk_ffi_checksum_func_convert_mnemonic_to_seed(
|
|
473
|
+
);
|
|
457
474
|
uint16_t uniffi_ddk_ffi_checksum_func_create_cet(
|
|
458
475
|
);
|
|
459
476
|
uint16_t uniffi_ddk_ffi_checksum_func_create_cet_adaptor_signature_from_oracle_info(
|
|
@@ -468,15 +485,17 @@ extern "C" {
|
|
|
468
485
|
);
|
|
469
486
|
uint16_t uniffi_ddk_ffi_checksum_func_create_spliced_dlc_transactions(
|
|
470
487
|
);
|
|
488
|
+
uint16_t uniffi_ddk_ffi_checksum_func_create_xpriv_from_parent_path(
|
|
489
|
+
);
|
|
471
490
|
uint16_t uniffi_ddk_ffi_checksum_func_get_change_output_and_fees(
|
|
472
491
|
);
|
|
473
492
|
uint16_t uniffi_ddk_ffi_checksum_func_get_raw_funding_transaction_input_signature(
|
|
474
493
|
);
|
|
475
494
|
uint16_t uniffi_ddk_ffi_checksum_func_get_total_input_vsize(
|
|
476
495
|
);
|
|
477
|
-
uint16_t
|
|
496
|
+
uint16_t uniffi_ddk_ffi_checksum_func_get_xpub_from_xpriv(
|
|
478
497
|
);
|
|
479
|
-
uint16_t
|
|
498
|
+
uint16_t uniffi_ddk_ffi_checksum_func_is_dust_output(
|
|
480
499
|
);
|
|
481
500
|
uint16_t uniffi_ddk_ffi_checksum_func_sign_fund_transaction_input(
|
|
482
501
|
);
|
|
@@ -2028,6 +2047,14 @@ NativeDdkFfi::NativeDdkFfi(
|
|
|
2028
2047
|
return this->cpp_uniffi_internal_fn_func_ffi__arraybuffer_to_string(rt, thisVal, args, count);
|
|
2029
2048
|
}
|
|
2030
2049
|
);
|
|
2050
|
+
props["ubrn_uniffi_ddk_ffi_fn_func_convert_mnemonic_to_seed"] = jsi::Function::createFromHostFunction(
|
|
2051
|
+
rt,
|
|
2052
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_ddk_ffi_fn_func_convert_mnemonic_to_seed"),
|
|
2053
|
+
2,
|
|
2054
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2055
|
+
return this->cpp_uniffi_ddk_ffi_fn_func_convert_mnemonic_to_seed(rt, thisVal, args, count);
|
|
2056
|
+
}
|
|
2057
|
+
);
|
|
2031
2058
|
props["ubrn_uniffi_ddk_ffi_fn_func_create_cet"] = jsi::Function::createFromHostFunction(
|
|
2032
2059
|
rt,
|
|
2033
2060
|
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_ddk_ffi_fn_func_create_cet"),
|
|
@@ -2084,6 +2111,14 @@ NativeDdkFfi::NativeDdkFfi(
|
|
|
2084
2111
|
return this->cpp_uniffi_ddk_ffi_fn_func_create_spliced_dlc_transactions(rt, thisVal, args, count);
|
|
2085
2112
|
}
|
|
2086
2113
|
);
|
|
2114
|
+
props["ubrn_uniffi_ddk_ffi_fn_func_create_xpriv_from_parent_path"] = jsi::Function::createFromHostFunction(
|
|
2115
|
+
rt,
|
|
2116
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_ddk_ffi_fn_func_create_xpriv_from_parent_path"),
|
|
2117
|
+
4,
|
|
2118
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2119
|
+
return this->cpp_uniffi_ddk_ffi_fn_func_create_xpriv_from_parent_path(rt, thisVal, args, count);
|
|
2120
|
+
}
|
|
2121
|
+
);
|
|
2087
2122
|
props["ubrn_uniffi_ddk_ffi_fn_func_get_change_output_and_fees"] = jsi::Function::createFromHostFunction(
|
|
2088
2123
|
rt,
|
|
2089
2124
|
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_ddk_ffi_fn_func_get_change_output_and_fees"),
|
|
@@ -2108,20 +2143,20 @@ NativeDdkFfi::NativeDdkFfi(
|
|
|
2108
2143
|
return this->cpp_uniffi_ddk_ffi_fn_func_get_total_input_vsize(rt, thisVal, args, count);
|
|
2109
2144
|
}
|
|
2110
2145
|
);
|
|
2111
|
-
props["
|
|
2146
|
+
props["ubrn_uniffi_ddk_ffi_fn_func_get_xpub_from_xpriv"] = jsi::Function::createFromHostFunction(
|
|
2112
2147
|
rt,
|
|
2113
|
-
jsi::PropNameID::forAscii(rt, "
|
|
2114
|
-
|
|
2148
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_ddk_ffi_fn_func_get_xpub_from_xpriv"),
|
|
2149
|
+
2,
|
|
2115
2150
|
[this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2116
|
-
return this->
|
|
2151
|
+
return this->cpp_uniffi_ddk_ffi_fn_func_get_xpub_from_xpriv(rt, thisVal, args, count);
|
|
2117
2152
|
}
|
|
2118
2153
|
);
|
|
2119
|
-
props["
|
|
2154
|
+
props["ubrn_uniffi_ddk_ffi_fn_func_is_dust_output"] = jsi::Function::createFromHostFunction(
|
|
2120
2155
|
rt,
|
|
2121
|
-
jsi::PropNameID::forAscii(rt, "
|
|
2122
|
-
|
|
2156
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_ddk_ffi_fn_func_is_dust_output"),
|
|
2157
|
+
1,
|
|
2123
2158
|
[this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2124
|
-
return this->
|
|
2159
|
+
return this->cpp_uniffi_ddk_ffi_fn_func_is_dust_output(rt, thisVal, args, count);
|
|
2125
2160
|
}
|
|
2126
2161
|
);
|
|
2127
2162
|
props["ubrn_uniffi_ddk_ffi_fn_func_sign_fund_transaction_input"] = jsi::Function::createFromHostFunction(
|
|
@@ -2148,6 +2183,14 @@ NativeDdkFfi::NativeDdkFfi(
|
|
|
2148
2183
|
return this->cpp_uniffi_ddk_ffi_fn_func_version(rt, thisVal, args, count);
|
|
2149
2184
|
}
|
|
2150
2185
|
);
|
|
2186
|
+
props["ubrn_uniffi_ddk_ffi_checksum_func_convert_mnemonic_to_seed"] = jsi::Function::createFromHostFunction(
|
|
2187
|
+
rt,
|
|
2188
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_ddk_ffi_checksum_func_convert_mnemonic_to_seed"),
|
|
2189
|
+
0,
|
|
2190
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2191
|
+
return this->cpp_uniffi_ddk_ffi_checksum_func_convert_mnemonic_to_seed(rt, thisVal, args, count);
|
|
2192
|
+
}
|
|
2193
|
+
);
|
|
2151
2194
|
props["ubrn_uniffi_ddk_ffi_checksum_func_create_cet"] = jsi::Function::createFromHostFunction(
|
|
2152
2195
|
rt,
|
|
2153
2196
|
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_ddk_ffi_checksum_func_create_cet"),
|
|
@@ -2204,6 +2247,14 @@ NativeDdkFfi::NativeDdkFfi(
|
|
|
2204
2247
|
return this->cpp_uniffi_ddk_ffi_checksum_func_create_spliced_dlc_transactions(rt, thisVal, args, count);
|
|
2205
2248
|
}
|
|
2206
2249
|
);
|
|
2250
|
+
props["ubrn_uniffi_ddk_ffi_checksum_func_create_xpriv_from_parent_path"] = jsi::Function::createFromHostFunction(
|
|
2251
|
+
rt,
|
|
2252
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_ddk_ffi_checksum_func_create_xpriv_from_parent_path"),
|
|
2253
|
+
0,
|
|
2254
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2255
|
+
return this->cpp_uniffi_ddk_ffi_checksum_func_create_xpriv_from_parent_path(rt, thisVal, args, count);
|
|
2256
|
+
}
|
|
2257
|
+
);
|
|
2207
2258
|
props["ubrn_uniffi_ddk_ffi_checksum_func_get_change_output_and_fees"] = jsi::Function::createFromHostFunction(
|
|
2208
2259
|
rt,
|
|
2209
2260
|
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_ddk_ffi_checksum_func_get_change_output_and_fees"),
|
|
@@ -2228,20 +2279,20 @@ NativeDdkFfi::NativeDdkFfi(
|
|
|
2228
2279
|
return this->cpp_uniffi_ddk_ffi_checksum_func_get_total_input_vsize(rt, thisVal, args, count);
|
|
2229
2280
|
}
|
|
2230
2281
|
);
|
|
2231
|
-
props["
|
|
2282
|
+
props["ubrn_uniffi_ddk_ffi_checksum_func_get_xpub_from_xpriv"] = jsi::Function::createFromHostFunction(
|
|
2232
2283
|
rt,
|
|
2233
|
-
jsi::PropNameID::forAscii(rt, "
|
|
2284
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_ddk_ffi_checksum_func_get_xpub_from_xpriv"),
|
|
2234
2285
|
0,
|
|
2235
2286
|
[this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2236
|
-
return this->
|
|
2287
|
+
return this->cpp_uniffi_ddk_ffi_checksum_func_get_xpub_from_xpriv(rt, thisVal, args, count);
|
|
2237
2288
|
}
|
|
2238
2289
|
);
|
|
2239
|
-
props["
|
|
2290
|
+
props["ubrn_uniffi_ddk_ffi_checksum_func_is_dust_output"] = jsi::Function::createFromHostFunction(
|
|
2240
2291
|
rt,
|
|
2241
|
-
jsi::PropNameID::forAscii(rt, "
|
|
2292
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_ddk_ffi_checksum_func_is_dust_output"),
|
|
2242
2293
|
0,
|
|
2243
2294
|
[this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2244
|
-
return this->
|
|
2295
|
+
return this->cpp_uniffi_ddk_ffi_checksum_func_is_dust_output(rt, thisVal, args, count);
|
|
2245
2296
|
}
|
|
2246
2297
|
);
|
|
2247
2298
|
props["ubrn_uniffi_ddk_ffi_checksum_func_sign_fund_transaction_input"] = jsi::Function::createFromHostFunction(
|
|
@@ -2331,6 +2382,16 @@ jsi::Value NativeDdkFfi::cpp_uniffi_internal_fn_func_ffi__arraybuffer_to_string(
|
|
|
2331
2382
|
}
|
|
2332
2383
|
|
|
2333
2384
|
// Methods calling directly into the uniffi generated C API of the Rust crate.
|
|
2385
|
+
jsi::Value NativeDdkFfi::cpp_uniffi_ddk_ffi_fn_func_convert_mnemonic_to_seed(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
|
|
2386
|
+
RustCallStatus status = uniffi::ddk_ffi::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
2387
|
+
auto value = uniffi_ddk_ffi_fn_func_convert_mnemonic_to_seed(uniffi::ddk_ffi::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[0]), uniffi::ddk_ffi::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[1]),
|
|
2388
|
+
&status
|
|
2389
|
+
);
|
|
2390
|
+
uniffi::ddk_ffi::Bridging<RustCallStatus>::copyIntoJs(rt, callInvoker, status, args[count - 1]);
|
|
2391
|
+
|
|
2392
|
+
|
|
2393
|
+
return uniffi::ddk_ffi::Bridging<RustBuffer>::toJs(rt, callInvoker, value);
|
|
2394
|
+
}
|
|
2334
2395
|
jsi::Value NativeDdkFfi::cpp_uniffi_ddk_ffi_fn_func_create_cet(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
|
|
2335
2396
|
RustCallStatus status = uniffi::ddk_ffi::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
2336
2397
|
auto value = uniffi_ddk_ffi_fn_func_create_cet(uniffi::ddk_ffi::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[0]), uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[1]), uniffi::ddk_ffi::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[2]), uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[3]), uniffi::ddk_ffi::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[4]), uniffi_jsi::Bridging<uint32_t>::fromJs(rt, callInvoker, args[5]), uniffi_jsi::Bridging<uint32_t>::fromJs(rt, callInvoker, args[6]),
|
|
@@ -2399,6 +2460,16 @@ jsi::Value NativeDdkFfi::cpp_uniffi_ddk_ffi_fn_func_create_spliced_dlc_transacti
|
|
|
2399
2460
|
uniffi::ddk_ffi::Bridging<RustCallStatus>::copyIntoJs(rt, callInvoker, status, args[count - 1]);
|
|
2400
2461
|
|
|
2401
2462
|
|
|
2463
|
+
return uniffi::ddk_ffi::Bridging<RustBuffer>::toJs(rt, callInvoker, value);
|
|
2464
|
+
}
|
|
2465
|
+
jsi::Value NativeDdkFfi::cpp_uniffi_ddk_ffi_fn_func_create_xpriv_from_parent_path(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
|
|
2466
|
+
RustCallStatus status = uniffi::ddk_ffi::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
2467
|
+
auto value = uniffi_ddk_ffi_fn_func_create_xpriv_from_parent_path(uniffi::ddk_ffi::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[0]), uniffi::ddk_ffi::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[1]), uniffi::ddk_ffi::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[2]), uniffi::ddk_ffi::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[3]),
|
|
2468
|
+
&status
|
|
2469
|
+
);
|
|
2470
|
+
uniffi::ddk_ffi::Bridging<RustCallStatus>::copyIntoJs(rt, callInvoker, status, args[count - 1]);
|
|
2471
|
+
|
|
2472
|
+
|
|
2402
2473
|
return uniffi::ddk_ffi::Bridging<RustBuffer>::toJs(rt, callInvoker, value);
|
|
2403
2474
|
}
|
|
2404
2475
|
jsi::Value NativeDdkFfi::cpp_uniffi_ddk_ffi_fn_func_get_change_output_and_fees(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
|
|
@@ -2431,24 +2502,25 @@ jsi::Value NativeDdkFfi::cpp_uniffi_ddk_ffi_fn_func_get_total_input_vsize(jsi::R
|
|
|
2431
2502
|
|
|
2432
2503
|
return uniffi_jsi::Bridging<uint32_t>::toJs(rt, callInvoker, value);
|
|
2433
2504
|
}
|
|
2434
|
-
jsi::Value NativeDdkFfi::
|
|
2505
|
+
jsi::Value NativeDdkFfi::cpp_uniffi_ddk_ffi_fn_func_get_xpub_from_xpriv(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
|
|
2435
2506
|
RustCallStatus status = uniffi::ddk_ffi::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
2436
|
-
auto value =
|
|
2507
|
+
auto value = uniffi_ddk_ffi_fn_func_get_xpub_from_xpriv(uniffi::ddk_ffi::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[0]), uniffi::ddk_ffi::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[1]),
|
|
2437
2508
|
&status
|
|
2438
2509
|
);
|
|
2439
2510
|
uniffi::ddk_ffi::Bridging<RustCallStatus>::copyIntoJs(rt, callInvoker, status, args[count - 1]);
|
|
2440
2511
|
|
|
2441
2512
|
|
|
2442
|
-
return
|
|
2513
|
+
return uniffi::ddk_ffi::Bridging<RustBuffer>::toJs(rt, callInvoker, value);
|
|
2443
2514
|
}
|
|
2444
|
-
jsi::Value NativeDdkFfi::
|
|
2515
|
+
jsi::Value NativeDdkFfi::cpp_uniffi_ddk_ffi_fn_func_is_dust_output(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
|
|
2445
2516
|
RustCallStatus status = uniffi::ddk_ffi::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
2446
|
-
auto value =
|
|
2517
|
+
auto value = uniffi_ddk_ffi_fn_func_is_dust_output(uniffi::ddk_ffi::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[0]),
|
|
2518
|
+
&status
|
|
2447
2519
|
);
|
|
2448
2520
|
uniffi::ddk_ffi::Bridging<RustCallStatus>::copyIntoJs(rt, callInvoker, status, args[count - 1]);
|
|
2449
2521
|
|
|
2450
2522
|
|
|
2451
|
-
return
|
|
2523
|
+
return uniffi_jsi::Bridging<int8_t>::toJs(rt, callInvoker, value);
|
|
2452
2524
|
}
|
|
2453
2525
|
jsi::Value NativeDdkFfi::cpp_uniffi_ddk_ffi_fn_func_sign_fund_transaction_input(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
|
|
2454
2526
|
RustCallStatus status = uniffi::ddk_ffi::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
@@ -2479,6 +2551,13 @@ jsi::Value NativeDdkFfi::cpp_uniffi_ddk_ffi_fn_func_version(jsi::Runtime& rt, co
|
|
|
2479
2551
|
|
|
2480
2552
|
return uniffi::ddk_ffi::Bridging<RustBuffer>::toJs(rt, callInvoker, value);
|
|
2481
2553
|
}
|
|
2554
|
+
jsi::Value NativeDdkFfi::cpp_uniffi_ddk_ffi_checksum_func_convert_mnemonic_to_seed(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
|
|
2555
|
+
auto value = uniffi_ddk_ffi_checksum_func_convert_mnemonic_to_seed(
|
|
2556
|
+
);
|
|
2557
|
+
|
|
2558
|
+
|
|
2559
|
+
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
2560
|
+
}
|
|
2482
2561
|
jsi::Value NativeDdkFfi::cpp_uniffi_ddk_ffi_checksum_func_create_cet(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
|
|
2483
2562
|
auto value = uniffi_ddk_ffi_checksum_func_create_cet(
|
|
2484
2563
|
);
|
|
@@ -2526,6 +2605,13 @@ jsi::Value NativeDdkFfi::cpp_uniffi_ddk_ffi_checksum_func_create_spliced_dlc_tra
|
|
|
2526
2605
|
);
|
|
2527
2606
|
|
|
2528
2607
|
|
|
2608
|
+
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
2609
|
+
}
|
|
2610
|
+
jsi::Value NativeDdkFfi::cpp_uniffi_ddk_ffi_checksum_func_create_xpriv_from_parent_path(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
|
|
2611
|
+
auto value = uniffi_ddk_ffi_checksum_func_create_xpriv_from_parent_path(
|
|
2612
|
+
);
|
|
2613
|
+
|
|
2614
|
+
|
|
2529
2615
|
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
2530
2616
|
}
|
|
2531
2617
|
jsi::Value NativeDdkFfi::cpp_uniffi_ddk_ffi_checksum_func_get_change_output_and_fees(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
|
|
@@ -2549,15 +2635,15 @@ jsi::Value NativeDdkFfi::cpp_uniffi_ddk_ffi_checksum_func_get_total_input_vsize(
|
|
|
2549
2635
|
|
|
2550
2636
|
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
2551
2637
|
}
|
|
2552
|
-
jsi::Value NativeDdkFfi::
|
|
2553
|
-
auto value =
|
|
2638
|
+
jsi::Value NativeDdkFfi::cpp_uniffi_ddk_ffi_checksum_func_get_xpub_from_xpriv(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
|
|
2639
|
+
auto value = uniffi_ddk_ffi_checksum_func_get_xpub_from_xpriv(
|
|
2554
2640
|
);
|
|
2555
2641
|
|
|
2556
2642
|
|
|
2557
2643
|
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
2558
2644
|
}
|
|
2559
|
-
jsi::Value NativeDdkFfi::
|
|
2560
|
-
auto value =
|
|
2645
|
+
jsi::Value NativeDdkFfi::cpp_uniffi_ddk_ffi_checksum_func_is_dust_output(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
|
|
2646
|
+
auto value = uniffi_ddk_ffi_checksum_func_is_dust_output(
|
|
2561
2647
|
);
|
|
2562
2648
|
|
|
2563
2649
|
|
package/cpp/ddk_ffi.hpp
CHANGED
|
@@ -21,6 +21,7 @@ class NativeDdkFfi : public jsi::HostObject {
|
|
|
21
21
|
jsi::Value cpp_uniffi_internal_fn_func_ffi__string_to_byte_length(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
22
22
|
jsi::Value cpp_uniffi_internal_fn_func_ffi__string_to_arraybuffer(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
23
23
|
jsi::Value cpp_uniffi_internal_fn_func_ffi__arraybuffer_to_string(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
24
|
+
jsi::Value cpp_uniffi_ddk_ffi_fn_func_convert_mnemonic_to_seed(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
24
25
|
jsi::Value cpp_uniffi_ddk_ffi_fn_func_create_cet(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
25
26
|
jsi::Value cpp_uniffi_ddk_ffi_fn_func_create_cet_adaptor_signature_from_oracle_info(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
26
27
|
jsi::Value cpp_uniffi_ddk_ffi_fn_func_create_cets(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
@@ -28,14 +29,16 @@ class NativeDdkFfi : public jsi::HostObject {
|
|
|
28
29
|
jsi::Value cpp_uniffi_ddk_ffi_fn_func_create_fund_tx_locking_script(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
29
30
|
jsi::Value cpp_uniffi_ddk_ffi_fn_func_create_refund_transaction(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
30
31
|
jsi::Value cpp_uniffi_ddk_ffi_fn_func_create_spliced_dlc_transactions(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
32
|
+
jsi::Value cpp_uniffi_ddk_ffi_fn_func_create_xpriv_from_parent_path(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
31
33
|
jsi::Value cpp_uniffi_ddk_ffi_fn_func_get_change_output_and_fees(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
32
34
|
jsi::Value cpp_uniffi_ddk_ffi_fn_func_get_raw_funding_transaction_input_signature(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
33
35
|
jsi::Value cpp_uniffi_ddk_ffi_fn_func_get_total_input_vsize(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
36
|
+
jsi::Value cpp_uniffi_ddk_ffi_fn_func_get_xpub_from_xpriv(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
34
37
|
jsi::Value cpp_uniffi_ddk_ffi_fn_func_is_dust_output(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
35
|
-
jsi::Value cpp_uniffi_ddk_ffi_fn_func_plz_work(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
36
38
|
jsi::Value cpp_uniffi_ddk_ffi_fn_func_sign_fund_transaction_input(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
37
39
|
jsi::Value cpp_uniffi_ddk_ffi_fn_func_verify_fund_tx_signature(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
38
40
|
jsi::Value cpp_uniffi_ddk_ffi_fn_func_version(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
41
|
+
jsi::Value cpp_uniffi_ddk_ffi_checksum_func_convert_mnemonic_to_seed(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
39
42
|
jsi::Value cpp_uniffi_ddk_ffi_checksum_func_create_cet(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
40
43
|
jsi::Value cpp_uniffi_ddk_ffi_checksum_func_create_cet_adaptor_signature_from_oracle_info(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
41
44
|
jsi::Value cpp_uniffi_ddk_ffi_checksum_func_create_cets(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
@@ -43,11 +46,12 @@ class NativeDdkFfi : public jsi::HostObject {
|
|
|
43
46
|
jsi::Value cpp_uniffi_ddk_ffi_checksum_func_create_fund_tx_locking_script(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
44
47
|
jsi::Value cpp_uniffi_ddk_ffi_checksum_func_create_refund_transaction(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
45
48
|
jsi::Value cpp_uniffi_ddk_ffi_checksum_func_create_spliced_dlc_transactions(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
49
|
+
jsi::Value cpp_uniffi_ddk_ffi_checksum_func_create_xpriv_from_parent_path(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
46
50
|
jsi::Value cpp_uniffi_ddk_ffi_checksum_func_get_change_output_and_fees(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
47
51
|
jsi::Value cpp_uniffi_ddk_ffi_checksum_func_get_raw_funding_transaction_input_signature(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
48
52
|
jsi::Value cpp_uniffi_ddk_ffi_checksum_func_get_total_input_vsize(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
53
|
+
jsi::Value cpp_uniffi_ddk_ffi_checksum_func_get_xpub_from_xpriv(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
49
54
|
jsi::Value cpp_uniffi_ddk_ffi_checksum_func_is_dust_output(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
50
|
-
jsi::Value cpp_uniffi_ddk_ffi_checksum_func_plz_work(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
51
55
|
jsi::Value cpp_uniffi_ddk_ffi_checksum_func_sign_fund_transaction_input(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
52
56
|
jsi::Value cpp_uniffi_ddk_ffi_checksum_func_verify_fund_tx_signature(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
53
57
|
jsi::Value cpp_uniffi_ddk_ffi_checksum_func_version(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
package/ddk-ffi/Cargo.lock
CHANGED
|
@@ -74,8 +74,8 @@ version = "0.1.0"
|
|
|
74
74
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
75
75
|
checksum = "2c8d66485a3a2ea485c1913c4572ce0256067a5377ac8c75c4960e1cda98605f"
|
|
76
76
|
dependencies = [
|
|
77
|
-
"bitcoin-internals",
|
|
78
|
-
"bitcoin_hashes",
|
|
77
|
+
"bitcoin-internals 0.3.0",
|
|
78
|
+
"bitcoin_hashes 0.14.0",
|
|
79
79
|
]
|
|
80
80
|
|
|
81
81
|
[[package]]
|
|
@@ -93,6 +93,19 @@ version = "0.11.0"
|
|
|
93
93
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
94
94
|
checksum = "d965446196e3b7decd44aa7ee49e31d630118f90ef12f97900f262eb915c951d"
|
|
95
95
|
|
|
96
|
+
[[package]]
|
|
97
|
+
name = "bip39"
|
|
98
|
+
version = "2.2.0"
|
|
99
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
100
|
+
checksum = "43d193de1f7487df1914d3a568b772458861d33f9c54249612cc2893d6915054"
|
|
101
|
+
dependencies = [
|
|
102
|
+
"bitcoin_hashes 0.13.0",
|
|
103
|
+
"rand",
|
|
104
|
+
"rand_core",
|
|
105
|
+
"serde",
|
|
106
|
+
"unicode-normalization",
|
|
107
|
+
]
|
|
108
|
+
|
|
96
109
|
[[package]]
|
|
97
110
|
name = "bitcoin"
|
|
98
111
|
version = "0.32.7"
|
|
@@ -101,16 +114,22 @@ checksum = "0fda569d741b895131a88ee5589a467e73e9c4718e958ac9308e4f7dc44b6945"
|
|
|
101
114
|
dependencies = [
|
|
102
115
|
"base58ck",
|
|
103
116
|
"bech32",
|
|
104
|
-
"bitcoin-internals",
|
|
117
|
+
"bitcoin-internals 0.3.0",
|
|
105
118
|
"bitcoin-io",
|
|
106
119
|
"bitcoin-units",
|
|
107
|
-
"bitcoin_hashes",
|
|
108
|
-
"hex-conservative",
|
|
120
|
+
"bitcoin_hashes 0.14.0",
|
|
121
|
+
"hex-conservative 0.2.1",
|
|
109
122
|
"hex_lit",
|
|
110
123
|
"secp256k1",
|
|
111
124
|
"serde",
|
|
112
125
|
]
|
|
113
126
|
|
|
127
|
+
[[package]]
|
|
128
|
+
name = "bitcoin-internals"
|
|
129
|
+
version = "0.2.0"
|
|
130
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
131
|
+
checksum = "9425c3bf7089c983facbae04de54513cce73b41c7f9ff8c845b54e7bc64ebbfb"
|
|
132
|
+
|
|
114
133
|
[[package]]
|
|
115
134
|
name = "bitcoin-internals"
|
|
116
135
|
version = "0.3.0"
|
|
@@ -138,10 +157,20 @@ version = "0.1.2"
|
|
|
138
157
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
139
158
|
checksum = "5285c8bcaa25876d07f37e3d30c303f2609179716e11d688f51e8f1fe70063e2"
|
|
140
159
|
dependencies = [
|
|
141
|
-
"bitcoin-internals",
|
|
160
|
+
"bitcoin-internals 0.3.0",
|
|
142
161
|
"serde",
|
|
143
162
|
]
|
|
144
163
|
|
|
164
|
+
[[package]]
|
|
165
|
+
name = "bitcoin_hashes"
|
|
166
|
+
version = "0.13.0"
|
|
167
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
168
|
+
checksum = "1930a4dabfebb8d7d9992db18ebe3ae2876f0a305fab206fd168df931ede293b"
|
|
169
|
+
dependencies = [
|
|
170
|
+
"bitcoin-internals 0.2.0",
|
|
171
|
+
"hex-conservative 0.1.2",
|
|
172
|
+
]
|
|
173
|
+
|
|
145
174
|
[[package]]
|
|
146
175
|
name = "bitcoin_hashes"
|
|
147
176
|
version = "0.14.0"
|
|
@@ -149,7 +178,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
149
178
|
checksum = "bb18c03d0db0247e147a21a6faafd5a7eb851c743db062de72018b6b7e8e4d16"
|
|
150
179
|
dependencies = [
|
|
151
180
|
"bitcoin-io",
|
|
152
|
-
"hex-conservative",
|
|
181
|
+
"hex-conservative 0.2.1",
|
|
153
182
|
"serde",
|
|
154
183
|
]
|
|
155
184
|
|
|
@@ -253,8 +282,9 @@ checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675"
|
|
|
253
282
|
|
|
254
283
|
[[package]]
|
|
255
284
|
name = "ddk_ffi"
|
|
256
|
-
version = "0.
|
|
285
|
+
version = "0.3.0"
|
|
257
286
|
dependencies = [
|
|
287
|
+
"bip39",
|
|
258
288
|
"bitcoin",
|
|
259
289
|
"dlc",
|
|
260
290
|
"secp256k1-zkp",
|
|
@@ -357,6 +387,12 @@ version = "0.5.0"
|
|
|
357
387
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
358
388
|
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
|
|
359
389
|
|
|
390
|
+
[[package]]
|
|
391
|
+
name = "hex-conservative"
|
|
392
|
+
version = "0.1.2"
|
|
393
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
394
|
+
checksum = "212ab92002354b4819390025006c897e8140934349e8635c9b077f47b4dcbd20"
|
|
395
|
+
|
|
360
396
|
[[package]]
|
|
361
397
|
name = "hex-conservative"
|
|
362
398
|
version = "0.2.1"
|
|
@@ -570,7 +606,7 @@ version = "0.29.1"
|
|
|
570
606
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
571
607
|
checksum = "9465315bc9d4566e1724f0fffcbcc446268cb522e60f9a27bcded6b19c108113"
|
|
572
608
|
dependencies = [
|
|
573
|
-
"bitcoin_hashes",
|
|
609
|
+
"bitcoin_hashes 0.14.0",
|
|
574
610
|
"rand",
|
|
575
611
|
"secp256k1-sys",
|
|
576
612
|
"serde",
|
|
@@ -732,6 +768,21 @@ dependencies = [
|
|
|
732
768
|
"syn",
|
|
733
769
|
]
|
|
734
770
|
|
|
771
|
+
[[package]]
|
|
772
|
+
name = "tinyvec"
|
|
773
|
+
version = "1.9.0"
|
|
774
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
775
|
+
checksum = "09b3661f17e86524eccd4371ab0429194e0d7c008abb45f7a7495b1719463c71"
|
|
776
|
+
dependencies = [
|
|
777
|
+
"tinyvec_macros",
|
|
778
|
+
]
|
|
779
|
+
|
|
780
|
+
[[package]]
|
|
781
|
+
name = "tinyvec_macros"
|
|
782
|
+
version = "0.1.1"
|
|
783
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
784
|
+
checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
|
|
785
|
+
|
|
735
786
|
[[package]]
|
|
736
787
|
name = "toml"
|
|
737
788
|
version = "0.5.11"
|
|
@@ -747,6 +798,15 @@ version = "1.0.18"
|
|
|
747
798
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
748
799
|
checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512"
|
|
749
800
|
|
|
801
|
+
[[package]]
|
|
802
|
+
name = "unicode-normalization"
|
|
803
|
+
version = "0.1.24"
|
|
804
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
805
|
+
checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956"
|
|
806
|
+
dependencies = [
|
|
807
|
+
"tinyvec",
|
|
808
|
+
]
|
|
809
|
+
|
|
750
810
|
[[package]]
|
|
751
811
|
name = "uniffi"
|
|
752
812
|
version = "0.29.4"
|
package/ddk-ffi/Cargo.toml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "ddk_ffi"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.3.0"
|
|
4
4
|
edition = "2021"
|
|
5
5
|
license = "MIT"
|
|
6
6
|
description = "rust-dlc language bindings"
|
|
@@ -19,6 +19,10 @@ dlc = { git = "https://github.com/bennyhodl/dlcdevkit.git", branch = "determinis
|
|
|
19
19
|
bitcoin = "0.32.7"
|
|
20
20
|
thiserror = "2.0.12"
|
|
21
21
|
secp256k1-zkp = "0.11.0"
|
|
22
|
+
bip39 = "2.2.0"
|
|
23
|
+
|
|
24
|
+
[dev-dependencies]
|
|
25
|
+
bip39 = {version = "2.2.0", features = ["rand"]}
|
|
22
26
|
|
|
23
27
|
[build-dependencies]
|
|
24
28
|
uniffi = { version = "0.29.4", features = ["build"] }
|
package/ddk-ffi/src/ddk_ffi.udl
CHANGED
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
namespace ddk_ffi {
|
|
2
2
|
string version();
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
[Throws=DLCError]
|
|
4
|
+
sequence<u8> convert_mnemonic_to_seed(string mnemonic, string? passphrase);
|
|
5
|
+
[Throws=DLCError]
|
|
6
|
+
sequence<u8> create_xpriv_from_parent_path(
|
|
7
|
+
sequence<u8> xpriv,
|
|
8
|
+
string base_derivation_path,
|
|
9
|
+
string network,
|
|
10
|
+
string path
|
|
11
|
+
);
|
|
12
|
+
[Throws=DLCError]
|
|
13
|
+
sequence<u8> get_xpub_from_xpriv(sequence<u8> xpriv, string network);
|
|
14
|
+
|
|
15
|
+
|
|
5
16
|
// DLC Transaction Creation Functions
|
|
6
17
|
[Throws=DLCError]
|
|
7
18
|
sequence<u8> create_fund_tx_locking_script(
|
|
@@ -226,5 +237,14 @@ enum DLCError {
|
|
|
226
237
|
"SerializationError",
|
|
227
238
|
"Secp256k1Error",
|
|
228
239
|
"MiniscriptError",
|
|
229
|
-
"
|
|
240
|
+
"InvalidNetwork",
|
|
241
|
+
"KeyError",
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
[Error]
|
|
245
|
+
enum ExtendedKey {
|
|
246
|
+
"InvalidMnemonic",
|
|
247
|
+
"InvalidXpriv",
|
|
248
|
+
"InvalidXpub",
|
|
249
|
+
"InvalidDerivationPath",
|
|
230
250
|
};
|