@bennyblader/ddk-rn 0.3.35 → 0.3.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/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 './ddk_ffi-ffi';
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 !== 'object' ||
57
+ typeof process !== "object" ||
59
58
  // @ts-ignore -- The process global might not be defined
60
- process?.env?.NODE_ENV !== 'production' ||
59
+ process?.env?.NODE_ENV !== "production" ||
61
60
  true;
62
61
  // Public interface members begin here.
63
62
 
64
- export function addSignatureToTransaction(
65
- tx: Transaction,
66
- signature: Array</*u8*/ number>,
67
- pubkey: Array</*u8*/ number>,
68
- inputIndex: /*u32*/ number
69
- ): Transaction /*throws*/ {
70
- return FfiConverterTypeTransaction.lift(
71
- uniffiCaller.rustCallWithError(
72
- /*liftError:*/ FfiConverterTypeDLCError.lift.bind(
73
- FfiConverterTypeDLCError
74
- ),
75
- /*caller:*/ (callStatus) => {
76
- return (() => {
77
- console.debug(
78
- `-- uniffi_ddk_ffi_fn_func_add_signature_to_transaction`
79
- );
80
- return nativeModule()
81
- .ubrn_uniffi_ddk_ffi_fn_func_add_signature_to_transaction;
82
- })()(
83
- FfiConverterTypeTransaction.lower(tx),
84
- FfiConverterArrayUInt8.lower(signature),
85
- FfiConverterArrayUInt8.lower(pubkey),
86
- FfiConverterUInt32.lower(inputIndex),
87
- callStatus
88
- );
89
- },
90
- /*liftString:*/ FfiConverterString.lift
91
- )
92
- );
93
- }
94
- export function convertMnemonicToSeed(
95
- mnemonic: string,
96
- passphrase: string | undefined
97
- ): Array</*u8*/ number> /*throws*/ {
98
- return FfiConverterArrayUInt8.lift(
99
- uniffiCaller.rustCallWithError(
100
- /*liftError:*/ FfiConverterTypeDLCError.lift.bind(
101
- FfiConverterTypeDLCError
102
- ),
103
- /*caller:*/ (callStatus) => {
104
- return (() => {
105
- console.debug(`-- uniffi_ddk_ffi_fn_func_convert_mnemonic_to_seed`);
106
- return nativeModule()
107
- .ubrn_uniffi_ddk_ffi_fn_func_convert_mnemonic_to_seed;
108
- })()(
109
- FfiConverterString.lower(mnemonic),
110
- FfiConverterOptionalString.lower(passphrase),
111
- callStatus
112
- );
113
- },
114
- /*liftString:*/ FfiConverterString.lift
115
- )
116
- );
117
- }
118
- export function createCet(
119
- localOutput: TxOutput,
120
- localPayoutSerialId: /*u64*/ bigint,
121
- remoteOutput: TxOutput,
122
- remotePayoutSerialId: /*u64*/ bigint,
123
- fundTxId: string,
124
- fundVout: /*u32*/ number,
125
- lockTime: /*u32*/ number
126
- ): Transaction /*throws*/ {
127
- return FfiConverterTypeTransaction.lift(
128
- uniffiCaller.rustCallWithError(
129
- /*liftError:*/ FfiConverterTypeDLCError.lift.bind(
130
- FfiConverterTypeDLCError
131
- ),
132
- /*caller:*/ (callStatus) => {
133
- return (() => {
134
- console.debug(`-- uniffi_ddk_ffi_fn_func_create_cet`);
135
- return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_create_cet;
136
- })()(
137
- FfiConverterTypeTxOutput.lower(localOutput),
138
- FfiConverterUInt64.lower(localPayoutSerialId),
139
- FfiConverterTypeTxOutput.lower(remoteOutput),
140
- FfiConverterUInt64.lower(remotePayoutSerialId),
141
- FfiConverterString.lower(fundTxId),
142
- FfiConverterUInt32.lower(fundVout),
143
- FfiConverterUInt32.lower(lockTime),
144
- callStatus
145
- );
146
- },
147
- /*liftString:*/ FfiConverterString.lift
148
- )
149
- );
150
- }
151
- export function createCetAdaptorPointsFromOracleInfo(
152
- oracleInfo: Array<OracleInfo>,
153
- msgs: Array<Array<Array<Array</*u8*/ number>>>>
154
- ): Array<Array</*u8*/ number>> /*throws*/ {
155
- return FfiConverterArrayArrayUInt8.lift(
156
- uniffiCaller.rustCallWithError(
157
- /*liftError:*/ FfiConverterTypeDLCError.lift.bind(
158
- FfiConverterTypeDLCError
159
- ),
160
- /*caller:*/ (callStatus) => {
161
- return (() => {
162
- console.debug(
163
- `-- uniffi_ddk_ffi_fn_func_create_cet_adaptor_points_from_oracle_info`
164
- );
165
- return nativeModule()
166
- .ubrn_uniffi_ddk_ffi_fn_func_create_cet_adaptor_points_from_oracle_info;
167
- })()(
168
- FfiConverterArrayTypeOracleInfo.lower(oracleInfo),
169
- FfiConverterArrayArrayArrayArrayUInt8.lower(msgs),
170
- callStatus
171
- );
172
- },
173
- /*liftString:*/ FfiConverterString.lift
174
- )
175
- );
176
- }
177
- export function createCetAdaptorSignatureFromOracleInfo(
178
- cet: Transaction,
179
- oracleInfo: OracleInfo,
180
- fundingSk: Array</*u8*/ number>,
181
- fundingScriptPubkey: Array</*u8*/ number>,
182
- totalCollateral: /*u64*/ bigint,
183
- msgs: Array<Array</*u8*/ number>>
184
- ): AdaptorSignature /*throws*/ {
185
- return FfiConverterTypeAdaptorSignature.lift(
186
- uniffiCaller.rustCallWithError(
187
- /*liftError:*/ FfiConverterTypeDLCError.lift.bind(
188
- FfiConverterTypeDLCError
189
- ),
190
- /*caller:*/ (callStatus) => {
191
- return (() => {
192
- console.debug(
193
- `-- uniffi_ddk_ffi_fn_func_create_cet_adaptor_signature_from_oracle_info`
194
- );
195
- return nativeModule()
196
- .ubrn_uniffi_ddk_ffi_fn_func_create_cet_adaptor_signature_from_oracle_info;
197
- })()(
198
- FfiConverterTypeTransaction.lower(cet),
199
- FfiConverterTypeOracleInfo.lower(oracleInfo),
200
- FfiConverterArrayUInt8.lower(fundingSk),
201
- FfiConverterArrayUInt8.lower(fundingScriptPubkey),
202
- FfiConverterUInt64.lower(totalCollateral),
203
- FfiConverterArrayArrayUInt8.lower(msgs),
204
- callStatus
205
- );
206
- },
207
- /*liftString:*/ FfiConverterString.lift
208
- )
209
- );
210
- }
211
- export function createCetAdaptorSigsFromOracleInfo(
212
- cets: Array<Transaction>,
213
- oracleInfo: Array<OracleInfo>,
214
- fundingSecretKey: Array</*u8*/ number>,
215
- fundingScriptPubkey: Array</*u8*/ number>,
216
- fundOutputValue: /*u64*/ bigint,
217
- msgs: Array<Array<Array<Array</*u8*/ number>>>>
218
- ): Array<AdaptorSignature> /*throws*/ {
219
- return FfiConverterArrayTypeAdaptorSignature.lift(
220
- uniffiCaller.rustCallWithError(
221
- /*liftError:*/ FfiConverterTypeDLCError.lift.bind(
222
- FfiConverterTypeDLCError
223
- ),
224
- /*caller:*/ (callStatus) => {
225
- return (() => {
226
- console.debug(
227
- `-- uniffi_ddk_ffi_fn_func_create_cet_adaptor_sigs_from_oracle_info`
228
- );
229
- return nativeModule()
230
- .ubrn_uniffi_ddk_ffi_fn_func_create_cet_adaptor_sigs_from_oracle_info;
231
- })()(
232
- FfiConverterArrayTypeTransaction.lower(cets),
233
- FfiConverterArrayTypeOracleInfo.lower(oracleInfo),
234
- FfiConverterArrayUInt8.lower(fundingSecretKey),
235
- FfiConverterArrayUInt8.lower(fundingScriptPubkey),
236
- FfiConverterUInt64.lower(fundOutputValue),
237
- FfiConverterArrayArrayArrayArrayUInt8.lower(msgs),
238
- callStatus
239
- );
240
- },
241
- /*liftString:*/ FfiConverterString.lift
242
- )
243
- );
244
- }
245
- export function createCetAdaptorSigsFromPoints(
246
- cets: Array<Transaction>,
247
- adaptorPoints: Array<Array</*u8*/ number>>,
248
- fundingSecretKey: Array</*u8*/ number>,
249
- fundingScriptPubkey: Array</*u8*/ number>,
250
- fundOutputValue: /*u64*/ bigint
251
- ): Array<AdaptorSignature> /*throws*/ {
252
- return FfiConverterArrayTypeAdaptorSignature.lift(
253
- uniffiCaller.rustCallWithError(
254
- /*liftError:*/ FfiConverterTypeDLCError.lift.bind(
255
- FfiConverterTypeDLCError
256
- ),
257
- /*caller:*/ (callStatus) => {
258
- return (() => {
259
- console.debug(
260
- `-- uniffi_ddk_ffi_fn_func_create_cet_adaptor_sigs_from_points`
261
- );
262
- return nativeModule()
263
- .ubrn_uniffi_ddk_ffi_fn_func_create_cet_adaptor_sigs_from_points;
264
- })()(
265
- FfiConverterArrayTypeTransaction.lower(cets),
266
- FfiConverterArrayArrayUInt8.lower(adaptorPoints),
267
- FfiConverterArrayUInt8.lower(fundingSecretKey),
268
- FfiConverterArrayUInt8.lower(fundingScriptPubkey),
269
- FfiConverterUInt64.lower(fundOutputValue),
270
- callStatus
271
- );
272
- },
273
- /*liftString:*/ FfiConverterString.lift
274
- )
275
- );
276
- }
277
- export function createCets(
278
- fundTxId: string,
279
- fundVout: /*u32*/ number,
280
- localFinalScriptPubkey: Array</*u8*/ number>,
281
- remoteFinalScriptPubkey: Array</*u8*/ number>,
282
- outcomes: Array<Payout>,
283
- lockTime: /*u32*/ number,
284
- localSerialId: /*u64*/ bigint,
285
- remoteSerialId: /*u64*/ bigint
286
- ): Array<Transaction> /*throws*/ {
287
- return FfiConverterArrayTypeTransaction.lift(
288
- uniffiCaller.rustCallWithError(
289
- /*liftError:*/ FfiConverterTypeDLCError.lift.bind(
290
- FfiConverterTypeDLCError
291
- ),
292
- /*caller:*/ (callStatus) => {
293
- return (() => {
294
- console.debug(`-- uniffi_ddk_ffi_fn_func_create_cets`);
295
- return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_create_cets;
296
- })()(
297
- FfiConverterString.lower(fundTxId),
298
- FfiConverterUInt32.lower(fundVout),
299
- FfiConverterArrayUInt8.lower(localFinalScriptPubkey),
300
- FfiConverterArrayUInt8.lower(remoteFinalScriptPubkey),
301
- FfiConverterArrayTypePayout.lower(outcomes),
302
- FfiConverterUInt32.lower(lockTime),
303
- FfiConverterUInt64.lower(localSerialId),
304
- FfiConverterUInt64.lower(remoteSerialId),
305
- callStatus
306
- );
307
- },
308
- /*liftString:*/ FfiConverterString.lift
309
- )
310
- );
311
- }
312
- export function createDlcTransactions(
313
- outcomes: Array<Payout>,
314
- localParams: PartyParams,
315
- remoteParams: PartyParams,
316
- refundLocktime: /*u32*/ number,
317
- feeRate: /*u64*/ bigint,
318
- fundLockTime: /*u32*/ number,
319
- cetLockTime: /*u32*/ number,
320
- fundOutputSerialId: /*u64*/ bigint
321
- ): DlcTransactions /*throws*/ {
322
- return FfiConverterTypeDlcTransactions.lift(
323
- uniffiCaller.rustCallWithError(
324
- /*liftError:*/ FfiConverterTypeDLCError.lift.bind(
325
- FfiConverterTypeDLCError
326
- ),
327
- /*caller:*/ (callStatus) => {
328
- return (() => {
329
- console.debug(`-- uniffi_ddk_ffi_fn_func_create_dlc_transactions`);
330
- return nativeModule()
331
- .ubrn_uniffi_ddk_ffi_fn_func_create_dlc_transactions;
332
- })()(
333
- FfiConverterArrayTypePayout.lower(outcomes),
334
- FfiConverterTypePartyParams.lower(localParams),
335
- FfiConverterTypePartyParams.lower(remoteParams),
336
- FfiConverterUInt32.lower(refundLocktime),
337
- FfiConverterUInt64.lower(feeRate),
338
- FfiConverterUInt32.lower(fundLockTime),
339
- FfiConverterUInt32.lower(cetLockTime),
340
- FfiConverterUInt64.lower(fundOutputSerialId),
341
- callStatus
342
- );
343
- },
344
- /*liftString:*/ FfiConverterString.lift
345
- )
346
- );
347
- }
348
- export function createExtkeyFromParentPath(
349
- extkey: Array</*u8*/ number>,
350
- path: string
351
- ): Array</*u8*/ number> /*throws*/ {
352
- return FfiConverterArrayUInt8.lift(
353
- uniffiCaller.rustCallWithError(
354
- /*liftError:*/ FfiConverterTypeDLCError.lift.bind(
355
- FfiConverterTypeDLCError
356
- ),
357
- /*caller:*/ (callStatus) => {
358
- return (() => {
359
- console.debug(
360
- `-- uniffi_ddk_ffi_fn_func_create_extkey_from_parent_path`
361
- );
362
- return nativeModule()
363
- .ubrn_uniffi_ddk_ffi_fn_func_create_extkey_from_parent_path;
364
- })()(
365
- FfiConverterArrayUInt8.lower(extkey),
366
- FfiConverterString.lower(path),
367
- callStatus
368
- );
369
- },
370
- /*liftString:*/ FfiConverterString.lift
371
- )
372
- );
373
- }
374
- export function createExtkeyFromSeed(
375
- seed: Array</*u8*/ number>,
376
- network: string
377
- ): Array</*u8*/ number> /*throws*/ {
378
- return FfiConverterArrayUInt8.lift(
379
- uniffiCaller.rustCallWithError(
380
- /*liftError:*/ FfiConverterTypeDLCError.lift.bind(
381
- FfiConverterTypeDLCError
382
- ),
383
- /*caller:*/ (callStatus) => {
384
- return (() => {
385
- console.debug(`-- uniffi_ddk_ffi_fn_func_create_extkey_from_seed`);
386
- return nativeModule()
387
- .ubrn_uniffi_ddk_ffi_fn_func_create_extkey_from_seed;
388
- })()(
389
- FfiConverterArrayUInt8.lower(seed),
390
- FfiConverterString.lower(network),
391
- callStatus
392
- );
393
- },
394
- /*liftString:*/ FfiConverterString.lift
395
- )
396
- );
397
- }
398
- export function createFundTxLockingScript(
399
- localFundPubkey: Array</*u8*/ number>,
400
- remoteFundPubkey: Array</*u8*/ number>
401
- ): Array</*u8*/ number> /*throws*/ {
402
- return FfiConverterArrayUInt8.lift(
403
- uniffiCaller.rustCallWithError(
404
- /*liftError:*/ FfiConverterTypeDLCError.lift.bind(
405
- FfiConverterTypeDLCError
406
- ),
407
- /*caller:*/ (callStatus) => {
408
- return (() => {
409
- console.debug(
410
- `-- uniffi_ddk_ffi_fn_func_create_fund_tx_locking_script`
411
- );
412
- return nativeModule()
413
- .ubrn_uniffi_ddk_ffi_fn_func_create_fund_tx_locking_script;
414
- })()(
415
- FfiConverterArrayUInt8.lower(localFundPubkey),
416
- FfiConverterArrayUInt8.lower(remoteFundPubkey),
417
- callStatus
418
- );
419
- },
420
- /*liftString:*/ FfiConverterString.lift
421
- )
422
- );
423
- }
424
- export function createRefundTransaction(
425
- localFinalScriptPubkey: Array</*u8*/ number>,
426
- remoteFinalScriptPubkey: Array</*u8*/ number>,
427
- localAmount: /*u64*/ bigint,
428
- remoteAmount: /*u64*/ bigint,
429
- lockTime: /*u32*/ number,
430
- fundTxId: string,
431
- fundVout: /*u32*/ number
432
- ): Transaction /*throws*/ {
433
- return FfiConverterTypeTransaction.lift(
434
- uniffiCaller.rustCallWithError(
435
- /*liftError:*/ FfiConverterTypeDLCError.lift.bind(
436
- FfiConverterTypeDLCError
437
- ),
438
- /*caller:*/ (callStatus) => {
439
- return (() => {
440
- console.debug(`-- uniffi_ddk_ffi_fn_func_create_refund_transaction`);
441
- return nativeModule()
442
- .ubrn_uniffi_ddk_ffi_fn_func_create_refund_transaction;
443
- })()(
444
- FfiConverterArrayUInt8.lower(localFinalScriptPubkey),
445
- FfiConverterArrayUInt8.lower(remoteFinalScriptPubkey),
446
- FfiConverterUInt64.lower(localAmount),
447
- FfiConverterUInt64.lower(remoteAmount),
448
- FfiConverterUInt32.lower(lockTime),
449
- FfiConverterString.lower(fundTxId),
450
- FfiConverterUInt32.lower(fundVout),
451
- callStatus
452
- );
453
- },
454
- /*liftString:*/ FfiConverterString.lift
455
- )
456
- );
457
- }
458
- export function createSplicedDlcTransactions(
459
- outcomes: Array<Payout>,
460
- localParams: PartyParams,
461
- remoteParams: PartyParams,
462
- refundLocktime: /*u32*/ number,
463
- feeRate: /*u64*/ bigint,
464
- fundLockTime: /*u32*/ number,
465
- cetLockTime: /*u32*/ number,
466
- fundOutputSerialId: /*u64*/ bigint
467
- ): DlcTransactions /*throws*/ {
468
- return FfiConverterTypeDlcTransactions.lift(
469
- uniffiCaller.rustCallWithError(
470
- /*liftError:*/ FfiConverterTypeDLCError.lift.bind(
471
- FfiConverterTypeDLCError
472
- ),
473
- /*caller:*/ (callStatus) => {
474
- return (() => {
475
- console.debug(
476
- `-- uniffi_ddk_ffi_fn_func_create_spliced_dlc_transactions`
477
- );
478
- return nativeModule()
479
- .ubrn_uniffi_ddk_ffi_fn_func_create_spliced_dlc_transactions;
480
- })()(
481
- FfiConverterArrayTypePayout.lower(outcomes),
482
- FfiConverterTypePartyParams.lower(localParams),
483
- FfiConverterTypePartyParams.lower(remoteParams),
484
- FfiConverterUInt32.lower(refundLocktime),
485
- FfiConverterUInt64.lower(feeRate),
486
- FfiConverterUInt32.lower(fundLockTime),
487
- FfiConverterUInt32.lower(cetLockTime),
488
- FfiConverterUInt64.lower(fundOutputSerialId),
489
- callStatus
490
- );
491
- },
492
- /*liftString:*/ FfiConverterString.lift
493
- )
494
- );
495
- }
496
- export function createXprivFromParentPath(
497
- seedOrXpriv: Array</*u8*/ number>,
498
- baseDerivationPath: string,
499
- network: string,
500
- path: string
501
- ): Array</*u8*/ number> /*throws*/ {
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
- return FfiConverterBool.lift(
728
- uniffiCaller.rustCall(
729
- /*caller:*/ (callStatus) => {
730
- return (() => {
731
- console.debug(`-- uniffi_ddk_ffi_fn_func_is_dust_output`);
732
- return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_is_dust_output;
733
- })()(FfiConverterTypeTxOutput.lower(output), callStatus);
734
- },
735
- /*liftString:*/ FfiConverterString.lift
736
- )
737
- );
738
- }
739
- export function signCet(
740
- cet: Transaction,
741
- adaptorSignature: Array</*u8*/ number>,
742
- oracleSignatures: Array<Array</*u8*/ number>>,
743
- fundingSecretKey: Array</*u8*/ number>,
744
- otherPubkey: Array</*u8*/ number>,
745
- fundingScriptPubkey: Array</*u8*/ number>,
746
- fundOutputValue: /*u64*/ bigint
747
- ): Transaction /*throws*/ {
748
- return FfiConverterTypeTransaction.lift(
749
- uniffiCaller.rustCallWithError(
750
- /*liftError:*/ FfiConverterTypeDLCError.lift.bind(
751
- FfiConverterTypeDLCError
752
- ),
753
- /*caller:*/ (callStatus) => {
754
- return (() => {
755
- console.debug(`-- uniffi_ddk_ffi_fn_func_sign_cet`);
756
- return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_sign_cet;
757
- })()(
758
- FfiConverterTypeTransaction.lower(cet),
759
- FfiConverterArrayUInt8.lower(adaptorSignature),
760
- FfiConverterArrayArrayUInt8.lower(oracleSignatures),
761
- FfiConverterArrayUInt8.lower(fundingSecretKey),
762
- FfiConverterArrayUInt8.lower(otherPubkey),
763
- FfiConverterArrayUInt8.lower(fundingScriptPubkey),
764
- FfiConverterUInt64.lower(fundOutputValue),
765
- callStatus
766
- );
767
- },
768
- /*liftString:*/ FfiConverterString.lift
769
- )
770
- );
771
- }
772
- export function signFundTransactionInput(
773
- fundTransaction: Transaction,
774
- privkey: Array</*u8*/ number>,
775
- prevTxId: string,
776
- prevTxVout: /*u32*/ number,
777
- value: /*u64*/ bigint
778
- ): Transaction /*throws*/ {
779
- return FfiConverterTypeTransaction.lift(
780
- uniffiCaller.rustCallWithError(
781
- /*liftError:*/ FfiConverterTypeDLCError.lift.bind(
782
- FfiConverterTypeDLCError
783
- ),
784
- /*caller:*/ (callStatus) => {
785
- return (() => {
786
- console.debug(
787
- `-- uniffi_ddk_ffi_fn_func_sign_fund_transaction_input`
788
- );
789
- return nativeModule()
790
- .ubrn_uniffi_ddk_ffi_fn_func_sign_fund_transaction_input;
791
- })()(
792
- FfiConverterTypeTransaction.lower(fundTransaction),
793
- FfiConverterArrayUInt8.lower(privkey),
794
- FfiConverterString.lower(prevTxId),
795
- FfiConverterUInt32.lower(prevTxVout),
796
- FfiConverterUInt64.lower(value),
797
- callStatus
798
- );
799
- },
800
- /*liftString:*/ FfiConverterString.lift
801
- )
802
- );
803
- }
804
- export function signMultiSigInput(
805
- tx: Transaction,
806
- dlcInput: DlcInputInfo,
807
- localPrivkey: Array</*u8*/ number>,
808
- remoteSignature: Array</*u8*/ number>
809
- ): Transaction /*throws*/ {
810
- return FfiConverterTypeTransaction.lift(
811
- uniffiCaller.rustCallWithError(
812
- /*liftError:*/ FfiConverterTypeDLCError.lift.bind(
813
- FfiConverterTypeDLCError
814
- ),
815
- /*caller:*/ (callStatus) => {
816
- return (() => {
817
- console.debug(`-- uniffi_ddk_ffi_fn_func_sign_multi_sig_input`);
818
- return nativeModule()
819
- .ubrn_uniffi_ddk_ffi_fn_func_sign_multi_sig_input;
820
- })()(
821
- FfiConverterTypeTransaction.lower(tx),
822
- FfiConverterTypeDlcInputInfo.lower(dlcInput),
823
- FfiConverterArrayUInt8.lower(localPrivkey),
824
- FfiConverterArrayUInt8.lower(remoteSignature),
825
- callStatus
826
- );
827
- },
828
- /*liftString:*/ FfiConverterString.lift
829
- )
830
- );
831
- }
832
- export function verifyCetAdaptorSigFromOracleInfo(
833
- adaptorSig: AdaptorSignature,
834
- cet: Transaction,
835
- oracleInfo: Array<OracleInfo>,
836
- pubkey: Array</*u8*/ number>,
837
- fundingScriptPubkey: Array</*u8*/ number>,
838
- totalCollateral: /*u64*/ bigint,
839
- msgs: Array<Array<Array</*u8*/ number>>>
840
- ): boolean {
841
- return FfiConverterBool.lift(
842
- uniffiCaller.rustCall(
843
- /*caller:*/ (callStatus) => {
844
- return (() => {
845
- console.debug(
846
- `-- uniffi_ddk_ffi_fn_func_verify_cet_adaptor_sig_from_oracle_info`
847
- );
848
- return nativeModule()
849
- .ubrn_uniffi_ddk_ffi_fn_func_verify_cet_adaptor_sig_from_oracle_info;
850
- })()(
851
- FfiConverterTypeAdaptorSignature.lower(adaptorSig),
852
- FfiConverterTypeTransaction.lower(cet),
853
- FfiConverterArrayTypeOracleInfo.lower(oracleInfo),
854
- FfiConverterArrayUInt8.lower(pubkey),
855
- FfiConverterArrayUInt8.lower(fundingScriptPubkey),
856
- FfiConverterUInt64.lower(totalCollateral),
857
- FfiConverterArrayArrayArrayUInt8.lower(msgs),
858
- callStatus
859
- );
860
- },
861
- /*liftString:*/ FfiConverterString.lift
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
- return FfiConverterString.lift(
932
- uniffiCaller.rustCall(
933
- /*caller:*/ (callStatus) => {
934
- return (() => {
935
- console.debug(`-- uniffi_ddk_ffi_fn_func_version`);
936
- return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_version;
937
- })()(callStatus);
938
- },
939
- /*liftString:*/ FfiConverterString.lift
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
- signature: Array</*u8*/ number>;
946
- proof: Array</*u8*/ number>;
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
- const defaults = () => ({});
954
- const create = (() => {
955
- return uniffiCreateRecord<AdaptorSignature, ReturnType<typeof defaults>>(
956
- defaults
957
- );
958
- })();
959
- return Object.freeze({
960
- /**
961
- * Create a frozen instance of {@link AdaptorSignature}, with defaults specified
962
- * in Rust, in the {@link ddk_ffi} crate.
963
- */
964
- create,
965
-
966
- /**
967
- * Create a frozen instance of {@link AdaptorSignature}, with defaults specified
968
- * in Rust, in the {@link ddk_ffi} crate.
969
- */
970
- new: create,
971
-
972
- /**
973
- * Defaults specified in the {@link ddk_ffi} crate.
974
- */
975
- defaults: () => Object.freeze(defaults()) as Partial<AdaptorSignature>,
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
- type TypeName = AdaptorSignature;
981
- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
982
- read(from: RustBuffer): TypeName {
983
- return {
984
- signature: FfiConverterArrayUInt8.read(from),
985
- proof: FfiConverterArrayUInt8.read(from),
986
- };
987
- }
988
- write(value: TypeName, into: RustBuffer): void {
989
- FfiConverterArrayUInt8.write(value.signature, into);
990
- FfiConverterArrayUInt8.write(value.proof, into);
991
- }
992
- allocationSize(value: TypeName): number {
993
- return (
994
- FfiConverterArrayUInt8.allocationSize(value.signature) +
995
- FfiConverterArrayUInt8.allocationSize(value.proof)
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
- sighash: Array</*u8*/ number>;
1004
- adaptorPoint: Array</*u8*/ number>;
1005
- inputIndex: /*u32*/ number;
1006
- scriptPubkey: Array</*u8*/ number>;
1007
- value: /*u64*/ bigint;
1008
- cetTxid: string;
1009
- cetRaw: Array</*u8*/ number>;
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
- const defaults = () => ({});
1017
- const create = (() => {
1018
- return uniffiCreateRecord<
1019
- CetAdaptorSignatureDebugInfo,
1020
- ReturnType<typeof defaults>
1021
- >(defaults);
1022
- })();
1023
- return Object.freeze({
1024
- /**
1025
- * Create a frozen instance of {@link CetAdaptorSignatureDebugInfo}, with defaults specified
1026
- * in Rust, in the {@link ddk_ffi} crate.
1027
- */
1028
- create,
1029
-
1030
- /**
1031
- * Create a frozen instance of {@link CetAdaptorSignatureDebugInfo}, with defaults specified
1032
- * in Rust, in the {@link ddk_ffi} crate.
1033
- */
1034
- new: create,
1035
-
1036
- /**
1037
- * Defaults specified in the {@link ddk_ffi} crate.
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
- type TypeName = CetAdaptorSignatureDebugInfo;
1046
- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
1047
- read(from: RustBuffer): TypeName {
1048
- return {
1049
- sighash: FfiConverterArrayUInt8.read(from),
1050
- adaptorPoint: FfiConverterArrayUInt8.read(from),
1051
- inputIndex: FfiConverterUInt32.read(from),
1052
- scriptPubkey: FfiConverterArrayUInt8.read(from),
1053
- value: FfiConverterUInt64.read(from),
1054
- cetTxid: FfiConverterString.read(from),
1055
- cetRaw: FfiConverterArrayUInt8.read(from),
1056
- };
1057
- }
1058
- write(value: TypeName, into: RustBuffer): void {
1059
- FfiConverterArrayUInt8.write(value.sighash, into);
1060
- FfiConverterArrayUInt8.write(value.adaptorPoint, into);
1061
- FfiConverterUInt32.write(value.inputIndex, into);
1062
- FfiConverterArrayUInt8.write(value.scriptPubkey, into);
1063
- FfiConverterUInt64.write(value.value, into);
1064
- FfiConverterString.write(value.cetTxid, into);
1065
- FfiConverterArrayUInt8.write(value.cetRaw, into);
1066
- }
1067
- allocationSize(value: TypeName): number {
1068
- return (
1069
- FfiConverterArrayUInt8.allocationSize(value.sighash) +
1070
- FfiConverterArrayUInt8.allocationSize(value.adaptorPoint) +
1071
- FfiConverterUInt32.allocationSize(value.inputIndex) +
1072
- FfiConverterArrayUInt8.allocationSize(value.scriptPubkey) +
1073
- FfiConverterUInt64.allocationSize(value.value) +
1074
- FfiConverterString.allocationSize(value.cetTxid) +
1075
- FfiConverterArrayUInt8.allocationSize(value.cetRaw)
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
- changeOutput: TxOutput;
1084
- fundFee: /*u64*/ bigint;
1085
- cetFee: /*u64*/ bigint;
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
- const defaults = () => ({});
1093
- const create = (() => {
1094
- return uniffiCreateRecord<ChangeOutputAndFees, ReturnType<typeof defaults>>(
1095
- defaults
1096
- );
1097
- })();
1098
- return Object.freeze({
1099
- /**
1100
- * Create a frozen instance of {@link ChangeOutputAndFees}, with defaults specified
1101
- * in Rust, in the {@link ddk_ffi} crate.
1102
- */
1103
- create,
1104
-
1105
- /**
1106
- * Create a frozen instance of {@link ChangeOutputAndFees}, with defaults specified
1107
- * in Rust, in the {@link ddk_ffi} crate.
1108
- */
1109
- new: create,
1110
-
1111
- /**
1112
- * Defaults specified in the {@link ddk_ffi} crate.
1113
- */
1114
- defaults: () => Object.freeze(defaults()) as Partial<ChangeOutputAndFees>,
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
- type TypeName = ChangeOutputAndFees;
1120
- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
1121
- read(from: RustBuffer): TypeName {
1122
- return {
1123
- changeOutput: FfiConverterTypeTxOutput.read(from),
1124
- fundFee: FfiConverterUInt64.read(from),
1125
- cetFee: FfiConverterUInt64.read(from),
1126
- };
1127
- }
1128
- write(value: TypeName, into: RustBuffer): void {
1129
- FfiConverterTypeTxOutput.write(value.changeOutput, into);
1130
- FfiConverterUInt64.write(value.fundFee, into);
1131
- FfiConverterUInt64.write(value.cetFee, into);
1132
- }
1133
- allocationSize(value: TypeName): number {
1134
- return (
1135
- FfiConverterTypeTxOutput.allocationSize(value.changeOutput) +
1136
- FfiConverterUInt64.allocationSize(value.fundFee) +
1137
- FfiConverterUInt64.allocationSize(value.cetFee)
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
- fundTx: Transaction;
1146
- fundVout: /*u32*/ number;
1147
- localFundPubkey: Array</*u8*/ number>;
1148
- remoteFundPubkey: Array</*u8*/ number>;
1149
- fundAmount: /*u64*/ bigint;
1150
- maxWitnessLen: /*u32*/ number;
1151
- inputSerialId: /*u64*/ bigint;
1152
- contractId: Array</*u8*/ number>;
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
- const defaults = () => ({});
1160
- const create = (() => {
1161
- return uniffiCreateRecord<DlcInputInfo, ReturnType<typeof defaults>>(
1162
- defaults
1163
- );
1164
- })();
1165
- return Object.freeze({
1166
- /**
1167
- * Create a frozen instance of {@link DlcInputInfo}, with defaults specified
1168
- * in Rust, in the {@link ddk_ffi} crate.
1169
- */
1170
- create,
1171
-
1172
- /**
1173
- * Create a frozen instance of {@link DlcInputInfo}, with defaults specified
1174
- * in Rust, in the {@link ddk_ffi} crate.
1175
- */
1176
- new: create,
1177
-
1178
- /**
1179
- * Defaults specified in the {@link ddk_ffi} crate.
1180
- */
1181
- defaults: () => Object.freeze(defaults()) as Partial<DlcInputInfo>,
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
- type TypeName = DlcInputInfo;
1187
- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
1188
- read(from: RustBuffer): TypeName {
1189
- return {
1190
- fundTx: FfiConverterTypeTransaction.read(from),
1191
- fundVout: FfiConverterUInt32.read(from),
1192
- localFundPubkey: FfiConverterArrayUInt8.read(from),
1193
- remoteFundPubkey: FfiConverterArrayUInt8.read(from),
1194
- fundAmount: FfiConverterUInt64.read(from),
1195
- maxWitnessLen: FfiConverterUInt32.read(from),
1196
- inputSerialId: FfiConverterUInt64.read(from),
1197
- contractId: FfiConverterArrayUInt8.read(from),
1198
- };
1199
- }
1200
- write(value: TypeName, into: RustBuffer): void {
1201
- FfiConverterTypeTransaction.write(value.fundTx, into);
1202
- FfiConverterUInt32.write(value.fundVout, into);
1203
- FfiConverterArrayUInt8.write(value.localFundPubkey, into);
1204
- FfiConverterArrayUInt8.write(value.remoteFundPubkey, into);
1205
- FfiConverterUInt64.write(value.fundAmount, into);
1206
- FfiConverterUInt32.write(value.maxWitnessLen, into);
1207
- FfiConverterUInt64.write(value.inputSerialId, into);
1208
- FfiConverterArrayUInt8.write(value.contractId, into);
1209
- }
1210
- allocationSize(value: TypeName): number {
1211
- return (
1212
- FfiConverterTypeTransaction.allocationSize(value.fundTx) +
1213
- FfiConverterUInt32.allocationSize(value.fundVout) +
1214
- FfiConverterArrayUInt8.allocationSize(value.localFundPubkey) +
1215
- FfiConverterArrayUInt8.allocationSize(value.remoteFundPubkey) +
1216
- FfiConverterUInt64.allocationSize(value.fundAmount) +
1217
- FfiConverterUInt32.allocationSize(value.maxWitnessLen) +
1218
- FfiConverterUInt64.allocationSize(value.inputSerialId) +
1219
- FfiConverterArrayUInt8.allocationSize(value.contractId)
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
- fund: Transaction;
1228
- cets: Array<Transaction>;
1229
- refund: Transaction;
1230
- fundingScriptPubkey: Array</*u8*/ number>;
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
- const defaults = () => ({});
1238
- const create = (() => {
1239
- return uniffiCreateRecord<DlcTransactions, ReturnType<typeof defaults>>(
1240
- defaults
1241
- );
1242
- })();
1243
- return Object.freeze({
1244
- /**
1245
- * Create a frozen instance of {@link DlcTransactions}, with defaults specified
1246
- * in Rust, in the {@link ddk_ffi} crate.
1247
- */
1248
- create,
1249
-
1250
- /**
1251
- * Create a frozen instance of {@link DlcTransactions}, with defaults specified
1252
- * in Rust, in the {@link ddk_ffi} crate.
1253
- */
1254
- new: create,
1255
-
1256
- /**
1257
- * Defaults specified in the {@link ddk_ffi} crate.
1258
- */
1259
- defaults: () => Object.freeze(defaults()) as Partial<DlcTransactions>,
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
- type TypeName = DlcTransactions;
1265
- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
1266
- read(from: RustBuffer): TypeName {
1267
- return {
1268
- fund: FfiConverterTypeTransaction.read(from),
1269
- cets: FfiConverterArrayTypeTransaction.read(from),
1270
- refund: FfiConverterTypeTransaction.read(from),
1271
- fundingScriptPubkey: FfiConverterArrayUInt8.read(from),
1272
- };
1273
- }
1274
- write(value: TypeName, into: RustBuffer): void {
1275
- FfiConverterTypeTransaction.write(value.fund, into);
1276
- FfiConverterArrayTypeTransaction.write(value.cets, into);
1277
- FfiConverterTypeTransaction.write(value.refund, into);
1278
- FfiConverterArrayUInt8.write(value.fundingScriptPubkey, into);
1279
- }
1280
- allocationSize(value: TypeName): number {
1281
- return (
1282
- FfiConverterTypeTransaction.allocationSize(value.fund) +
1283
- FfiConverterArrayTypeTransaction.allocationSize(value.cets) +
1284
- FfiConverterTypeTransaction.allocationSize(value.refund) +
1285
- FfiConverterArrayUInt8.allocationSize(value.fundingScriptPubkey)
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
- publicKey: Array</*u8*/ number>;
1294
- nonces: Array<Array</*u8*/ number>>;
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
- const defaults = () => ({});
1302
- const create = (() => {
1303
- return uniffiCreateRecord<OracleInfo, ReturnType<typeof defaults>>(
1304
- defaults
1305
- );
1306
- })();
1307
- return Object.freeze({
1308
- /**
1309
- * Create a frozen instance of {@link OracleInfo}, with defaults specified
1310
- * in Rust, in the {@link ddk_ffi} crate.
1311
- */
1312
- create,
1313
-
1314
- /**
1315
- * Create a frozen instance of {@link OracleInfo}, with defaults specified
1316
- * in Rust, in the {@link ddk_ffi} crate.
1317
- */
1318
- new: create,
1319
-
1320
- /**
1321
- * Defaults specified in the {@link ddk_ffi} crate.
1322
- */
1323
- defaults: () => Object.freeze(defaults()) as Partial<OracleInfo>,
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
- type TypeName = OracleInfo;
1329
- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
1330
- read(from: RustBuffer): TypeName {
1331
- return {
1332
- publicKey: FfiConverterArrayUInt8.read(from),
1333
- nonces: FfiConverterArrayArrayUInt8.read(from),
1334
- };
1335
- }
1336
- write(value: TypeName, into: RustBuffer): void {
1337
- FfiConverterArrayUInt8.write(value.publicKey, into);
1338
- FfiConverterArrayArrayUInt8.write(value.nonces, into);
1339
- }
1340
- allocationSize(value: TypeName): number {
1341
- return (
1342
- FfiConverterArrayUInt8.allocationSize(value.publicKey) +
1343
- FfiConverterArrayArrayUInt8.allocationSize(value.nonces)
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
- fundPubkey: Array</*u8*/ number>;
1352
- changeScriptPubkey: Array</*u8*/ number>;
1353
- changeSerialId: /*u64*/ bigint;
1354
- payoutScriptPubkey: Array</*u8*/ number>;
1355
- payoutSerialId: /*u64*/ bigint;
1356
- inputs: Array<TxInputInfo>;
1357
- inputAmount: /*u64*/ bigint;
1358
- collateral: /*u64*/ bigint;
1359
- dlcInputs: Array<DlcInputInfo>;
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
- const defaults = () => ({});
1367
- const create = (() => {
1368
- return uniffiCreateRecord<PartyParams, ReturnType<typeof defaults>>(
1369
- defaults
1370
- );
1371
- })();
1372
- return Object.freeze({
1373
- /**
1374
- * Create a frozen instance of {@link PartyParams}, with defaults specified
1375
- * in Rust, in the {@link ddk_ffi} crate.
1376
- */
1377
- create,
1378
-
1379
- /**
1380
- * Create a frozen instance of {@link PartyParams}, with defaults specified
1381
- * in Rust, in the {@link ddk_ffi} crate.
1382
- */
1383
- new: create,
1384
-
1385
- /**
1386
- * Defaults specified in the {@link ddk_ffi} crate.
1387
- */
1388
- defaults: () => Object.freeze(defaults()) as Partial<PartyParams>,
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
- type TypeName = PartyParams;
1394
- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
1395
- read(from: RustBuffer): TypeName {
1396
- return {
1397
- fundPubkey: FfiConverterArrayUInt8.read(from),
1398
- changeScriptPubkey: FfiConverterArrayUInt8.read(from),
1399
- changeSerialId: FfiConverterUInt64.read(from),
1400
- payoutScriptPubkey: FfiConverterArrayUInt8.read(from),
1401
- payoutSerialId: FfiConverterUInt64.read(from),
1402
- inputs: FfiConverterArrayTypeTxInputInfo.read(from),
1403
- inputAmount: FfiConverterUInt64.read(from),
1404
- collateral: FfiConverterUInt64.read(from),
1405
- dlcInputs: FfiConverterArrayTypeDlcInputInfo.read(from),
1406
- };
1407
- }
1408
- write(value: TypeName, into: RustBuffer): void {
1409
- FfiConverterArrayUInt8.write(value.fundPubkey, into);
1410
- FfiConverterArrayUInt8.write(value.changeScriptPubkey, into);
1411
- FfiConverterUInt64.write(value.changeSerialId, into);
1412
- FfiConverterArrayUInt8.write(value.payoutScriptPubkey, into);
1413
- FfiConverterUInt64.write(value.payoutSerialId, into);
1414
- FfiConverterArrayTypeTxInputInfo.write(value.inputs, into);
1415
- FfiConverterUInt64.write(value.inputAmount, into);
1416
- FfiConverterUInt64.write(value.collateral, into);
1417
- FfiConverterArrayTypeDlcInputInfo.write(value.dlcInputs, into);
1418
- }
1419
- allocationSize(value: TypeName): number {
1420
- return (
1421
- FfiConverterArrayUInt8.allocationSize(value.fundPubkey) +
1422
- FfiConverterArrayUInt8.allocationSize(value.changeScriptPubkey) +
1423
- FfiConverterUInt64.allocationSize(value.changeSerialId) +
1424
- FfiConverterArrayUInt8.allocationSize(value.payoutScriptPubkey) +
1425
- FfiConverterUInt64.allocationSize(value.payoutSerialId) +
1426
- FfiConverterArrayTypeTxInputInfo.allocationSize(value.inputs) +
1427
- FfiConverterUInt64.allocationSize(value.inputAmount) +
1428
- FfiConverterUInt64.allocationSize(value.collateral) +
1429
- FfiConverterArrayTypeDlcInputInfo.allocationSize(value.dlcInputs)
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
- offer: /*u64*/ bigint;
1438
- accept: /*u64*/ bigint;
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
- const defaults = () => ({});
1446
- const create = (() => {
1447
- return uniffiCreateRecord<Payout, ReturnType<typeof defaults>>(defaults);
1448
- })();
1449
- return Object.freeze({
1450
- /**
1451
- * Create a frozen instance of {@link Payout}, with defaults specified
1452
- * in Rust, in the {@link ddk_ffi} crate.
1453
- */
1454
- create,
1455
-
1456
- /**
1457
- * Create a frozen instance of {@link Payout}, with defaults specified
1458
- * in Rust, in the {@link ddk_ffi} crate.
1459
- */
1460
- new: create,
1461
-
1462
- /**
1463
- * Defaults specified in the {@link ddk_ffi} crate.
1464
- */
1465
- defaults: () => Object.freeze(defaults()) as Partial<Payout>,
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
- type TypeName = Payout;
1471
- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
1472
- read(from: RustBuffer): TypeName {
1473
- return {
1474
- offer: FfiConverterUInt64.read(from),
1475
- accept: FfiConverterUInt64.read(from),
1476
- };
1477
- }
1478
- write(value: TypeName, into: RustBuffer): void {
1479
- FfiConverterUInt64.write(value.offer, into);
1480
- FfiConverterUInt64.write(value.accept, into);
1481
- }
1482
- allocationSize(value: TypeName): number {
1483
- return (
1484
- FfiConverterUInt64.allocationSize(value.offer) +
1485
- FfiConverterUInt64.allocationSize(value.accept)
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
- version: /*i32*/ number;
1494
- lockTime: /*u32*/ number;
1495
- inputs: Array<TxInput>;
1496
- outputs: Array<TxOutput>;
1497
- rawBytes: Array</*u8*/ number>;
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
- const defaults = () => ({});
1505
- const create = (() => {
1506
- return uniffiCreateRecord<Transaction, ReturnType<typeof defaults>>(
1507
- defaults
1508
- );
1509
- })();
1510
- return Object.freeze({
1511
- /**
1512
- * Create a frozen instance of {@link Transaction}, with defaults specified
1513
- * in Rust, in the {@link ddk_ffi} crate.
1514
- */
1515
- create,
1516
-
1517
- /**
1518
- * Create a frozen instance of {@link Transaction}, with defaults specified
1519
- * in Rust, in the {@link ddk_ffi} crate.
1520
- */
1521
- new: create,
1522
-
1523
- /**
1524
- * Defaults specified in the {@link ddk_ffi} crate.
1525
- */
1526
- defaults: () => Object.freeze(defaults()) as Partial<Transaction>,
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
- type TypeName = Transaction;
1532
- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
1533
- read(from: RustBuffer): TypeName {
1534
- return {
1535
- version: FfiConverterInt32.read(from),
1536
- lockTime: FfiConverterUInt32.read(from),
1537
- inputs: FfiConverterArrayTypeTxInput.read(from),
1538
- outputs: FfiConverterArrayTypeTxOutput.read(from),
1539
- rawBytes: FfiConverterArrayUInt8.read(from),
1540
- };
1541
- }
1542
- write(value: TypeName, into: RustBuffer): void {
1543
- FfiConverterInt32.write(value.version, into);
1544
- FfiConverterUInt32.write(value.lockTime, into);
1545
- FfiConverterArrayTypeTxInput.write(value.inputs, into);
1546
- FfiConverterArrayTypeTxOutput.write(value.outputs, into);
1547
- FfiConverterArrayUInt8.write(value.rawBytes, into);
1548
- }
1549
- allocationSize(value: TypeName): number {
1550
- return (
1551
- FfiConverterInt32.allocationSize(value.version) +
1552
- FfiConverterUInt32.allocationSize(value.lockTime) +
1553
- FfiConverterArrayTypeTxInput.allocationSize(value.inputs) +
1554
- FfiConverterArrayTypeTxOutput.allocationSize(value.outputs) +
1555
- FfiConverterArrayUInt8.allocationSize(value.rawBytes)
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
- txid: string;
1564
- vout: /*u32*/ number;
1565
- scriptSig: Array</*u8*/ number>;
1566
- sequence: /*u32*/ number;
1567
- witness: Array<Array</*u8*/ number>>;
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
- const defaults = () => ({});
1575
- const create = (() => {
1576
- return uniffiCreateRecord<TxInput, ReturnType<typeof defaults>>(defaults);
1577
- })();
1578
- return Object.freeze({
1579
- /**
1580
- * Create a frozen instance of {@link TxInput}, with defaults specified
1581
- * in Rust, in the {@link ddk_ffi} crate.
1582
- */
1583
- create,
1584
-
1585
- /**
1586
- * Create a frozen instance of {@link TxInput}, with defaults specified
1587
- * in Rust, in the {@link ddk_ffi} crate.
1588
- */
1589
- new: create,
1590
-
1591
- /**
1592
- * Defaults specified in the {@link ddk_ffi} crate.
1593
- */
1594
- defaults: () => Object.freeze(defaults()) as Partial<TxInput>,
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
- type TypeName = TxInput;
1600
- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
1601
- read(from: RustBuffer): TypeName {
1602
- return {
1603
- txid: FfiConverterString.read(from),
1604
- vout: FfiConverterUInt32.read(from),
1605
- scriptSig: FfiConverterArrayUInt8.read(from),
1606
- sequence: FfiConverterUInt32.read(from),
1607
- witness: FfiConverterArrayArrayUInt8.read(from),
1608
- };
1609
- }
1610
- write(value: TypeName, into: RustBuffer): void {
1611
- FfiConverterString.write(value.txid, into);
1612
- FfiConverterUInt32.write(value.vout, into);
1613
- FfiConverterArrayUInt8.write(value.scriptSig, into);
1614
- FfiConverterUInt32.write(value.sequence, into);
1615
- FfiConverterArrayArrayUInt8.write(value.witness, into);
1616
- }
1617
- allocationSize(value: TypeName): number {
1618
- return (
1619
- FfiConverterString.allocationSize(value.txid) +
1620
- FfiConverterUInt32.allocationSize(value.vout) +
1621
- FfiConverterArrayUInt8.allocationSize(value.scriptSig) +
1622
- FfiConverterUInt32.allocationSize(value.sequence) +
1623
- FfiConverterArrayArrayUInt8.allocationSize(value.witness)
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
- txid: string;
1632
- vout: /*u32*/ number;
1633
- scriptSig: Array</*u8*/ number>;
1634
- maxWitnessLength: /*u32*/ number;
1635
- serialId: /*u64*/ bigint;
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
- const defaults = () => ({});
1643
- const create = (() => {
1644
- return uniffiCreateRecord<TxInputInfo, ReturnType<typeof defaults>>(
1645
- defaults
1646
- );
1647
- })();
1648
- return Object.freeze({
1649
- /**
1650
- * Create a frozen instance of {@link TxInputInfo}, with defaults specified
1651
- * in Rust, in the {@link ddk_ffi} crate.
1652
- */
1653
- create,
1654
-
1655
- /**
1656
- * Create a frozen instance of {@link TxInputInfo}, with defaults specified
1657
- * in Rust, in the {@link ddk_ffi} crate.
1658
- */
1659
- new: create,
1660
-
1661
- /**
1662
- * Defaults specified in the {@link ddk_ffi} crate.
1663
- */
1664
- defaults: () => Object.freeze(defaults()) as Partial<TxInputInfo>,
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
- type TypeName = TxInputInfo;
1670
- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
1671
- read(from: RustBuffer): TypeName {
1672
- return {
1673
- txid: FfiConverterString.read(from),
1674
- vout: FfiConverterUInt32.read(from),
1675
- scriptSig: FfiConverterArrayUInt8.read(from),
1676
- maxWitnessLength: FfiConverterUInt32.read(from),
1677
- serialId: FfiConverterUInt64.read(from),
1678
- };
1679
- }
1680
- write(value: TypeName, into: RustBuffer): void {
1681
- FfiConverterString.write(value.txid, into);
1682
- FfiConverterUInt32.write(value.vout, into);
1683
- FfiConverterArrayUInt8.write(value.scriptSig, into);
1684
- FfiConverterUInt32.write(value.maxWitnessLength, into);
1685
- FfiConverterUInt64.write(value.serialId, into);
1686
- }
1687
- allocationSize(value: TypeName): number {
1688
- return (
1689
- FfiConverterString.allocationSize(value.txid) +
1690
- FfiConverterUInt32.allocationSize(value.vout) +
1691
- FfiConverterArrayUInt8.allocationSize(value.scriptSig) +
1692
- FfiConverterUInt32.allocationSize(value.maxWitnessLength) +
1693
- FfiConverterUInt64.allocationSize(value.serialId)
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
- value: /*u64*/ bigint;
1702
- scriptPubkey: Array</*u8*/ number>;
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
- const defaults = () => ({});
1710
- const create = (() => {
1711
- return uniffiCreateRecord<TxOutput, ReturnType<typeof defaults>>(defaults);
1712
- })();
1713
- return Object.freeze({
1714
- /**
1715
- * Create a frozen instance of {@link TxOutput}, with defaults specified
1716
- * in Rust, in the {@link ddk_ffi} crate.
1717
- */
1718
- create,
1719
-
1720
- /**
1721
- * Create a frozen instance of {@link TxOutput}, with defaults specified
1722
- * in Rust, in the {@link ddk_ffi} crate.
1723
- */
1724
- new: create,
1725
-
1726
- /**
1727
- * Defaults specified in the {@link ddk_ffi} crate.
1728
- */
1729
- defaults: () => Object.freeze(defaults()) as Partial<TxOutput>,
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
- type TypeName = TxOutput;
1735
- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
1736
- read(from: RustBuffer): TypeName {
1737
- return {
1738
- value: FfiConverterUInt64.read(from),
1739
- scriptPubkey: FfiConverterArrayUInt8.read(from),
1740
- };
1741
- }
1742
- write(value: TypeName, into: RustBuffer): void {
1743
- FfiConverterUInt64.write(value.value, into);
1744
- FfiConverterArrayUInt8.write(value.scriptPubkey, into);
1745
- }
1746
- allocationSize(value: TypeName): number {
1747
- return (
1748
- FfiConverterUInt64.allocationSize(value.value) +
1749
- FfiConverterArrayUInt8.allocationSize(value.scriptPubkey)
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
- stringToBytes: (s: string) =>
1758
- uniffiCaller.rustCall((status) =>
1759
- nativeModule().ubrn_uniffi_internal_fn_func_ffi__string_to_arraybuffer(
1760
- s,
1761
- status
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
- // Utility function which does not rely on instanceof.
2017
- function instanceOf(e: any): e is DlcError {
2018
- return (e as any)[uniffiTypeNameSymbol] === 'DlcError';
2019
- }
2020
- return {
2021
- InvalidSignature,
2022
- InvalidPublicKey,
2023
- InvalidTransaction,
2024
- InsufficientFunds,
2025
- InvalidArgument,
2026
- SerializationError,
2027
- Secp256k1Error,
2028
- MiniscriptError,
2029
- InvalidNetwork,
2030
- KeyError,
2031
- instanceOf,
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
- (typeof DlcError)[keyof Omit<typeof DlcError, 'instanceOf'>]
1756
+ typeof DlcError[keyof Omit<typeof DlcError, 'instanceOf'>]
2039
1757
  >;
2040
1758
 
2041
1759
  const FfiConverterTypeDLCError = (() => {
2042
- const intConverter = FfiConverterInt32;
2043
- type TypeName = DlcError;
2044
- class FfiConverter extends AbstractFfiConverterByteArray<TypeName> {
2045
- read(from: RustBuffer): TypeName {
2046
- switch (intConverter.read(from)) {
2047
- case 1:
2048
- return new DlcError.InvalidSignature(FfiConverterString.read(from));
2049
-
2050
- case 2:
2051
- return new DlcError.InvalidPublicKey(FfiConverterString.read(from));
2052
-
2053
- case 3:
2054
- return new DlcError.InvalidTransaction(FfiConverterString.read(from));
2055
-
2056
- case 4:
2057
- return new DlcError.InsufficientFunds(FfiConverterString.read(from));
2058
-
2059
- case 5:
2060
- return new DlcError.InvalidArgument(FfiConverterString.read(from));
2061
-
2062
- case 6:
2063
- return new DlcError.SerializationError(FfiConverterString.read(from));
2064
-
2065
- case 7:
2066
- return new DlcError.Secp256k1Error(FfiConverterString.read(from));
2067
-
2068
- case 8:
2069
- return new DlcError.MiniscriptError(FfiConverterString.read(from));
2070
-
2071
- case 9:
2072
- return new DlcError.InvalidNetwork(FfiConverterString.read(from));
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
- InvalidMnemonic = 'InvalidMnemonic',
2096
- InvalidXpriv = 'InvalidXpriv',
2097
- InvalidXpub = 'InvalidXpub',
2098
- InvalidDerivationPath = 'InvalidDerivationPath',
1814
+ InvalidMnemonic = "InvalidMnemonic",
1815
+ InvalidXpriv = "InvalidXpriv",
1816
+ InvalidXpub = "InvalidXpub",
1817
+ InvalidDerivationPath = "InvalidDerivationPath"
2099
1818
  }
2100
1819
  export const ExtendedKey = (() => {
2101
- class InvalidMnemonic extends UniffiError {
2102
- /**
2103
- * @private
2104
- * This field is private and should not be used.
2105
- */
2106
- readonly [uniffiTypeNameSymbol]: string = 'ExtendedKey';
2107
- /**
2108
- * @private
2109
- * This field is private and should not be used.
2110
- */
2111
- readonly [variantOrdinalSymbol] = 1;
2112
-
2113
- public readonly tag = ExtendedKey_Tags.InvalidMnemonic;
2114
-
2115
- constructor(message: string) {
2116
- super('ExtendedKey', 'InvalidMnemonic', message);
2117
- }
2118
-
2119
- static instanceOf(e: any): e is InvalidMnemonic {
2120
- return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 1;
2121
- }
2122
- }
2123
- class InvalidXpriv extends UniffiError {
2124
- /**
2125
- * @private
2126
- * This field is private and should not be used.
2127
- */
2128
- readonly [uniffiTypeNameSymbol]: string = 'ExtendedKey';
2129
- /**
2130
- * @private
2131
- * This field is private and should not be used.
2132
- */
2133
- readonly [variantOrdinalSymbol] = 2;
2134
-
2135
- public readonly tag = ExtendedKey_Tags.InvalidXpriv;
2136
-
2137
- constructor(message: string) {
2138
- super('ExtendedKey', 'InvalidXpriv', message);
2139
- }
2140
-
2141
- static instanceOf(e: any): e is InvalidXpriv {
2142
- return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 2;
2143
- }
2144
- }
2145
- class InvalidXpub extends UniffiError {
2146
- /**
2147
- * @private
2148
- * This field is private and should not be used.
2149
- */
2150
- readonly [uniffiTypeNameSymbol]: string = 'ExtendedKey';
2151
- /**
2152
- * @private
2153
- * This field is private and should not be used.
2154
- */
2155
- readonly [variantOrdinalSymbol] = 3;
2156
-
2157
- public readonly tag = ExtendedKey_Tags.InvalidXpub;
2158
-
2159
- constructor(message: string) {
2160
- super('ExtendedKey', 'InvalidXpub', message);
2161
- }
2162
-
2163
- static instanceOf(e: any): e is InvalidXpub {
2164
- return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 3;
2165
- }
2166
- }
2167
- class InvalidDerivationPath extends UniffiError {
2168
- /**
2169
- * @private
2170
- * This field is private and should not be used.
2171
- */
2172
- readonly [uniffiTypeNameSymbol]: string = 'ExtendedKey';
2173
- /**
2174
- * @private
2175
- * This field is private and should not be used.
2176
- */
2177
- readonly [variantOrdinalSymbol] = 4;
2178
-
2179
- public readonly tag = ExtendedKey_Tags.InvalidDerivationPath;
2180
-
2181
- constructor(message: string) {
2182
- super('ExtendedKey', 'InvalidDerivationPath', message);
2183
- }
2184
-
2185
- static instanceOf(e: any): e is InvalidDerivationPath {
2186
- return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 4;
2187
- }
2188
- }
2189
-
2190
- // Utility function which does not rely on instanceof.
2191
- function instanceOf(e: any): e is ExtendedKey {
2192
- return (e as any)[uniffiTypeNameSymbol] === 'ExtendedKey';
2193
- }
2194
- return {
2195
- InvalidMnemonic,
2196
- InvalidXpriv,
2197
- InvalidXpub,
2198
- InvalidDerivationPath,
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
- (typeof ExtendedKey)[keyof Omit<typeof ExtendedKey, 'instanceOf'>]
1934
+ typeof ExtendedKey[keyof Omit<typeof ExtendedKey, 'instanceOf'>]
2207
1935
  >;
2208
1936
 
2209
1937
  const FfiConverterTypeExtendedKey = (() => {
2210
- const intConverter = FfiConverterInt32;
2211
- type TypeName = ExtendedKey;
2212
- class FfiConverter extends AbstractFfiConverterByteArray<TypeName> {
2213
- read(from: RustBuffer): TypeName {
2214
- switch (intConverter.read(from)) {
2215
- case 1:
2216
- return new ExtendedKey.InvalidMnemonic(FfiConverterString.read(from));
2217
-
2218
- case 2:
2219
- return new ExtendedKey.InvalidXpriv(FfiConverterString.read(from));
2220
-
2221
- case 3:
2222
- return new ExtendedKey.InvalidXpub(FfiConverterString.read(from));
2223
-
2224
- case 4:
2225
- return new ExtendedKey.InvalidDerivationPath(
2226
- FfiConverterString.read(from)
2227
- );
2228
-
2229
- default:
2230
- throw new UniffiInternalError.UnexpectedEnumCase();
2231
- }
2232
- }
2233
- write(value: TypeName, into: RustBuffer): void {
2234
- const obj = value as any;
2235
- const index = obj[variantOrdinalSymbol] as number;
2236
- intConverter.write(index, into);
2237
- }
2238
- allocationSize(value: TypeName): number {
2239
- return intConverter.allocationSize(0);
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
- FfiConverterTypeAdaptorSignature
2251
- );
1976
+ const FfiConverterArrayTypeAdaptorSignature = new FfiConverterArray(FfiConverterTypeAdaptorSignature);
1977
+
2252
1978
 
2253
1979
  // FfiConverter for Array<DlcInputInfo>
2254
- const FfiConverterArrayTypeDlcInputInfo = new FfiConverterArray(
2255
- FfiConverterTypeDlcInputInfo
2256
- );
1980
+ const FfiConverterArrayTypeDlcInputInfo = new FfiConverterArray(FfiConverterTypeDlcInputInfo);
1981
+
2257
1982
 
2258
1983
  // FfiConverter for Array<OracleInfo>
2259
- const FfiConverterArrayTypeOracleInfo = new FfiConverterArray(
2260
- FfiConverterTypeOracleInfo
2261
- );
1984
+ const FfiConverterArrayTypeOracleInfo = new FfiConverterArray(FfiConverterTypeOracleInfo);
1985
+
2262
1986
 
2263
1987
  // FfiConverter for Array<Payout>
2264
- const FfiConverterArrayTypePayout = new FfiConverterArray(
2265
- FfiConverterTypePayout
2266
- );
1988
+ const FfiConverterArrayTypePayout = new FfiConverterArray(FfiConverterTypePayout);
1989
+
2267
1990
 
2268
1991
  // FfiConverter for Array<Transaction>
2269
- const FfiConverterArrayTypeTransaction = new FfiConverterArray(
2270
- FfiConverterTypeTransaction
2271
- );
1992
+ const FfiConverterArrayTypeTransaction = new FfiConverterArray(FfiConverterTypeTransaction);
1993
+
2272
1994
 
2273
1995
  // FfiConverter for Array<TxInput>
2274
- const FfiConverterArrayTypeTxInput = new FfiConverterArray(
2275
- FfiConverterTypeTxInput
2276
- );
1996
+ const FfiConverterArrayTypeTxInput = new FfiConverterArray(FfiConverterTypeTxInput);
1997
+
2277
1998
 
2278
1999
  // FfiConverter for Array<TxInputInfo>
2279
- const FfiConverterArrayTypeTxInputInfo = new FfiConverterArray(
2280
- FfiConverterTypeTxInputInfo
2281
- );
2000
+ const FfiConverterArrayTypeTxInputInfo = new FfiConverterArray(FfiConverterTypeTxInputInfo);
2001
+
2282
2002
 
2283
2003
  // FfiConverter for Array<TxOutput>
2284
- const FfiConverterArrayTypeTxOutput = new FfiConverterArray(
2285
- FfiConverterTypeTxOutput
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
- FfiConverterArrayUInt8
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
- FfiConverterArrayArrayUInt8
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
- // Get the bindings contract version from our ComponentInterface
2318
- const bindingsContractVersion = 29;
2319
- // Get the scaffolding contract version by calling the into the dylib
2320
- const scaffoldingContractVersion =
2321
- nativeModule().ubrn_ffi_ddk_ffi_uniffi_contract_version();
2322
- if (bindingsContractVersion !== scaffoldingContractVersion) {
2323
- throw new UniffiInternalError.ContractVersionMismatch(
2324
- scaffoldingContractVersion,
2325
- bindingsContractVersion
2326
- );
2327
- }
2328
- if (
2329
- nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_add_signature_to_transaction() !==
2330
- 1337
2331
- ) {
2332
- throw new UniffiInternalError.ApiChecksumMismatch(
2333
- 'uniffi_ddk_ffi_checksum_func_add_signature_to_transaction'
2334
- );
2335
- }
2336
- if (
2337
- nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_convert_mnemonic_to_seed() !==
2338
- 65049
2339
- ) {
2340
- throw new UniffiInternalError.ApiChecksumMismatch(
2341
- 'uniffi_ddk_ffi_checksum_func_convert_mnemonic_to_seed'
2342
- );
2343
- }
2344
- if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_cet() !== 23081) {
2345
- throw new UniffiInternalError.ApiChecksumMismatch(
2346
- 'uniffi_ddk_ffi_checksum_func_create_cet'
2347
- );
2348
- }
2349
- if (
2350
- nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_cet_adaptor_points_from_oracle_info() !==
2351
- 6552
2352
- ) {
2353
- throw new UniffiInternalError.ApiChecksumMismatch(
2354
- 'uniffi_ddk_ffi_checksum_func_create_cet_adaptor_points_from_oracle_info'
2355
- );
2356
- }
2357
- if (
2358
- nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_cet_adaptor_signature_from_oracle_info() !==
2359
- 65174
2360
- ) {
2361
- throw new UniffiInternalError.ApiChecksumMismatch(
2362
- 'uniffi_ddk_ffi_checksum_func_create_cet_adaptor_signature_from_oracle_info'
2363
- );
2364
- }
2365
- if (
2366
- nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_cet_adaptor_sigs_from_oracle_info() !==
2367
- 15699
2368
- ) {
2369
- throw new UniffiInternalError.ApiChecksumMismatch(
2370
- 'uniffi_ddk_ffi_checksum_func_create_cet_adaptor_sigs_from_oracle_info'
2371
- );
2372
- }
2373
- if (
2374
- nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_cet_adaptor_sigs_from_points() !==
2375
- 33705
2376
- ) {
2377
- throw new UniffiInternalError.ApiChecksumMismatch(
2378
- 'uniffi_ddk_ffi_checksum_func_create_cet_adaptor_sigs_from_points'
2379
- );
2380
- }
2381
- if (
2382
- nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_cets() !== 50529
2383
- ) {
2384
- throw new UniffiInternalError.ApiChecksumMismatch(
2385
- 'uniffi_ddk_ffi_checksum_func_create_cets'
2386
- );
2387
- }
2388
- if (
2389
- nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_dlc_transactions() !==
2390
- 29518
2391
- ) {
2392
- throw new UniffiInternalError.ApiChecksumMismatch(
2393
- 'uniffi_ddk_ffi_checksum_func_create_dlc_transactions'
2394
- );
2395
- }
2396
- if (
2397
- nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_extkey_from_parent_path() !==
2398
- 26671
2399
- ) {
2400
- throw new UniffiInternalError.ApiChecksumMismatch(
2401
- 'uniffi_ddk_ffi_checksum_func_create_extkey_from_parent_path'
2402
- );
2403
- }
2404
- if (
2405
- nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_extkey_from_seed() !==
2406
- 12526
2407
- ) {
2408
- throw new UniffiInternalError.ApiChecksumMismatch(
2409
- 'uniffi_ddk_ffi_checksum_func_create_extkey_from_seed'
2410
- );
2411
- }
2412
- if (
2413
- nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_fund_tx_locking_script() !==
2414
- 2761
2415
- ) {
2416
- throw new UniffiInternalError.ApiChecksumMismatch(
2417
- 'uniffi_ddk_ffi_checksum_func_create_fund_tx_locking_script'
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
+ });