@bennyblader/ddk-rn 0.3.35 → 0.3.37
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 -2483
- package/cpp/ddk_ffi.hpp +255 -97
- package/ddk-ffi/Cargo.lock +1 -1
- package/ddk-ffi/Cargo.toml +1 -1
- package/lib/commonjs/ddk_ffi-ffi.js.map +1 -1
- package/lib/commonjs/ddk_ffi.js +75 -63
- 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 +76 -64
- package/lib/module/ddk_ffi.js.map +1 -1
- package/lib/typescript/commonjs/src/ddk_ffi-ffi.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/ddk_ffi.d.ts +3 -3
- package/lib/typescript/commonjs/src/ddk_ffi.d.ts.map +1 -1
- package/lib/typescript/module/src/ddk_ffi-ffi.d.ts.map +1 -1
- package/lib/typescript/module/src/ddk_ffi.d.ts +3 -3
- package/lib/typescript/module/src/ddk_ffi.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/ddk_ffi-ffi.ts +83 -329
- package/src/ddk_ffi.ts +1883 -2313
package/src/ddk_ffi.ts
CHANGED
|
@@ -29,2279 +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
|
-
return FfiConverterArrayUInt8.lift(
|
|
503
|
-
uniffiCaller.rustCallWithError(
|
|
504
|
-
/*liftError:*/ FfiConverterTypeDLCError.lift.bind(
|
|
505
|
-
FfiConverterTypeDLCError
|
|
506
|
-
),
|
|
507
|
-
/*caller:*/ (callStatus) => {
|
|
508
|
-
return (() => {
|
|
509
|
-
console.debug(
|
|
510
|
-
`-- uniffi_ddk_ffi_fn_func_create_xpriv_from_parent_path`
|
|
511
|
-
);
|
|
512
|
-
return nativeModule()
|
|
513
|
-
.ubrn_uniffi_ddk_ffi_fn_func_create_xpriv_from_parent_path;
|
|
514
|
-
})()(
|
|
515
|
-
FfiConverterArrayUInt8.lower(seedOrXpriv),
|
|
516
|
-
FfiConverterString.lower(baseDerivationPath),
|
|
517
|
-
FfiConverterString.lower(network),
|
|
518
|
-
FfiConverterString.lower(path),
|
|
519
|
-
callStatus
|
|
520
|
-
);
|
|
521
|
-
},
|
|
522
|
-
/*liftString:*/ FfiConverterString.lift
|
|
523
|
-
)
|
|
524
|
-
);
|
|
525
|
-
}
|
|
526
|
-
export function extractEcdsaSignatureFromOracleSignatures(
|
|
527
|
-
oracleSignatures: Array<Array</*u8*/ number>>,
|
|
528
|
-
adaptorSignature: Array</*u8*/ number>
|
|
529
|
-
): Array</*u8*/ number> /*throws*/ {
|
|
530
|
-
return FfiConverterArrayUInt8.lift(
|
|
531
|
-
uniffiCaller.rustCallWithError(
|
|
532
|
-
/*liftError:*/ FfiConverterTypeDLCError.lift.bind(
|
|
533
|
-
FfiConverterTypeDLCError
|
|
534
|
-
),
|
|
535
|
-
/*caller:*/ (callStatus) => {
|
|
536
|
-
return (() => {
|
|
537
|
-
console.debug(
|
|
538
|
-
`-- uniffi_ddk_ffi_fn_func_extract_ecdsa_signature_from_oracle_signatures`
|
|
539
|
-
);
|
|
540
|
-
return nativeModule()
|
|
541
|
-
.ubrn_uniffi_ddk_ffi_fn_func_extract_ecdsa_signature_from_oracle_signatures;
|
|
542
|
-
})()(
|
|
543
|
-
FfiConverterArrayArrayUInt8.lower(oracleSignatures),
|
|
544
|
-
FfiConverterArrayUInt8.lower(adaptorSignature),
|
|
545
|
-
callStatus
|
|
546
|
-
);
|
|
547
|
-
},
|
|
548
|
-
/*liftString:*/ FfiConverterString.lift
|
|
549
|
-
)
|
|
550
|
-
);
|
|
551
|
-
}
|
|
552
|
-
export function getCetAdaptorSignatureInputs(
|
|
553
|
-
cet: Transaction,
|
|
554
|
-
oracleInfo: Array<OracleInfo>,
|
|
555
|
-
fundingScriptPubkey: Array</*u8*/ number>,
|
|
556
|
-
fundOutputValue: /*u64*/ bigint,
|
|
557
|
-
msgs: Array<Array<Array</*u8*/ number>>>
|
|
558
|
-
): CetAdaptorSignatureDebugInfo /*throws*/ {
|
|
559
|
-
return FfiConverterTypeCetAdaptorSignatureDebugInfo.lift(
|
|
560
|
-
uniffiCaller.rustCallWithError(
|
|
561
|
-
/*liftError:*/ FfiConverterTypeDLCError.lift.bind(
|
|
562
|
-
FfiConverterTypeDLCError
|
|
563
|
-
),
|
|
564
|
-
/*caller:*/ (callStatus) => {
|
|
565
|
-
return (() => {
|
|
566
|
-
console.debug(
|
|
567
|
-
`-- uniffi_ddk_ffi_fn_func_get_cet_adaptor_signature_inputs`
|
|
568
|
-
);
|
|
569
|
-
return nativeModule()
|
|
570
|
-
.ubrn_uniffi_ddk_ffi_fn_func_get_cet_adaptor_signature_inputs;
|
|
571
|
-
})()(
|
|
572
|
-
FfiConverterTypeTransaction.lower(cet),
|
|
573
|
-
FfiConverterArrayTypeOracleInfo.lower(oracleInfo),
|
|
574
|
-
FfiConverterArrayUInt8.lower(fundingScriptPubkey),
|
|
575
|
-
FfiConverterUInt64.lower(fundOutputValue),
|
|
576
|
-
FfiConverterArrayArrayArrayUInt8.lower(msgs),
|
|
577
|
-
callStatus
|
|
578
|
-
);
|
|
579
|
-
},
|
|
580
|
-
/*liftString:*/ FfiConverterString.lift
|
|
581
|
-
)
|
|
582
|
-
);
|
|
583
|
-
}
|
|
584
|
-
export function getCetSighash(
|
|
585
|
-
cet: Transaction,
|
|
586
|
-
fundingScriptPubkey: Array</*u8*/ number>,
|
|
587
|
-
fundOutputValue: /*u64*/ bigint
|
|
588
|
-
): Array</*u8*/ number> /*throws*/ {
|
|
589
|
-
return FfiConverterArrayUInt8.lift(
|
|
590
|
-
uniffiCaller.rustCallWithError(
|
|
591
|
-
/*liftError:*/ FfiConverterTypeDLCError.lift.bind(
|
|
592
|
-
FfiConverterTypeDLCError
|
|
593
|
-
),
|
|
594
|
-
/*caller:*/ (callStatus) => {
|
|
595
|
-
return (() => {
|
|
596
|
-
console.debug(`-- uniffi_ddk_ffi_fn_func_get_cet_sighash`);
|
|
597
|
-
return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_get_cet_sighash;
|
|
598
|
-
})()(
|
|
599
|
-
FfiConverterTypeTransaction.lower(cet),
|
|
600
|
-
FfiConverterArrayUInt8.lower(fundingScriptPubkey),
|
|
601
|
-
FfiConverterUInt64.lower(fundOutputValue),
|
|
602
|
-
callStatus
|
|
603
|
-
);
|
|
604
|
-
},
|
|
605
|
-
/*liftString:*/ FfiConverterString.lift
|
|
606
|
-
)
|
|
607
|
-
);
|
|
608
|
-
}
|
|
609
|
-
export function getChangeOutputAndFees(
|
|
610
|
-
params: PartyParams,
|
|
611
|
-
feeRate: /*u64*/ bigint
|
|
612
|
-
): ChangeOutputAndFees /*throws*/ {
|
|
613
|
-
return FfiConverterTypeChangeOutputAndFees.lift(
|
|
614
|
-
uniffiCaller.rustCallWithError(
|
|
615
|
-
/*liftError:*/ FfiConverterTypeDLCError.lift.bind(
|
|
616
|
-
FfiConverterTypeDLCError
|
|
617
|
-
),
|
|
618
|
-
/*caller:*/ (callStatus) => {
|
|
619
|
-
return (() => {
|
|
620
|
-
console.debug(`-- uniffi_ddk_ffi_fn_func_get_change_output_and_fees`);
|
|
621
|
-
return nativeModule()
|
|
622
|
-
.ubrn_uniffi_ddk_ffi_fn_func_get_change_output_and_fees;
|
|
623
|
-
})()(
|
|
624
|
-
FfiConverterTypePartyParams.lower(params),
|
|
625
|
-
FfiConverterUInt64.lower(feeRate),
|
|
626
|
-
callStatus
|
|
627
|
-
);
|
|
628
|
-
},
|
|
629
|
-
/*liftString:*/ FfiConverterString.lift
|
|
630
|
-
)
|
|
631
|
-
);
|
|
632
|
-
}
|
|
633
|
-
export function getPubkeyFromExtkey(
|
|
634
|
-
extkey: Array</*u8*/ number>,
|
|
635
|
-
network: string
|
|
636
|
-
): Array</*u8*/ number> /*throws*/ {
|
|
637
|
-
return FfiConverterArrayUInt8.lift(
|
|
638
|
-
uniffiCaller.rustCallWithError(
|
|
639
|
-
/*liftError:*/ FfiConverterTypeDLCError.lift.bind(
|
|
640
|
-
FfiConverterTypeDLCError
|
|
641
|
-
),
|
|
642
|
-
/*caller:*/ (callStatus) => {
|
|
643
|
-
return (() => {
|
|
644
|
-
console.debug(`-- uniffi_ddk_ffi_fn_func_get_pubkey_from_extkey`);
|
|
645
|
-
return nativeModule()
|
|
646
|
-
.ubrn_uniffi_ddk_ffi_fn_func_get_pubkey_from_extkey;
|
|
647
|
-
})()(
|
|
648
|
-
FfiConverterArrayUInt8.lower(extkey),
|
|
649
|
-
FfiConverterString.lower(network),
|
|
650
|
-
callStatus
|
|
651
|
-
);
|
|
652
|
-
},
|
|
653
|
-
/*liftString:*/ FfiConverterString.lift
|
|
654
|
-
)
|
|
655
|
-
);
|
|
656
|
-
}
|
|
657
|
-
export function getRawFundingTransactionInputSignature(
|
|
658
|
-
fundingTransaction: Transaction,
|
|
659
|
-
privkey: Array</*u8*/ number>,
|
|
660
|
-
prevTxId: string,
|
|
661
|
-
prevTxVout: /*u32*/ number,
|
|
662
|
-
value: /*u64*/ bigint
|
|
663
|
-
): Array</*u8*/ number> /*throws*/ {
|
|
664
|
-
return FfiConverterArrayUInt8.lift(
|
|
665
|
-
uniffiCaller.rustCallWithError(
|
|
666
|
-
/*liftError:*/ FfiConverterTypeDLCError.lift.bind(
|
|
667
|
-
FfiConverterTypeDLCError
|
|
668
|
-
),
|
|
669
|
-
/*caller:*/ (callStatus) => {
|
|
670
|
-
return (() => {
|
|
671
|
-
console.debug(
|
|
672
|
-
`-- uniffi_ddk_ffi_fn_func_get_raw_funding_transaction_input_signature`
|
|
673
|
-
);
|
|
674
|
-
return nativeModule()
|
|
675
|
-
.ubrn_uniffi_ddk_ffi_fn_func_get_raw_funding_transaction_input_signature;
|
|
676
|
-
})()(
|
|
677
|
-
FfiConverterTypeTransaction.lower(fundingTransaction),
|
|
678
|
-
FfiConverterArrayUInt8.lower(privkey),
|
|
679
|
-
FfiConverterString.lower(prevTxId),
|
|
680
|
-
FfiConverterUInt32.lower(prevTxVout),
|
|
681
|
-
FfiConverterUInt64.lower(value),
|
|
682
|
-
callStatus
|
|
683
|
-
);
|
|
684
|
-
},
|
|
685
|
-
/*liftString:*/ FfiConverterString.lift
|
|
686
|
-
)
|
|
687
|
-
);
|
|
688
|
-
}
|
|
689
|
-
export function getTotalInputVsize(inputs: Array<TxInputInfo>): /*u32*/ number {
|
|
690
|
-
return FfiConverterUInt32.lift(
|
|
691
|
-
uniffiCaller.rustCall(
|
|
692
|
-
/*caller:*/ (callStatus) => {
|
|
693
|
-
return (() => {
|
|
694
|
-
console.debug(`-- uniffi_ddk_ffi_fn_func_get_total_input_vsize`);
|
|
695
|
-
return nativeModule()
|
|
696
|
-
.ubrn_uniffi_ddk_ffi_fn_func_get_total_input_vsize;
|
|
697
|
-
})()(FfiConverterArrayTypeTxInputInfo.lower(inputs), callStatus);
|
|
698
|
-
},
|
|
699
|
-
/*liftString:*/ FfiConverterString.lift
|
|
700
|
-
)
|
|
701
|
-
);
|
|
702
|
-
}
|
|
703
|
-
export function getXpubFromXpriv(
|
|
704
|
-
xpriv: Array</*u8*/ number>,
|
|
705
|
-
network: string
|
|
706
|
-
): Array</*u8*/ number> /*throws*/ {
|
|
707
|
-
return FfiConverterArrayUInt8.lift(
|
|
708
|
-
uniffiCaller.rustCallWithError(
|
|
709
|
-
/*liftError:*/ FfiConverterTypeDLCError.lift.bind(
|
|
710
|
-
FfiConverterTypeDLCError
|
|
711
|
-
),
|
|
712
|
-
/*caller:*/ (callStatus) => {
|
|
713
|
-
return (() => {
|
|
714
|
-
console.debug(`-- uniffi_ddk_ffi_fn_func_get_xpub_from_xpriv`);
|
|
715
|
-
return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_get_xpub_from_xpriv;
|
|
716
|
-
})()(
|
|
717
|
-
FfiConverterArrayUInt8.lower(xpriv),
|
|
718
|
-
FfiConverterString.lower(network),
|
|
719
|
-
callStatus
|
|
720
|
-
);
|
|
721
|
-
},
|
|
722
|
-
/*liftString:*/ FfiConverterString.lift
|
|
723
|
-
)
|
|
724
|
-
);
|
|
725
|
-
}
|
|
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
|
+
}
|
|
726
501
|
export function isDustOutput(output: TxOutput): boolean {
|
|
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
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
)
|
|
863
|
-
);
|
|
864
|
-
}
|
|
865
|
-
export function verifyCetAdaptorSigsFromOracleInfo(
|
|
866
|
-
adaptorSigs: Array<AdaptorSignature>,
|
|
867
|
-
cets: Array<Transaction>,
|
|
868
|
-
oracleInfo: Array<OracleInfo>,
|
|
869
|
-
pubkey: Array</*u8*/ number>,
|
|
870
|
-
fundingScriptPubkey: Array</*u8*/ number>,
|
|
871
|
-
totalCollateral: /*u64*/ bigint,
|
|
872
|
-
msgs: Array<Array<Array<Array</*u8*/ number>>>>
|
|
873
|
-
): boolean {
|
|
874
|
-
return FfiConverterBool.lift(
|
|
875
|
-
uniffiCaller.rustCall(
|
|
876
|
-
/*caller:*/ (callStatus) => {
|
|
877
|
-
return (() => {
|
|
878
|
-
console.debug(
|
|
879
|
-
`-- uniffi_ddk_ffi_fn_func_verify_cet_adaptor_sigs_from_oracle_info`
|
|
880
|
-
);
|
|
881
|
-
return nativeModule()
|
|
882
|
-
.ubrn_uniffi_ddk_ffi_fn_func_verify_cet_adaptor_sigs_from_oracle_info;
|
|
883
|
-
})()(
|
|
884
|
-
FfiConverterArrayTypeAdaptorSignature.lower(adaptorSigs),
|
|
885
|
-
FfiConverterArrayTypeTransaction.lower(cets),
|
|
886
|
-
FfiConverterArrayTypeOracleInfo.lower(oracleInfo),
|
|
887
|
-
FfiConverterArrayUInt8.lower(pubkey),
|
|
888
|
-
FfiConverterArrayUInt8.lower(fundingScriptPubkey),
|
|
889
|
-
FfiConverterUInt64.lower(totalCollateral),
|
|
890
|
-
FfiConverterArrayArrayArrayArrayUInt8.lower(msgs),
|
|
891
|
-
callStatus
|
|
892
|
-
);
|
|
893
|
-
},
|
|
894
|
-
/*liftString:*/ FfiConverterString.lift
|
|
895
|
-
)
|
|
896
|
-
);
|
|
897
|
-
}
|
|
898
|
-
export function verifyFundTxSignature(
|
|
899
|
-
fundTx: Transaction,
|
|
900
|
-
signature: Array</*u8*/ number>,
|
|
901
|
-
pubkey: Array</*u8*/ number>,
|
|
902
|
-
txid: string,
|
|
903
|
-
vout: /*u32*/ number,
|
|
904
|
-
inputAmount: /*u64*/ bigint
|
|
905
|
-
): boolean /*throws*/ {
|
|
906
|
-
return FfiConverterBool.lift(
|
|
907
|
-
uniffiCaller.rustCallWithError(
|
|
908
|
-
/*liftError:*/ FfiConverterTypeDLCError.lift.bind(
|
|
909
|
-
FfiConverterTypeDLCError
|
|
910
|
-
),
|
|
911
|
-
/*caller:*/ (callStatus) => {
|
|
912
|
-
return (() => {
|
|
913
|
-
console.debug(`-- uniffi_ddk_ffi_fn_func_verify_fund_tx_signature`);
|
|
914
|
-
return nativeModule()
|
|
915
|
-
.ubrn_uniffi_ddk_ffi_fn_func_verify_fund_tx_signature;
|
|
916
|
-
})()(
|
|
917
|
-
FfiConverterTypeTransaction.lower(fundTx),
|
|
918
|
-
FfiConverterArrayUInt8.lower(signature),
|
|
919
|
-
FfiConverterArrayUInt8.lower(pubkey),
|
|
920
|
-
FfiConverterString.lower(txid),
|
|
921
|
-
FfiConverterUInt32.lower(vout),
|
|
922
|
-
FfiConverterUInt64.lower(inputAmount),
|
|
923
|
-
callStatus
|
|
924
|
-
);
|
|
925
|
-
},
|
|
926
|
-
/*liftString:*/ FfiConverterString.lift
|
|
927
|
-
)
|
|
928
|
-
);
|
|
929
|
-
}
|
|
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
|
+
}
|
|
930
637
|
export function version(): string {
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
}
|
|
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
|
+
|
|
943
655
|
|
|
944
656
|
export type AdaptorSignature = {
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
}
|
|
657
|
+
signature: Array</*u8*/number>,
|
|
658
|
+
proof: Array</*u8*/number>
|
|
659
|
+
}
|
|
948
660
|
|
|
949
661
|
/**
|
|
950
662
|
* Generated factory for {@link AdaptorSignature} record objects.
|
|
951
663
|
*/
|
|
952
664
|
export const AdaptorSignature = (() => {
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
);
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
});
|
|
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
|
+
});
|
|
977
688
|
})();
|
|
978
689
|
|
|
979
690
|
const FfiConverterTypeAdaptorSignature = (() => {
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
}
|
|
998
|
-
|
|
999
|
-
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();
|
|
1000
710
|
})();
|
|
1001
711
|
|
|
712
|
+
|
|
1002
713
|
export type CetAdaptorSignatureDebugInfo = {
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
}
|
|
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
|
+
}
|
|
1011
722
|
|
|
1012
723
|
/**
|
|
1013
724
|
* Generated factory for {@link CetAdaptorSignatureDebugInfo} record objects.
|
|
1014
725
|
*/
|
|
1015
726
|
export const CetAdaptorSignatureDebugInfo = (() => {
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
defaults: () =>
|
|
1040
|
-
Object.freeze(defaults()) as Partial<CetAdaptorSignatureDebugInfo>,
|
|
1041
|
-
});
|
|
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
|
+
});
|
|
1042
750
|
})();
|
|
1043
751
|
|
|
1044
752
|
const FfiConverterTypeCetAdaptorSignatureDebugInfo = (() => {
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
}
|
|
1078
|
-
|
|
1079
|
-
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();
|
|
1080
787
|
})();
|
|
1081
788
|
|
|
789
|
+
|
|
1082
790
|
export type ChangeOutputAndFees = {
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
}
|
|
791
|
+
changeOutput: TxOutput,
|
|
792
|
+
fundFee: /*u64*/bigint,
|
|
793
|
+
cetFee: /*u64*/bigint
|
|
794
|
+
}
|
|
1087
795
|
|
|
1088
796
|
/**
|
|
1089
797
|
* Generated factory for {@link ChangeOutputAndFees} record objects.
|
|
1090
798
|
*/
|
|
1091
799
|
export const ChangeOutputAndFees = (() => {
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
);
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
});
|
|
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
|
+
});
|
|
1116
823
|
})();
|
|
1117
824
|
|
|
1118
825
|
const FfiConverterTypeChangeOutputAndFees = (() => {
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
}
|
|
1140
|
-
|
|
1141
|
-
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();
|
|
1142
848
|
})();
|
|
1143
849
|
|
|
850
|
+
|
|
1144
851
|
export type DlcInputInfo = {
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
}
|
|
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
|
+
}
|
|
1154
861
|
|
|
1155
862
|
/**
|
|
1156
863
|
* Generated factory for {@link DlcInputInfo} record objects.
|
|
1157
864
|
*/
|
|
1158
865
|
export const DlcInputInfo = (() => {
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
);
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
});
|
|
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
|
+
});
|
|
1183
889
|
})();
|
|
1184
890
|
|
|
1185
891
|
const FfiConverterTypeDlcInputInfo = (() => {
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
}
|
|
1222
|
-
|
|
1223
|
-
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();
|
|
1224
929
|
})();
|
|
1225
930
|
|
|
931
|
+
|
|
1226
932
|
export type DlcTransactions = {
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
}
|
|
933
|
+
fund: Transaction,
|
|
934
|
+
cets: Array<Transaction>,
|
|
935
|
+
refund: Transaction,
|
|
936
|
+
fundingScriptPubkey: Array</*u8*/number>
|
|
937
|
+
}
|
|
1232
938
|
|
|
1233
939
|
/**
|
|
1234
940
|
* Generated factory for {@link DlcTransactions} record objects.
|
|
1235
941
|
*/
|
|
1236
942
|
export const DlcTransactions = (() => {
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
);
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
});
|
|
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
|
+
});
|
|
1261
966
|
})();
|
|
1262
967
|
|
|
1263
968
|
const FfiConverterTypeDlcTransactions = (() => {
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
}
|
|
1288
|
-
|
|
1289
|
-
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();
|
|
1290
994
|
})();
|
|
1291
995
|
|
|
996
|
+
|
|
1292
997
|
export type OracleInfo = {
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
}
|
|
998
|
+
publicKey: Array</*u8*/number>,
|
|
999
|
+
nonces: Array<Array</*u8*/number>>
|
|
1000
|
+
}
|
|
1296
1001
|
|
|
1297
1002
|
/**
|
|
1298
1003
|
* Generated factory for {@link OracleInfo} record objects.
|
|
1299
1004
|
*/
|
|
1300
1005
|
export const OracleInfo = (() => {
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
);
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
});
|
|
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
|
+
});
|
|
1325
1029
|
})();
|
|
1326
1030
|
|
|
1327
1031
|
const FfiConverterTypeOracleInfo = (() => {
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
}
|
|
1346
|
-
|
|
1347
|
-
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();
|
|
1348
1051
|
})();
|
|
1349
1052
|
|
|
1053
|
+
|
|
1350
1054
|
export type PartyParams = {
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
}
|
|
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
|
+
}
|
|
1361
1065
|
|
|
1362
1066
|
/**
|
|
1363
1067
|
* Generated factory for {@link PartyParams} record objects.
|
|
1364
1068
|
*/
|
|
1365
1069
|
export const PartyParams = (() => {
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
);
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
});
|
|
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
|
+
});
|
|
1390
1093
|
})();
|
|
1391
1094
|
|
|
1392
1095
|
const FfiConverterTypePartyParams = (() => {
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
}
|
|
1432
|
-
|
|
1433
|
-
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();
|
|
1434
1136
|
})();
|
|
1435
1137
|
|
|
1138
|
+
|
|
1436
1139
|
export type Payout = {
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
}
|
|
1140
|
+
offer: /*u64*/bigint,
|
|
1141
|
+
accept: /*u64*/bigint
|
|
1142
|
+
}
|
|
1440
1143
|
|
|
1441
1144
|
/**
|
|
1442
1145
|
* Generated factory for {@link Payout} record objects.
|
|
1443
1146
|
*/
|
|
1444
1147
|
export const Payout = (() => {
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
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
|
+
});
|
|
1467
1171
|
})();
|
|
1468
1172
|
|
|
1469
1173
|
const FfiConverterTypePayout = (() => {
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
}
|
|
1488
|
-
|
|
1489
|
-
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();
|
|
1490
1193
|
})();
|
|
1491
1194
|
|
|
1195
|
+
|
|
1492
1196
|
export type Transaction = {
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
}
|
|
1197
|
+
version: /*i32*/number,
|
|
1198
|
+
lockTime: /*u32*/number,
|
|
1199
|
+
inputs: Array<TxInput>,
|
|
1200
|
+
outputs: Array<TxOutput>,
|
|
1201
|
+
rawBytes: Array</*u8*/number>
|
|
1202
|
+
}
|
|
1499
1203
|
|
|
1500
1204
|
/**
|
|
1501
1205
|
* Generated factory for {@link Transaction} record objects.
|
|
1502
1206
|
*/
|
|
1503
1207
|
export const Transaction = (() => {
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
);
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
});
|
|
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
|
+
});
|
|
1528
1231
|
})();
|
|
1529
1232
|
|
|
1530
1233
|
const FfiConverterTypeTransaction = (() => {
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
}
|
|
1558
|
-
|
|
1559
|
-
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();
|
|
1560
1262
|
})();
|
|
1561
1263
|
|
|
1264
|
+
|
|
1562
1265
|
export type TxInput = {
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
}
|
|
1266
|
+
txid: string,
|
|
1267
|
+
vout: /*u32*/number,
|
|
1268
|
+
scriptSig: Array</*u8*/number>,
|
|
1269
|
+
sequence: /*u32*/number,
|
|
1270
|
+
witness: Array<Array</*u8*/number>>
|
|
1271
|
+
}
|
|
1569
1272
|
|
|
1570
1273
|
/**
|
|
1571
1274
|
* Generated factory for {@link TxInput} record objects.
|
|
1572
1275
|
*/
|
|
1573
1276
|
export const TxInput = (() => {
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
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
|
+
});
|
|
1596
1300
|
})();
|
|
1597
1301
|
|
|
1598
1302
|
const FfiConverterTypeTxInput = (() => {
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
}
|
|
1626
|
-
|
|
1627
|
-
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();
|
|
1628
1331
|
})();
|
|
1629
1332
|
|
|
1333
|
+
|
|
1630
1334
|
export type TxInputInfo = {
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
}
|
|
1335
|
+
txid: string,
|
|
1336
|
+
vout: /*u32*/number,
|
|
1337
|
+
scriptSig: Array</*u8*/number>,
|
|
1338
|
+
maxWitnessLength: /*u32*/number,
|
|
1339
|
+
serialId: /*u64*/bigint
|
|
1340
|
+
}
|
|
1637
1341
|
|
|
1638
1342
|
/**
|
|
1639
1343
|
* Generated factory for {@link TxInputInfo} record objects.
|
|
1640
1344
|
*/
|
|
1641
1345
|
export const TxInputInfo = (() => {
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
);
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
});
|
|
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
|
+
});
|
|
1666
1369
|
})();
|
|
1667
1370
|
|
|
1668
1371
|
const FfiConverterTypeTxInputInfo = (() => {
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
}
|
|
1696
|
-
|
|
1697
|
-
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();
|
|
1698
1400
|
})();
|
|
1699
1401
|
|
|
1402
|
+
|
|
1700
1403
|
export type TxOutput = {
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
}
|
|
1404
|
+
value: /*u64*/bigint,
|
|
1405
|
+
scriptPubkey: Array</*u8*/number>
|
|
1406
|
+
}
|
|
1704
1407
|
|
|
1705
1408
|
/**
|
|
1706
1409
|
* Generated factory for {@link TxOutput} record objects.
|
|
1707
1410
|
*/
|
|
1708
1411
|
export const TxOutput = (() => {
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
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
|
+
});
|
|
1731
1435
|
})();
|
|
1732
1436
|
|
|
1733
1437
|
const FfiConverterTypeTxOutput = (() => {
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
}
|
|
1752
|
-
|
|
1753
|
-
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();
|
|
1754
1457
|
})();
|
|
1755
1458
|
|
|
1459
|
+
|
|
1756
1460
|
const stringConverter = {
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
),
|
|
1764
|
-
bytesToString: (ab: UniffiByteArray) =>
|
|
1765
|
-
uniffiCaller.rustCall((status) =>
|
|
1766
|
-
nativeModule().ubrn_uniffi_internal_fn_func_ffi__arraybuffer_to_string(
|
|
1767
|
-
ab,
|
|
1768
|
-
status
|
|
1769
|
-
)
|
|
1770
|
-
),
|
|
1771
|
-
stringByteLength: (s: string) =>
|
|
1772
|
-
uniffiCaller.rustCall((status) =>
|
|
1773
|
-
nativeModule().ubrn_uniffi_internal_fn_func_ffi__string_to_byte_length(
|
|
1774
|
-
s,
|
|
1775
|
-
status
|
|
1776
|
-
)
|
|
1777
|
-
),
|
|
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)),
|
|
1778
1467
|
};
|
|
1779
1468
|
const FfiConverterString = uniffiCreateFfiConverterString(stringConverter);
|
|
1780
1469
|
|
|
1781
|
-
// Flat error type: DlcError
|
|
1782
|
-
export enum DlcError_Tags {
|
|
1783
|
-
InvalidSignature = 'InvalidSignature',
|
|
1784
|
-
InvalidPublicKey = 'InvalidPublicKey',
|
|
1785
|
-
InvalidTransaction = 'InvalidTransaction',
|
|
1786
|
-
InsufficientFunds = 'InsufficientFunds',
|
|
1787
|
-
InvalidArgument = 'InvalidArgument',
|
|
1788
|
-
SerializationError = 'SerializationError',
|
|
1789
|
-
Secp256k1Error = 'Secp256k1Error',
|
|
1790
|
-
MiniscriptError = 'MiniscriptError',
|
|
1791
|
-
InvalidNetwork = 'InvalidNetwork',
|
|
1792
|
-
KeyError = 'KeyError',
|
|
1793
|
-
}
|
|
1794
|
-
export const DlcError = (() => {
|
|
1795
|
-
class InvalidSignature extends UniffiError {
|
|
1796
|
-
/**
|
|
1797
|
-
* @private
|
|
1798
|
-
* This field is private and should not be used.
|
|
1799
|
-
*/
|
|
1800
|
-
readonly [uniffiTypeNameSymbol]: string = 'DlcError';
|
|
1801
|
-
/**
|
|
1802
|
-
* @private
|
|
1803
|
-
* This field is private and should not be used.
|
|
1804
|
-
*/
|
|
1805
|
-
readonly [variantOrdinalSymbol] = 1;
|
|
1806
|
-
|
|
1807
|
-
public readonly tag = DlcError_Tags.InvalidSignature;
|
|
1808
|
-
|
|
1809
|
-
constructor(message: string) {
|
|
1810
|
-
super('DlcError', 'InvalidSignature', message);
|
|
1811
|
-
}
|
|
1812
|
-
|
|
1813
|
-
static instanceOf(e: any): e is InvalidSignature {
|
|
1814
|
-
return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 1;
|
|
1815
|
-
}
|
|
1816
|
-
}
|
|
1817
|
-
class InvalidPublicKey extends UniffiError {
|
|
1818
|
-
/**
|
|
1819
|
-
* @private
|
|
1820
|
-
* This field is private and should not be used.
|
|
1821
|
-
*/
|
|
1822
|
-
readonly [uniffiTypeNameSymbol]: string = 'DlcError';
|
|
1823
|
-
/**
|
|
1824
|
-
* @private
|
|
1825
|
-
* This field is private and should not be used.
|
|
1826
|
-
*/
|
|
1827
|
-
readonly [variantOrdinalSymbol] = 2;
|
|
1828
|
-
|
|
1829
|
-
public readonly tag = DlcError_Tags.InvalidPublicKey;
|
|
1830
|
-
|
|
1831
|
-
constructor(message: string) {
|
|
1832
|
-
super('DlcError', 'InvalidPublicKey', message);
|
|
1833
|
-
}
|
|
1834
|
-
|
|
1835
|
-
static instanceOf(e: any): e is InvalidPublicKey {
|
|
1836
|
-
return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 2;
|
|
1837
|
-
}
|
|
1838
|
-
}
|
|
1839
|
-
class InvalidTransaction extends UniffiError {
|
|
1840
|
-
/**
|
|
1841
|
-
* @private
|
|
1842
|
-
* This field is private and should not be used.
|
|
1843
|
-
*/
|
|
1844
|
-
readonly [uniffiTypeNameSymbol]: string = 'DlcError';
|
|
1845
|
-
/**
|
|
1846
|
-
* @private
|
|
1847
|
-
* This field is private and should not be used.
|
|
1848
|
-
*/
|
|
1849
|
-
readonly [variantOrdinalSymbol] = 3;
|
|
1850
|
-
|
|
1851
|
-
public readonly tag = DlcError_Tags.InvalidTransaction;
|
|
1852
|
-
|
|
1853
|
-
constructor(message: string) {
|
|
1854
|
-
super('DlcError', 'InvalidTransaction', message);
|
|
1855
|
-
}
|
|
1856
|
-
|
|
1857
|
-
static instanceOf(e: any): e is InvalidTransaction {
|
|
1858
|
-
return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 3;
|
|
1859
|
-
}
|
|
1860
|
-
}
|
|
1861
|
-
class InsufficientFunds extends UniffiError {
|
|
1862
|
-
/**
|
|
1863
|
-
* @private
|
|
1864
|
-
* This field is private and should not be used.
|
|
1865
|
-
*/
|
|
1866
|
-
readonly [uniffiTypeNameSymbol]: string = 'DlcError';
|
|
1867
|
-
/**
|
|
1868
|
-
* @private
|
|
1869
|
-
* This field is private and should not be used.
|
|
1870
|
-
*/
|
|
1871
|
-
readonly [variantOrdinalSymbol] = 4;
|
|
1872
|
-
|
|
1873
|
-
public readonly tag = DlcError_Tags.InsufficientFunds;
|
|
1874
|
-
|
|
1875
|
-
constructor(message: string) {
|
|
1876
|
-
super('DlcError', 'InsufficientFunds', message);
|
|
1877
|
-
}
|
|
1878
|
-
|
|
1879
|
-
static instanceOf(e: any): e is InsufficientFunds {
|
|
1880
|
-
return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 4;
|
|
1881
|
-
}
|
|
1882
|
-
}
|
|
1883
|
-
class InvalidArgument extends UniffiError {
|
|
1884
|
-
/**
|
|
1885
|
-
* @private
|
|
1886
|
-
* This field is private and should not be used.
|
|
1887
|
-
*/
|
|
1888
|
-
readonly [uniffiTypeNameSymbol]: string = 'DlcError';
|
|
1889
|
-
/**
|
|
1890
|
-
* @private
|
|
1891
|
-
* This field is private and should not be used.
|
|
1892
|
-
*/
|
|
1893
|
-
readonly [variantOrdinalSymbol] = 5;
|
|
1894
|
-
|
|
1895
|
-
public readonly tag = DlcError_Tags.InvalidArgument;
|
|
1896
|
-
|
|
1897
|
-
constructor(message: string) {
|
|
1898
|
-
super('DlcError', 'InvalidArgument', message);
|
|
1899
|
-
}
|
|
1900
|
-
|
|
1901
|
-
static instanceOf(e: any): e is InvalidArgument {
|
|
1902
|
-
return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 5;
|
|
1903
|
-
}
|
|
1904
|
-
}
|
|
1905
|
-
class SerializationError extends UniffiError {
|
|
1906
|
-
/**
|
|
1907
|
-
* @private
|
|
1908
|
-
* This field is private and should not be used.
|
|
1909
|
-
*/
|
|
1910
|
-
readonly [uniffiTypeNameSymbol]: string = 'DlcError';
|
|
1911
|
-
/**
|
|
1912
|
-
* @private
|
|
1913
|
-
* This field is private and should not be used.
|
|
1914
|
-
*/
|
|
1915
|
-
readonly [variantOrdinalSymbol] = 6;
|
|
1916
|
-
|
|
1917
|
-
public readonly tag = DlcError_Tags.SerializationError;
|
|
1918
|
-
|
|
1919
|
-
constructor(message: string) {
|
|
1920
|
-
super('DlcError', 'SerializationError', message);
|
|
1921
|
-
}
|
|
1922
|
-
|
|
1923
|
-
static instanceOf(e: any): e is SerializationError {
|
|
1924
|
-
return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 6;
|
|
1925
|
-
}
|
|
1926
|
-
}
|
|
1927
|
-
class Secp256k1Error extends UniffiError {
|
|
1928
|
-
/**
|
|
1929
|
-
* @private
|
|
1930
|
-
* This field is private and should not be used.
|
|
1931
|
-
*/
|
|
1932
|
-
readonly [uniffiTypeNameSymbol]: string = 'DlcError';
|
|
1933
|
-
/**
|
|
1934
|
-
* @private
|
|
1935
|
-
* This field is private and should not be used.
|
|
1936
|
-
*/
|
|
1937
|
-
readonly [variantOrdinalSymbol] = 7;
|
|
1938
|
-
|
|
1939
|
-
public readonly tag = DlcError_Tags.Secp256k1Error;
|
|
1940
|
-
|
|
1941
|
-
constructor(message: string) {
|
|
1942
|
-
super('DlcError', 'Secp256k1Error', message);
|
|
1943
|
-
}
|
|
1944
|
-
|
|
1945
|
-
static instanceOf(e: any): e is Secp256k1Error {
|
|
1946
|
-
return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 7;
|
|
1947
|
-
}
|
|
1948
|
-
}
|
|
1949
|
-
class MiniscriptError extends UniffiError {
|
|
1950
|
-
/**
|
|
1951
|
-
* @private
|
|
1952
|
-
* This field is private and should not be used.
|
|
1953
|
-
*/
|
|
1954
|
-
readonly [uniffiTypeNameSymbol]: string = 'DlcError';
|
|
1955
|
-
/**
|
|
1956
|
-
* @private
|
|
1957
|
-
* This field is private and should not be used.
|
|
1958
|
-
*/
|
|
1959
|
-
readonly [variantOrdinalSymbol] = 8;
|
|
1960
|
-
|
|
1961
|
-
public readonly tag = DlcError_Tags.MiniscriptError;
|
|
1962
1470
|
|
|
1963
|
-
constructor(message: string) {
|
|
1964
|
-
super('DlcError', 'MiniscriptError', message);
|
|
1965
|
-
}
|
|
1966
1471
|
|
|
1967
|
-
static instanceOf(e: any): e is MiniscriptError {
|
|
1968
|
-
return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 8;
|
|
1969
|
-
}
|
|
1970
|
-
}
|
|
1971
|
-
class InvalidNetwork extends UniffiError {
|
|
1972
|
-
/**
|
|
1973
|
-
* @private
|
|
1974
|
-
* This field is private and should not be used.
|
|
1975
|
-
*/
|
|
1976
|
-
readonly [uniffiTypeNameSymbol]: string = 'DlcError';
|
|
1977
|
-
/**
|
|
1978
|
-
* @private
|
|
1979
|
-
* This field is private and should not be used.
|
|
1980
|
-
*/
|
|
1981
|
-
readonly [variantOrdinalSymbol] = 9;
|
|
1982
1472
|
|
|
1983
|
-
public readonly tag = DlcError_Tags.InvalidNetwork;
|
|
1984
|
-
|
|
1985
|
-
constructor(message: string) {
|
|
1986
|
-
super('DlcError', 'InvalidNetwork', message);
|
|
1987
|
-
}
|
|
1988
1473
|
|
|
1989
|
-
static instanceOf(e: any): e is InvalidNetwork {
|
|
1990
|
-
return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 9;
|
|
1991
|
-
}
|
|
1992
|
-
}
|
|
1993
|
-
class KeyError extends UniffiError {
|
|
1994
|
-
/**
|
|
1995
|
-
* @private
|
|
1996
|
-
* This field is private and should not be used.
|
|
1997
|
-
*/
|
|
1998
|
-
readonly [uniffiTypeNameSymbol]: string = 'DlcError';
|
|
1999
|
-
/**
|
|
2000
|
-
* @private
|
|
2001
|
-
* This field is private and should not be used.
|
|
2002
|
-
*/
|
|
2003
|
-
readonly [variantOrdinalSymbol] = 10;
|
|
2004
1474
|
|
|
2005
|
-
public readonly tag = DlcError_Tags.KeyError;
|
|
2006
1475
|
|
|
2007
|
-
constructor(message: string) {
|
|
2008
|
-
super('DlcError', 'KeyError', message);
|
|
2009
|
-
}
|
|
2010
1476
|
|
|
2011
|
-
static instanceOf(e: any): e is KeyError {
|
|
2012
|
-
return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 10;
|
|
2013
|
-
}
|
|
2014
|
-
}
|
|
2015
1477
|
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
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
|
+
};
|
|
2033
1750
|
})();
|
|
2034
1751
|
|
|
2035
1752
|
// Union type for DlcError error type.
|
|
2036
1753
|
|
|
1754
|
+
|
|
2037
1755
|
export type DlcError = InstanceType<
|
|
2038
|
-
|
|
1756
|
+
typeof DlcError[keyof Omit<typeof DlcError, 'instanceOf'>]
|
|
2039
1757
|
>;
|
|
2040
1758
|
|
|
2041
1759
|
const FfiConverterTypeDLCError = (() => {
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
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
|
+
})();
|
|
2073
1809
|
|
|
2074
|
-
case 10:
|
|
2075
|
-
return new DlcError.KeyError(FfiConverterString.read(from));
|
|
2076
1810
|
|
|
2077
|
-
default:
|
|
2078
|
-
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
2079
|
-
}
|
|
2080
|
-
}
|
|
2081
|
-
write(value: TypeName, into: RustBuffer): void {
|
|
2082
|
-
const obj = value as any;
|
|
2083
|
-
const index = obj[variantOrdinalSymbol] as number;
|
|
2084
|
-
intConverter.write(index, into);
|
|
2085
|
-
}
|
|
2086
|
-
allocationSize(value: TypeName): number {
|
|
2087
|
-
return intConverter.allocationSize(0);
|
|
2088
|
-
}
|
|
2089
|
-
}
|
|
2090
|
-
return new FfiConverter();
|
|
2091
|
-
})();
|
|
2092
1811
|
|
|
2093
1812
|
// Flat error type: ExtendedKey
|
|
2094
1813
|
export enum ExtendedKey_Tags {
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
1814
|
+
InvalidMnemonic = "InvalidMnemonic",
|
|
1815
|
+
InvalidXpriv = "InvalidXpriv",
|
|
1816
|
+
InvalidXpub = "InvalidXpub",
|
|
1817
|
+
InvalidDerivationPath = "InvalidDerivationPath"
|
|
2099
1818
|
}
|
|
2100
1819
|
export const ExtendedKey = (() => {
|
|
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
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
instanceOf
|
|
2200
|
-
|
|
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
|
+
};
|
|
2201
1928
|
})();
|
|
2202
1929
|
|
|
2203
1930
|
// Union type for ExtendedKey error type.
|
|
2204
1931
|
|
|
1932
|
+
|
|
2205
1933
|
export type ExtendedKey = InstanceType<
|
|
2206
|
-
|
|
1934
|
+
typeof ExtendedKey[keyof Omit<typeof ExtendedKey, 'instanceOf'>]
|
|
2207
1935
|
>;
|
|
2208
1936
|
|
|
2209
1937
|
const FfiConverterTypeExtendedKey = (() => {
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
}
|
|
2241
|
-
}
|
|
2242
|
-
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();
|
|
2243
1968
|
})();
|
|
2244
1969
|
|
|
1970
|
+
|
|
2245
1971
|
// FfiConverter for string | undefined
|
|
2246
1972
|
const FfiConverterOptionalString = new FfiConverterOptional(FfiConverterString);
|
|
2247
1973
|
|
|
1974
|
+
|
|
2248
1975
|
// FfiConverter for Array<AdaptorSignature>
|
|
2249
|
-
const FfiConverterArrayTypeAdaptorSignature = new FfiConverterArray(
|
|
2250
|
-
|
|
2251
|
-
);
|
|
1976
|
+
const FfiConverterArrayTypeAdaptorSignature = new FfiConverterArray(FfiConverterTypeAdaptorSignature);
|
|
1977
|
+
|
|
2252
1978
|
|
|
2253
1979
|
// FfiConverter for Array<DlcInputInfo>
|
|
2254
|
-
const FfiConverterArrayTypeDlcInputInfo = new FfiConverterArray(
|
|
2255
|
-
|
|
2256
|
-
);
|
|
1980
|
+
const FfiConverterArrayTypeDlcInputInfo = new FfiConverterArray(FfiConverterTypeDlcInputInfo);
|
|
1981
|
+
|
|
2257
1982
|
|
|
2258
1983
|
// FfiConverter for Array<OracleInfo>
|
|
2259
|
-
const FfiConverterArrayTypeOracleInfo = new FfiConverterArray(
|
|
2260
|
-
|
|
2261
|
-
);
|
|
1984
|
+
const FfiConverterArrayTypeOracleInfo = new FfiConverterArray(FfiConverterTypeOracleInfo);
|
|
1985
|
+
|
|
2262
1986
|
|
|
2263
1987
|
// FfiConverter for Array<Payout>
|
|
2264
|
-
const FfiConverterArrayTypePayout = new FfiConverterArray(
|
|
2265
|
-
|
|
2266
|
-
);
|
|
1988
|
+
const FfiConverterArrayTypePayout = new FfiConverterArray(FfiConverterTypePayout);
|
|
1989
|
+
|
|
2267
1990
|
|
|
2268
1991
|
// FfiConverter for Array<Transaction>
|
|
2269
|
-
const FfiConverterArrayTypeTransaction = new FfiConverterArray(
|
|
2270
|
-
|
|
2271
|
-
);
|
|
1992
|
+
const FfiConverterArrayTypeTransaction = new FfiConverterArray(FfiConverterTypeTransaction);
|
|
1993
|
+
|
|
2272
1994
|
|
|
2273
1995
|
// FfiConverter for Array<TxInput>
|
|
2274
|
-
const FfiConverterArrayTypeTxInput = new FfiConverterArray(
|
|
2275
|
-
|
|
2276
|
-
);
|
|
1996
|
+
const FfiConverterArrayTypeTxInput = new FfiConverterArray(FfiConverterTypeTxInput);
|
|
1997
|
+
|
|
2277
1998
|
|
|
2278
1999
|
// FfiConverter for Array<TxInputInfo>
|
|
2279
|
-
const FfiConverterArrayTypeTxInputInfo = new FfiConverterArray(
|
|
2280
|
-
|
|
2281
|
-
);
|
|
2000
|
+
const FfiConverterArrayTypeTxInputInfo = new FfiConverterArray(FfiConverterTypeTxInputInfo);
|
|
2001
|
+
|
|
2282
2002
|
|
|
2283
2003
|
// FfiConverter for Array<TxOutput>
|
|
2284
|
-
const FfiConverterArrayTypeTxOutput = new FfiConverterArray(
|
|
2285
|
-
|
|
2286
|
-
);
|
|
2004
|
+
const FfiConverterArrayTypeTxOutput = new FfiConverterArray(FfiConverterTypeTxOutput);
|
|
2005
|
+
|
|
2287
2006
|
|
|
2288
2007
|
// FfiConverter for Array</*u8*/number>
|
|
2289
2008
|
const FfiConverterArrayUInt8 = new FfiConverterArray(FfiConverterUInt8);
|
|
2290
2009
|
|
|
2010
|
+
|
|
2291
2011
|
// FfiConverter for Array<Array</*u8*/number>>
|
|
2292
|
-
const FfiConverterArrayArrayUInt8 = new FfiConverterArray(
|
|
2293
|
-
|
|
2294
|
-
);
|
|
2012
|
+
const FfiConverterArrayArrayUInt8 = new FfiConverterArray(FfiConverterArrayUInt8);
|
|
2013
|
+
|
|
2295
2014
|
|
|
2296
2015
|
// FfiConverter for Array<Array<Array</*u8*/number>>>
|
|
2297
|
-
const FfiConverterArrayArrayArrayUInt8 = new FfiConverterArray(
|
|
2298
|
-
|
|
2299
|
-
);
|
|
2016
|
+
const FfiConverterArrayArrayArrayUInt8 = new FfiConverterArray(FfiConverterArrayArrayUInt8);
|
|
2017
|
+
|
|
2300
2018
|
|
|
2301
2019
|
// FfiConverter for Array<Array<Array<Array</*u8*/number>>>>
|
|
2302
|
-
const FfiConverterArrayArrayArrayArrayUInt8 = new FfiConverterArray(
|
|
2303
|
-
FfiConverterArrayArrayArrayUInt8
|
|
2304
|
-
);
|
|
2020
|
+
const FfiConverterArrayArrayArrayArrayUInt8 = new FfiConverterArray(FfiConverterArrayArrayArrayUInt8);
|
|
2305
2021
|
|
|
2306
2022
|
/**
|
|
2307
2023
|
* This should be called before anything else.
|
|
@@ -2314,254 +2030,108 @@ const FfiConverterArrayArrayArrayArrayUInt8 = new FfiConverterArray(
|
|
|
2314
2030
|
* It also initializes the machinery to enable Rust to talk back to Javascript.
|
|
2315
2031
|
*/
|
|
2316
2032
|
function uniffiEnsureInitialized() {
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
)
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
)
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
nativeModule().
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
)
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
nativeModule().
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
}
|
|
2420
|
-
if (
|
|
2421
|
-
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_refund_transaction() !==
|
|
2422
|
-
57261
|
|
2423
|
-
) {
|
|
2424
|
-
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2425
|
-
'uniffi_ddk_ffi_checksum_func_create_refund_transaction'
|
|
2426
|
-
);
|
|
2427
|
-
}
|
|
2428
|
-
if (
|
|
2429
|
-
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_spliced_dlc_transactions() !==
|
|
2430
|
-
19497
|
|
2431
|
-
) {
|
|
2432
|
-
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2433
|
-
'uniffi_ddk_ffi_checksum_func_create_spliced_dlc_transactions'
|
|
2434
|
-
);
|
|
2435
|
-
}
|
|
2436
|
-
if (
|
|
2437
|
-
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_xpriv_from_parent_path() !==
|
|
2438
|
-
34808
|
|
2439
|
-
) {
|
|
2440
|
-
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2441
|
-
'uniffi_ddk_ffi_checksum_func_create_xpriv_from_parent_path'
|
|
2442
|
-
);
|
|
2443
|
-
}
|
|
2444
|
-
if (
|
|
2445
|
-
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_extract_ecdsa_signature_from_oracle_signatures() !==
|
|
2446
|
-
8006
|
|
2447
|
-
) {
|
|
2448
|
-
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2449
|
-
'uniffi_ddk_ffi_checksum_func_extract_ecdsa_signature_from_oracle_signatures'
|
|
2450
|
-
);
|
|
2451
|
-
}
|
|
2452
|
-
if (
|
|
2453
|
-
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_get_cet_adaptor_signature_inputs() !==
|
|
2454
|
-
14595
|
|
2455
|
-
) {
|
|
2456
|
-
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2457
|
-
'uniffi_ddk_ffi_checksum_func_get_cet_adaptor_signature_inputs'
|
|
2458
|
-
);
|
|
2459
|
-
}
|
|
2460
|
-
if (
|
|
2461
|
-
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_get_cet_sighash() !== 10643
|
|
2462
|
-
) {
|
|
2463
|
-
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2464
|
-
'uniffi_ddk_ffi_checksum_func_get_cet_sighash'
|
|
2465
|
-
);
|
|
2466
|
-
}
|
|
2467
|
-
if (
|
|
2468
|
-
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_get_change_output_and_fees() !==
|
|
2469
|
-
44150
|
|
2470
|
-
) {
|
|
2471
|
-
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2472
|
-
'uniffi_ddk_ffi_checksum_func_get_change_output_and_fees'
|
|
2473
|
-
);
|
|
2474
|
-
}
|
|
2475
|
-
if (
|
|
2476
|
-
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_get_pubkey_from_extkey() !==
|
|
2477
|
-
64637
|
|
2478
|
-
) {
|
|
2479
|
-
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2480
|
-
'uniffi_ddk_ffi_checksum_func_get_pubkey_from_extkey'
|
|
2481
|
-
);
|
|
2482
|
-
}
|
|
2483
|
-
if (
|
|
2484
|
-
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_get_raw_funding_transaction_input_signature() !==
|
|
2485
|
-
35708
|
|
2486
|
-
) {
|
|
2487
|
-
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2488
|
-
'uniffi_ddk_ffi_checksum_func_get_raw_funding_transaction_input_signature'
|
|
2489
|
-
);
|
|
2490
|
-
}
|
|
2491
|
-
if (
|
|
2492
|
-
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_get_total_input_vsize() !==
|
|
2493
|
-
38213
|
|
2494
|
-
) {
|
|
2495
|
-
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2496
|
-
'uniffi_ddk_ffi_checksum_func_get_total_input_vsize'
|
|
2497
|
-
);
|
|
2498
|
-
}
|
|
2499
|
-
if (
|
|
2500
|
-
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_get_xpub_from_xpriv() !==
|
|
2501
|
-
44344
|
|
2502
|
-
) {
|
|
2503
|
-
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2504
|
-
'uniffi_ddk_ffi_checksum_func_get_xpub_from_xpriv'
|
|
2505
|
-
);
|
|
2506
|
-
}
|
|
2507
|
-
if (
|
|
2508
|
-
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_is_dust_output() !== 64174
|
|
2509
|
-
) {
|
|
2510
|
-
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2511
|
-
'uniffi_ddk_ffi_checksum_func_is_dust_output'
|
|
2512
|
-
);
|
|
2513
|
-
}
|
|
2514
|
-
if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_sign_cet() !== 43957) {
|
|
2515
|
-
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2516
|
-
'uniffi_ddk_ffi_checksum_func_sign_cet'
|
|
2517
|
-
);
|
|
2518
|
-
}
|
|
2519
|
-
if (
|
|
2520
|
-
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_sign_fund_transaction_input() !==
|
|
2521
|
-
50531
|
|
2522
|
-
) {
|
|
2523
|
-
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2524
|
-
'uniffi_ddk_ffi_checksum_func_sign_fund_transaction_input'
|
|
2525
|
-
);
|
|
2526
|
-
}
|
|
2527
|
-
if (
|
|
2528
|
-
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_sign_multi_sig_input() !==
|
|
2529
|
-
14569
|
|
2530
|
-
) {
|
|
2531
|
-
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2532
|
-
'uniffi_ddk_ffi_checksum_func_sign_multi_sig_input'
|
|
2533
|
-
);
|
|
2534
|
-
}
|
|
2535
|
-
if (
|
|
2536
|
-
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_verify_cet_adaptor_sig_from_oracle_info() !==
|
|
2537
|
-
52232
|
|
2538
|
-
) {
|
|
2539
|
-
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2540
|
-
'uniffi_ddk_ffi_checksum_func_verify_cet_adaptor_sig_from_oracle_info'
|
|
2541
|
-
);
|
|
2542
|
-
}
|
|
2543
|
-
if (
|
|
2544
|
-
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_verify_cet_adaptor_sigs_from_oracle_info() !==
|
|
2545
|
-
14181
|
|
2546
|
-
) {
|
|
2547
|
-
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2548
|
-
'uniffi_ddk_ffi_checksum_func_verify_cet_adaptor_sigs_from_oracle_info'
|
|
2549
|
-
);
|
|
2550
|
-
}
|
|
2551
|
-
if (
|
|
2552
|
-
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_verify_fund_tx_signature() !==
|
|
2553
|
-
27316
|
|
2554
|
-
) {
|
|
2555
|
-
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2556
|
-
'uniffi_ddk_ffi_checksum_func_verify_fund_tx_signature'
|
|
2557
|
-
);
|
|
2558
|
-
}
|
|
2559
|
-
if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_version() !== 22317) {
|
|
2560
|
-
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2561
|
-
'uniffi_ddk_ffi_checksum_func_version'
|
|
2562
|
-
);
|
|
2563
|
-
}
|
|
2564
|
-
}
|
|
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
|
+
}
|
|
2565
2135
|
|
|
2566
2136
|
export default Object.freeze({
|
|
2567
2137
|
initialize: uniffiEnsureInitialized,
|
|
@@ -2580,5 +2150,5 @@ export default Object.freeze({
|
|
|
2580
2150
|
FfiConverterTypeTxInput,
|
|
2581
2151
|
FfiConverterTypeTxInputInfo,
|
|
2582
2152
|
FfiConverterTypeTxOutput,
|
|
2583
|
-
}
|
|
2584
|
-
});
|
|
2153
|
+
}
|
|
2154
|
+
});
|