@bennyblader/ddk-rn 0.2.7 → 0.3.1
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/cpp/ddk_ffi.cpp +144 -13
- package/cpp/ddk_ffi.hpp +8 -2
- package/ddk-ffi/Cargo.lock +69 -9
- package/ddk-ffi/Cargo.toml +5 -1
- package/ddk-ffi/src/ddk_ffi.udl +34 -3
- package/ddk-ffi/src/lib.rs +179 -20
- package/lib/commonjs/ddk_ffi-ffi.js.map +1 -1
- package/lib/commonjs/ddk_ffi.js +208 -15
- 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 +204 -14
- package/lib/module/ddk_ffi.js.map +1 -1
- package/lib/typescript/commonjs/src/ddk_ffi-ffi.d.ts +8 -2
- package/lib/typescript/commonjs/src/ddk_ffi-ffi.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/ddk_ffi.d.ts +211 -5
- package/lib/typescript/commonjs/src/ddk_ffi.d.ts.map +1 -1
- package/lib/typescript/module/src/ddk_ffi-ffi.d.ts +8 -2
- package/lib/typescript/module/src/ddk_ffi-ffi.d.ts.map +1 -1
- package/lib/typescript/module/src/ddk_ffi.d.ts +211 -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 +29 -2
- package/src/ddk_ffi.ts +320 -15
- package/ddk-ffi/scratchpad.txt +0 -243
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,11 +229,24 @@ 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
|
|
241
|
+
RustBuffer uniffi_ddk_ffi_fn_func_sign_cet(
|
|
242
|
+
RustBuffer cet,
|
|
243
|
+
RustBuffer adaptor_signature,
|
|
244
|
+
RustBuffer oracle_signatures,
|
|
245
|
+
RustBuffer funding_secret_key,
|
|
246
|
+
RustBuffer other_pubkey,
|
|
247
|
+
RustBuffer funding_script_pubkey,
|
|
248
|
+
uint64_t fund_output_value,
|
|
249
|
+
RustCallStatus *uniffi_out_err
|
|
225
250
|
);
|
|
226
251
|
RustBuffer uniffi_ddk_ffi_fn_func_sign_fund_transaction_input(
|
|
227
252
|
RustBuffer fund_transaction,
|
|
@@ -454,6 +479,8 @@ extern "C" {
|
|
|
454
479
|
/*handle*/ uint64_t handle,
|
|
455
480
|
RustCallStatus *uniffi_out_err
|
|
456
481
|
);
|
|
482
|
+
uint16_t uniffi_ddk_ffi_checksum_func_convert_mnemonic_to_seed(
|
|
483
|
+
);
|
|
457
484
|
uint16_t uniffi_ddk_ffi_checksum_func_create_cet(
|
|
458
485
|
);
|
|
459
486
|
uint16_t uniffi_ddk_ffi_checksum_func_create_cet_adaptor_signature_from_oracle_info(
|
|
@@ -468,15 +495,19 @@ extern "C" {
|
|
|
468
495
|
);
|
|
469
496
|
uint16_t uniffi_ddk_ffi_checksum_func_create_spliced_dlc_transactions(
|
|
470
497
|
);
|
|
498
|
+
uint16_t uniffi_ddk_ffi_checksum_func_create_xpriv_from_parent_path(
|
|
499
|
+
);
|
|
471
500
|
uint16_t uniffi_ddk_ffi_checksum_func_get_change_output_and_fees(
|
|
472
501
|
);
|
|
473
502
|
uint16_t uniffi_ddk_ffi_checksum_func_get_raw_funding_transaction_input_signature(
|
|
474
503
|
);
|
|
475
504
|
uint16_t uniffi_ddk_ffi_checksum_func_get_total_input_vsize(
|
|
476
505
|
);
|
|
506
|
+
uint16_t uniffi_ddk_ffi_checksum_func_get_xpub_from_xpriv(
|
|
507
|
+
);
|
|
477
508
|
uint16_t uniffi_ddk_ffi_checksum_func_is_dust_output(
|
|
478
509
|
);
|
|
479
|
-
uint16_t
|
|
510
|
+
uint16_t uniffi_ddk_ffi_checksum_func_sign_cet(
|
|
480
511
|
);
|
|
481
512
|
uint16_t uniffi_ddk_ffi_checksum_func_sign_fund_transaction_input(
|
|
482
513
|
);
|
|
@@ -2028,6 +2059,14 @@ NativeDdkFfi::NativeDdkFfi(
|
|
|
2028
2059
|
return this->cpp_uniffi_internal_fn_func_ffi__arraybuffer_to_string(rt, thisVal, args, count);
|
|
2029
2060
|
}
|
|
2030
2061
|
);
|
|
2062
|
+
props["ubrn_uniffi_ddk_ffi_fn_func_convert_mnemonic_to_seed"] = jsi::Function::createFromHostFunction(
|
|
2063
|
+
rt,
|
|
2064
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_ddk_ffi_fn_func_convert_mnemonic_to_seed"),
|
|
2065
|
+
2,
|
|
2066
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2067
|
+
return this->cpp_uniffi_ddk_ffi_fn_func_convert_mnemonic_to_seed(rt, thisVal, args, count);
|
|
2068
|
+
}
|
|
2069
|
+
);
|
|
2031
2070
|
props["ubrn_uniffi_ddk_ffi_fn_func_create_cet"] = jsi::Function::createFromHostFunction(
|
|
2032
2071
|
rt,
|
|
2033
2072
|
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_ddk_ffi_fn_func_create_cet"),
|
|
@@ -2084,6 +2123,14 @@ NativeDdkFfi::NativeDdkFfi(
|
|
|
2084
2123
|
return this->cpp_uniffi_ddk_ffi_fn_func_create_spliced_dlc_transactions(rt, thisVal, args, count);
|
|
2085
2124
|
}
|
|
2086
2125
|
);
|
|
2126
|
+
props["ubrn_uniffi_ddk_ffi_fn_func_create_xpriv_from_parent_path"] = jsi::Function::createFromHostFunction(
|
|
2127
|
+
rt,
|
|
2128
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_ddk_ffi_fn_func_create_xpriv_from_parent_path"),
|
|
2129
|
+
4,
|
|
2130
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2131
|
+
return this->cpp_uniffi_ddk_ffi_fn_func_create_xpriv_from_parent_path(rt, thisVal, args, count);
|
|
2132
|
+
}
|
|
2133
|
+
);
|
|
2087
2134
|
props["ubrn_uniffi_ddk_ffi_fn_func_get_change_output_and_fees"] = jsi::Function::createFromHostFunction(
|
|
2088
2135
|
rt,
|
|
2089
2136
|
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_ddk_ffi_fn_func_get_change_output_and_fees"),
|
|
@@ -2108,6 +2155,14 @@ NativeDdkFfi::NativeDdkFfi(
|
|
|
2108
2155
|
return this->cpp_uniffi_ddk_ffi_fn_func_get_total_input_vsize(rt, thisVal, args, count);
|
|
2109
2156
|
}
|
|
2110
2157
|
);
|
|
2158
|
+
props["ubrn_uniffi_ddk_ffi_fn_func_get_xpub_from_xpriv"] = jsi::Function::createFromHostFunction(
|
|
2159
|
+
rt,
|
|
2160
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_ddk_ffi_fn_func_get_xpub_from_xpriv"),
|
|
2161
|
+
2,
|
|
2162
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2163
|
+
return this->cpp_uniffi_ddk_ffi_fn_func_get_xpub_from_xpriv(rt, thisVal, args, count);
|
|
2164
|
+
}
|
|
2165
|
+
);
|
|
2111
2166
|
props["ubrn_uniffi_ddk_ffi_fn_func_is_dust_output"] = jsi::Function::createFromHostFunction(
|
|
2112
2167
|
rt,
|
|
2113
2168
|
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_ddk_ffi_fn_func_is_dust_output"),
|
|
@@ -2116,12 +2171,12 @@ NativeDdkFfi::NativeDdkFfi(
|
|
|
2116
2171
|
return this->cpp_uniffi_ddk_ffi_fn_func_is_dust_output(rt, thisVal, args, count);
|
|
2117
2172
|
}
|
|
2118
2173
|
);
|
|
2119
|
-
props["
|
|
2174
|
+
props["ubrn_uniffi_ddk_ffi_fn_func_sign_cet"] = jsi::Function::createFromHostFunction(
|
|
2120
2175
|
rt,
|
|
2121
|
-
jsi::PropNameID::forAscii(rt, "
|
|
2122
|
-
|
|
2176
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_ddk_ffi_fn_func_sign_cet"),
|
|
2177
|
+
7,
|
|
2123
2178
|
[this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2124
|
-
return this->
|
|
2179
|
+
return this->cpp_uniffi_ddk_ffi_fn_func_sign_cet(rt, thisVal, args, count);
|
|
2125
2180
|
}
|
|
2126
2181
|
);
|
|
2127
2182
|
props["ubrn_uniffi_ddk_ffi_fn_func_sign_fund_transaction_input"] = jsi::Function::createFromHostFunction(
|
|
@@ -2148,6 +2203,14 @@ NativeDdkFfi::NativeDdkFfi(
|
|
|
2148
2203
|
return this->cpp_uniffi_ddk_ffi_fn_func_version(rt, thisVal, args, count);
|
|
2149
2204
|
}
|
|
2150
2205
|
);
|
|
2206
|
+
props["ubrn_uniffi_ddk_ffi_checksum_func_convert_mnemonic_to_seed"] = jsi::Function::createFromHostFunction(
|
|
2207
|
+
rt,
|
|
2208
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_ddk_ffi_checksum_func_convert_mnemonic_to_seed"),
|
|
2209
|
+
0,
|
|
2210
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2211
|
+
return this->cpp_uniffi_ddk_ffi_checksum_func_convert_mnemonic_to_seed(rt, thisVal, args, count);
|
|
2212
|
+
}
|
|
2213
|
+
);
|
|
2151
2214
|
props["ubrn_uniffi_ddk_ffi_checksum_func_create_cet"] = jsi::Function::createFromHostFunction(
|
|
2152
2215
|
rt,
|
|
2153
2216
|
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_ddk_ffi_checksum_func_create_cet"),
|
|
@@ -2204,6 +2267,14 @@ NativeDdkFfi::NativeDdkFfi(
|
|
|
2204
2267
|
return this->cpp_uniffi_ddk_ffi_checksum_func_create_spliced_dlc_transactions(rt, thisVal, args, count);
|
|
2205
2268
|
}
|
|
2206
2269
|
);
|
|
2270
|
+
props["ubrn_uniffi_ddk_ffi_checksum_func_create_xpriv_from_parent_path"] = jsi::Function::createFromHostFunction(
|
|
2271
|
+
rt,
|
|
2272
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_ddk_ffi_checksum_func_create_xpriv_from_parent_path"),
|
|
2273
|
+
0,
|
|
2274
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2275
|
+
return this->cpp_uniffi_ddk_ffi_checksum_func_create_xpriv_from_parent_path(rt, thisVal, args, count);
|
|
2276
|
+
}
|
|
2277
|
+
);
|
|
2207
2278
|
props["ubrn_uniffi_ddk_ffi_checksum_func_get_change_output_and_fees"] = jsi::Function::createFromHostFunction(
|
|
2208
2279
|
rt,
|
|
2209
2280
|
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_ddk_ffi_checksum_func_get_change_output_and_fees"),
|
|
@@ -2228,6 +2299,14 @@ NativeDdkFfi::NativeDdkFfi(
|
|
|
2228
2299
|
return this->cpp_uniffi_ddk_ffi_checksum_func_get_total_input_vsize(rt, thisVal, args, count);
|
|
2229
2300
|
}
|
|
2230
2301
|
);
|
|
2302
|
+
props["ubrn_uniffi_ddk_ffi_checksum_func_get_xpub_from_xpriv"] = jsi::Function::createFromHostFunction(
|
|
2303
|
+
rt,
|
|
2304
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_ddk_ffi_checksum_func_get_xpub_from_xpriv"),
|
|
2305
|
+
0,
|
|
2306
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2307
|
+
return this->cpp_uniffi_ddk_ffi_checksum_func_get_xpub_from_xpriv(rt, thisVal, args, count);
|
|
2308
|
+
}
|
|
2309
|
+
);
|
|
2231
2310
|
props["ubrn_uniffi_ddk_ffi_checksum_func_is_dust_output"] = jsi::Function::createFromHostFunction(
|
|
2232
2311
|
rt,
|
|
2233
2312
|
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_ddk_ffi_checksum_func_is_dust_output"),
|
|
@@ -2236,12 +2315,12 @@ NativeDdkFfi::NativeDdkFfi(
|
|
|
2236
2315
|
return this->cpp_uniffi_ddk_ffi_checksum_func_is_dust_output(rt, thisVal, args, count);
|
|
2237
2316
|
}
|
|
2238
2317
|
);
|
|
2239
|
-
props["
|
|
2318
|
+
props["ubrn_uniffi_ddk_ffi_checksum_func_sign_cet"] = jsi::Function::createFromHostFunction(
|
|
2240
2319
|
rt,
|
|
2241
|
-
jsi::PropNameID::forAscii(rt, "
|
|
2320
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_ddk_ffi_checksum_func_sign_cet"),
|
|
2242
2321
|
0,
|
|
2243
2322
|
[this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
|
|
2244
|
-
return this->
|
|
2323
|
+
return this->cpp_uniffi_ddk_ffi_checksum_func_sign_cet(rt, thisVal, args, count);
|
|
2245
2324
|
}
|
|
2246
2325
|
);
|
|
2247
2326
|
props["ubrn_uniffi_ddk_ffi_checksum_func_sign_fund_transaction_input"] = jsi::Function::createFromHostFunction(
|
|
@@ -2331,6 +2410,16 @@ jsi::Value NativeDdkFfi::cpp_uniffi_internal_fn_func_ffi__arraybuffer_to_string(
|
|
|
2331
2410
|
}
|
|
2332
2411
|
|
|
2333
2412
|
// Methods calling directly into the uniffi generated C API of the Rust crate.
|
|
2413
|
+
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) {
|
|
2414
|
+
RustCallStatus status = uniffi::ddk_ffi::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
2415
|
+
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]),
|
|
2416
|
+
&status
|
|
2417
|
+
);
|
|
2418
|
+
uniffi::ddk_ffi::Bridging<RustCallStatus>::copyIntoJs(rt, callInvoker, status, args[count - 1]);
|
|
2419
|
+
|
|
2420
|
+
|
|
2421
|
+
return uniffi::ddk_ffi::Bridging<RustBuffer>::toJs(rt, callInvoker, value);
|
|
2422
|
+
}
|
|
2334
2423
|
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
2424
|
RustCallStatus status = uniffi::ddk_ffi::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
2336
2425
|
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 +2488,16 @@ jsi::Value NativeDdkFfi::cpp_uniffi_ddk_ffi_fn_func_create_spliced_dlc_transacti
|
|
|
2399
2488
|
uniffi::ddk_ffi::Bridging<RustCallStatus>::copyIntoJs(rt, callInvoker, status, args[count - 1]);
|
|
2400
2489
|
|
|
2401
2490
|
|
|
2491
|
+
return uniffi::ddk_ffi::Bridging<RustBuffer>::toJs(rt, callInvoker, value);
|
|
2492
|
+
}
|
|
2493
|
+
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) {
|
|
2494
|
+
RustCallStatus status = uniffi::ddk_ffi::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
2495
|
+
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]),
|
|
2496
|
+
&status
|
|
2497
|
+
);
|
|
2498
|
+
uniffi::ddk_ffi::Bridging<RustCallStatus>::copyIntoJs(rt, callInvoker, status, args[count - 1]);
|
|
2499
|
+
|
|
2500
|
+
|
|
2402
2501
|
return uniffi::ddk_ffi::Bridging<RustBuffer>::toJs(rt, callInvoker, value);
|
|
2403
2502
|
}
|
|
2404
2503
|
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,6 +2530,16 @@ jsi::Value NativeDdkFfi::cpp_uniffi_ddk_ffi_fn_func_get_total_input_vsize(jsi::R
|
|
|
2431
2530
|
|
|
2432
2531
|
return uniffi_jsi::Bridging<uint32_t>::toJs(rt, callInvoker, value);
|
|
2433
2532
|
}
|
|
2533
|
+
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) {
|
|
2534
|
+
RustCallStatus status = uniffi::ddk_ffi::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
2535
|
+
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]),
|
|
2536
|
+
&status
|
|
2537
|
+
);
|
|
2538
|
+
uniffi::ddk_ffi::Bridging<RustCallStatus>::copyIntoJs(rt, callInvoker, status, args[count - 1]);
|
|
2539
|
+
|
|
2540
|
+
|
|
2541
|
+
return uniffi::ddk_ffi::Bridging<RustBuffer>::toJs(rt, callInvoker, value);
|
|
2542
|
+
}
|
|
2434
2543
|
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) {
|
|
2435
2544
|
RustCallStatus status = uniffi::ddk_ffi::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
2436
2545
|
auto value = uniffi_ddk_ffi_fn_func_is_dust_output(uniffi::ddk_ffi::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[0]),
|
|
@@ -2441,9 +2550,10 @@ jsi::Value NativeDdkFfi::cpp_uniffi_ddk_ffi_fn_func_is_dust_output(jsi::Runtime&
|
|
|
2441
2550
|
|
|
2442
2551
|
return uniffi_jsi::Bridging<int8_t>::toJs(rt, callInvoker, value);
|
|
2443
2552
|
}
|
|
2444
|
-
jsi::Value NativeDdkFfi::
|
|
2553
|
+
jsi::Value NativeDdkFfi::cpp_uniffi_ddk_ffi_fn_func_sign_cet(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
|
|
2445
2554
|
RustCallStatus status = uniffi::ddk_ffi::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
2446
|
-
auto value =
|
|
2555
|
+
auto value = uniffi_ddk_ffi_fn_func_sign_cet(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]), uniffi::ddk_ffi::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[4]), uniffi::ddk_ffi::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[5]), uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[6]),
|
|
2556
|
+
&status
|
|
2447
2557
|
);
|
|
2448
2558
|
uniffi::ddk_ffi::Bridging<RustCallStatus>::copyIntoJs(rt, callInvoker, status, args[count - 1]);
|
|
2449
2559
|
|
|
@@ -2479,6 +2589,13 @@ jsi::Value NativeDdkFfi::cpp_uniffi_ddk_ffi_fn_func_version(jsi::Runtime& rt, co
|
|
|
2479
2589
|
|
|
2480
2590
|
return uniffi::ddk_ffi::Bridging<RustBuffer>::toJs(rt, callInvoker, value);
|
|
2481
2591
|
}
|
|
2592
|
+
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) {
|
|
2593
|
+
auto value = uniffi_ddk_ffi_checksum_func_convert_mnemonic_to_seed(
|
|
2594
|
+
);
|
|
2595
|
+
|
|
2596
|
+
|
|
2597
|
+
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
2598
|
+
}
|
|
2482
2599
|
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
2600
|
auto value = uniffi_ddk_ffi_checksum_func_create_cet(
|
|
2484
2601
|
);
|
|
@@ -2526,6 +2643,13 @@ jsi::Value NativeDdkFfi::cpp_uniffi_ddk_ffi_checksum_func_create_spliced_dlc_tra
|
|
|
2526
2643
|
);
|
|
2527
2644
|
|
|
2528
2645
|
|
|
2646
|
+
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
2647
|
+
}
|
|
2648
|
+
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) {
|
|
2649
|
+
auto value = uniffi_ddk_ffi_checksum_func_create_xpriv_from_parent_path(
|
|
2650
|
+
);
|
|
2651
|
+
|
|
2652
|
+
|
|
2529
2653
|
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
2530
2654
|
}
|
|
2531
2655
|
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) {
|
|
@@ -2547,6 +2671,13 @@ jsi::Value NativeDdkFfi::cpp_uniffi_ddk_ffi_checksum_func_get_total_input_vsize(
|
|
|
2547
2671
|
);
|
|
2548
2672
|
|
|
2549
2673
|
|
|
2674
|
+
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
2675
|
+
}
|
|
2676
|
+
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) {
|
|
2677
|
+
auto value = uniffi_ddk_ffi_checksum_func_get_xpub_from_xpriv(
|
|
2678
|
+
);
|
|
2679
|
+
|
|
2680
|
+
|
|
2550
2681
|
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
2551
2682
|
}
|
|
2552
2683
|
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) {
|
|
@@ -2556,8 +2687,8 @@ jsi::Value NativeDdkFfi::cpp_uniffi_ddk_ffi_checksum_func_is_dust_output(jsi::Ru
|
|
|
2556
2687
|
|
|
2557
2688
|
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
2558
2689
|
}
|
|
2559
|
-
jsi::Value NativeDdkFfi::
|
|
2560
|
-
auto value =
|
|
2690
|
+
jsi::Value NativeDdkFfi::cpp_uniffi_ddk_ffi_checksum_func_sign_cet(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
|
|
2691
|
+
auto value = uniffi_ddk_ffi_checksum_func_sign_cet(
|
|
2561
2692
|
);
|
|
2562
2693
|
|
|
2563
2694
|
|
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,17 @@ 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
|
|
38
|
+
jsi::Value cpp_uniffi_ddk_ffi_fn_func_sign_cet(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
36
39
|
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
40
|
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
41
|
jsi::Value cpp_uniffi_ddk_ffi_fn_func_version(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
42
|
+
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
43
|
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
44
|
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
45
|
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 +47,13 @@ class NativeDdkFfi : public jsi::HostObject {
|
|
|
43
47
|
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
48
|
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
49
|
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);
|
|
50
|
+
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
51
|
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
52
|
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
53
|
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);
|
|
54
|
+
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
55
|
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
|
|
56
|
+
jsi::Value cpp_uniffi_ddk_ffi_checksum_func_sign_cet(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
51
57
|
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
58
|
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
59
|
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.1"
|
|
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.1"
|
|
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(
|
|
@@ -87,6 +98,17 @@ namespace ddk_ffi {
|
|
|
87
98
|
u32 vout,
|
|
88
99
|
u64 input_amount
|
|
89
100
|
);
|
|
101
|
+
|
|
102
|
+
[Throws=DLCError]
|
|
103
|
+
Transaction sign_cet(
|
|
104
|
+
Transaction cet,
|
|
105
|
+
sequence<u8> adaptor_signature,
|
|
106
|
+
sequence<sequence<u8>> oracle_signatures,
|
|
107
|
+
sequence<u8> funding_secret_key,
|
|
108
|
+
sequence<u8> other_pubkey,
|
|
109
|
+
sequence<u8> funding_script_pubkey,
|
|
110
|
+
u64 fund_output_value
|
|
111
|
+
);
|
|
90
112
|
|
|
91
113
|
// Signing Functions
|
|
92
114
|
[Throws=DLCError]
|
|
@@ -226,5 +248,14 @@ enum DLCError {
|
|
|
226
248
|
"SerializationError",
|
|
227
249
|
"Secp256k1Error",
|
|
228
250
|
"MiniscriptError",
|
|
229
|
-
"
|
|
251
|
+
"InvalidNetwork",
|
|
252
|
+
"KeyError",
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
[Error]
|
|
256
|
+
enum ExtendedKey {
|
|
257
|
+
"InvalidMnemonic",
|
|
258
|
+
"InvalidXpriv",
|
|
259
|
+
"InvalidXpub",
|
|
260
|
+
"InvalidDerivationPath",
|
|
230
261
|
};
|