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