@bennyblader/ddk-rn 0.3.33 → 0.3.36

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