@bennyblader/ddk-rn 0.3.39 → 0.3.40

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