@bennyblader/ddk-rn 0.3.37 → 0.3.39

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