@bennyblader/ddk-rn 0.2.2 → 0.2.4

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