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