@bennyblader/ddk-rn 0.2.0 → 0.2.2

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,1571 +29,1448 @@ 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
- FfiConverterUInt32,
40
- FfiConverterUInt64,
41
- FfiConverterUInt8,
42
- RustBuffer,
43
- UniffiError,
44
- UniffiInternalError,
45
- UniffiRustCaller,
46
- uniffiCreateFfiConverterString,
47
- uniffiCreateRecord,
48
- uniffiTypeNameSymbol,
49
- variantOrdinalSymbol,
50
- } from 'uniffi-bindgen-react-native';
34
+ type UniffiByteArray,
35
+ AbstractFfiConverterByteArray,
36
+ FfiConverterArray,
37
+ FfiConverterBool,
38
+ FfiConverterInt32,
39
+ FfiConverterUInt32,
40
+ FfiConverterUInt64,
41
+ FfiConverterUInt8,
42
+ RustBuffer,
43
+ UniffiError,
44
+ UniffiInternalError,
45
+ UniffiRustCaller,
46
+ uniffiCreateFfiConverterString,
47
+ uniffiCreateRecord,
48
+ uniffiTypeNameSymbol,
49
+ variantOrdinalSymbol } from "uniffi-bindgen-react-native";
51
50
 
52
51
  // Get converters from the other files, if any.
53
52
  const uniffiCaller = new UniffiRustCaller(() => ({ code: 0 }));
54
53
 
55
54
  const uniffiIsDebug =
56
55
  // @ts-ignore -- The process global might not be defined
57
- typeof process !== 'object' ||
56
+ typeof process !== "object" ||
58
57
  // @ts-ignore -- The process global might not be defined
59
- process?.env?.NODE_ENV !== 'production' ||
58
+ process?.env?.NODE_ENV !== "production" ||
60
59
  true;
61
60
  // Public interface members begin here.
62
61
 
63
- export function createCet(
64
- localOutput: TxOutput,
65
- localPayoutSerialId: /*u64*/ bigint,
66
- remoteOutput: TxOutput,
67
- remotePayoutSerialId: /*u64*/ bigint,
68
- fundTxId: string,
69
- fundVout: /*u32*/ number,
70
- lockTime: /*u32*/ number
71
- ): Transaction /*throws*/ {
72
- return FfiConverterTypeTransaction.lift(
73
- uniffiCaller.rustCallWithError(
74
- /*liftError:*/ FfiConverterTypeDLCError.lift.bind(
75
- FfiConverterTypeDLCError
76
- ),
77
- /*caller:*/ (callStatus) => {
78
- return (() => {
79
- console.debug(`-- uniffi_ddk_ffi_fn_func_create_cet`);
80
- return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_create_cet;
81
- })()(
82
- FfiConverterTypeTxOutput.lower(localOutput),
83
- FfiConverterUInt64.lower(localPayoutSerialId),
84
- FfiConverterTypeTxOutput.lower(remoteOutput),
85
- FfiConverterUInt64.lower(remotePayoutSerialId),
86
- FfiConverterString.lower(fundTxId),
87
- FfiConverterUInt32.lower(fundVout),
88
- FfiConverterUInt32.lower(lockTime),
89
- callStatus
90
- );
91
- },
92
- /*liftString:*/ FfiConverterString.lift
93
- )
94
- );
95
- }
96
- export function createCetAdaptorSignatureFromOracleInfo(
97
- cet: Transaction,
98
- oracleInfo: OracleInfo,
99
- fundingSk: Array</*u8*/ number>,
100
- fundingScriptPubkey: Array</*u8*/ number>,
101
- totalCollateral: /*u64*/ bigint,
102
- msgs: Array<Array</*u8*/ number>>
103
- ): AdaptorSignature /*throws*/ {
104
- return FfiConverterTypeAdaptorSignature.lift(
105
- uniffiCaller.rustCallWithError(
106
- /*liftError:*/ FfiConverterTypeDLCError.lift.bind(
107
- FfiConverterTypeDLCError
108
- ),
109
- /*caller:*/ (callStatus) => {
110
- return (() => {
111
- console.debug(
112
- `-- uniffi_ddk_ffi_fn_func_create_cet_adaptor_signature_from_oracle_info`
113
- );
114
- return nativeModule()
115
- .ubrn_uniffi_ddk_ffi_fn_func_create_cet_adaptor_signature_from_oracle_info;
116
- })()(
117
- FfiConverterTypeTransaction.lower(cet),
118
- FfiConverterTypeOracleInfo.lower(oracleInfo),
119
- FfiConverterArrayUInt8.lower(fundingSk),
120
- FfiConverterArrayUInt8.lower(fundingScriptPubkey),
121
- FfiConverterUInt64.lower(totalCollateral),
122
- FfiConverterArrayArrayUInt8.lower(msgs),
123
- callStatus
124
- );
125
- },
126
- /*liftString:*/ FfiConverterString.lift
127
- )
128
- );
129
- }
130
- export function createCets(
131
- fundTxId: string,
132
- fundVout: /*u32*/ number,
133
- localFinalScriptPubkey: Array</*u8*/ number>,
134
- remoteFinalScriptPubkey: Array</*u8*/ number>,
135
- outcomes: Array<DlcOutcome>,
136
- lockTime: /*u32*/ number,
137
- localSerialId: /*u64*/ bigint,
138
- remoteSerialId: /*u64*/ bigint
139
- ): Array<Transaction> /*throws*/ {
140
- return FfiConverterArrayTypeTransaction.lift(
141
- uniffiCaller.rustCallWithError(
142
- /*liftError:*/ FfiConverterTypeDLCError.lift.bind(
143
- FfiConverterTypeDLCError
144
- ),
145
- /*caller:*/ (callStatus) => {
146
- return (() => {
147
- console.debug(`-- uniffi_ddk_ffi_fn_func_create_cets`);
148
- return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_create_cets;
149
- })()(
150
- FfiConverterString.lower(fundTxId),
151
- FfiConverterUInt32.lower(fundVout),
152
- FfiConverterArrayUInt8.lower(localFinalScriptPubkey),
153
- FfiConverterArrayUInt8.lower(remoteFinalScriptPubkey),
154
- FfiConverterArrayTypeDlcOutcome.lower(outcomes),
155
- FfiConverterUInt32.lower(lockTime),
156
- FfiConverterUInt64.lower(localSerialId),
157
- FfiConverterUInt64.lower(remoteSerialId),
158
- callStatus
159
- );
160
- },
161
- /*liftString:*/ FfiConverterString.lift
162
- )
163
- );
164
- }
165
- export function createDlcTransactions(
166
- outcomes: Array<DlcOutcome>,
167
- localParams: PartyParams,
168
- remoteParams: PartyParams,
169
- refundLocktime: /*u32*/ number,
170
- feeRate: /*u64*/ bigint,
171
- fundLockTime: /*u32*/ number,
172
- cetLockTime: /*u32*/ number,
173
- fundOutputSerialId: /*u64*/ bigint
174
- ): DlcTransactions /*throws*/ {
175
- return FfiConverterTypeDlcTransactions.lift(
176
- uniffiCaller.rustCallWithError(
177
- /*liftError:*/ FfiConverterTypeDLCError.lift.bind(
178
- FfiConverterTypeDLCError
179
- ),
180
- /*caller:*/ (callStatus) => {
181
- return (() => {
182
- console.debug(`-- uniffi_ddk_ffi_fn_func_create_dlc_transactions`);
183
- return nativeModule()
184
- .ubrn_uniffi_ddk_ffi_fn_func_create_dlc_transactions;
185
- })()(
186
- FfiConverterArrayTypeDlcOutcome.lower(outcomes),
187
- FfiConverterTypePartyParams.lower(localParams),
188
- FfiConverterTypePartyParams.lower(remoteParams),
189
- FfiConverterUInt32.lower(refundLocktime),
190
- FfiConverterUInt64.lower(feeRate),
191
- FfiConverterUInt32.lower(fundLockTime),
192
- FfiConverterUInt32.lower(cetLockTime),
193
- FfiConverterUInt64.lower(fundOutputSerialId),
194
- callStatus
195
- );
196
- },
197
- /*liftString:*/ FfiConverterString.lift
198
- )
199
- );
200
- }
201
- export function createFundTxLockingScript(
202
- localFundPubkey: Array</*u8*/ number>,
203
- remoteFundPubkey: Array</*u8*/ number>
204
- ): Array</*u8*/ number> /*throws*/ {
205
- return FfiConverterArrayUInt8.lift(
206
- uniffiCaller.rustCallWithError(
207
- /*liftError:*/ FfiConverterTypeDLCError.lift.bind(
208
- FfiConverterTypeDLCError
209
- ),
210
- /*caller:*/ (callStatus) => {
211
- return (() => {
212
- console.debug(
213
- `-- uniffi_ddk_ffi_fn_func_create_fund_tx_locking_script`
214
- );
215
- return nativeModule()
216
- .ubrn_uniffi_ddk_ffi_fn_func_create_fund_tx_locking_script;
217
- })()(
218
- FfiConverterArrayUInt8.lower(localFundPubkey),
219
- FfiConverterArrayUInt8.lower(remoteFundPubkey),
220
- callStatus
221
- );
222
- },
223
- /*liftString:*/ FfiConverterString.lift
224
- )
225
- );
226
- }
227
- export function createRefundTransaction(
228
- localFinalScriptPubkey: Array</*u8*/ number>,
229
- remoteFinalScriptPubkey: Array</*u8*/ number>,
230
- localAmount: /*u64*/ bigint,
231
- remoteAmount: /*u64*/ bigint,
232
- lockTime: /*u32*/ number,
233
- fundTxId: string,
234
- fundVout: /*u32*/ number
235
- ): Transaction /*throws*/ {
236
- return FfiConverterTypeTransaction.lift(
237
- uniffiCaller.rustCallWithError(
238
- /*liftError:*/ FfiConverterTypeDLCError.lift.bind(
239
- FfiConverterTypeDLCError
240
- ),
241
- /*caller:*/ (callStatus) => {
242
- return (() => {
243
- console.debug(`-- uniffi_ddk_ffi_fn_func_create_refund_transaction`);
244
- return nativeModule()
245
- .ubrn_uniffi_ddk_ffi_fn_func_create_refund_transaction;
246
- })()(
247
- FfiConverterArrayUInt8.lower(localFinalScriptPubkey),
248
- FfiConverterArrayUInt8.lower(remoteFinalScriptPubkey),
249
- FfiConverterUInt64.lower(localAmount),
250
- FfiConverterUInt64.lower(remoteAmount),
251
- FfiConverterUInt32.lower(lockTime),
252
- FfiConverterString.lower(fundTxId),
253
- FfiConverterUInt32.lower(fundVout),
254
- callStatus
255
- );
256
- },
257
- /*liftString:*/ FfiConverterString.lift
258
- )
259
- );
260
- }
261
- export function createSplicedDlcTransactions(
262
- outcomes: Array<DlcOutcome>,
263
- localParams: PartyParams,
264
- remoteParams: PartyParams,
265
- refundLocktime: /*u32*/ number,
266
- feeRate: /*u64*/ bigint,
267
- fundLockTime: /*u32*/ number,
268
- cetLockTime: /*u32*/ number,
269
- fundOutputSerialId: /*u64*/ bigint
270
- ): DlcTransactions /*throws*/ {
271
- return FfiConverterTypeDlcTransactions.lift(
272
- uniffiCaller.rustCallWithError(
273
- /*liftError:*/ FfiConverterTypeDLCError.lift.bind(
274
- FfiConverterTypeDLCError
275
- ),
276
- /*caller:*/ (callStatus) => {
277
- return (() => {
278
- console.debug(
279
- `-- uniffi_ddk_ffi_fn_func_create_spliced_dlc_transactions`
280
- );
281
- return nativeModule()
282
- .ubrn_uniffi_ddk_ffi_fn_func_create_spliced_dlc_transactions;
283
- })()(
284
- FfiConverterArrayTypeDlcOutcome.lower(outcomes),
285
- FfiConverterTypePartyParams.lower(localParams),
286
- FfiConverterTypePartyParams.lower(remoteParams),
287
- FfiConverterUInt32.lower(refundLocktime),
288
- FfiConverterUInt64.lower(feeRate),
289
- FfiConverterUInt32.lower(fundLockTime),
290
- FfiConverterUInt32.lower(cetLockTime),
291
- FfiConverterUInt64.lower(fundOutputSerialId),
292
- callStatus
293
- );
294
- },
295
- /*liftString:*/ FfiConverterString.lift
296
- )
297
- );
298
- }
299
- export function getChangeOutputAndFees(
300
- params: PartyParams,
301
- feeRate: /*u64*/ bigint
302
- ): ChangeOutputAndFees /*throws*/ {
303
- return FfiConverterTypeChangeOutputAndFees.lift(
304
- uniffiCaller.rustCallWithError(
305
- /*liftError:*/ FfiConverterTypeDLCError.lift.bind(
306
- FfiConverterTypeDLCError
307
- ),
308
- /*caller:*/ (callStatus) => {
309
- return (() => {
310
- console.debug(`-- uniffi_ddk_ffi_fn_func_get_change_output_and_fees`);
311
- return nativeModule()
312
- .ubrn_uniffi_ddk_ffi_fn_func_get_change_output_and_fees;
313
- })()(
314
- FfiConverterTypePartyParams.lower(params),
315
- FfiConverterUInt64.lower(feeRate),
316
- callStatus
317
- );
318
- },
319
- /*liftString:*/ FfiConverterString.lift
320
- )
321
- );
322
- }
323
- export function getRawFundingTransactionInputSignature(
324
- fundingTransaction: Transaction,
325
- privkey: Array</*u8*/ number>,
326
- prevTxId: string,
327
- prevTxVout: /*u32*/ number,
328
- value: /*u64*/ bigint
329
- ): Array</*u8*/ number> /*throws*/ {
330
- return FfiConverterArrayUInt8.lift(
331
- uniffiCaller.rustCallWithError(
332
- /*liftError:*/ FfiConverterTypeDLCError.lift.bind(
333
- FfiConverterTypeDLCError
334
- ),
335
- /*caller:*/ (callStatus) => {
336
- return (() => {
337
- console.debug(
338
- `-- uniffi_ddk_ffi_fn_func_get_raw_funding_transaction_input_signature`
339
- );
340
- return nativeModule()
341
- .ubrn_uniffi_ddk_ffi_fn_func_get_raw_funding_transaction_input_signature;
342
- })()(
343
- FfiConverterTypeTransaction.lower(fundingTransaction),
344
- FfiConverterArrayUInt8.lower(privkey),
345
- FfiConverterString.lower(prevTxId),
346
- FfiConverterUInt32.lower(prevTxVout),
347
- FfiConverterUInt64.lower(value),
348
- callStatus
349
- );
350
- },
351
- /*liftString:*/ FfiConverterString.lift
352
- )
353
- );
354
- }
355
- export function getTotalInputVsize(inputs: Array<TxInputInfo>): /*u32*/ number {
356
- return FfiConverterUInt32.lift(
357
- uniffiCaller.rustCall(
358
- /*caller:*/ (callStatus) => {
359
- return (() => {
360
- console.debug(`-- uniffi_ddk_ffi_fn_func_get_total_input_vsize`);
361
- return nativeModule()
362
- .ubrn_uniffi_ddk_ffi_fn_func_get_total_input_vsize;
363
- })()(FfiConverterArrayTypeTxInputInfo.lower(inputs), callStatus);
364
- },
365
- /*liftString:*/ FfiConverterString.lift
366
- )
367
- );
368
- }
62
+ export function createCet(localOutput: TxOutput, localPayoutSerialId: /*u64*/bigint, remoteOutput: TxOutput, remotePayoutSerialId: /*u64*/bigint, fundTxId: string, fundVout: /*u32*/number, lockTime: /*u32*/number): Transaction /*throws*/ {
63
+ return FfiConverterTypeTransaction.lift(
64
+ uniffiCaller.rustCallWithError(
65
+ /*liftError:*/ FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError),
66
+ /*caller:*/ (callStatus) => {
67
+ return (() => {
68
+
69
+ console.debug(`-- uniffi_ddk_ffi_fn_func_create_cet`);
70
+ return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_create_cet;
71
+ })()(
72
+ FfiConverterTypeTxOutput.lower(localOutput),
73
+ FfiConverterUInt64.lower(localPayoutSerialId),
74
+ FfiConverterTypeTxOutput.lower(remoteOutput),
75
+ FfiConverterUInt64.lower(remotePayoutSerialId),
76
+ FfiConverterString.lower(fundTxId),
77
+ FfiConverterUInt32.lower(fundVout),
78
+ FfiConverterUInt32.lower(lockTime),
79
+ callStatus);
80
+ },
81
+ /*liftString:*/ FfiConverterString.lift,
82
+ ));
83
+ }
84
+ 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*/ {
85
+ return FfiConverterTypeAdaptorSignature.lift(
86
+ uniffiCaller.rustCallWithError(
87
+ /*liftError:*/ FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError),
88
+ /*caller:*/ (callStatus) => {
89
+ return (() => {
90
+
91
+ console.debug(`-- uniffi_ddk_ffi_fn_func_create_cet_adaptor_signature_from_oracle_info`);
92
+ return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_create_cet_adaptor_signature_from_oracle_info;
93
+ })()(
94
+ FfiConverterTypeTransaction.lower(cet),
95
+ FfiConverterTypeOracleInfo.lower(oracleInfo),
96
+ FfiConverterArrayUInt8.lower(fundingSk),
97
+ FfiConverterArrayUInt8.lower(fundingScriptPubkey),
98
+ FfiConverterUInt64.lower(totalCollateral),
99
+ FfiConverterArrayArrayUInt8.lower(msgs),
100
+ callStatus);
101
+ },
102
+ /*liftString:*/ FfiConverterString.lift,
103
+ ));
104
+ }
105
+ export function createCets(fundTxId: string, fundVout: /*u32*/number, localFinalScriptPubkey: Array</*u8*/number>, remoteFinalScriptPubkey: Array</*u8*/number>, outcomes: Array<DlcOutcome>, lockTime: /*u32*/number, localSerialId: /*u64*/bigint, remoteSerialId: /*u64*/bigint): Array<Transaction> /*throws*/ {
106
+ return FfiConverterArrayTypeTransaction.lift(
107
+ uniffiCaller.rustCallWithError(
108
+ /*liftError:*/ FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError),
109
+ /*caller:*/ (callStatus) => {
110
+ return (() => {
111
+
112
+ console.debug(`-- uniffi_ddk_ffi_fn_func_create_cets`);
113
+ return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_create_cets;
114
+ })()(
115
+ FfiConverterString.lower(fundTxId),
116
+ FfiConverterUInt32.lower(fundVout),
117
+ FfiConverterArrayUInt8.lower(localFinalScriptPubkey),
118
+ FfiConverterArrayUInt8.lower(remoteFinalScriptPubkey),
119
+ FfiConverterArrayTypeDlcOutcome.lower(outcomes),
120
+ FfiConverterUInt32.lower(lockTime),
121
+ FfiConverterUInt64.lower(localSerialId),
122
+ FfiConverterUInt64.lower(remoteSerialId),
123
+ callStatus);
124
+ },
125
+ /*liftString:*/ FfiConverterString.lift,
126
+ ));
127
+ }
128
+ export function createDlcTransactions(outcomes: Array<DlcOutcome>, localParams: PartyParams, remoteParams: PartyParams, refundLocktime: /*u32*/number, feeRate: /*u64*/bigint, fundLockTime: /*u32*/number, cetLockTime: /*u32*/number, fundOutputSerialId: /*u64*/bigint): DlcTransactions /*throws*/ {
129
+ return FfiConverterTypeDlcTransactions.lift(
130
+ uniffiCaller.rustCallWithError(
131
+ /*liftError:*/ FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError),
132
+ /*caller:*/ (callStatus) => {
133
+ return (() => {
134
+
135
+ console.debug(`-- uniffi_ddk_ffi_fn_func_create_dlc_transactions`);
136
+ return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_create_dlc_transactions;
137
+ })()(
138
+ FfiConverterArrayTypeDlcOutcome.lower(outcomes),
139
+ FfiConverterTypePartyParams.lower(localParams),
140
+ FfiConverterTypePartyParams.lower(remoteParams),
141
+ FfiConverterUInt32.lower(refundLocktime),
142
+ FfiConverterUInt64.lower(feeRate),
143
+ FfiConverterUInt32.lower(fundLockTime),
144
+ FfiConverterUInt32.lower(cetLockTime),
145
+ FfiConverterUInt64.lower(fundOutputSerialId),
146
+ callStatus);
147
+ },
148
+ /*liftString:*/ FfiConverterString.lift,
149
+ ));
150
+ }
151
+ export function createFundTxLockingScript(localFundPubkey: Array</*u8*/number>, remoteFundPubkey: Array</*u8*/number>): Array</*u8*/number> /*throws*/ {
152
+ return FfiConverterArrayUInt8.lift(
153
+ uniffiCaller.rustCallWithError(
154
+ /*liftError:*/ FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError),
155
+ /*caller:*/ (callStatus) => {
156
+ return (() => {
157
+
158
+ console.debug(`-- uniffi_ddk_ffi_fn_func_create_fund_tx_locking_script`);
159
+ return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_create_fund_tx_locking_script;
160
+ })()(
161
+ FfiConverterArrayUInt8.lower(localFundPubkey),
162
+ FfiConverterArrayUInt8.lower(remoteFundPubkey),
163
+ callStatus);
164
+ },
165
+ /*liftString:*/ FfiConverterString.lift,
166
+ ));
167
+ }
168
+ 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*/ {
169
+ return FfiConverterTypeTransaction.lift(
170
+ uniffiCaller.rustCallWithError(
171
+ /*liftError:*/ FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError),
172
+ /*caller:*/ (callStatus) => {
173
+ return (() => {
174
+
175
+ console.debug(`-- uniffi_ddk_ffi_fn_func_create_refund_transaction`);
176
+ return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_create_refund_transaction;
177
+ })()(
178
+ FfiConverterArrayUInt8.lower(localFinalScriptPubkey),
179
+ FfiConverterArrayUInt8.lower(remoteFinalScriptPubkey),
180
+ FfiConverterUInt64.lower(localAmount),
181
+ FfiConverterUInt64.lower(remoteAmount),
182
+ FfiConverterUInt32.lower(lockTime),
183
+ FfiConverterString.lower(fundTxId),
184
+ FfiConverterUInt32.lower(fundVout),
185
+ callStatus);
186
+ },
187
+ /*liftString:*/ FfiConverterString.lift,
188
+ ));
189
+ }
190
+ export function createSplicedDlcTransactions(outcomes: Array<DlcOutcome>, localParams: PartyParams, remoteParams: PartyParams, refundLocktime: /*u32*/number, feeRate: /*u64*/bigint, fundLockTime: /*u32*/number, cetLockTime: /*u32*/number, fundOutputSerialId: /*u64*/bigint): DlcTransactions /*throws*/ {
191
+ return FfiConverterTypeDlcTransactions.lift(
192
+ uniffiCaller.rustCallWithError(
193
+ /*liftError:*/ FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError),
194
+ /*caller:*/ (callStatus) => {
195
+ return (() => {
196
+
197
+ console.debug(`-- uniffi_ddk_ffi_fn_func_create_spliced_dlc_transactions`);
198
+ return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_create_spliced_dlc_transactions;
199
+ })()(
200
+ FfiConverterArrayTypeDlcOutcome.lower(outcomes),
201
+ FfiConverterTypePartyParams.lower(localParams),
202
+ FfiConverterTypePartyParams.lower(remoteParams),
203
+ FfiConverterUInt32.lower(refundLocktime),
204
+ FfiConverterUInt64.lower(feeRate),
205
+ FfiConverterUInt32.lower(fundLockTime),
206
+ FfiConverterUInt32.lower(cetLockTime),
207
+ FfiConverterUInt64.lower(fundOutputSerialId),
208
+ callStatus);
209
+ },
210
+ /*liftString:*/ FfiConverterString.lift,
211
+ ));
212
+ }
213
+ export function getChangeOutputAndFees(params: PartyParams, feeRate: /*u64*/bigint): ChangeOutputAndFees /*throws*/ {
214
+ return FfiConverterTypeChangeOutputAndFees.lift(
215
+ uniffiCaller.rustCallWithError(
216
+ /*liftError:*/ FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError),
217
+ /*caller:*/ (callStatus) => {
218
+ return (() => {
219
+
220
+ console.debug(`-- uniffi_ddk_ffi_fn_func_get_change_output_and_fees`);
221
+ return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_get_change_output_and_fees;
222
+ })()(
223
+ FfiConverterTypePartyParams.lower(params),
224
+ FfiConverterUInt64.lower(feeRate),
225
+ callStatus);
226
+ },
227
+ /*liftString:*/ FfiConverterString.lift,
228
+ ));
229
+ }
230
+ export function getRawFundingTransactionInputSignature(fundingTransaction: Transaction, privkey: Array</*u8*/number>, prevTxId: string, prevTxVout: /*u32*/number, value: /*u64*/bigint): Array</*u8*/number> /*throws*/ {
231
+ return FfiConverterArrayUInt8.lift(
232
+ uniffiCaller.rustCallWithError(
233
+ /*liftError:*/ FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError),
234
+ /*caller:*/ (callStatus) => {
235
+ return (() => {
236
+
237
+ console.debug(`-- uniffi_ddk_ffi_fn_func_get_raw_funding_transaction_input_signature`);
238
+ return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_get_raw_funding_transaction_input_signature;
239
+ })()(
240
+ FfiConverterTypeTransaction.lower(fundingTransaction),
241
+ FfiConverterArrayUInt8.lower(privkey),
242
+ FfiConverterString.lower(prevTxId),
243
+ FfiConverterUInt32.lower(prevTxVout),
244
+ FfiConverterUInt64.lower(value),
245
+ callStatus);
246
+ },
247
+ /*liftString:*/ FfiConverterString.lift,
248
+ ));
249
+ }
250
+ export function getTotalInputVsize(inputs: Array<TxInputInfo>): /*u32*/number {
251
+ return FfiConverterUInt32.lift(uniffiCaller.rustCall(
252
+ /*caller:*/ (callStatus) => {
253
+ return (() => {
254
+
255
+ console.debug(`-- uniffi_ddk_ffi_fn_func_get_total_input_vsize`);
256
+ return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_get_total_input_vsize;
257
+ })()(
258
+ FfiConverterArrayTypeTxInputInfo.lower(inputs),
259
+ callStatus);
260
+ },
261
+ /*liftString:*/ FfiConverterString.lift,
262
+ ));
263
+ }
369
264
  export function isDustOutput(output: TxOutput): boolean {
370
- return FfiConverterBool.lift(
371
- uniffiCaller.rustCall(
372
- /*caller:*/ (callStatus) => {
373
- return (() => {
374
- console.debug(`-- uniffi_ddk_ffi_fn_func_is_dust_output`);
375
- return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_is_dust_output;
376
- })()(FfiConverterTypeTxOutput.lower(output), callStatus);
377
- },
378
- /*liftString:*/ FfiConverterString.lift
379
- )
380
- );
381
- }
382
- export function signFundTransactionInput(
383
- fundTransaction: Transaction,
384
- privkey: Array</*u8*/ number>,
385
- prevTxId: string,
386
- prevTxVout: /*u32*/ number,
387
- value: /*u64*/ bigint
388
- ): Transaction /*throws*/ {
389
- return FfiConverterTypeTransaction.lift(
390
- uniffiCaller.rustCallWithError(
391
- /*liftError:*/ FfiConverterTypeDLCError.lift.bind(
392
- FfiConverterTypeDLCError
393
- ),
394
- /*caller:*/ (callStatus) => {
395
- return (() => {
396
- console.debug(
397
- `-- uniffi_ddk_ffi_fn_func_sign_fund_transaction_input`
398
- );
399
- return nativeModule()
400
- .ubrn_uniffi_ddk_ffi_fn_func_sign_fund_transaction_input;
401
- })()(
402
- FfiConverterTypeTransaction.lower(fundTransaction),
403
- FfiConverterArrayUInt8.lower(privkey),
404
- FfiConverterString.lower(prevTxId),
405
- FfiConverterUInt32.lower(prevTxVout),
406
- FfiConverterUInt64.lower(value),
407
- callStatus
408
- );
409
- },
410
- /*liftString:*/ FfiConverterString.lift
411
- )
412
- );
413
- }
414
- export function verifyFundTxSignature(
415
- fundTx: Transaction,
416
- signature: Array</*u8*/ number>,
417
- pubkey: Array</*u8*/ number>,
418
- txid: string,
419
- vout: /*u32*/ number,
420
- inputAmount: /*u64*/ bigint
421
- ): boolean /*throws*/ {
422
- return FfiConverterBool.lift(
423
- uniffiCaller.rustCallWithError(
424
- /*liftError:*/ FfiConverterTypeDLCError.lift.bind(
425
- FfiConverterTypeDLCError
426
- ),
427
- /*caller:*/ (callStatus) => {
428
- return (() => {
429
- console.debug(`-- uniffi_ddk_ffi_fn_func_verify_fund_tx_signature`);
430
- return nativeModule()
431
- .ubrn_uniffi_ddk_ffi_fn_func_verify_fund_tx_signature;
432
- })()(
433
- FfiConverterTypeTransaction.lower(fundTx),
434
- FfiConverterArrayUInt8.lower(signature),
435
- FfiConverterArrayUInt8.lower(pubkey),
436
- FfiConverterString.lower(txid),
437
- FfiConverterUInt32.lower(vout),
438
- FfiConverterUInt64.lower(inputAmount),
439
- callStatus
440
- );
441
- },
442
- /*liftString:*/ FfiConverterString.lift
443
- )
444
- );
445
- }
265
+ return FfiConverterBool.lift(uniffiCaller.rustCall(
266
+ /*caller:*/ (callStatus) => {
267
+ return (() => {
268
+
269
+ console.debug(`-- uniffi_ddk_ffi_fn_func_is_dust_output`);
270
+ return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_is_dust_output;
271
+ })()(
272
+ FfiConverterTypeTxOutput.lower(output),
273
+ callStatus);
274
+ },
275
+ /*liftString:*/ FfiConverterString.lift,
276
+ ));
277
+ }
278
+ export function signFundTransactionInput(fundTransaction: Transaction, privkey: Array</*u8*/number>, prevTxId: string, prevTxVout: /*u32*/number, value: /*u64*/bigint): Transaction /*throws*/ {
279
+ return FfiConverterTypeTransaction.lift(
280
+ uniffiCaller.rustCallWithError(
281
+ /*liftError:*/ FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError),
282
+ /*caller:*/ (callStatus) => {
283
+ return (() => {
284
+
285
+ console.debug(`-- uniffi_ddk_ffi_fn_func_sign_fund_transaction_input`);
286
+ return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_sign_fund_transaction_input;
287
+ })()(
288
+ FfiConverterTypeTransaction.lower(fundTransaction),
289
+ FfiConverterArrayUInt8.lower(privkey),
290
+ FfiConverterString.lower(prevTxId),
291
+ FfiConverterUInt32.lower(prevTxVout),
292
+ FfiConverterUInt64.lower(value),
293
+ callStatus);
294
+ },
295
+ /*liftString:*/ FfiConverterString.lift,
296
+ ));
297
+ }
298
+ export function verifyFundTxSignature(fundTx: Transaction, signature: Array</*u8*/number>, pubkey: Array</*u8*/number>, txid: string, vout: /*u32*/number, inputAmount: /*u64*/bigint): boolean /*throws*/ {
299
+ return FfiConverterBool.lift(
300
+ uniffiCaller.rustCallWithError(
301
+ /*liftError:*/ FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError),
302
+ /*caller:*/ (callStatus) => {
303
+ return (() => {
304
+
305
+ console.debug(`-- uniffi_ddk_ffi_fn_func_verify_fund_tx_signature`);
306
+ return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_verify_fund_tx_signature;
307
+ })()(
308
+ FfiConverterTypeTransaction.lower(fundTx),
309
+ FfiConverterArrayUInt8.lower(signature),
310
+ FfiConverterArrayUInt8.lower(pubkey),
311
+ FfiConverterString.lower(txid),
312
+ FfiConverterUInt32.lower(vout),
313
+ FfiConverterUInt64.lower(inputAmount),
314
+ callStatus);
315
+ },
316
+ /*liftString:*/ FfiConverterString.lift,
317
+ ));
318
+ }
446
319
  export function version(): string {
447
- return FfiConverterString.lift(
448
- uniffiCaller.rustCall(
449
- /*caller:*/ (callStatus) => {
450
- return (() => {
451
- console.debug(`-- uniffi_ddk_ffi_fn_func_version`);
452
- return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_version;
453
- })()(callStatus);
454
- },
455
- /*liftString:*/ FfiConverterString.lift
456
- )
457
- );
458
- }
320
+ return FfiConverterString.lift(uniffiCaller.rustCall(
321
+ /*caller:*/ (callStatus) => {
322
+ return (() => {
323
+
324
+ console.debug(`-- uniffi_ddk_ffi_fn_func_version`);
325
+ return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_version;
326
+ })()(
327
+ callStatus);
328
+ },
329
+ /*liftString:*/ FfiConverterString.lift,
330
+ ));
331
+ }
332
+
333
+
334
+
335
+
336
+
459
337
 
460
338
  export type AdaptorSignature = {
461
- signature: Array</*u8*/ number>;
462
- proof: Array</*u8*/ number>;
463
- };
339
+ signature: Array</*u8*/number>,
340
+ proof: Array</*u8*/number>
341
+ }
464
342
 
465
343
  /**
466
344
  * Generated factory for {@link AdaptorSignature} record objects.
467
345
  */
468
346
  export const AdaptorSignature = (() => {
469
- const defaults = () => ({});
470
- const create = (() => {
471
- return uniffiCreateRecord<AdaptorSignature, ReturnType<typeof defaults>>(
472
- defaults
473
- );
474
- })();
475
- return Object.freeze({
476
- /**
477
- * Create a frozen instance of {@link AdaptorSignature}, with defaults specified
478
- * in Rust, in the {@link ddk_ffi} crate.
479
- */
480
- create,
481
-
482
- /**
483
- * Create a frozen instance of {@link AdaptorSignature}, with defaults specified
484
- * in Rust, in the {@link ddk_ffi} crate.
485
- */
486
- new: create,
487
-
488
- /**
489
- * Defaults specified in the {@link ddk_ffi} crate.
490
- */
491
- defaults: () => Object.freeze(defaults()) as Partial<AdaptorSignature>,
492
- });
347
+ const defaults = () => ({
348
+ });
349
+ const create = (() => {
350
+ return uniffiCreateRecord<AdaptorSignature, ReturnType<typeof defaults>>(defaults);
351
+ })();
352
+ return Object.freeze({
353
+ /**
354
+ * Create a frozen instance of {@link AdaptorSignature}, with defaults specified
355
+ * in Rust, in the {@link ddk_ffi} crate.
356
+ */
357
+ create,
358
+
359
+ /**
360
+ * Create a frozen instance of {@link AdaptorSignature}, with defaults specified
361
+ * in Rust, in the {@link ddk_ffi} crate.
362
+ */
363
+ new: create,
364
+
365
+ /**
366
+ * Defaults specified in the {@link ddk_ffi} crate.
367
+ */
368
+ defaults: () => Object.freeze(defaults()) as Partial<AdaptorSignature>,
369
+ });
493
370
  })();
494
371
 
495
372
  const FfiConverterTypeAdaptorSignature = (() => {
496
- type TypeName = AdaptorSignature;
497
- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
498
- read(from: RustBuffer): TypeName {
499
- return {
500
- signature: FfiConverterArrayUInt8.read(from),
501
- proof: FfiConverterArrayUInt8.read(from),
502
- };
503
- }
504
- write(value: TypeName, into: RustBuffer): void {
505
- FfiConverterArrayUInt8.write(value.signature, into);
506
- FfiConverterArrayUInt8.write(value.proof, into);
507
- }
508
- allocationSize(value: TypeName): number {
509
- return (
510
- FfiConverterArrayUInt8.allocationSize(value.signature) +
511
- FfiConverterArrayUInt8.allocationSize(value.proof)
512
- );
513
- }
514
- }
515
- return new FFIConverter();
373
+ type TypeName = AdaptorSignature;
374
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
375
+ read(from: RustBuffer): TypeName {
376
+ return {
377
+ signature: FfiConverterArrayUInt8.read(from),
378
+ proof: FfiConverterArrayUInt8.read(from)
379
+ };
380
+ }
381
+ write(value: TypeName, into: RustBuffer): void {
382
+ FfiConverterArrayUInt8.write(value.signature, into);
383
+ FfiConverterArrayUInt8.write(value.proof, into);
384
+ }
385
+ allocationSize(value: TypeName): number {
386
+ return FfiConverterArrayUInt8.allocationSize(value.signature) +
387
+ FfiConverterArrayUInt8.allocationSize(value.proof);
388
+
389
+ }
390
+ };
391
+ return new FFIConverter();
516
392
  })();
517
393
 
394
+
518
395
  export type ChangeOutputAndFees = {
519
- changeOutput: TxOutput;
520
- fundFee: /*u64*/ bigint;
521
- cetFee: /*u64*/ bigint;
522
- };
396
+ changeOutput: TxOutput,
397
+ fundFee: /*u64*/bigint,
398
+ cetFee: /*u64*/bigint
399
+ }
523
400
 
524
401
  /**
525
402
  * Generated factory for {@link ChangeOutputAndFees} record objects.
526
403
  */
527
404
  export const ChangeOutputAndFees = (() => {
528
- const defaults = () => ({});
529
- const create = (() => {
530
- return uniffiCreateRecord<ChangeOutputAndFees, ReturnType<typeof defaults>>(
531
- defaults
532
- );
533
- })();
534
- return Object.freeze({
535
- /**
536
- * Create a frozen instance of {@link ChangeOutputAndFees}, with defaults specified
537
- * in Rust, in the {@link ddk_ffi} crate.
538
- */
539
- create,
540
-
541
- /**
542
- * Create a frozen instance of {@link ChangeOutputAndFees}, with defaults specified
543
- * in Rust, in the {@link ddk_ffi} crate.
544
- */
545
- new: create,
546
-
547
- /**
548
- * Defaults specified in the {@link ddk_ffi} crate.
549
- */
550
- defaults: () => Object.freeze(defaults()) as Partial<ChangeOutputAndFees>,
551
- });
405
+ const defaults = () => ({
406
+ });
407
+ const create = (() => {
408
+ return uniffiCreateRecord<ChangeOutputAndFees, ReturnType<typeof defaults>>(defaults);
409
+ })();
410
+ return Object.freeze({
411
+ /**
412
+ * Create a frozen instance of {@link ChangeOutputAndFees}, with defaults specified
413
+ * in Rust, in the {@link ddk_ffi} crate.
414
+ */
415
+ create,
416
+
417
+ /**
418
+ * Create a frozen instance of {@link ChangeOutputAndFees}, with defaults specified
419
+ * in Rust, in the {@link ddk_ffi} crate.
420
+ */
421
+ new: create,
422
+
423
+ /**
424
+ * Defaults specified in the {@link ddk_ffi} crate.
425
+ */
426
+ defaults: () => Object.freeze(defaults()) as Partial<ChangeOutputAndFees>,
427
+ });
552
428
  })();
553
429
 
554
430
  const FfiConverterTypeChangeOutputAndFees = (() => {
555
- type TypeName = ChangeOutputAndFees;
556
- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
557
- read(from: RustBuffer): TypeName {
558
- return {
559
- changeOutput: FfiConverterTypeTxOutput.read(from),
560
- fundFee: FfiConverterUInt64.read(from),
561
- cetFee: FfiConverterUInt64.read(from),
562
- };
563
- }
564
- write(value: TypeName, into: RustBuffer): void {
565
- FfiConverterTypeTxOutput.write(value.changeOutput, into);
566
- FfiConverterUInt64.write(value.fundFee, into);
567
- FfiConverterUInt64.write(value.cetFee, into);
568
- }
569
- allocationSize(value: TypeName): number {
570
- return (
571
- FfiConverterTypeTxOutput.allocationSize(value.changeOutput) +
572
- FfiConverterUInt64.allocationSize(value.fundFee) +
573
- FfiConverterUInt64.allocationSize(value.cetFee)
574
- );
575
- }
576
- }
577
- return new FFIConverter();
431
+ type TypeName = ChangeOutputAndFees;
432
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
433
+ read(from: RustBuffer): TypeName {
434
+ return {
435
+ changeOutput: FfiConverterTypeTxOutput.read(from),
436
+ fundFee: FfiConverterUInt64.read(from),
437
+ cetFee: FfiConverterUInt64.read(from)
438
+ };
439
+ }
440
+ write(value: TypeName, into: RustBuffer): void {
441
+ FfiConverterTypeTxOutput.write(value.changeOutput, into);
442
+ FfiConverterUInt64.write(value.fundFee, into);
443
+ FfiConverterUInt64.write(value.cetFee, into);
444
+ }
445
+ allocationSize(value: TypeName): number {
446
+ return FfiConverterTypeTxOutput.allocationSize(value.changeOutput) +
447
+ FfiConverterUInt64.allocationSize(value.fundFee) +
448
+ FfiConverterUInt64.allocationSize(value.cetFee);
449
+
450
+ }
451
+ };
452
+ return new FFIConverter();
578
453
  })();
579
454
 
455
+
580
456
  export type DlcInputInfo = {
581
- fundTx: Transaction;
582
- fundVout: /*u32*/ number;
583
- localFundPubkey: Array</*u8*/ number>;
584
- remoteFundPubkey: Array</*u8*/ number>;
585
- fundAmount: /*u64*/ bigint;
586
- maxWitnessLen: /*u32*/ number;
587
- inputSerialId: /*u64*/ bigint;
588
- contractId: Array</*u8*/ number>;
589
- };
457
+ fundTx: Transaction,
458
+ fundVout: /*u32*/number,
459
+ localFundPubkey: Array</*u8*/number>,
460
+ remoteFundPubkey: Array</*u8*/number>,
461
+ fundAmount: /*u64*/bigint,
462
+ maxWitnessLen: /*u32*/number,
463
+ inputSerialId: /*u64*/bigint,
464
+ contractId: Array</*u8*/number>
465
+ }
590
466
 
591
467
  /**
592
468
  * Generated factory for {@link DlcInputInfo} record objects.
593
469
  */
594
470
  export const DlcInputInfo = (() => {
595
- const defaults = () => ({});
596
- const create = (() => {
597
- return uniffiCreateRecord<DlcInputInfo, ReturnType<typeof defaults>>(
598
- defaults
599
- );
600
- })();
601
- return Object.freeze({
602
- /**
603
- * Create a frozen instance of {@link DlcInputInfo}, with defaults specified
604
- * in Rust, in the {@link ddk_ffi} crate.
605
- */
606
- create,
607
-
608
- /**
609
- * Create a frozen instance of {@link DlcInputInfo}, with defaults specified
610
- * in Rust, in the {@link ddk_ffi} crate.
611
- */
612
- new: create,
613
-
614
- /**
615
- * Defaults specified in the {@link ddk_ffi} crate.
616
- */
617
- defaults: () => Object.freeze(defaults()) as Partial<DlcInputInfo>,
618
- });
471
+ const defaults = () => ({
472
+ });
473
+ const create = (() => {
474
+ return uniffiCreateRecord<DlcInputInfo, ReturnType<typeof defaults>>(defaults);
475
+ })();
476
+ return Object.freeze({
477
+ /**
478
+ * Create a frozen instance of {@link DlcInputInfo}, with defaults specified
479
+ * in Rust, in the {@link ddk_ffi} crate.
480
+ */
481
+ create,
482
+
483
+ /**
484
+ * Create a frozen instance of {@link DlcInputInfo}, with defaults specified
485
+ * in Rust, in the {@link ddk_ffi} crate.
486
+ */
487
+ new: create,
488
+
489
+ /**
490
+ * Defaults specified in the {@link ddk_ffi} crate.
491
+ */
492
+ defaults: () => Object.freeze(defaults()) as Partial<DlcInputInfo>,
493
+ });
619
494
  })();
620
495
 
621
496
  const FfiConverterTypeDlcInputInfo = (() => {
622
- type TypeName = DlcInputInfo;
623
- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
624
- read(from: RustBuffer): TypeName {
625
- return {
626
- fundTx: FfiConverterTypeTransaction.read(from),
627
- fundVout: FfiConverterUInt32.read(from),
628
- localFundPubkey: FfiConverterArrayUInt8.read(from),
629
- remoteFundPubkey: FfiConverterArrayUInt8.read(from),
630
- fundAmount: FfiConverterUInt64.read(from),
631
- maxWitnessLen: FfiConverterUInt32.read(from),
632
- inputSerialId: FfiConverterUInt64.read(from),
633
- contractId: FfiConverterArrayUInt8.read(from),
634
- };
635
- }
636
- write(value: TypeName, into: RustBuffer): void {
637
- FfiConverterTypeTransaction.write(value.fundTx, into);
638
- FfiConverterUInt32.write(value.fundVout, into);
639
- FfiConverterArrayUInt8.write(value.localFundPubkey, into);
640
- FfiConverterArrayUInt8.write(value.remoteFundPubkey, into);
641
- FfiConverterUInt64.write(value.fundAmount, into);
642
- FfiConverterUInt32.write(value.maxWitnessLen, into);
643
- FfiConverterUInt64.write(value.inputSerialId, into);
644
- FfiConverterArrayUInt8.write(value.contractId, into);
645
- }
646
- allocationSize(value: TypeName): number {
647
- return (
648
- FfiConverterTypeTransaction.allocationSize(value.fundTx) +
649
- FfiConverterUInt32.allocationSize(value.fundVout) +
650
- FfiConverterArrayUInt8.allocationSize(value.localFundPubkey) +
651
- FfiConverterArrayUInt8.allocationSize(value.remoteFundPubkey) +
652
- FfiConverterUInt64.allocationSize(value.fundAmount) +
653
- FfiConverterUInt32.allocationSize(value.maxWitnessLen) +
654
- FfiConverterUInt64.allocationSize(value.inputSerialId) +
655
- FfiConverterArrayUInt8.allocationSize(value.contractId)
656
- );
657
- }
658
- }
659
- return new FFIConverter();
497
+ type TypeName = DlcInputInfo;
498
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
499
+ read(from: RustBuffer): TypeName {
500
+ return {
501
+ fundTx: FfiConverterTypeTransaction.read(from),
502
+ fundVout: FfiConverterUInt32.read(from),
503
+ localFundPubkey: FfiConverterArrayUInt8.read(from),
504
+ remoteFundPubkey: FfiConverterArrayUInt8.read(from),
505
+ fundAmount: FfiConverterUInt64.read(from),
506
+ maxWitnessLen: FfiConverterUInt32.read(from),
507
+ inputSerialId: FfiConverterUInt64.read(from),
508
+ contractId: FfiConverterArrayUInt8.read(from)
509
+ };
510
+ }
511
+ write(value: TypeName, into: RustBuffer): void {
512
+ FfiConverterTypeTransaction.write(value.fundTx, into);
513
+ FfiConverterUInt32.write(value.fundVout, into);
514
+ FfiConverterArrayUInt8.write(value.localFundPubkey, into);
515
+ FfiConverterArrayUInt8.write(value.remoteFundPubkey, into);
516
+ FfiConverterUInt64.write(value.fundAmount, into);
517
+ FfiConverterUInt32.write(value.maxWitnessLen, into);
518
+ FfiConverterUInt64.write(value.inputSerialId, into);
519
+ FfiConverterArrayUInt8.write(value.contractId, into);
520
+ }
521
+ allocationSize(value: TypeName): number {
522
+ return FfiConverterTypeTransaction.allocationSize(value.fundTx) +
523
+ FfiConverterUInt32.allocationSize(value.fundVout) +
524
+ FfiConverterArrayUInt8.allocationSize(value.localFundPubkey) +
525
+ FfiConverterArrayUInt8.allocationSize(value.remoteFundPubkey) +
526
+ FfiConverterUInt64.allocationSize(value.fundAmount) +
527
+ FfiConverterUInt32.allocationSize(value.maxWitnessLen) +
528
+ FfiConverterUInt64.allocationSize(value.inputSerialId) +
529
+ FfiConverterArrayUInt8.allocationSize(value.contractId);
530
+
531
+ }
532
+ };
533
+ return new FFIConverter();
660
534
  })();
661
535
 
536
+
662
537
  export type DlcOutcome = {
663
- localPayout: /*u64*/ bigint;
664
- remotePayout: /*u64*/ bigint;
665
- };
538
+ localPayout: /*u64*/bigint,
539
+ remotePayout: /*u64*/bigint
540
+ }
666
541
 
667
542
  /**
668
543
  * Generated factory for {@link DlcOutcome} record objects.
669
544
  */
670
545
  export const DlcOutcome = (() => {
671
- const defaults = () => ({});
672
- const create = (() => {
673
- return uniffiCreateRecord<DlcOutcome, ReturnType<typeof defaults>>(
674
- defaults
675
- );
676
- })();
677
- return Object.freeze({
678
- /**
679
- * Create a frozen instance of {@link DlcOutcome}, with defaults specified
680
- * in Rust, in the {@link ddk_ffi} crate.
681
- */
682
- create,
683
-
684
- /**
685
- * Create a frozen instance of {@link DlcOutcome}, with defaults specified
686
- * in Rust, in the {@link ddk_ffi} crate.
687
- */
688
- new: create,
689
-
690
- /**
691
- * Defaults specified in the {@link ddk_ffi} crate.
692
- */
693
- defaults: () => Object.freeze(defaults()) as Partial<DlcOutcome>,
694
- });
546
+ const defaults = () => ({
547
+ });
548
+ const create = (() => {
549
+ return uniffiCreateRecord<DlcOutcome, ReturnType<typeof defaults>>(defaults);
550
+ })();
551
+ return Object.freeze({
552
+ /**
553
+ * Create a frozen instance of {@link DlcOutcome}, with defaults specified
554
+ * in Rust, in the {@link ddk_ffi} crate.
555
+ */
556
+ create,
557
+
558
+ /**
559
+ * Create a frozen instance of {@link DlcOutcome}, with defaults specified
560
+ * in Rust, in the {@link ddk_ffi} crate.
561
+ */
562
+ new: create,
563
+
564
+ /**
565
+ * Defaults specified in the {@link ddk_ffi} crate.
566
+ */
567
+ defaults: () => Object.freeze(defaults()) as Partial<DlcOutcome>,
568
+ });
695
569
  })();
696
570
 
697
571
  const FfiConverterTypeDlcOutcome = (() => {
698
- type TypeName = DlcOutcome;
699
- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
700
- read(from: RustBuffer): TypeName {
701
- return {
702
- localPayout: FfiConverterUInt64.read(from),
703
- remotePayout: FfiConverterUInt64.read(from),
704
- };
705
- }
706
- write(value: TypeName, into: RustBuffer): void {
707
- FfiConverterUInt64.write(value.localPayout, into);
708
- FfiConverterUInt64.write(value.remotePayout, into);
709
- }
710
- allocationSize(value: TypeName): number {
711
- return (
712
- FfiConverterUInt64.allocationSize(value.localPayout) +
713
- FfiConverterUInt64.allocationSize(value.remotePayout)
714
- );
715
- }
716
- }
717
- return new FFIConverter();
572
+ type TypeName = DlcOutcome;
573
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
574
+ read(from: RustBuffer): TypeName {
575
+ return {
576
+ localPayout: FfiConverterUInt64.read(from),
577
+ remotePayout: FfiConverterUInt64.read(from)
578
+ };
579
+ }
580
+ write(value: TypeName, into: RustBuffer): void {
581
+ FfiConverterUInt64.write(value.localPayout, into);
582
+ FfiConverterUInt64.write(value.remotePayout, into);
583
+ }
584
+ allocationSize(value: TypeName): number {
585
+ return FfiConverterUInt64.allocationSize(value.localPayout) +
586
+ FfiConverterUInt64.allocationSize(value.remotePayout);
587
+
588
+ }
589
+ };
590
+ return new FFIConverter();
718
591
  })();
719
592
 
593
+
720
594
  export type DlcTransactions = {
721
- fund: Transaction;
722
- cets: Array<Transaction>;
723
- refund: Transaction;
724
- fundingScriptPubkey: Array</*u8*/ number>;
725
- };
595
+ fund: Transaction,
596
+ cets: Array<Transaction>,
597
+ refund: Transaction,
598
+ fundingScriptPubkey: Array</*u8*/number>
599
+ }
726
600
 
727
601
  /**
728
602
  * Generated factory for {@link DlcTransactions} record objects.
729
603
  */
730
604
  export const DlcTransactions = (() => {
731
- const defaults = () => ({});
732
- const create = (() => {
733
- return uniffiCreateRecord<DlcTransactions, ReturnType<typeof defaults>>(
734
- defaults
735
- );
736
- })();
737
- return Object.freeze({
738
- /**
739
- * Create a frozen instance of {@link DlcTransactions}, with defaults specified
740
- * in Rust, in the {@link ddk_ffi} crate.
741
- */
742
- create,
743
-
744
- /**
745
- * Create a frozen instance of {@link DlcTransactions}, with defaults specified
746
- * in Rust, in the {@link ddk_ffi} crate.
747
- */
748
- new: create,
749
-
750
- /**
751
- * Defaults specified in the {@link ddk_ffi} crate.
752
- */
753
- defaults: () => Object.freeze(defaults()) as Partial<DlcTransactions>,
754
- });
605
+ const defaults = () => ({
606
+ });
607
+ const create = (() => {
608
+ return uniffiCreateRecord<DlcTransactions, ReturnType<typeof defaults>>(defaults);
609
+ })();
610
+ return Object.freeze({
611
+ /**
612
+ * Create a frozen instance of {@link DlcTransactions}, with defaults specified
613
+ * in Rust, in the {@link ddk_ffi} crate.
614
+ */
615
+ create,
616
+
617
+ /**
618
+ * Create a frozen instance of {@link DlcTransactions}, with defaults specified
619
+ * in Rust, in the {@link ddk_ffi} crate.
620
+ */
621
+ new: create,
622
+
623
+ /**
624
+ * Defaults specified in the {@link ddk_ffi} crate.
625
+ */
626
+ defaults: () => Object.freeze(defaults()) as Partial<DlcTransactions>,
627
+ });
755
628
  })();
756
629
 
757
630
  const FfiConverterTypeDlcTransactions = (() => {
758
- type TypeName = DlcTransactions;
759
- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
760
- read(from: RustBuffer): TypeName {
761
- return {
762
- fund: FfiConverterTypeTransaction.read(from),
763
- cets: FfiConverterArrayTypeTransaction.read(from),
764
- refund: FfiConverterTypeTransaction.read(from),
765
- fundingScriptPubkey: FfiConverterArrayUInt8.read(from),
766
- };
767
- }
768
- write(value: TypeName, into: RustBuffer): void {
769
- FfiConverterTypeTransaction.write(value.fund, into);
770
- FfiConverterArrayTypeTransaction.write(value.cets, into);
771
- FfiConverterTypeTransaction.write(value.refund, into);
772
- FfiConverterArrayUInt8.write(value.fundingScriptPubkey, into);
773
- }
774
- allocationSize(value: TypeName): number {
775
- return (
776
- FfiConverterTypeTransaction.allocationSize(value.fund) +
777
- FfiConverterArrayTypeTransaction.allocationSize(value.cets) +
778
- FfiConverterTypeTransaction.allocationSize(value.refund) +
779
- FfiConverterArrayUInt8.allocationSize(value.fundingScriptPubkey)
780
- );
781
- }
782
- }
783
- return new FFIConverter();
631
+ type TypeName = DlcTransactions;
632
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
633
+ read(from: RustBuffer): TypeName {
634
+ return {
635
+ fund: FfiConverterTypeTransaction.read(from),
636
+ cets: FfiConverterArrayTypeTransaction.read(from),
637
+ refund: FfiConverterTypeTransaction.read(from),
638
+ fundingScriptPubkey: FfiConverterArrayUInt8.read(from)
639
+ };
640
+ }
641
+ write(value: TypeName, into: RustBuffer): void {
642
+ FfiConverterTypeTransaction.write(value.fund, into);
643
+ FfiConverterArrayTypeTransaction.write(value.cets, into);
644
+ FfiConverterTypeTransaction.write(value.refund, into);
645
+ FfiConverterArrayUInt8.write(value.fundingScriptPubkey, into);
646
+ }
647
+ allocationSize(value: TypeName): number {
648
+ return FfiConverterTypeTransaction.allocationSize(value.fund) +
649
+ FfiConverterArrayTypeTransaction.allocationSize(value.cets) +
650
+ FfiConverterTypeTransaction.allocationSize(value.refund) +
651
+ FfiConverterArrayUInt8.allocationSize(value.fundingScriptPubkey);
652
+
653
+ }
654
+ };
655
+ return new FFIConverter();
784
656
  })();
785
657
 
658
+
786
659
  export type OracleInfo = {
787
- publicKey: Array</*u8*/ number>;
788
- nonces: Array<Array</*u8*/ number>>;
789
- };
660
+ publicKey: Array</*u8*/number>,
661
+ nonces: Array<Array</*u8*/number>>
662
+ }
790
663
 
791
664
  /**
792
665
  * Generated factory for {@link OracleInfo} record objects.
793
666
  */
794
667
  export const OracleInfo = (() => {
795
- const defaults = () => ({});
796
- const create = (() => {
797
- return uniffiCreateRecord<OracleInfo, ReturnType<typeof defaults>>(
798
- defaults
799
- );
800
- })();
801
- return Object.freeze({
802
- /**
803
- * Create a frozen instance of {@link OracleInfo}, with defaults specified
804
- * in Rust, in the {@link ddk_ffi} crate.
805
- */
806
- create,
807
-
808
- /**
809
- * Create a frozen instance of {@link OracleInfo}, with defaults specified
810
- * in Rust, in the {@link ddk_ffi} crate.
811
- */
812
- new: create,
813
-
814
- /**
815
- * Defaults specified in the {@link ddk_ffi} crate.
816
- */
817
- defaults: () => Object.freeze(defaults()) as Partial<OracleInfo>,
818
- });
668
+ const defaults = () => ({
669
+ });
670
+ const create = (() => {
671
+ return uniffiCreateRecord<OracleInfo, ReturnType<typeof defaults>>(defaults);
672
+ })();
673
+ return Object.freeze({
674
+ /**
675
+ * Create a frozen instance of {@link OracleInfo}, with defaults specified
676
+ * in Rust, in the {@link ddk_ffi} crate.
677
+ */
678
+ create,
679
+
680
+ /**
681
+ * Create a frozen instance of {@link OracleInfo}, with defaults specified
682
+ * in Rust, in the {@link ddk_ffi} crate.
683
+ */
684
+ new: create,
685
+
686
+ /**
687
+ * Defaults specified in the {@link ddk_ffi} crate.
688
+ */
689
+ defaults: () => Object.freeze(defaults()) as Partial<OracleInfo>,
690
+ });
819
691
  })();
820
692
 
821
693
  const FfiConverterTypeOracleInfo = (() => {
822
- type TypeName = OracleInfo;
823
- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
824
- read(from: RustBuffer): TypeName {
825
- return {
826
- publicKey: FfiConverterArrayUInt8.read(from),
827
- nonces: FfiConverterArrayArrayUInt8.read(from),
828
- };
829
- }
830
- write(value: TypeName, into: RustBuffer): void {
831
- FfiConverterArrayUInt8.write(value.publicKey, into);
832
- FfiConverterArrayArrayUInt8.write(value.nonces, into);
833
- }
834
- allocationSize(value: TypeName): number {
835
- return (
836
- FfiConverterArrayUInt8.allocationSize(value.publicKey) +
837
- FfiConverterArrayArrayUInt8.allocationSize(value.nonces)
838
- );
839
- }
840
- }
841
- return new FFIConverter();
694
+ type TypeName = OracleInfo;
695
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
696
+ read(from: RustBuffer): TypeName {
697
+ return {
698
+ publicKey: FfiConverterArrayUInt8.read(from),
699
+ nonces: FfiConverterArrayArrayUInt8.read(from)
700
+ };
701
+ }
702
+ write(value: TypeName, into: RustBuffer): void {
703
+ FfiConverterArrayUInt8.write(value.publicKey, into);
704
+ FfiConverterArrayArrayUInt8.write(value.nonces, into);
705
+ }
706
+ allocationSize(value: TypeName): number {
707
+ return FfiConverterArrayUInt8.allocationSize(value.publicKey) +
708
+ FfiConverterArrayArrayUInt8.allocationSize(value.nonces);
709
+
710
+ }
711
+ };
712
+ return new FFIConverter();
842
713
  })();
843
714
 
715
+
844
716
  export type PartyParams = {
845
- fundPubkey: Array</*u8*/ number>;
846
- changeScriptPubkey: Array</*u8*/ number>;
847
- changeSerialId: /*u64*/ bigint;
848
- payoutScriptPubkey: Array</*u8*/ number>;
849
- payoutSerialId: /*u64*/ bigint;
850
- inputs: Array<TxInputInfo>;
851
- inputAmount: /*u64*/ bigint;
852
- collateral: /*u64*/ bigint;
853
- dlcInputs: Array<DlcInputInfo>;
854
- };
717
+ fundPubkey: Array</*u8*/number>,
718
+ changeScriptPubkey: Array</*u8*/number>,
719
+ changeSerialId: /*u64*/bigint,
720
+ payoutScriptPubkey: Array</*u8*/number>,
721
+ payoutSerialId: /*u64*/bigint,
722
+ inputs: Array<TxInputInfo>,
723
+ inputAmount: /*u64*/bigint,
724
+ collateral: /*u64*/bigint,
725
+ dlcInputs: Array<DlcInputInfo>
726
+ }
855
727
 
856
728
  /**
857
729
  * Generated factory for {@link PartyParams} record objects.
858
730
  */
859
731
  export const PartyParams = (() => {
860
- const defaults = () => ({});
861
- const create = (() => {
862
- return uniffiCreateRecord<PartyParams, ReturnType<typeof defaults>>(
863
- defaults
864
- );
865
- })();
866
- return Object.freeze({
867
- /**
868
- * Create a frozen instance of {@link PartyParams}, with defaults specified
869
- * in Rust, in the {@link ddk_ffi} crate.
870
- */
871
- create,
872
-
873
- /**
874
- * Create a frozen instance of {@link PartyParams}, with defaults specified
875
- * in Rust, in the {@link ddk_ffi} crate.
876
- */
877
- new: create,
878
-
879
- /**
880
- * Defaults specified in the {@link ddk_ffi} crate.
881
- */
882
- defaults: () => Object.freeze(defaults()) as Partial<PartyParams>,
883
- });
732
+ const defaults = () => ({
733
+ });
734
+ const create = (() => {
735
+ return uniffiCreateRecord<PartyParams, ReturnType<typeof defaults>>(defaults);
736
+ })();
737
+ return Object.freeze({
738
+ /**
739
+ * Create a frozen instance of {@link PartyParams}, with defaults specified
740
+ * in Rust, in the {@link ddk_ffi} crate.
741
+ */
742
+ create,
743
+
744
+ /**
745
+ * Create a frozen instance of {@link PartyParams}, with defaults specified
746
+ * in Rust, in the {@link ddk_ffi} crate.
747
+ */
748
+ new: create,
749
+
750
+ /**
751
+ * Defaults specified in the {@link ddk_ffi} crate.
752
+ */
753
+ defaults: () => Object.freeze(defaults()) as Partial<PartyParams>,
754
+ });
884
755
  })();
885
756
 
886
757
  const FfiConverterTypePartyParams = (() => {
887
- type TypeName = PartyParams;
888
- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
889
- read(from: RustBuffer): TypeName {
890
- return {
891
- fundPubkey: FfiConverterArrayUInt8.read(from),
892
- changeScriptPubkey: FfiConverterArrayUInt8.read(from),
893
- changeSerialId: FfiConverterUInt64.read(from),
894
- payoutScriptPubkey: FfiConverterArrayUInt8.read(from),
895
- payoutSerialId: FfiConverterUInt64.read(from),
896
- inputs: FfiConverterArrayTypeTxInputInfo.read(from),
897
- inputAmount: FfiConverterUInt64.read(from),
898
- collateral: FfiConverterUInt64.read(from),
899
- dlcInputs: FfiConverterArrayTypeDlcInputInfo.read(from),
900
- };
901
- }
902
- write(value: TypeName, into: RustBuffer): void {
903
- FfiConverterArrayUInt8.write(value.fundPubkey, into);
904
- FfiConverterArrayUInt8.write(value.changeScriptPubkey, into);
905
- FfiConverterUInt64.write(value.changeSerialId, into);
906
- FfiConverterArrayUInt8.write(value.payoutScriptPubkey, into);
907
- FfiConverterUInt64.write(value.payoutSerialId, into);
908
- FfiConverterArrayTypeTxInputInfo.write(value.inputs, into);
909
- FfiConverterUInt64.write(value.inputAmount, into);
910
- FfiConverterUInt64.write(value.collateral, into);
911
- FfiConverterArrayTypeDlcInputInfo.write(value.dlcInputs, into);
912
- }
913
- allocationSize(value: TypeName): number {
914
- return (
915
- FfiConverterArrayUInt8.allocationSize(value.fundPubkey) +
916
- FfiConverterArrayUInt8.allocationSize(value.changeScriptPubkey) +
917
- FfiConverterUInt64.allocationSize(value.changeSerialId) +
918
- FfiConverterArrayUInt8.allocationSize(value.payoutScriptPubkey) +
919
- FfiConverterUInt64.allocationSize(value.payoutSerialId) +
920
- FfiConverterArrayTypeTxInputInfo.allocationSize(value.inputs) +
921
- FfiConverterUInt64.allocationSize(value.inputAmount) +
922
- FfiConverterUInt64.allocationSize(value.collateral) +
923
- FfiConverterArrayTypeDlcInputInfo.allocationSize(value.dlcInputs)
924
- );
925
- }
926
- }
927
- return new FFIConverter();
758
+ type TypeName = PartyParams;
759
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
760
+ read(from: RustBuffer): TypeName {
761
+ return {
762
+ fundPubkey: FfiConverterArrayUInt8.read(from),
763
+ changeScriptPubkey: FfiConverterArrayUInt8.read(from),
764
+ changeSerialId: FfiConverterUInt64.read(from),
765
+ payoutScriptPubkey: FfiConverterArrayUInt8.read(from),
766
+ payoutSerialId: FfiConverterUInt64.read(from),
767
+ inputs: FfiConverterArrayTypeTxInputInfo.read(from),
768
+ inputAmount: FfiConverterUInt64.read(from),
769
+ collateral: FfiConverterUInt64.read(from),
770
+ dlcInputs: FfiConverterArrayTypeDlcInputInfo.read(from)
771
+ };
772
+ }
773
+ write(value: TypeName, into: RustBuffer): void {
774
+ FfiConverterArrayUInt8.write(value.fundPubkey, into);
775
+ FfiConverterArrayUInt8.write(value.changeScriptPubkey, into);
776
+ FfiConverterUInt64.write(value.changeSerialId, into);
777
+ FfiConverterArrayUInt8.write(value.payoutScriptPubkey, into);
778
+ FfiConverterUInt64.write(value.payoutSerialId, into);
779
+ FfiConverterArrayTypeTxInputInfo.write(value.inputs, into);
780
+ FfiConverterUInt64.write(value.inputAmount, into);
781
+ FfiConverterUInt64.write(value.collateral, into);
782
+ FfiConverterArrayTypeDlcInputInfo.write(value.dlcInputs, into);
783
+ }
784
+ allocationSize(value: TypeName): number {
785
+ return FfiConverterArrayUInt8.allocationSize(value.fundPubkey) +
786
+ FfiConverterArrayUInt8.allocationSize(value.changeScriptPubkey) +
787
+ FfiConverterUInt64.allocationSize(value.changeSerialId) +
788
+ FfiConverterArrayUInt8.allocationSize(value.payoutScriptPubkey) +
789
+ FfiConverterUInt64.allocationSize(value.payoutSerialId) +
790
+ FfiConverterArrayTypeTxInputInfo.allocationSize(value.inputs) +
791
+ FfiConverterUInt64.allocationSize(value.inputAmount) +
792
+ FfiConverterUInt64.allocationSize(value.collateral) +
793
+ FfiConverterArrayTypeDlcInputInfo.allocationSize(value.dlcInputs);
794
+
795
+ }
796
+ };
797
+ return new FFIConverter();
928
798
  })();
929
799
 
800
+
930
801
  export type Payout = {
931
- offer: /*u64*/ bigint;
932
- accept: /*u64*/ bigint;
933
- };
802
+ offer: /*u64*/bigint,
803
+ accept: /*u64*/bigint
804
+ }
934
805
 
935
806
  /**
936
807
  * Generated factory for {@link Payout} record objects.
937
808
  */
938
809
  export const Payout = (() => {
939
- const defaults = () => ({});
940
- const create = (() => {
941
- return uniffiCreateRecord<Payout, ReturnType<typeof defaults>>(defaults);
942
- })();
943
- return Object.freeze({
944
- /**
945
- * Create a frozen instance of {@link Payout}, with defaults specified
946
- * in Rust, in the {@link ddk_ffi} crate.
947
- */
948
- create,
949
-
950
- /**
951
- * Create a frozen instance of {@link Payout}, with defaults specified
952
- * in Rust, in the {@link ddk_ffi} crate.
953
- */
954
- new: create,
955
-
956
- /**
957
- * Defaults specified in the {@link ddk_ffi} crate.
958
- */
959
- defaults: () => Object.freeze(defaults()) as Partial<Payout>,
960
- });
810
+ const defaults = () => ({
811
+ });
812
+ const create = (() => {
813
+ return uniffiCreateRecord<Payout, ReturnType<typeof defaults>>(defaults);
814
+ })();
815
+ return Object.freeze({
816
+ /**
817
+ * Create a frozen instance of {@link Payout}, with defaults specified
818
+ * in Rust, in the {@link ddk_ffi} crate.
819
+ */
820
+ create,
821
+
822
+ /**
823
+ * Create a frozen instance of {@link Payout}, with defaults specified
824
+ * in Rust, in the {@link ddk_ffi} crate.
825
+ */
826
+ new: create,
827
+
828
+ /**
829
+ * Defaults specified in the {@link ddk_ffi} crate.
830
+ */
831
+ defaults: () => Object.freeze(defaults()) as Partial<Payout>,
832
+ });
961
833
  })();
962
834
 
963
835
  const FfiConverterTypePayout = (() => {
964
- type TypeName = Payout;
965
- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
966
- read(from: RustBuffer): TypeName {
967
- return {
968
- offer: FfiConverterUInt64.read(from),
969
- accept: FfiConverterUInt64.read(from),
970
- };
971
- }
972
- write(value: TypeName, into: RustBuffer): void {
973
- FfiConverterUInt64.write(value.offer, into);
974
- FfiConverterUInt64.write(value.accept, into);
975
- }
976
- allocationSize(value: TypeName): number {
977
- return (
978
- FfiConverterUInt64.allocationSize(value.offer) +
979
- FfiConverterUInt64.allocationSize(value.accept)
980
- );
981
- }
982
- }
983
- return new FFIConverter();
836
+ type TypeName = Payout;
837
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
838
+ read(from: RustBuffer): TypeName {
839
+ return {
840
+ offer: FfiConverterUInt64.read(from),
841
+ accept: FfiConverterUInt64.read(from)
842
+ };
843
+ }
844
+ write(value: TypeName, into: RustBuffer): void {
845
+ FfiConverterUInt64.write(value.offer, into);
846
+ FfiConverterUInt64.write(value.accept, into);
847
+ }
848
+ allocationSize(value: TypeName): number {
849
+ return FfiConverterUInt64.allocationSize(value.offer) +
850
+ FfiConverterUInt64.allocationSize(value.accept);
851
+
852
+ }
853
+ };
854
+ return new FFIConverter();
984
855
  })();
985
856
 
857
+
986
858
  export type Transaction = {
987
- version: /*i32*/ number;
988
- lockTime: /*u32*/ number;
989
- inputs: Array<TxInput>;
990
- outputs: Array<TxOutput>;
991
- rawBytes: Array</*u8*/ number>;
992
- };
859
+ version: /*i32*/number,
860
+ lockTime: /*u32*/number,
861
+ inputs: Array<TxInput>,
862
+ outputs: Array<TxOutput>,
863
+ rawBytes: Array</*u8*/number>
864
+ }
993
865
 
994
866
  /**
995
867
  * Generated factory for {@link Transaction} record objects.
996
868
  */
997
869
  export const Transaction = (() => {
998
- const defaults = () => ({});
999
- const create = (() => {
1000
- return uniffiCreateRecord<Transaction, ReturnType<typeof defaults>>(
1001
- defaults
1002
- );
1003
- })();
1004
- return Object.freeze({
1005
- /**
1006
- * Create a frozen instance of {@link Transaction}, with defaults specified
1007
- * in Rust, in the {@link ddk_ffi} crate.
1008
- */
1009
- create,
1010
-
1011
- /**
1012
- * Create a frozen instance of {@link Transaction}, with defaults specified
1013
- * in Rust, in the {@link ddk_ffi} crate.
1014
- */
1015
- new: create,
1016
-
1017
- /**
1018
- * Defaults specified in the {@link ddk_ffi} crate.
1019
- */
1020
- defaults: () => Object.freeze(defaults()) as Partial<Transaction>,
1021
- });
870
+ const defaults = () => ({
871
+ });
872
+ const create = (() => {
873
+ return uniffiCreateRecord<Transaction, ReturnType<typeof defaults>>(defaults);
874
+ })();
875
+ return Object.freeze({
876
+ /**
877
+ * Create a frozen instance of {@link Transaction}, with defaults specified
878
+ * in Rust, in the {@link ddk_ffi} crate.
879
+ */
880
+ create,
881
+
882
+ /**
883
+ * Create a frozen instance of {@link Transaction}, with defaults specified
884
+ * in Rust, in the {@link ddk_ffi} crate.
885
+ */
886
+ new: create,
887
+
888
+ /**
889
+ * Defaults specified in the {@link ddk_ffi} crate.
890
+ */
891
+ defaults: () => Object.freeze(defaults()) as Partial<Transaction>,
892
+ });
1022
893
  })();
1023
894
 
1024
895
  const FfiConverterTypeTransaction = (() => {
1025
- type TypeName = Transaction;
1026
- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
1027
- read(from: RustBuffer): TypeName {
1028
- return {
1029
- version: FfiConverterInt32.read(from),
1030
- lockTime: FfiConverterUInt32.read(from),
1031
- inputs: FfiConverterArrayTypeTxInput.read(from),
1032
- outputs: FfiConverterArrayTypeTxOutput.read(from),
1033
- rawBytes: FfiConverterArrayUInt8.read(from),
1034
- };
1035
- }
1036
- write(value: TypeName, into: RustBuffer): void {
1037
- FfiConverterInt32.write(value.version, into);
1038
- FfiConverterUInt32.write(value.lockTime, into);
1039
- FfiConverterArrayTypeTxInput.write(value.inputs, into);
1040
- FfiConverterArrayTypeTxOutput.write(value.outputs, into);
1041
- FfiConverterArrayUInt8.write(value.rawBytes, into);
1042
- }
1043
- allocationSize(value: TypeName): number {
1044
- return (
1045
- FfiConverterInt32.allocationSize(value.version) +
1046
- FfiConverterUInt32.allocationSize(value.lockTime) +
1047
- FfiConverterArrayTypeTxInput.allocationSize(value.inputs) +
1048
- FfiConverterArrayTypeTxOutput.allocationSize(value.outputs) +
1049
- FfiConverterArrayUInt8.allocationSize(value.rawBytes)
1050
- );
1051
- }
1052
- }
1053
- return new FFIConverter();
896
+ type TypeName = Transaction;
897
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
898
+ read(from: RustBuffer): TypeName {
899
+ return {
900
+ version: FfiConverterInt32.read(from),
901
+ lockTime: FfiConverterUInt32.read(from),
902
+ inputs: FfiConverterArrayTypeTxInput.read(from),
903
+ outputs: FfiConverterArrayTypeTxOutput.read(from),
904
+ rawBytes: FfiConverterArrayUInt8.read(from)
905
+ };
906
+ }
907
+ write(value: TypeName, into: RustBuffer): void {
908
+ FfiConverterInt32.write(value.version, into);
909
+ FfiConverterUInt32.write(value.lockTime, into);
910
+ FfiConverterArrayTypeTxInput.write(value.inputs, into);
911
+ FfiConverterArrayTypeTxOutput.write(value.outputs, into);
912
+ FfiConverterArrayUInt8.write(value.rawBytes, into);
913
+ }
914
+ allocationSize(value: TypeName): number {
915
+ return FfiConverterInt32.allocationSize(value.version) +
916
+ FfiConverterUInt32.allocationSize(value.lockTime) +
917
+ FfiConverterArrayTypeTxInput.allocationSize(value.inputs) +
918
+ FfiConverterArrayTypeTxOutput.allocationSize(value.outputs) +
919
+ FfiConverterArrayUInt8.allocationSize(value.rawBytes);
920
+
921
+ }
922
+ };
923
+ return new FFIConverter();
1054
924
  })();
1055
925
 
926
+
1056
927
  export type TxInput = {
1057
- txid: string;
1058
- vout: /*u32*/ number;
1059
- scriptSig: Array</*u8*/ number>;
1060
- sequence: /*u32*/ number;
1061
- witness: Array<Array</*u8*/ number>>;
1062
- };
928
+ txid: string,
929
+ vout: /*u32*/number,
930
+ scriptSig: Array</*u8*/number>,
931
+ sequence: /*u32*/number,
932
+ witness: Array<Array</*u8*/number>>
933
+ }
1063
934
 
1064
935
  /**
1065
936
  * Generated factory for {@link TxInput} record objects.
1066
937
  */
1067
938
  export const TxInput = (() => {
1068
- const defaults = () => ({});
1069
- const create = (() => {
1070
- return uniffiCreateRecord<TxInput, ReturnType<typeof defaults>>(defaults);
1071
- })();
1072
- return Object.freeze({
1073
- /**
1074
- * Create a frozen instance of {@link TxInput}, with defaults specified
1075
- * in Rust, in the {@link ddk_ffi} crate.
1076
- */
1077
- create,
1078
-
1079
- /**
1080
- * Create a frozen instance of {@link TxInput}, with defaults specified
1081
- * in Rust, in the {@link ddk_ffi} crate.
1082
- */
1083
- new: create,
1084
-
1085
- /**
1086
- * Defaults specified in the {@link ddk_ffi} crate.
1087
- */
1088
- defaults: () => Object.freeze(defaults()) as Partial<TxInput>,
1089
- });
939
+ const defaults = () => ({
940
+ });
941
+ const create = (() => {
942
+ return uniffiCreateRecord<TxInput, ReturnType<typeof defaults>>(defaults);
943
+ })();
944
+ return Object.freeze({
945
+ /**
946
+ * Create a frozen instance of {@link TxInput}, with defaults specified
947
+ * in Rust, in the {@link ddk_ffi} crate.
948
+ */
949
+ create,
950
+
951
+ /**
952
+ * Create a frozen instance of {@link TxInput}, with defaults specified
953
+ * in Rust, in the {@link ddk_ffi} crate.
954
+ */
955
+ new: create,
956
+
957
+ /**
958
+ * Defaults specified in the {@link ddk_ffi} crate.
959
+ */
960
+ defaults: () => Object.freeze(defaults()) as Partial<TxInput>,
961
+ });
1090
962
  })();
1091
963
 
1092
964
  const FfiConverterTypeTxInput = (() => {
1093
- type TypeName = TxInput;
1094
- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
1095
- read(from: RustBuffer): TypeName {
1096
- return {
1097
- txid: FfiConverterString.read(from),
1098
- vout: FfiConverterUInt32.read(from),
1099
- scriptSig: FfiConverterArrayUInt8.read(from),
1100
- sequence: FfiConverterUInt32.read(from),
1101
- witness: FfiConverterArrayArrayUInt8.read(from),
1102
- };
1103
- }
1104
- write(value: TypeName, into: RustBuffer): void {
1105
- FfiConverterString.write(value.txid, into);
1106
- FfiConverterUInt32.write(value.vout, into);
1107
- FfiConverterArrayUInt8.write(value.scriptSig, into);
1108
- FfiConverterUInt32.write(value.sequence, into);
1109
- FfiConverterArrayArrayUInt8.write(value.witness, into);
1110
- }
1111
- allocationSize(value: TypeName): number {
1112
- return (
1113
- FfiConverterString.allocationSize(value.txid) +
1114
- FfiConverterUInt32.allocationSize(value.vout) +
1115
- FfiConverterArrayUInt8.allocationSize(value.scriptSig) +
1116
- FfiConverterUInt32.allocationSize(value.sequence) +
1117
- FfiConverterArrayArrayUInt8.allocationSize(value.witness)
1118
- );
1119
- }
1120
- }
1121
- return new FFIConverter();
965
+ type TypeName = TxInput;
966
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
967
+ read(from: RustBuffer): TypeName {
968
+ return {
969
+ txid: FfiConverterString.read(from),
970
+ vout: FfiConverterUInt32.read(from),
971
+ scriptSig: FfiConverterArrayUInt8.read(from),
972
+ sequence: FfiConverterUInt32.read(from),
973
+ witness: FfiConverterArrayArrayUInt8.read(from)
974
+ };
975
+ }
976
+ write(value: TypeName, into: RustBuffer): void {
977
+ FfiConverterString.write(value.txid, into);
978
+ FfiConverterUInt32.write(value.vout, into);
979
+ FfiConverterArrayUInt8.write(value.scriptSig, into);
980
+ FfiConverterUInt32.write(value.sequence, into);
981
+ FfiConverterArrayArrayUInt8.write(value.witness, into);
982
+ }
983
+ allocationSize(value: TypeName): number {
984
+ return FfiConverterString.allocationSize(value.txid) +
985
+ FfiConverterUInt32.allocationSize(value.vout) +
986
+ FfiConverterArrayUInt8.allocationSize(value.scriptSig) +
987
+ FfiConverterUInt32.allocationSize(value.sequence) +
988
+ FfiConverterArrayArrayUInt8.allocationSize(value.witness);
989
+
990
+ }
991
+ };
992
+ return new FFIConverter();
1122
993
  })();
1123
994
 
995
+
1124
996
  export type TxInputInfo = {
1125
- txid: string;
1126
- vout: /*u32*/ number;
1127
- scriptSig: Array</*u8*/ number>;
1128
- maxWitnessLength: /*u32*/ number;
1129
- serialId: /*u64*/ bigint;
1130
- };
997
+ txid: string,
998
+ vout: /*u32*/number,
999
+ scriptSig: Array</*u8*/number>,
1000
+ maxWitnessLength: /*u32*/number,
1001
+ serialId: /*u64*/bigint
1002
+ }
1131
1003
 
1132
1004
  /**
1133
1005
  * Generated factory for {@link TxInputInfo} record objects.
1134
1006
  */
1135
1007
  export const TxInputInfo = (() => {
1136
- const defaults = () => ({});
1137
- const create = (() => {
1138
- return uniffiCreateRecord<TxInputInfo, ReturnType<typeof defaults>>(
1139
- defaults
1140
- );
1141
- })();
1142
- return Object.freeze({
1143
- /**
1144
- * Create a frozen instance of {@link TxInputInfo}, with defaults specified
1145
- * in Rust, in the {@link ddk_ffi} crate.
1146
- */
1147
- create,
1148
-
1149
- /**
1150
- * Create a frozen instance of {@link TxInputInfo}, with defaults specified
1151
- * in Rust, in the {@link ddk_ffi} crate.
1152
- */
1153
- new: create,
1154
-
1155
- /**
1156
- * Defaults specified in the {@link ddk_ffi} crate.
1157
- */
1158
- defaults: () => Object.freeze(defaults()) as Partial<TxInputInfo>,
1159
- });
1008
+ const defaults = () => ({
1009
+ });
1010
+ const create = (() => {
1011
+ return uniffiCreateRecord<TxInputInfo, ReturnType<typeof defaults>>(defaults);
1012
+ })();
1013
+ return Object.freeze({
1014
+ /**
1015
+ * Create a frozen instance of {@link TxInputInfo}, with defaults specified
1016
+ * in Rust, in the {@link ddk_ffi} crate.
1017
+ */
1018
+ create,
1019
+
1020
+ /**
1021
+ * Create a frozen instance of {@link TxInputInfo}, with defaults specified
1022
+ * in Rust, in the {@link ddk_ffi} crate.
1023
+ */
1024
+ new: create,
1025
+
1026
+ /**
1027
+ * Defaults specified in the {@link ddk_ffi} crate.
1028
+ */
1029
+ defaults: () => Object.freeze(defaults()) as Partial<TxInputInfo>,
1030
+ });
1160
1031
  })();
1161
1032
 
1162
1033
  const FfiConverterTypeTxInputInfo = (() => {
1163
- type TypeName = TxInputInfo;
1164
- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
1165
- read(from: RustBuffer): TypeName {
1166
- return {
1167
- txid: FfiConverterString.read(from),
1168
- vout: FfiConverterUInt32.read(from),
1169
- scriptSig: FfiConverterArrayUInt8.read(from),
1170
- maxWitnessLength: FfiConverterUInt32.read(from),
1171
- serialId: FfiConverterUInt64.read(from),
1172
- };
1173
- }
1174
- write(value: TypeName, into: RustBuffer): void {
1175
- FfiConverterString.write(value.txid, into);
1176
- FfiConverterUInt32.write(value.vout, into);
1177
- FfiConverterArrayUInt8.write(value.scriptSig, into);
1178
- FfiConverterUInt32.write(value.maxWitnessLength, into);
1179
- FfiConverterUInt64.write(value.serialId, into);
1180
- }
1181
- allocationSize(value: TypeName): number {
1182
- return (
1183
- FfiConverterString.allocationSize(value.txid) +
1184
- FfiConverterUInt32.allocationSize(value.vout) +
1185
- FfiConverterArrayUInt8.allocationSize(value.scriptSig) +
1186
- FfiConverterUInt32.allocationSize(value.maxWitnessLength) +
1187
- FfiConverterUInt64.allocationSize(value.serialId)
1188
- );
1189
- }
1190
- }
1191
- return new FFIConverter();
1034
+ type TypeName = TxInputInfo;
1035
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
1036
+ read(from: RustBuffer): TypeName {
1037
+ return {
1038
+ txid: FfiConverterString.read(from),
1039
+ vout: FfiConverterUInt32.read(from),
1040
+ scriptSig: FfiConverterArrayUInt8.read(from),
1041
+ maxWitnessLength: FfiConverterUInt32.read(from),
1042
+ serialId: FfiConverterUInt64.read(from)
1043
+ };
1044
+ }
1045
+ write(value: TypeName, into: RustBuffer): void {
1046
+ FfiConverterString.write(value.txid, into);
1047
+ FfiConverterUInt32.write(value.vout, into);
1048
+ FfiConverterArrayUInt8.write(value.scriptSig, into);
1049
+ FfiConverterUInt32.write(value.maxWitnessLength, into);
1050
+ FfiConverterUInt64.write(value.serialId, into);
1051
+ }
1052
+ allocationSize(value: TypeName): number {
1053
+ return FfiConverterString.allocationSize(value.txid) +
1054
+ FfiConverterUInt32.allocationSize(value.vout) +
1055
+ FfiConverterArrayUInt8.allocationSize(value.scriptSig) +
1056
+ FfiConverterUInt32.allocationSize(value.maxWitnessLength) +
1057
+ FfiConverterUInt64.allocationSize(value.serialId);
1058
+
1059
+ }
1060
+ };
1061
+ return new FFIConverter();
1192
1062
  })();
1193
1063
 
1064
+
1194
1065
  export type TxOutput = {
1195
- value: /*u64*/ bigint;
1196
- scriptPubkey: Array</*u8*/ number>;
1197
- };
1066
+ value: /*u64*/bigint,
1067
+ scriptPubkey: Array</*u8*/number>
1068
+ }
1198
1069
 
1199
1070
  /**
1200
1071
  * Generated factory for {@link TxOutput} record objects.
1201
1072
  */
1202
1073
  export const TxOutput = (() => {
1203
- const defaults = () => ({});
1204
- const create = (() => {
1205
- return uniffiCreateRecord<TxOutput, ReturnType<typeof defaults>>(defaults);
1206
- })();
1207
- return Object.freeze({
1208
- /**
1209
- * Create a frozen instance of {@link TxOutput}, with defaults specified
1210
- * in Rust, in the {@link ddk_ffi} crate.
1211
- */
1212
- create,
1213
-
1214
- /**
1215
- * Create a frozen instance of {@link TxOutput}, with defaults specified
1216
- * in Rust, in the {@link ddk_ffi} crate.
1217
- */
1218
- new: create,
1219
-
1220
- /**
1221
- * Defaults specified in the {@link ddk_ffi} crate.
1222
- */
1223
- defaults: () => Object.freeze(defaults()) as Partial<TxOutput>,
1224
- });
1074
+ const defaults = () => ({
1075
+ });
1076
+ const create = (() => {
1077
+ return uniffiCreateRecord<TxOutput, ReturnType<typeof defaults>>(defaults);
1078
+ })();
1079
+ return Object.freeze({
1080
+ /**
1081
+ * Create a frozen instance of {@link TxOutput}, with defaults specified
1082
+ * in Rust, in the {@link ddk_ffi} crate.
1083
+ */
1084
+ create,
1085
+
1086
+ /**
1087
+ * Create a frozen instance of {@link TxOutput}, with defaults specified
1088
+ * in Rust, in the {@link ddk_ffi} crate.
1089
+ */
1090
+ new: create,
1091
+
1092
+ /**
1093
+ * Defaults specified in the {@link ddk_ffi} crate.
1094
+ */
1095
+ defaults: () => Object.freeze(defaults()) as Partial<TxOutput>,
1096
+ });
1225
1097
  })();
1226
1098
 
1227
1099
  const FfiConverterTypeTxOutput = (() => {
1228
- type TypeName = TxOutput;
1229
- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
1230
- read(from: RustBuffer): TypeName {
1231
- return {
1232
- value: FfiConverterUInt64.read(from),
1233
- scriptPubkey: FfiConverterArrayUInt8.read(from),
1234
- };
1235
- }
1236
- write(value: TypeName, into: RustBuffer): void {
1237
- FfiConverterUInt64.write(value.value, into);
1238
- FfiConverterArrayUInt8.write(value.scriptPubkey, into);
1239
- }
1240
- allocationSize(value: TypeName): number {
1241
- return (
1242
- FfiConverterUInt64.allocationSize(value.value) +
1243
- FfiConverterArrayUInt8.allocationSize(value.scriptPubkey)
1244
- );
1245
- }
1246
- }
1247
- return new FFIConverter();
1100
+ type TypeName = TxOutput;
1101
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
1102
+ read(from: RustBuffer): TypeName {
1103
+ return {
1104
+ value: FfiConverterUInt64.read(from),
1105
+ scriptPubkey: FfiConverterArrayUInt8.read(from)
1106
+ };
1107
+ }
1108
+ write(value: TypeName, into: RustBuffer): void {
1109
+ FfiConverterUInt64.write(value.value, into);
1110
+ FfiConverterArrayUInt8.write(value.scriptPubkey, into);
1111
+ }
1112
+ allocationSize(value: TypeName): number {
1113
+ return FfiConverterUInt64.allocationSize(value.value) +
1114
+ FfiConverterArrayUInt8.allocationSize(value.scriptPubkey);
1115
+
1116
+ }
1117
+ };
1118
+ return new FFIConverter();
1248
1119
  })();
1249
1120
 
1121
+
1250
1122
  const stringConverter = {
1251
- stringToBytes: (s: string) =>
1252
- uniffiCaller.rustCall((status) =>
1253
- nativeModule().ubrn_uniffi_internal_fn_func_ffi__string_to_arraybuffer(
1254
- s,
1255
- status
1256
- )
1257
- ),
1258
- bytesToString: (ab: UniffiByteArray) =>
1259
- uniffiCaller.rustCall((status) =>
1260
- nativeModule().ubrn_uniffi_internal_fn_func_ffi__arraybuffer_to_string(
1261
- ab,
1262
- status
1263
- )
1264
- ),
1265
- stringByteLength: (s: string) =>
1266
- uniffiCaller.rustCall((status) =>
1267
- nativeModule().ubrn_uniffi_internal_fn_func_ffi__string_to_byte_length(
1268
- s,
1269
- status
1270
- )
1271
- ),
1123
+ stringToBytes: (s: string) =>
1124
+ uniffiCaller.rustCall((status) => nativeModule().ubrn_uniffi_internal_fn_func_ffi__string_to_arraybuffer(s, status)),
1125
+ bytesToString: (ab: UniffiByteArray) =>
1126
+ uniffiCaller.rustCall((status) => nativeModule().ubrn_uniffi_internal_fn_func_ffi__arraybuffer_to_string(ab, status)),
1127
+ stringByteLength: (s: string) =>
1128
+ uniffiCaller.rustCall((status) => nativeModule().ubrn_uniffi_internal_fn_func_ffi__string_to_byte_length(s, status)),
1272
1129
  };
1273
1130
  const FfiConverterString = uniffiCreateFfiConverterString(stringConverter);
1274
1131
 
1275
- // Flat error type: DlcError
1276
- export enum DlcError_Tags {
1277
- InvalidSignature = 'InvalidSignature',
1278
- InvalidPublicKey = 'InvalidPublicKey',
1279
- InvalidTransaction = 'InvalidTransaction',
1280
- InsufficientFunds = 'InsufficientFunds',
1281
- InvalidArgument = 'InvalidArgument',
1282
- SerializationError = 'SerializationError',
1283
- Secp256k1Error = 'Secp256k1Error',
1284
- MiniscriptError = 'MiniscriptError',
1285
- NetworkError = 'NetworkError',
1286
- }
1287
- export const DlcError = (() => {
1288
- class InvalidSignature extends UniffiError {
1289
- /**
1290
- * @private
1291
- * This field is private and should not be used.
1292
- */
1293
- readonly [uniffiTypeNameSymbol]: string = 'DlcError';
1294
- /**
1295
- * @private
1296
- * This field is private and should not be used.
1297
- */
1298
- readonly [variantOrdinalSymbol] = 1;
1299
-
1300
- public readonly tag = DlcError_Tags.InvalidSignature;
1301
-
1302
- constructor(message: string) {
1303
- super('DlcError', 'InvalidSignature', message);
1304
- }
1305
1132
 
1306
- static instanceOf(e: any): e is InvalidSignature {
1307
- return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 1;
1308
- }
1309
- }
1310
- class InvalidPublicKey extends UniffiError {
1311
- /**
1312
- * @private
1313
- * This field is private and should not be used.
1314
- */
1315
- readonly [uniffiTypeNameSymbol]: string = 'DlcError';
1316
- /**
1317
- * @private
1318
- * This field is private and should not be used.
1319
- */
1320
- readonly [variantOrdinalSymbol] = 2;
1321
-
1322
- public readonly tag = DlcError_Tags.InvalidPublicKey;
1323
-
1324
- constructor(message: string) {
1325
- super('DlcError', 'InvalidPublicKey', message);
1326
- }
1327
1133
 
1328
- static instanceOf(e: any): e is InvalidPublicKey {
1329
- return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 2;
1330
- }
1331
- }
1332
- class InvalidTransaction extends UniffiError {
1333
- /**
1334
- * @private
1335
- * This field is private and should not be used.
1336
- */
1337
- readonly [uniffiTypeNameSymbol]: string = 'DlcError';
1338
- /**
1339
- * @private
1340
- * This field is private and should not be used.
1341
- */
1342
- readonly [variantOrdinalSymbol] = 3;
1343
-
1344
- public readonly tag = DlcError_Tags.InvalidTransaction;
1345
-
1346
- constructor(message: string) {
1347
- super('DlcError', 'InvalidTransaction', message);
1348
- }
1349
1134
 
1350
- static instanceOf(e: any): e is InvalidTransaction {
1351
- return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 3;
1352
- }
1353
- }
1354
- class InsufficientFunds extends UniffiError {
1355
- /**
1356
- * @private
1357
- * This field is private and should not be used.
1358
- */
1359
- readonly [uniffiTypeNameSymbol]: string = 'DlcError';
1360
- /**
1361
- * @private
1362
- * This field is private and should not be used.
1363
- */
1364
- readonly [variantOrdinalSymbol] = 4;
1365
-
1366
- public readonly tag = DlcError_Tags.InsufficientFunds;
1367
-
1368
- constructor(message: string) {
1369
- super('DlcError', 'InsufficientFunds', message);
1370
- }
1371
1135
 
1372
- static instanceOf(e: any): e is InsufficientFunds {
1373
- return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 4;
1374
- }
1375
- }
1376
- class InvalidArgument extends UniffiError {
1377
- /**
1378
- * @private
1379
- * This field is private and should not be used.
1380
- */
1381
- readonly [uniffiTypeNameSymbol]: string = 'DlcError';
1382
- /**
1383
- * @private
1384
- * This field is private and should not be used.
1385
- */
1386
- readonly [variantOrdinalSymbol] = 5;
1387
-
1388
- public readonly tag = DlcError_Tags.InvalidArgument;
1389
-
1390
- constructor(message: string) {
1391
- super('DlcError', 'InvalidArgument', message);
1392
- }
1393
1136
 
1394
- static instanceOf(e: any): e is InvalidArgument {
1395
- return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 5;
1137
+
1138
+
1139
+
1140
+ // Flat error type: DlcError
1141
+ export enum DlcError_Tags {
1142
+ InvalidSignature = "InvalidSignature",
1143
+ InvalidPublicKey = "InvalidPublicKey",
1144
+ InvalidTransaction = "InvalidTransaction",
1145
+ InsufficientFunds = "InsufficientFunds",
1146
+ InvalidArgument = "InvalidArgument",
1147
+ SerializationError = "SerializationError",
1148
+ Secp256k1Error = "Secp256k1Error",
1149
+ MiniscriptError = "MiniscriptError",
1150
+ NetworkError = "NetworkError"
1151
+ }
1152
+ export const DlcError = (() => {
1153
+ class InvalidSignature extends UniffiError {
1154
+ /**
1155
+ * @private
1156
+ * This field is private and should not be used.
1157
+ */
1158
+ readonly [uniffiTypeNameSymbol]: string = "DlcError";
1159
+ /**
1160
+ * @private
1161
+ * This field is private and should not be used.
1162
+ */
1163
+ readonly [variantOrdinalSymbol] = 1;
1164
+
1165
+ public readonly tag = DlcError_Tags.InvalidSignature;
1166
+
1167
+ constructor(message: string) {
1168
+ super("DlcError", "InvalidSignature", message);
1169
+ }
1170
+
1171
+ static instanceOf(e: any): e is InvalidSignature {
1172
+ return (
1173
+ instanceOf(e) && (e as any)[variantOrdinalSymbol] === 1
1174
+ );
1175
+ }
1396
1176
  }
1397
- }
1398
- class SerializationError extends UniffiError {
1399
- /**
1400
- * @private
1401
- * This field is private and should not be used.
1402
- */
1403
- readonly [uniffiTypeNameSymbol]: string = 'DlcError';
1404
- /**
1405
- * @private
1406
- * This field is private and should not be used.
1407
- */
1408
- readonly [variantOrdinalSymbol] = 6;
1409
-
1410
- public readonly tag = DlcError_Tags.SerializationError;
1411
-
1412
- constructor(message: string) {
1413
- super('DlcError', 'SerializationError', message);
1177
+ class InvalidPublicKey extends UniffiError {
1178
+ /**
1179
+ * @private
1180
+ * This field is private and should not be used.
1181
+ */
1182
+ readonly [uniffiTypeNameSymbol]: string = "DlcError";
1183
+ /**
1184
+ * @private
1185
+ * This field is private and should not be used.
1186
+ */
1187
+ readonly [variantOrdinalSymbol] = 2;
1188
+
1189
+ public readonly tag = DlcError_Tags.InvalidPublicKey;
1190
+
1191
+ constructor(message: string) {
1192
+ super("DlcError", "InvalidPublicKey", message);
1193
+ }
1194
+
1195
+ static instanceOf(e: any): e is InvalidPublicKey {
1196
+ return (
1197
+ instanceOf(e) && (e as any)[variantOrdinalSymbol] === 2
1198
+ );
1199
+ }
1414
1200
  }
1415
-
1416
- static instanceOf(e: any): e is SerializationError {
1417
- return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 6;
1201
+ class InvalidTransaction extends UniffiError {
1202
+ /**
1203
+ * @private
1204
+ * This field is private and should not be used.
1205
+ */
1206
+ readonly [uniffiTypeNameSymbol]: string = "DlcError";
1207
+ /**
1208
+ * @private
1209
+ * This field is private and should not be used.
1210
+ */
1211
+ readonly [variantOrdinalSymbol] = 3;
1212
+
1213
+ public readonly tag = DlcError_Tags.InvalidTransaction;
1214
+
1215
+ constructor(message: string) {
1216
+ super("DlcError", "InvalidTransaction", message);
1217
+ }
1218
+
1219
+ static instanceOf(e: any): e is InvalidTransaction {
1220
+ return (
1221
+ instanceOf(e) && (e as any)[variantOrdinalSymbol] === 3
1222
+ );
1223
+ }
1418
1224
  }
1419
- }
1420
- class Secp256k1Error extends UniffiError {
1421
- /**
1422
- * @private
1423
- * This field is private and should not be used.
1424
- */
1425
- readonly [uniffiTypeNameSymbol]: string = 'DlcError';
1426
- /**
1427
- * @private
1428
- * This field is private and should not be used.
1429
- */
1430
- readonly [variantOrdinalSymbol] = 7;
1431
-
1432
- public readonly tag = DlcError_Tags.Secp256k1Error;
1433
-
1434
- constructor(message: string) {
1435
- super('DlcError', 'Secp256k1Error', message);
1225
+ class InsufficientFunds extends UniffiError {
1226
+ /**
1227
+ * @private
1228
+ * This field is private and should not be used.
1229
+ */
1230
+ readonly [uniffiTypeNameSymbol]: string = "DlcError";
1231
+ /**
1232
+ * @private
1233
+ * This field is private and should not be used.
1234
+ */
1235
+ readonly [variantOrdinalSymbol] = 4;
1236
+
1237
+ public readonly tag = DlcError_Tags.InsufficientFunds;
1238
+
1239
+ constructor(message: string) {
1240
+ super("DlcError", "InsufficientFunds", message);
1241
+ }
1242
+
1243
+ static instanceOf(e: any): e is InsufficientFunds {
1244
+ return (
1245
+ instanceOf(e) && (e as any)[variantOrdinalSymbol] === 4
1246
+ );
1247
+ }
1436
1248
  }
1437
-
1438
- static instanceOf(e: any): e is Secp256k1Error {
1439
- return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 7;
1249
+ class InvalidArgument extends UniffiError {
1250
+ /**
1251
+ * @private
1252
+ * This field is private and should not be used.
1253
+ */
1254
+ readonly [uniffiTypeNameSymbol]: string = "DlcError";
1255
+ /**
1256
+ * @private
1257
+ * This field is private and should not be used.
1258
+ */
1259
+ readonly [variantOrdinalSymbol] = 5;
1260
+
1261
+ public readonly tag = DlcError_Tags.InvalidArgument;
1262
+
1263
+ constructor(message: string) {
1264
+ super("DlcError", "InvalidArgument", message);
1265
+ }
1266
+
1267
+ static instanceOf(e: any): e is InvalidArgument {
1268
+ return (
1269
+ instanceOf(e) && (e as any)[variantOrdinalSymbol] === 5
1270
+ );
1271
+ }
1440
1272
  }
1441
- }
1442
- class MiniscriptError extends UniffiError {
1443
- /**
1444
- * @private
1445
- * This field is private and should not be used.
1446
- */
1447
- readonly [uniffiTypeNameSymbol]: string = 'DlcError';
1448
- /**
1449
- * @private
1450
- * This field is private and should not be used.
1451
- */
1452
- readonly [variantOrdinalSymbol] = 8;
1453
-
1454
- public readonly tag = DlcError_Tags.MiniscriptError;
1455
-
1456
- constructor(message: string) {
1457
- super('DlcError', 'MiniscriptError', message);
1273
+ class SerializationError extends UniffiError {
1274
+ /**
1275
+ * @private
1276
+ * This field is private and should not be used.
1277
+ */
1278
+ readonly [uniffiTypeNameSymbol]: string = "DlcError";
1279
+ /**
1280
+ * @private
1281
+ * This field is private and should not be used.
1282
+ */
1283
+ readonly [variantOrdinalSymbol] = 6;
1284
+
1285
+ public readonly tag = DlcError_Tags.SerializationError;
1286
+
1287
+ constructor(message: string) {
1288
+ super("DlcError", "SerializationError", message);
1289
+ }
1290
+
1291
+ static instanceOf(e: any): e is SerializationError {
1292
+ return (
1293
+ instanceOf(e) && (e as any)[variantOrdinalSymbol] === 6
1294
+ );
1295
+ }
1458
1296
  }
1459
-
1460
- static instanceOf(e: any): e is MiniscriptError {
1461
- return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 8;
1297
+ class Secp256k1Error extends UniffiError {
1298
+ /**
1299
+ * @private
1300
+ * This field is private and should not be used.
1301
+ */
1302
+ readonly [uniffiTypeNameSymbol]: string = "DlcError";
1303
+ /**
1304
+ * @private
1305
+ * This field is private and should not be used.
1306
+ */
1307
+ readonly [variantOrdinalSymbol] = 7;
1308
+
1309
+ public readonly tag = DlcError_Tags.Secp256k1Error;
1310
+
1311
+ constructor(message: string) {
1312
+ super("DlcError", "Secp256k1Error", message);
1313
+ }
1314
+
1315
+ static instanceOf(e: any): e is Secp256k1Error {
1316
+ return (
1317
+ instanceOf(e) && (e as any)[variantOrdinalSymbol] === 7
1318
+ );
1319
+ }
1462
1320
  }
1463
- }
1464
- class NetworkError extends UniffiError {
1465
- /**
1466
- * @private
1467
- * This field is private and should not be used.
1468
- */
1469
- readonly [uniffiTypeNameSymbol]: string = 'DlcError';
1470
- /**
1471
- * @private
1472
- * This field is private and should not be used.
1473
- */
1474
- readonly [variantOrdinalSymbol] = 9;
1475
-
1476
- public readonly tag = DlcError_Tags.NetworkError;
1477
-
1478
- constructor(message: string) {
1479
- super('DlcError', 'NetworkError', message);
1321
+ class MiniscriptError extends UniffiError {
1322
+ /**
1323
+ * @private
1324
+ * This field is private and should not be used.
1325
+ */
1326
+ readonly [uniffiTypeNameSymbol]: string = "DlcError";
1327
+ /**
1328
+ * @private
1329
+ * This field is private and should not be used.
1330
+ */
1331
+ readonly [variantOrdinalSymbol] = 8;
1332
+
1333
+ public readonly tag = DlcError_Tags.MiniscriptError;
1334
+
1335
+ constructor(message: string) {
1336
+ super("DlcError", "MiniscriptError", message);
1337
+ }
1338
+
1339
+ static instanceOf(e: any): e is MiniscriptError {
1340
+ return (
1341
+ instanceOf(e) && (e as any)[variantOrdinalSymbol] === 8
1342
+ );
1343
+ }
1480
1344
  }
1481
-
1482
- static instanceOf(e: any): e is NetworkError {
1483
- return instanceOf(e) && (e as any)[variantOrdinalSymbol] === 9;
1345
+ class NetworkError extends UniffiError {
1346
+ /**
1347
+ * @private
1348
+ * This field is private and should not be used.
1349
+ */
1350
+ readonly [uniffiTypeNameSymbol]: string = "DlcError";
1351
+ /**
1352
+ * @private
1353
+ * This field is private and should not be used.
1354
+ */
1355
+ readonly [variantOrdinalSymbol] = 9;
1356
+
1357
+ public readonly tag = DlcError_Tags.NetworkError;
1358
+
1359
+ constructor(message: string) {
1360
+ super("DlcError", "NetworkError", message);
1361
+ }
1362
+
1363
+ static instanceOf(e: any): e is NetworkError {
1364
+ return (
1365
+ instanceOf(e) && (e as any)[variantOrdinalSymbol] === 9
1366
+ );
1367
+ }
1484
1368
  }
1485
- }
1486
1369
 
1487
- // Utility function which does not rely on instanceof.
1488
- function instanceOf(e: any): e is DlcError {
1489
- return (e as any)[uniffiTypeNameSymbol] === 'DlcError';
1490
- }
1491
- return {
1492
- InvalidSignature,
1493
- InvalidPublicKey,
1494
- InvalidTransaction,
1495
- InsufficientFunds,
1496
- InvalidArgument,
1497
- SerializationError,
1498
- Secp256k1Error,
1499
- MiniscriptError,
1500
- NetworkError,
1501
- instanceOf,
1502
- };
1370
+ // Utility function which does not rely on instanceof.
1371
+ function instanceOf(e: any): e is DlcError {
1372
+ return (e as any)[uniffiTypeNameSymbol] === "DlcError";
1373
+ }
1374
+ return {
1375
+ InvalidSignature,
1376
+ InvalidPublicKey,
1377
+ InvalidTransaction,
1378
+ InsufficientFunds,
1379
+ InvalidArgument,
1380
+ SerializationError,
1381
+ Secp256k1Error,
1382
+ MiniscriptError,
1383
+ NetworkError,
1384
+ instanceOf,
1385
+ };
1503
1386
  })();
1504
1387
 
1505
1388
  // Union type for DlcError error type.
1506
1389
 
1390
+
1507
1391
  export type DlcError = InstanceType<
1508
- (typeof DlcError)[keyof Omit<typeof DlcError, 'instanceOf'>]
1392
+ typeof DlcError[keyof Omit<typeof DlcError, 'instanceOf'>]
1509
1393
  >;
1510
1394
 
1511
1395
  const FfiConverterTypeDLCError = (() => {
1512
- const intConverter = FfiConverterInt32;
1513
- type TypeName = DlcError;
1514
- class FfiConverter extends AbstractFfiConverterByteArray<TypeName> {
1515
- read(from: RustBuffer): TypeName {
1516
- switch (intConverter.read(from)) {
1517
- case 1:
1518
- return new DlcError.InvalidSignature(FfiConverterString.read(from));
1519
-
1520
- case 2:
1521
- return new DlcError.InvalidPublicKey(FfiConverterString.read(from));
1522
-
1523
- case 3:
1524
- return new DlcError.InvalidTransaction(FfiConverterString.read(from));
1525
-
1526
- case 4:
1527
- return new DlcError.InsufficientFunds(FfiConverterString.read(from));
1528
-
1529
- case 5:
1530
- return new DlcError.InvalidArgument(FfiConverterString.read(from));
1531
-
1532
- case 6:
1533
- return new DlcError.SerializationError(FfiConverterString.read(from));
1534
-
1535
- case 7:
1536
- return new DlcError.Secp256k1Error(FfiConverterString.read(from));
1537
-
1538
- case 8:
1539
- return new DlcError.MiniscriptError(FfiConverterString.read(from));
1540
-
1541
- case 9:
1542
- return new DlcError.NetworkError(FfiConverterString.read(from));
1543
-
1544
- default:
1545
- throw new UniffiInternalError.UnexpectedEnumCase();
1546
- }
1547
- }
1548
- write(value: TypeName, into: RustBuffer): void {
1549
- const obj = value as any;
1550
- const index = obj[variantOrdinalSymbol] as number;
1551
- intConverter.write(index, into);
1396
+ const intConverter = FfiConverterInt32;
1397
+ type TypeName = DlcError;
1398
+ class FfiConverter extends AbstractFfiConverterByteArray<TypeName> {
1399
+ read(from: RustBuffer): TypeName {
1400
+ switch (intConverter.read(from)) {
1401
+ case 1: return new DlcError.InvalidSignature(FfiConverterString.read(from)
1402
+ );
1403
+
1404
+ case 2: return new DlcError.InvalidPublicKey(FfiConverterString.read(from)
1405
+ );
1406
+
1407
+ case 3: return new DlcError.InvalidTransaction(FfiConverterString.read(from)
1408
+ );
1409
+
1410
+ case 4: return new DlcError.InsufficientFunds(FfiConverterString.read(from)
1411
+ );
1412
+
1413
+ case 5: return new DlcError.InvalidArgument(FfiConverterString.read(from)
1414
+ );
1415
+
1416
+ case 6: return new DlcError.SerializationError(FfiConverterString.read(from)
1417
+ );
1418
+
1419
+ case 7: return new DlcError.Secp256k1Error(FfiConverterString.read(from)
1420
+ );
1421
+
1422
+ case 8: return new DlcError.MiniscriptError(FfiConverterString.read(from)
1423
+ );
1424
+
1425
+ case 9: return new DlcError.NetworkError(FfiConverterString.read(from)
1426
+ );
1427
+
1428
+ default: throw new UniffiInternalError.UnexpectedEnumCase();
1429
+ }
1430
+ }
1431
+ write(value: TypeName, into: RustBuffer): void {
1432
+ const obj = value as any;
1433
+ const index = obj[variantOrdinalSymbol] as number;
1434
+ intConverter.write(index, into);
1435
+ }
1436
+ allocationSize(value: TypeName): number {
1437
+ return intConverter.allocationSize(0);
1438
+ }
1552
1439
  }
1553
- allocationSize(value: TypeName): number {
1554
- return intConverter.allocationSize(0);
1555
- }
1556
- }
1557
- return new FfiConverter();
1440
+ return new FfiConverter();
1558
1441
  })();
1559
1442
 
1443
+
1560
1444
  // FfiConverter for Array<DlcInputInfo>
1561
- const FfiConverterArrayTypeDlcInputInfo = new FfiConverterArray(
1562
- FfiConverterTypeDlcInputInfo
1563
- );
1445
+ const FfiConverterArrayTypeDlcInputInfo = new FfiConverterArray(FfiConverterTypeDlcInputInfo);
1446
+
1564
1447
 
1565
1448
  // FfiConverter for Array<DlcOutcome>
1566
- const FfiConverterArrayTypeDlcOutcome = new FfiConverterArray(
1567
- FfiConverterTypeDlcOutcome
1568
- );
1449
+ const FfiConverterArrayTypeDlcOutcome = new FfiConverterArray(FfiConverterTypeDlcOutcome);
1450
+
1569
1451
 
1570
1452
  // FfiConverter for Array<Transaction>
1571
- const FfiConverterArrayTypeTransaction = new FfiConverterArray(
1572
- FfiConverterTypeTransaction
1573
- );
1453
+ const FfiConverterArrayTypeTransaction = new FfiConverterArray(FfiConverterTypeTransaction);
1454
+
1574
1455
 
1575
1456
  // FfiConverter for Array<TxInput>
1576
- const FfiConverterArrayTypeTxInput = new FfiConverterArray(
1577
- FfiConverterTypeTxInput
1578
- );
1457
+ const FfiConverterArrayTypeTxInput = new FfiConverterArray(FfiConverterTypeTxInput);
1458
+
1579
1459
 
1580
1460
  // FfiConverter for Array<TxInputInfo>
1581
- const FfiConverterArrayTypeTxInputInfo = new FfiConverterArray(
1582
- FfiConverterTypeTxInputInfo
1583
- );
1461
+ const FfiConverterArrayTypeTxInputInfo = new FfiConverterArray(FfiConverterTypeTxInputInfo);
1462
+
1584
1463
 
1585
1464
  // FfiConverter for Array<TxOutput>
1586
- const FfiConverterArrayTypeTxOutput = new FfiConverterArray(
1587
- FfiConverterTypeTxOutput
1588
- );
1465
+ const FfiConverterArrayTypeTxOutput = new FfiConverterArray(FfiConverterTypeTxOutput);
1466
+
1589
1467
 
1590
1468
  // FfiConverter for Array</*u8*/number>
1591
1469
  const FfiConverterArrayUInt8 = new FfiConverterArray(FfiConverterUInt8);
1592
1470
 
1471
+
1593
1472
  // FfiConverter for Array<Array</*u8*/number>>
1594
- const FfiConverterArrayArrayUInt8 = new FfiConverterArray(
1595
- FfiConverterArrayUInt8
1596
- );
1473
+ const FfiConverterArrayArrayUInt8 = new FfiConverterArray(FfiConverterArrayUInt8);
1597
1474
 
1598
1475
  /**
1599
1476
  * This should be called before anything else.
@@ -1606,122 +1483,57 @@ const FfiConverterArrayArrayUInt8 = new FfiConverterArray(
1606
1483
  * It also initializes the machinery to enable Rust to talk back to Javascript.
1607
1484
  */
1608
1485
  function uniffiEnsureInitialized() {
1609
- // Get the bindings contract version from our ComponentInterface
1610
- const bindingsContractVersion = 29;
1611
- // Get the scaffolding contract version by calling the into the dylib
1612
- const scaffoldingContractVersion =
1613
- nativeModule().ubrn_ffi_ddk_ffi_uniffi_contract_version();
1614
- if (bindingsContractVersion !== scaffoldingContractVersion) {
1615
- throw new UniffiInternalError.ContractVersionMismatch(
1616
- scaffoldingContractVersion,
1617
- bindingsContractVersion
1618
- );
1619
- }
1620
- if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_cet() !== 23081) {
1621
- throw new UniffiInternalError.ApiChecksumMismatch(
1622
- 'uniffi_ddk_ffi_checksum_func_create_cet'
1623
- );
1624
- }
1625
- if (
1626
- nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_cet_adaptor_signature_from_oracle_info() !==
1627
- 65174
1628
- ) {
1629
- throw new UniffiInternalError.ApiChecksumMismatch(
1630
- 'uniffi_ddk_ffi_checksum_func_create_cet_adaptor_signature_from_oracle_info'
1631
- );
1632
- }
1633
- if (
1634
- nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_cets() !== 45293
1635
- ) {
1636
- throw new UniffiInternalError.ApiChecksumMismatch(
1637
- 'uniffi_ddk_ffi_checksum_func_create_cets'
1638
- );
1639
- }
1640
- if (
1641
- nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_dlc_transactions() !==
1642
- 9500
1643
- ) {
1644
- throw new UniffiInternalError.ApiChecksumMismatch(
1645
- 'uniffi_ddk_ffi_checksum_func_create_dlc_transactions'
1646
- );
1647
- }
1648
- if (
1649
- nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_fund_tx_locking_script() !==
1650
- 2761
1651
- ) {
1652
- throw new UniffiInternalError.ApiChecksumMismatch(
1653
- 'uniffi_ddk_ffi_checksum_func_create_fund_tx_locking_script'
1654
- );
1655
- }
1656
- if (
1657
- nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_refund_transaction() !==
1658
- 57261
1659
- ) {
1660
- throw new UniffiInternalError.ApiChecksumMismatch(
1661
- 'uniffi_ddk_ffi_checksum_func_create_refund_transaction'
1662
- );
1663
- }
1664
- if (
1665
- nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_spliced_dlc_transactions() !==
1666
- 51059
1667
- ) {
1668
- throw new UniffiInternalError.ApiChecksumMismatch(
1669
- 'uniffi_ddk_ffi_checksum_func_create_spliced_dlc_transactions'
1670
- );
1671
- }
1672
- if (
1673
- nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_get_change_output_and_fees() !==
1674
- 44150
1675
- ) {
1676
- throw new UniffiInternalError.ApiChecksumMismatch(
1677
- 'uniffi_ddk_ffi_checksum_func_get_change_output_and_fees'
1678
- );
1679
- }
1680
- if (
1681
- nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_get_raw_funding_transaction_input_signature() !==
1682
- 35708
1683
- ) {
1684
- throw new UniffiInternalError.ApiChecksumMismatch(
1685
- 'uniffi_ddk_ffi_checksum_func_get_raw_funding_transaction_input_signature'
1686
- );
1687
- }
1688
- if (
1689
- nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_get_total_input_vsize() !==
1690
- 38213
1691
- ) {
1692
- throw new UniffiInternalError.ApiChecksumMismatch(
1693
- 'uniffi_ddk_ffi_checksum_func_get_total_input_vsize'
1694
- );
1695
- }
1696
- if (
1697
- nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_is_dust_output() !== 64174
1698
- ) {
1699
- throw new UniffiInternalError.ApiChecksumMismatch(
1700
- 'uniffi_ddk_ffi_checksum_func_is_dust_output'
1701
- );
1702
- }
1703
- if (
1704
- nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_sign_fund_transaction_input() !==
1705
- 50531
1706
- ) {
1707
- throw new UniffiInternalError.ApiChecksumMismatch(
1708
- 'uniffi_ddk_ffi_checksum_func_sign_fund_transaction_input'
1709
- );
1710
- }
1711
- if (
1712
- nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_verify_fund_tx_signature() !==
1713
- 27316
1714
- ) {
1715
- throw new UniffiInternalError.ApiChecksumMismatch(
1716
- 'uniffi_ddk_ffi_checksum_func_verify_fund_tx_signature'
1717
- );
1718
- }
1719
- if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_version() !== 22317) {
1720
- throw new UniffiInternalError.ApiChecksumMismatch(
1721
- 'uniffi_ddk_ffi_checksum_func_version'
1722
- );
1723
- }
1724
- }
1486
+ // Get the bindings contract version from our ComponentInterface
1487
+ const bindingsContractVersion = 29;
1488
+ // Get the scaffolding contract version by calling the into the dylib
1489
+ const scaffoldingContractVersion = nativeModule().ubrn_ffi_ddk_ffi_uniffi_contract_version();
1490
+ if (bindingsContractVersion !== scaffoldingContractVersion) {
1491
+ throw new UniffiInternalError.ContractVersionMismatch(scaffoldingContractVersion, bindingsContractVersion);
1492
+ }
1493
+ if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_cet() !== 23081) {
1494
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_create_cet");
1495
+ }
1496
+ if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_cet_adaptor_signature_from_oracle_info() !== 65174) {
1497
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_create_cet_adaptor_signature_from_oracle_info");
1498
+ }
1499
+ if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_cets() !== 45293) {
1500
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_create_cets");
1501
+ }
1502
+ if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_dlc_transactions() !== 9500) {
1503
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_create_dlc_transactions");
1504
+ }
1505
+ if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_fund_tx_locking_script() !== 2761) {
1506
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_create_fund_tx_locking_script");
1507
+ }
1508
+ if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_refund_transaction() !== 57261) {
1509
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_create_refund_transaction");
1510
+ }
1511
+ if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_spliced_dlc_transactions() !== 51059) {
1512
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_create_spliced_dlc_transactions");
1513
+ }
1514
+ if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_get_change_output_and_fees() !== 44150) {
1515
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_get_change_output_and_fees");
1516
+ }
1517
+ if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_get_raw_funding_transaction_input_signature() !== 35708) {
1518
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_get_raw_funding_transaction_input_signature");
1519
+ }
1520
+ if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_get_total_input_vsize() !== 38213) {
1521
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_get_total_input_vsize");
1522
+ }
1523
+ if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_is_dust_output() !== 64174) {
1524
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_is_dust_output");
1525
+ }
1526
+ if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_sign_fund_transaction_input() !== 50531) {
1527
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_sign_fund_transaction_input");
1528
+ }
1529
+ if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_verify_fund_tx_signature() !== 27316) {
1530
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_verify_fund_tx_signature");
1531
+ }
1532
+ if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_version() !== 22317) {
1533
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_version");
1534
+ }
1535
+
1536
+ }
1725
1537
 
1726
1538
  export default Object.freeze({
1727
1539
  initialize: uniffiEnsureInitialized,
@@ -1739,5 +1551,5 @@ export default Object.freeze({
1739
1551
  FfiConverterTypeTxInput,
1740
1552
  FfiConverterTypeTxInputInfo,
1741
1553
  FfiConverterTypeTxOutput,
1742
- },
1743
- });
1554
+ }
1555
+ });