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