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