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