@bennyblader/ddk-rn 0.3.40 → 0.3.41
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/cpp/bennyblader-ddk-rn.cpp +1 -1
- package/cpp/ddk_ffi.cpp +2485 -2573
- package/cpp/ddk_ffi.hpp +97 -255
- package/ddk-ffi/Cargo.lock +3 -3
- package/ddk-ffi/Cargo.toml +2 -2
- package/lib/commonjs/ddk_ffi-ffi.js.map +1 -1
- package/lib/commonjs/ddk_ffi.js +63 -75
- 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 +64 -76
- package/lib/module/ddk_ffi.js.map +1 -1
- package/lib/typescript/commonjs/src/ddk_ffi-ffi.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/ddk_ffi.d.ts +3 -3
- package/lib/typescript/commonjs/src/ddk_ffi.d.ts.map +1 -1
- package/lib/typescript/module/src/ddk_ffi-ffi.d.ts.map +1 -1
- package/lib/typescript/module/src/ddk_ffi.d.ts +3 -3
- package/lib/typescript/module/src/ddk_ffi.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/ddk_ffi-ffi.ts +331 -83
- package/src/ddk_ffi.ts +2317 -1885
package/src/ddk_ffi.ts
CHANGED
|
@@ -29,1997 +29,2283 @@ import nativeModule, {
|
|
|
29
29
|
type UniffiForeignFutureCompleteRustBuffer,
|
|
30
30
|
type UniffiForeignFutureStructVoid,
|
|
31
31
|
type UniffiForeignFutureCompleteVoid,
|
|
32
|
-
} from
|
|
32
|
+
} from './ddk_ffi-ffi';
|
|
33
33
|
import {
|
|
34
|
-
type UniffiByteArray,
|
|
35
|
-
AbstractFfiConverterByteArray,
|
|
36
|
-
FfiConverterArray,
|
|
37
|
-
FfiConverterBool,
|
|
38
|
-
FfiConverterInt32,
|
|
39
|
-
FfiConverterOptional,
|
|
40
|
-
FfiConverterUInt32,
|
|
41
|
-
FfiConverterUInt64,
|
|
42
|
-
FfiConverterUInt8,
|
|
43
|
-
RustBuffer,
|
|
44
|
-
UniffiError,
|
|
45
|
-
UniffiInternalError,
|
|
46
|
-
UniffiRustCaller,
|
|
47
|
-
uniffiCreateFfiConverterString,
|
|
48
|
-
uniffiCreateRecord,
|
|
49
|
-
uniffiTypeNameSymbol,
|
|
50
|
-
variantOrdinalSymbol
|
|
34
|
+
type UniffiByteArray,
|
|
35
|
+
AbstractFfiConverterByteArray,
|
|
36
|
+
FfiConverterArray,
|
|
37
|
+
FfiConverterBool,
|
|
38
|
+
FfiConverterInt32,
|
|
39
|
+
FfiConverterOptional,
|
|
40
|
+
FfiConverterUInt32,
|
|
41
|
+
FfiConverterUInt64,
|
|
42
|
+
FfiConverterUInt8,
|
|
43
|
+
RustBuffer,
|
|
44
|
+
UniffiError,
|
|
45
|
+
UniffiInternalError,
|
|
46
|
+
UniffiRustCaller,
|
|
47
|
+
uniffiCreateFfiConverterString,
|
|
48
|
+
uniffiCreateRecord,
|
|
49
|
+
uniffiTypeNameSymbol,
|
|
50
|
+
variantOrdinalSymbol,
|
|
51
|
+
} from 'uniffi-bindgen-react-native';
|
|
51
52
|
|
|
52
53
|
// Get converters from the other files, if any.
|
|
53
54
|
const uniffiCaller = new UniffiRustCaller(() => ({ code: 0 }));
|
|
54
55
|
|
|
55
56
|
const uniffiIsDebug =
|
|
56
57
|
// @ts-ignore -- The process global might not be defined
|
|
57
|
-
typeof process !==
|
|
58
|
+
typeof process !== 'object' ||
|
|
58
59
|
// @ts-ignore -- The process global might not be defined
|
|
59
|
-
process?.env?.NODE_ENV !==
|
|
60
|
+
process?.env?.NODE_ENV !== 'production' ||
|
|
60
61
|
true;
|
|
61
62
|
// Public interface members begin here.
|
|
62
63
|
|
|
63
|
-
export function addSignatureToTransaction(
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
})()(
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
})()(
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
console.debug(
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
64
|
+
export function addSignatureToTransaction(
|
|
65
|
+
tx: Transaction,
|
|
66
|
+
signature: Array</*u8*/ number>,
|
|
67
|
+
pubkey: Array</*u8*/ number>,
|
|
68
|
+
inputIndex: /*u32*/ number
|
|
69
|
+
): Transaction /*throws*/ {
|
|
70
|
+
return FfiConverterTypeTransaction.lift(
|
|
71
|
+
uniffiCaller.rustCallWithError(
|
|
72
|
+
/*liftError:*/ FfiConverterTypeDLCError.lift.bind(
|
|
73
|
+
FfiConverterTypeDLCError
|
|
74
|
+
),
|
|
75
|
+
/*caller:*/ (callStatus) => {
|
|
76
|
+
return (() => {
|
|
77
|
+
console.debug(
|
|
78
|
+
`-- uniffi_ddk_ffi_fn_func_add_signature_to_transaction`
|
|
79
|
+
);
|
|
80
|
+
return nativeModule()
|
|
81
|
+
.ubrn_uniffi_ddk_ffi_fn_func_add_signature_to_transaction;
|
|
82
|
+
})()(
|
|
83
|
+
FfiConverterTypeTransaction.lower(tx),
|
|
84
|
+
FfiConverterArrayUInt8.lower(signature),
|
|
85
|
+
FfiConverterArrayUInt8.lower(pubkey),
|
|
86
|
+
FfiConverterUInt32.lower(inputIndex),
|
|
87
|
+
callStatus
|
|
88
|
+
);
|
|
89
|
+
},
|
|
90
|
+
/*liftString:*/ FfiConverterString.lift
|
|
91
|
+
)
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
export function convertMnemonicToSeed(
|
|
95
|
+
mnemonic: string,
|
|
96
|
+
passphrase: string | undefined
|
|
97
|
+
): Array</*u8*/ number> /*throws*/ {
|
|
98
|
+
return FfiConverterArrayUInt8.lift(
|
|
99
|
+
uniffiCaller.rustCallWithError(
|
|
100
|
+
/*liftError:*/ FfiConverterTypeDLCError.lift.bind(
|
|
101
|
+
FfiConverterTypeDLCError
|
|
102
|
+
),
|
|
103
|
+
/*caller:*/ (callStatus) => {
|
|
104
|
+
return (() => {
|
|
105
|
+
console.debug(`-- uniffi_ddk_ffi_fn_func_convert_mnemonic_to_seed`);
|
|
106
|
+
return nativeModule()
|
|
107
|
+
.ubrn_uniffi_ddk_ffi_fn_func_convert_mnemonic_to_seed;
|
|
108
|
+
})()(
|
|
109
|
+
FfiConverterString.lower(mnemonic),
|
|
110
|
+
FfiConverterOptionalString.lower(passphrase),
|
|
111
|
+
callStatus
|
|
112
|
+
);
|
|
113
|
+
},
|
|
114
|
+
/*liftString:*/ FfiConverterString.lift
|
|
115
|
+
)
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
export function createCet(
|
|
119
|
+
localOutput: TxOutput,
|
|
120
|
+
localPayoutSerialId: /*u64*/ bigint,
|
|
121
|
+
remoteOutput: TxOutput,
|
|
122
|
+
remotePayoutSerialId: /*u64*/ bigint,
|
|
123
|
+
fundTxId: string,
|
|
124
|
+
fundVout: /*u32*/ number,
|
|
125
|
+
lockTime: /*u32*/ number
|
|
126
|
+
): Transaction /*throws*/ {
|
|
127
|
+
return FfiConverterTypeTransaction.lift(
|
|
128
|
+
uniffiCaller.rustCallWithError(
|
|
129
|
+
/*liftError:*/ FfiConverterTypeDLCError.lift.bind(
|
|
130
|
+
FfiConverterTypeDLCError
|
|
131
|
+
),
|
|
132
|
+
/*caller:*/ (callStatus) => {
|
|
133
|
+
return (() => {
|
|
134
|
+
console.debug(`-- uniffi_ddk_ffi_fn_func_create_cet`);
|
|
135
|
+
return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_create_cet;
|
|
136
|
+
})()(
|
|
137
|
+
FfiConverterTypeTxOutput.lower(localOutput),
|
|
138
|
+
FfiConverterUInt64.lower(localPayoutSerialId),
|
|
139
|
+
FfiConverterTypeTxOutput.lower(remoteOutput),
|
|
140
|
+
FfiConverterUInt64.lower(remotePayoutSerialId),
|
|
141
|
+
FfiConverterString.lower(fundTxId),
|
|
142
|
+
FfiConverterUInt32.lower(fundVout),
|
|
143
|
+
FfiConverterUInt32.lower(lockTime),
|
|
144
|
+
callStatus
|
|
145
|
+
);
|
|
146
|
+
},
|
|
147
|
+
/*liftString:*/ FfiConverterString.lift
|
|
148
|
+
)
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
export function createCetAdaptorPointsFromOracleInfo(
|
|
152
|
+
oracleInfo: Array<OracleInfo>,
|
|
153
|
+
msgs: Array<Array<Array<Array</*u8*/ number>>>>
|
|
154
|
+
): Array<Array</*u8*/ number>> /*throws*/ {
|
|
155
|
+
return FfiConverterArrayArrayUInt8.lift(
|
|
156
|
+
uniffiCaller.rustCallWithError(
|
|
157
|
+
/*liftError:*/ FfiConverterTypeDLCError.lift.bind(
|
|
158
|
+
FfiConverterTypeDLCError
|
|
159
|
+
),
|
|
160
|
+
/*caller:*/ (callStatus) => {
|
|
161
|
+
return (() => {
|
|
162
|
+
console.debug(
|
|
163
|
+
`-- uniffi_ddk_ffi_fn_func_create_cet_adaptor_points_from_oracle_info`
|
|
164
|
+
);
|
|
165
|
+
return nativeModule()
|
|
166
|
+
.ubrn_uniffi_ddk_ffi_fn_func_create_cet_adaptor_points_from_oracle_info;
|
|
167
|
+
})()(
|
|
168
|
+
FfiConverterArrayTypeOracleInfo.lower(oracleInfo),
|
|
169
|
+
FfiConverterArrayArrayArrayArrayUInt8.lower(msgs),
|
|
170
|
+
callStatus
|
|
171
|
+
);
|
|
172
|
+
},
|
|
173
|
+
/*liftString:*/ FfiConverterString.lift
|
|
174
|
+
)
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
export function createCetAdaptorSignatureFromOracleInfo(
|
|
178
|
+
cet: Transaction,
|
|
179
|
+
oracleInfo: OracleInfo,
|
|
180
|
+
fundingSk: Array</*u8*/ number>,
|
|
181
|
+
fundingScriptPubkey: Array</*u8*/ number>,
|
|
182
|
+
totalCollateral: /*u64*/ bigint,
|
|
183
|
+
msgs: Array<Array</*u8*/ number>>
|
|
184
|
+
): AdaptorSignature /*throws*/ {
|
|
185
|
+
return FfiConverterTypeAdaptorSignature.lift(
|
|
186
|
+
uniffiCaller.rustCallWithError(
|
|
187
|
+
/*liftError:*/ FfiConverterTypeDLCError.lift.bind(
|
|
188
|
+
FfiConverterTypeDLCError
|
|
189
|
+
),
|
|
190
|
+
/*caller:*/ (callStatus) => {
|
|
191
|
+
return (() => {
|
|
192
|
+
console.debug(
|
|
193
|
+
`-- uniffi_ddk_ffi_fn_func_create_cet_adaptor_signature_from_oracle_info`
|
|
194
|
+
);
|
|
195
|
+
return nativeModule()
|
|
196
|
+
.ubrn_uniffi_ddk_ffi_fn_func_create_cet_adaptor_signature_from_oracle_info;
|
|
197
|
+
})()(
|
|
198
|
+
FfiConverterTypeTransaction.lower(cet),
|
|
199
|
+
FfiConverterTypeOracleInfo.lower(oracleInfo),
|
|
200
|
+
FfiConverterArrayUInt8.lower(fundingSk),
|
|
201
|
+
FfiConverterArrayUInt8.lower(fundingScriptPubkey),
|
|
202
|
+
FfiConverterUInt64.lower(totalCollateral),
|
|
203
|
+
FfiConverterArrayArrayUInt8.lower(msgs),
|
|
204
|
+
callStatus
|
|
205
|
+
);
|
|
206
|
+
},
|
|
207
|
+
/*liftString:*/ FfiConverterString.lift
|
|
208
|
+
)
|
|
209
|
+
);
|
|
210
|
+
}
|
|
211
|
+
export function createCetAdaptorSigsFromOracleInfo(
|
|
212
|
+
cets: Array<Transaction>,
|
|
213
|
+
oracleInfo: Array<OracleInfo>,
|
|
214
|
+
fundingSecretKey: Array</*u8*/ number>,
|
|
215
|
+
fundingScriptPubkey: Array</*u8*/ number>,
|
|
216
|
+
fundOutputValue: /*u64*/ bigint,
|
|
217
|
+
msgs: Array<Array<Array<Array</*u8*/ number>>>>
|
|
218
|
+
): Array<AdaptorSignature> /*throws*/ {
|
|
219
|
+
return FfiConverterArrayTypeAdaptorSignature.lift(
|
|
220
|
+
uniffiCaller.rustCallWithError(
|
|
221
|
+
/*liftError:*/ FfiConverterTypeDLCError.lift.bind(
|
|
222
|
+
FfiConverterTypeDLCError
|
|
223
|
+
),
|
|
224
|
+
/*caller:*/ (callStatus) => {
|
|
225
|
+
return (() => {
|
|
226
|
+
console.debug(
|
|
227
|
+
`-- uniffi_ddk_ffi_fn_func_create_cet_adaptor_sigs_from_oracle_info`
|
|
228
|
+
);
|
|
229
|
+
return nativeModule()
|
|
230
|
+
.ubrn_uniffi_ddk_ffi_fn_func_create_cet_adaptor_sigs_from_oracle_info;
|
|
231
|
+
})()(
|
|
232
|
+
FfiConverterArrayTypeTransaction.lower(cets),
|
|
233
|
+
FfiConverterArrayTypeOracleInfo.lower(oracleInfo),
|
|
234
|
+
FfiConverterArrayUInt8.lower(fundingSecretKey),
|
|
235
|
+
FfiConverterArrayUInt8.lower(fundingScriptPubkey),
|
|
236
|
+
FfiConverterUInt64.lower(fundOutputValue),
|
|
237
|
+
FfiConverterArrayArrayArrayArrayUInt8.lower(msgs),
|
|
238
|
+
callStatus
|
|
239
|
+
);
|
|
240
|
+
},
|
|
241
|
+
/*liftString:*/ FfiConverterString.lift
|
|
242
|
+
)
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
export function createCetAdaptorSigsFromPoints(
|
|
246
|
+
cets: Array<Transaction>,
|
|
247
|
+
adaptorPoints: Array<Array</*u8*/ number>>,
|
|
248
|
+
fundingSecretKey: Array</*u8*/ number>,
|
|
249
|
+
fundingScriptPubkey: Array</*u8*/ number>,
|
|
250
|
+
fundOutputValue: /*u64*/ bigint
|
|
251
|
+
): Array<AdaptorSignature> /*throws*/ {
|
|
252
|
+
return FfiConverterArrayTypeAdaptorSignature.lift(
|
|
253
|
+
uniffiCaller.rustCallWithError(
|
|
254
|
+
/*liftError:*/ FfiConverterTypeDLCError.lift.bind(
|
|
255
|
+
FfiConverterTypeDLCError
|
|
256
|
+
),
|
|
257
|
+
/*caller:*/ (callStatus) => {
|
|
258
|
+
return (() => {
|
|
259
|
+
console.debug(
|
|
260
|
+
`-- uniffi_ddk_ffi_fn_func_create_cet_adaptor_sigs_from_points`
|
|
261
|
+
);
|
|
262
|
+
return nativeModule()
|
|
263
|
+
.ubrn_uniffi_ddk_ffi_fn_func_create_cet_adaptor_sigs_from_points;
|
|
264
|
+
})()(
|
|
265
|
+
FfiConverterArrayTypeTransaction.lower(cets),
|
|
266
|
+
FfiConverterArrayArrayUInt8.lower(adaptorPoints),
|
|
267
|
+
FfiConverterArrayUInt8.lower(fundingSecretKey),
|
|
268
|
+
FfiConverterArrayUInt8.lower(fundingScriptPubkey),
|
|
269
|
+
FfiConverterUInt64.lower(fundOutputValue),
|
|
270
|
+
callStatus
|
|
271
|
+
);
|
|
272
|
+
},
|
|
273
|
+
/*liftString:*/ FfiConverterString.lift
|
|
274
|
+
)
|
|
275
|
+
);
|
|
276
|
+
}
|
|
277
|
+
export function createCets(
|
|
278
|
+
fundTxId: string,
|
|
279
|
+
fundVout: /*u32*/ number,
|
|
280
|
+
localFinalScriptPubkey: Array</*u8*/ number>,
|
|
281
|
+
remoteFinalScriptPubkey: Array</*u8*/ number>,
|
|
282
|
+
outcomes: Array<Payout>,
|
|
283
|
+
lockTime: /*u32*/ number,
|
|
284
|
+
localSerialId: /*u64*/ bigint,
|
|
285
|
+
remoteSerialId: /*u64*/ bigint
|
|
286
|
+
): Array<Transaction> /*throws*/ {
|
|
287
|
+
return FfiConverterArrayTypeTransaction.lift(
|
|
288
|
+
uniffiCaller.rustCallWithError(
|
|
289
|
+
/*liftError:*/ FfiConverterTypeDLCError.lift.bind(
|
|
290
|
+
FfiConverterTypeDLCError
|
|
291
|
+
),
|
|
292
|
+
/*caller:*/ (callStatus) => {
|
|
293
|
+
return (() => {
|
|
294
|
+
console.debug(`-- uniffi_ddk_ffi_fn_func_create_cets`);
|
|
295
|
+
return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_create_cets;
|
|
296
|
+
})()(
|
|
297
|
+
FfiConverterString.lower(fundTxId),
|
|
298
|
+
FfiConverterUInt32.lower(fundVout),
|
|
299
|
+
FfiConverterArrayUInt8.lower(localFinalScriptPubkey),
|
|
300
|
+
FfiConverterArrayUInt8.lower(remoteFinalScriptPubkey),
|
|
301
|
+
FfiConverterArrayTypePayout.lower(outcomes),
|
|
302
|
+
FfiConverterUInt32.lower(lockTime),
|
|
303
|
+
FfiConverterUInt64.lower(localSerialId),
|
|
304
|
+
FfiConverterUInt64.lower(remoteSerialId),
|
|
305
|
+
callStatus
|
|
306
|
+
);
|
|
307
|
+
},
|
|
308
|
+
/*liftString:*/ FfiConverterString.lift
|
|
309
|
+
)
|
|
310
|
+
);
|
|
311
|
+
}
|
|
312
|
+
export function createDlcTransactions(
|
|
313
|
+
outcomes: Array<Payout>,
|
|
314
|
+
localParams: PartyParams,
|
|
315
|
+
remoteParams: PartyParams,
|
|
316
|
+
refundLocktime: /*u32*/ number,
|
|
317
|
+
feeRate: /*u64*/ bigint,
|
|
318
|
+
fundLockTime: /*u32*/ number,
|
|
319
|
+
cetLockTime: /*u32*/ number,
|
|
320
|
+
fundOutputSerialId: /*u64*/ bigint,
|
|
321
|
+
contractFlags: /*u8*/ number
|
|
322
|
+
): DlcTransactions /*throws*/ {
|
|
323
|
+
return FfiConverterTypeDlcTransactions.lift(
|
|
324
|
+
uniffiCaller.rustCallWithError(
|
|
325
|
+
/*liftError:*/ FfiConverterTypeDLCError.lift.bind(
|
|
326
|
+
FfiConverterTypeDLCError
|
|
327
|
+
),
|
|
328
|
+
/*caller:*/ (callStatus) => {
|
|
329
|
+
return (() => {
|
|
330
|
+
console.debug(`-- uniffi_ddk_ffi_fn_func_create_dlc_transactions`);
|
|
331
|
+
return nativeModule()
|
|
332
|
+
.ubrn_uniffi_ddk_ffi_fn_func_create_dlc_transactions;
|
|
333
|
+
})()(
|
|
334
|
+
FfiConverterArrayTypePayout.lower(outcomes),
|
|
335
|
+
FfiConverterTypePartyParams.lower(localParams),
|
|
336
|
+
FfiConverterTypePartyParams.lower(remoteParams),
|
|
337
|
+
FfiConverterUInt32.lower(refundLocktime),
|
|
338
|
+
FfiConverterUInt64.lower(feeRate),
|
|
339
|
+
FfiConverterUInt32.lower(fundLockTime),
|
|
340
|
+
FfiConverterUInt32.lower(cetLockTime),
|
|
341
|
+
FfiConverterUInt64.lower(fundOutputSerialId),
|
|
342
|
+
FfiConverterUInt8.lower(contractFlags),
|
|
343
|
+
callStatus
|
|
344
|
+
);
|
|
345
|
+
},
|
|
346
|
+
/*liftString:*/ FfiConverterString.lift
|
|
347
|
+
)
|
|
348
|
+
);
|
|
349
|
+
}
|
|
350
|
+
export function createExtkeyFromParentPath(
|
|
351
|
+
extkey: Array</*u8*/ number>,
|
|
352
|
+
path: string
|
|
353
|
+
): Array</*u8*/ number> /*throws*/ {
|
|
354
|
+
return FfiConverterArrayUInt8.lift(
|
|
355
|
+
uniffiCaller.rustCallWithError(
|
|
356
|
+
/*liftError:*/ FfiConverterTypeDLCError.lift.bind(
|
|
357
|
+
FfiConverterTypeDLCError
|
|
358
|
+
),
|
|
359
|
+
/*caller:*/ (callStatus) => {
|
|
360
|
+
return (() => {
|
|
361
|
+
console.debug(
|
|
362
|
+
`-- uniffi_ddk_ffi_fn_func_create_extkey_from_parent_path`
|
|
363
|
+
);
|
|
364
|
+
return nativeModule()
|
|
365
|
+
.ubrn_uniffi_ddk_ffi_fn_func_create_extkey_from_parent_path;
|
|
366
|
+
})()(
|
|
367
|
+
FfiConverterArrayUInt8.lower(extkey),
|
|
368
|
+
FfiConverterString.lower(path),
|
|
369
|
+
callStatus
|
|
370
|
+
);
|
|
371
|
+
},
|
|
372
|
+
/*liftString:*/ FfiConverterString.lift
|
|
373
|
+
)
|
|
374
|
+
);
|
|
375
|
+
}
|
|
376
|
+
export function createExtkeyFromSeed(
|
|
377
|
+
seed: Array</*u8*/ number>,
|
|
378
|
+
network: string
|
|
379
|
+
): Array</*u8*/ number> /*throws*/ {
|
|
380
|
+
return FfiConverterArrayUInt8.lift(
|
|
381
|
+
uniffiCaller.rustCallWithError(
|
|
382
|
+
/*liftError:*/ FfiConverterTypeDLCError.lift.bind(
|
|
383
|
+
FfiConverterTypeDLCError
|
|
384
|
+
),
|
|
385
|
+
/*caller:*/ (callStatus) => {
|
|
386
|
+
return (() => {
|
|
387
|
+
console.debug(`-- uniffi_ddk_ffi_fn_func_create_extkey_from_seed`);
|
|
388
|
+
return nativeModule()
|
|
389
|
+
.ubrn_uniffi_ddk_ffi_fn_func_create_extkey_from_seed;
|
|
390
|
+
})()(
|
|
391
|
+
FfiConverterArrayUInt8.lower(seed),
|
|
392
|
+
FfiConverterString.lower(network),
|
|
393
|
+
callStatus
|
|
394
|
+
);
|
|
395
|
+
},
|
|
396
|
+
/*liftString:*/ FfiConverterString.lift
|
|
397
|
+
)
|
|
398
|
+
);
|
|
399
|
+
}
|
|
400
|
+
export function createFundTxLockingScript(
|
|
401
|
+
localFundPubkey: Array</*u8*/ number>,
|
|
402
|
+
remoteFundPubkey: Array</*u8*/ number>
|
|
403
|
+
): Array</*u8*/ number> /*throws*/ {
|
|
404
|
+
return FfiConverterArrayUInt8.lift(
|
|
405
|
+
uniffiCaller.rustCallWithError(
|
|
406
|
+
/*liftError:*/ FfiConverterTypeDLCError.lift.bind(
|
|
407
|
+
FfiConverterTypeDLCError
|
|
408
|
+
),
|
|
409
|
+
/*caller:*/ (callStatus) => {
|
|
410
|
+
return (() => {
|
|
411
|
+
console.debug(
|
|
412
|
+
`-- uniffi_ddk_ffi_fn_func_create_fund_tx_locking_script`
|
|
413
|
+
);
|
|
414
|
+
return nativeModule()
|
|
415
|
+
.ubrn_uniffi_ddk_ffi_fn_func_create_fund_tx_locking_script;
|
|
416
|
+
})()(
|
|
417
|
+
FfiConverterArrayUInt8.lower(localFundPubkey),
|
|
418
|
+
FfiConverterArrayUInt8.lower(remoteFundPubkey),
|
|
419
|
+
callStatus
|
|
420
|
+
);
|
|
421
|
+
},
|
|
422
|
+
/*liftString:*/ FfiConverterString.lift
|
|
423
|
+
)
|
|
424
|
+
);
|
|
425
|
+
}
|
|
426
|
+
export function createRefundTransaction(
|
|
427
|
+
localFinalScriptPubkey: Array</*u8*/ number>,
|
|
428
|
+
remoteFinalScriptPubkey: Array</*u8*/ number>,
|
|
429
|
+
localAmount: /*u64*/ bigint,
|
|
430
|
+
remoteAmount: /*u64*/ bigint,
|
|
431
|
+
lockTime: /*u32*/ number,
|
|
432
|
+
fundTxId: string,
|
|
433
|
+
fundVout: /*u32*/ number
|
|
434
|
+
): Transaction /*throws*/ {
|
|
435
|
+
return FfiConverterTypeTransaction.lift(
|
|
436
|
+
uniffiCaller.rustCallWithError(
|
|
437
|
+
/*liftError:*/ FfiConverterTypeDLCError.lift.bind(
|
|
438
|
+
FfiConverterTypeDLCError
|
|
439
|
+
),
|
|
440
|
+
/*caller:*/ (callStatus) => {
|
|
441
|
+
return (() => {
|
|
442
|
+
console.debug(`-- uniffi_ddk_ffi_fn_func_create_refund_transaction`);
|
|
443
|
+
return nativeModule()
|
|
444
|
+
.ubrn_uniffi_ddk_ffi_fn_func_create_refund_transaction;
|
|
445
|
+
})()(
|
|
446
|
+
FfiConverterArrayUInt8.lower(localFinalScriptPubkey),
|
|
447
|
+
FfiConverterArrayUInt8.lower(remoteFinalScriptPubkey),
|
|
448
|
+
FfiConverterUInt64.lower(localAmount),
|
|
449
|
+
FfiConverterUInt64.lower(remoteAmount),
|
|
450
|
+
FfiConverterUInt32.lower(lockTime),
|
|
451
|
+
FfiConverterString.lower(fundTxId),
|
|
452
|
+
FfiConverterUInt32.lower(fundVout),
|
|
453
|
+
callStatus
|
|
454
|
+
);
|
|
455
|
+
},
|
|
456
|
+
/*liftString:*/ FfiConverterString.lift
|
|
457
|
+
)
|
|
458
|
+
);
|
|
459
|
+
}
|
|
460
|
+
export function createSplicedDlcTransactions(
|
|
461
|
+
outcomes: Array<Payout>,
|
|
462
|
+
localParams: PartyParams,
|
|
463
|
+
remoteParams: PartyParams,
|
|
464
|
+
refundLocktime: /*u32*/ number,
|
|
465
|
+
feeRate: /*u64*/ bigint,
|
|
466
|
+
fundLockTime: /*u32*/ number,
|
|
467
|
+
cetLockTime: /*u32*/ number,
|
|
468
|
+
fundOutputSerialId: /*u64*/ bigint,
|
|
469
|
+
contractFlags: /*u8*/ number
|
|
470
|
+
): DlcTransactions /*throws*/ {
|
|
471
|
+
return FfiConverterTypeDlcTransactions.lift(
|
|
472
|
+
uniffiCaller.rustCallWithError(
|
|
473
|
+
/*liftError:*/ FfiConverterTypeDLCError.lift.bind(
|
|
474
|
+
FfiConverterTypeDLCError
|
|
475
|
+
),
|
|
476
|
+
/*caller:*/ (callStatus) => {
|
|
477
|
+
return (() => {
|
|
478
|
+
console.debug(
|
|
479
|
+
`-- uniffi_ddk_ffi_fn_func_create_spliced_dlc_transactions`
|
|
480
|
+
);
|
|
481
|
+
return nativeModule()
|
|
482
|
+
.ubrn_uniffi_ddk_ffi_fn_func_create_spliced_dlc_transactions;
|
|
483
|
+
})()(
|
|
484
|
+
FfiConverterArrayTypePayout.lower(outcomes),
|
|
485
|
+
FfiConverterTypePartyParams.lower(localParams),
|
|
486
|
+
FfiConverterTypePartyParams.lower(remoteParams),
|
|
487
|
+
FfiConverterUInt32.lower(refundLocktime),
|
|
488
|
+
FfiConverterUInt64.lower(feeRate),
|
|
489
|
+
FfiConverterUInt32.lower(fundLockTime),
|
|
490
|
+
FfiConverterUInt32.lower(cetLockTime),
|
|
491
|
+
FfiConverterUInt64.lower(fundOutputSerialId),
|
|
492
|
+
FfiConverterUInt8.lower(contractFlags),
|
|
493
|
+
callStatus
|
|
494
|
+
);
|
|
495
|
+
},
|
|
496
|
+
/*liftString:*/ FfiConverterString.lift
|
|
497
|
+
)
|
|
498
|
+
);
|
|
499
|
+
}
|
|
500
|
+
export function createXprivFromParentPath(
|
|
501
|
+
seedOrXpriv: Array</*u8*/ number>,
|
|
502
|
+
baseDerivationPath: string,
|
|
503
|
+
network: string,
|
|
504
|
+
path: string
|
|
505
|
+
): Array</*u8*/ number> /*throws*/ {
|
|
506
|
+
return FfiConverterArrayUInt8.lift(
|
|
507
|
+
uniffiCaller.rustCallWithError(
|
|
508
|
+
/*liftError:*/ FfiConverterTypeDLCError.lift.bind(
|
|
509
|
+
FfiConverterTypeDLCError
|
|
510
|
+
),
|
|
511
|
+
/*caller:*/ (callStatus) => {
|
|
512
|
+
return (() => {
|
|
513
|
+
console.debug(
|
|
514
|
+
`-- uniffi_ddk_ffi_fn_func_create_xpriv_from_parent_path`
|
|
515
|
+
);
|
|
516
|
+
return nativeModule()
|
|
517
|
+
.ubrn_uniffi_ddk_ffi_fn_func_create_xpriv_from_parent_path;
|
|
518
|
+
})()(
|
|
519
|
+
FfiConverterArrayUInt8.lower(seedOrXpriv),
|
|
520
|
+
FfiConverterString.lower(baseDerivationPath),
|
|
521
|
+
FfiConverterString.lower(network),
|
|
522
|
+
FfiConverterString.lower(path),
|
|
523
|
+
callStatus
|
|
524
|
+
);
|
|
525
|
+
},
|
|
526
|
+
/*liftString:*/ FfiConverterString.lift
|
|
527
|
+
)
|
|
528
|
+
);
|
|
529
|
+
}
|
|
530
|
+
export function extractEcdsaSignatureFromOracleSignatures(
|
|
531
|
+
oracleSignatures: Array<Array</*u8*/ number>>,
|
|
532
|
+
adaptorSignature: Array</*u8*/ number>
|
|
533
|
+
): Array</*u8*/ number> /*throws*/ {
|
|
534
|
+
return FfiConverterArrayUInt8.lift(
|
|
535
|
+
uniffiCaller.rustCallWithError(
|
|
536
|
+
/*liftError:*/ FfiConverterTypeDLCError.lift.bind(
|
|
537
|
+
FfiConverterTypeDLCError
|
|
538
|
+
),
|
|
539
|
+
/*caller:*/ (callStatus) => {
|
|
540
|
+
return (() => {
|
|
541
|
+
console.debug(
|
|
542
|
+
`-- uniffi_ddk_ffi_fn_func_extract_ecdsa_signature_from_oracle_signatures`
|
|
543
|
+
);
|
|
544
|
+
return nativeModule()
|
|
545
|
+
.ubrn_uniffi_ddk_ffi_fn_func_extract_ecdsa_signature_from_oracle_signatures;
|
|
546
|
+
})()(
|
|
547
|
+
FfiConverterArrayArrayUInt8.lower(oracleSignatures),
|
|
548
|
+
FfiConverterArrayUInt8.lower(adaptorSignature),
|
|
549
|
+
callStatus
|
|
550
|
+
);
|
|
551
|
+
},
|
|
552
|
+
/*liftString:*/ FfiConverterString.lift
|
|
553
|
+
)
|
|
554
|
+
);
|
|
555
|
+
}
|
|
556
|
+
export function getCetAdaptorSignatureInputs(
|
|
557
|
+
cet: Transaction,
|
|
558
|
+
oracleInfo: Array<OracleInfo>,
|
|
559
|
+
fundingScriptPubkey: Array</*u8*/ number>,
|
|
560
|
+
fundOutputValue: /*u64*/ bigint,
|
|
561
|
+
msgs: Array<Array<Array</*u8*/ number>>>
|
|
562
|
+
): CetAdaptorSignatureDebugInfo /*throws*/ {
|
|
563
|
+
return FfiConverterTypeCetAdaptorSignatureDebugInfo.lift(
|
|
564
|
+
uniffiCaller.rustCallWithError(
|
|
565
|
+
/*liftError:*/ FfiConverterTypeDLCError.lift.bind(
|
|
566
|
+
FfiConverterTypeDLCError
|
|
567
|
+
),
|
|
568
|
+
/*caller:*/ (callStatus) => {
|
|
569
|
+
return (() => {
|
|
570
|
+
console.debug(
|
|
571
|
+
`-- uniffi_ddk_ffi_fn_func_get_cet_adaptor_signature_inputs`
|
|
572
|
+
);
|
|
573
|
+
return nativeModule()
|
|
574
|
+
.ubrn_uniffi_ddk_ffi_fn_func_get_cet_adaptor_signature_inputs;
|
|
575
|
+
})()(
|
|
576
|
+
FfiConverterTypeTransaction.lower(cet),
|
|
577
|
+
FfiConverterArrayTypeOracleInfo.lower(oracleInfo),
|
|
578
|
+
FfiConverterArrayUInt8.lower(fundingScriptPubkey),
|
|
579
|
+
FfiConverterUInt64.lower(fundOutputValue),
|
|
580
|
+
FfiConverterArrayArrayArrayUInt8.lower(msgs),
|
|
581
|
+
callStatus
|
|
582
|
+
);
|
|
583
|
+
},
|
|
584
|
+
/*liftString:*/ FfiConverterString.lift
|
|
585
|
+
)
|
|
586
|
+
);
|
|
587
|
+
}
|
|
588
|
+
export function getCetSighash(
|
|
589
|
+
cet: Transaction,
|
|
590
|
+
fundingScriptPubkey: Array</*u8*/ number>,
|
|
591
|
+
fundOutputValue: /*u64*/ bigint
|
|
592
|
+
): Array</*u8*/ number> /*throws*/ {
|
|
593
|
+
return FfiConverterArrayUInt8.lift(
|
|
594
|
+
uniffiCaller.rustCallWithError(
|
|
595
|
+
/*liftError:*/ FfiConverterTypeDLCError.lift.bind(
|
|
596
|
+
FfiConverterTypeDLCError
|
|
597
|
+
),
|
|
598
|
+
/*caller:*/ (callStatus) => {
|
|
599
|
+
return (() => {
|
|
600
|
+
console.debug(`-- uniffi_ddk_ffi_fn_func_get_cet_sighash`);
|
|
601
|
+
return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_get_cet_sighash;
|
|
602
|
+
})()(
|
|
603
|
+
FfiConverterTypeTransaction.lower(cet),
|
|
604
|
+
FfiConverterArrayUInt8.lower(fundingScriptPubkey),
|
|
605
|
+
FfiConverterUInt64.lower(fundOutputValue),
|
|
606
|
+
callStatus
|
|
607
|
+
);
|
|
608
|
+
},
|
|
609
|
+
/*liftString:*/ FfiConverterString.lift
|
|
610
|
+
)
|
|
611
|
+
);
|
|
612
|
+
}
|
|
613
|
+
export function getChangeOutputAndFees(
|
|
614
|
+
params: PartyParams,
|
|
615
|
+
feeRate: /*u64*/ bigint
|
|
616
|
+
): ChangeOutputAndFees /*throws*/ {
|
|
617
|
+
return FfiConverterTypeChangeOutputAndFees.lift(
|
|
618
|
+
uniffiCaller.rustCallWithError(
|
|
619
|
+
/*liftError:*/ FfiConverterTypeDLCError.lift.bind(
|
|
620
|
+
FfiConverterTypeDLCError
|
|
621
|
+
),
|
|
622
|
+
/*caller:*/ (callStatus) => {
|
|
623
|
+
return (() => {
|
|
624
|
+
console.debug(`-- uniffi_ddk_ffi_fn_func_get_change_output_and_fees`);
|
|
625
|
+
return nativeModule()
|
|
626
|
+
.ubrn_uniffi_ddk_ffi_fn_func_get_change_output_and_fees;
|
|
627
|
+
})()(
|
|
628
|
+
FfiConverterTypePartyParams.lower(params),
|
|
629
|
+
FfiConverterUInt64.lower(feeRate),
|
|
630
|
+
callStatus
|
|
631
|
+
);
|
|
632
|
+
},
|
|
633
|
+
/*liftString:*/ FfiConverterString.lift
|
|
634
|
+
)
|
|
635
|
+
);
|
|
636
|
+
}
|
|
637
|
+
export function getPubkeyFromExtkey(
|
|
638
|
+
extkey: Array</*u8*/ number>,
|
|
639
|
+
network: string
|
|
640
|
+
): Array</*u8*/ number> /*throws*/ {
|
|
641
|
+
return FfiConverterArrayUInt8.lift(
|
|
642
|
+
uniffiCaller.rustCallWithError(
|
|
643
|
+
/*liftError:*/ FfiConverterTypeDLCError.lift.bind(
|
|
644
|
+
FfiConverterTypeDLCError
|
|
645
|
+
),
|
|
646
|
+
/*caller:*/ (callStatus) => {
|
|
647
|
+
return (() => {
|
|
648
|
+
console.debug(`-- uniffi_ddk_ffi_fn_func_get_pubkey_from_extkey`);
|
|
649
|
+
return nativeModule()
|
|
650
|
+
.ubrn_uniffi_ddk_ffi_fn_func_get_pubkey_from_extkey;
|
|
651
|
+
})()(
|
|
652
|
+
FfiConverterArrayUInt8.lower(extkey),
|
|
653
|
+
FfiConverterString.lower(network),
|
|
654
|
+
callStatus
|
|
655
|
+
);
|
|
656
|
+
},
|
|
657
|
+
/*liftString:*/ FfiConverterString.lift
|
|
658
|
+
)
|
|
659
|
+
);
|
|
660
|
+
}
|
|
661
|
+
export function getRawFundingTransactionInputSignature(
|
|
662
|
+
fundingTransaction: Transaction,
|
|
663
|
+
privkey: Array</*u8*/ number>,
|
|
664
|
+
prevTxId: string,
|
|
665
|
+
prevTxVout: /*u32*/ number,
|
|
666
|
+
value: /*u64*/ bigint
|
|
667
|
+
): Array</*u8*/ number> /*throws*/ {
|
|
668
|
+
return FfiConverterArrayUInt8.lift(
|
|
669
|
+
uniffiCaller.rustCallWithError(
|
|
670
|
+
/*liftError:*/ FfiConverterTypeDLCError.lift.bind(
|
|
671
|
+
FfiConverterTypeDLCError
|
|
672
|
+
),
|
|
673
|
+
/*caller:*/ (callStatus) => {
|
|
674
|
+
return (() => {
|
|
675
|
+
console.debug(
|
|
676
|
+
`-- uniffi_ddk_ffi_fn_func_get_raw_funding_transaction_input_signature`
|
|
677
|
+
);
|
|
678
|
+
return nativeModule()
|
|
679
|
+
.ubrn_uniffi_ddk_ffi_fn_func_get_raw_funding_transaction_input_signature;
|
|
680
|
+
})()(
|
|
681
|
+
FfiConverterTypeTransaction.lower(fundingTransaction),
|
|
682
|
+
FfiConverterArrayUInt8.lower(privkey),
|
|
683
|
+
FfiConverterString.lower(prevTxId),
|
|
684
|
+
FfiConverterUInt32.lower(prevTxVout),
|
|
685
|
+
FfiConverterUInt64.lower(value),
|
|
686
|
+
callStatus
|
|
687
|
+
);
|
|
688
|
+
},
|
|
689
|
+
/*liftString:*/ FfiConverterString.lift
|
|
690
|
+
)
|
|
691
|
+
);
|
|
692
|
+
}
|
|
693
|
+
export function getTotalInputVsize(inputs: Array<TxInputInfo>): /*u32*/ number {
|
|
694
|
+
return FfiConverterUInt32.lift(
|
|
695
|
+
uniffiCaller.rustCall(
|
|
696
|
+
/*caller:*/ (callStatus) => {
|
|
697
|
+
return (() => {
|
|
698
|
+
console.debug(`-- uniffi_ddk_ffi_fn_func_get_total_input_vsize`);
|
|
699
|
+
return nativeModule()
|
|
700
|
+
.ubrn_uniffi_ddk_ffi_fn_func_get_total_input_vsize;
|
|
701
|
+
})()(FfiConverterArrayTypeTxInputInfo.lower(inputs), callStatus);
|
|
702
|
+
},
|
|
703
|
+
/*liftString:*/ FfiConverterString.lift
|
|
704
|
+
)
|
|
705
|
+
);
|
|
706
|
+
}
|
|
707
|
+
export function getXpubFromXpriv(
|
|
708
|
+
xpriv: Array</*u8*/ number>,
|
|
709
|
+
network: string
|
|
710
|
+
): Array</*u8*/ number> /*throws*/ {
|
|
711
|
+
return FfiConverterArrayUInt8.lift(
|
|
712
|
+
uniffiCaller.rustCallWithError(
|
|
713
|
+
/*liftError:*/ FfiConverterTypeDLCError.lift.bind(
|
|
714
|
+
FfiConverterTypeDLCError
|
|
715
|
+
),
|
|
716
|
+
/*caller:*/ (callStatus) => {
|
|
717
|
+
return (() => {
|
|
718
|
+
console.debug(`-- uniffi_ddk_ffi_fn_func_get_xpub_from_xpriv`);
|
|
719
|
+
return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_get_xpub_from_xpriv;
|
|
720
|
+
})()(
|
|
721
|
+
FfiConverterArrayUInt8.lower(xpriv),
|
|
722
|
+
FfiConverterString.lower(network),
|
|
723
|
+
callStatus
|
|
724
|
+
);
|
|
725
|
+
},
|
|
726
|
+
/*liftString:*/ FfiConverterString.lift
|
|
727
|
+
)
|
|
728
|
+
);
|
|
729
|
+
}
|
|
503
730
|
export function isDustOutput(output: TxOutput): boolean {
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
console.debug(`-- uniffi_ddk_ffi_fn_func_is_dust_output`);
|
|
509
|
-
|
|
510
|
-
})()(
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
})()(
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
})()(
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
731
|
+
return FfiConverterBool.lift(
|
|
732
|
+
uniffiCaller.rustCall(
|
|
733
|
+
/*caller:*/ (callStatus) => {
|
|
734
|
+
return (() => {
|
|
735
|
+
console.debug(`-- uniffi_ddk_ffi_fn_func_is_dust_output`);
|
|
736
|
+
return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_is_dust_output;
|
|
737
|
+
})()(FfiConverterTypeTxOutput.lower(output), callStatus);
|
|
738
|
+
},
|
|
739
|
+
/*liftString:*/ FfiConverterString.lift
|
|
740
|
+
)
|
|
741
|
+
);
|
|
742
|
+
}
|
|
743
|
+
export function signCet(
|
|
744
|
+
cet: Transaction,
|
|
745
|
+
adaptorSignature: Array</*u8*/ number>,
|
|
746
|
+
oracleSignatures: Array<Array</*u8*/ number>>,
|
|
747
|
+
fundingSecretKey: Array</*u8*/ number>,
|
|
748
|
+
otherPubkey: Array</*u8*/ number>,
|
|
749
|
+
fundingScriptPubkey: Array</*u8*/ number>,
|
|
750
|
+
fundOutputValue: /*u64*/ bigint
|
|
751
|
+
): Transaction /*throws*/ {
|
|
752
|
+
return FfiConverterTypeTransaction.lift(
|
|
753
|
+
uniffiCaller.rustCallWithError(
|
|
754
|
+
/*liftError:*/ FfiConverterTypeDLCError.lift.bind(
|
|
755
|
+
FfiConverterTypeDLCError
|
|
756
|
+
),
|
|
757
|
+
/*caller:*/ (callStatus) => {
|
|
758
|
+
return (() => {
|
|
759
|
+
console.debug(`-- uniffi_ddk_ffi_fn_func_sign_cet`);
|
|
760
|
+
return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_sign_cet;
|
|
761
|
+
})()(
|
|
762
|
+
FfiConverterTypeTransaction.lower(cet),
|
|
763
|
+
FfiConverterArrayUInt8.lower(adaptorSignature),
|
|
764
|
+
FfiConverterArrayArrayUInt8.lower(oracleSignatures),
|
|
765
|
+
FfiConverterArrayUInt8.lower(fundingSecretKey),
|
|
766
|
+
FfiConverterArrayUInt8.lower(otherPubkey),
|
|
767
|
+
FfiConverterArrayUInt8.lower(fundingScriptPubkey),
|
|
768
|
+
FfiConverterUInt64.lower(fundOutputValue),
|
|
769
|
+
callStatus
|
|
770
|
+
);
|
|
771
|
+
},
|
|
772
|
+
/*liftString:*/ FfiConverterString.lift
|
|
773
|
+
)
|
|
774
|
+
);
|
|
775
|
+
}
|
|
776
|
+
export function signFundTransactionInput(
|
|
777
|
+
fundTransaction: Transaction,
|
|
778
|
+
privkey: Array</*u8*/ number>,
|
|
779
|
+
prevTxId: string,
|
|
780
|
+
prevTxVout: /*u32*/ number,
|
|
781
|
+
value: /*u64*/ bigint
|
|
782
|
+
): Transaction /*throws*/ {
|
|
783
|
+
return FfiConverterTypeTransaction.lift(
|
|
784
|
+
uniffiCaller.rustCallWithError(
|
|
785
|
+
/*liftError:*/ FfiConverterTypeDLCError.lift.bind(
|
|
786
|
+
FfiConverterTypeDLCError
|
|
787
|
+
),
|
|
788
|
+
/*caller:*/ (callStatus) => {
|
|
789
|
+
return (() => {
|
|
790
|
+
console.debug(
|
|
791
|
+
`-- uniffi_ddk_ffi_fn_func_sign_fund_transaction_input`
|
|
792
|
+
);
|
|
793
|
+
return nativeModule()
|
|
794
|
+
.ubrn_uniffi_ddk_ffi_fn_func_sign_fund_transaction_input;
|
|
795
|
+
})()(
|
|
796
|
+
FfiConverterTypeTransaction.lower(fundTransaction),
|
|
797
|
+
FfiConverterArrayUInt8.lower(privkey),
|
|
798
|
+
FfiConverterString.lower(prevTxId),
|
|
799
|
+
FfiConverterUInt32.lower(prevTxVout),
|
|
800
|
+
FfiConverterUInt64.lower(value),
|
|
801
|
+
callStatus
|
|
802
|
+
);
|
|
803
|
+
},
|
|
804
|
+
/*liftString:*/ FfiConverterString.lift
|
|
805
|
+
)
|
|
806
|
+
);
|
|
807
|
+
}
|
|
808
|
+
export function signMultiSigInput(
|
|
809
|
+
tx: Transaction,
|
|
810
|
+
dlcInput: DlcInputInfo,
|
|
811
|
+
localPrivkey: Array</*u8*/ number>,
|
|
812
|
+
remoteSignature: Array</*u8*/ number>
|
|
813
|
+
): Transaction /*throws*/ {
|
|
814
|
+
return FfiConverterTypeTransaction.lift(
|
|
815
|
+
uniffiCaller.rustCallWithError(
|
|
816
|
+
/*liftError:*/ FfiConverterTypeDLCError.lift.bind(
|
|
817
|
+
FfiConverterTypeDLCError
|
|
818
|
+
),
|
|
819
|
+
/*caller:*/ (callStatus) => {
|
|
820
|
+
return (() => {
|
|
821
|
+
console.debug(`-- uniffi_ddk_ffi_fn_func_sign_multi_sig_input`);
|
|
822
|
+
return nativeModule()
|
|
823
|
+
.ubrn_uniffi_ddk_ffi_fn_func_sign_multi_sig_input;
|
|
824
|
+
})()(
|
|
825
|
+
FfiConverterTypeTransaction.lower(tx),
|
|
826
|
+
FfiConverterTypeDlcInputInfo.lower(dlcInput),
|
|
827
|
+
FfiConverterArrayUInt8.lower(localPrivkey),
|
|
828
|
+
FfiConverterArrayUInt8.lower(remoteSignature),
|
|
829
|
+
callStatus
|
|
830
|
+
);
|
|
831
|
+
},
|
|
832
|
+
/*liftString:*/ FfiConverterString.lift
|
|
833
|
+
)
|
|
834
|
+
);
|
|
835
|
+
}
|
|
836
|
+
export function verifyCetAdaptorSigFromOracleInfo(
|
|
837
|
+
adaptorSig: AdaptorSignature,
|
|
838
|
+
cet: Transaction,
|
|
839
|
+
oracleInfo: Array<OracleInfo>,
|
|
840
|
+
pubkey: Array</*u8*/ number>,
|
|
841
|
+
fundingScriptPubkey: Array</*u8*/ number>,
|
|
842
|
+
totalCollateral: /*u64*/ bigint,
|
|
843
|
+
msgs: Array<Array<Array</*u8*/ number>>>
|
|
844
|
+
): boolean {
|
|
845
|
+
return FfiConverterBool.lift(
|
|
846
|
+
uniffiCaller.rustCall(
|
|
847
|
+
/*caller:*/ (callStatus) => {
|
|
848
|
+
return (() => {
|
|
849
|
+
console.debug(
|
|
850
|
+
`-- uniffi_ddk_ffi_fn_func_verify_cet_adaptor_sig_from_oracle_info`
|
|
851
|
+
);
|
|
852
|
+
return nativeModule()
|
|
853
|
+
.ubrn_uniffi_ddk_ffi_fn_func_verify_cet_adaptor_sig_from_oracle_info;
|
|
854
|
+
})()(
|
|
855
|
+
FfiConverterTypeAdaptorSignature.lower(adaptorSig),
|
|
856
|
+
FfiConverterTypeTransaction.lower(cet),
|
|
857
|
+
FfiConverterArrayTypeOracleInfo.lower(oracleInfo),
|
|
858
|
+
FfiConverterArrayUInt8.lower(pubkey),
|
|
859
|
+
FfiConverterArrayUInt8.lower(fundingScriptPubkey),
|
|
860
|
+
FfiConverterUInt64.lower(totalCollateral),
|
|
861
|
+
FfiConverterArrayArrayArrayUInt8.lower(msgs),
|
|
862
|
+
callStatus
|
|
863
|
+
);
|
|
864
|
+
},
|
|
865
|
+
/*liftString:*/ FfiConverterString.lift
|
|
866
|
+
)
|
|
867
|
+
);
|
|
868
|
+
}
|
|
869
|
+
export function verifyCetAdaptorSigsFromOracleInfo(
|
|
870
|
+
adaptorSigs: Array<AdaptorSignature>,
|
|
871
|
+
cets: Array<Transaction>,
|
|
872
|
+
oracleInfo: Array<OracleInfo>,
|
|
873
|
+
pubkey: Array</*u8*/ number>,
|
|
874
|
+
fundingScriptPubkey: Array</*u8*/ number>,
|
|
875
|
+
totalCollateral: /*u64*/ bigint,
|
|
876
|
+
msgs: Array<Array<Array<Array</*u8*/ number>>>>
|
|
877
|
+
): boolean {
|
|
878
|
+
return FfiConverterBool.lift(
|
|
879
|
+
uniffiCaller.rustCall(
|
|
880
|
+
/*caller:*/ (callStatus) => {
|
|
881
|
+
return (() => {
|
|
882
|
+
console.debug(
|
|
883
|
+
`-- uniffi_ddk_ffi_fn_func_verify_cet_adaptor_sigs_from_oracle_info`
|
|
884
|
+
);
|
|
885
|
+
return nativeModule()
|
|
886
|
+
.ubrn_uniffi_ddk_ffi_fn_func_verify_cet_adaptor_sigs_from_oracle_info;
|
|
887
|
+
})()(
|
|
888
|
+
FfiConverterArrayTypeAdaptorSignature.lower(adaptorSigs),
|
|
889
|
+
FfiConverterArrayTypeTransaction.lower(cets),
|
|
890
|
+
FfiConverterArrayTypeOracleInfo.lower(oracleInfo),
|
|
891
|
+
FfiConverterArrayUInt8.lower(pubkey),
|
|
892
|
+
FfiConverterArrayUInt8.lower(fundingScriptPubkey),
|
|
893
|
+
FfiConverterUInt64.lower(totalCollateral),
|
|
894
|
+
FfiConverterArrayArrayArrayArrayUInt8.lower(msgs),
|
|
895
|
+
callStatus
|
|
896
|
+
);
|
|
897
|
+
},
|
|
898
|
+
/*liftString:*/ FfiConverterString.lift
|
|
899
|
+
)
|
|
900
|
+
);
|
|
901
|
+
}
|
|
902
|
+
export function verifyFundTxSignature(
|
|
903
|
+
fundTx: Transaction,
|
|
904
|
+
signature: Array</*u8*/ number>,
|
|
905
|
+
pubkey: Array</*u8*/ number>,
|
|
906
|
+
txid: string,
|
|
907
|
+
vout: /*u32*/ number,
|
|
908
|
+
inputAmount: /*u64*/ bigint
|
|
909
|
+
): boolean /*throws*/ {
|
|
910
|
+
return FfiConverterBool.lift(
|
|
911
|
+
uniffiCaller.rustCallWithError(
|
|
912
|
+
/*liftError:*/ FfiConverterTypeDLCError.lift.bind(
|
|
913
|
+
FfiConverterTypeDLCError
|
|
914
|
+
),
|
|
915
|
+
/*caller:*/ (callStatus) => {
|
|
916
|
+
return (() => {
|
|
917
|
+
console.debug(`-- uniffi_ddk_ffi_fn_func_verify_fund_tx_signature`);
|
|
918
|
+
return nativeModule()
|
|
919
|
+
.ubrn_uniffi_ddk_ffi_fn_func_verify_fund_tx_signature;
|
|
920
|
+
})()(
|
|
921
|
+
FfiConverterTypeTransaction.lower(fundTx),
|
|
922
|
+
FfiConverterArrayUInt8.lower(signature),
|
|
923
|
+
FfiConverterArrayUInt8.lower(pubkey),
|
|
924
|
+
FfiConverterString.lower(txid),
|
|
925
|
+
FfiConverterUInt32.lower(vout),
|
|
926
|
+
FfiConverterUInt64.lower(inputAmount),
|
|
927
|
+
callStatus
|
|
928
|
+
);
|
|
929
|
+
},
|
|
930
|
+
/*liftString:*/ FfiConverterString.lift
|
|
931
|
+
)
|
|
932
|
+
);
|
|
933
|
+
}
|
|
639
934
|
export function version(): string {
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
console.debug(`-- uniffi_ddk_ffi_fn_func_version`);
|
|
645
|
-
|
|
646
|
-
})()(
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
935
|
+
return FfiConverterString.lift(
|
|
936
|
+
uniffiCaller.rustCall(
|
|
937
|
+
/*caller:*/ (callStatus) => {
|
|
938
|
+
return (() => {
|
|
939
|
+
console.debug(`-- uniffi_ddk_ffi_fn_func_version`);
|
|
940
|
+
return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_version;
|
|
941
|
+
})()(callStatus);
|
|
942
|
+
},
|
|
943
|
+
/*liftString:*/ FfiConverterString.lift
|
|
944
|
+
)
|
|
945
|
+
);
|
|
946
|
+
}
|
|
657
947
|
|
|
658
948
|
export type AdaptorSignature = {
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
}
|
|
949
|
+
signature: Array</*u8*/ number>;
|
|
950
|
+
proof: Array</*u8*/ number>;
|
|
951
|
+
};
|
|
662
952
|
|
|
663
953
|
/**
|
|
664
954
|
* Generated factory for {@link AdaptorSignature} record objects.
|
|
665
955
|
*/
|
|
666
956
|
export const AdaptorSignature = (() => {
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
957
|
+
const defaults = () => ({});
|
|
958
|
+
const create = (() => {
|
|
959
|
+
return uniffiCreateRecord<AdaptorSignature, ReturnType<typeof defaults>>(
|
|
960
|
+
defaults
|
|
961
|
+
);
|
|
962
|
+
})();
|
|
963
|
+
return Object.freeze({
|
|
964
|
+
/**
|
|
965
|
+
* Create a frozen instance of {@link AdaptorSignature}, with defaults specified
|
|
966
|
+
* in Rust, in the {@link ddk_ffi} crate.
|
|
967
|
+
*/
|
|
968
|
+
create,
|
|
969
|
+
|
|
970
|
+
/**
|
|
971
|
+
* Create a frozen instance of {@link AdaptorSignature}, with defaults specified
|
|
972
|
+
* in Rust, in the {@link ddk_ffi} crate.
|
|
973
|
+
*/
|
|
974
|
+
new: create,
|
|
975
|
+
|
|
976
|
+
/**
|
|
977
|
+
* Defaults specified in the {@link ddk_ffi} crate.
|
|
978
|
+
*/
|
|
979
|
+
defaults: () => Object.freeze(defaults()) as Partial<AdaptorSignature>,
|
|
980
|
+
});
|
|
690
981
|
})();
|
|
691
982
|
|
|
692
983
|
const FfiConverterTypeAdaptorSignature = (() => {
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
}
|
|
711
|
-
|
|
984
|
+
type TypeName = AdaptorSignature;
|
|
985
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
986
|
+
read(from: RustBuffer): TypeName {
|
|
987
|
+
return {
|
|
988
|
+
signature: FfiConverterArrayUInt8.read(from),
|
|
989
|
+
proof: FfiConverterArrayUInt8.read(from),
|
|
990
|
+
};
|
|
991
|
+
}
|
|
992
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
993
|
+
FfiConverterArrayUInt8.write(value.signature, into);
|
|
994
|
+
FfiConverterArrayUInt8.write(value.proof, into);
|
|
995
|
+
}
|
|
996
|
+
allocationSize(value: TypeName): number {
|
|
997
|
+
return (
|
|
998
|
+
FfiConverterArrayUInt8.allocationSize(value.signature) +
|
|
999
|
+
FfiConverterArrayUInt8.allocationSize(value.proof)
|
|
1000
|
+
);
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
return new FFIConverter();
|
|
712
1004
|
})();
|
|
713
1005
|
|
|
714
|
-
|
|
715
1006
|
export type CetAdaptorSignatureDebugInfo = {
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
}
|
|
1007
|
+
sighash: Array</*u8*/ number>;
|
|
1008
|
+
adaptorPoint: Array</*u8*/ number>;
|
|
1009
|
+
inputIndex: /*u32*/ number;
|
|
1010
|
+
scriptPubkey: Array</*u8*/ number>;
|
|
1011
|
+
value: /*u64*/ bigint;
|
|
1012
|
+
cetTxid: string;
|
|
1013
|
+
cetRaw: Array</*u8*/ number>;
|
|
1014
|
+
};
|
|
724
1015
|
|
|
725
1016
|
/**
|
|
726
1017
|
* Generated factory for {@link CetAdaptorSignatureDebugInfo} record objects.
|
|
727
1018
|
*/
|
|
728
1019
|
export const CetAdaptorSignatureDebugInfo = (() => {
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
1020
|
+
const defaults = () => ({});
|
|
1021
|
+
const create = (() => {
|
|
1022
|
+
return uniffiCreateRecord<
|
|
1023
|
+
CetAdaptorSignatureDebugInfo,
|
|
1024
|
+
ReturnType<typeof defaults>
|
|
1025
|
+
>(defaults);
|
|
1026
|
+
})();
|
|
1027
|
+
return Object.freeze({
|
|
1028
|
+
/**
|
|
1029
|
+
* Create a frozen instance of {@link CetAdaptorSignatureDebugInfo}, with defaults specified
|
|
1030
|
+
* in Rust, in the {@link ddk_ffi} crate.
|
|
1031
|
+
*/
|
|
1032
|
+
create,
|
|
1033
|
+
|
|
1034
|
+
/**
|
|
1035
|
+
* Create a frozen instance of {@link CetAdaptorSignatureDebugInfo}, with defaults specified
|
|
1036
|
+
* in Rust, in the {@link ddk_ffi} crate.
|
|
1037
|
+
*/
|
|
1038
|
+
new: create,
|
|
1039
|
+
|
|
1040
|
+
/**
|
|
1041
|
+
* Defaults specified in the {@link ddk_ffi} crate.
|
|
1042
|
+
*/
|
|
1043
|
+
defaults: () =>
|
|
1044
|
+
Object.freeze(defaults()) as Partial<CetAdaptorSignatureDebugInfo>,
|
|
1045
|
+
});
|
|
752
1046
|
})();
|
|
753
1047
|
|
|
754
1048
|
const FfiConverterTypeCetAdaptorSignatureDebugInfo = (() => {
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
}
|
|
788
|
-
|
|
1049
|
+
type TypeName = CetAdaptorSignatureDebugInfo;
|
|
1050
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
1051
|
+
read(from: RustBuffer): TypeName {
|
|
1052
|
+
return {
|
|
1053
|
+
sighash: FfiConverterArrayUInt8.read(from),
|
|
1054
|
+
adaptorPoint: FfiConverterArrayUInt8.read(from),
|
|
1055
|
+
inputIndex: FfiConverterUInt32.read(from),
|
|
1056
|
+
scriptPubkey: FfiConverterArrayUInt8.read(from),
|
|
1057
|
+
value: FfiConverterUInt64.read(from),
|
|
1058
|
+
cetTxid: FfiConverterString.read(from),
|
|
1059
|
+
cetRaw: FfiConverterArrayUInt8.read(from),
|
|
1060
|
+
};
|
|
1061
|
+
}
|
|
1062
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
1063
|
+
FfiConverterArrayUInt8.write(value.sighash, into);
|
|
1064
|
+
FfiConverterArrayUInt8.write(value.adaptorPoint, into);
|
|
1065
|
+
FfiConverterUInt32.write(value.inputIndex, into);
|
|
1066
|
+
FfiConverterArrayUInt8.write(value.scriptPubkey, into);
|
|
1067
|
+
FfiConverterUInt64.write(value.value, into);
|
|
1068
|
+
FfiConverterString.write(value.cetTxid, into);
|
|
1069
|
+
FfiConverterArrayUInt8.write(value.cetRaw, into);
|
|
1070
|
+
}
|
|
1071
|
+
allocationSize(value: TypeName): number {
|
|
1072
|
+
return (
|
|
1073
|
+
FfiConverterArrayUInt8.allocationSize(value.sighash) +
|
|
1074
|
+
FfiConverterArrayUInt8.allocationSize(value.adaptorPoint) +
|
|
1075
|
+
FfiConverterUInt32.allocationSize(value.inputIndex) +
|
|
1076
|
+
FfiConverterArrayUInt8.allocationSize(value.scriptPubkey) +
|
|
1077
|
+
FfiConverterUInt64.allocationSize(value.value) +
|
|
1078
|
+
FfiConverterString.allocationSize(value.cetTxid) +
|
|
1079
|
+
FfiConverterArrayUInt8.allocationSize(value.cetRaw)
|
|
1080
|
+
);
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
return new FFIConverter();
|
|
789
1084
|
})();
|
|
790
1085
|
|
|
791
|
-
|
|
792
1086
|
export type ChangeOutputAndFees = {
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
}
|
|
1087
|
+
changeOutput: TxOutput;
|
|
1088
|
+
fundFee: /*u64*/ bigint;
|
|
1089
|
+
cetFee: /*u64*/ bigint;
|
|
1090
|
+
};
|
|
797
1091
|
|
|
798
1092
|
/**
|
|
799
1093
|
* Generated factory for {@link ChangeOutputAndFees} record objects.
|
|
800
1094
|
*/
|
|
801
1095
|
export const ChangeOutputAndFees = (() => {
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
1096
|
+
const defaults = () => ({});
|
|
1097
|
+
const create = (() => {
|
|
1098
|
+
return uniffiCreateRecord<ChangeOutputAndFees, ReturnType<typeof defaults>>(
|
|
1099
|
+
defaults
|
|
1100
|
+
);
|
|
1101
|
+
})();
|
|
1102
|
+
return Object.freeze({
|
|
1103
|
+
/**
|
|
1104
|
+
* Create a frozen instance of {@link ChangeOutputAndFees}, with defaults specified
|
|
1105
|
+
* in Rust, in the {@link ddk_ffi} crate.
|
|
1106
|
+
*/
|
|
1107
|
+
create,
|
|
1108
|
+
|
|
1109
|
+
/**
|
|
1110
|
+
* Create a frozen instance of {@link ChangeOutputAndFees}, with defaults specified
|
|
1111
|
+
* in Rust, in the {@link ddk_ffi} crate.
|
|
1112
|
+
*/
|
|
1113
|
+
new: create,
|
|
1114
|
+
|
|
1115
|
+
/**
|
|
1116
|
+
* Defaults specified in the {@link ddk_ffi} crate.
|
|
1117
|
+
*/
|
|
1118
|
+
defaults: () => Object.freeze(defaults()) as Partial<ChangeOutputAndFees>,
|
|
1119
|
+
});
|
|
825
1120
|
})();
|
|
826
1121
|
|
|
827
1122
|
const FfiConverterTypeChangeOutputAndFees = (() => {
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
}
|
|
849
|
-
|
|
1123
|
+
type TypeName = ChangeOutputAndFees;
|
|
1124
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
1125
|
+
read(from: RustBuffer): TypeName {
|
|
1126
|
+
return {
|
|
1127
|
+
changeOutput: FfiConverterTypeTxOutput.read(from),
|
|
1128
|
+
fundFee: FfiConverterUInt64.read(from),
|
|
1129
|
+
cetFee: FfiConverterUInt64.read(from),
|
|
1130
|
+
};
|
|
1131
|
+
}
|
|
1132
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
1133
|
+
FfiConverterTypeTxOutput.write(value.changeOutput, into);
|
|
1134
|
+
FfiConverterUInt64.write(value.fundFee, into);
|
|
1135
|
+
FfiConverterUInt64.write(value.cetFee, into);
|
|
1136
|
+
}
|
|
1137
|
+
allocationSize(value: TypeName): number {
|
|
1138
|
+
return (
|
|
1139
|
+
FfiConverterTypeTxOutput.allocationSize(value.changeOutput) +
|
|
1140
|
+
FfiConverterUInt64.allocationSize(value.fundFee) +
|
|
1141
|
+
FfiConverterUInt64.allocationSize(value.cetFee)
|
|
1142
|
+
);
|
|
1143
|
+
}
|
|
1144
|
+
}
|
|
1145
|
+
return new FFIConverter();
|
|
850
1146
|
})();
|
|
851
1147
|
|
|
852
|
-
|
|
853
1148
|
export type DlcInputInfo = {
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
}
|
|
1149
|
+
fundTx: Transaction;
|
|
1150
|
+
fundVout: /*u32*/ number;
|
|
1151
|
+
localFundPubkey: Array</*u8*/ number>;
|
|
1152
|
+
remoteFundPubkey: Array</*u8*/ number>;
|
|
1153
|
+
fundAmount: /*u64*/ bigint;
|
|
1154
|
+
maxWitnessLen: /*u32*/ number;
|
|
1155
|
+
inputSerialId: /*u64*/ bigint;
|
|
1156
|
+
contractId: Array</*u8*/ number>;
|
|
1157
|
+
};
|
|
863
1158
|
|
|
864
1159
|
/**
|
|
865
1160
|
* Generated factory for {@link DlcInputInfo} record objects.
|
|
866
1161
|
*/
|
|
867
1162
|
export const DlcInputInfo = (() => {
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
1163
|
+
const defaults = () => ({});
|
|
1164
|
+
const create = (() => {
|
|
1165
|
+
return uniffiCreateRecord<DlcInputInfo, ReturnType<typeof defaults>>(
|
|
1166
|
+
defaults
|
|
1167
|
+
);
|
|
1168
|
+
})();
|
|
1169
|
+
return Object.freeze({
|
|
1170
|
+
/**
|
|
1171
|
+
* Create a frozen instance of {@link DlcInputInfo}, with defaults specified
|
|
1172
|
+
* in Rust, in the {@link ddk_ffi} crate.
|
|
1173
|
+
*/
|
|
1174
|
+
create,
|
|
1175
|
+
|
|
1176
|
+
/**
|
|
1177
|
+
* Create a frozen instance of {@link DlcInputInfo}, with defaults specified
|
|
1178
|
+
* in Rust, in the {@link ddk_ffi} crate.
|
|
1179
|
+
*/
|
|
1180
|
+
new: create,
|
|
1181
|
+
|
|
1182
|
+
/**
|
|
1183
|
+
* Defaults specified in the {@link ddk_ffi} crate.
|
|
1184
|
+
*/
|
|
1185
|
+
defaults: () => Object.freeze(defaults()) as Partial<DlcInputInfo>,
|
|
1186
|
+
});
|
|
891
1187
|
})();
|
|
892
1188
|
|
|
893
1189
|
const FfiConverterTypeDlcInputInfo = (() => {
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
}
|
|
930
|
-
|
|
1190
|
+
type TypeName = DlcInputInfo;
|
|
1191
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
1192
|
+
read(from: RustBuffer): TypeName {
|
|
1193
|
+
return {
|
|
1194
|
+
fundTx: FfiConverterTypeTransaction.read(from),
|
|
1195
|
+
fundVout: FfiConverterUInt32.read(from),
|
|
1196
|
+
localFundPubkey: FfiConverterArrayUInt8.read(from),
|
|
1197
|
+
remoteFundPubkey: FfiConverterArrayUInt8.read(from),
|
|
1198
|
+
fundAmount: FfiConverterUInt64.read(from),
|
|
1199
|
+
maxWitnessLen: FfiConverterUInt32.read(from),
|
|
1200
|
+
inputSerialId: FfiConverterUInt64.read(from),
|
|
1201
|
+
contractId: FfiConverterArrayUInt8.read(from),
|
|
1202
|
+
};
|
|
1203
|
+
}
|
|
1204
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
1205
|
+
FfiConverterTypeTransaction.write(value.fundTx, into);
|
|
1206
|
+
FfiConverterUInt32.write(value.fundVout, into);
|
|
1207
|
+
FfiConverterArrayUInt8.write(value.localFundPubkey, into);
|
|
1208
|
+
FfiConverterArrayUInt8.write(value.remoteFundPubkey, into);
|
|
1209
|
+
FfiConverterUInt64.write(value.fundAmount, into);
|
|
1210
|
+
FfiConverterUInt32.write(value.maxWitnessLen, into);
|
|
1211
|
+
FfiConverterUInt64.write(value.inputSerialId, into);
|
|
1212
|
+
FfiConverterArrayUInt8.write(value.contractId, into);
|
|
1213
|
+
}
|
|
1214
|
+
allocationSize(value: TypeName): number {
|
|
1215
|
+
return (
|
|
1216
|
+
FfiConverterTypeTransaction.allocationSize(value.fundTx) +
|
|
1217
|
+
FfiConverterUInt32.allocationSize(value.fundVout) +
|
|
1218
|
+
FfiConverterArrayUInt8.allocationSize(value.localFundPubkey) +
|
|
1219
|
+
FfiConverterArrayUInt8.allocationSize(value.remoteFundPubkey) +
|
|
1220
|
+
FfiConverterUInt64.allocationSize(value.fundAmount) +
|
|
1221
|
+
FfiConverterUInt32.allocationSize(value.maxWitnessLen) +
|
|
1222
|
+
FfiConverterUInt64.allocationSize(value.inputSerialId) +
|
|
1223
|
+
FfiConverterArrayUInt8.allocationSize(value.contractId)
|
|
1224
|
+
);
|
|
1225
|
+
}
|
|
1226
|
+
}
|
|
1227
|
+
return new FFIConverter();
|
|
931
1228
|
})();
|
|
932
1229
|
|
|
933
|
-
|
|
934
1230
|
export type DlcTransactions = {
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
}
|
|
1231
|
+
fund: Transaction;
|
|
1232
|
+
cets: Array<Transaction>;
|
|
1233
|
+
refund: Transaction;
|
|
1234
|
+
fundingScriptPubkey: Array</*u8*/ number>;
|
|
1235
|
+
};
|
|
940
1236
|
|
|
941
1237
|
/**
|
|
942
1238
|
* Generated factory for {@link DlcTransactions} record objects.
|
|
943
1239
|
*/
|
|
944
1240
|
export const DlcTransactions = (() => {
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
1241
|
+
const defaults = () => ({});
|
|
1242
|
+
const create = (() => {
|
|
1243
|
+
return uniffiCreateRecord<DlcTransactions, ReturnType<typeof defaults>>(
|
|
1244
|
+
defaults
|
|
1245
|
+
);
|
|
1246
|
+
})();
|
|
1247
|
+
return Object.freeze({
|
|
1248
|
+
/**
|
|
1249
|
+
* Create a frozen instance of {@link DlcTransactions}, with defaults specified
|
|
1250
|
+
* in Rust, in the {@link ddk_ffi} crate.
|
|
1251
|
+
*/
|
|
1252
|
+
create,
|
|
1253
|
+
|
|
1254
|
+
/**
|
|
1255
|
+
* Create a frozen instance of {@link DlcTransactions}, with defaults specified
|
|
1256
|
+
* in Rust, in the {@link ddk_ffi} crate.
|
|
1257
|
+
*/
|
|
1258
|
+
new: create,
|
|
1259
|
+
|
|
1260
|
+
/**
|
|
1261
|
+
* Defaults specified in the {@link ddk_ffi} crate.
|
|
1262
|
+
*/
|
|
1263
|
+
defaults: () => Object.freeze(defaults()) as Partial<DlcTransactions>,
|
|
1264
|
+
});
|
|
968
1265
|
})();
|
|
969
1266
|
|
|
970
1267
|
const FfiConverterTypeDlcTransactions = (() => {
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
}
|
|
995
|
-
|
|
1268
|
+
type TypeName = DlcTransactions;
|
|
1269
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
1270
|
+
read(from: RustBuffer): TypeName {
|
|
1271
|
+
return {
|
|
1272
|
+
fund: FfiConverterTypeTransaction.read(from),
|
|
1273
|
+
cets: FfiConverterArrayTypeTransaction.read(from),
|
|
1274
|
+
refund: FfiConverterTypeTransaction.read(from),
|
|
1275
|
+
fundingScriptPubkey: FfiConverterArrayUInt8.read(from),
|
|
1276
|
+
};
|
|
1277
|
+
}
|
|
1278
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
1279
|
+
FfiConverterTypeTransaction.write(value.fund, into);
|
|
1280
|
+
FfiConverterArrayTypeTransaction.write(value.cets, into);
|
|
1281
|
+
FfiConverterTypeTransaction.write(value.refund, into);
|
|
1282
|
+
FfiConverterArrayUInt8.write(value.fundingScriptPubkey, into);
|
|
1283
|
+
}
|
|
1284
|
+
allocationSize(value: TypeName): number {
|
|
1285
|
+
return (
|
|
1286
|
+
FfiConverterTypeTransaction.allocationSize(value.fund) +
|
|
1287
|
+
FfiConverterArrayTypeTransaction.allocationSize(value.cets) +
|
|
1288
|
+
FfiConverterTypeTransaction.allocationSize(value.refund) +
|
|
1289
|
+
FfiConverterArrayUInt8.allocationSize(value.fundingScriptPubkey)
|
|
1290
|
+
);
|
|
1291
|
+
}
|
|
1292
|
+
}
|
|
1293
|
+
return new FFIConverter();
|
|
996
1294
|
})();
|
|
997
1295
|
|
|
998
|
-
|
|
999
1296
|
export type OracleInfo = {
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
}
|
|
1297
|
+
publicKey: Array</*u8*/ number>;
|
|
1298
|
+
nonces: Array<Array</*u8*/ number>>;
|
|
1299
|
+
};
|
|
1003
1300
|
|
|
1004
1301
|
/**
|
|
1005
1302
|
* Generated factory for {@link OracleInfo} record objects.
|
|
1006
1303
|
*/
|
|
1007
1304
|
export const OracleInfo = (() => {
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1305
|
+
const defaults = () => ({});
|
|
1306
|
+
const create = (() => {
|
|
1307
|
+
return uniffiCreateRecord<OracleInfo, ReturnType<typeof defaults>>(
|
|
1308
|
+
defaults
|
|
1309
|
+
);
|
|
1310
|
+
})();
|
|
1311
|
+
return Object.freeze({
|
|
1312
|
+
/**
|
|
1313
|
+
* Create a frozen instance of {@link OracleInfo}, with defaults specified
|
|
1314
|
+
* in Rust, in the {@link ddk_ffi} crate.
|
|
1315
|
+
*/
|
|
1316
|
+
create,
|
|
1317
|
+
|
|
1318
|
+
/**
|
|
1319
|
+
* Create a frozen instance of {@link OracleInfo}, with defaults specified
|
|
1320
|
+
* in Rust, in the {@link ddk_ffi} crate.
|
|
1321
|
+
*/
|
|
1322
|
+
new: create,
|
|
1323
|
+
|
|
1324
|
+
/**
|
|
1325
|
+
* Defaults specified in the {@link ddk_ffi} crate.
|
|
1326
|
+
*/
|
|
1327
|
+
defaults: () => Object.freeze(defaults()) as Partial<OracleInfo>,
|
|
1328
|
+
});
|
|
1031
1329
|
})();
|
|
1032
1330
|
|
|
1033
1331
|
const FfiConverterTypeOracleInfo = (() => {
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
}
|
|
1052
|
-
|
|
1332
|
+
type TypeName = OracleInfo;
|
|
1333
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
1334
|
+
read(from: RustBuffer): TypeName {
|
|
1335
|
+
return {
|
|
1336
|
+
publicKey: FfiConverterArrayUInt8.read(from),
|
|
1337
|
+
nonces: FfiConverterArrayArrayUInt8.read(from),
|
|
1338
|
+
};
|
|
1339
|
+
}
|
|
1340
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
1341
|
+
FfiConverterArrayUInt8.write(value.publicKey, into);
|
|
1342
|
+
FfiConverterArrayArrayUInt8.write(value.nonces, into);
|
|
1343
|
+
}
|
|
1344
|
+
allocationSize(value: TypeName): number {
|
|
1345
|
+
return (
|
|
1346
|
+
FfiConverterArrayUInt8.allocationSize(value.publicKey) +
|
|
1347
|
+
FfiConverterArrayArrayUInt8.allocationSize(value.nonces)
|
|
1348
|
+
);
|
|
1349
|
+
}
|
|
1350
|
+
}
|
|
1351
|
+
return new FFIConverter();
|
|
1053
1352
|
})();
|
|
1054
1353
|
|
|
1055
|
-
|
|
1056
1354
|
export type PartyParams = {
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
}
|
|
1355
|
+
fundPubkey: Array</*u8*/ number>;
|
|
1356
|
+
changeScriptPubkey: Array</*u8*/ number>;
|
|
1357
|
+
changeSerialId: /*u64*/ bigint;
|
|
1358
|
+
payoutScriptPubkey: Array</*u8*/ number>;
|
|
1359
|
+
payoutSerialId: /*u64*/ bigint;
|
|
1360
|
+
inputs: Array<TxInputInfo>;
|
|
1361
|
+
inputAmount: /*u64*/ bigint;
|
|
1362
|
+
collateral: /*u64*/ bigint;
|
|
1363
|
+
dlcInputs: Array<DlcInputInfo>;
|
|
1364
|
+
};
|
|
1067
1365
|
|
|
1068
1366
|
/**
|
|
1069
1367
|
* Generated factory for {@link PartyParams} record objects.
|
|
1070
1368
|
*/
|
|
1071
1369
|
export const PartyParams = (() => {
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1370
|
+
const defaults = () => ({});
|
|
1371
|
+
const create = (() => {
|
|
1372
|
+
return uniffiCreateRecord<PartyParams, ReturnType<typeof defaults>>(
|
|
1373
|
+
defaults
|
|
1374
|
+
);
|
|
1375
|
+
})();
|
|
1376
|
+
return Object.freeze({
|
|
1377
|
+
/**
|
|
1378
|
+
* Create a frozen instance of {@link PartyParams}, with defaults specified
|
|
1379
|
+
* in Rust, in the {@link ddk_ffi} crate.
|
|
1380
|
+
*/
|
|
1381
|
+
create,
|
|
1382
|
+
|
|
1383
|
+
/**
|
|
1384
|
+
* Create a frozen instance of {@link PartyParams}, with defaults specified
|
|
1385
|
+
* in Rust, in the {@link ddk_ffi} crate.
|
|
1386
|
+
*/
|
|
1387
|
+
new: create,
|
|
1388
|
+
|
|
1389
|
+
/**
|
|
1390
|
+
* Defaults specified in the {@link ddk_ffi} crate.
|
|
1391
|
+
*/
|
|
1392
|
+
defaults: () => Object.freeze(defaults()) as Partial<PartyParams>,
|
|
1393
|
+
});
|
|
1095
1394
|
})();
|
|
1096
1395
|
|
|
1097
1396
|
const FfiConverterTypePartyParams = (() => {
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
}
|
|
1137
|
-
|
|
1397
|
+
type TypeName = PartyParams;
|
|
1398
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
1399
|
+
read(from: RustBuffer): TypeName {
|
|
1400
|
+
return {
|
|
1401
|
+
fundPubkey: FfiConverterArrayUInt8.read(from),
|
|
1402
|
+
changeScriptPubkey: FfiConverterArrayUInt8.read(from),
|
|
1403
|
+
changeSerialId: FfiConverterUInt64.read(from),
|
|
1404
|
+
payoutScriptPubkey: FfiConverterArrayUInt8.read(from),
|
|
1405
|
+
payoutSerialId: FfiConverterUInt64.read(from),
|
|
1406
|
+
inputs: FfiConverterArrayTypeTxInputInfo.read(from),
|
|
1407
|
+
inputAmount: FfiConverterUInt64.read(from),
|
|
1408
|
+
collateral: FfiConverterUInt64.read(from),
|
|
1409
|
+
dlcInputs: FfiConverterArrayTypeDlcInputInfo.read(from),
|
|
1410
|
+
};
|
|
1411
|
+
}
|
|
1412
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
1413
|
+
FfiConverterArrayUInt8.write(value.fundPubkey, into);
|
|
1414
|
+
FfiConverterArrayUInt8.write(value.changeScriptPubkey, into);
|
|
1415
|
+
FfiConverterUInt64.write(value.changeSerialId, into);
|
|
1416
|
+
FfiConverterArrayUInt8.write(value.payoutScriptPubkey, into);
|
|
1417
|
+
FfiConverterUInt64.write(value.payoutSerialId, into);
|
|
1418
|
+
FfiConverterArrayTypeTxInputInfo.write(value.inputs, into);
|
|
1419
|
+
FfiConverterUInt64.write(value.inputAmount, into);
|
|
1420
|
+
FfiConverterUInt64.write(value.collateral, into);
|
|
1421
|
+
FfiConverterArrayTypeDlcInputInfo.write(value.dlcInputs, into);
|
|
1422
|
+
}
|
|
1423
|
+
allocationSize(value: TypeName): number {
|
|
1424
|
+
return (
|
|
1425
|
+
FfiConverterArrayUInt8.allocationSize(value.fundPubkey) +
|
|
1426
|
+
FfiConverterArrayUInt8.allocationSize(value.changeScriptPubkey) +
|
|
1427
|
+
FfiConverterUInt64.allocationSize(value.changeSerialId) +
|
|
1428
|
+
FfiConverterArrayUInt8.allocationSize(value.payoutScriptPubkey) +
|
|
1429
|
+
FfiConverterUInt64.allocationSize(value.payoutSerialId) +
|
|
1430
|
+
FfiConverterArrayTypeTxInputInfo.allocationSize(value.inputs) +
|
|
1431
|
+
FfiConverterUInt64.allocationSize(value.inputAmount) +
|
|
1432
|
+
FfiConverterUInt64.allocationSize(value.collateral) +
|
|
1433
|
+
FfiConverterArrayTypeDlcInputInfo.allocationSize(value.dlcInputs)
|
|
1434
|
+
);
|
|
1435
|
+
}
|
|
1436
|
+
}
|
|
1437
|
+
return new FFIConverter();
|
|
1138
1438
|
})();
|
|
1139
1439
|
|
|
1140
|
-
|
|
1141
1440
|
export type Payout = {
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
}
|
|
1441
|
+
offer: /*u64*/ bigint;
|
|
1442
|
+
accept: /*u64*/ bigint;
|
|
1443
|
+
};
|
|
1145
1444
|
|
|
1146
1445
|
/**
|
|
1147
1446
|
* Generated factory for {@link Payout} record objects.
|
|
1148
1447
|
*/
|
|
1149
1448
|
export const Payout = (() => {
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
});
|
|
1449
|
+
const defaults = () => ({});
|
|
1450
|
+
const create = (() => {
|
|
1451
|
+
return uniffiCreateRecord<Payout, ReturnType<typeof defaults>>(defaults);
|
|
1452
|
+
})();
|
|
1453
|
+
return Object.freeze({
|
|
1454
|
+
/**
|
|
1455
|
+
* Create a frozen instance of {@link Payout}, with defaults specified
|
|
1456
|
+
* in Rust, in the {@link ddk_ffi} crate.
|
|
1457
|
+
*/
|
|
1458
|
+
create,
|
|
1459
|
+
|
|
1460
|
+
/**
|
|
1461
|
+
* Create a frozen instance of {@link Payout}, with defaults specified
|
|
1462
|
+
* in Rust, in the {@link ddk_ffi} crate.
|
|
1463
|
+
*/
|
|
1464
|
+
new: create,
|
|
1465
|
+
|
|
1466
|
+
/**
|
|
1467
|
+
* Defaults specified in the {@link ddk_ffi} crate.
|
|
1468
|
+
*/
|
|
1469
|
+
defaults: () => Object.freeze(defaults()) as Partial<Payout>,
|
|
1470
|
+
});
|
|
1173
1471
|
})();
|
|
1174
1472
|
|
|
1175
1473
|
const FfiConverterTypePayout = (() => {
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
}
|
|
1194
|
-
|
|
1474
|
+
type TypeName = Payout;
|
|
1475
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
1476
|
+
read(from: RustBuffer): TypeName {
|
|
1477
|
+
return {
|
|
1478
|
+
offer: FfiConverterUInt64.read(from),
|
|
1479
|
+
accept: FfiConverterUInt64.read(from),
|
|
1480
|
+
};
|
|
1481
|
+
}
|
|
1482
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
1483
|
+
FfiConverterUInt64.write(value.offer, into);
|
|
1484
|
+
FfiConverterUInt64.write(value.accept, into);
|
|
1485
|
+
}
|
|
1486
|
+
allocationSize(value: TypeName): number {
|
|
1487
|
+
return (
|
|
1488
|
+
FfiConverterUInt64.allocationSize(value.offer) +
|
|
1489
|
+
FfiConverterUInt64.allocationSize(value.accept)
|
|
1490
|
+
);
|
|
1491
|
+
}
|
|
1492
|
+
}
|
|
1493
|
+
return new FFIConverter();
|
|
1195
1494
|
})();
|
|
1196
1495
|
|
|
1197
|
-
|
|
1198
1496
|
export type Transaction = {
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
}
|
|
1497
|
+
version: /*i32*/ number;
|
|
1498
|
+
lockTime: /*u32*/ number;
|
|
1499
|
+
inputs: Array<TxInput>;
|
|
1500
|
+
outputs: Array<TxOutput>;
|
|
1501
|
+
rawBytes: Array</*u8*/ number>;
|
|
1502
|
+
};
|
|
1205
1503
|
|
|
1206
1504
|
/**
|
|
1207
1505
|
* Generated factory for {@link Transaction} record objects.
|
|
1208
1506
|
*/
|
|
1209
1507
|
export const Transaction = (() => {
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1508
|
+
const defaults = () => ({});
|
|
1509
|
+
const create = (() => {
|
|
1510
|
+
return uniffiCreateRecord<Transaction, ReturnType<typeof defaults>>(
|
|
1511
|
+
defaults
|
|
1512
|
+
);
|
|
1513
|
+
})();
|
|
1514
|
+
return Object.freeze({
|
|
1515
|
+
/**
|
|
1516
|
+
* Create a frozen instance of {@link Transaction}, with defaults specified
|
|
1517
|
+
* in Rust, in the {@link ddk_ffi} crate.
|
|
1518
|
+
*/
|
|
1519
|
+
create,
|
|
1520
|
+
|
|
1521
|
+
/**
|
|
1522
|
+
* Create a frozen instance of {@link Transaction}, with defaults specified
|
|
1523
|
+
* in Rust, in the {@link ddk_ffi} crate.
|
|
1524
|
+
*/
|
|
1525
|
+
new: create,
|
|
1526
|
+
|
|
1527
|
+
/**
|
|
1528
|
+
* Defaults specified in the {@link ddk_ffi} crate.
|
|
1529
|
+
*/
|
|
1530
|
+
defaults: () => Object.freeze(defaults()) as Partial<Transaction>,
|
|
1531
|
+
});
|
|
1233
1532
|
})();
|
|
1234
1533
|
|
|
1235
1534
|
const FfiConverterTypeTransaction = (() => {
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
}
|
|
1263
|
-
|
|
1535
|
+
type TypeName = Transaction;
|
|
1536
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
1537
|
+
read(from: RustBuffer): TypeName {
|
|
1538
|
+
return {
|
|
1539
|
+
version: FfiConverterInt32.read(from),
|
|
1540
|
+
lockTime: FfiConverterUInt32.read(from),
|
|
1541
|
+
inputs: FfiConverterArrayTypeTxInput.read(from),
|
|
1542
|
+
outputs: FfiConverterArrayTypeTxOutput.read(from),
|
|
1543
|
+
rawBytes: FfiConverterArrayUInt8.read(from),
|
|
1544
|
+
};
|
|
1545
|
+
}
|
|
1546
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
1547
|
+
FfiConverterInt32.write(value.version, into);
|
|
1548
|
+
FfiConverterUInt32.write(value.lockTime, into);
|
|
1549
|
+
FfiConverterArrayTypeTxInput.write(value.inputs, into);
|
|
1550
|
+
FfiConverterArrayTypeTxOutput.write(value.outputs, into);
|
|
1551
|
+
FfiConverterArrayUInt8.write(value.rawBytes, into);
|
|
1552
|
+
}
|
|
1553
|
+
allocationSize(value: TypeName): number {
|
|
1554
|
+
return (
|
|
1555
|
+
FfiConverterInt32.allocationSize(value.version) +
|
|
1556
|
+
FfiConverterUInt32.allocationSize(value.lockTime) +
|
|
1557
|
+
FfiConverterArrayTypeTxInput.allocationSize(value.inputs) +
|
|
1558
|
+
FfiConverterArrayTypeTxOutput.allocationSize(value.outputs) +
|
|
1559
|
+
FfiConverterArrayUInt8.allocationSize(value.rawBytes)
|
|
1560
|
+
);
|
|
1561
|
+
}
|
|
1562
|
+
}
|
|
1563
|
+
return new FFIConverter();
|
|
1264
1564
|
})();
|
|
1265
1565
|
|
|
1266
|
-
|
|
1267
1566
|
export type TxInput = {
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
}
|
|
1567
|
+
txid: string;
|
|
1568
|
+
vout: /*u32*/ number;
|
|
1569
|
+
scriptSig: Array</*u8*/ number>;
|
|
1570
|
+
sequence: /*u32*/ number;
|
|
1571
|
+
witness: Array<Array</*u8*/ number>>;
|
|
1572
|
+
};
|
|
1274
1573
|
|
|
1275
1574
|
/**
|
|
1276
1575
|
* Generated factory for {@link TxInput} record objects.
|
|
1277
1576
|
*/
|
|
1278
1577
|
export const TxInput = (() => {
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
});
|
|
1578
|
+
const defaults = () => ({});
|
|
1579
|
+
const create = (() => {
|
|
1580
|
+
return uniffiCreateRecord<TxInput, ReturnType<typeof defaults>>(defaults);
|
|
1581
|
+
})();
|
|
1582
|
+
return Object.freeze({
|
|
1583
|
+
/**
|
|
1584
|
+
* Create a frozen instance of {@link TxInput}, with defaults specified
|
|
1585
|
+
* in Rust, in the {@link ddk_ffi} crate.
|
|
1586
|
+
*/
|
|
1587
|
+
create,
|
|
1588
|
+
|
|
1589
|
+
/**
|
|
1590
|
+
* Create a frozen instance of {@link TxInput}, with defaults specified
|
|
1591
|
+
* in Rust, in the {@link ddk_ffi} crate.
|
|
1592
|
+
*/
|
|
1593
|
+
new: create,
|
|
1594
|
+
|
|
1595
|
+
/**
|
|
1596
|
+
* Defaults specified in the {@link ddk_ffi} crate.
|
|
1597
|
+
*/
|
|
1598
|
+
defaults: () => Object.freeze(defaults()) as Partial<TxInput>,
|
|
1599
|
+
});
|
|
1302
1600
|
})();
|
|
1303
1601
|
|
|
1304
1602
|
const FfiConverterTypeTxInput = (() => {
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
}
|
|
1332
|
-
|
|
1603
|
+
type TypeName = TxInput;
|
|
1604
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
1605
|
+
read(from: RustBuffer): TypeName {
|
|
1606
|
+
return {
|
|
1607
|
+
txid: FfiConverterString.read(from),
|
|
1608
|
+
vout: FfiConverterUInt32.read(from),
|
|
1609
|
+
scriptSig: FfiConverterArrayUInt8.read(from),
|
|
1610
|
+
sequence: FfiConverterUInt32.read(from),
|
|
1611
|
+
witness: FfiConverterArrayArrayUInt8.read(from),
|
|
1612
|
+
};
|
|
1613
|
+
}
|
|
1614
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
1615
|
+
FfiConverterString.write(value.txid, into);
|
|
1616
|
+
FfiConverterUInt32.write(value.vout, into);
|
|
1617
|
+
FfiConverterArrayUInt8.write(value.scriptSig, into);
|
|
1618
|
+
FfiConverterUInt32.write(value.sequence, into);
|
|
1619
|
+
FfiConverterArrayArrayUInt8.write(value.witness, into);
|
|
1620
|
+
}
|
|
1621
|
+
allocationSize(value: TypeName): number {
|
|
1622
|
+
return (
|
|
1623
|
+
FfiConverterString.allocationSize(value.txid) +
|
|
1624
|
+
FfiConverterUInt32.allocationSize(value.vout) +
|
|
1625
|
+
FfiConverterArrayUInt8.allocationSize(value.scriptSig) +
|
|
1626
|
+
FfiConverterUInt32.allocationSize(value.sequence) +
|
|
1627
|
+
FfiConverterArrayArrayUInt8.allocationSize(value.witness)
|
|
1628
|
+
);
|
|
1629
|
+
}
|
|
1630
|
+
}
|
|
1631
|
+
return new FFIConverter();
|
|
1333
1632
|
})();
|
|
1334
1633
|
|
|
1335
|
-
|
|
1336
1634
|
export type TxInputInfo = {
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
}
|
|
1635
|
+
txid: string;
|
|
1636
|
+
vout: /*u32*/ number;
|
|
1637
|
+
scriptSig: Array</*u8*/ number>;
|
|
1638
|
+
maxWitnessLength: /*u32*/ number;
|
|
1639
|
+
serialId: /*u64*/ bigint;
|
|
1640
|
+
};
|
|
1343
1641
|
|
|
1344
1642
|
/**
|
|
1345
1643
|
* Generated factory for {@link TxInputInfo} record objects.
|
|
1346
1644
|
*/
|
|
1347
1645
|
export const TxInputInfo = (() => {
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1646
|
+
const defaults = () => ({});
|
|
1647
|
+
const create = (() => {
|
|
1648
|
+
return uniffiCreateRecord<TxInputInfo, ReturnType<typeof defaults>>(
|
|
1649
|
+
defaults
|
|
1650
|
+
);
|
|
1651
|
+
})();
|
|
1652
|
+
return Object.freeze({
|
|
1653
|
+
/**
|
|
1654
|
+
* Create a frozen instance of {@link TxInputInfo}, with defaults specified
|
|
1655
|
+
* in Rust, in the {@link ddk_ffi} crate.
|
|
1656
|
+
*/
|
|
1657
|
+
create,
|
|
1658
|
+
|
|
1659
|
+
/**
|
|
1660
|
+
* Create a frozen instance of {@link TxInputInfo}, with defaults specified
|
|
1661
|
+
* in Rust, in the {@link ddk_ffi} crate.
|
|
1662
|
+
*/
|
|
1663
|
+
new: create,
|
|
1664
|
+
|
|
1665
|
+
/**
|
|
1666
|
+
* Defaults specified in the {@link ddk_ffi} crate.
|
|
1667
|
+
*/
|
|
1668
|
+
defaults: () => Object.freeze(defaults()) as Partial<TxInputInfo>,
|
|
1669
|
+
});
|
|
1371
1670
|
})();
|
|
1372
1671
|
|
|
1373
1672
|
const FfiConverterTypeTxInputInfo = (() => {
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
}
|
|
1401
|
-
|
|
1673
|
+
type TypeName = TxInputInfo;
|
|
1674
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
1675
|
+
read(from: RustBuffer): TypeName {
|
|
1676
|
+
return {
|
|
1677
|
+
txid: FfiConverterString.read(from),
|
|
1678
|
+
vout: FfiConverterUInt32.read(from),
|
|
1679
|
+
scriptSig: FfiConverterArrayUInt8.read(from),
|
|
1680
|
+
maxWitnessLength: FfiConverterUInt32.read(from),
|
|
1681
|
+
serialId: FfiConverterUInt64.read(from),
|
|
1682
|
+
};
|
|
1683
|
+
}
|
|
1684
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
1685
|
+
FfiConverterString.write(value.txid, into);
|
|
1686
|
+
FfiConverterUInt32.write(value.vout, into);
|
|
1687
|
+
FfiConverterArrayUInt8.write(value.scriptSig, into);
|
|
1688
|
+
FfiConverterUInt32.write(value.maxWitnessLength, into);
|
|
1689
|
+
FfiConverterUInt64.write(value.serialId, into);
|
|
1690
|
+
}
|
|
1691
|
+
allocationSize(value: TypeName): number {
|
|
1692
|
+
return (
|
|
1693
|
+
FfiConverterString.allocationSize(value.txid) +
|
|
1694
|
+
FfiConverterUInt32.allocationSize(value.vout) +
|
|
1695
|
+
FfiConverterArrayUInt8.allocationSize(value.scriptSig) +
|
|
1696
|
+
FfiConverterUInt32.allocationSize(value.maxWitnessLength) +
|
|
1697
|
+
FfiConverterUInt64.allocationSize(value.serialId)
|
|
1698
|
+
);
|
|
1699
|
+
}
|
|
1700
|
+
}
|
|
1701
|
+
return new FFIConverter();
|
|
1402
1702
|
})();
|
|
1403
1703
|
|
|
1404
|
-
|
|
1405
1704
|
export type TxOutput = {
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
}
|
|
1705
|
+
value: /*u64*/ bigint;
|
|
1706
|
+
scriptPubkey: Array</*u8*/ number>;
|
|
1707
|
+
};
|
|
1409
1708
|
|
|
1410
1709
|
/**
|
|
1411
1710
|
* Generated factory for {@link TxOutput} record objects.
|
|
1412
1711
|
*/
|
|
1413
1712
|
export const TxOutput = (() => {
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
});
|
|
1713
|
+
const defaults = () => ({});
|
|
1714
|
+
const create = (() => {
|
|
1715
|
+
return uniffiCreateRecord<TxOutput, ReturnType<typeof defaults>>(defaults);
|
|
1716
|
+
})();
|
|
1717
|
+
return Object.freeze({
|
|
1718
|
+
/**
|
|
1719
|
+
* Create a frozen instance of {@link TxOutput}, with defaults specified
|
|
1720
|
+
* in Rust, in the {@link ddk_ffi} crate.
|
|
1721
|
+
*/
|
|
1722
|
+
create,
|
|
1723
|
+
|
|
1724
|
+
/**
|
|
1725
|
+
* Create a frozen instance of {@link TxOutput}, with defaults specified
|
|
1726
|
+
* in Rust, in the {@link ddk_ffi} crate.
|
|
1727
|
+
*/
|
|
1728
|
+
new: create,
|
|
1729
|
+
|
|
1730
|
+
/**
|
|
1731
|
+
* Defaults specified in the {@link ddk_ffi} crate.
|
|
1732
|
+
*/
|
|
1733
|
+
defaults: () => Object.freeze(defaults()) as Partial<TxOutput>,
|
|
1734
|
+
});
|
|
1437
1735
|
})();
|
|
1438
1736
|
|
|
1439
1737
|
const FfiConverterTypeTxOutput = (() => {
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
}
|
|
1458
|
-
|
|
1738
|
+
type TypeName = TxOutput;
|
|
1739
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
1740
|
+
read(from: RustBuffer): TypeName {
|
|
1741
|
+
return {
|
|
1742
|
+
value: FfiConverterUInt64.read(from),
|
|
1743
|
+
scriptPubkey: FfiConverterArrayUInt8.read(from),
|
|
1744
|
+
};
|
|
1745
|
+
}
|
|
1746
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
1747
|
+
FfiConverterUInt64.write(value.value, into);
|
|
1748
|
+
FfiConverterArrayUInt8.write(value.scriptPubkey, into);
|
|
1749
|
+
}
|
|
1750
|
+
allocationSize(value: TypeName): number {
|
|
1751
|
+
return (
|
|
1752
|
+
FfiConverterUInt64.allocationSize(value.value) +
|
|
1753
|
+
FfiConverterArrayUInt8.allocationSize(value.scriptPubkey)
|
|
1754
|
+
);
|
|
1755
|
+
}
|
|
1756
|
+
}
|
|
1757
|
+
return new FFIConverter();
|
|
1459
1758
|
})();
|
|
1460
1759
|
|
|
1461
|
-
|
|
1462
1760
|
const stringConverter = {
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1761
|
+
stringToBytes: (s: string) =>
|
|
1762
|
+
uniffiCaller.rustCall((status) =>
|
|
1763
|
+
nativeModule().ubrn_uniffi_internal_fn_func_ffi__string_to_arraybuffer(
|
|
1764
|
+
s,
|
|
1765
|
+
status
|
|
1766
|
+
)
|
|
1767
|
+
),
|
|
1768
|
+
bytesToString: (ab: UniffiByteArray) =>
|
|
1769
|
+
uniffiCaller.rustCall((status) =>
|
|
1770
|
+
nativeModule().ubrn_uniffi_internal_fn_func_ffi__arraybuffer_to_string(
|
|
1771
|
+
ab,
|
|
1772
|
+
status
|
|
1773
|
+
)
|
|
1774
|
+
),
|
|
1775
|
+
stringByteLength: (s: string) =>
|
|
1776
|
+
uniffiCaller.rustCall((status) =>
|
|
1777
|
+
nativeModule().ubrn_uniffi_internal_fn_func_ffi__string_to_byte_length(
|
|
1778
|
+
s,
|
|
1779
|
+
status
|
|
1780
|
+
)
|
|
1781
|
+
),
|
|
1469
1782
|
};
|
|
1470
1783
|
const FfiConverterString = uniffiCreateFfiConverterString(stringConverter);
|
|
1471
1784
|
|
|
1785
|
+
// Flat error type: DlcError
|
|
1786
|
+
export enum DlcError_Tags {
|
|
1787
|
+
InvalidSignature = 'InvalidSignature',
|
|
1788
|
+
InvalidPublicKey = 'InvalidPublicKey',
|
|
1789
|
+
InvalidTransaction = 'InvalidTransaction',
|
|
1790
|
+
InsufficientFunds = 'InsufficientFunds',
|
|
1791
|
+
InvalidArgument = 'InvalidArgument',
|
|
1792
|
+
SerializationError = 'SerializationError',
|
|
1793
|
+
Secp256k1Error = 'Secp256k1Error',
|
|
1794
|
+
MiniscriptError = 'MiniscriptError',
|
|
1795
|
+
InvalidNetwork = 'InvalidNetwork',
|
|
1796
|
+
KeyError = 'KeyError',
|
|
1797
|
+
}
|
|
1798
|
+
export const DlcError = (() => {
|
|
1799
|
+
class InvalidSignature extends UniffiError {
|
|
1800
|
+
/**
|
|
1801
|
+
* @private
|
|
1802
|
+
* This field is private and should not be used.
|
|
1803
|
+
*/
|
|
1804
|
+
readonly [uniffiTypeNameSymbol]: string = 'DlcError';
|
|
1805
|
+
/**
|
|
1806
|
+
* @private
|
|
1807
|
+
* This field is private and should not be used.
|
|
1808
|
+
*/
|
|
1809
|
+
readonly [variantOrdinalSymbol] = 1;
|
|
1472
1810
|
|
|
1811
|
+
public readonly tag = DlcError_Tags.InvalidSignature;
|
|
1473
1812
|
|
|
1813
|
+
constructor(message: string) {
|
|
1814
|
+
super('DlcError', 'InvalidSignature', message);
|
|
1815
|
+
}
|
|
1474
1816
|
|
|
1817
|
+
static instanceOf(e: any): e is InvalidSignature {
|
|
1818
|
+
return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 1;
|
|
1819
|
+
}
|
|
1820
|
+
}
|
|
1821
|
+
class InvalidPublicKey extends UniffiError {
|
|
1822
|
+
/**
|
|
1823
|
+
* @private
|
|
1824
|
+
* This field is private and should not be used.
|
|
1825
|
+
*/
|
|
1826
|
+
readonly [uniffiTypeNameSymbol]: string = 'DlcError';
|
|
1827
|
+
/**
|
|
1828
|
+
* @private
|
|
1829
|
+
* This field is private and should not be used.
|
|
1830
|
+
*/
|
|
1831
|
+
readonly [variantOrdinalSymbol] = 2;
|
|
1475
1832
|
|
|
1833
|
+
public readonly tag = DlcError_Tags.InvalidPublicKey;
|
|
1476
1834
|
|
|
1835
|
+
constructor(message: string) {
|
|
1836
|
+
super('DlcError', 'InvalidPublicKey', message);
|
|
1837
|
+
}
|
|
1477
1838
|
|
|
1839
|
+
static instanceOf(e: any): e is InvalidPublicKey {
|
|
1840
|
+
return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 2;
|
|
1841
|
+
}
|
|
1842
|
+
}
|
|
1843
|
+
class InvalidTransaction extends UniffiError {
|
|
1844
|
+
/**
|
|
1845
|
+
* @private
|
|
1846
|
+
* This field is private and should not be used.
|
|
1847
|
+
*/
|
|
1848
|
+
readonly [uniffiTypeNameSymbol]: string = 'DlcError';
|
|
1849
|
+
/**
|
|
1850
|
+
* @private
|
|
1851
|
+
* This field is private and should not be used.
|
|
1852
|
+
*/
|
|
1853
|
+
readonly [variantOrdinalSymbol] = 3;
|
|
1478
1854
|
|
|
1855
|
+
public readonly tag = DlcError_Tags.InvalidTransaction;
|
|
1479
1856
|
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
}
|
|
1661
|
-
}
|
|
1662
|
-
class MiniscriptError extends UniffiError {
|
|
1663
|
-
/**
|
|
1664
|
-
* @private
|
|
1665
|
-
* This field is private and should not be used.
|
|
1666
|
-
*/
|
|
1667
|
-
readonly [uniffiTypeNameSymbol]: string = "DlcError";
|
|
1668
|
-
/**
|
|
1669
|
-
* @private
|
|
1670
|
-
* This field is private and should not be used.
|
|
1671
|
-
*/
|
|
1672
|
-
readonly [variantOrdinalSymbol] = 8;
|
|
1673
|
-
|
|
1674
|
-
public readonly tag = DlcError_Tags.MiniscriptError;
|
|
1675
|
-
|
|
1676
|
-
constructor(message: string) {
|
|
1677
|
-
super("DlcError", "MiniscriptError", message);
|
|
1678
|
-
}
|
|
1679
|
-
|
|
1680
|
-
static instanceOf(e: any): e is MiniscriptError {
|
|
1681
|
-
return (
|
|
1682
|
-
instanceOf(e) && (e as any)[variantOrdinalSymbol] === 8
|
|
1683
|
-
);
|
|
1684
|
-
}
|
|
1685
|
-
}
|
|
1686
|
-
class InvalidNetwork extends UniffiError {
|
|
1687
|
-
/**
|
|
1688
|
-
* @private
|
|
1689
|
-
* This field is private and should not be used.
|
|
1690
|
-
*/
|
|
1691
|
-
readonly [uniffiTypeNameSymbol]: string = "DlcError";
|
|
1692
|
-
/**
|
|
1693
|
-
* @private
|
|
1694
|
-
* This field is private and should not be used.
|
|
1695
|
-
*/
|
|
1696
|
-
readonly [variantOrdinalSymbol] = 9;
|
|
1697
|
-
|
|
1698
|
-
public readonly tag = DlcError_Tags.InvalidNetwork;
|
|
1699
|
-
|
|
1700
|
-
constructor(message: string) {
|
|
1701
|
-
super("DlcError", "InvalidNetwork", message);
|
|
1702
|
-
}
|
|
1703
|
-
|
|
1704
|
-
static instanceOf(e: any): e is InvalidNetwork {
|
|
1705
|
-
return (
|
|
1706
|
-
instanceOf(e) && (e as any)[variantOrdinalSymbol] === 9
|
|
1707
|
-
);
|
|
1708
|
-
}
|
|
1709
|
-
}
|
|
1710
|
-
class KeyError extends UniffiError {
|
|
1711
|
-
/**
|
|
1712
|
-
* @private
|
|
1713
|
-
* This field is private and should not be used.
|
|
1714
|
-
*/
|
|
1715
|
-
readonly [uniffiTypeNameSymbol]: string = "DlcError";
|
|
1716
|
-
/**
|
|
1717
|
-
* @private
|
|
1718
|
-
* This field is private and should not be used.
|
|
1719
|
-
*/
|
|
1720
|
-
readonly [variantOrdinalSymbol] = 10;
|
|
1721
|
-
|
|
1722
|
-
public readonly tag = DlcError_Tags.KeyError;
|
|
1723
|
-
|
|
1724
|
-
constructor(message: string) {
|
|
1725
|
-
super("DlcError", "KeyError", message);
|
|
1726
|
-
}
|
|
1727
|
-
|
|
1728
|
-
static instanceOf(e: any): e is KeyError {
|
|
1729
|
-
return (
|
|
1730
|
-
instanceOf(e) && (e as any)[variantOrdinalSymbol] === 10
|
|
1731
|
-
);
|
|
1732
|
-
}
|
|
1733
|
-
}
|
|
1734
|
-
|
|
1735
|
-
// Utility function which does not rely on instanceof.
|
|
1736
|
-
function instanceOf(e: any): e is DlcError {
|
|
1737
|
-
return (e as any)[uniffiTypeNameSymbol] === "DlcError";
|
|
1738
|
-
}
|
|
1739
|
-
return {
|
|
1740
|
-
InvalidSignature,
|
|
1741
|
-
InvalidPublicKey,
|
|
1742
|
-
InvalidTransaction,
|
|
1743
|
-
InsufficientFunds,
|
|
1744
|
-
InvalidArgument,
|
|
1745
|
-
SerializationError,
|
|
1746
|
-
Secp256k1Error,
|
|
1747
|
-
MiniscriptError,
|
|
1748
|
-
InvalidNetwork,
|
|
1749
|
-
KeyError,
|
|
1750
|
-
instanceOf,
|
|
1751
|
-
};
|
|
1857
|
+
constructor(message: string) {
|
|
1858
|
+
super('DlcError', 'InvalidTransaction', message);
|
|
1859
|
+
}
|
|
1860
|
+
|
|
1861
|
+
static instanceOf(e: any): e is InvalidTransaction {
|
|
1862
|
+
return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 3;
|
|
1863
|
+
}
|
|
1864
|
+
}
|
|
1865
|
+
class InsufficientFunds extends UniffiError {
|
|
1866
|
+
/**
|
|
1867
|
+
* @private
|
|
1868
|
+
* This field is private and should not be used.
|
|
1869
|
+
*/
|
|
1870
|
+
readonly [uniffiTypeNameSymbol]: string = 'DlcError';
|
|
1871
|
+
/**
|
|
1872
|
+
* @private
|
|
1873
|
+
* This field is private and should not be used.
|
|
1874
|
+
*/
|
|
1875
|
+
readonly [variantOrdinalSymbol] = 4;
|
|
1876
|
+
|
|
1877
|
+
public readonly tag = DlcError_Tags.InsufficientFunds;
|
|
1878
|
+
|
|
1879
|
+
constructor(message: string) {
|
|
1880
|
+
super('DlcError', 'InsufficientFunds', message);
|
|
1881
|
+
}
|
|
1882
|
+
|
|
1883
|
+
static instanceOf(e: any): e is InsufficientFunds {
|
|
1884
|
+
return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 4;
|
|
1885
|
+
}
|
|
1886
|
+
}
|
|
1887
|
+
class InvalidArgument extends UniffiError {
|
|
1888
|
+
/**
|
|
1889
|
+
* @private
|
|
1890
|
+
* This field is private and should not be used.
|
|
1891
|
+
*/
|
|
1892
|
+
readonly [uniffiTypeNameSymbol]: string = 'DlcError';
|
|
1893
|
+
/**
|
|
1894
|
+
* @private
|
|
1895
|
+
* This field is private and should not be used.
|
|
1896
|
+
*/
|
|
1897
|
+
readonly [variantOrdinalSymbol] = 5;
|
|
1898
|
+
|
|
1899
|
+
public readonly tag = DlcError_Tags.InvalidArgument;
|
|
1900
|
+
|
|
1901
|
+
constructor(message: string) {
|
|
1902
|
+
super('DlcError', 'InvalidArgument', message);
|
|
1903
|
+
}
|
|
1904
|
+
|
|
1905
|
+
static instanceOf(e: any): e is InvalidArgument {
|
|
1906
|
+
return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 5;
|
|
1907
|
+
}
|
|
1908
|
+
}
|
|
1909
|
+
class SerializationError extends UniffiError {
|
|
1910
|
+
/**
|
|
1911
|
+
* @private
|
|
1912
|
+
* This field is private and should not be used.
|
|
1913
|
+
*/
|
|
1914
|
+
readonly [uniffiTypeNameSymbol]: string = 'DlcError';
|
|
1915
|
+
/**
|
|
1916
|
+
* @private
|
|
1917
|
+
* This field is private and should not be used.
|
|
1918
|
+
*/
|
|
1919
|
+
readonly [variantOrdinalSymbol] = 6;
|
|
1920
|
+
|
|
1921
|
+
public readonly tag = DlcError_Tags.SerializationError;
|
|
1922
|
+
|
|
1923
|
+
constructor(message: string) {
|
|
1924
|
+
super('DlcError', 'SerializationError', message);
|
|
1925
|
+
}
|
|
1926
|
+
|
|
1927
|
+
static instanceOf(e: any): e is SerializationError {
|
|
1928
|
+
return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 6;
|
|
1929
|
+
}
|
|
1930
|
+
}
|
|
1931
|
+
class Secp256k1Error extends UniffiError {
|
|
1932
|
+
/**
|
|
1933
|
+
* @private
|
|
1934
|
+
* This field is private and should not be used.
|
|
1935
|
+
*/
|
|
1936
|
+
readonly [uniffiTypeNameSymbol]: string = 'DlcError';
|
|
1937
|
+
/**
|
|
1938
|
+
* @private
|
|
1939
|
+
* This field is private and should not be used.
|
|
1940
|
+
*/
|
|
1941
|
+
readonly [variantOrdinalSymbol] = 7;
|
|
1942
|
+
|
|
1943
|
+
public readonly tag = DlcError_Tags.Secp256k1Error;
|
|
1944
|
+
|
|
1945
|
+
constructor(message: string) {
|
|
1946
|
+
super('DlcError', 'Secp256k1Error', message);
|
|
1947
|
+
}
|
|
1948
|
+
|
|
1949
|
+
static instanceOf(e: any): e is Secp256k1Error {
|
|
1950
|
+
return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 7;
|
|
1951
|
+
}
|
|
1952
|
+
}
|
|
1953
|
+
class MiniscriptError extends UniffiError {
|
|
1954
|
+
/**
|
|
1955
|
+
* @private
|
|
1956
|
+
* This field is private and should not be used.
|
|
1957
|
+
*/
|
|
1958
|
+
readonly [uniffiTypeNameSymbol]: string = 'DlcError';
|
|
1959
|
+
/**
|
|
1960
|
+
* @private
|
|
1961
|
+
* This field is private and should not be used.
|
|
1962
|
+
*/
|
|
1963
|
+
readonly [variantOrdinalSymbol] = 8;
|
|
1964
|
+
|
|
1965
|
+
public readonly tag = DlcError_Tags.MiniscriptError;
|
|
1966
|
+
|
|
1967
|
+
constructor(message: string) {
|
|
1968
|
+
super('DlcError', 'MiniscriptError', message);
|
|
1969
|
+
}
|
|
1970
|
+
|
|
1971
|
+
static instanceOf(e: any): e is MiniscriptError {
|
|
1972
|
+
return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 8;
|
|
1973
|
+
}
|
|
1974
|
+
}
|
|
1975
|
+
class InvalidNetwork extends UniffiError {
|
|
1976
|
+
/**
|
|
1977
|
+
* @private
|
|
1978
|
+
* This field is private and should not be used.
|
|
1979
|
+
*/
|
|
1980
|
+
readonly [uniffiTypeNameSymbol]: string = 'DlcError';
|
|
1981
|
+
/**
|
|
1982
|
+
* @private
|
|
1983
|
+
* This field is private and should not be used.
|
|
1984
|
+
*/
|
|
1985
|
+
readonly [variantOrdinalSymbol] = 9;
|
|
1986
|
+
|
|
1987
|
+
public readonly tag = DlcError_Tags.InvalidNetwork;
|
|
1988
|
+
|
|
1989
|
+
constructor(message: string) {
|
|
1990
|
+
super('DlcError', 'InvalidNetwork', message);
|
|
1991
|
+
}
|
|
1992
|
+
|
|
1993
|
+
static instanceOf(e: any): e is InvalidNetwork {
|
|
1994
|
+
return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 9;
|
|
1995
|
+
}
|
|
1996
|
+
}
|
|
1997
|
+
class KeyError extends UniffiError {
|
|
1998
|
+
/**
|
|
1999
|
+
* @private
|
|
2000
|
+
* This field is private and should not be used.
|
|
2001
|
+
*/
|
|
2002
|
+
readonly [uniffiTypeNameSymbol]: string = 'DlcError';
|
|
2003
|
+
/**
|
|
2004
|
+
* @private
|
|
2005
|
+
* This field is private and should not be used.
|
|
2006
|
+
*/
|
|
2007
|
+
readonly [variantOrdinalSymbol] = 10;
|
|
2008
|
+
|
|
2009
|
+
public readonly tag = DlcError_Tags.KeyError;
|
|
2010
|
+
|
|
2011
|
+
constructor(message: string) {
|
|
2012
|
+
super('DlcError', 'KeyError', message);
|
|
2013
|
+
}
|
|
2014
|
+
|
|
2015
|
+
static instanceOf(e: any): e is KeyError {
|
|
2016
|
+
return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 10;
|
|
2017
|
+
}
|
|
2018
|
+
}
|
|
2019
|
+
|
|
2020
|
+
// Utility function which does not rely on instanceof.
|
|
2021
|
+
function instanceOf(e: any): e is DlcError {
|
|
2022
|
+
return (e as any)[uniffiTypeNameSymbol] === 'DlcError';
|
|
2023
|
+
}
|
|
2024
|
+
return {
|
|
2025
|
+
InvalidSignature,
|
|
2026
|
+
InvalidPublicKey,
|
|
2027
|
+
InvalidTransaction,
|
|
2028
|
+
InsufficientFunds,
|
|
2029
|
+
InvalidArgument,
|
|
2030
|
+
SerializationError,
|
|
2031
|
+
Secp256k1Error,
|
|
2032
|
+
MiniscriptError,
|
|
2033
|
+
InvalidNetwork,
|
|
2034
|
+
KeyError,
|
|
2035
|
+
instanceOf,
|
|
2036
|
+
};
|
|
1752
2037
|
})();
|
|
1753
2038
|
|
|
1754
2039
|
// Union type for DlcError error type.
|
|
1755
2040
|
|
|
1756
|
-
|
|
1757
2041
|
export type DlcError = InstanceType<
|
|
1758
|
-
|
|
2042
|
+
(typeof DlcError)[keyof Omit<typeof DlcError, 'instanceOf'>]
|
|
1759
2043
|
>;
|
|
1760
2044
|
|
|
1761
2045
|
const FfiConverterTypeDLCError = (() => {
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
case 4: return new DlcError.InsufficientFunds(FfiConverterString.read(from)
|
|
1777
|
-
);
|
|
1778
|
-
|
|
1779
|
-
case 5: return new DlcError.InvalidArgument(FfiConverterString.read(from)
|
|
1780
|
-
);
|
|
1781
|
-
|
|
1782
|
-
case 6: return new DlcError.SerializationError(FfiConverterString.read(from)
|
|
1783
|
-
);
|
|
1784
|
-
|
|
1785
|
-
case 7: return new DlcError.Secp256k1Error(FfiConverterString.read(from)
|
|
1786
|
-
);
|
|
1787
|
-
|
|
1788
|
-
case 8: return new DlcError.MiniscriptError(FfiConverterString.read(from)
|
|
1789
|
-
);
|
|
1790
|
-
|
|
1791
|
-
case 9: return new DlcError.InvalidNetwork(FfiConverterString.read(from)
|
|
1792
|
-
);
|
|
1793
|
-
|
|
1794
|
-
case 10: return new DlcError.KeyError(FfiConverterString.read(from)
|
|
1795
|
-
);
|
|
1796
|
-
|
|
1797
|
-
default: throw new UniffiInternalError.UnexpectedEnumCase();
|
|
1798
|
-
}
|
|
1799
|
-
}
|
|
1800
|
-
write(value: TypeName, into: RustBuffer): void {
|
|
1801
|
-
const obj = value as any;
|
|
1802
|
-
const index = obj[variantOrdinalSymbol] as number;
|
|
1803
|
-
intConverter.write(index, into);
|
|
1804
|
-
}
|
|
1805
|
-
allocationSize(value: TypeName): number {
|
|
1806
|
-
return intConverter.allocationSize(0);
|
|
1807
|
-
}
|
|
1808
|
-
}
|
|
1809
|
-
return new FfiConverter();
|
|
1810
|
-
})();
|
|
2046
|
+
const intConverter = FfiConverterInt32;
|
|
2047
|
+
type TypeName = DlcError;
|
|
2048
|
+
class FfiConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
2049
|
+
read(from: RustBuffer): TypeName {
|
|
2050
|
+
switch (intConverter.read(from)) {
|
|
2051
|
+
case 1:
|
|
2052
|
+
return new DlcError.InvalidSignature(FfiConverterString.read(from));
|
|
2053
|
+
|
|
2054
|
+
case 2:
|
|
2055
|
+
return new DlcError.InvalidPublicKey(FfiConverterString.read(from));
|
|
2056
|
+
|
|
2057
|
+
case 3:
|
|
2058
|
+
return new DlcError.InvalidTransaction(FfiConverterString.read(from));
|
|
1811
2059
|
|
|
2060
|
+
case 4:
|
|
2061
|
+
return new DlcError.InsufficientFunds(FfiConverterString.read(from));
|
|
1812
2062
|
|
|
2063
|
+
case 5:
|
|
2064
|
+
return new DlcError.InvalidArgument(FfiConverterString.read(from));
|
|
2065
|
+
|
|
2066
|
+
case 6:
|
|
2067
|
+
return new DlcError.SerializationError(FfiConverterString.read(from));
|
|
2068
|
+
|
|
2069
|
+
case 7:
|
|
2070
|
+
return new DlcError.Secp256k1Error(FfiConverterString.read(from));
|
|
2071
|
+
|
|
2072
|
+
case 8:
|
|
2073
|
+
return new DlcError.MiniscriptError(FfiConverterString.read(from));
|
|
2074
|
+
|
|
2075
|
+
case 9:
|
|
2076
|
+
return new DlcError.InvalidNetwork(FfiConverterString.read(from));
|
|
2077
|
+
|
|
2078
|
+
case 10:
|
|
2079
|
+
return new DlcError.KeyError(FfiConverterString.read(from));
|
|
2080
|
+
|
|
2081
|
+
default:
|
|
2082
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
2083
|
+
}
|
|
2084
|
+
}
|
|
2085
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
2086
|
+
const obj = value as any;
|
|
2087
|
+
const index = obj[variantOrdinalSymbol] as number;
|
|
2088
|
+
intConverter.write(index, into);
|
|
2089
|
+
}
|
|
2090
|
+
allocationSize(value: TypeName): number {
|
|
2091
|
+
return intConverter.allocationSize(0);
|
|
2092
|
+
}
|
|
2093
|
+
}
|
|
2094
|
+
return new FfiConverter();
|
|
2095
|
+
})();
|
|
1813
2096
|
|
|
1814
2097
|
// Flat error type: ExtendedKey
|
|
1815
2098
|
export enum ExtendedKey_Tags {
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
2099
|
+
InvalidMnemonic = 'InvalidMnemonic',
|
|
2100
|
+
InvalidXpriv = 'InvalidXpriv',
|
|
2101
|
+
InvalidXpub = 'InvalidXpub',
|
|
2102
|
+
InvalidDerivationPath = 'InvalidDerivationPath',
|
|
1820
2103
|
}
|
|
1821
2104
|
export const ExtendedKey = (() => {
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
}
|
|
1923
|
-
return {
|
|
1924
|
-
InvalidMnemonic,
|
|
1925
|
-
InvalidXpriv,
|
|
1926
|
-
InvalidXpub,
|
|
1927
|
-
InvalidDerivationPath,
|
|
1928
|
-
instanceOf,
|
|
1929
|
-
};
|
|
2105
|
+
class InvalidMnemonic extends UniffiError {
|
|
2106
|
+
/**
|
|
2107
|
+
* @private
|
|
2108
|
+
* This field is private and should not be used.
|
|
2109
|
+
*/
|
|
2110
|
+
readonly [uniffiTypeNameSymbol]: string = 'ExtendedKey';
|
|
2111
|
+
/**
|
|
2112
|
+
* @private
|
|
2113
|
+
* This field is private and should not be used.
|
|
2114
|
+
*/
|
|
2115
|
+
readonly [variantOrdinalSymbol] = 1;
|
|
2116
|
+
|
|
2117
|
+
public readonly tag = ExtendedKey_Tags.InvalidMnemonic;
|
|
2118
|
+
|
|
2119
|
+
constructor(message: string) {
|
|
2120
|
+
super('ExtendedKey', 'InvalidMnemonic', message);
|
|
2121
|
+
}
|
|
2122
|
+
|
|
2123
|
+
static instanceOf(e: any): e is InvalidMnemonic {
|
|
2124
|
+
return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 1;
|
|
2125
|
+
}
|
|
2126
|
+
}
|
|
2127
|
+
class InvalidXpriv extends UniffiError {
|
|
2128
|
+
/**
|
|
2129
|
+
* @private
|
|
2130
|
+
* This field is private and should not be used.
|
|
2131
|
+
*/
|
|
2132
|
+
readonly [uniffiTypeNameSymbol]: string = 'ExtendedKey';
|
|
2133
|
+
/**
|
|
2134
|
+
* @private
|
|
2135
|
+
* This field is private and should not be used.
|
|
2136
|
+
*/
|
|
2137
|
+
readonly [variantOrdinalSymbol] = 2;
|
|
2138
|
+
|
|
2139
|
+
public readonly tag = ExtendedKey_Tags.InvalidXpriv;
|
|
2140
|
+
|
|
2141
|
+
constructor(message: string) {
|
|
2142
|
+
super('ExtendedKey', 'InvalidXpriv', message);
|
|
2143
|
+
}
|
|
2144
|
+
|
|
2145
|
+
static instanceOf(e: any): e is InvalidXpriv {
|
|
2146
|
+
return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 2;
|
|
2147
|
+
}
|
|
2148
|
+
}
|
|
2149
|
+
class InvalidXpub extends UniffiError {
|
|
2150
|
+
/**
|
|
2151
|
+
* @private
|
|
2152
|
+
* This field is private and should not be used.
|
|
2153
|
+
*/
|
|
2154
|
+
readonly [uniffiTypeNameSymbol]: string = 'ExtendedKey';
|
|
2155
|
+
/**
|
|
2156
|
+
* @private
|
|
2157
|
+
* This field is private and should not be used.
|
|
2158
|
+
*/
|
|
2159
|
+
readonly [variantOrdinalSymbol] = 3;
|
|
2160
|
+
|
|
2161
|
+
public readonly tag = ExtendedKey_Tags.InvalidXpub;
|
|
2162
|
+
|
|
2163
|
+
constructor(message: string) {
|
|
2164
|
+
super('ExtendedKey', 'InvalidXpub', message);
|
|
2165
|
+
}
|
|
2166
|
+
|
|
2167
|
+
static instanceOf(e: any): e is InvalidXpub {
|
|
2168
|
+
return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 3;
|
|
2169
|
+
}
|
|
2170
|
+
}
|
|
2171
|
+
class InvalidDerivationPath extends UniffiError {
|
|
2172
|
+
/**
|
|
2173
|
+
* @private
|
|
2174
|
+
* This field is private and should not be used.
|
|
2175
|
+
*/
|
|
2176
|
+
readonly [uniffiTypeNameSymbol]: string = 'ExtendedKey';
|
|
2177
|
+
/**
|
|
2178
|
+
* @private
|
|
2179
|
+
* This field is private and should not be used.
|
|
2180
|
+
*/
|
|
2181
|
+
readonly [variantOrdinalSymbol] = 4;
|
|
2182
|
+
|
|
2183
|
+
public readonly tag = ExtendedKey_Tags.InvalidDerivationPath;
|
|
2184
|
+
|
|
2185
|
+
constructor(message: string) {
|
|
2186
|
+
super('ExtendedKey', 'InvalidDerivationPath', message);
|
|
2187
|
+
}
|
|
2188
|
+
|
|
2189
|
+
static instanceOf(e: any): e is InvalidDerivationPath {
|
|
2190
|
+
return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 4;
|
|
2191
|
+
}
|
|
2192
|
+
}
|
|
2193
|
+
|
|
2194
|
+
// Utility function which does not rely on instanceof.
|
|
2195
|
+
function instanceOf(e: any): e is ExtendedKey {
|
|
2196
|
+
return (e as any)[uniffiTypeNameSymbol] === 'ExtendedKey';
|
|
2197
|
+
}
|
|
2198
|
+
return {
|
|
2199
|
+
InvalidMnemonic,
|
|
2200
|
+
InvalidXpriv,
|
|
2201
|
+
InvalidXpub,
|
|
2202
|
+
InvalidDerivationPath,
|
|
2203
|
+
instanceOf,
|
|
2204
|
+
};
|
|
1930
2205
|
})();
|
|
1931
2206
|
|
|
1932
2207
|
// Union type for ExtendedKey error type.
|
|
1933
2208
|
|
|
1934
|
-
|
|
1935
2209
|
export type ExtendedKey = InstanceType<
|
|
1936
|
-
|
|
2210
|
+
(typeof ExtendedKey)[keyof Omit<typeof ExtendedKey, 'instanceOf'>]
|
|
1937
2211
|
>;
|
|
1938
2212
|
|
|
1939
2213
|
const FfiConverterTypeExtendedKey = (() => {
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
case 4: return new ExtendedKey.InvalidDerivationPath(FfiConverterString.read(from)
|
|
1955
|
-
);
|
|
1956
|
-
|
|
1957
|
-
default: throw new UniffiInternalError.UnexpectedEnumCase();
|
|
1958
|
-
}
|
|
1959
|
-
}
|
|
1960
|
-
write(value: TypeName, into: RustBuffer): void {
|
|
1961
|
-
const obj = value as any;
|
|
1962
|
-
const index = obj[variantOrdinalSymbol] as number;
|
|
1963
|
-
intConverter.write(index, into);
|
|
1964
|
-
}
|
|
1965
|
-
allocationSize(value: TypeName): number {
|
|
1966
|
-
return intConverter.allocationSize(0);
|
|
1967
|
-
}
|
|
1968
|
-
}
|
|
1969
|
-
return new FfiConverter();
|
|
1970
|
-
})();
|
|
2214
|
+
const intConverter = FfiConverterInt32;
|
|
2215
|
+
type TypeName = ExtendedKey;
|
|
2216
|
+
class FfiConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
2217
|
+
read(from: RustBuffer): TypeName {
|
|
2218
|
+
switch (intConverter.read(from)) {
|
|
2219
|
+
case 1:
|
|
2220
|
+
return new ExtendedKey.InvalidMnemonic(FfiConverterString.read(from));
|
|
2221
|
+
|
|
2222
|
+
case 2:
|
|
2223
|
+
return new ExtendedKey.InvalidXpriv(FfiConverterString.read(from));
|
|
2224
|
+
|
|
2225
|
+
case 3:
|
|
2226
|
+
return new ExtendedKey.InvalidXpub(FfiConverterString.read(from));
|
|
1971
2227
|
|
|
2228
|
+
case 4:
|
|
2229
|
+
return new ExtendedKey.InvalidDerivationPath(
|
|
2230
|
+
FfiConverterString.read(from)
|
|
2231
|
+
);
|
|
2232
|
+
|
|
2233
|
+
default:
|
|
2234
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
2235
|
+
}
|
|
2236
|
+
}
|
|
2237
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
2238
|
+
const obj = value as any;
|
|
2239
|
+
const index = obj[variantOrdinalSymbol] as number;
|
|
2240
|
+
intConverter.write(index, into);
|
|
2241
|
+
}
|
|
2242
|
+
allocationSize(value: TypeName): number {
|
|
2243
|
+
return intConverter.allocationSize(0);
|
|
2244
|
+
}
|
|
2245
|
+
}
|
|
2246
|
+
return new FfiConverter();
|
|
2247
|
+
})();
|
|
1972
2248
|
|
|
1973
2249
|
// FfiConverter for string | undefined
|
|
1974
2250
|
const FfiConverterOptionalString = new FfiConverterOptional(FfiConverterString);
|
|
1975
2251
|
|
|
1976
|
-
|
|
1977
2252
|
// FfiConverter for Array<AdaptorSignature>
|
|
1978
|
-
const FfiConverterArrayTypeAdaptorSignature = new FfiConverterArray(
|
|
1979
|
-
|
|
2253
|
+
const FfiConverterArrayTypeAdaptorSignature = new FfiConverterArray(
|
|
2254
|
+
FfiConverterTypeAdaptorSignature
|
|
2255
|
+
);
|
|
1980
2256
|
|
|
1981
2257
|
// FfiConverter for Array<DlcInputInfo>
|
|
1982
|
-
const FfiConverterArrayTypeDlcInputInfo = new FfiConverterArray(
|
|
1983
|
-
|
|
2258
|
+
const FfiConverterArrayTypeDlcInputInfo = new FfiConverterArray(
|
|
2259
|
+
FfiConverterTypeDlcInputInfo
|
|
2260
|
+
);
|
|
1984
2261
|
|
|
1985
2262
|
// FfiConverter for Array<OracleInfo>
|
|
1986
|
-
const FfiConverterArrayTypeOracleInfo = new FfiConverterArray(
|
|
1987
|
-
|
|
2263
|
+
const FfiConverterArrayTypeOracleInfo = new FfiConverterArray(
|
|
2264
|
+
FfiConverterTypeOracleInfo
|
|
2265
|
+
);
|
|
1988
2266
|
|
|
1989
2267
|
// FfiConverter for Array<Payout>
|
|
1990
|
-
const FfiConverterArrayTypePayout = new FfiConverterArray(
|
|
1991
|
-
|
|
2268
|
+
const FfiConverterArrayTypePayout = new FfiConverterArray(
|
|
2269
|
+
FfiConverterTypePayout
|
|
2270
|
+
);
|
|
1992
2271
|
|
|
1993
2272
|
// FfiConverter for Array<Transaction>
|
|
1994
|
-
const FfiConverterArrayTypeTransaction = new FfiConverterArray(
|
|
1995
|
-
|
|
2273
|
+
const FfiConverterArrayTypeTransaction = new FfiConverterArray(
|
|
2274
|
+
FfiConverterTypeTransaction
|
|
2275
|
+
);
|
|
1996
2276
|
|
|
1997
2277
|
// FfiConverter for Array<TxInput>
|
|
1998
|
-
const FfiConverterArrayTypeTxInput = new FfiConverterArray(
|
|
1999
|
-
|
|
2278
|
+
const FfiConverterArrayTypeTxInput = new FfiConverterArray(
|
|
2279
|
+
FfiConverterTypeTxInput
|
|
2280
|
+
);
|
|
2000
2281
|
|
|
2001
2282
|
// FfiConverter for Array<TxInputInfo>
|
|
2002
|
-
const FfiConverterArrayTypeTxInputInfo = new FfiConverterArray(
|
|
2003
|
-
|
|
2283
|
+
const FfiConverterArrayTypeTxInputInfo = new FfiConverterArray(
|
|
2284
|
+
FfiConverterTypeTxInputInfo
|
|
2285
|
+
);
|
|
2004
2286
|
|
|
2005
2287
|
// FfiConverter for Array<TxOutput>
|
|
2006
|
-
const FfiConverterArrayTypeTxOutput = new FfiConverterArray(
|
|
2007
|
-
|
|
2288
|
+
const FfiConverterArrayTypeTxOutput = new FfiConverterArray(
|
|
2289
|
+
FfiConverterTypeTxOutput
|
|
2290
|
+
);
|
|
2008
2291
|
|
|
2009
2292
|
// FfiConverter for Array</*u8*/number>
|
|
2010
2293
|
const FfiConverterArrayUInt8 = new FfiConverterArray(FfiConverterUInt8);
|
|
2011
2294
|
|
|
2012
|
-
|
|
2013
2295
|
// FfiConverter for Array<Array</*u8*/number>>
|
|
2014
|
-
const FfiConverterArrayArrayUInt8 = new FfiConverterArray(
|
|
2015
|
-
|
|
2296
|
+
const FfiConverterArrayArrayUInt8 = new FfiConverterArray(
|
|
2297
|
+
FfiConverterArrayUInt8
|
|
2298
|
+
);
|
|
2016
2299
|
|
|
2017
2300
|
// FfiConverter for Array<Array<Array</*u8*/number>>>
|
|
2018
|
-
const FfiConverterArrayArrayArrayUInt8 = new FfiConverterArray(
|
|
2019
|
-
|
|
2301
|
+
const FfiConverterArrayArrayArrayUInt8 = new FfiConverterArray(
|
|
2302
|
+
FfiConverterArrayArrayUInt8
|
|
2303
|
+
);
|
|
2020
2304
|
|
|
2021
2305
|
// FfiConverter for Array<Array<Array<Array</*u8*/number>>>>
|
|
2022
|
-
const FfiConverterArrayArrayArrayArrayUInt8 = new FfiConverterArray(
|
|
2306
|
+
const FfiConverterArrayArrayArrayArrayUInt8 = new FfiConverterArray(
|
|
2307
|
+
FfiConverterArrayArrayArrayUInt8
|
|
2308
|
+
);
|
|
2023
2309
|
|
|
2024
2310
|
/**
|
|
2025
2311
|
* This should be called before anything else.
|
|
@@ -2032,108 +2318,254 @@ const FfiConverterArrayArrayArrayArrayUInt8 = new FfiConverterArray(FfiConverter
|
|
|
2032
2318
|
* It also initializes the machinery to enable Rust to talk back to Javascript.
|
|
2033
2319
|
*/
|
|
2034
2320
|
function uniffiEnsureInitialized() {
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2321
|
+
// Get the bindings contract version from our ComponentInterface
|
|
2322
|
+
const bindingsContractVersion = 29;
|
|
2323
|
+
// Get the scaffolding contract version by calling the into the dylib
|
|
2324
|
+
const scaffoldingContractVersion =
|
|
2325
|
+
nativeModule().ubrn_ffi_ddk_ffi_uniffi_contract_version();
|
|
2326
|
+
if (bindingsContractVersion !== scaffoldingContractVersion) {
|
|
2327
|
+
throw new UniffiInternalError.ContractVersionMismatch(
|
|
2328
|
+
scaffoldingContractVersion,
|
|
2329
|
+
bindingsContractVersion
|
|
2330
|
+
);
|
|
2331
|
+
}
|
|
2332
|
+
if (
|
|
2333
|
+
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_add_signature_to_transaction() !==
|
|
2334
|
+
1337
|
|
2335
|
+
) {
|
|
2336
|
+
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2337
|
+
'uniffi_ddk_ffi_checksum_func_add_signature_to_transaction'
|
|
2338
|
+
);
|
|
2339
|
+
}
|
|
2340
|
+
if (
|
|
2341
|
+
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_convert_mnemonic_to_seed() !==
|
|
2342
|
+
65049
|
|
2343
|
+
) {
|
|
2344
|
+
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2345
|
+
'uniffi_ddk_ffi_checksum_func_convert_mnemonic_to_seed'
|
|
2346
|
+
);
|
|
2347
|
+
}
|
|
2348
|
+
if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_cet() !== 23081) {
|
|
2349
|
+
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2350
|
+
'uniffi_ddk_ffi_checksum_func_create_cet'
|
|
2351
|
+
);
|
|
2352
|
+
}
|
|
2353
|
+
if (
|
|
2354
|
+
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_cet_adaptor_points_from_oracle_info() !==
|
|
2355
|
+
6552
|
|
2356
|
+
) {
|
|
2357
|
+
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2358
|
+
'uniffi_ddk_ffi_checksum_func_create_cet_adaptor_points_from_oracle_info'
|
|
2359
|
+
);
|
|
2360
|
+
}
|
|
2361
|
+
if (
|
|
2362
|
+
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_cet_adaptor_signature_from_oracle_info() !==
|
|
2363
|
+
65174
|
|
2364
|
+
) {
|
|
2365
|
+
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2366
|
+
'uniffi_ddk_ffi_checksum_func_create_cet_adaptor_signature_from_oracle_info'
|
|
2367
|
+
);
|
|
2368
|
+
}
|
|
2369
|
+
if (
|
|
2370
|
+
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_cet_adaptor_sigs_from_oracle_info() !==
|
|
2371
|
+
15699
|
|
2372
|
+
) {
|
|
2373
|
+
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2374
|
+
'uniffi_ddk_ffi_checksum_func_create_cet_adaptor_sigs_from_oracle_info'
|
|
2375
|
+
);
|
|
2376
|
+
}
|
|
2377
|
+
if (
|
|
2378
|
+
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_cet_adaptor_sigs_from_points() !==
|
|
2379
|
+
33705
|
|
2380
|
+
) {
|
|
2381
|
+
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2382
|
+
'uniffi_ddk_ffi_checksum_func_create_cet_adaptor_sigs_from_points'
|
|
2383
|
+
);
|
|
2384
|
+
}
|
|
2385
|
+
if (
|
|
2386
|
+
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_cets() !== 50529
|
|
2387
|
+
) {
|
|
2388
|
+
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2389
|
+
'uniffi_ddk_ffi_checksum_func_create_cets'
|
|
2390
|
+
);
|
|
2391
|
+
}
|
|
2392
|
+
if (
|
|
2393
|
+
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_dlc_transactions() !==
|
|
2394
|
+
51134
|
|
2395
|
+
) {
|
|
2396
|
+
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2397
|
+
'uniffi_ddk_ffi_checksum_func_create_dlc_transactions'
|
|
2398
|
+
);
|
|
2399
|
+
}
|
|
2400
|
+
if (
|
|
2401
|
+
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_extkey_from_parent_path() !==
|
|
2402
|
+
26671
|
|
2403
|
+
) {
|
|
2404
|
+
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2405
|
+
'uniffi_ddk_ffi_checksum_func_create_extkey_from_parent_path'
|
|
2406
|
+
);
|
|
2407
|
+
}
|
|
2408
|
+
if (
|
|
2409
|
+
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_extkey_from_seed() !==
|
|
2410
|
+
12526
|
|
2411
|
+
) {
|
|
2412
|
+
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2413
|
+
'uniffi_ddk_ffi_checksum_func_create_extkey_from_seed'
|
|
2414
|
+
);
|
|
2415
|
+
}
|
|
2416
|
+
if (
|
|
2417
|
+
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_fund_tx_locking_script() !==
|
|
2418
|
+
2761
|
|
2419
|
+
) {
|
|
2420
|
+
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2421
|
+
'uniffi_ddk_ffi_checksum_func_create_fund_tx_locking_script'
|
|
2422
|
+
);
|
|
2423
|
+
}
|
|
2424
|
+
if (
|
|
2425
|
+
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_refund_transaction() !==
|
|
2426
|
+
57261
|
|
2427
|
+
) {
|
|
2428
|
+
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2429
|
+
'uniffi_ddk_ffi_checksum_func_create_refund_transaction'
|
|
2430
|
+
);
|
|
2431
|
+
}
|
|
2432
|
+
if (
|
|
2433
|
+
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_spliced_dlc_transactions() !==
|
|
2434
|
+
31130
|
|
2435
|
+
) {
|
|
2436
|
+
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2437
|
+
'uniffi_ddk_ffi_checksum_func_create_spliced_dlc_transactions'
|
|
2438
|
+
);
|
|
2439
|
+
}
|
|
2440
|
+
if (
|
|
2441
|
+
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_xpriv_from_parent_path() !==
|
|
2442
|
+
34808
|
|
2443
|
+
) {
|
|
2444
|
+
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2445
|
+
'uniffi_ddk_ffi_checksum_func_create_xpriv_from_parent_path'
|
|
2446
|
+
);
|
|
2447
|
+
}
|
|
2448
|
+
if (
|
|
2449
|
+
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_extract_ecdsa_signature_from_oracle_signatures() !==
|
|
2450
|
+
8006
|
|
2451
|
+
) {
|
|
2452
|
+
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2453
|
+
'uniffi_ddk_ffi_checksum_func_extract_ecdsa_signature_from_oracle_signatures'
|
|
2454
|
+
);
|
|
2455
|
+
}
|
|
2456
|
+
if (
|
|
2457
|
+
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_get_cet_adaptor_signature_inputs() !==
|
|
2458
|
+
14595
|
|
2459
|
+
) {
|
|
2460
|
+
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2461
|
+
'uniffi_ddk_ffi_checksum_func_get_cet_adaptor_signature_inputs'
|
|
2462
|
+
);
|
|
2463
|
+
}
|
|
2464
|
+
if (
|
|
2465
|
+
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_get_cet_sighash() !== 10643
|
|
2466
|
+
) {
|
|
2467
|
+
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2468
|
+
'uniffi_ddk_ffi_checksum_func_get_cet_sighash'
|
|
2469
|
+
);
|
|
2470
|
+
}
|
|
2471
|
+
if (
|
|
2472
|
+
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_get_change_output_and_fees() !==
|
|
2473
|
+
44150
|
|
2474
|
+
) {
|
|
2475
|
+
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2476
|
+
'uniffi_ddk_ffi_checksum_func_get_change_output_and_fees'
|
|
2477
|
+
);
|
|
2478
|
+
}
|
|
2479
|
+
if (
|
|
2480
|
+
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_get_pubkey_from_extkey() !==
|
|
2481
|
+
64637
|
|
2482
|
+
) {
|
|
2483
|
+
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2484
|
+
'uniffi_ddk_ffi_checksum_func_get_pubkey_from_extkey'
|
|
2485
|
+
);
|
|
2486
|
+
}
|
|
2487
|
+
if (
|
|
2488
|
+
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_get_raw_funding_transaction_input_signature() !==
|
|
2489
|
+
35708
|
|
2490
|
+
) {
|
|
2491
|
+
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2492
|
+
'uniffi_ddk_ffi_checksum_func_get_raw_funding_transaction_input_signature'
|
|
2493
|
+
);
|
|
2494
|
+
}
|
|
2495
|
+
if (
|
|
2496
|
+
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_get_total_input_vsize() !==
|
|
2497
|
+
38213
|
|
2498
|
+
) {
|
|
2499
|
+
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2500
|
+
'uniffi_ddk_ffi_checksum_func_get_total_input_vsize'
|
|
2501
|
+
);
|
|
2502
|
+
}
|
|
2503
|
+
if (
|
|
2504
|
+
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_get_xpub_from_xpriv() !==
|
|
2505
|
+
44344
|
|
2506
|
+
) {
|
|
2507
|
+
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2508
|
+
'uniffi_ddk_ffi_checksum_func_get_xpub_from_xpriv'
|
|
2509
|
+
);
|
|
2510
|
+
}
|
|
2511
|
+
if (
|
|
2512
|
+
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_is_dust_output() !== 64174
|
|
2513
|
+
) {
|
|
2514
|
+
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2515
|
+
'uniffi_ddk_ffi_checksum_func_is_dust_output'
|
|
2516
|
+
);
|
|
2517
|
+
}
|
|
2518
|
+
if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_sign_cet() !== 43957) {
|
|
2519
|
+
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2520
|
+
'uniffi_ddk_ffi_checksum_func_sign_cet'
|
|
2521
|
+
);
|
|
2522
|
+
}
|
|
2523
|
+
if (
|
|
2524
|
+
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_sign_fund_transaction_input() !==
|
|
2525
|
+
50531
|
|
2526
|
+
) {
|
|
2527
|
+
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2528
|
+
'uniffi_ddk_ffi_checksum_func_sign_fund_transaction_input'
|
|
2529
|
+
);
|
|
2530
|
+
}
|
|
2531
|
+
if (
|
|
2532
|
+
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_sign_multi_sig_input() !==
|
|
2533
|
+
14569
|
|
2534
|
+
) {
|
|
2535
|
+
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2536
|
+
'uniffi_ddk_ffi_checksum_func_sign_multi_sig_input'
|
|
2537
|
+
);
|
|
2538
|
+
}
|
|
2539
|
+
if (
|
|
2540
|
+
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_verify_cet_adaptor_sig_from_oracle_info() !==
|
|
2541
|
+
52232
|
|
2542
|
+
) {
|
|
2543
|
+
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2544
|
+
'uniffi_ddk_ffi_checksum_func_verify_cet_adaptor_sig_from_oracle_info'
|
|
2545
|
+
);
|
|
2546
|
+
}
|
|
2547
|
+
if (
|
|
2548
|
+
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_verify_cet_adaptor_sigs_from_oracle_info() !==
|
|
2549
|
+
14181
|
|
2550
|
+
) {
|
|
2551
|
+
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2552
|
+
'uniffi_ddk_ffi_checksum_func_verify_cet_adaptor_sigs_from_oracle_info'
|
|
2553
|
+
);
|
|
2554
|
+
}
|
|
2555
|
+
if (
|
|
2556
|
+
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_verify_fund_tx_signature() !==
|
|
2557
|
+
27316
|
|
2558
|
+
) {
|
|
2559
|
+
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2560
|
+
'uniffi_ddk_ffi_checksum_func_verify_fund_tx_signature'
|
|
2561
|
+
);
|
|
2562
|
+
}
|
|
2563
|
+
if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_version() !== 22317) {
|
|
2564
|
+
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2565
|
+
'uniffi_ddk_ffi_checksum_func_version'
|
|
2566
|
+
);
|
|
2567
|
+
}
|
|
2568
|
+
}
|
|
2137
2569
|
|
|
2138
2570
|
export default Object.freeze({
|
|
2139
2571
|
initialize: uniffiEnsureInitialized,
|
|
@@ -2152,5 +2584,5 @@ export default Object.freeze({
|
|
|
2152
2584
|
FfiConverterTypeTxInput,
|
|
2153
2585
|
FfiConverterTypeTxInputInfo,
|
|
2154
2586
|
FfiConverterTypeTxOutput,
|
|
2155
|
-
}
|
|
2156
|
-
});
|
|
2587
|
+
},
|
|
2588
|
+
});
|