@bennyblader/ddk-rn 0.3.42 → 0.4.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 +1 -1
- package/README.md +14 -0
- package/android/CMakeLists.txt +6 -3
- package/android/build.gradle +0 -1
- package/android/cpp-adapter.cpp +6 -26
- package/android/src/main/jniLibs/arm64-v8a/libddk_ffi.so +0 -0
- package/android/src/main/jniLibs/armeabi-v7a/libddk_ffi.so +0 -0
- package/android/src/main/jniLibs/x86/libddk_ffi.so +0 -0
- package/android/src/main/jniLibs/x86_64/libddk_ffi.so +0 -0
- package/cpp/bennyblader-ddk-rn.cpp +1 -1
- package/cpp/ddk_ffi.cpp +2361 -2671
- package/cpp/ddk_ffi.hpp +86 -255
- package/ios/DdkRn.xcframework/Info.plist +43 -0
- package/ios/DdkRn.xcframework/ios-arm64/libddk_ffi.a +0 -0
- package/ios/DdkRn.xcframework/ios-arm64-simulator/libddk_ffi.a +0 -0
- package/lib/commonjs/ddk_ffi-ffi.js +6 -29
- package/lib/commonjs/ddk_ffi-ffi.js.map +1 -1
- package/lib/commonjs/ddk_ffi.js +961 -944
- package/lib/commonjs/ddk_ffi.js.map +1 -1
- package/lib/module/ddk_ffi-ffi.js +6 -29
- package/lib/module/ddk_ffi-ffi.js.map +1 -1
- package/lib/module/ddk_ffi.js +924 -896
- package/lib/module/ddk_ffi.js.map +1 -1
- package/lib/typescript/commonjs/src/ddk_ffi-ffi.d.ts +71 -96
- package/lib/typescript/commonjs/src/ddk_ffi-ffi.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/ddk_ffi.d.ts +500 -471
- package/lib/typescript/commonjs/src/ddk_ffi.d.ts.map +1 -1
- package/lib/typescript/module/src/ddk_ffi-ffi.d.ts +71 -96
- package/lib/typescript/module/src/ddk_ffi-ffi.d.ts.map +1 -1
- package/lib/typescript/module/src/ddk_ffi.d.ts +500 -471
- package/lib/typescript/module/src/ddk_ffi.d.ts.map +1 -1
- package/package.json +8 -38
- package/src/ddk_ffi-ffi.ts +419 -170
- package/src/ddk_ffi.ts +2648 -1939
- package/ubrn.config.yaml +18 -1
- package/ddk-ffi/Cargo.lock +0 -1013
- package/ddk-ffi/Cargo.toml +0 -36
- package/ddk-ffi/build.rs +0 -3
- package/ddk-ffi/rust-toolchain.toml +0 -10
- package/ddk-ffi/src/ddk_ffi.udl +0 -376
- package/ddk-ffi/src/lib.rs +0 -2509
- package/ddk-ffi/src/uniffi-bindgen.rs +0 -3
- package/ddk-ffi/uniffi.toml +0 -18
- package/scripts/apply-hotfix.js +0 -96
- package/scripts/postinstall.js +0 -298
- package/scripts/prepare-rust-src.js +0 -51
package/src/ddk_ffi-ffi.ts
CHANGED
|
@@ -1,195 +1,444 @@
|
|
|
1
1
|
// This file was autogenerated by some hot garbage in the `uniffi-bindgen-react-native` crate.
|
|
2
2
|
// Trust me, you don't want to mess with it!
|
|
3
3
|
|
|
4
|
+
/* tslint:disable */
|
|
5
|
+
/* eslint-disable */
|
|
6
|
+
// @ts-nocheck
|
|
7
|
+
|
|
4
8
|
import {
|
|
5
9
|
type StructuralEquality as UniffiStructuralEquality,
|
|
6
10
|
type UniffiForeignFuture as RuntimeUniffiForeignFuture,
|
|
7
11
|
type UniffiRustCallStatus,
|
|
8
|
-
type
|
|
12
|
+
type UniffiGcObject,
|
|
9
13
|
type UniffiRustFutureContinuationCallback as RuntimeUniffiRustFutureContinuationCallback,
|
|
10
14
|
type UniffiResult,
|
|
11
|
-
|
|
15
|
+
} from '@ubjs/core';
|
|
12
16
|
|
|
13
17
|
interface NativeModuleInterface {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
18
|
+
ubrn_uniffi_internal_fn_func_ffi__string_to_byte_length(
|
|
19
|
+
string: string,
|
|
20
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
21
|
+
): number;
|
|
22
|
+
ubrn_uniffi_internal_fn_func_ffi__string_to_buffer(
|
|
23
|
+
string: string,
|
|
24
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
25
|
+
): Uint8Array;
|
|
26
|
+
ubrn_uniffi_internal_fn_func_ffi__string_from_buffer(
|
|
27
|
+
buffer: Uint8Array,
|
|
28
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
29
|
+
): string;
|
|
30
|
+
ubrn_uniffi_internal_fn_func_ffi__read_string_from_buffer(
|
|
31
|
+
buffer: any,
|
|
32
|
+
offset: number,
|
|
33
|
+
length: number
|
|
34
|
+
): string;
|
|
35
|
+
ubrn_ffi_ddk_ffi_rust_future_poll_u8(
|
|
36
|
+
handle: bigint,
|
|
37
|
+
callback: UniffiRustFutureContinuationCallback,
|
|
38
|
+
callbackData: bigint
|
|
39
|
+
): void;
|
|
40
|
+
ubrn_ffi_ddk_ffi_rust_future_cancel_u8(handle: bigint): void;
|
|
41
|
+
ubrn_ffi_ddk_ffi_rust_future_complete_u8(
|
|
42
|
+
handle: bigint,
|
|
43
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
44
|
+
): number;
|
|
45
|
+
ubrn_ffi_ddk_ffi_rust_future_free_u8(handle: bigint): void;
|
|
46
|
+
ubrn_ffi_ddk_ffi_rust_future_poll_i8(
|
|
47
|
+
handle: bigint,
|
|
48
|
+
callback: UniffiRustFutureContinuationCallback,
|
|
49
|
+
callbackData: bigint
|
|
50
|
+
): void;
|
|
51
|
+
ubrn_ffi_ddk_ffi_rust_future_cancel_i8(handle: bigint): void;
|
|
52
|
+
ubrn_ffi_ddk_ffi_rust_future_complete_i8(
|
|
53
|
+
handle: bigint,
|
|
54
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
55
|
+
): number;
|
|
56
|
+
ubrn_ffi_ddk_ffi_rust_future_free_i8(handle: bigint): void;
|
|
57
|
+
ubrn_ffi_ddk_ffi_rust_future_poll_u16(
|
|
58
|
+
handle: bigint,
|
|
59
|
+
callback: UniffiRustFutureContinuationCallback,
|
|
60
|
+
callbackData: bigint
|
|
61
|
+
): void;
|
|
62
|
+
ubrn_ffi_ddk_ffi_rust_future_cancel_u16(handle: bigint): void;
|
|
63
|
+
ubrn_ffi_ddk_ffi_rust_future_complete_u16(
|
|
64
|
+
handle: bigint,
|
|
65
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
66
|
+
): number;
|
|
67
|
+
ubrn_ffi_ddk_ffi_rust_future_free_u16(handle: bigint): void;
|
|
68
|
+
ubrn_ffi_ddk_ffi_rust_future_poll_i16(
|
|
69
|
+
handle: bigint,
|
|
70
|
+
callback: UniffiRustFutureContinuationCallback,
|
|
71
|
+
callbackData: bigint
|
|
72
|
+
): void;
|
|
73
|
+
ubrn_ffi_ddk_ffi_rust_future_cancel_i16(handle: bigint): void;
|
|
74
|
+
ubrn_ffi_ddk_ffi_rust_future_complete_i16(
|
|
75
|
+
handle: bigint,
|
|
76
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
77
|
+
): number;
|
|
78
|
+
ubrn_ffi_ddk_ffi_rust_future_free_i16(handle: bigint): void;
|
|
79
|
+
ubrn_ffi_ddk_ffi_rust_future_poll_u32(
|
|
80
|
+
handle: bigint,
|
|
81
|
+
callback: UniffiRustFutureContinuationCallback,
|
|
82
|
+
callbackData: bigint
|
|
83
|
+
): void;
|
|
84
|
+
ubrn_ffi_ddk_ffi_rust_future_cancel_u32(handle: bigint): void;
|
|
85
|
+
ubrn_ffi_ddk_ffi_rust_future_complete_u32(
|
|
86
|
+
handle: bigint,
|
|
87
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
88
|
+
): number;
|
|
89
|
+
ubrn_ffi_ddk_ffi_rust_future_free_u32(handle: bigint): void;
|
|
90
|
+
ubrn_ffi_ddk_ffi_rust_future_poll_i32(
|
|
91
|
+
handle: bigint,
|
|
92
|
+
callback: UniffiRustFutureContinuationCallback,
|
|
93
|
+
callbackData: bigint
|
|
94
|
+
): void;
|
|
95
|
+
ubrn_ffi_ddk_ffi_rust_future_cancel_i32(handle: bigint): void;
|
|
96
|
+
ubrn_ffi_ddk_ffi_rust_future_complete_i32(
|
|
97
|
+
handle: bigint,
|
|
98
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
99
|
+
): number;
|
|
100
|
+
ubrn_ffi_ddk_ffi_rust_future_free_i32(handle: bigint): void;
|
|
101
|
+
ubrn_ffi_ddk_ffi_rust_future_poll_u64(
|
|
102
|
+
handle: bigint,
|
|
103
|
+
callback: UniffiRustFutureContinuationCallback,
|
|
104
|
+
callbackData: bigint
|
|
105
|
+
): void;
|
|
106
|
+
ubrn_ffi_ddk_ffi_rust_future_cancel_u64(handle: bigint): void;
|
|
107
|
+
ubrn_ffi_ddk_ffi_rust_future_complete_u64(
|
|
108
|
+
handle: bigint,
|
|
109
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
110
|
+
): bigint;
|
|
111
|
+
ubrn_ffi_ddk_ffi_rust_future_free_u64(handle: bigint): void;
|
|
112
|
+
ubrn_ffi_ddk_ffi_rust_future_poll_i64(
|
|
113
|
+
handle: bigint,
|
|
114
|
+
callback: UniffiRustFutureContinuationCallback,
|
|
115
|
+
callbackData: bigint
|
|
116
|
+
): void;
|
|
117
|
+
ubrn_ffi_ddk_ffi_rust_future_cancel_i64(handle: bigint): void;
|
|
118
|
+
ubrn_ffi_ddk_ffi_rust_future_complete_i64(
|
|
119
|
+
handle: bigint,
|
|
120
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
121
|
+
): bigint;
|
|
122
|
+
ubrn_ffi_ddk_ffi_rust_future_free_i64(handle: bigint): void;
|
|
123
|
+
ubrn_ffi_ddk_ffi_rust_future_poll_f32(
|
|
124
|
+
handle: bigint,
|
|
125
|
+
callback: UniffiRustFutureContinuationCallback,
|
|
126
|
+
callbackData: bigint
|
|
127
|
+
): void;
|
|
128
|
+
ubrn_ffi_ddk_ffi_rust_future_cancel_f32(handle: bigint): void;
|
|
129
|
+
ubrn_ffi_ddk_ffi_rust_future_complete_f32(
|
|
130
|
+
handle: bigint,
|
|
131
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
132
|
+
): number;
|
|
133
|
+
ubrn_ffi_ddk_ffi_rust_future_free_f32(handle: bigint): void;
|
|
134
|
+
ubrn_ffi_ddk_ffi_rust_future_poll_f64(
|
|
135
|
+
handle: bigint,
|
|
136
|
+
callback: UniffiRustFutureContinuationCallback,
|
|
137
|
+
callbackData: bigint
|
|
138
|
+
): void;
|
|
139
|
+
ubrn_ffi_ddk_ffi_rust_future_cancel_f64(handle: bigint): void;
|
|
140
|
+
ubrn_ffi_ddk_ffi_rust_future_complete_f64(
|
|
141
|
+
handle: bigint,
|
|
142
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
143
|
+
): number;
|
|
144
|
+
ubrn_ffi_ddk_ffi_rust_future_free_f64(handle: bigint): void;
|
|
145
|
+
ubrn_ffi_ddk_ffi_rust_future_poll_rust_buffer(
|
|
146
|
+
handle: bigint,
|
|
147
|
+
callback: UniffiRustFutureContinuationCallback,
|
|
148
|
+
callbackData: bigint
|
|
149
|
+
): void;
|
|
150
|
+
ubrn_ffi_ddk_ffi_rust_future_cancel_rust_buffer(handle: bigint): void;
|
|
151
|
+
ubrn_ffi_ddk_ffi_rust_future_complete_rust_buffer(
|
|
152
|
+
handle: bigint,
|
|
153
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
154
|
+
): Uint8Array;
|
|
155
|
+
ubrn_ffi_ddk_ffi_rust_future_free_rust_buffer(handle: bigint): void;
|
|
156
|
+
ubrn_ffi_ddk_ffi_rust_future_poll_void(
|
|
157
|
+
handle: bigint,
|
|
158
|
+
callback: UniffiRustFutureContinuationCallback,
|
|
159
|
+
callbackData: bigint
|
|
160
|
+
): void;
|
|
161
|
+
ubrn_ffi_ddk_ffi_rust_future_cancel_void(handle: bigint): void;
|
|
162
|
+
ubrn_ffi_ddk_ffi_rust_future_complete_void(
|
|
163
|
+
handle: bigint,
|
|
164
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
165
|
+
): void;
|
|
166
|
+
ubrn_ffi_ddk_ffi_rust_future_free_void(handle: bigint): void;
|
|
167
|
+
ubrn_uniffi_ddk_ffi_fn_func_convert_mnemonic_to_seed(
|
|
168
|
+
mnemonic: Uint8Array,
|
|
169
|
+
passphrase: Uint8Array,
|
|
170
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
171
|
+
): Uint8Array;
|
|
172
|
+
ubrn_uniffi_ddk_ffi_fn_func_create_cet(
|
|
173
|
+
localOutput: Uint8Array,
|
|
174
|
+
localPayoutSerialId: bigint,
|
|
175
|
+
remoteOutput: Uint8Array,
|
|
176
|
+
remotePayoutSerialId: bigint,
|
|
177
|
+
fundTxId: Uint8Array,
|
|
178
|
+
fundVout: number,
|
|
179
|
+
lockTime: number,
|
|
180
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
181
|
+
): Uint8Array;
|
|
182
|
+
ubrn_uniffi_ddk_ffi_fn_func_create_cet_adaptor_points_from_oracle_info(
|
|
183
|
+
oracleInfo: Uint8Array,
|
|
184
|
+
msgs: Uint8Array,
|
|
185
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
186
|
+
): Uint8Array;
|
|
187
|
+
ubrn_uniffi_ddk_ffi_fn_func_create_cet_adaptor_sigs_from_oracle_info(
|
|
188
|
+
cets: Uint8Array,
|
|
189
|
+
oracleInfo: Uint8Array,
|
|
190
|
+
fundingSecretKey: Uint8Array,
|
|
191
|
+
fundingScriptPubkey: Uint8Array,
|
|
192
|
+
fundOutputValue: bigint,
|
|
193
|
+
msgs: Uint8Array,
|
|
194
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
195
|
+
): Uint8Array;
|
|
196
|
+
ubrn_uniffi_ddk_ffi_fn_func_create_cet_adaptor_sigs_from_points(
|
|
197
|
+
cets: Uint8Array,
|
|
198
|
+
adaptorPoints: Uint8Array,
|
|
199
|
+
fundingSecretKey: Uint8Array,
|
|
200
|
+
fundingScriptPubkey: Uint8Array,
|
|
201
|
+
fundOutputValue: bigint,
|
|
202
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
203
|
+
): Uint8Array;
|
|
204
|
+
ubrn_uniffi_ddk_ffi_fn_func_create_cets(
|
|
205
|
+
fundTxId: Uint8Array,
|
|
206
|
+
fundVout: number,
|
|
207
|
+
localFinalScriptPubkey: Uint8Array,
|
|
208
|
+
remoteFinalScriptPubkey: Uint8Array,
|
|
209
|
+
outcomes: Uint8Array,
|
|
210
|
+
lockTime: number,
|
|
211
|
+
localSerialId: bigint,
|
|
212
|
+
remoteSerialId: bigint,
|
|
213
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
214
|
+
): Uint8Array;
|
|
215
|
+
ubrn_uniffi_ddk_ffi_fn_func_create_dlc_transactions(
|
|
216
|
+
outcomes: Uint8Array,
|
|
217
|
+
localParams: Uint8Array,
|
|
218
|
+
remoteParams: Uint8Array,
|
|
219
|
+
refundLocktime: number,
|
|
220
|
+
feeRate: bigint,
|
|
221
|
+
fundLockTime: number,
|
|
222
|
+
cetLockTime: number,
|
|
223
|
+
fundOutputSerialId: bigint,
|
|
224
|
+
contractFlags: number,
|
|
225
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
226
|
+
): Uint8Array;
|
|
227
|
+
ubrn_uniffi_ddk_ffi_fn_func_create_extkey_from_parent_path(
|
|
228
|
+
extkey: Uint8Array,
|
|
229
|
+
path: Uint8Array,
|
|
230
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
231
|
+
): Uint8Array;
|
|
232
|
+
ubrn_uniffi_ddk_ffi_fn_func_create_extkey_from_seed(
|
|
233
|
+
seed: Uint8Array,
|
|
234
|
+
network: Uint8Array,
|
|
235
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
236
|
+
): Uint8Array;
|
|
237
|
+
ubrn_uniffi_ddk_ffi_fn_func_create_fund_tx_locking_script(
|
|
238
|
+
localFundPubkey: Uint8Array,
|
|
239
|
+
remoteFundPubkey: Uint8Array,
|
|
240
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
241
|
+
): Uint8Array;
|
|
242
|
+
ubrn_uniffi_ddk_ffi_fn_func_create_refund_transaction(
|
|
243
|
+
localFinalScriptPubkey: Uint8Array,
|
|
244
|
+
remoteFinalScriptPubkey: Uint8Array,
|
|
245
|
+
localAmount: bigint,
|
|
246
|
+
remoteAmount: bigint,
|
|
247
|
+
lockTime: number,
|
|
248
|
+
fundTxId: Uint8Array,
|
|
249
|
+
fundVout: number,
|
|
250
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
251
|
+
): Uint8Array;
|
|
252
|
+
ubrn_uniffi_ddk_ffi_fn_func_create_spliced_dlc_transactions(
|
|
253
|
+
outcomes: Uint8Array,
|
|
254
|
+
localParams: Uint8Array,
|
|
255
|
+
remoteParams: Uint8Array,
|
|
256
|
+
refundLocktime: number,
|
|
257
|
+
feeRate: bigint,
|
|
258
|
+
fundLockTime: number,
|
|
259
|
+
cetLockTime: number,
|
|
260
|
+
fundOutputSerialId: bigint,
|
|
261
|
+
contractFlags: number,
|
|
262
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
263
|
+
): Uint8Array;
|
|
264
|
+
ubrn_uniffi_ddk_ffi_fn_func_create_xpriv_from_parent_path(
|
|
265
|
+
seedOrXpriv: Uint8Array,
|
|
266
|
+
baseDerivationPath: Uint8Array,
|
|
267
|
+
network: Uint8Array,
|
|
268
|
+
path: Uint8Array,
|
|
269
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
270
|
+
): Uint8Array;
|
|
271
|
+
ubrn_uniffi_ddk_ffi_fn_func_extract_ecdsa_signature_from_oracle_signatures(
|
|
272
|
+
oracleSignatures: Uint8Array,
|
|
273
|
+
adaptorSignature: Uint8Array,
|
|
274
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
275
|
+
): Uint8Array;
|
|
276
|
+
ubrn_uniffi_ddk_ffi_fn_func_get_pubkey_from_extkey(
|
|
277
|
+
extkey: Uint8Array,
|
|
278
|
+
network: Uint8Array,
|
|
279
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
280
|
+
): Uint8Array;
|
|
281
|
+
ubrn_uniffi_ddk_ffi_fn_func_get_total_input_vsize(
|
|
282
|
+
inputs: Uint8Array,
|
|
283
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
284
|
+
): number;
|
|
285
|
+
ubrn_uniffi_ddk_ffi_fn_func_get_xpub_from_xpriv(
|
|
286
|
+
xpriv: Uint8Array,
|
|
287
|
+
network: Uint8Array,
|
|
288
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
289
|
+
): Uint8Array;
|
|
290
|
+
ubrn_uniffi_ddk_ffi_fn_func_verify_cet_adaptor_sigs_from_oracle_info(
|
|
291
|
+
adaptorSigs: Uint8Array,
|
|
292
|
+
cets: Uint8Array,
|
|
293
|
+
oracleInfos: Uint8Array,
|
|
294
|
+
pubkey: Uint8Array,
|
|
295
|
+
fundingScriptPubkey: Uint8Array,
|
|
296
|
+
totalCollateral: bigint,
|
|
297
|
+
msgs: Uint8Array,
|
|
298
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
299
|
+
): number;
|
|
300
|
+
ubrn_uniffi_ddk_ffi_fn_func_version(
|
|
301
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
302
|
+
): Uint8Array;
|
|
303
|
+
ubrn_uniffi_ddk_ffi_fn_method_adaptorsignature_verify_from_oracle_info(
|
|
304
|
+
uniffiSelf: Uint8Array,
|
|
305
|
+
cet: Uint8Array,
|
|
306
|
+
oracleInfos: Uint8Array,
|
|
307
|
+
pubkey: Uint8Array,
|
|
308
|
+
fundingScriptPubkey: Uint8Array,
|
|
309
|
+
totalCollateral: bigint,
|
|
310
|
+
msgs: Uint8Array,
|
|
311
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
312
|
+
): number;
|
|
313
|
+
ubrn_uniffi_ddk_ffi_fn_method_partyparams_change_output_and_fees(
|
|
314
|
+
uniffiSelf: Uint8Array,
|
|
315
|
+
feeRate: bigint,
|
|
316
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
317
|
+
): Uint8Array;
|
|
318
|
+
ubrn_uniffi_ddk_ffi_fn_method_transaction_add_signature(
|
|
319
|
+
uniffiSelf: Uint8Array,
|
|
320
|
+
signature: Uint8Array,
|
|
321
|
+
pubkey: Uint8Array,
|
|
322
|
+
inputIndex: number,
|
|
323
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
324
|
+
): Uint8Array;
|
|
325
|
+
ubrn_uniffi_ddk_ffi_fn_method_transaction_cet_adaptor_signature_from_oracle_info(
|
|
326
|
+
uniffiSelf: Uint8Array,
|
|
327
|
+
oracleInfo: Uint8Array,
|
|
328
|
+
fundingSk: Uint8Array,
|
|
329
|
+
fundingScriptPubkey: Uint8Array,
|
|
330
|
+
totalCollateral: bigint,
|
|
331
|
+
msgs: Uint8Array,
|
|
332
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
333
|
+
): Uint8Array;
|
|
334
|
+
ubrn_uniffi_ddk_ffi_fn_method_transaction_cet_adaptor_signature_inputs(
|
|
335
|
+
uniffiSelf: Uint8Array,
|
|
336
|
+
oracleInfo: Uint8Array,
|
|
337
|
+
fundingScriptPubkey: Uint8Array,
|
|
338
|
+
fundOutputValue: bigint,
|
|
339
|
+
msgs: Uint8Array,
|
|
340
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
341
|
+
): Uint8Array;
|
|
342
|
+
ubrn_uniffi_ddk_ffi_fn_method_transaction_cet_sighash(
|
|
343
|
+
uniffiSelf: Uint8Array,
|
|
344
|
+
fundingScriptPubkey: Uint8Array,
|
|
345
|
+
fundOutputValue: bigint,
|
|
346
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
347
|
+
): Uint8Array;
|
|
348
|
+
ubrn_uniffi_ddk_ffi_fn_method_transaction_raw_funding_input_signature(
|
|
349
|
+
uniffiSelf: Uint8Array,
|
|
350
|
+
privkey: Uint8Array,
|
|
351
|
+
prevTxId: Uint8Array,
|
|
352
|
+
prevTxVout: number,
|
|
353
|
+
value: bigint,
|
|
354
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
355
|
+
): Uint8Array;
|
|
356
|
+
ubrn_uniffi_ddk_ffi_fn_method_transaction_sign_cet(
|
|
357
|
+
uniffiSelf: Uint8Array,
|
|
358
|
+
adaptorSignature: Uint8Array,
|
|
359
|
+
oracleSignatures: Uint8Array,
|
|
360
|
+
fundingSecretKey: Uint8Array,
|
|
361
|
+
otherPubkey: Uint8Array,
|
|
362
|
+
fundingScriptPubkey: Uint8Array,
|
|
363
|
+
fundOutputValue: bigint,
|
|
364
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
365
|
+
): Uint8Array;
|
|
366
|
+
ubrn_uniffi_ddk_ffi_fn_method_transaction_sign_fund_input(
|
|
367
|
+
uniffiSelf: Uint8Array,
|
|
368
|
+
privkey: Uint8Array,
|
|
369
|
+
prevTxId: Uint8Array,
|
|
370
|
+
prevTxVout: number,
|
|
371
|
+
value: bigint,
|
|
372
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
373
|
+
): Uint8Array;
|
|
374
|
+
ubrn_uniffi_ddk_ffi_fn_method_transaction_sign_multi_sig_input(
|
|
375
|
+
uniffiSelf: Uint8Array,
|
|
376
|
+
dlcInput: Uint8Array,
|
|
377
|
+
localPrivkey: Uint8Array,
|
|
378
|
+
remoteSignature: Uint8Array,
|
|
379
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
380
|
+
): Uint8Array;
|
|
381
|
+
ubrn_uniffi_ddk_ffi_fn_method_transaction_verify_fund_signature(
|
|
382
|
+
uniffiSelf: Uint8Array,
|
|
383
|
+
signature: Uint8Array,
|
|
384
|
+
pubkey: Uint8Array,
|
|
385
|
+
txid: Uint8Array,
|
|
386
|
+
vout: number,
|
|
387
|
+
inputAmount: bigint,
|
|
388
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
389
|
+
): number;
|
|
390
|
+
ubrn_uniffi_ddk_ffi_fn_method_txoutput_is_dust(
|
|
391
|
+
uniffiSelf: Uint8Array,
|
|
392
|
+
uniffi_out_err: UniffiRustCallStatus
|
|
393
|
+
): number;
|
|
394
|
+
ubrn_ffi_ddk_ffi_uniffi_contract_version(): number;
|
|
395
|
+
ubrn_uniffi_ddk_ffi_checksum_func_convert_mnemonic_to_seed(): number;
|
|
396
|
+
ubrn_uniffi_ddk_ffi_checksum_func_create_cet(): number;
|
|
397
|
+
ubrn_uniffi_ddk_ffi_checksum_func_create_cet_adaptor_points_from_oracle_info(): number;
|
|
398
|
+
ubrn_uniffi_ddk_ffi_checksum_func_create_cet_adaptor_sigs_from_oracle_info(): number;
|
|
399
|
+
ubrn_uniffi_ddk_ffi_checksum_func_create_cet_adaptor_sigs_from_points(): number;
|
|
400
|
+
ubrn_uniffi_ddk_ffi_checksum_func_create_cets(): number;
|
|
401
|
+
ubrn_uniffi_ddk_ffi_checksum_func_create_dlc_transactions(): number;
|
|
402
|
+
ubrn_uniffi_ddk_ffi_checksum_func_create_extkey_from_parent_path(): number;
|
|
403
|
+
ubrn_uniffi_ddk_ffi_checksum_func_create_extkey_from_seed(): number;
|
|
404
|
+
ubrn_uniffi_ddk_ffi_checksum_func_create_fund_tx_locking_script(): number;
|
|
405
|
+
ubrn_uniffi_ddk_ffi_checksum_func_create_refund_transaction(): number;
|
|
406
|
+
ubrn_uniffi_ddk_ffi_checksum_func_create_spliced_dlc_transactions(): number;
|
|
407
|
+
ubrn_uniffi_ddk_ffi_checksum_func_create_xpriv_from_parent_path(): number;
|
|
408
|
+
ubrn_uniffi_ddk_ffi_checksum_func_extract_ecdsa_signature_from_oracle_signatures(): number;
|
|
409
|
+
ubrn_uniffi_ddk_ffi_checksum_func_get_pubkey_from_extkey(): number;
|
|
410
|
+
ubrn_uniffi_ddk_ffi_checksum_func_get_total_input_vsize(): number;
|
|
411
|
+
ubrn_uniffi_ddk_ffi_checksum_func_get_xpub_from_xpriv(): number;
|
|
412
|
+
ubrn_uniffi_ddk_ffi_checksum_func_verify_cet_adaptor_sigs_from_oracle_info(): number;
|
|
413
|
+
ubrn_uniffi_ddk_ffi_checksum_func_version(): number;
|
|
414
|
+
// Codegen call sites use these via `nativeModule().rustbuffer_alloc(...)`
|
|
415
|
+
// and `nativeModule().rustbuffer_free(...)`. The JSI host object exposes
|
|
416
|
+
// them as properties; see `props["rustbuffer_alloc"]` / `props["rustbuffer_free"]`
|
|
417
|
+
// in the C++ wrapper template.
|
|
418
|
+
rustbuffer_alloc(n: number): Uint8Array;
|
|
419
|
+
rustbuffer_free(view: Uint8Array): void;
|
|
80
420
|
}
|
|
81
421
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
//
|
|
85
|
-
// We use a getter here rather than simply `globalThis.NativeDdkFfi` so that
|
|
86
|
-
// if/when the startup sequence isn't just so, an empty value isn't inadvertantly cached.
|
|
87
|
-
const getter: () => NativeModuleInterface = () => (globalThis as any).NativeDdkFfi;
|
|
422
|
+
const getter: () => NativeModuleInterface = () =>
|
|
423
|
+
(globalThis as any).NativeDdkFfi;
|
|
88
424
|
export default getter;
|
|
89
425
|
|
|
90
426
|
// Structs and function types for calling back into Typescript from Rust.
|
|
91
|
-
export type UniffiRustFutureContinuationCallback = (
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
427
|
+
export type UniffiRustFutureContinuationCallback = (
|
|
428
|
+
data: bigint,
|
|
429
|
+
pollResult: number
|
|
430
|
+
) => void;
|
|
431
|
+
export type UniffiForeignFutureDroppedCallback = (handle: bigint) => void;
|
|
432
|
+
export type UniffiForeignFutureDroppedCallbackStruct = {
|
|
95
433
|
handle: bigint;
|
|
96
|
-
free:
|
|
97
|
-
};
|
|
98
|
-
export type UniffiForeignFutureStructU8 = {
|
|
99
|
-
returnValue: number;
|
|
100
|
-
callStatus: UniffiRustCallStatus;
|
|
101
|
-
};
|
|
102
|
-
export type UniffiForeignFutureCompleteU8 = (callbackData: bigint, result: UniffiForeignFutureStructU8) => void;
|
|
103
|
-
export type UniffiForeignFutureStructI8 = {
|
|
104
|
-
returnValue: number;
|
|
105
|
-
callStatus: UniffiRustCallStatus;
|
|
106
|
-
};
|
|
107
|
-
export type UniffiForeignFutureCompleteI8 = (callbackData: bigint, result: UniffiForeignFutureStructI8) => void;
|
|
108
|
-
export type UniffiForeignFutureStructU16 = {
|
|
109
|
-
returnValue: number;
|
|
110
|
-
callStatus: UniffiRustCallStatus;
|
|
111
|
-
};
|
|
112
|
-
export type UniffiForeignFutureCompleteU16 = (callbackData: bigint, result: UniffiForeignFutureStructU16) => void;
|
|
113
|
-
export type UniffiForeignFutureStructI16 = {
|
|
114
|
-
returnValue: number;
|
|
115
|
-
callStatus: UniffiRustCallStatus;
|
|
116
|
-
};
|
|
117
|
-
export type UniffiForeignFutureCompleteI16 = (callbackData: bigint, result: UniffiForeignFutureStructI16) => void;
|
|
118
|
-
export type UniffiForeignFutureStructU32 = {
|
|
119
|
-
returnValue: number;
|
|
120
|
-
callStatus: UniffiRustCallStatus;
|
|
121
|
-
};
|
|
122
|
-
export type UniffiForeignFutureCompleteU32 = (callbackData: bigint, result: UniffiForeignFutureStructU32) => void;
|
|
123
|
-
export type UniffiForeignFutureStructI32 = {
|
|
124
|
-
returnValue: number;
|
|
125
|
-
callStatus: UniffiRustCallStatus;
|
|
126
|
-
};
|
|
127
|
-
export type UniffiForeignFutureCompleteI32 = (callbackData: bigint, result: UniffiForeignFutureStructI32) => void;
|
|
128
|
-
export type UniffiForeignFutureStructU64 = {
|
|
129
|
-
returnValue: bigint;
|
|
130
|
-
callStatus: UniffiRustCallStatus;
|
|
131
|
-
};
|
|
132
|
-
export type UniffiForeignFutureCompleteU64 = (callbackData: bigint, result: UniffiForeignFutureStructU64) => void;
|
|
133
|
-
export type UniffiForeignFutureStructI64 = {
|
|
134
|
-
returnValue: bigint;
|
|
135
|
-
callStatus: UniffiRustCallStatus;
|
|
136
|
-
};
|
|
137
|
-
export type UniffiForeignFutureCompleteI64 = (callbackData: bigint, result: UniffiForeignFutureStructI64) => void;
|
|
138
|
-
export type UniffiForeignFutureStructF32 = {
|
|
139
|
-
returnValue: number;
|
|
140
|
-
callStatus: UniffiRustCallStatus;
|
|
141
|
-
};
|
|
142
|
-
export type UniffiForeignFutureCompleteF32 = (callbackData: bigint, result: UniffiForeignFutureStructF32) => void;
|
|
143
|
-
export type UniffiForeignFutureStructF64 = {
|
|
144
|
-
returnValue: number;
|
|
145
|
-
callStatus: UniffiRustCallStatus;
|
|
146
|
-
};
|
|
147
|
-
export type UniffiForeignFutureCompleteF64 = (callbackData: bigint, result: UniffiForeignFutureStructF64) => void;
|
|
148
|
-
export type UniffiForeignFutureStructPointer = {
|
|
149
|
-
returnValue: bigint;
|
|
150
|
-
callStatus: UniffiRustCallStatus;
|
|
151
|
-
};
|
|
152
|
-
export type UniffiForeignFutureCompletePointer = (callbackData: bigint, result: UniffiForeignFutureStructPointer) => void;
|
|
153
|
-
export type UniffiForeignFutureStructRustBuffer = {
|
|
154
|
-
returnValue: Uint8Array;
|
|
155
|
-
callStatus: UniffiRustCallStatus;
|
|
156
|
-
};
|
|
157
|
-
export type UniffiForeignFutureCompleteRustBuffer = (callbackData: bigint, result: UniffiForeignFutureStructRustBuffer) => void;
|
|
158
|
-
export type UniffiForeignFutureStructVoid = {
|
|
159
|
-
callStatus: UniffiRustCallStatus;
|
|
434
|
+
free: UniffiForeignFutureDroppedCallback;
|
|
160
435
|
};
|
|
161
|
-
export type UniffiForeignFutureCompleteVoid = (callbackData: bigint, result: UniffiForeignFutureStructVoid) => void;
|
|
162
436
|
|
|
163
437
|
// UniffiRustFutureContinuationCallback is generated as part of the component interface's
|
|
164
438
|
// ffi_definitions. However, we need it in the runtime.
|
|
165
|
-
// We
|
|
166
|
-
//
|
|
167
|
-
// (b) import the generated declaration into the runtime (m a y b e) or…
|
|
168
|
-
// (c) generate the declaration anyway, and use a different declaration in the runtime.
|
|
169
|
-
//
|
|
170
|
-
// We chose (c) here as the simplest. In addition, we perform a compile time check that
|
|
171
|
-
// the two versions of `UniffiRustFutureContinuationCallback` are structurally equivalent.
|
|
172
|
-
//
|
|
173
|
-
// If you see the error:
|
|
174
|
-
// ```
|
|
175
|
-
// Type 'true' is not assignable to type 'false'.(2322)
|
|
176
|
-
// ```
|
|
177
|
-
// Then a new version of uniffi has changed the signature of the callback. Most likely, code in
|
|
178
|
-
// `typescript/src/async-rust-call.ts` will need to be changed.
|
|
179
|
-
//
|
|
180
|
-
// If you see the error:
|
|
181
|
-
// ```
|
|
182
|
-
// Cannot find name 'UniffiRustFutureContinuationCallback'. Did you mean 'RuntimeUniffiRustFutureContinuationCallback'?(2552)
|
|
183
|
-
// ```
|
|
184
|
-
// then you may not be using callbacks or promises, and uniffi is now not generating Futures and callbacks.
|
|
185
|
-
// You should not generate this if that is the case.
|
|
186
|
-
//
|
|
187
|
-
// ('You' being the bindings generator maintainer).
|
|
439
|
+
// We chose to generate the declaration anyway, and use a different declaration in the runtime.
|
|
440
|
+
// We perform a compile time check that the two versions are structurally equivalent.
|
|
188
441
|
const isRustFutureContinuationCallbackTypeCompatible: UniffiStructuralEquality<
|
|
189
442
|
RuntimeUniffiRustFutureContinuationCallback,
|
|
190
443
|
UniffiRustFutureContinuationCallback
|
|
191
444
|
> = true;
|
|
192
|
-
const isUniffiForeignFutureTypeCompatible: UniffiStructuralEquality<
|
|
193
|
-
RuntimeUniffiForeignFuture,
|
|
194
|
-
UniffiForeignFuture
|
|
195
|
-
> = true;
|