@xstoicunicornx/payjoin_test 0.1.4 → 0.1.6
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/README.md +1 -3
- package/dist/generated/bitcoin.d.ts +4633 -0
- package/dist/generated/bitcoin.d.ts.map +1 -0
- package/dist/generated/bitcoin.js +3861 -0
- package/dist/generated/bitcoin.js.map +1 -0
- package/dist/generated/{payjoin.d.ts → payjoin_ffi.d.ts} +327 -2405
- package/dist/generated/payjoin_ffi.d.ts.map +1 -0
- package/dist/generated/{payjoin.js → payjoin_ffi.js} +2224 -4651
- package/dist/generated/payjoin_ffi.js.map +1 -0
- package/dist/generated/wasm-bindgen/index.d.ts +297 -419
- package/dist/generated/wasm-bindgen/index.js +1391 -1894
- package/dist/generated/wasm-bindgen/index_bg.wasm +0 -0
- package/dist/generated/wasm-bindgen/index_bg.wasm.d.ts +568 -522
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/index.web.js +8 -4
- package/package.json +37 -37
- package/dist/generated/payjoin.d.ts.map +0 -1
- package/dist/generated/payjoin.js.map +0 -1
|
@@ -0,0 +1,3861 @@
|
|
|
1
|
+
// This file was autogenerated by some hot garbage in the `uniffi-bindgen-react-native` crate.
|
|
2
|
+
// Trust me, you don't want to mess with it!
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
// @ts-nocheck
|
|
6
|
+
import * as wasmBundle from "./wasm-bindgen/index.js";
|
|
7
|
+
import { AbstractFfiConverterByteArray, FfiConverterArray, FfiConverterArrayBuffer, FfiConverterBool, FfiConverterFloat64, FfiConverterInt32, FfiConverterObject, FfiConverterUInt32, FfiConverterUInt64, FfiConverterUInt8, UniffiAbstractObject, UniffiError, UniffiInternalError, UniffiRustCaller, destructorGuardSymbol, pointerLiteralSymbol, uniffiCreateFfiConverterString, uniffiCreateRecord, uniffiTypeNameSymbol, } from "uniffi-bindgen-react-native";
|
|
8
|
+
// Get converters from the other files, if any.
|
|
9
|
+
const nativeModule = () => wasmBundle;
|
|
10
|
+
const uniffiCaller = new UniffiRustCaller(() => new wasmBundle.RustCallStatus());
|
|
11
|
+
const uniffiIsDebug =
|
|
12
|
+
// @ts-ignore -- The process global might not be defined
|
|
13
|
+
typeof process !== "object" ||
|
|
14
|
+
// @ts-ignore -- The process global might not be defined
|
|
15
|
+
process?.env?.NODE_ENV !== "production" ||
|
|
16
|
+
false;
|
|
17
|
+
/**
|
|
18
|
+
* Generated factory for {@link OutPoint} record objects.
|
|
19
|
+
*/
|
|
20
|
+
export const OutPoint = (() => {
|
|
21
|
+
const defaults = () => ({});
|
|
22
|
+
const create = (() => {
|
|
23
|
+
return uniffiCreateRecord(defaults);
|
|
24
|
+
})();
|
|
25
|
+
return Object.freeze({
|
|
26
|
+
/**
|
|
27
|
+
* Create a frozen instance of {@link OutPoint}, with defaults specified
|
|
28
|
+
* in Rust, in the {@link bitcoin} crate.
|
|
29
|
+
*/
|
|
30
|
+
create,
|
|
31
|
+
/**
|
|
32
|
+
* Create a frozen instance of {@link OutPoint}, with defaults specified
|
|
33
|
+
* in Rust, in the {@link bitcoin} crate.
|
|
34
|
+
*/
|
|
35
|
+
new: create,
|
|
36
|
+
/**
|
|
37
|
+
* Defaults specified in the {@link bitcoin} crate.
|
|
38
|
+
*/
|
|
39
|
+
defaults: () => Object.freeze(defaults()),
|
|
40
|
+
});
|
|
41
|
+
})();
|
|
42
|
+
const FfiConverterTypeOutPoint = (() => {
|
|
43
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
44
|
+
read(from) {
|
|
45
|
+
return {
|
|
46
|
+
txid: FfiConverterTypeTxid.read(from),
|
|
47
|
+
vout: FfiConverterUInt32.read(from),
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
write(value, into) {
|
|
51
|
+
FfiConverterTypeTxid.write(value.txid, into);
|
|
52
|
+
FfiConverterUInt32.write(value.vout, into);
|
|
53
|
+
}
|
|
54
|
+
allocationSize(value) {
|
|
55
|
+
return (FfiConverterTypeTxid.allocationSize(value.txid) +
|
|
56
|
+
FfiConverterUInt32.allocationSize(value.vout));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return new FFIConverter();
|
|
60
|
+
})();
|
|
61
|
+
/**
|
|
62
|
+
* Generated factory for {@link TxIn} record objects.
|
|
63
|
+
*/
|
|
64
|
+
export const TxIn = (() => {
|
|
65
|
+
const defaults = () => ({});
|
|
66
|
+
const create = (() => {
|
|
67
|
+
return uniffiCreateRecord(defaults);
|
|
68
|
+
})();
|
|
69
|
+
return Object.freeze({
|
|
70
|
+
/**
|
|
71
|
+
* Create a frozen instance of {@link TxIn}, with defaults specified
|
|
72
|
+
* in Rust, in the {@link bitcoin} crate.
|
|
73
|
+
*/
|
|
74
|
+
create,
|
|
75
|
+
/**
|
|
76
|
+
* Create a frozen instance of {@link TxIn}, with defaults specified
|
|
77
|
+
* in Rust, in the {@link bitcoin} crate.
|
|
78
|
+
*/
|
|
79
|
+
new: create,
|
|
80
|
+
/**
|
|
81
|
+
* Defaults specified in the {@link bitcoin} crate.
|
|
82
|
+
*/
|
|
83
|
+
defaults: () => Object.freeze(defaults()),
|
|
84
|
+
});
|
|
85
|
+
})();
|
|
86
|
+
const FfiConverterTypeTxIn = (() => {
|
|
87
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
88
|
+
read(from) {
|
|
89
|
+
return {
|
|
90
|
+
previousOutput: FfiConverterTypeOutPoint.read(from),
|
|
91
|
+
scriptSig: FfiConverterTypeScript.read(from),
|
|
92
|
+
sequence: FfiConverterUInt32.read(from),
|
|
93
|
+
witness: FfiConverterArrayArrayBuffer.read(from),
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
write(value, into) {
|
|
97
|
+
FfiConverterTypeOutPoint.write(value.previousOutput, into);
|
|
98
|
+
FfiConverterTypeScript.write(value.scriptSig, into);
|
|
99
|
+
FfiConverterUInt32.write(value.sequence, into);
|
|
100
|
+
FfiConverterArrayArrayBuffer.write(value.witness, into);
|
|
101
|
+
}
|
|
102
|
+
allocationSize(value) {
|
|
103
|
+
return (FfiConverterTypeOutPoint.allocationSize(value.previousOutput) +
|
|
104
|
+
FfiConverterTypeScript.allocationSize(value.scriptSig) +
|
|
105
|
+
FfiConverterUInt32.allocationSize(value.sequence) +
|
|
106
|
+
FfiConverterArrayArrayBuffer.allocationSize(value.witness));
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return new FFIConverter();
|
|
110
|
+
})();
|
|
111
|
+
/**
|
|
112
|
+
* Generated factory for {@link TxOut} record objects.
|
|
113
|
+
*/
|
|
114
|
+
export const TxOut = (() => {
|
|
115
|
+
const defaults = () => ({});
|
|
116
|
+
const create = (() => {
|
|
117
|
+
return uniffiCreateRecord(defaults);
|
|
118
|
+
})();
|
|
119
|
+
return Object.freeze({
|
|
120
|
+
/**
|
|
121
|
+
* Create a frozen instance of {@link TxOut}, with defaults specified
|
|
122
|
+
* in Rust, in the {@link bitcoin} crate.
|
|
123
|
+
*/
|
|
124
|
+
create,
|
|
125
|
+
/**
|
|
126
|
+
* Create a frozen instance of {@link TxOut}, with defaults specified
|
|
127
|
+
* in Rust, in the {@link bitcoin} crate.
|
|
128
|
+
*/
|
|
129
|
+
new: create,
|
|
130
|
+
/**
|
|
131
|
+
* Defaults specified in the {@link bitcoin} crate.
|
|
132
|
+
*/
|
|
133
|
+
defaults: () => Object.freeze(defaults()),
|
|
134
|
+
});
|
|
135
|
+
})();
|
|
136
|
+
const FfiConverterTypeTxOut = (() => {
|
|
137
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
138
|
+
read(from) {
|
|
139
|
+
return {
|
|
140
|
+
value: FfiConverterTypeAmount.read(from),
|
|
141
|
+
scriptPubkey: FfiConverterTypeScript.read(from),
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
write(value, into) {
|
|
145
|
+
FfiConverterTypeAmount.write(value.value, into);
|
|
146
|
+
FfiConverterTypeScript.write(value.scriptPubkey, into);
|
|
147
|
+
}
|
|
148
|
+
allocationSize(value) {
|
|
149
|
+
return (FfiConverterTypeAmount.allocationSize(value.value) +
|
|
150
|
+
FfiConverterTypeScript.allocationSize(value.scriptPubkey));
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return new FFIConverter();
|
|
154
|
+
})();
|
|
155
|
+
const stringConverter = (() => {
|
|
156
|
+
const encoder = new TextEncoder();
|
|
157
|
+
const decoder = new TextDecoder();
|
|
158
|
+
return {
|
|
159
|
+
stringToBytes: (s) => encoder.encode(s),
|
|
160
|
+
bytesToString: (ab) => decoder.decode(ab),
|
|
161
|
+
stringByteLength: (s) => encoder.encode(s).byteLength,
|
|
162
|
+
};
|
|
163
|
+
})();
|
|
164
|
+
const FfiConverterString = uniffiCreateFfiConverterString(stringConverter);
|
|
165
|
+
// FfiConverter for BlockHash, a type alias for string.
|
|
166
|
+
const FfiConverterTypeBlockHash = FfiConverterString;
|
|
167
|
+
// FfiConverter for Txid, a type alias for string.
|
|
168
|
+
const FfiConverterTypeTxid = FfiConverterString;
|
|
169
|
+
// Error type: AddressParseError
|
|
170
|
+
// Enum: AddressParseError
|
|
171
|
+
export var AddressParseError_Tags;
|
|
172
|
+
(function (AddressParseError_Tags) {
|
|
173
|
+
AddressParseError_Tags["Base58"] = "Base58";
|
|
174
|
+
AddressParseError_Tags["Bech32"] = "Bech32";
|
|
175
|
+
AddressParseError_Tags["WitnessVersion"] = "WitnessVersion";
|
|
176
|
+
AddressParseError_Tags["WitnessProgram"] = "WitnessProgram";
|
|
177
|
+
AddressParseError_Tags["UnknownHrp"] = "UnknownHrp";
|
|
178
|
+
AddressParseError_Tags["LegacyAddressTooLong"] = "LegacyAddressTooLong";
|
|
179
|
+
AddressParseError_Tags["InvalidBase58PayloadLength"] = "InvalidBase58PayloadLength";
|
|
180
|
+
AddressParseError_Tags["InvalidLegacyPrefix"] = "InvalidLegacyPrefix";
|
|
181
|
+
AddressParseError_Tags["NetworkValidation"] = "NetworkValidation";
|
|
182
|
+
AddressParseError_Tags["OtherAddressParseErr"] = "OtherAddressParseErr";
|
|
183
|
+
})(AddressParseError_Tags || (AddressParseError_Tags = {}));
|
|
184
|
+
export const AddressParseError = (() => {
|
|
185
|
+
class Base58_ extends UniffiError {
|
|
186
|
+
/**
|
|
187
|
+
* @private
|
|
188
|
+
* This field is private and should not be used, use `tag` instead.
|
|
189
|
+
*/
|
|
190
|
+
[uniffiTypeNameSymbol] = "AddressParseError";
|
|
191
|
+
tag = AddressParseError_Tags.Base58;
|
|
192
|
+
constructor() {
|
|
193
|
+
super("AddressParseError", "Base58");
|
|
194
|
+
}
|
|
195
|
+
static new() {
|
|
196
|
+
return new Base58_();
|
|
197
|
+
}
|
|
198
|
+
static instanceOf(obj) {
|
|
199
|
+
return obj.tag === AddressParseError_Tags.Base58;
|
|
200
|
+
}
|
|
201
|
+
static hasInner(obj) {
|
|
202
|
+
return false;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
class Bech32_ extends UniffiError {
|
|
206
|
+
/**
|
|
207
|
+
* @private
|
|
208
|
+
* This field is private and should not be used, use `tag` instead.
|
|
209
|
+
*/
|
|
210
|
+
[uniffiTypeNameSymbol] = "AddressParseError";
|
|
211
|
+
tag = AddressParseError_Tags.Bech32;
|
|
212
|
+
constructor() {
|
|
213
|
+
super("AddressParseError", "Bech32");
|
|
214
|
+
}
|
|
215
|
+
static new() {
|
|
216
|
+
return new Bech32_();
|
|
217
|
+
}
|
|
218
|
+
static instanceOf(obj) {
|
|
219
|
+
return obj.tag === AddressParseError_Tags.Bech32;
|
|
220
|
+
}
|
|
221
|
+
static hasInner(obj) {
|
|
222
|
+
return false;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
class WitnessVersion_ extends UniffiError {
|
|
226
|
+
/**
|
|
227
|
+
* @private
|
|
228
|
+
* This field is private and should not be used, use `tag` instead.
|
|
229
|
+
*/
|
|
230
|
+
[uniffiTypeNameSymbol] = "AddressParseError";
|
|
231
|
+
tag = AddressParseError_Tags.WitnessVersion;
|
|
232
|
+
inner;
|
|
233
|
+
constructor(inner) {
|
|
234
|
+
super("AddressParseError", "WitnessVersion");
|
|
235
|
+
this.inner = Object.freeze(inner);
|
|
236
|
+
}
|
|
237
|
+
static new(inner) {
|
|
238
|
+
return new WitnessVersion_(inner);
|
|
239
|
+
}
|
|
240
|
+
static instanceOf(obj) {
|
|
241
|
+
return obj.tag === AddressParseError_Tags.WitnessVersion;
|
|
242
|
+
}
|
|
243
|
+
static hasInner(obj) {
|
|
244
|
+
return WitnessVersion_.instanceOf(obj);
|
|
245
|
+
}
|
|
246
|
+
static getInner(obj) {
|
|
247
|
+
return obj.inner;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
class WitnessProgram_ extends UniffiError {
|
|
251
|
+
/**
|
|
252
|
+
* @private
|
|
253
|
+
* This field is private and should not be used, use `tag` instead.
|
|
254
|
+
*/
|
|
255
|
+
[uniffiTypeNameSymbol] = "AddressParseError";
|
|
256
|
+
tag = AddressParseError_Tags.WitnessProgram;
|
|
257
|
+
inner;
|
|
258
|
+
constructor(inner) {
|
|
259
|
+
super("AddressParseError", "WitnessProgram");
|
|
260
|
+
this.inner = Object.freeze(inner);
|
|
261
|
+
}
|
|
262
|
+
static new(inner) {
|
|
263
|
+
return new WitnessProgram_(inner);
|
|
264
|
+
}
|
|
265
|
+
static instanceOf(obj) {
|
|
266
|
+
return obj.tag === AddressParseError_Tags.WitnessProgram;
|
|
267
|
+
}
|
|
268
|
+
static hasInner(obj) {
|
|
269
|
+
return WitnessProgram_.instanceOf(obj);
|
|
270
|
+
}
|
|
271
|
+
static getInner(obj) {
|
|
272
|
+
return obj.inner;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
class UnknownHrp_ extends UniffiError {
|
|
276
|
+
/**
|
|
277
|
+
* @private
|
|
278
|
+
* This field is private and should not be used, use `tag` instead.
|
|
279
|
+
*/
|
|
280
|
+
[uniffiTypeNameSymbol] = "AddressParseError";
|
|
281
|
+
tag = AddressParseError_Tags.UnknownHrp;
|
|
282
|
+
constructor() {
|
|
283
|
+
super("AddressParseError", "UnknownHrp");
|
|
284
|
+
}
|
|
285
|
+
static new() {
|
|
286
|
+
return new UnknownHrp_();
|
|
287
|
+
}
|
|
288
|
+
static instanceOf(obj) {
|
|
289
|
+
return obj.tag === AddressParseError_Tags.UnknownHrp;
|
|
290
|
+
}
|
|
291
|
+
static hasInner(obj) {
|
|
292
|
+
return false;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
class LegacyAddressTooLong_ extends UniffiError {
|
|
296
|
+
/**
|
|
297
|
+
* @private
|
|
298
|
+
* This field is private and should not be used, use `tag` instead.
|
|
299
|
+
*/
|
|
300
|
+
[uniffiTypeNameSymbol] = "AddressParseError";
|
|
301
|
+
tag = AddressParseError_Tags.LegacyAddressTooLong;
|
|
302
|
+
constructor() {
|
|
303
|
+
super("AddressParseError", "LegacyAddressTooLong");
|
|
304
|
+
}
|
|
305
|
+
static new() {
|
|
306
|
+
return new LegacyAddressTooLong_();
|
|
307
|
+
}
|
|
308
|
+
static instanceOf(obj) {
|
|
309
|
+
return obj.tag === AddressParseError_Tags.LegacyAddressTooLong;
|
|
310
|
+
}
|
|
311
|
+
static hasInner(obj) {
|
|
312
|
+
return false;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
class InvalidBase58PayloadLength_ extends UniffiError {
|
|
316
|
+
/**
|
|
317
|
+
* @private
|
|
318
|
+
* This field is private and should not be used, use `tag` instead.
|
|
319
|
+
*/
|
|
320
|
+
[uniffiTypeNameSymbol] = "AddressParseError";
|
|
321
|
+
tag = AddressParseError_Tags.InvalidBase58PayloadLength;
|
|
322
|
+
constructor() {
|
|
323
|
+
super("AddressParseError", "InvalidBase58PayloadLength");
|
|
324
|
+
}
|
|
325
|
+
static new() {
|
|
326
|
+
return new InvalidBase58PayloadLength_();
|
|
327
|
+
}
|
|
328
|
+
static instanceOf(obj) {
|
|
329
|
+
return (obj.tag === AddressParseError_Tags.InvalidBase58PayloadLength);
|
|
330
|
+
}
|
|
331
|
+
static hasInner(obj) {
|
|
332
|
+
return false;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
class InvalidLegacyPrefix_ extends UniffiError {
|
|
336
|
+
/**
|
|
337
|
+
* @private
|
|
338
|
+
* This field is private and should not be used, use `tag` instead.
|
|
339
|
+
*/
|
|
340
|
+
[uniffiTypeNameSymbol] = "AddressParseError";
|
|
341
|
+
tag = AddressParseError_Tags.InvalidLegacyPrefix;
|
|
342
|
+
constructor() {
|
|
343
|
+
super("AddressParseError", "InvalidLegacyPrefix");
|
|
344
|
+
}
|
|
345
|
+
static new() {
|
|
346
|
+
return new InvalidLegacyPrefix_();
|
|
347
|
+
}
|
|
348
|
+
static instanceOf(obj) {
|
|
349
|
+
return obj.tag === AddressParseError_Tags.InvalidLegacyPrefix;
|
|
350
|
+
}
|
|
351
|
+
static hasInner(obj) {
|
|
352
|
+
return false;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
class NetworkValidation_ extends UniffiError {
|
|
356
|
+
/**
|
|
357
|
+
* @private
|
|
358
|
+
* This field is private and should not be used, use `tag` instead.
|
|
359
|
+
*/
|
|
360
|
+
[uniffiTypeNameSymbol] = "AddressParseError";
|
|
361
|
+
tag = AddressParseError_Tags.NetworkValidation;
|
|
362
|
+
constructor() {
|
|
363
|
+
super("AddressParseError", "NetworkValidation");
|
|
364
|
+
}
|
|
365
|
+
static new() {
|
|
366
|
+
return new NetworkValidation_();
|
|
367
|
+
}
|
|
368
|
+
static instanceOf(obj) {
|
|
369
|
+
return obj.tag === AddressParseError_Tags.NetworkValidation;
|
|
370
|
+
}
|
|
371
|
+
static hasInner(obj) {
|
|
372
|
+
return false;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
class OtherAddressParseErr_ extends UniffiError {
|
|
376
|
+
/**
|
|
377
|
+
* @private
|
|
378
|
+
* This field is private and should not be used, use `tag` instead.
|
|
379
|
+
*/
|
|
380
|
+
[uniffiTypeNameSymbol] = "AddressParseError";
|
|
381
|
+
tag = AddressParseError_Tags.OtherAddressParseErr;
|
|
382
|
+
constructor() {
|
|
383
|
+
super("AddressParseError", "OtherAddressParseErr");
|
|
384
|
+
}
|
|
385
|
+
static new() {
|
|
386
|
+
return new OtherAddressParseErr_();
|
|
387
|
+
}
|
|
388
|
+
static instanceOf(obj) {
|
|
389
|
+
return obj.tag === AddressParseError_Tags.OtherAddressParseErr;
|
|
390
|
+
}
|
|
391
|
+
static hasInner(obj) {
|
|
392
|
+
return false;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
function instanceOf(obj) {
|
|
396
|
+
return obj[uniffiTypeNameSymbol] === "AddressParseError";
|
|
397
|
+
}
|
|
398
|
+
return Object.freeze({
|
|
399
|
+
instanceOf,
|
|
400
|
+
Base58: Base58_,
|
|
401
|
+
Bech32: Bech32_,
|
|
402
|
+
WitnessVersion: WitnessVersion_,
|
|
403
|
+
WitnessProgram: WitnessProgram_,
|
|
404
|
+
UnknownHrp: UnknownHrp_,
|
|
405
|
+
LegacyAddressTooLong: LegacyAddressTooLong_,
|
|
406
|
+
InvalidBase58PayloadLength: InvalidBase58PayloadLength_,
|
|
407
|
+
InvalidLegacyPrefix: InvalidLegacyPrefix_,
|
|
408
|
+
NetworkValidation: NetworkValidation_,
|
|
409
|
+
OtherAddressParseErr: OtherAddressParseErr_,
|
|
410
|
+
});
|
|
411
|
+
})();
|
|
412
|
+
// FfiConverter for enum AddressParseError
|
|
413
|
+
const FfiConverterTypeAddressParseError = (() => {
|
|
414
|
+
const ordinalConverter = FfiConverterInt32;
|
|
415
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
416
|
+
read(from) {
|
|
417
|
+
switch (ordinalConverter.read(from)) {
|
|
418
|
+
case 1:
|
|
419
|
+
return new AddressParseError.Base58();
|
|
420
|
+
case 2:
|
|
421
|
+
return new AddressParseError.Bech32();
|
|
422
|
+
case 3:
|
|
423
|
+
return new AddressParseError.WitnessVersion({
|
|
424
|
+
errorMessage: FfiConverterString.read(from),
|
|
425
|
+
});
|
|
426
|
+
case 4:
|
|
427
|
+
return new AddressParseError.WitnessProgram({
|
|
428
|
+
errorMessage: FfiConverterString.read(from),
|
|
429
|
+
});
|
|
430
|
+
case 5:
|
|
431
|
+
return new AddressParseError.UnknownHrp();
|
|
432
|
+
case 6:
|
|
433
|
+
return new AddressParseError.LegacyAddressTooLong();
|
|
434
|
+
case 7:
|
|
435
|
+
return new AddressParseError.InvalidBase58PayloadLength();
|
|
436
|
+
case 8:
|
|
437
|
+
return new AddressParseError.InvalidLegacyPrefix();
|
|
438
|
+
case 9:
|
|
439
|
+
return new AddressParseError.NetworkValidation();
|
|
440
|
+
case 10:
|
|
441
|
+
return new AddressParseError.OtherAddressParseErr();
|
|
442
|
+
default:
|
|
443
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
write(value, into) {
|
|
447
|
+
switch (value.tag) {
|
|
448
|
+
case AddressParseError_Tags.Base58: {
|
|
449
|
+
ordinalConverter.write(1, into);
|
|
450
|
+
return;
|
|
451
|
+
}
|
|
452
|
+
case AddressParseError_Tags.Bech32: {
|
|
453
|
+
ordinalConverter.write(2, into);
|
|
454
|
+
return;
|
|
455
|
+
}
|
|
456
|
+
case AddressParseError_Tags.WitnessVersion: {
|
|
457
|
+
ordinalConverter.write(3, into);
|
|
458
|
+
const inner = value.inner;
|
|
459
|
+
FfiConverterString.write(inner.errorMessage, into);
|
|
460
|
+
return;
|
|
461
|
+
}
|
|
462
|
+
case AddressParseError_Tags.WitnessProgram: {
|
|
463
|
+
ordinalConverter.write(4, into);
|
|
464
|
+
const inner = value.inner;
|
|
465
|
+
FfiConverterString.write(inner.errorMessage, into);
|
|
466
|
+
return;
|
|
467
|
+
}
|
|
468
|
+
case AddressParseError_Tags.UnknownHrp: {
|
|
469
|
+
ordinalConverter.write(5, into);
|
|
470
|
+
return;
|
|
471
|
+
}
|
|
472
|
+
case AddressParseError_Tags.LegacyAddressTooLong: {
|
|
473
|
+
ordinalConverter.write(6, into);
|
|
474
|
+
return;
|
|
475
|
+
}
|
|
476
|
+
case AddressParseError_Tags.InvalidBase58PayloadLength: {
|
|
477
|
+
ordinalConverter.write(7, into);
|
|
478
|
+
return;
|
|
479
|
+
}
|
|
480
|
+
case AddressParseError_Tags.InvalidLegacyPrefix: {
|
|
481
|
+
ordinalConverter.write(8, into);
|
|
482
|
+
return;
|
|
483
|
+
}
|
|
484
|
+
case AddressParseError_Tags.NetworkValidation: {
|
|
485
|
+
ordinalConverter.write(9, into);
|
|
486
|
+
return;
|
|
487
|
+
}
|
|
488
|
+
case AddressParseError_Tags.OtherAddressParseErr: {
|
|
489
|
+
ordinalConverter.write(10, into);
|
|
490
|
+
return;
|
|
491
|
+
}
|
|
492
|
+
default:
|
|
493
|
+
// Throwing from here means that AddressParseError_Tags hasn't matched an ordinal.
|
|
494
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
allocationSize(value) {
|
|
498
|
+
switch (value.tag) {
|
|
499
|
+
case AddressParseError_Tags.Base58: {
|
|
500
|
+
return ordinalConverter.allocationSize(1);
|
|
501
|
+
}
|
|
502
|
+
case AddressParseError_Tags.Bech32: {
|
|
503
|
+
return ordinalConverter.allocationSize(2);
|
|
504
|
+
}
|
|
505
|
+
case AddressParseError_Tags.WitnessVersion: {
|
|
506
|
+
const inner = value.inner;
|
|
507
|
+
let size = ordinalConverter.allocationSize(3);
|
|
508
|
+
size += FfiConverterString.allocationSize(inner.errorMessage);
|
|
509
|
+
return size;
|
|
510
|
+
}
|
|
511
|
+
case AddressParseError_Tags.WitnessProgram: {
|
|
512
|
+
const inner = value.inner;
|
|
513
|
+
let size = ordinalConverter.allocationSize(4);
|
|
514
|
+
size += FfiConverterString.allocationSize(inner.errorMessage);
|
|
515
|
+
return size;
|
|
516
|
+
}
|
|
517
|
+
case AddressParseError_Tags.UnknownHrp: {
|
|
518
|
+
return ordinalConverter.allocationSize(5);
|
|
519
|
+
}
|
|
520
|
+
case AddressParseError_Tags.LegacyAddressTooLong: {
|
|
521
|
+
return ordinalConverter.allocationSize(6);
|
|
522
|
+
}
|
|
523
|
+
case AddressParseError_Tags.InvalidBase58PayloadLength: {
|
|
524
|
+
return ordinalConverter.allocationSize(7);
|
|
525
|
+
}
|
|
526
|
+
case AddressParseError_Tags.InvalidLegacyPrefix: {
|
|
527
|
+
return ordinalConverter.allocationSize(8);
|
|
528
|
+
}
|
|
529
|
+
case AddressParseError_Tags.NetworkValidation: {
|
|
530
|
+
return ordinalConverter.allocationSize(9);
|
|
531
|
+
}
|
|
532
|
+
case AddressParseError_Tags.OtherAddressParseErr: {
|
|
533
|
+
return ordinalConverter.allocationSize(10);
|
|
534
|
+
}
|
|
535
|
+
default:
|
|
536
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
return new FFIConverter();
|
|
541
|
+
})();
|
|
542
|
+
// Error type: EncodeError
|
|
543
|
+
// Enum: EncodeError
|
|
544
|
+
export var EncodeError_Tags;
|
|
545
|
+
(function (EncodeError_Tags) {
|
|
546
|
+
EncodeError_Tags["Io"] = "Io";
|
|
547
|
+
EncodeError_Tags["OversizedVectorAllocation"] = "OversizedVectorAllocation";
|
|
548
|
+
EncodeError_Tags["InvalidChecksum"] = "InvalidChecksum";
|
|
549
|
+
EncodeError_Tags["NonMinimalVarInt"] = "NonMinimalVarInt";
|
|
550
|
+
EncodeError_Tags["ParseFailed"] = "ParseFailed";
|
|
551
|
+
EncodeError_Tags["UnsupportedSegwitFlag"] = "UnsupportedSegwitFlag";
|
|
552
|
+
EncodeError_Tags["OtherEncodeErr"] = "OtherEncodeErr";
|
|
553
|
+
})(EncodeError_Tags || (EncodeError_Tags = {}));
|
|
554
|
+
export const EncodeError = (() => {
|
|
555
|
+
class Io_ extends UniffiError {
|
|
556
|
+
/**
|
|
557
|
+
* @private
|
|
558
|
+
* This field is private and should not be used, use `tag` instead.
|
|
559
|
+
*/
|
|
560
|
+
[uniffiTypeNameSymbol] = "EncodeError";
|
|
561
|
+
tag = EncodeError_Tags.Io;
|
|
562
|
+
constructor() {
|
|
563
|
+
super("EncodeError", "Io");
|
|
564
|
+
}
|
|
565
|
+
static new() {
|
|
566
|
+
return new Io_();
|
|
567
|
+
}
|
|
568
|
+
static instanceOf(obj) {
|
|
569
|
+
return obj.tag === EncodeError_Tags.Io;
|
|
570
|
+
}
|
|
571
|
+
static hasInner(obj) {
|
|
572
|
+
return false;
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
class OversizedVectorAllocation_ extends UniffiError {
|
|
576
|
+
/**
|
|
577
|
+
* @private
|
|
578
|
+
* This field is private and should not be used, use `tag` instead.
|
|
579
|
+
*/
|
|
580
|
+
[uniffiTypeNameSymbol] = "EncodeError";
|
|
581
|
+
tag = EncodeError_Tags.OversizedVectorAllocation;
|
|
582
|
+
constructor() {
|
|
583
|
+
super("EncodeError", "OversizedVectorAllocation");
|
|
584
|
+
}
|
|
585
|
+
static new() {
|
|
586
|
+
return new OversizedVectorAllocation_();
|
|
587
|
+
}
|
|
588
|
+
static instanceOf(obj) {
|
|
589
|
+
return obj.tag === EncodeError_Tags.OversizedVectorAllocation;
|
|
590
|
+
}
|
|
591
|
+
static hasInner(obj) {
|
|
592
|
+
return false;
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
class InvalidChecksum_ extends UniffiError {
|
|
596
|
+
/**
|
|
597
|
+
* @private
|
|
598
|
+
* This field is private and should not be used, use `tag` instead.
|
|
599
|
+
*/
|
|
600
|
+
[uniffiTypeNameSymbol] = "EncodeError";
|
|
601
|
+
tag = EncodeError_Tags.InvalidChecksum;
|
|
602
|
+
inner;
|
|
603
|
+
constructor(inner) {
|
|
604
|
+
super("EncodeError", "InvalidChecksum");
|
|
605
|
+
this.inner = Object.freeze(inner);
|
|
606
|
+
}
|
|
607
|
+
static new(inner) {
|
|
608
|
+
return new InvalidChecksum_(inner);
|
|
609
|
+
}
|
|
610
|
+
static instanceOf(obj) {
|
|
611
|
+
return obj.tag === EncodeError_Tags.InvalidChecksum;
|
|
612
|
+
}
|
|
613
|
+
static hasInner(obj) {
|
|
614
|
+
return InvalidChecksum_.instanceOf(obj);
|
|
615
|
+
}
|
|
616
|
+
static getInner(obj) {
|
|
617
|
+
return obj.inner;
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
class NonMinimalVarInt_ extends UniffiError {
|
|
621
|
+
/**
|
|
622
|
+
* @private
|
|
623
|
+
* This field is private and should not be used, use `tag` instead.
|
|
624
|
+
*/
|
|
625
|
+
[uniffiTypeNameSymbol] = "EncodeError";
|
|
626
|
+
tag = EncodeError_Tags.NonMinimalVarInt;
|
|
627
|
+
constructor() {
|
|
628
|
+
super("EncodeError", "NonMinimalVarInt");
|
|
629
|
+
}
|
|
630
|
+
static new() {
|
|
631
|
+
return new NonMinimalVarInt_();
|
|
632
|
+
}
|
|
633
|
+
static instanceOf(obj) {
|
|
634
|
+
return obj.tag === EncodeError_Tags.NonMinimalVarInt;
|
|
635
|
+
}
|
|
636
|
+
static hasInner(obj) {
|
|
637
|
+
return false;
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
class ParseFailed_ extends UniffiError {
|
|
641
|
+
/**
|
|
642
|
+
* @private
|
|
643
|
+
* This field is private and should not be used, use `tag` instead.
|
|
644
|
+
*/
|
|
645
|
+
[uniffiTypeNameSymbol] = "EncodeError";
|
|
646
|
+
tag = EncodeError_Tags.ParseFailed;
|
|
647
|
+
constructor() {
|
|
648
|
+
super("EncodeError", "ParseFailed");
|
|
649
|
+
}
|
|
650
|
+
static new() {
|
|
651
|
+
return new ParseFailed_();
|
|
652
|
+
}
|
|
653
|
+
static instanceOf(obj) {
|
|
654
|
+
return obj.tag === EncodeError_Tags.ParseFailed;
|
|
655
|
+
}
|
|
656
|
+
static hasInner(obj) {
|
|
657
|
+
return false;
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
class UnsupportedSegwitFlag_ extends UniffiError {
|
|
661
|
+
/**
|
|
662
|
+
* @private
|
|
663
|
+
* This field is private and should not be used, use `tag` instead.
|
|
664
|
+
*/
|
|
665
|
+
[uniffiTypeNameSymbol] = "EncodeError";
|
|
666
|
+
tag = EncodeError_Tags.UnsupportedSegwitFlag;
|
|
667
|
+
inner;
|
|
668
|
+
constructor(inner) {
|
|
669
|
+
super("EncodeError", "UnsupportedSegwitFlag");
|
|
670
|
+
this.inner = Object.freeze(inner);
|
|
671
|
+
}
|
|
672
|
+
static new(inner) {
|
|
673
|
+
return new UnsupportedSegwitFlag_(inner);
|
|
674
|
+
}
|
|
675
|
+
static instanceOf(obj) {
|
|
676
|
+
return obj.tag === EncodeError_Tags.UnsupportedSegwitFlag;
|
|
677
|
+
}
|
|
678
|
+
static hasInner(obj) {
|
|
679
|
+
return UnsupportedSegwitFlag_.instanceOf(obj);
|
|
680
|
+
}
|
|
681
|
+
static getInner(obj) {
|
|
682
|
+
return obj.inner;
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
class OtherEncodeErr_ extends UniffiError {
|
|
686
|
+
/**
|
|
687
|
+
* @private
|
|
688
|
+
* This field is private and should not be used, use `tag` instead.
|
|
689
|
+
*/
|
|
690
|
+
[uniffiTypeNameSymbol] = "EncodeError";
|
|
691
|
+
tag = EncodeError_Tags.OtherEncodeErr;
|
|
692
|
+
constructor() {
|
|
693
|
+
super("EncodeError", "OtherEncodeErr");
|
|
694
|
+
}
|
|
695
|
+
static new() {
|
|
696
|
+
return new OtherEncodeErr_();
|
|
697
|
+
}
|
|
698
|
+
static instanceOf(obj) {
|
|
699
|
+
return obj.tag === EncodeError_Tags.OtherEncodeErr;
|
|
700
|
+
}
|
|
701
|
+
static hasInner(obj) {
|
|
702
|
+
return false;
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
function instanceOf(obj) {
|
|
706
|
+
return obj[uniffiTypeNameSymbol] === "EncodeError";
|
|
707
|
+
}
|
|
708
|
+
return Object.freeze({
|
|
709
|
+
instanceOf,
|
|
710
|
+
Io: Io_,
|
|
711
|
+
OversizedVectorAllocation: OversizedVectorAllocation_,
|
|
712
|
+
InvalidChecksum: InvalidChecksum_,
|
|
713
|
+
NonMinimalVarInt: NonMinimalVarInt_,
|
|
714
|
+
ParseFailed: ParseFailed_,
|
|
715
|
+
UnsupportedSegwitFlag: UnsupportedSegwitFlag_,
|
|
716
|
+
OtherEncodeErr: OtherEncodeErr_,
|
|
717
|
+
});
|
|
718
|
+
})();
|
|
719
|
+
// FfiConverter for enum EncodeError
|
|
720
|
+
const FfiConverterTypeEncodeError = (() => {
|
|
721
|
+
const ordinalConverter = FfiConverterInt32;
|
|
722
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
723
|
+
read(from) {
|
|
724
|
+
switch (ordinalConverter.read(from)) {
|
|
725
|
+
case 1:
|
|
726
|
+
return new EncodeError.Io();
|
|
727
|
+
case 2:
|
|
728
|
+
return new EncodeError.OversizedVectorAllocation();
|
|
729
|
+
case 3:
|
|
730
|
+
return new EncodeError.InvalidChecksum({
|
|
731
|
+
expected: FfiConverterString.read(from),
|
|
732
|
+
actual: FfiConverterString.read(from),
|
|
733
|
+
});
|
|
734
|
+
case 4:
|
|
735
|
+
return new EncodeError.NonMinimalVarInt();
|
|
736
|
+
case 5:
|
|
737
|
+
return new EncodeError.ParseFailed();
|
|
738
|
+
case 6:
|
|
739
|
+
return new EncodeError.UnsupportedSegwitFlag({
|
|
740
|
+
flag: FfiConverterUInt8.read(from),
|
|
741
|
+
});
|
|
742
|
+
case 7:
|
|
743
|
+
return new EncodeError.OtherEncodeErr();
|
|
744
|
+
default:
|
|
745
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
write(value, into) {
|
|
749
|
+
switch (value.tag) {
|
|
750
|
+
case EncodeError_Tags.Io: {
|
|
751
|
+
ordinalConverter.write(1, into);
|
|
752
|
+
return;
|
|
753
|
+
}
|
|
754
|
+
case EncodeError_Tags.OversizedVectorAllocation: {
|
|
755
|
+
ordinalConverter.write(2, into);
|
|
756
|
+
return;
|
|
757
|
+
}
|
|
758
|
+
case EncodeError_Tags.InvalidChecksum: {
|
|
759
|
+
ordinalConverter.write(3, into);
|
|
760
|
+
const inner = value.inner;
|
|
761
|
+
FfiConverterString.write(inner.expected, into);
|
|
762
|
+
FfiConverterString.write(inner.actual, into);
|
|
763
|
+
return;
|
|
764
|
+
}
|
|
765
|
+
case EncodeError_Tags.NonMinimalVarInt: {
|
|
766
|
+
ordinalConverter.write(4, into);
|
|
767
|
+
return;
|
|
768
|
+
}
|
|
769
|
+
case EncodeError_Tags.ParseFailed: {
|
|
770
|
+
ordinalConverter.write(5, into);
|
|
771
|
+
return;
|
|
772
|
+
}
|
|
773
|
+
case EncodeError_Tags.UnsupportedSegwitFlag: {
|
|
774
|
+
ordinalConverter.write(6, into);
|
|
775
|
+
const inner = value.inner;
|
|
776
|
+
FfiConverterUInt8.write(inner.flag, into);
|
|
777
|
+
return;
|
|
778
|
+
}
|
|
779
|
+
case EncodeError_Tags.OtherEncodeErr: {
|
|
780
|
+
ordinalConverter.write(7, into);
|
|
781
|
+
return;
|
|
782
|
+
}
|
|
783
|
+
default:
|
|
784
|
+
// Throwing from here means that EncodeError_Tags hasn't matched an ordinal.
|
|
785
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
allocationSize(value) {
|
|
789
|
+
switch (value.tag) {
|
|
790
|
+
case EncodeError_Tags.Io: {
|
|
791
|
+
return ordinalConverter.allocationSize(1);
|
|
792
|
+
}
|
|
793
|
+
case EncodeError_Tags.OversizedVectorAllocation: {
|
|
794
|
+
return ordinalConverter.allocationSize(2);
|
|
795
|
+
}
|
|
796
|
+
case EncodeError_Tags.InvalidChecksum: {
|
|
797
|
+
const inner = value.inner;
|
|
798
|
+
let size = ordinalConverter.allocationSize(3);
|
|
799
|
+
size += FfiConverterString.allocationSize(inner.expected);
|
|
800
|
+
size += FfiConverterString.allocationSize(inner.actual);
|
|
801
|
+
return size;
|
|
802
|
+
}
|
|
803
|
+
case EncodeError_Tags.NonMinimalVarInt: {
|
|
804
|
+
return ordinalConverter.allocationSize(4);
|
|
805
|
+
}
|
|
806
|
+
case EncodeError_Tags.ParseFailed: {
|
|
807
|
+
return ordinalConverter.allocationSize(5);
|
|
808
|
+
}
|
|
809
|
+
case EncodeError_Tags.UnsupportedSegwitFlag: {
|
|
810
|
+
const inner = value.inner;
|
|
811
|
+
let size = ordinalConverter.allocationSize(6);
|
|
812
|
+
size += FfiConverterUInt8.allocationSize(inner.flag);
|
|
813
|
+
return size;
|
|
814
|
+
}
|
|
815
|
+
case EncodeError_Tags.OtherEncodeErr: {
|
|
816
|
+
return ordinalConverter.allocationSize(7);
|
|
817
|
+
}
|
|
818
|
+
default:
|
|
819
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
return new FFIConverter();
|
|
824
|
+
})();
|
|
825
|
+
// Error type: ExtractTxError
|
|
826
|
+
// Enum: ExtractTxError
|
|
827
|
+
export var ExtractTxError_Tags;
|
|
828
|
+
(function (ExtractTxError_Tags) {
|
|
829
|
+
ExtractTxError_Tags["AbsurdFeeRate"] = "AbsurdFeeRate";
|
|
830
|
+
ExtractTxError_Tags["MissingInputValue"] = "MissingInputValue";
|
|
831
|
+
ExtractTxError_Tags["SendingTooMuch"] = "SendingTooMuch";
|
|
832
|
+
ExtractTxError_Tags["OtherExtractTxErr"] = "OtherExtractTxErr";
|
|
833
|
+
})(ExtractTxError_Tags || (ExtractTxError_Tags = {}));
|
|
834
|
+
export const ExtractTxError = (() => {
|
|
835
|
+
class AbsurdFeeRate_ extends UniffiError {
|
|
836
|
+
/**
|
|
837
|
+
* @private
|
|
838
|
+
* This field is private and should not be used, use `tag` instead.
|
|
839
|
+
*/
|
|
840
|
+
[uniffiTypeNameSymbol] = "ExtractTxError";
|
|
841
|
+
tag = ExtractTxError_Tags.AbsurdFeeRate;
|
|
842
|
+
inner;
|
|
843
|
+
constructor(inner) {
|
|
844
|
+
super("ExtractTxError", "AbsurdFeeRate");
|
|
845
|
+
this.inner = Object.freeze(inner);
|
|
846
|
+
}
|
|
847
|
+
static new(inner) {
|
|
848
|
+
return new AbsurdFeeRate_(inner);
|
|
849
|
+
}
|
|
850
|
+
static instanceOf(obj) {
|
|
851
|
+
return obj.tag === ExtractTxError_Tags.AbsurdFeeRate;
|
|
852
|
+
}
|
|
853
|
+
static hasInner(obj) {
|
|
854
|
+
return AbsurdFeeRate_.instanceOf(obj);
|
|
855
|
+
}
|
|
856
|
+
static getInner(obj) {
|
|
857
|
+
return obj.inner;
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
class MissingInputValue_ extends UniffiError {
|
|
861
|
+
/**
|
|
862
|
+
* @private
|
|
863
|
+
* This field is private and should not be used, use `tag` instead.
|
|
864
|
+
*/
|
|
865
|
+
[uniffiTypeNameSymbol] = "ExtractTxError";
|
|
866
|
+
tag = ExtractTxError_Tags.MissingInputValue;
|
|
867
|
+
constructor() {
|
|
868
|
+
super("ExtractTxError", "MissingInputValue");
|
|
869
|
+
}
|
|
870
|
+
static new() {
|
|
871
|
+
return new MissingInputValue_();
|
|
872
|
+
}
|
|
873
|
+
static instanceOf(obj) {
|
|
874
|
+
return obj.tag === ExtractTxError_Tags.MissingInputValue;
|
|
875
|
+
}
|
|
876
|
+
static hasInner(obj) {
|
|
877
|
+
return false;
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
class SendingTooMuch_ extends UniffiError {
|
|
881
|
+
/**
|
|
882
|
+
* @private
|
|
883
|
+
* This field is private and should not be used, use `tag` instead.
|
|
884
|
+
*/
|
|
885
|
+
[uniffiTypeNameSymbol] = "ExtractTxError";
|
|
886
|
+
tag = ExtractTxError_Tags.SendingTooMuch;
|
|
887
|
+
constructor() {
|
|
888
|
+
super("ExtractTxError", "SendingTooMuch");
|
|
889
|
+
}
|
|
890
|
+
static new() {
|
|
891
|
+
return new SendingTooMuch_();
|
|
892
|
+
}
|
|
893
|
+
static instanceOf(obj) {
|
|
894
|
+
return obj.tag === ExtractTxError_Tags.SendingTooMuch;
|
|
895
|
+
}
|
|
896
|
+
static hasInner(obj) {
|
|
897
|
+
return false;
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
class OtherExtractTxErr_ extends UniffiError {
|
|
901
|
+
/**
|
|
902
|
+
* @private
|
|
903
|
+
* This field is private and should not be used, use `tag` instead.
|
|
904
|
+
*/
|
|
905
|
+
[uniffiTypeNameSymbol] = "ExtractTxError";
|
|
906
|
+
tag = ExtractTxError_Tags.OtherExtractTxErr;
|
|
907
|
+
constructor() {
|
|
908
|
+
super("ExtractTxError", "OtherExtractTxErr");
|
|
909
|
+
}
|
|
910
|
+
static new() {
|
|
911
|
+
return new OtherExtractTxErr_();
|
|
912
|
+
}
|
|
913
|
+
static instanceOf(obj) {
|
|
914
|
+
return obj.tag === ExtractTxError_Tags.OtherExtractTxErr;
|
|
915
|
+
}
|
|
916
|
+
static hasInner(obj) {
|
|
917
|
+
return false;
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
function instanceOf(obj) {
|
|
921
|
+
return obj[uniffiTypeNameSymbol] === "ExtractTxError";
|
|
922
|
+
}
|
|
923
|
+
return Object.freeze({
|
|
924
|
+
instanceOf,
|
|
925
|
+
AbsurdFeeRate: AbsurdFeeRate_,
|
|
926
|
+
MissingInputValue: MissingInputValue_,
|
|
927
|
+
SendingTooMuch: SendingTooMuch_,
|
|
928
|
+
OtherExtractTxErr: OtherExtractTxErr_,
|
|
929
|
+
});
|
|
930
|
+
})();
|
|
931
|
+
// FfiConverter for enum ExtractTxError
|
|
932
|
+
const FfiConverterTypeExtractTxError = (() => {
|
|
933
|
+
const ordinalConverter = FfiConverterInt32;
|
|
934
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
935
|
+
read(from) {
|
|
936
|
+
switch (ordinalConverter.read(from)) {
|
|
937
|
+
case 1:
|
|
938
|
+
return new ExtractTxError.AbsurdFeeRate({
|
|
939
|
+
feeRate: FfiConverterString.read(from),
|
|
940
|
+
});
|
|
941
|
+
case 2:
|
|
942
|
+
return new ExtractTxError.MissingInputValue();
|
|
943
|
+
case 3:
|
|
944
|
+
return new ExtractTxError.SendingTooMuch();
|
|
945
|
+
case 4:
|
|
946
|
+
return new ExtractTxError.OtherExtractTxErr();
|
|
947
|
+
default:
|
|
948
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
write(value, into) {
|
|
952
|
+
switch (value.tag) {
|
|
953
|
+
case ExtractTxError_Tags.AbsurdFeeRate: {
|
|
954
|
+
ordinalConverter.write(1, into);
|
|
955
|
+
const inner = value.inner;
|
|
956
|
+
FfiConverterString.write(inner.feeRate, into);
|
|
957
|
+
return;
|
|
958
|
+
}
|
|
959
|
+
case ExtractTxError_Tags.MissingInputValue: {
|
|
960
|
+
ordinalConverter.write(2, into);
|
|
961
|
+
return;
|
|
962
|
+
}
|
|
963
|
+
case ExtractTxError_Tags.SendingTooMuch: {
|
|
964
|
+
ordinalConverter.write(3, into);
|
|
965
|
+
return;
|
|
966
|
+
}
|
|
967
|
+
case ExtractTxError_Tags.OtherExtractTxErr: {
|
|
968
|
+
ordinalConverter.write(4, into);
|
|
969
|
+
return;
|
|
970
|
+
}
|
|
971
|
+
default:
|
|
972
|
+
// Throwing from here means that ExtractTxError_Tags hasn't matched an ordinal.
|
|
973
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
allocationSize(value) {
|
|
977
|
+
switch (value.tag) {
|
|
978
|
+
case ExtractTxError_Tags.AbsurdFeeRate: {
|
|
979
|
+
const inner = value.inner;
|
|
980
|
+
let size = ordinalConverter.allocationSize(1);
|
|
981
|
+
size += FfiConverterString.allocationSize(inner.feeRate);
|
|
982
|
+
return size;
|
|
983
|
+
}
|
|
984
|
+
case ExtractTxError_Tags.MissingInputValue: {
|
|
985
|
+
return ordinalConverter.allocationSize(2);
|
|
986
|
+
}
|
|
987
|
+
case ExtractTxError_Tags.SendingTooMuch: {
|
|
988
|
+
return ordinalConverter.allocationSize(3);
|
|
989
|
+
}
|
|
990
|
+
case ExtractTxError_Tags.OtherExtractTxErr: {
|
|
991
|
+
return ordinalConverter.allocationSize(4);
|
|
992
|
+
}
|
|
993
|
+
default:
|
|
994
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
return new FFIConverter();
|
|
999
|
+
})();
|
|
1000
|
+
// Error type: FeeRateError
|
|
1001
|
+
// Enum: FeeRateError
|
|
1002
|
+
export var FeeRateError_Tags;
|
|
1003
|
+
(function (FeeRateError_Tags) {
|
|
1004
|
+
FeeRateError_Tags["ArithmeticOverflow"] = "ArithmeticOverflow";
|
|
1005
|
+
})(FeeRateError_Tags || (FeeRateError_Tags = {}));
|
|
1006
|
+
export const FeeRateError = (() => {
|
|
1007
|
+
class ArithmeticOverflow_ extends UniffiError {
|
|
1008
|
+
/**
|
|
1009
|
+
* @private
|
|
1010
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1011
|
+
*/
|
|
1012
|
+
[uniffiTypeNameSymbol] = "FeeRateError";
|
|
1013
|
+
tag = FeeRateError_Tags.ArithmeticOverflow;
|
|
1014
|
+
constructor() {
|
|
1015
|
+
super("FeeRateError", "ArithmeticOverflow");
|
|
1016
|
+
}
|
|
1017
|
+
static new() {
|
|
1018
|
+
return new ArithmeticOverflow_();
|
|
1019
|
+
}
|
|
1020
|
+
static instanceOf(obj) {
|
|
1021
|
+
return obj.tag === FeeRateError_Tags.ArithmeticOverflow;
|
|
1022
|
+
}
|
|
1023
|
+
static hasInner(obj) {
|
|
1024
|
+
return false;
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1027
|
+
function instanceOf(obj) {
|
|
1028
|
+
return obj[uniffiTypeNameSymbol] === "FeeRateError";
|
|
1029
|
+
}
|
|
1030
|
+
return Object.freeze({
|
|
1031
|
+
instanceOf,
|
|
1032
|
+
ArithmeticOverflow: ArithmeticOverflow_,
|
|
1033
|
+
});
|
|
1034
|
+
})();
|
|
1035
|
+
// FfiConverter for enum FeeRateError
|
|
1036
|
+
const FfiConverterTypeFeeRateError = (() => {
|
|
1037
|
+
const ordinalConverter = FfiConverterInt32;
|
|
1038
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
1039
|
+
read(from) {
|
|
1040
|
+
switch (ordinalConverter.read(from)) {
|
|
1041
|
+
case 1:
|
|
1042
|
+
return new FeeRateError.ArithmeticOverflow();
|
|
1043
|
+
default:
|
|
1044
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
write(value, into) {
|
|
1048
|
+
switch (value.tag) {
|
|
1049
|
+
case FeeRateError_Tags.ArithmeticOverflow: {
|
|
1050
|
+
ordinalConverter.write(1, into);
|
|
1051
|
+
return;
|
|
1052
|
+
}
|
|
1053
|
+
default:
|
|
1054
|
+
// Throwing from here means that FeeRateError_Tags hasn't matched an ordinal.
|
|
1055
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
allocationSize(value) {
|
|
1059
|
+
switch (value.tag) {
|
|
1060
|
+
case FeeRateError_Tags.ArithmeticOverflow: {
|
|
1061
|
+
return ordinalConverter.allocationSize(1);
|
|
1062
|
+
}
|
|
1063
|
+
default:
|
|
1064
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
return new FFIConverter();
|
|
1069
|
+
})();
|
|
1070
|
+
// Error type: FromScriptError
|
|
1071
|
+
// Enum: FromScriptError
|
|
1072
|
+
export var FromScriptError_Tags;
|
|
1073
|
+
(function (FromScriptError_Tags) {
|
|
1074
|
+
FromScriptError_Tags["UnrecognizedScript"] = "UnrecognizedScript";
|
|
1075
|
+
FromScriptError_Tags["WitnessProgram"] = "WitnessProgram";
|
|
1076
|
+
FromScriptError_Tags["WitnessVersion"] = "WitnessVersion";
|
|
1077
|
+
FromScriptError_Tags["OtherFromScriptErr"] = "OtherFromScriptErr";
|
|
1078
|
+
})(FromScriptError_Tags || (FromScriptError_Tags = {}));
|
|
1079
|
+
export const FromScriptError = (() => {
|
|
1080
|
+
class UnrecognizedScript_ extends UniffiError {
|
|
1081
|
+
/**
|
|
1082
|
+
* @private
|
|
1083
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1084
|
+
*/
|
|
1085
|
+
[uniffiTypeNameSymbol] = "FromScriptError";
|
|
1086
|
+
tag = FromScriptError_Tags.UnrecognizedScript;
|
|
1087
|
+
constructor() {
|
|
1088
|
+
super("FromScriptError", "UnrecognizedScript");
|
|
1089
|
+
}
|
|
1090
|
+
static new() {
|
|
1091
|
+
return new UnrecognizedScript_();
|
|
1092
|
+
}
|
|
1093
|
+
static instanceOf(obj) {
|
|
1094
|
+
return obj.tag === FromScriptError_Tags.UnrecognizedScript;
|
|
1095
|
+
}
|
|
1096
|
+
static hasInner(obj) {
|
|
1097
|
+
return false;
|
|
1098
|
+
}
|
|
1099
|
+
}
|
|
1100
|
+
class WitnessProgram_ extends UniffiError {
|
|
1101
|
+
/**
|
|
1102
|
+
* @private
|
|
1103
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1104
|
+
*/
|
|
1105
|
+
[uniffiTypeNameSymbol] = "FromScriptError";
|
|
1106
|
+
tag = FromScriptError_Tags.WitnessProgram;
|
|
1107
|
+
inner;
|
|
1108
|
+
constructor(inner) {
|
|
1109
|
+
super("FromScriptError", "WitnessProgram");
|
|
1110
|
+
this.inner = Object.freeze(inner);
|
|
1111
|
+
}
|
|
1112
|
+
static new(inner) {
|
|
1113
|
+
return new WitnessProgram_(inner);
|
|
1114
|
+
}
|
|
1115
|
+
static instanceOf(obj) {
|
|
1116
|
+
return obj.tag === FromScriptError_Tags.WitnessProgram;
|
|
1117
|
+
}
|
|
1118
|
+
static hasInner(obj) {
|
|
1119
|
+
return WitnessProgram_.instanceOf(obj);
|
|
1120
|
+
}
|
|
1121
|
+
static getInner(obj) {
|
|
1122
|
+
return obj.inner;
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
class WitnessVersion_ extends UniffiError {
|
|
1126
|
+
/**
|
|
1127
|
+
* @private
|
|
1128
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1129
|
+
*/
|
|
1130
|
+
[uniffiTypeNameSymbol] = "FromScriptError";
|
|
1131
|
+
tag = FromScriptError_Tags.WitnessVersion;
|
|
1132
|
+
inner;
|
|
1133
|
+
constructor(inner) {
|
|
1134
|
+
super("FromScriptError", "WitnessVersion");
|
|
1135
|
+
this.inner = Object.freeze(inner);
|
|
1136
|
+
}
|
|
1137
|
+
static new(inner) {
|
|
1138
|
+
return new WitnessVersion_(inner);
|
|
1139
|
+
}
|
|
1140
|
+
static instanceOf(obj) {
|
|
1141
|
+
return obj.tag === FromScriptError_Tags.WitnessVersion;
|
|
1142
|
+
}
|
|
1143
|
+
static hasInner(obj) {
|
|
1144
|
+
return WitnessVersion_.instanceOf(obj);
|
|
1145
|
+
}
|
|
1146
|
+
static getInner(obj) {
|
|
1147
|
+
return obj.inner;
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
class OtherFromScriptErr_ extends UniffiError {
|
|
1151
|
+
/**
|
|
1152
|
+
* @private
|
|
1153
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1154
|
+
*/
|
|
1155
|
+
[uniffiTypeNameSymbol] = "FromScriptError";
|
|
1156
|
+
tag = FromScriptError_Tags.OtherFromScriptErr;
|
|
1157
|
+
constructor() {
|
|
1158
|
+
super("FromScriptError", "OtherFromScriptErr");
|
|
1159
|
+
}
|
|
1160
|
+
static new() {
|
|
1161
|
+
return new OtherFromScriptErr_();
|
|
1162
|
+
}
|
|
1163
|
+
static instanceOf(obj) {
|
|
1164
|
+
return obj.tag === FromScriptError_Tags.OtherFromScriptErr;
|
|
1165
|
+
}
|
|
1166
|
+
static hasInner(obj) {
|
|
1167
|
+
return false;
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
function instanceOf(obj) {
|
|
1171
|
+
return obj[uniffiTypeNameSymbol] === "FromScriptError";
|
|
1172
|
+
}
|
|
1173
|
+
return Object.freeze({
|
|
1174
|
+
instanceOf,
|
|
1175
|
+
UnrecognizedScript: UnrecognizedScript_,
|
|
1176
|
+
WitnessProgram: WitnessProgram_,
|
|
1177
|
+
WitnessVersion: WitnessVersion_,
|
|
1178
|
+
OtherFromScriptErr: OtherFromScriptErr_,
|
|
1179
|
+
});
|
|
1180
|
+
})();
|
|
1181
|
+
// FfiConverter for enum FromScriptError
|
|
1182
|
+
const FfiConverterTypeFromScriptError = (() => {
|
|
1183
|
+
const ordinalConverter = FfiConverterInt32;
|
|
1184
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
1185
|
+
read(from) {
|
|
1186
|
+
switch (ordinalConverter.read(from)) {
|
|
1187
|
+
case 1:
|
|
1188
|
+
return new FromScriptError.UnrecognizedScript();
|
|
1189
|
+
case 2:
|
|
1190
|
+
return new FromScriptError.WitnessProgram({
|
|
1191
|
+
errorMessage: FfiConverterString.read(from),
|
|
1192
|
+
});
|
|
1193
|
+
case 3:
|
|
1194
|
+
return new FromScriptError.WitnessVersion({
|
|
1195
|
+
errorMessage: FfiConverterString.read(from),
|
|
1196
|
+
});
|
|
1197
|
+
case 4:
|
|
1198
|
+
return new FromScriptError.OtherFromScriptErr();
|
|
1199
|
+
default:
|
|
1200
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
1201
|
+
}
|
|
1202
|
+
}
|
|
1203
|
+
write(value, into) {
|
|
1204
|
+
switch (value.tag) {
|
|
1205
|
+
case FromScriptError_Tags.UnrecognizedScript: {
|
|
1206
|
+
ordinalConverter.write(1, into);
|
|
1207
|
+
return;
|
|
1208
|
+
}
|
|
1209
|
+
case FromScriptError_Tags.WitnessProgram: {
|
|
1210
|
+
ordinalConverter.write(2, into);
|
|
1211
|
+
const inner = value.inner;
|
|
1212
|
+
FfiConverterString.write(inner.errorMessage, into);
|
|
1213
|
+
return;
|
|
1214
|
+
}
|
|
1215
|
+
case FromScriptError_Tags.WitnessVersion: {
|
|
1216
|
+
ordinalConverter.write(3, into);
|
|
1217
|
+
const inner = value.inner;
|
|
1218
|
+
FfiConverterString.write(inner.errorMessage, into);
|
|
1219
|
+
return;
|
|
1220
|
+
}
|
|
1221
|
+
case FromScriptError_Tags.OtherFromScriptErr: {
|
|
1222
|
+
ordinalConverter.write(4, into);
|
|
1223
|
+
return;
|
|
1224
|
+
}
|
|
1225
|
+
default:
|
|
1226
|
+
// Throwing from here means that FromScriptError_Tags hasn't matched an ordinal.
|
|
1227
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1230
|
+
allocationSize(value) {
|
|
1231
|
+
switch (value.tag) {
|
|
1232
|
+
case FromScriptError_Tags.UnrecognizedScript: {
|
|
1233
|
+
return ordinalConverter.allocationSize(1);
|
|
1234
|
+
}
|
|
1235
|
+
case FromScriptError_Tags.WitnessProgram: {
|
|
1236
|
+
const inner = value.inner;
|
|
1237
|
+
let size = ordinalConverter.allocationSize(2);
|
|
1238
|
+
size += FfiConverterString.allocationSize(inner.errorMessage);
|
|
1239
|
+
return size;
|
|
1240
|
+
}
|
|
1241
|
+
case FromScriptError_Tags.WitnessVersion: {
|
|
1242
|
+
const inner = value.inner;
|
|
1243
|
+
let size = ordinalConverter.allocationSize(3);
|
|
1244
|
+
size += FfiConverterString.allocationSize(inner.errorMessage);
|
|
1245
|
+
return size;
|
|
1246
|
+
}
|
|
1247
|
+
case FromScriptError_Tags.OtherFromScriptErr: {
|
|
1248
|
+
return ordinalConverter.allocationSize(4);
|
|
1249
|
+
}
|
|
1250
|
+
default:
|
|
1251
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
return new FFIConverter();
|
|
1256
|
+
})();
|
|
1257
|
+
export var Network;
|
|
1258
|
+
(function (Network) {
|
|
1259
|
+
Network[Network["Bitcoin"] = 0] = "Bitcoin";
|
|
1260
|
+
Network[Network["Testnet"] = 1] = "Testnet";
|
|
1261
|
+
Network[Network["Testnet4"] = 2] = "Testnet4";
|
|
1262
|
+
Network[Network["Signet"] = 3] = "Signet";
|
|
1263
|
+
Network[Network["Regtest"] = 4] = "Regtest";
|
|
1264
|
+
})(Network || (Network = {}));
|
|
1265
|
+
const FfiConverterTypeNetwork = (() => {
|
|
1266
|
+
const ordinalConverter = FfiConverterInt32;
|
|
1267
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
1268
|
+
read(from) {
|
|
1269
|
+
switch (ordinalConverter.read(from)) {
|
|
1270
|
+
case 1:
|
|
1271
|
+
return Network.Bitcoin;
|
|
1272
|
+
case 2:
|
|
1273
|
+
return Network.Testnet;
|
|
1274
|
+
case 3:
|
|
1275
|
+
return Network.Testnet4;
|
|
1276
|
+
case 4:
|
|
1277
|
+
return Network.Signet;
|
|
1278
|
+
case 5:
|
|
1279
|
+
return Network.Regtest;
|
|
1280
|
+
default:
|
|
1281
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
1282
|
+
}
|
|
1283
|
+
}
|
|
1284
|
+
write(value, into) {
|
|
1285
|
+
switch (value) {
|
|
1286
|
+
case Network.Bitcoin:
|
|
1287
|
+
return ordinalConverter.write(1, into);
|
|
1288
|
+
case Network.Testnet:
|
|
1289
|
+
return ordinalConverter.write(2, into);
|
|
1290
|
+
case Network.Testnet4:
|
|
1291
|
+
return ordinalConverter.write(3, into);
|
|
1292
|
+
case Network.Signet:
|
|
1293
|
+
return ordinalConverter.write(4, into);
|
|
1294
|
+
case Network.Regtest:
|
|
1295
|
+
return ordinalConverter.write(5, into);
|
|
1296
|
+
}
|
|
1297
|
+
}
|
|
1298
|
+
allocationSize(value) {
|
|
1299
|
+
return ordinalConverter.allocationSize(0);
|
|
1300
|
+
}
|
|
1301
|
+
}
|
|
1302
|
+
return new FFIConverter();
|
|
1303
|
+
})();
|
|
1304
|
+
// Error type: ParseAmountError
|
|
1305
|
+
// Enum: ParseAmountError
|
|
1306
|
+
export var ParseAmountError_Tags;
|
|
1307
|
+
(function (ParseAmountError_Tags) {
|
|
1308
|
+
ParseAmountError_Tags["OutOfRange"] = "OutOfRange";
|
|
1309
|
+
ParseAmountError_Tags["TooPrecise"] = "TooPrecise";
|
|
1310
|
+
ParseAmountError_Tags["MissingDigits"] = "MissingDigits";
|
|
1311
|
+
ParseAmountError_Tags["InputTooLarge"] = "InputTooLarge";
|
|
1312
|
+
ParseAmountError_Tags["InvalidCharacter"] = "InvalidCharacter";
|
|
1313
|
+
ParseAmountError_Tags["OtherParseAmountErr"] = "OtherParseAmountErr";
|
|
1314
|
+
})(ParseAmountError_Tags || (ParseAmountError_Tags = {}));
|
|
1315
|
+
export const ParseAmountError = (() => {
|
|
1316
|
+
class OutOfRange_ extends UniffiError {
|
|
1317
|
+
/**
|
|
1318
|
+
* @private
|
|
1319
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1320
|
+
*/
|
|
1321
|
+
[uniffiTypeNameSymbol] = "ParseAmountError";
|
|
1322
|
+
tag = ParseAmountError_Tags.OutOfRange;
|
|
1323
|
+
constructor() {
|
|
1324
|
+
super("ParseAmountError", "OutOfRange");
|
|
1325
|
+
}
|
|
1326
|
+
static new() {
|
|
1327
|
+
return new OutOfRange_();
|
|
1328
|
+
}
|
|
1329
|
+
static instanceOf(obj) {
|
|
1330
|
+
return obj.tag === ParseAmountError_Tags.OutOfRange;
|
|
1331
|
+
}
|
|
1332
|
+
static hasInner(obj) {
|
|
1333
|
+
return false;
|
|
1334
|
+
}
|
|
1335
|
+
}
|
|
1336
|
+
class TooPrecise_ extends UniffiError {
|
|
1337
|
+
/**
|
|
1338
|
+
* @private
|
|
1339
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1340
|
+
*/
|
|
1341
|
+
[uniffiTypeNameSymbol] = "ParseAmountError";
|
|
1342
|
+
tag = ParseAmountError_Tags.TooPrecise;
|
|
1343
|
+
constructor() {
|
|
1344
|
+
super("ParseAmountError", "TooPrecise");
|
|
1345
|
+
}
|
|
1346
|
+
static new() {
|
|
1347
|
+
return new TooPrecise_();
|
|
1348
|
+
}
|
|
1349
|
+
static instanceOf(obj) {
|
|
1350
|
+
return obj.tag === ParseAmountError_Tags.TooPrecise;
|
|
1351
|
+
}
|
|
1352
|
+
static hasInner(obj) {
|
|
1353
|
+
return false;
|
|
1354
|
+
}
|
|
1355
|
+
}
|
|
1356
|
+
class MissingDigits_ extends UniffiError {
|
|
1357
|
+
/**
|
|
1358
|
+
* @private
|
|
1359
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1360
|
+
*/
|
|
1361
|
+
[uniffiTypeNameSymbol] = "ParseAmountError";
|
|
1362
|
+
tag = ParseAmountError_Tags.MissingDigits;
|
|
1363
|
+
constructor() {
|
|
1364
|
+
super("ParseAmountError", "MissingDigits");
|
|
1365
|
+
}
|
|
1366
|
+
static new() {
|
|
1367
|
+
return new MissingDigits_();
|
|
1368
|
+
}
|
|
1369
|
+
static instanceOf(obj) {
|
|
1370
|
+
return obj.tag === ParseAmountError_Tags.MissingDigits;
|
|
1371
|
+
}
|
|
1372
|
+
static hasInner(obj) {
|
|
1373
|
+
return false;
|
|
1374
|
+
}
|
|
1375
|
+
}
|
|
1376
|
+
class InputTooLarge_ extends UniffiError {
|
|
1377
|
+
/**
|
|
1378
|
+
* @private
|
|
1379
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1380
|
+
*/
|
|
1381
|
+
[uniffiTypeNameSymbol] = "ParseAmountError";
|
|
1382
|
+
tag = ParseAmountError_Tags.InputTooLarge;
|
|
1383
|
+
constructor() {
|
|
1384
|
+
super("ParseAmountError", "InputTooLarge");
|
|
1385
|
+
}
|
|
1386
|
+
static new() {
|
|
1387
|
+
return new InputTooLarge_();
|
|
1388
|
+
}
|
|
1389
|
+
static instanceOf(obj) {
|
|
1390
|
+
return obj.tag === ParseAmountError_Tags.InputTooLarge;
|
|
1391
|
+
}
|
|
1392
|
+
static hasInner(obj) {
|
|
1393
|
+
return false;
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1396
|
+
class InvalidCharacter_ extends UniffiError {
|
|
1397
|
+
/**
|
|
1398
|
+
* @private
|
|
1399
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1400
|
+
*/
|
|
1401
|
+
[uniffiTypeNameSymbol] = "ParseAmountError";
|
|
1402
|
+
tag = ParseAmountError_Tags.InvalidCharacter;
|
|
1403
|
+
inner;
|
|
1404
|
+
constructor(inner) {
|
|
1405
|
+
super("ParseAmountError", "InvalidCharacter");
|
|
1406
|
+
this.inner = Object.freeze(inner);
|
|
1407
|
+
}
|
|
1408
|
+
static new(inner) {
|
|
1409
|
+
return new InvalidCharacter_(inner);
|
|
1410
|
+
}
|
|
1411
|
+
static instanceOf(obj) {
|
|
1412
|
+
return obj.tag === ParseAmountError_Tags.InvalidCharacter;
|
|
1413
|
+
}
|
|
1414
|
+
static hasInner(obj) {
|
|
1415
|
+
return InvalidCharacter_.instanceOf(obj);
|
|
1416
|
+
}
|
|
1417
|
+
static getInner(obj) {
|
|
1418
|
+
return obj.inner;
|
|
1419
|
+
}
|
|
1420
|
+
}
|
|
1421
|
+
class OtherParseAmountErr_ extends UniffiError {
|
|
1422
|
+
/**
|
|
1423
|
+
* @private
|
|
1424
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1425
|
+
*/
|
|
1426
|
+
[uniffiTypeNameSymbol] = "ParseAmountError";
|
|
1427
|
+
tag = ParseAmountError_Tags.OtherParseAmountErr;
|
|
1428
|
+
constructor() {
|
|
1429
|
+
super("ParseAmountError", "OtherParseAmountErr");
|
|
1430
|
+
}
|
|
1431
|
+
static new() {
|
|
1432
|
+
return new OtherParseAmountErr_();
|
|
1433
|
+
}
|
|
1434
|
+
static instanceOf(obj) {
|
|
1435
|
+
return obj.tag === ParseAmountError_Tags.OtherParseAmountErr;
|
|
1436
|
+
}
|
|
1437
|
+
static hasInner(obj) {
|
|
1438
|
+
return false;
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1441
|
+
function instanceOf(obj) {
|
|
1442
|
+
return obj[uniffiTypeNameSymbol] === "ParseAmountError";
|
|
1443
|
+
}
|
|
1444
|
+
return Object.freeze({
|
|
1445
|
+
instanceOf,
|
|
1446
|
+
OutOfRange: OutOfRange_,
|
|
1447
|
+
TooPrecise: TooPrecise_,
|
|
1448
|
+
MissingDigits: MissingDigits_,
|
|
1449
|
+
InputTooLarge: InputTooLarge_,
|
|
1450
|
+
InvalidCharacter: InvalidCharacter_,
|
|
1451
|
+
OtherParseAmountErr: OtherParseAmountErr_,
|
|
1452
|
+
});
|
|
1453
|
+
})();
|
|
1454
|
+
// FfiConverter for enum ParseAmountError
|
|
1455
|
+
const FfiConverterTypeParseAmountError = (() => {
|
|
1456
|
+
const ordinalConverter = FfiConverterInt32;
|
|
1457
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
1458
|
+
read(from) {
|
|
1459
|
+
switch (ordinalConverter.read(from)) {
|
|
1460
|
+
case 1:
|
|
1461
|
+
return new ParseAmountError.OutOfRange();
|
|
1462
|
+
case 2:
|
|
1463
|
+
return new ParseAmountError.TooPrecise();
|
|
1464
|
+
case 3:
|
|
1465
|
+
return new ParseAmountError.MissingDigits();
|
|
1466
|
+
case 4:
|
|
1467
|
+
return new ParseAmountError.InputTooLarge();
|
|
1468
|
+
case 5:
|
|
1469
|
+
return new ParseAmountError.InvalidCharacter({
|
|
1470
|
+
errorMessage: FfiConverterString.read(from),
|
|
1471
|
+
});
|
|
1472
|
+
case 6:
|
|
1473
|
+
return new ParseAmountError.OtherParseAmountErr();
|
|
1474
|
+
default:
|
|
1475
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
1476
|
+
}
|
|
1477
|
+
}
|
|
1478
|
+
write(value, into) {
|
|
1479
|
+
switch (value.tag) {
|
|
1480
|
+
case ParseAmountError_Tags.OutOfRange: {
|
|
1481
|
+
ordinalConverter.write(1, into);
|
|
1482
|
+
return;
|
|
1483
|
+
}
|
|
1484
|
+
case ParseAmountError_Tags.TooPrecise: {
|
|
1485
|
+
ordinalConverter.write(2, into);
|
|
1486
|
+
return;
|
|
1487
|
+
}
|
|
1488
|
+
case ParseAmountError_Tags.MissingDigits: {
|
|
1489
|
+
ordinalConverter.write(3, into);
|
|
1490
|
+
return;
|
|
1491
|
+
}
|
|
1492
|
+
case ParseAmountError_Tags.InputTooLarge: {
|
|
1493
|
+
ordinalConverter.write(4, into);
|
|
1494
|
+
return;
|
|
1495
|
+
}
|
|
1496
|
+
case ParseAmountError_Tags.InvalidCharacter: {
|
|
1497
|
+
ordinalConverter.write(5, into);
|
|
1498
|
+
const inner = value.inner;
|
|
1499
|
+
FfiConverterString.write(inner.errorMessage, into);
|
|
1500
|
+
return;
|
|
1501
|
+
}
|
|
1502
|
+
case ParseAmountError_Tags.OtherParseAmountErr: {
|
|
1503
|
+
ordinalConverter.write(6, into);
|
|
1504
|
+
return;
|
|
1505
|
+
}
|
|
1506
|
+
default:
|
|
1507
|
+
// Throwing from here means that ParseAmountError_Tags hasn't matched an ordinal.
|
|
1508
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
1509
|
+
}
|
|
1510
|
+
}
|
|
1511
|
+
allocationSize(value) {
|
|
1512
|
+
switch (value.tag) {
|
|
1513
|
+
case ParseAmountError_Tags.OutOfRange: {
|
|
1514
|
+
return ordinalConverter.allocationSize(1);
|
|
1515
|
+
}
|
|
1516
|
+
case ParseAmountError_Tags.TooPrecise: {
|
|
1517
|
+
return ordinalConverter.allocationSize(2);
|
|
1518
|
+
}
|
|
1519
|
+
case ParseAmountError_Tags.MissingDigits: {
|
|
1520
|
+
return ordinalConverter.allocationSize(3);
|
|
1521
|
+
}
|
|
1522
|
+
case ParseAmountError_Tags.InputTooLarge: {
|
|
1523
|
+
return ordinalConverter.allocationSize(4);
|
|
1524
|
+
}
|
|
1525
|
+
case ParseAmountError_Tags.InvalidCharacter: {
|
|
1526
|
+
const inner = value.inner;
|
|
1527
|
+
let size = ordinalConverter.allocationSize(5);
|
|
1528
|
+
size += FfiConverterString.allocationSize(inner.errorMessage);
|
|
1529
|
+
return size;
|
|
1530
|
+
}
|
|
1531
|
+
case ParseAmountError_Tags.OtherParseAmountErr: {
|
|
1532
|
+
return ordinalConverter.allocationSize(6);
|
|
1533
|
+
}
|
|
1534
|
+
default:
|
|
1535
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
1536
|
+
}
|
|
1537
|
+
}
|
|
1538
|
+
}
|
|
1539
|
+
return new FFIConverter();
|
|
1540
|
+
})();
|
|
1541
|
+
// Error type: PsbtError
|
|
1542
|
+
// Enum: PsbtError
|
|
1543
|
+
export var PsbtError_Tags;
|
|
1544
|
+
(function (PsbtError_Tags) {
|
|
1545
|
+
PsbtError_Tags["InvalidMagic"] = "InvalidMagic";
|
|
1546
|
+
PsbtError_Tags["MissingUtxo"] = "MissingUtxo";
|
|
1547
|
+
PsbtError_Tags["InvalidSeparator"] = "InvalidSeparator";
|
|
1548
|
+
PsbtError_Tags["PsbtUtxoOutOfBounds"] = "PsbtUtxoOutOfBounds";
|
|
1549
|
+
PsbtError_Tags["InvalidKey"] = "InvalidKey";
|
|
1550
|
+
PsbtError_Tags["InvalidProprietaryKey"] = "InvalidProprietaryKey";
|
|
1551
|
+
PsbtError_Tags["DuplicateKey"] = "DuplicateKey";
|
|
1552
|
+
PsbtError_Tags["UnsignedTxHasScriptSigs"] = "UnsignedTxHasScriptSigs";
|
|
1553
|
+
PsbtError_Tags["UnsignedTxHasScriptWitnesses"] = "UnsignedTxHasScriptWitnesses";
|
|
1554
|
+
PsbtError_Tags["MustHaveUnsignedTx"] = "MustHaveUnsignedTx";
|
|
1555
|
+
PsbtError_Tags["NoMorePairs"] = "NoMorePairs";
|
|
1556
|
+
PsbtError_Tags["UnexpectedUnsignedTx"] = "UnexpectedUnsignedTx";
|
|
1557
|
+
PsbtError_Tags["NonStandardSighashType"] = "NonStandardSighashType";
|
|
1558
|
+
PsbtError_Tags["InvalidHash"] = "InvalidHash";
|
|
1559
|
+
PsbtError_Tags["InvalidPreimageHashPair"] = "InvalidPreimageHashPair";
|
|
1560
|
+
PsbtError_Tags["CombineInconsistentKeySources"] = "CombineInconsistentKeySources";
|
|
1561
|
+
PsbtError_Tags["ConsensusEncoding"] = "ConsensusEncoding";
|
|
1562
|
+
PsbtError_Tags["NegativeFee"] = "NegativeFee";
|
|
1563
|
+
PsbtError_Tags["FeeOverflow"] = "FeeOverflow";
|
|
1564
|
+
PsbtError_Tags["InvalidPublicKey"] = "InvalidPublicKey";
|
|
1565
|
+
PsbtError_Tags["InvalidSecp256k1PublicKey"] = "InvalidSecp256k1PublicKey";
|
|
1566
|
+
PsbtError_Tags["InvalidXOnlyPublicKey"] = "InvalidXOnlyPublicKey";
|
|
1567
|
+
PsbtError_Tags["InvalidEcdsaSignature"] = "InvalidEcdsaSignature";
|
|
1568
|
+
PsbtError_Tags["InvalidTaprootSignature"] = "InvalidTaprootSignature";
|
|
1569
|
+
PsbtError_Tags["InvalidControlBlock"] = "InvalidControlBlock";
|
|
1570
|
+
PsbtError_Tags["InvalidLeafVersion"] = "InvalidLeafVersion";
|
|
1571
|
+
PsbtError_Tags["Taproot"] = "Taproot";
|
|
1572
|
+
PsbtError_Tags["TapTree"] = "TapTree";
|
|
1573
|
+
PsbtError_Tags["XPubKey"] = "XPubKey";
|
|
1574
|
+
PsbtError_Tags["Version"] = "Version";
|
|
1575
|
+
PsbtError_Tags["PartialDataConsumption"] = "PartialDataConsumption";
|
|
1576
|
+
PsbtError_Tags["Io"] = "Io";
|
|
1577
|
+
PsbtError_Tags["OtherPsbtErr"] = "OtherPsbtErr";
|
|
1578
|
+
})(PsbtError_Tags || (PsbtError_Tags = {}));
|
|
1579
|
+
export const PsbtError = (() => {
|
|
1580
|
+
class InvalidMagic_ extends UniffiError {
|
|
1581
|
+
/**
|
|
1582
|
+
* @private
|
|
1583
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1584
|
+
*/
|
|
1585
|
+
[uniffiTypeNameSymbol] = "PsbtError";
|
|
1586
|
+
tag = PsbtError_Tags.InvalidMagic;
|
|
1587
|
+
constructor() {
|
|
1588
|
+
super("PsbtError", "InvalidMagic");
|
|
1589
|
+
}
|
|
1590
|
+
static new() {
|
|
1591
|
+
return new InvalidMagic_();
|
|
1592
|
+
}
|
|
1593
|
+
static instanceOf(obj) {
|
|
1594
|
+
return obj.tag === PsbtError_Tags.InvalidMagic;
|
|
1595
|
+
}
|
|
1596
|
+
static hasInner(obj) {
|
|
1597
|
+
return false;
|
|
1598
|
+
}
|
|
1599
|
+
}
|
|
1600
|
+
class MissingUtxo_ extends UniffiError {
|
|
1601
|
+
/**
|
|
1602
|
+
* @private
|
|
1603
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1604
|
+
*/
|
|
1605
|
+
[uniffiTypeNameSymbol] = "PsbtError";
|
|
1606
|
+
tag = PsbtError_Tags.MissingUtxo;
|
|
1607
|
+
constructor() {
|
|
1608
|
+
super("PsbtError", "MissingUtxo");
|
|
1609
|
+
}
|
|
1610
|
+
static new() {
|
|
1611
|
+
return new MissingUtxo_();
|
|
1612
|
+
}
|
|
1613
|
+
static instanceOf(obj) {
|
|
1614
|
+
return obj.tag === PsbtError_Tags.MissingUtxo;
|
|
1615
|
+
}
|
|
1616
|
+
static hasInner(obj) {
|
|
1617
|
+
return false;
|
|
1618
|
+
}
|
|
1619
|
+
}
|
|
1620
|
+
class InvalidSeparator_ extends UniffiError {
|
|
1621
|
+
/**
|
|
1622
|
+
* @private
|
|
1623
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1624
|
+
*/
|
|
1625
|
+
[uniffiTypeNameSymbol] = "PsbtError";
|
|
1626
|
+
tag = PsbtError_Tags.InvalidSeparator;
|
|
1627
|
+
constructor() {
|
|
1628
|
+
super("PsbtError", "InvalidSeparator");
|
|
1629
|
+
}
|
|
1630
|
+
static new() {
|
|
1631
|
+
return new InvalidSeparator_();
|
|
1632
|
+
}
|
|
1633
|
+
static instanceOf(obj) {
|
|
1634
|
+
return obj.tag === PsbtError_Tags.InvalidSeparator;
|
|
1635
|
+
}
|
|
1636
|
+
static hasInner(obj) {
|
|
1637
|
+
return false;
|
|
1638
|
+
}
|
|
1639
|
+
}
|
|
1640
|
+
class PsbtUtxoOutOfBounds_ extends UniffiError {
|
|
1641
|
+
/**
|
|
1642
|
+
* @private
|
|
1643
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1644
|
+
*/
|
|
1645
|
+
[uniffiTypeNameSymbol] = "PsbtError";
|
|
1646
|
+
tag = PsbtError_Tags.PsbtUtxoOutOfBounds;
|
|
1647
|
+
constructor() {
|
|
1648
|
+
super("PsbtError", "PsbtUtxoOutOfBounds");
|
|
1649
|
+
}
|
|
1650
|
+
static new() {
|
|
1651
|
+
return new PsbtUtxoOutOfBounds_();
|
|
1652
|
+
}
|
|
1653
|
+
static instanceOf(obj) {
|
|
1654
|
+
return obj.tag === PsbtError_Tags.PsbtUtxoOutOfBounds;
|
|
1655
|
+
}
|
|
1656
|
+
static hasInner(obj) {
|
|
1657
|
+
return false;
|
|
1658
|
+
}
|
|
1659
|
+
}
|
|
1660
|
+
class InvalidKey_ extends UniffiError {
|
|
1661
|
+
/**
|
|
1662
|
+
* @private
|
|
1663
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1664
|
+
*/
|
|
1665
|
+
[uniffiTypeNameSymbol] = "PsbtError";
|
|
1666
|
+
tag = PsbtError_Tags.InvalidKey;
|
|
1667
|
+
inner;
|
|
1668
|
+
constructor(inner) {
|
|
1669
|
+
super("PsbtError", "InvalidKey");
|
|
1670
|
+
this.inner = Object.freeze(inner);
|
|
1671
|
+
}
|
|
1672
|
+
static new(inner) {
|
|
1673
|
+
return new InvalidKey_(inner);
|
|
1674
|
+
}
|
|
1675
|
+
static instanceOf(obj) {
|
|
1676
|
+
return obj.tag === PsbtError_Tags.InvalidKey;
|
|
1677
|
+
}
|
|
1678
|
+
static hasInner(obj) {
|
|
1679
|
+
return InvalidKey_.instanceOf(obj);
|
|
1680
|
+
}
|
|
1681
|
+
static getInner(obj) {
|
|
1682
|
+
return obj.inner;
|
|
1683
|
+
}
|
|
1684
|
+
}
|
|
1685
|
+
class InvalidProprietaryKey_ extends UniffiError {
|
|
1686
|
+
/**
|
|
1687
|
+
* @private
|
|
1688
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1689
|
+
*/
|
|
1690
|
+
[uniffiTypeNameSymbol] = "PsbtError";
|
|
1691
|
+
tag = PsbtError_Tags.InvalidProprietaryKey;
|
|
1692
|
+
constructor() {
|
|
1693
|
+
super("PsbtError", "InvalidProprietaryKey");
|
|
1694
|
+
}
|
|
1695
|
+
static new() {
|
|
1696
|
+
return new InvalidProprietaryKey_();
|
|
1697
|
+
}
|
|
1698
|
+
static instanceOf(obj) {
|
|
1699
|
+
return obj.tag === PsbtError_Tags.InvalidProprietaryKey;
|
|
1700
|
+
}
|
|
1701
|
+
static hasInner(obj) {
|
|
1702
|
+
return false;
|
|
1703
|
+
}
|
|
1704
|
+
}
|
|
1705
|
+
class DuplicateKey_ extends UniffiError {
|
|
1706
|
+
/**
|
|
1707
|
+
* @private
|
|
1708
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1709
|
+
*/
|
|
1710
|
+
[uniffiTypeNameSymbol] = "PsbtError";
|
|
1711
|
+
tag = PsbtError_Tags.DuplicateKey;
|
|
1712
|
+
inner;
|
|
1713
|
+
constructor(inner) {
|
|
1714
|
+
super("PsbtError", "DuplicateKey");
|
|
1715
|
+
this.inner = Object.freeze(inner);
|
|
1716
|
+
}
|
|
1717
|
+
static new(inner) {
|
|
1718
|
+
return new DuplicateKey_(inner);
|
|
1719
|
+
}
|
|
1720
|
+
static instanceOf(obj) {
|
|
1721
|
+
return obj.tag === PsbtError_Tags.DuplicateKey;
|
|
1722
|
+
}
|
|
1723
|
+
static hasInner(obj) {
|
|
1724
|
+
return DuplicateKey_.instanceOf(obj);
|
|
1725
|
+
}
|
|
1726
|
+
static getInner(obj) {
|
|
1727
|
+
return obj.inner;
|
|
1728
|
+
}
|
|
1729
|
+
}
|
|
1730
|
+
class UnsignedTxHasScriptSigs_ extends UniffiError {
|
|
1731
|
+
/**
|
|
1732
|
+
* @private
|
|
1733
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1734
|
+
*/
|
|
1735
|
+
[uniffiTypeNameSymbol] = "PsbtError";
|
|
1736
|
+
tag = PsbtError_Tags.UnsignedTxHasScriptSigs;
|
|
1737
|
+
constructor() {
|
|
1738
|
+
super("PsbtError", "UnsignedTxHasScriptSigs");
|
|
1739
|
+
}
|
|
1740
|
+
static new() {
|
|
1741
|
+
return new UnsignedTxHasScriptSigs_();
|
|
1742
|
+
}
|
|
1743
|
+
static instanceOf(obj) {
|
|
1744
|
+
return obj.tag === PsbtError_Tags.UnsignedTxHasScriptSigs;
|
|
1745
|
+
}
|
|
1746
|
+
static hasInner(obj) {
|
|
1747
|
+
return false;
|
|
1748
|
+
}
|
|
1749
|
+
}
|
|
1750
|
+
class UnsignedTxHasScriptWitnesses_ extends UniffiError {
|
|
1751
|
+
/**
|
|
1752
|
+
* @private
|
|
1753
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1754
|
+
*/
|
|
1755
|
+
[uniffiTypeNameSymbol] = "PsbtError";
|
|
1756
|
+
tag = PsbtError_Tags.UnsignedTxHasScriptWitnesses;
|
|
1757
|
+
constructor() {
|
|
1758
|
+
super("PsbtError", "UnsignedTxHasScriptWitnesses");
|
|
1759
|
+
}
|
|
1760
|
+
static new() {
|
|
1761
|
+
return new UnsignedTxHasScriptWitnesses_();
|
|
1762
|
+
}
|
|
1763
|
+
static instanceOf(obj) {
|
|
1764
|
+
return obj.tag === PsbtError_Tags.UnsignedTxHasScriptWitnesses;
|
|
1765
|
+
}
|
|
1766
|
+
static hasInner(obj) {
|
|
1767
|
+
return false;
|
|
1768
|
+
}
|
|
1769
|
+
}
|
|
1770
|
+
class MustHaveUnsignedTx_ extends UniffiError {
|
|
1771
|
+
/**
|
|
1772
|
+
* @private
|
|
1773
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1774
|
+
*/
|
|
1775
|
+
[uniffiTypeNameSymbol] = "PsbtError";
|
|
1776
|
+
tag = PsbtError_Tags.MustHaveUnsignedTx;
|
|
1777
|
+
constructor() {
|
|
1778
|
+
super("PsbtError", "MustHaveUnsignedTx");
|
|
1779
|
+
}
|
|
1780
|
+
static new() {
|
|
1781
|
+
return new MustHaveUnsignedTx_();
|
|
1782
|
+
}
|
|
1783
|
+
static instanceOf(obj) {
|
|
1784
|
+
return obj.tag === PsbtError_Tags.MustHaveUnsignedTx;
|
|
1785
|
+
}
|
|
1786
|
+
static hasInner(obj) {
|
|
1787
|
+
return false;
|
|
1788
|
+
}
|
|
1789
|
+
}
|
|
1790
|
+
class NoMorePairs_ extends UniffiError {
|
|
1791
|
+
/**
|
|
1792
|
+
* @private
|
|
1793
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1794
|
+
*/
|
|
1795
|
+
[uniffiTypeNameSymbol] = "PsbtError";
|
|
1796
|
+
tag = PsbtError_Tags.NoMorePairs;
|
|
1797
|
+
constructor() {
|
|
1798
|
+
super("PsbtError", "NoMorePairs");
|
|
1799
|
+
}
|
|
1800
|
+
static new() {
|
|
1801
|
+
return new NoMorePairs_();
|
|
1802
|
+
}
|
|
1803
|
+
static instanceOf(obj) {
|
|
1804
|
+
return obj.tag === PsbtError_Tags.NoMorePairs;
|
|
1805
|
+
}
|
|
1806
|
+
static hasInner(obj) {
|
|
1807
|
+
return false;
|
|
1808
|
+
}
|
|
1809
|
+
}
|
|
1810
|
+
class UnexpectedUnsignedTx_ extends UniffiError {
|
|
1811
|
+
/**
|
|
1812
|
+
* @private
|
|
1813
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1814
|
+
*/
|
|
1815
|
+
[uniffiTypeNameSymbol] = "PsbtError";
|
|
1816
|
+
tag = PsbtError_Tags.UnexpectedUnsignedTx;
|
|
1817
|
+
constructor() {
|
|
1818
|
+
super("PsbtError", "UnexpectedUnsignedTx");
|
|
1819
|
+
}
|
|
1820
|
+
static new() {
|
|
1821
|
+
return new UnexpectedUnsignedTx_();
|
|
1822
|
+
}
|
|
1823
|
+
static instanceOf(obj) {
|
|
1824
|
+
return obj.tag === PsbtError_Tags.UnexpectedUnsignedTx;
|
|
1825
|
+
}
|
|
1826
|
+
static hasInner(obj) {
|
|
1827
|
+
return false;
|
|
1828
|
+
}
|
|
1829
|
+
}
|
|
1830
|
+
class NonStandardSighashType_ extends UniffiError {
|
|
1831
|
+
/**
|
|
1832
|
+
* @private
|
|
1833
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1834
|
+
*/
|
|
1835
|
+
[uniffiTypeNameSymbol] = "PsbtError";
|
|
1836
|
+
tag = PsbtError_Tags.NonStandardSighashType;
|
|
1837
|
+
inner;
|
|
1838
|
+
constructor(inner) {
|
|
1839
|
+
super("PsbtError", "NonStandardSighashType");
|
|
1840
|
+
this.inner = Object.freeze(inner);
|
|
1841
|
+
}
|
|
1842
|
+
static new(inner) {
|
|
1843
|
+
return new NonStandardSighashType_(inner);
|
|
1844
|
+
}
|
|
1845
|
+
static instanceOf(obj) {
|
|
1846
|
+
return obj.tag === PsbtError_Tags.NonStandardSighashType;
|
|
1847
|
+
}
|
|
1848
|
+
static hasInner(obj) {
|
|
1849
|
+
return NonStandardSighashType_.instanceOf(obj);
|
|
1850
|
+
}
|
|
1851
|
+
static getInner(obj) {
|
|
1852
|
+
return obj.inner;
|
|
1853
|
+
}
|
|
1854
|
+
}
|
|
1855
|
+
class InvalidHash_ extends UniffiError {
|
|
1856
|
+
/**
|
|
1857
|
+
* @private
|
|
1858
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1859
|
+
*/
|
|
1860
|
+
[uniffiTypeNameSymbol] = "PsbtError";
|
|
1861
|
+
tag = PsbtError_Tags.InvalidHash;
|
|
1862
|
+
inner;
|
|
1863
|
+
constructor(inner) {
|
|
1864
|
+
super("PsbtError", "InvalidHash");
|
|
1865
|
+
this.inner = Object.freeze(inner);
|
|
1866
|
+
}
|
|
1867
|
+
static new(inner) {
|
|
1868
|
+
return new InvalidHash_(inner);
|
|
1869
|
+
}
|
|
1870
|
+
static instanceOf(obj) {
|
|
1871
|
+
return obj.tag === PsbtError_Tags.InvalidHash;
|
|
1872
|
+
}
|
|
1873
|
+
static hasInner(obj) {
|
|
1874
|
+
return InvalidHash_.instanceOf(obj);
|
|
1875
|
+
}
|
|
1876
|
+
static getInner(obj) {
|
|
1877
|
+
return obj.inner;
|
|
1878
|
+
}
|
|
1879
|
+
}
|
|
1880
|
+
class InvalidPreimageHashPair_ extends UniffiError {
|
|
1881
|
+
/**
|
|
1882
|
+
* @private
|
|
1883
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1884
|
+
*/
|
|
1885
|
+
[uniffiTypeNameSymbol] = "PsbtError";
|
|
1886
|
+
tag = PsbtError_Tags.InvalidPreimageHashPair;
|
|
1887
|
+
constructor() {
|
|
1888
|
+
super("PsbtError", "InvalidPreimageHashPair");
|
|
1889
|
+
}
|
|
1890
|
+
static new() {
|
|
1891
|
+
return new InvalidPreimageHashPair_();
|
|
1892
|
+
}
|
|
1893
|
+
static instanceOf(obj) {
|
|
1894
|
+
return obj.tag === PsbtError_Tags.InvalidPreimageHashPair;
|
|
1895
|
+
}
|
|
1896
|
+
static hasInner(obj) {
|
|
1897
|
+
return false;
|
|
1898
|
+
}
|
|
1899
|
+
}
|
|
1900
|
+
class CombineInconsistentKeySources_ extends UniffiError {
|
|
1901
|
+
/**
|
|
1902
|
+
* @private
|
|
1903
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1904
|
+
*/
|
|
1905
|
+
[uniffiTypeNameSymbol] = "PsbtError";
|
|
1906
|
+
tag = PsbtError_Tags.CombineInconsistentKeySources;
|
|
1907
|
+
inner;
|
|
1908
|
+
constructor(inner) {
|
|
1909
|
+
super("PsbtError", "CombineInconsistentKeySources");
|
|
1910
|
+
this.inner = Object.freeze(inner);
|
|
1911
|
+
}
|
|
1912
|
+
static new(inner) {
|
|
1913
|
+
return new CombineInconsistentKeySources_(inner);
|
|
1914
|
+
}
|
|
1915
|
+
static instanceOf(obj) {
|
|
1916
|
+
return obj.tag === PsbtError_Tags.CombineInconsistentKeySources;
|
|
1917
|
+
}
|
|
1918
|
+
static hasInner(obj) {
|
|
1919
|
+
return CombineInconsistentKeySources_.instanceOf(obj);
|
|
1920
|
+
}
|
|
1921
|
+
static getInner(obj) {
|
|
1922
|
+
return obj.inner;
|
|
1923
|
+
}
|
|
1924
|
+
}
|
|
1925
|
+
class ConsensusEncoding_ extends UniffiError {
|
|
1926
|
+
/**
|
|
1927
|
+
* @private
|
|
1928
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1929
|
+
*/
|
|
1930
|
+
[uniffiTypeNameSymbol] = "PsbtError";
|
|
1931
|
+
tag = PsbtError_Tags.ConsensusEncoding;
|
|
1932
|
+
inner;
|
|
1933
|
+
constructor(inner) {
|
|
1934
|
+
super("PsbtError", "ConsensusEncoding");
|
|
1935
|
+
this.inner = Object.freeze(inner);
|
|
1936
|
+
}
|
|
1937
|
+
static new(inner) {
|
|
1938
|
+
return new ConsensusEncoding_(inner);
|
|
1939
|
+
}
|
|
1940
|
+
static instanceOf(obj) {
|
|
1941
|
+
return obj.tag === PsbtError_Tags.ConsensusEncoding;
|
|
1942
|
+
}
|
|
1943
|
+
static hasInner(obj) {
|
|
1944
|
+
return ConsensusEncoding_.instanceOf(obj);
|
|
1945
|
+
}
|
|
1946
|
+
static getInner(obj) {
|
|
1947
|
+
return obj.inner;
|
|
1948
|
+
}
|
|
1949
|
+
}
|
|
1950
|
+
class NegativeFee_ extends UniffiError {
|
|
1951
|
+
/**
|
|
1952
|
+
* @private
|
|
1953
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1954
|
+
*/
|
|
1955
|
+
[uniffiTypeNameSymbol] = "PsbtError";
|
|
1956
|
+
tag = PsbtError_Tags.NegativeFee;
|
|
1957
|
+
constructor() {
|
|
1958
|
+
super("PsbtError", "NegativeFee");
|
|
1959
|
+
}
|
|
1960
|
+
static new() {
|
|
1961
|
+
return new NegativeFee_();
|
|
1962
|
+
}
|
|
1963
|
+
static instanceOf(obj) {
|
|
1964
|
+
return obj.tag === PsbtError_Tags.NegativeFee;
|
|
1965
|
+
}
|
|
1966
|
+
static hasInner(obj) {
|
|
1967
|
+
return false;
|
|
1968
|
+
}
|
|
1969
|
+
}
|
|
1970
|
+
class FeeOverflow_ extends UniffiError {
|
|
1971
|
+
/**
|
|
1972
|
+
* @private
|
|
1973
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1974
|
+
*/
|
|
1975
|
+
[uniffiTypeNameSymbol] = "PsbtError";
|
|
1976
|
+
tag = PsbtError_Tags.FeeOverflow;
|
|
1977
|
+
constructor() {
|
|
1978
|
+
super("PsbtError", "FeeOverflow");
|
|
1979
|
+
}
|
|
1980
|
+
static new() {
|
|
1981
|
+
return new FeeOverflow_();
|
|
1982
|
+
}
|
|
1983
|
+
static instanceOf(obj) {
|
|
1984
|
+
return obj.tag === PsbtError_Tags.FeeOverflow;
|
|
1985
|
+
}
|
|
1986
|
+
static hasInner(obj) {
|
|
1987
|
+
return false;
|
|
1988
|
+
}
|
|
1989
|
+
}
|
|
1990
|
+
class InvalidPublicKey_ extends UniffiError {
|
|
1991
|
+
/**
|
|
1992
|
+
* @private
|
|
1993
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1994
|
+
*/
|
|
1995
|
+
[uniffiTypeNameSymbol] = "PsbtError";
|
|
1996
|
+
tag = PsbtError_Tags.InvalidPublicKey;
|
|
1997
|
+
inner;
|
|
1998
|
+
constructor(inner) {
|
|
1999
|
+
super("PsbtError", "InvalidPublicKey");
|
|
2000
|
+
this.inner = Object.freeze(inner);
|
|
2001
|
+
}
|
|
2002
|
+
static new(inner) {
|
|
2003
|
+
return new InvalidPublicKey_(inner);
|
|
2004
|
+
}
|
|
2005
|
+
static instanceOf(obj) {
|
|
2006
|
+
return obj.tag === PsbtError_Tags.InvalidPublicKey;
|
|
2007
|
+
}
|
|
2008
|
+
static hasInner(obj) {
|
|
2009
|
+
return InvalidPublicKey_.instanceOf(obj);
|
|
2010
|
+
}
|
|
2011
|
+
static getInner(obj) {
|
|
2012
|
+
return obj.inner;
|
|
2013
|
+
}
|
|
2014
|
+
}
|
|
2015
|
+
class InvalidSecp256k1PublicKey_ extends UniffiError {
|
|
2016
|
+
/**
|
|
2017
|
+
* @private
|
|
2018
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2019
|
+
*/
|
|
2020
|
+
[uniffiTypeNameSymbol] = "PsbtError";
|
|
2021
|
+
tag = PsbtError_Tags.InvalidSecp256k1PublicKey;
|
|
2022
|
+
inner;
|
|
2023
|
+
constructor(inner) {
|
|
2024
|
+
super("PsbtError", "InvalidSecp256k1PublicKey");
|
|
2025
|
+
this.inner = Object.freeze(inner);
|
|
2026
|
+
}
|
|
2027
|
+
static new(inner) {
|
|
2028
|
+
return new InvalidSecp256k1PublicKey_(inner);
|
|
2029
|
+
}
|
|
2030
|
+
static instanceOf(obj) {
|
|
2031
|
+
return obj.tag === PsbtError_Tags.InvalidSecp256k1PublicKey;
|
|
2032
|
+
}
|
|
2033
|
+
static hasInner(obj) {
|
|
2034
|
+
return InvalidSecp256k1PublicKey_.instanceOf(obj);
|
|
2035
|
+
}
|
|
2036
|
+
static getInner(obj) {
|
|
2037
|
+
return obj.inner;
|
|
2038
|
+
}
|
|
2039
|
+
}
|
|
2040
|
+
class InvalidXOnlyPublicKey_ extends UniffiError {
|
|
2041
|
+
/**
|
|
2042
|
+
* @private
|
|
2043
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2044
|
+
*/
|
|
2045
|
+
[uniffiTypeNameSymbol] = "PsbtError";
|
|
2046
|
+
tag = PsbtError_Tags.InvalidXOnlyPublicKey;
|
|
2047
|
+
constructor() {
|
|
2048
|
+
super("PsbtError", "InvalidXOnlyPublicKey");
|
|
2049
|
+
}
|
|
2050
|
+
static new() {
|
|
2051
|
+
return new InvalidXOnlyPublicKey_();
|
|
2052
|
+
}
|
|
2053
|
+
static instanceOf(obj) {
|
|
2054
|
+
return obj.tag === PsbtError_Tags.InvalidXOnlyPublicKey;
|
|
2055
|
+
}
|
|
2056
|
+
static hasInner(obj) {
|
|
2057
|
+
return false;
|
|
2058
|
+
}
|
|
2059
|
+
}
|
|
2060
|
+
class InvalidEcdsaSignature_ extends UniffiError {
|
|
2061
|
+
/**
|
|
2062
|
+
* @private
|
|
2063
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2064
|
+
*/
|
|
2065
|
+
[uniffiTypeNameSymbol] = "PsbtError";
|
|
2066
|
+
tag = PsbtError_Tags.InvalidEcdsaSignature;
|
|
2067
|
+
inner;
|
|
2068
|
+
constructor(inner) {
|
|
2069
|
+
super("PsbtError", "InvalidEcdsaSignature");
|
|
2070
|
+
this.inner = Object.freeze(inner);
|
|
2071
|
+
}
|
|
2072
|
+
static new(inner) {
|
|
2073
|
+
return new InvalidEcdsaSignature_(inner);
|
|
2074
|
+
}
|
|
2075
|
+
static instanceOf(obj) {
|
|
2076
|
+
return obj.tag === PsbtError_Tags.InvalidEcdsaSignature;
|
|
2077
|
+
}
|
|
2078
|
+
static hasInner(obj) {
|
|
2079
|
+
return InvalidEcdsaSignature_.instanceOf(obj);
|
|
2080
|
+
}
|
|
2081
|
+
static getInner(obj) {
|
|
2082
|
+
return obj.inner;
|
|
2083
|
+
}
|
|
2084
|
+
}
|
|
2085
|
+
class InvalidTaprootSignature_ extends UniffiError {
|
|
2086
|
+
/**
|
|
2087
|
+
* @private
|
|
2088
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2089
|
+
*/
|
|
2090
|
+
[uniffiTypeNameSymbol] = "PsbtError";
|
|
2091
|
+
tag = PsbtError_Tags.InvalidTaprootSignature;
|
|
2092
|
+
inner;
|
|
2093
|
+
constructor(inner) {
|
|
2094
|
+
super("PsbtError", "InvalidTaprootSignature");
|
|
2095
|
+
this.inner = Object.freeze(inner);
|
|
2096
|
+
}
|
|
2097
|
+
static new(inner) {
|
|
2098
|
+
return new InvalidTaprootSignature_(inner);
|
|
2099
|
+
}
|
|
2100
|
+
static instanceOf(obj) {
|
|
2101
|
+
return obj.tag === PsbtError_Tags.InvalidTaprootSignature;
|
|
2102
|
+
}
|
|
2103
|
+
static hasInner(obj) {
|
|
2104
|
+
return InvalidTaprootSignature_.instanceOf(obj);
|
|
2105
|
+
}
|
|
2106
|
+
static getInner(obj) {
|
|
2107
|
+
return obj.inner;
|
|
2108
|
+
}
|
|
2109
|
+
}
|
|
2110
|
+
class InvalidControlBlock_ extends UniffiError {
|
|
2111
|
+
/**
|
|
2112
|
+
* @private
|
|
2113
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2114
|
+
*/
|
|
2115
|
+
[uniffiTypeNameSymbol] = "PsbtError";
|
|
2116
|
+
tag = PsbtError_Tags.InvalidControlBlock;
|
|
2117
|
+
constructor() {
|
|
2118
|
+
super("PsbtError", "InvalidControlBlock");
|
|
2119
|
+
}
|
|
2120
|
+
static new() {
|
|
2121
|
+
return new InvalidControlBlock_();
|
|
2122
|
+
}
|
|
2123
|
+
static instanceOf(obj) {
|
|
2124
|
+
return obj.tag === PsbtError_Tags.InvalidControlBlock;
|
|
2125
|
+
}
|
|
2126
|
+
static hasInner(obj) {
|
|
2127
|
+
return false;
|
|
2128
|
+
}
|
|
2129
|
+
}
|
|
2130
|
+
class InvalidLeafVersion_ extends UniffiError {
|
|
2131
|
+
/**
|
|
2132
|
+
* @private
|
|
2133
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2134
|
+
*/
|
|
2135
|
+
[uniffiTypeNameSymbol] = "PsbtError";
|
|
2136
|
+
tag = PsbtError_Tags.InvalidLeafVersion;
|
|
2137
|
+
constructor() {
|
|
2138
|
+
super("PsbtError", "InvalidLeafVersion");
|
|
2139
|
+
}
|
|
2140
|
+
static new() {
|
|
2141
|
+
return new InvalidLeafVersion_();
|
|
2142
|
+
}
|
|
2143
|
+
static instanceOf(obj) {
|
|
2144
|
+
return obj.tag === PsbtError_Tags.InvalidLeafVersion;
|
|
2145
|
+
}
|
|
2146
|
+
static hasInner(obj) {
|
|
2147
|
+
return false;
|
|
2148
|
+
}
|
|
2149
|
+
}
|
|
2150
|
+
class Taproot_ extends UniffiError {
|
|
2151
|
+
/**
|
|
2152
|
+
* @private
|
|
2153
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2154
|
+
*/
|
|
2155
|
+
[uniffiTypeNameSymbol] = "PsbtError";
|
|
2156
|
+
tag = PsbtError_Tags.Taproot;
|
|
2157
|
+
constructor() {
|
|
2158
|
+
super("PsbtError", "Taproot");
|
|
2159
|
+
}
|
|
2160
|
+
static new() {
|
|
2161
|
+
return new Taproot_();
|
|
2162
|
+
}
|
|
2163
|
+
static instanceOf(obj) {
|
|
2164
|
+
return obj.tag === PsbtError_Tags.Taproot;
|
|
2165
|
+
}
|
|
2166
|
+
static hasInner(obj) {
|
|
2167
|
+
return false;
|
|
2168
|
+
}
|
|
2169
|
+
}
|
|
2170
|
+
class TapTree_ extends UniffiError {
|
|
2171
|
+
/**
|
|
2172
|
+
* @private
|
|
2173
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2174
|
+
*/
|
|
2175
|
+
[uniffiTypeNameSymbol] = "PsbtError";
|
|
2176
|
+
tag = PsbtError_Tags.TapTree;
|
|
2177
|
+
inner;
|
|
2178
|
+
constructor(inner) {
|
|
2179
|
+
super("PsbtError", "TapTree");
|
|
2180
|
+
this.inner = Object.freeze(inner);
|
|
2181
|
+
}
|
|
2182
|
+
static new(inner) {
|
|
2183
|
+
return new TapTree_(inner);
|
|
2184
|
+
}
|
|
2185
|
+
static instanceOf(obj) {
|
|
2186
|
+
return obj.tag === PsbtError_Tags.TapTree;
|
|
2187
|
+
}
|
|
2188
|
+
static hasInner(obj) {
|
|
2189
|
+
return TapTree_.instanceOf(obj);
|
|
2190
|
+
}
|
|
2191
|
+
static getInner(obj) {
|
|
2192
|
+
return obj.inner;
|
|
2193
|
+
}
|
|
2194
|
+
}
|
|
2195
|
+
class XPubKey_ extends UniffiError {
|
|
2196
|
+
/**
|
|
2197
|
+
* @private
|
|
2198
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2199
|
+
*/
|
|
2200
|
+
[uniffiTypeNameSymbol] = "PsbtError";
|
|
2201
|
+
tag = PsbtError_Tags.XPubKey;
|
|
2202
|
+
constructor() {
|
|
2203
|
+
super("PsbtError", "XPubKey");
|
|
2204
|
+
}
|
|
2205
|
+
static new() {
|
|
2206
|
+
return new XPubKey_();
|
|
2207
|
+
}
|
|
2208
|
+
static instanceOf(obj) {
|
|
2209
|
+
return obj.tag === PsbtError_Tags.XPubKey;
|
|
2210
|
+
}
|
|
2211
|
+
static hasInner(obj) {
|
|
2212
|
+
return false;
|
|
2213
|
+
}
|
|
2214
|
+
}
|
|
2215
|
+
class Version_ extends UniffiError {
|
|
2216
|
+
/**
|
|
2217
|
+
* @private
|
|
2218
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2219
|
+
*/
|
|
2220
|
+
[uniffiTypeNameSymbol] = "PsbtError";
|
|
2221
|
+
tag = PsbtError_Tags.Version;
|
|
2222
|
+
inner;
|
|
2223
|
+
constructor(inner) {
|
|
2224
|
+
super("PsbtError", "Version");
|
|
2225
|
+
this.inner = Object.freeze(inner);
|
|
2226
|
+
}
|
|
2227
|
+
static new(inner) {
|
|
2228
|
+
return new Version_(inner);
|
|
2229
|
+
}
|
|
2230
|
+
static instanceOf(obj) {
|
|
2231
|
+
return obj.tag === PsbtError_Tags.Version;
|
|
2232
|
+
}
|
|
2233
|
+
static hasInner(obj) {
|
|
2234
|
+
return Version_.instanceOf(obj);
|
|
2235
|
+
}
|
|
2236
|
+
static getInner(obj) {
|
|
2237
|
+
return obj.inner;
|
|
2238
|
+
}
|
|
2239
|
+
}
|
|
2240
|
+
class PartialDataConsumption_ extends UniffiError {
|
|
2241
|
+
/**
|
|
2242
|
+
* @private
|
|
2243
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2244
|
+
*/
|
|
2245
|
+
[uniffiTypeNameSymbol] = "PsbtError";
|
|
2246
|
+
tag = PsbtError_Tags.PartialDataConsumption;
|
|
2247
|
+
constructor() {
|
|
2248
|
+
super("PsbtError", "PartialDataConsumption");
|
|
2249
|
+
}
|
|
2250
|
+
static new() {
|
|
2251
|
+
return new PartialDataConsumption_();
|
|
2252
|
+
}
|
|
2253
|
+
static instanceOf(obj) {
|
|
2254
|
+
return obj.tag === PsbtError_Tags.PartialDataConsumption;
|
|
2255
|
+
}
|
|
2256
|
+
static hasInner(obj) {
|
|
2257
|
+
return false;
|
|
2258
|
+
}
|
|
2259
|
+
}
|
|
2260
|
+
class Io_ extends UniffiError {
|
|
2261
|
+
/**
|
|
2262
|
+
* @private
|
|
2263
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2264
|
+
*/
|
|
2265
|
+
[uniffiTypeNameSymbol] = "PsbtError";
|
|
2266
|
+
tag = PsbtError_Tags.Io;
|
|
2267
|
+
inner;
|
|
2268
|
+
constructor(inner) {
|
|
2269
|
+
super("PsbtError", "Io");
|
|
2270
|
+
this.inner = Object.freeze(inner);
|
|
2271
|
+
}
|
|
2272
|
+
static new(inner) {
|
|
2273
|
+
return new Io_(inner);
|
|
2274
|
+
}
|
|
2275
|
+
static instanceOf(obj) {
|
|
2276
|
+
return obj.tag === PsbtError_Tags.Io;
|
|
2277
|
+
}
|
|
2278
|
+
static hasInner(obj) {
|
|
2279
|
+
return Io_.instanceOf(obj);
|
|
2280
|
+
}
|
|
2281
|
+
static getInner(obj) {
|
|
2282
|
+
return obj.inner;
|
|
2283
|
+
}
|
|
2284
|
+
}
|
|
2285
|
+
class OtherPsbtErr_ extends UniffiError {
|
|
2286
|
+
/**
|
|
2287
|
+
* @private
|
|
2288
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2289
|
+
*/
|
|
2290
|
+
[uniffiTypeNameSymbol] = "PsbtError";
|
|
2291
|
+
tag = PsbtError_Tags.OtherPsbtErr;
|
|
2292
|
+
constructor() {
|
|
2293
|
+
super("PsbtError", "OtherPsbtErr");
|
|
2294
|
+
}
|
|
2295
|
+
static new() {
|
|
2296
|
+
return new OtherPsbtErr_();
|
|
2297
|
+
}
|
|
2298
|
+
static instanceOf(obj) {
|
|
2299
|
+
return obj.tag === PsbtError_Tags.OtherPsbtErr;
|
|
2300
|
+
}
|
|
2301
|
+
static hasInner(obj) {
|
|
2302
|
+
return false;
|
|
2303
|
+
}
|
|
2304
|
+
}
|
|
2305
|
+
function instanceOf(obj) {
|
|
2306
|
+
return obj[uniffiTypeNameSymbol] === "PsbtError";
|
|
2307
|
+
}
|
|
2308
|
+
return Object.freeze({
|
|
2309
|
+
instanceOf,
|
|
2310
|
+
InvalidMagic: InvalidMagic_,
|
|
2311
|
+
MissingUtxo: MissingUtxo_,
|
|
2312
|
+
InvalidSeparator: InvalidSeparator_,
|
|
2313
|
+
PsbtUtxoOutOfBounds: PsbtUtxoOutOfBounds_,
|
|
2314
|
+
InvalidKey: InvalidKey_,
|
|
2315
|
+
InvalidProprietaryKey: InvalidProprietaryKey_,
|
|
2316
|
+
DuplicateKey: DuplicateKey_,
|
|
2317
|
+
UnsignedTxHasScriptSigs: UnsignedTxHasScriptSigs_,
|
|
2318
|
+
UnsignedTxHasScriptWitnesses: UnsignedTxHasScriptWitnesses_,
|
|
2319
|
+
MustHaveUnsignedTx: MustHaveUnsignedTx_,
|
|
2320
|
+
NoMorePairs: NoMorePairs_,
|
|
2321
|
+
UnexpectedUnsignedTx: UnexpectedUnsignedTx_,
|
|
2322
|
+
NonStandardSighashType: NonStandardSighashType_,
|
|
2323
|
+
InvalidHash: InvalidHash_,
|
|
2324
|
+
InvalidPreimageHashPair: InvalidPreimageHashPair_,
|
|
2325
|
+
CombineInconsistentKeySources: CombineInconsistentKeySources_,
|
|
2326
|
+
ConsensusEncoding: ConsensusEncoding_,
|
|
2327
|
+
NegativeFee: NegativeFee_,
|
|
2328
|
+
FeeOverflow: FeeOverflow_,
|
|
2329
|
+
InvalidPublicKey: InvalidPublicKey_,
|
|
2330
|
+
InvalidSecp256k1PublicKey: InvalidSecp256k1PublicKey_,
|
|
2331
|
+
InvalidXOnlyPublicKey: InvalidXOnlyPublicKey_,
|
|
2332
|
+
InvalidEcdsaSignature: InvalidEcdsaSignature_,
|
|
2333
|
+
InvalidTaprootSignature: InvalidTaprootSignature_,
|
|
2334
|
+
InvalidControlBlock: InvalidControlBlock_,
|
|
2335
|
+
InvalidLeafVersion: InvalidLeafVersion_,
|
|
2336
|
+
Taproot: Taproot_,
|
|
2337
|
+
TapTree: TapTree_,
|
|
2338
|
+
XPubKey: XPubKey_,
|
|
2339
|
+
Version: Version_,
|
|
2340
|
+
PartialDataConsumption: PartialDataConsumption_,
|
|
2341
|
+
Io: Io_,
|
|
2342
|
+
OtherPsbtErr: OtherPsbtErr_,
|
|
2343
|
+
});
|
|
2344
|
+
})();
|
|
2345
|
+
// FfiConverter for enum PsbtError
|
|
2346
|
+
const FfiConverterTypePsbtError = (() => {
|
|
2347
|
+
const ordinalConverter = FfiConverterInt32;
|
|
2348
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
2349
|
+
read(from) {
|
|
2350
|
+
switch (ordinalConverter.read(from)) {
|
|
2351
|
+
case 1:
|
|
2352
|
+
return new PsbtError.InvalidMagic();
|
|
2353
|
+
case 2:
|
|
2354
|
+
return new PsbtError.MissingUtxo();
|
|
2355
|
+
case 3:
|
|
2356
|
+
return new PsbtError.InvalidSeparator();
|
|
2357
|
+
case 4:
|
|
2358
|
+
return new PsbtError.PsbtUtxoOutOfBounds();
|
|
2359
|
+
case 5:
|
|
2360
|
+
return new PsbtError.InvalidKey({
|
|
2361
|
+
key: FfiConverterString.read(from),
|
|
2362
|
+
});
|
|
2363
|
+
case 6:
|
|
2364
|
+
return new PsbtError.InvalidProprietaryKey();
|
|
2365
|
+
case 7:
|
|
2366
|
+
return new PsbtError.DuplicateKey({
|
|
2367
|
+
key: FfiConverterString.read(from),
|
|
2368
|
+
});
|
|
2369
|
+
case 8:
|
|
2370
|
+
return new PsbtError.UnsignedTxHasScriptSigs();
|
|
2371
|
+
case 9:
|
|
2372
|
+
return new PsbtError.UnsignedTxHasScriptWitnesses();
|
|
2373
|
+
case 10:
|
|
2374
|
+
return new PsbtError.MustHaveUnsignedTx();
|
|
2375
|
+
case 11:
|
|
2376
|
+
return new PsbtError.NoMorePairs();
|
|
2377
|
+
case 12:
|
|
2378
|
+
return new PsbtError.UnexpectedUnsignedTx();
|
|
2379
|
+
case 13:
|
|
2380
|
+
return new PsbtError.NonStandardSighashType({
|
|
2381
|
+
sighash: FfiConverterUInt32.read(from),
|
|
2382
|
+
});
|
|
2383
|
+
case 14:
|
|
2384
|
+
return new PsbtError.InvalidHash({
|
|
2385
|
+
hash: FfiConverterString.read(from),
|
|
2386
|
+
});
|
|
2387
|
+
case 15:
|
|
2388
|
+
return new PsbtError.InvalidPreimageHashPair();
|
|
2389
|
+
case 16:
|
|
2390
|
+
return new PsbtError.CombineInconsistentKeySources({
|
|
2391
|
+
xpub: FfiConverterString.read(from),
|
|
2392
|
+
});
|
|
2393
|
+
case 17:
|
|
2394
|
+
return new PsbtError.ConsensusEncoding({
|
|
2395
|
+
encodingError: FfiConverterString.read(from),
|
|
2396
|
+
});
|
|
2397
|
+
case 18:
|
|
2398
|
+
return new PsbtError.NegativeFee();
|
|
2399
|
+
case 19:
|
|
2400
|
+
return new PsbtError.FeeOverflow();
|
|
2401
|
+
case 20:
|
|
2402
|
+
return new PsbtError.InvalidPublicKey({
|
|
2403
|
+
errorMessage: FfiConverterString.read(from),
|
|
2404
|
+
});
|
|
2405
|
+
case 21:
|
|
2406
|
+
return new PsbtError.InvalidSecp256k1PublicKey({
|
|
2407
|
+
secp256k1Error: FfiConverterString.read(from),
|
|
2408
|
+
});
|
|
2409
|
+
case 22:
|
|
2410
|
+
return new PsbtError.InvalidXOnlyPublicKey();
|
|
2411
|
+
case 23:
|
|
2412
|
+
return new PsbtError.InvalidEcdsaSignature({
|
|
2413
|
+
errorMessage: FfiConverterString.read(from),
|
|
2414
|
+
});
|
|
2415
|
+
case 24:
|
|
2416
|
+
return new PsbtError.InvalidTaprootSignature({
|
|
2417
|
+
errorMessage: FfiConverterString.read(from),
|
|
2418
|
+
});
|
|
2419
|
+
case 25:
|
|
2420
|
+
return new PsbtError.InvalidControlBlock();
|
|
2421
|
+
case 26:
|
|
2422
|
+
return new PsbtError.InvalidLeafVersion();
|
|
2423
|
+
case 27:
|
|
2424
|
+
return new PsbtError.Taproot();
|
|
2425
|
+
case 28:
|
|
2426
|
+
return new PsbtError.TapTree({
|
|
2427
|
+
errorMessage: FfiConverterString.read(from),
|
|
2428
|
+
});
|
|
2429
|
+
case 29:
|
|
2430
|
+
return new PsbtError.XPubKey();
|
|
2431
|
+
case 30:
|
|
2432
|
+
return new PsbtError.Version({
|
|
2433
|
+
errorMessage: FfiConverterString.read(from),
|
|
2434
|
+
});
|
|
2435
|
+
case 31:
|
|
2436
|
+
return new PsbtError.PartialDataConsumption();
|
|
2437
|
+
case 32:
|
|
2438
|
+
return new PsbtError.Io({
|
|
2439
|
+
errorMessage: FfiConverterString.read(from),
|
|
2440
|
+
});
|
|
2441
|
+
case 33:
|
|
2442
|
+
return new PsbtError.OtherPsbtErr();
|
|
2443
|
+
default:
|
|
2444
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
2445
|
+
}
|
|
2446
|
+
}
|
|
2447
|
+
write(value, into) {
|
|
2448
|
+
switch (value.tag) {
|
|
2449
|
+
case PsbtError_Tags.InvalidMagic: {
|
|
2450
|
+
ordinalConverter.write(1, into);
|
|
2451
|
+
return;
|
|
2452
|
+
}
|
|
2453
|
+
case PsbtError_Tags.MissingUtxo: {
|
|
2454
|
+
ordinalConverter.write(2, into);
|
|
2455
|
+
return;
|
|
2456
|
+
}
|
|
2457
|
+
case PsbtError_Tags.InvalidSeparator: {
|
|
2458
|
+
ordinalConverter.write(3, into);
|
|
2459
|
+
return;
|
|
2460
|
+
}
|
|
2461
|
+
case PsbtError_Tags.PsbtUtxoOutOfBounds: {
|
|
2462
|
+
ordinalConverter.write(4, into);
|
|
2463
|
+
return;
|
|
2464
|
+
}
|
|
2465
|
+
case PsbtError_Tags.InvalidKey: {
|
|
2466
|
+
ordinalConverter.write(5, into);
|
|
2467
|
+
const inner = value.inner;
|
|
2468
|
+
FfiConverterString.write(inner.key, into);
|
|
2469
|
+
return;
|
|
2470
|
+
}
|
|
2471
|
+
case PsbtError_Tags.InvalidProprietaryKey: {
|
|
2472
|
+
ordinalConverter.write(6, into);
|
|
2473
|
+
return;
|
|
2474
|
+
}
|
|
2475
|
+
case PsbtError_Tags.DuplicateKey: {
|
|
2476
|
+
ordinalConverter.write(7, into);
|
|
2477
|
+
const inner = value.inner;
|
|
2478
|
+
FfiConverterString.write(inner.key, into);
|
|
2479
|
+
return;
|
|
2480
|
+
}
|
|
2481
|
+
case PsbtError_Tags.UnsignedTxHasScriptSigs: {
|
|
2482
|
+
ordinalConverter.write(8, into);
|
|
2483
|
+
return;
|
|
2484
|
+
}
|
|
2485
|
+
case PsbtError_Tags.UnsignedTxHasScriptWitnesses: {
|
|
2486
|
+
ordinalConverter.write(9, into);
|
|
2487
|
+
return;
|
|
2488
|
+
}
|
|
2489
|
+
case PsbtError_Tags.MustHaveUnsignedTx: {
|
|
2490
|
+
ordinalConverter.write(10, into);
|
|
2491
|
+
return;
|
|
2492
|
+
}
|
|
2493
|
+
case PsbtError_Tags.NoMorePairs: {
|
|
2494
|
+
ordinalConverter.write(11, into);
|
|
2495
|
+
return;
|
|
2496
|
+
}
|
|
2497
|
+
case PsbtError_Tags.UnexpectedUnsignedTx: {
|
|
2498
|
+
ordinalConverter.write(12, into);
|
|
2499
|
+
return;
|
|
2500
|
+
}
|
|
2501
|
+
case PsbtError_Tags.NonStandardSighashType: {
|
|
2502
|
+
ordinalConverter.write(13, into);
|
|
2503
|
+
const inner = value.inner;
|
|
2504
|
+
FfiConverterUInt32.write(inner.sighash, into);
|
|
2505
|
+
return;
|
|
2506
|
+
}
|
|
2507
|
+
case PsbtError_Tags.InvalidHash: {
|
|
2508
|
+
ordinalConverter.write(14, into);
|
|
2509
|
+
const inner = value.inner;
|
|
2510
|
+
FfiConverterString.write(inner.hash, into);
|
|
2511
|
+
return;
|
|
2512
|
+
}
|
|
2513
|
+
case PsbtError_Tags.InvalidPreimageHashPair: {
|
|
2514
|
+
ordinalConverter.write(15, into);
|
|
2515
|
+
return;
|
|
2516
|
+
}
|
|
2517
|
+
case PsbtError_Tags.CombineInconsistentKeySources: {
|
|
2518
|
+
ordinalConverter.write(16, into);
|
|
2519
|
+
const inner = value.inner;
|
|
2520
|
+
FfiConverterString.write(inner.xpub, into);
|
|
2521
|
+
return;
|
|
2522
|
+
}
|
|
2523
|
+
case PsbtError_Tags.ConsensusEncoding: {
|
|
2524
|
+
ordinalConverter.write(17, into);
|
|
2525
|
+
const inner = value.inner;
|
|
2526
|
+
FfiConverterString.write(inner.encodingError, into);
|
|
2527
|
+
return;
|
|
2528
|
+
}
|
|
2529
|
+
case PsbtError_Tags.NegativeFee: {
|
|
2530
|
+
ordinalConverter.write(18, into);
|
|
2531
|
+
return;
|
|
2532
|
+
}
|
|
2533
|
+
case PsbtError_Tags.FeeOverflow: {
|
|
2534
|
+
ordinalConverter.write(19, into);
|
|
2535
|
+
return;
|
|
2536
|
+
}
|
|
2537
|
+
case PsbtError_Tags.InvalidPublicKey: {
|
|
2538
|
+
ordinalConverter.write(20, into);
|
|
2539
|
+
const inner = value.inner;
|
|
2540
|
+
FfiConverterString.write(inner.errorMessage, into);
|
|
2541
|
+
return;
|
|
2542
|
+
}
|
|
2543
|
+
case PsbtError_Tags.InvalidSecp256k1PublicKey: {
|
|
2544
|
+
ordinalConverter.write(21, into);
|
|
2545
|
+
const inner = value.inner;
|
|
2546
|
+
FfiConverterString.write(inner.secp256k1Error, into);
|
|
2547
|
+
return;
|
|
2548
|
+
}
|
|
2549
|
+
case PsbtError_Tags.InvalidXOnlyPublicKey: {
|
|
2550
|
+
ordinalConverter.write(22, into);
|
|
2551
|
+
return;
|
|
2552
|
+
}
|
|
2553
|
+
case PsbtError_Tags.InvalidEcdsaSignature: {
|
|
2554
|
+
ordinalConverter.write(23, into);
|
|
2555
|
+
const inner = value.inner;
|
|
2556
|
+
FfiConverterString.write(inner.errorMessage, into);
|
|
2557
|
+
return;
|
|
2558
|
+
}
|
|
2559
|
+
case PsbtError_Tags.InvalidTaprootSignature: {
|
|
2560
|
+
ordinalConverter.write(24, into);
|
|
2561
|
+
const inner = value.inner;
|
|
2562
|
+
FfiConverterString.write(inner.errorMessage, into);
|
|
2563
|
+
return;
|
|
2564
|
+
}
|
|
2565
|
+
case PsbtError_Tags.InvalidControlBlock: {
|
|
2566
|
+
ordinalConverter.write(25, into);
|
|
2567
|
+
return;
|
|
2568
|
+
}
|
|
2569
|
+
case PsbtError_Tags.InvalidLeafVersion: {
|
|
2570
|
+
ordinalConverter.write(26, into);
|
|
2571
|
+
return;
|
|
2572
|
+
}
|
|
2573
|
+
case PsbtError_Tags.Taproot: {
|
|
2574
|
+
ordinalConverter.write(27, into);
|
|
2575
|
+
return;
|
|
2576
|
+
}
|
|
2577
|
+
case PsbtError_Tags.TapTree: {
|
|
2578
|
+
ordinalConverter.write(28, into);
|
|
2579
|
+
const inner = value.inner;
|
|
2580
|
+
FfiConverterString.write(inner.errorMessage, into);
|
|
2581
|
+
return;
|
|
2582
|
+
}
|
|
2583
|
+
case PsbtError_Tags.XPubKey: {
|
|
2584
|
+
ordinalConverter.write(29, into);
|
|
2585
|
+
return;
|
|
2586
|
+
}
|
|
2587
|
+
case PsbtError_Tags.Version: {
|
|
2588
|
+
ordinalConverter.write(30, into);
|
|
2589
|
+
const inner = value.inner;
|
|
2590
|
+
FfiConverterString.write(inner.errorMessage, into);
|
|
2591
|
+
return;
|
|
2592
|
+
}
|
|
2593
|
+
case PsbtError_Tags.PartialDataConsumption: {
|
|
2594
|
+
ordinalConverter.write(31, into);
|
|
2595
|
+
return;
|
|
2596
|
+
}
|
|
2597
|
+
case PsbtError_Tags.Io: {
|
|
2598
|
+
ordinalConverter.write(32, into);
|
|
2599
|
+
const inner = value.inner;
|
|
2600
|
+
FfiConverterString.write(inner.errorMessage, into);
|
|
2601
|
+
return;
|
|
2602
|
+
}
|
|
2603
|
+
case PsbtError_Tags.OtherPsbtErr: {
|
|
2604
|
+
ordinalConverter.write(33, into);
|
|
2605
|
+
return;
|
|
2606
|
+
}
|
|
2607
|
+
default:
|
|
2608
|
+
// Throwing from here means that PsbtError_Tags hasn't matched an ordinal.
|
|
2609
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
2610
|
+
}
|
|
2611
|
+
}
|
|
2612
|
+
allocationSize(value) {
|
|
2613
|
+
switch (value.tag) {
|
|
2614
|
+
case PsbtError_Tags.InvalidMagic: {
|
|
2615
|
+
return ordinalConverter.allocationSize(1);
|
|
2616
|
+
}
|
|
2617
|
+
case PsbtError_Tags.MissingUtxo: {
|
|
2618
|
+
return ordinalConverter.allocationSize(2);
|
|
2619
|
+
}
|
|
2620
|
+
case PsbtError_Tags.InvalidSeparator: {
|
|
2621
|
+
return ordinalConverter.allocationSize(3);
|
|
2622
|
+
}
|
|
2623
|
+
case PsbtError_Tags.PsbtUtxoOutOfBounds: {
|
|
2624
|
+
return ordinalConverter.allocationSize(4);
|
|
2625
|
+
}
|
|
2626
|
+
case PsbtError_Tags.InvalidKey: {
|
|
2627
|
+
const inner = value.inner;
|
|
2628
|
+
let size = ordinalConverter.allocationSize(5);
|
|
2629
|
+
size += FfiConverterString.allocationSize(inner.key);
|
|
2630
|
+
return size;
|
|
2631
|
+
}
|
|
2632
|
+
case PsbtError_Tags.InvalidProprietaryKey: {
|
|
2633
|
+
return ordinalConverter.allocationSize(6);
|
|
2634
|
+
}
|
|
2635
|
+
case PsbtError_Tags.DuplicateKey: {
|
|
2636
|
+
const inner = value.inner;
|
|
2637
|
+
let size = ordinalConverter.allocationSize(7);
|
|
2638
|
+
size += FfiConverterString.allocationSize(inner.key);
|
|
2639
|
+
return size;
|
|
2640
|
+
}
|
|
2641
|
+
case PsbtError_Tags.UnsignedTxHasScriptSigs: {
|
|
2642
|
+
return ordinalConverter.allocationSize(8);
|
|
2643
|
+
}
|
|
2644
|
+
case PsbtError_Tags.UnsignedTxHasScriptWitnesses: {
|
|
2645
|
+
return ordinalConverter.allocationSize(9);
|
|
2646
|
+
}
|
|
2647
|
+
case PsbtError_Tags.MustHaveUnsignedTx: {
|
|
2648
|
+
return ordinalConverter.allocationSize(10);
|
|
2649
|
+
}
|
|
2650
|
+
case PsbtError_Tags.NoMorePairs: {
|
|
2651
|
+
return ordinalConverter.allocationSize(11);
|
|
2652
|
+
}
|
|
2653
|
+
case PsbtError_Tags.UnexpectedUnsignedTx: {
|
|
2654
|
+
return ordinalConverter.allocationSize(12);
|
|
2655
|
+
}
|
|
2656
|
+
case PsbtError_Tags.NonStandardSighashType: {
|
|
2657
|
+
const inner = value.inner;
|
|
2658
|
+
let size = ordinalConverter.allocationSize(13);
|
|
2659
|
+
size += FfiConverterUInt32.allocationSize(inner.sighash);
|
|
2660
|
+
return size;
|
|
2661
|
+
}
|
|
2662
|
+
case PsbtError_Tags.InvalidHash: {
|
|
2663
|
+
const inner = value.inner;
|
|
2664
|
+
let size = ordinalConverter.allocationSize(14);
|
|
2665
|
+
size += FfiConverterString.allocationSize(inner.hash);
|
|
2666
|
+
return size;
|
|
2667
|
+
}
|
|
2668
|
+
case PsbtError_Tags.InvalidPreimageHashPair: {
|
|
2669
|
+
return ordinalConverter.allocationSize(15);
|
|
2670
|
+
}
|
|
2671
|
+
case PsbtError_Tags.CombineInconsistentKeySources: {
|
|
2672
|
+
const inner = value.inner;
|
|
2673
|
+
let size = ordinalConverter.allocationSize(16);
|
|
2674
|
+
size += FfiConverterString.allocationSize(inner.xpub);
|
|
2675
|
+
return size;
|
|
2676
|
+
}
|
|
2677
|
+
case PsbtError_Tags.ConsensusEncoding: {
|
|
2678
|
+
const inner = value.inner;
|
|
2679
|
+
let size = ordinalConverter.allocationSize(17);
|
|
2680
|
+
size += FfiConverterString.allocationSize(inner.encodingError);
|
|
2681
|
+
return size;
|
|
2682
|
+
}
|
|
2683
|
+
case PsbtError_Tags.NegativeFee: {
|
|
2684
|
+
return ordinalConverter.allocationSize(18);
|
|
2685
|
+
}
|
|
2686
|
+
case PsbtError_Tags.FeeOverflow: {
|
|
2687
|
+
return ordinalConverter.allocationSize(19);
|
|
2688
|
+
}
|
|
2689
|
+
case PsbtError_Tags.InvalidPublicKey: {
|
|
2690
|
+
const inner = value.inner;
|
|
2691
|
+
let size = ordinalConverter.allocationSize(20);
|
|
2692
|
+
size += FfiConverterString.allocationSize(inner.errorMessage);
|
|
2693
|
+
return size;
|
|
2694
|
+
}
|
|
2695
|
+
case PsbtError_Tags.InvalidSecp256k1PublicKey: {
|
|
2696
|
+
const inner = value.inner;
|
|
2697
|
+
let size = ordinalConverter.allocationSize(21);
|
|
2698
|
+
size += FfiConverterString.allocationSize(inner.secp256k1Error);
|
|
2699
|
+
return size;
|
|
2700
|
+
}
|
|
2701
|
+
case PsbtError_Tags.InvalidXOnlyPublicKey: {
|
|
2702
|
+
return ordinalConverter.allocationSize(22);
|
|
2703
|
+
}
|
|
2704
|
+
case PsbtError_Tags.InvalidEcdsaSignature: {
|
|
2705
|
+
const inner = value.inner;
|
|
2706
|
+
let size = ordinalConverter.allocationSize(23);
|
|
2707
|
+
size += FfiConverterString.allocationSize(inner.errorMessage);
|
|
2708
|
+
return size;
|
|
2709
|
+
}
|
|
2710
|
+
case PsbtError_Tags.InvalidTaprootSignature: {
|
|
2711
|
+
const inner = value.inner;
|
|
2712
|
+
let size = ordinalConverter.allocationSize(24);
|
|
2713
|
+
size += FfiConverterString.allocationSize(inner.errorMessage);
|
|
2714
|
+
return size;
|
|
2715
|
+
}
|
|
2716
|
+
case PsbtError_Tags.InvalidControlBlock: {
|
|
2717
|
+
return ordinalConverter.allocationSize(25);
|
|
2718
|
+
}
|
|
2719
|
+
case PsbtError_Tags.InvalidLeafVersion: {
|
|
2720
|
+
return ordinalConverter.allocationSize(26);
|
|
2721
|
+
}
|
|
2722
|
+
case PsbtError_Tags.Taproot: {
|
|
2723
|
+
return ordinalConverter.allocationSize(27);
|
|
2724
|
+
}
|
|
2725
|
+
case PsbtError_Tags.TapTree: {
|
|
2726
|
+
const inner = value.inner;
|
|
2727
|
+
let size = ordinalConverter.allocationSize(28);
|
|
2728
|
+
size += FfiConverterString.allocationSize(inner.errorMessage);
|
|
2729
|
+
return size;
|
|
2730
|
+
}
|
|
2731
|
+
case PsbtError_Tags.XPubKey: {
|
|
2732
|
+
return ordinalConverter.allocationSize(29);
|
|
2733
|
+
}
|
|
2734
|
+
case PsbtError_Tags.Version: {
|
|
2735
|
+
const inner = value.inner;
|
|
2736
|
+
let size = ordinalConverter.allocationSize(30);
|
|
2737
|
+
size += FfiConverterString.allocationSize(inner.errorMessage);
|
|
2738
|
+
return size;
|
|
2739
|
+
}
|
|
2740
|
+
case PsbtError_Tags.PartialDataConsumption: {
|
|
2741
|
+
return ordinalConverter.allocationSize(31);
|
|
2742
|
+
}
|
|
2743
|
+
case PsbtError_Tags.Io: {
|
|
2744
|
+
const inner = value.inner;
|
|
2745
|
+
let size = ordinalConverter.allocationSize(32);
|
|
2746
|
+
size += FfiConverterString.allocationSize(inner.errorMessage);
|
|
2747
|
+
return size;
|
|
2748
|
+
}
|
|
2749
|
+
case PsbtError_Tags.OtherPsbtErr: {
|
|
2750
|
+
return ordinalConverter.allocationSize(33);
|
|
2751
|
+
}
|
|
2752
|
+
default:
|
|
2753
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
2754
|
+
}
|
|
2755
|
+
}
|
|
2756
|
+
}
|
|
2757
|
+
return new FFIConverter();
|
|
2758
|
+
})();
|
|
2759
|
+
// Error type: PsbtParseError
|
|
2760
|
+
// Enum: PsbtParseError
|
|
2761
|
+
export var PsbtParseError_Tags;
|
|
2762
|
+
(function (PsbtParseError_Tags) {
|
|
2763
|
+
PsbtParseError_Tags["PsbtEncoding"] = "PsbtEncoding";
|
|
2764
|
+
PsbtParseError_Tags["Base64Encoding"] = "Base64Encoding";
|
|
2765
|
+
})(PsbtParseError_Tags || (PsbtParseError_Tags = {}));
|
|
2766
|
+
export const PsbtParseError = (() => {
|
|
2767
|
+
class PsbtEncoding_ extends UniffiError {
|
|
2768
|
+
/**
|
|
2769
|
+
* @private
|
|
2770
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2771
|
+
*/
|
|
2772
|
+
[uniffiTypeNameSymbol] = "PsbtParseError";
|
|
2773
|
+
tag = PsbtParseError_Tags.PsbtEncoding;
|
|
2774
|
+
inner;
|
|
2775
|
+
constructor(inner) {
|
|
2776
|
+
super("PsbtParseError", "PsbtEncoding");
|
|
2777
|
+
this.inner = Object.freeze(inner);
|
|
2778
|
+
}
|
|
2779
|
+
static new(inner) {
|
|
2780
|
+
return new PsbtEncoding_(inner);
|
|
2781
|
+
}
|
|
2782
|
+
static instanceOf(obj) {
|
|
2783
|
+
return obj.tag === PsbtParseError_Tags.PsbtEncoding;
|
|
2784
|
+
}
|
|
2785
|
+
static hasInner(obj) {
|
|
2786
|
+
return PsbtEncoding_.instanceOf(obj);
|
|
2787
|
+
}
|
|
2788
|
+
static getInner(obj) {
|
|
2789
|
+
return obj.inner;
|
|
2790
|
+
}
|
|
2791
|
+
}
|
|
2792
|
+
class Base64Encoding_ extends UniffiError {
|
|
2793
|
+
/**
|
|
2794
|
+
* @private
|
|
2795
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2796
|
+
*/
|
|
2797
|
+
[uniffiTypeNameSymbol] = "PsbtParseError";
|
|
2798
|
+
tag = PsbtParseError_Tags.Base64Encoding;
|
|
2799
|
+
inner;
|
|
2800
|
+
constructor(inner) {
|
|
2801
|
+
super("PsbtParseError", "Base64Encoding");
|
|
2802
|
+
this.inner = Object.freeze(inner);
|
|
2803
|
+
}
|
|
2804
|
+
static new(inner) {
|
|
2805
|
+
return new Base64Encoding_(inner);
|
|
2806
|
+
}
|
|
2807
|
+
static instanceOf(obj) {
|
|
2808
|
+
return obj.tag === PsbtParseError_Tags.Base64Encoding;
|
|
2809
|
+
}
|
|
2810
|
+
static hasInner(obj) {
|
|
2811
|
+
return Base64Encoding_.instanceOf(obj);
|
|
2812
|
+
}
|
|
2813
|
+
static getInner(obj) {
|
|
2814
|
+
return obj.inner;
|
|
2815
|
+
}
|
|
2816
|
+
}
|
|
2817
|
+
function instanceOf(obj) {
|
|
2818
|
+
return obj[uniffiTypeNameSymbol] === "PsbtParseError";
|
|
2819
|
+
}
|
|
2820
|
+
return Object.freeze({
|
|
2821
|
+
instanceOf,
|
|
2822
|
+
PsbtEncoding: PsbtEncoding_,
|
|
2823
|
+
Base64Encoding: Base64Encoding_,
|
|
2824
|
+
});
|
|
2825
|
+
})();
|
|
2826
|
+
// FfiConverter for enum PsbtParseError
|
|
2827
|
+
const FfiConverterTypePsbtParseError = (() => {
|
|
2828
|
+
const ordinalConverter = FfiConverterInt32;
|
|
2829
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
2830
|
+
read(from) {
|
|
2831
|
+
switch (ordinalConverter.read(from)) {
|
|
2832
|
+
case 1:
|
|
2833
|
+
return new PsbtParseError.PsbtEncoding({
|
|
2834
|
+
errorMessage: FfiConverterString.read(from),
|
|
2835
|
+
});
|
|
2836
|
+
case 2:
|
|
2837
|
+
return new PsbtParseError.Base64Encoding({
|
|
2838
|
+
errorMessage: FfiConverterString.read(from),
|
|
2839
|
+
});
|
|
2840
|
+
default:
|
|
2841
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
2842
|
+
}
|
|
2843
|
+
}
|
|
2844
|
+
write(value, into) {
|
|
2845
|
+
switch (value.tag) {
|
|
2846
|
+
case PsbtParseError_Tags.PsbtEncoding: {
|
|
2847
|
+
ordinalConverter.write(1, into);
|
|
2848
|
+
const inner = value.inner;
|
|
2849
|
+
FfiConverterString.write(inner.errorMessage, into);
|
|
2850
|
+
return;
|
|
2851
|
+
}
|
|
2852
|
+
case PsbtParseError_Tags.Base64Encoding: {
|
|
2853
|
+
ordinalConverter.write(2, into);
|
|
2854
|
+
const inner = value.inner;
|
|
2855
|
+
FfiConverterString.write(inner.errorMessage, into);
|
|
2856
|
+
return;
|
|
2857
|
+
}
|
|
2858
|
+
default:
|
|
2859
|
+
// Throwing from here means that PsbtParseError_Tags hasn't matched an ordinal.
|
|
2860
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
2861
|
+
}
|
|
2862
|
+
}
|
|
2863
|
+
allocationSize(value) {
|
|
2864
|
+
switch (value.tag) {
|
|
2865
|
+
case PsbtParseError_Tags.PsbtEncoding: {
|
|
2866
|
+
const inner = value.inner;
|
|
2867
|
+
let size = ordinalConverter.allocationSize(1);
|
|
2868
|
+
size += FfiConverterString.allocationSize(inner.errorMessage);
|
|
2869
|
+
return size;
|
|
2870
|
+
}
|
|
2871
|
+
case PsbtParseError_Tags.Base64Encoding: {
|
|
2872
|
+
const inner = value.inner;
|
|
2873
|
+
let size = ordinalConverter.allocationSize(2);
|
|
2874
|
+
size += FfiConverterString.allocationSize(inner.errorMessage);
|
|
2875
|
+
return size;
|
|
2876
|
+
}
|
|
2877
|
+
default:
|
|
2878
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
2879
|
+
}
|
|
2880
|
+
}
|
|
2881
|
+
}
|
|
2882
|
+
return new FFIConverter();
|
|
2883
|
+
})();
|
|
2884
|
+
export class Address extends UniffiAbstractObject {
|
|
2885
|
+
[uniffiTypeNameSymbol] = "Address";
|
|
2886
|
+
[destructorGuardSymbol];
|
|
2887
|
+
[pointerLiteralSymbol];
|
|
2888
|
+
constructor(address, network) {
|
|
2889
|
+
super();
|
|
2890
|
+
const pointer = uniffiCaller.rustCallWithError(
|
|
2891
|
+
/*liftError:*/ FfiConverterTypeAddressParseError.lift.bind(FfiConverterTypeAddressParseError),
|
|
2892
|
+
/*caller:*/ (callStatus) => {
|
|
2893
|
+
return nativeModule().ubrn_uniffi_bitcoin_ffi_fn_constructor_address_new(FfiConverterString.lower(address), FfiConverterTypeNetwork.lower(network), callStatus);
|
|
2894
|
+
},
|
|
2895
|
+
/*liftString:*/ FfiConverterString.lift);
|
|
2896
|
+
this[pointerLiteralSymbol] = pointer;
|
|
2897
|
+
this[destructorGuardSymbol] =
|
|
2898
|
+
uniffiTypeAddressObjectFactory.bless(pointer);
|
|
2899
|
+
}
|
|
2900
|
+
static fromScript(script, network) {
|
|
2901
|
+
return FfiConverterTypeAddress.lift(uniffiCaller.rustCallWithError(
|
|
2902
|
+
/*liftError:*/ FfiConverterTypeFromScriptError.lift.bind(FfiConverterTypeFromScriptError),
|
|
2903
|
+
/*caller:*/ (callStatus) => {
|
|
2904
|
+
return nativeModule().ubrn_uniffi_bitcoin_ffi_fn_constructor_address_from_script(FfiConverterTypeScript.lower(script), FfiConverterTypeNetwork.lower(network), callStatus);
|
|
2905
|
+
},
|
|
2906
|
+
/*liftString:*/ FfiConverterString.lift));
|
|
2907
|
+
}
|
|
2908
|
+
isValidForNetwork(network) {
|
|
2909
|
+
return FfiConverterBool.lift(uniffiCaller.rustCall(
|
|
2910
|
+
/*caller:*/ (callStatus) => {
|
|
2911
|
+
return nativeModule().ubrn_uniffi_bitcoin_ffi_fn_method_address_is_valid_for_network(uniffiTypeAddressObjectFactory.clonePointer(this), FfiConverterTypeNetwork.lower(network), callStatus);
|
|
2912
|
+
},
|
|
2913
|
+
/*liftString:*/ FfiConverterString.lift));
|
|
2914
|
+
}
|
|
2915
|
+
scriptPubkey() {
|
|
2916
|
+
return FfiConverterTypeScript.lift(uniffiCaller.rustCall(
|
|
2917
|
+
/*caller:*/ (callStatus) => {
|
|
2918
|
+
return nativeModule().ubrn_uniffi_bitcoin_ffi_fn_method_address_script_pubkey(uniffiTypeAddressObjectFactory.clonePointer(this), callStatus);
|
|
2919
|
+
},
|
|
2920
|
+
/*liftString:*/ FfiConverterString.lift));
|
|
2921
|
+
}
|
|
2922
|
+
toQrUri() {
|
|
2923
|
+
return FfiConverterString.lift(uniffiCaller.rustCall(
|
|
2924
|
+
/*caller:*/ (callStatus) => {
|
|
2925
|
+
return nativeModule().ubrn_uniffi_bitcoin_ffi_fn_method_address_to_qr_uri(uniffiTypeAddressObjectFactory.clonePointer(this), callStatus);
|
|
2926
|
+
},
|
|
2927
|
+
/*liftString:*/ FfiConverterString.lift));
|
|
2928
|
+
}
|
|
2929
|
+
/**
|
|
2930
|
+
* Calls into the `AddressInterface::to_string()` method of the native Rust peer.
|
|
2931
|
+
*
|
|
2932
|
+
* Generated by deriving the `Display` trait in Rust.
|
|
2933
|
+
*/
|
|
2934
|
+
toString() {
|
|
2935
|
+
return FfiConverterString.lift(uniffiCaller.rustCall(
|
|
2936
|
+
/*caller:*/ (callStatus) => {
|
|
2937
|
+
return nativeModule().ubrn_uniffi_bitcoin_ffi_fn_method_address_uniffi_trait_display(uniffiTypeAddressObjectFactory.clonePointer(this), callStatus);
|
|
2938
|
+
},
|
|
2939
|
+
/*liftString:*/ FfiConverterString.lift));
|
|
2940
|
+
}
|
|
2941
|
+
/**
|
|
2942
|
+
* {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
|
|
2943
|
+
*/
|
|
2944
|
+
uniffiDestroy() {
|
|
2945
|
+
const ptr = this[destructorGuardSymbol];
|
|
2946
|
+
if (ptr !== undefined) {
|
|
2947
|
+
const pointer = uniffiTypeAddressObjectFactory.pointer(this);
|
|
2948
|
+
uniffiTypeAddressObjectFactory.freePointer(pointer);
|
|
2949
|
+
uniffiTypeAddressObjectFactory.unbless(ptr);
|
|
2950
|
+
delete this[destructorGuardSymbol];
|
|
2951
|
+
}
|
|
2952
|
+
}
|
|
2953
|
+
static instanceOf(obj) {
|
|
2954
|
+
return uniffiTypeAddressObjectFactory.isConcreteType(obj);
|
|
2955
|
+
}
|
|
2956
|
+
}
|
|
2957
|
+
const uniffiTypeAddressObjectFactory = (() => {
|
|
2958
|
+
/// <reference lib="es2021" />
|
|
2959
|
+
const registry = typeof FinalizationRegistry !== "undefined"
|
|
2960
|
+
? new FinalizationRegistry((heldValue) => {
|
|
2961
|
+
uniffiTypeAddressObjectFactory.freePointer(heldValue);
|
|
2962
|
+
})
|
|
2963
|
+
: null;
|
|
2964
|
+
return {
|
|
2965
|
+
create(pointer) {
|
|
2966
|
+
const instance = Object.create(Address.prototype);
|
|
2967
|
+
instance[pointerLiteralSymbol] = pointer;
|
|
2968
|
+
instance[destructorGuardSymbol] = this.bless(pointer);
|
|
2969
|
+
instance[uniffiTypeNameSymbol] = "Address";
|
|
2970
|
+
return instance;
|
|
2971
|
+
},
|
|
2972
|
+
bless(p) {
|
|
2973
|
+
const ptr = {
|
|
2974
|
+
p, // make sure this object doesn't get optimized away.
|
|
2975
|
+
markDestroyed: () => undefined,
|
|
2976
|
+
};
|
|
2977
|
+
if (registry) {
|
|
2978
|
+
registry.register(ptr, p, ptr);
|
|
2979
|
+
}
|
|
2980
|
+
return ptr;
|
|
2981
|
+
},
|
|
2982
|
+
unbless(ptr) {
|
|
2983
|
+
if (registry) {
|
|
2984
|
+
registry.unregister(ptr);
|
|
2985
|
+
}
|
|
2986
|
+
},
|
|
2987
|
+
pointer(obj) {
|
|
2988
|
+
if (obj[destructorGuardSymbol] === undefined) {
|
|
2989
|
+
throw new UniffiInternalError.UnexpectedNullPointer();
|
|
2990
|
+
}
|
|
2991
|
+
return obj[pointerLiteralSymbol];
|
|
2992
|
+
},
|
|
2993
|
+
clonePointer(obj) {
|
|
2994
|
+
const pointer = this.pointer(obj);
|
|
2995
|
+
return uniffiCaller.rustCall(
|
|
2996
|
+
/*caller:*/ (callStatus) => nativeModule().ubrn_uniffi_bitcoin_ffi_fn_clone_address(pointer, callStatus),
|
|
2997
|
+
/*liftString:*/ FfiConverterString.lift);
|
|
2998
|
+
},
|
|
2999
|
+
freePointer(pointer) {
|
|
3000
|
+
uniffiCaller.rustCall(
|
|
3001
|
+
/*caller:*/ (callStatus) => nativeModule().ubrn_uniffi_bitcoin_ffi_fn_free_address(pointer, callStatus),
|
|
3002
|
+
/*liftString:*/ FfiConverterString.lift);
|
|
3003
|
+
},
|
|
3004
|
+
isConcreteType(obj) {
|
|
3005
|
+
return (obj[destructorGuardSymbol] &&
|
|
3006
|
+
obj[uniffiTypeNameSymbol] === "Address");
|
|
3007
|
+
},
|
|
3008
|
+
};
|
|
3009
|
+
})();
|
|
3010
|
+
// FfiConverter for AddressInterface
|
|
3011
|
+
const FfiConverterTypeAddress = new FfiConverterObject(uniffiTypeAddressObjectFactory);
|
|
3012
|
+
export class Amount extends UniffiAbstractObject {
|
|
3013
|
+
[uniffiTypeNameSymbol] = "Amount";
|
|
3014
|
+
[destructorGuardSymbol];
|
|
3015
|
+
[pointerLiteralSymbol];
|
|
3016
|
+
// No primary constructor declared for this class.
|
|
3017
|
+
constructor(pointer) {
|
|
3018
|
+
super();
|
|
3019
|
+
this[pointerLiteralSymbol] = pointer;
|
|
3020
|
+
this[destructorGuardSymbol] =
|
|
3021
|
+
uniffiTypeAmountObjectFactory.bless(pointer);
|
|
3022
|
+
}
|
|
3023
|
+
static fromBtc(btc) {
|
|
3024
|
+
return FfiConverterTypeAmount.lift(uniffiCaller.rustCallWithError(
|
|
3025
|
+
/*liftError:*/ FfiConverterTypeParseAmountError.lift.bind(FfiConverterTypeParseAmountError),
|
|
3026
|
+
/*caller:*/ (callStatus) => {
|
|
3027
|
+
return nativeModule().ubrn_uniffi_bitcoin_ffi_fn_constructor_amount_from_btc(FfiConverterFloat64.lower(btc), callStatus);
|
|
3028
|
+
},
|
|
3029
|
+
/*liftString:*/ FfiConverterString.lift));
|
|
3030
|
+
}
|
|
3031
|
+
static fromSat(sat) {
|
|
3032
|
+
return FfiConverterTypeAmount.lift(uniffiCaller.rustCall(
|
|
3033
|
+
/*caller:*/ (callStatus) => {
|
|
3034
|
+
return nativeModule().ubrn_uniffi_bitcoin_ffi_fn_constructor_amount_from_sat(FfiConverterUInt64.lower(sat), callStatus);
|
|
3035
|
+
},
|
|
3036
|
+
/*liftString:*/ FfiConverterString.lift));
|
|
3037
|
+
}
|
|
3038
|
+
toBtc() {
|
|
3039
|
+
return FfiConverterFloat64.lift(uniffiCaller.rustCall(
|
|
3040
|
+
/*caller:*/ (callStatus) => {
|
|
3041
|
+
return nativeModule().ubrn_uniffi_bitcoin_ffi_fn_method_amount_to_btc(uniffiTypeAmountObjectFactory.clonePointer(this), callStatus);
|
|
3042
|
+
},
|
|
3043
|
+
/*liftString:*/ FfiConverterString.lift));
|
|
3044
|
+
}
|
|
3045
|
+
toSat() {
|
|
3046
|
+
return FfiConverterUInt64.lift(uniffiCaller.rustCall(
|
|
3047
|
+
/*caller:*/ (callStatus) => {
|
|
3048
|
+
return nativeModule().ubrn_uniffi_bitcoin_ffi_fn_method_amount_to_sat(uniffiTypeAmountObjectFactory.clonePointer(this), callStatus);
|
|
3049
|
+
},
|
|
3050
|
+
/*liftString:*/ FfiConverterString.lift));
|
|
3051
|
+
}
|
|
3052
|
+
/**
|
|
3053
|
+
* {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
|
|
3054
|
+
*/
|
|
3055
|
+
uniffiDestroy() {
|
|
3056
|
+
const ptr = this[destructorGuardSymbol];
|
|
3057
|
+
if (ptr !== undefined) {
|
|
3058
|
+
const pointer = uniffiTypeAmountObjectFactory.pointer(this);
|
|
3059
|
+
uniffiTypeAmountObjectFactory.freePointer(pointer);
|
|
3060
|
+
uniffiTypeAmountObjectFactory.unbless(ptr);
|
|
3061
|
+
delete this[destructorGuardSymbol];
|
|
3062
|
+
}
|
|
3063
|
+
}
|
|
3064
|
+
static instanceOf(obj) {
|
|
3065
|
+
return uniffiTypeAmountObjectFactory.isConcreteType(obj);
|
|
3066
|
+
}
|
|
3067
|
+
}
|
|
3068
|
+
const uniffiTypeAmountObjectFactory = (() => {
|
|
3069
|
+
/// <reference lib="es2021" />
|
|
3070
|
+
const registry = typeof FinalizationRegistry !== "undefined"
|
|
3071
|
+
? new FinalizationRegistry((heldValue) => {
|
|
3072
|
+
uniffiTypeAmountObjectFactory.freePointer(heldValue);
|
|
3073
|
+
})
|
|
3074
|
+
: null;
|
|
3075
|
+
return {
|
|
3076
|
+
create(pointer) {
|
|
3077
|
+
const instance = Object.create(Amount.prototype);
|
|
3078
|
+
instance[pointerLiteralSymbol] = pointer;
|
|
3079
|
+
instance[destructorGuardSymbol] = this.bless(pointer);
|
|
3080
|
+
instance[uniffiTypeNameSymbol] = "Amount";
|
|
3081
|
+
return instance;
|
|
3082
|
+
},
|
|
3083
|
+
bless(p) {
|
|
3084
|
+
const ptr = {
|
|
3085
|
+
p, // make sure this object doesn't get optimized away.
|
|
3086
|
+
markDestroyed: () => undefined,
|
|
3087
|
+
};
|
|
3088
|
+
if (registry) {
|
|
3089
|
+
registry.register(ptr, p, ptr);
|
|
3090
|
+
}
|
|
3091
|
+
return ptr;
|
|
3092
|
+
},
|
|
3093
|
+
unbless(ptr) {
|
|
3094
|
+
if (registry) {
|
|
3095
|
+
registry.unregister(ptr);
|
|
3096
|
+
}
|
|
3097
|
+
},
|
|
3098
|
+
pointer(obj) {
|
|
3099
|
+
if (obj[destructorGuardSymbol] === undefined) {
|
|
3100
|
+
throw new UniffiInternalError.UnexpectedNullPointer();
|
|
3101
|
+
}
|
|
3102
|
+
return obj[pointerLiteralSymbol];
|
|
3103
|
+
},
|
|
3104
|
+
clonePointer(obj) {
|
|
3105
|
+
const pointer = this.pointer(obj);
|
|
3106
|
+
return uniffiCaller.rustCall(
|
|
3107
|
+
/*caller:*/ (callStatus) => nativeModule().ubrn_uniffi_bitcoin_ffi_fn_clone_amount(pointer, callStatus),
|
|
3108
|
+
/*liftString:*/ FfiConverterString.lift);
|
|
3109
|
+
},
|
|
3110
|
+
freePointer(pointer) {
|
|
3111
|
+
uniffiCaller.rustCall(
|
|
3112
|
+
/*caller:*/ (callStatus) => nativeModule().ubrn_uniffi_bitcoin_ffi_fn_free_amount(pointer, callStatus),
|
|
3113
|
+
/*liftString:*/ FfiConverterString.lift);
|
|
3114
|
+
},
|
|
3115
|
+
isConcreteType(obj) {
|
|
3116
|
+
return (obj[destructorGuardSymbol] &&
|
|
3117
|
+
obj[uniffiTypeNameSymbol] === "Amount");
|
|
3118
|
+
},
|
|
3119
|
+
};
|
|
3120
|
+
})();
|
|
3121
|
+
// FfiConverter for AmountInterface
|
|
3122
|
+
const FfiConverterTypeAmount = new FfiConverterObject(uniffiTypeAmountObjectFactory);
|
|
3123
|
+
export class FeeRate extends UniffiAbstractObject {
|
|
3124
|
+
[uniffiTypeNameSymbol] = "FeeRate";
|
|
3125
|
+
[destructorGuardSymbol];
|
|
3126
|
+
[pointerLiteralSymbol];
|
|
3127
|
+
// No primary constructor declared for this class.
|
|
3128
|
+
constructor(pointer) {
|
|
3129
|
+
super();
|
|
3130
|
+
this[pointerLiteralSymbol] = pointer;
|
|
3131
|
+
this[destructorGuardSymbol] =
|
|
3132
|
+
uniffiTypeFeeRateObjectFactory.bless(pointer);
|
|
3133
|
+
}
|
|
3134
|
+
static fromSatPerKwu(satPerKwu) {
|
|
3135
|
+
return FfiConverterTypeFeeRate.lift(uniffiCaller.rustCall(
|
|
3136
|
+
/*caller:*/ (callStatus) => {
|
|
3137
|
+
return nativeModule().ubrn_uniffi_bitcoin_ffi_fn_constructor_feerate_from_sat_per_kwu(FfiConverterUInt64.lower(satPerKwu), callStatus);
|
|
3138
|
+
},
|
|
3139
|
+
/*liftString:*/ FfiConverterString.lift));
|
|
3140
|
+
}
|
|
3141
|
+
static fromSatPerVb(satPerVb) {
|
|
3142
|
+
return FfiConverterTypeFeeRate.lift(uniffiCaller.rustCallWithError(
|
|
3143
|
+
/*liftError:*/ FfiConverterTypeFeeRateError.lift.bind(FfiConverterTypeFeeRateError),
|
|
3144
|
+
/*caller:*/ (callStatus) => {
|
|
3145
|
+
return nativeModule().ubrn_uniffi_bitcoin_ffi_fn_constructor_feerate_from_sat_per_vb(FfiConverterUInt64.lower(satPerVb), callStatus);
|
|
3146
|
+
},
|
|
3147
|
+
/*liftString:*/ FfiConverterString.lift));
|
|
3148
|
+
}
|
|
3149
|
+
toSatPerKwu() {
|
|
3150
|
+
return FfiConverterUInt64.lift(uniffiCaller.rustCall(
|
|
3151
|
+
/*caller:*/ (callStatus) => {
|
|
3152
|
+
return nativeModule().ubrn_uniffi_bitcoin_ffi_fn_method_feerate_to_sat_per_kwu(uniffiTypeFeeRateObjectFactory.clonePointer(this), callStatus);
|
|
3153
|
+
},
|
|
3154
|
+
/*liftString:*/ FfiConverterString.lift));
|
|
3155
|
+
}
|
|
3156
|
+
toSatPerVbCeil() {
|
|
3157
|
+
return FfiConverterUInt64.lift(uniffiCaller.rustCall(
|
|
3158
|
+
/*caller:*/ (callStatus) => {
|
|
3159
|
+
return nativeModule().ubrn_uniffi_bitcoin_ffi_fn_method_feerate_to_sat_per_vb_ceil(uniffiTypeFeeRateObjectFactory.clonePointer(this), callStatus);
|
|
3160
|
+
},
|
|
3161
|
+
/*liftString:*/ FfiConverterString.lift));
|
|
3162
|
+
}
|
|
3163
|
+
toSatPerVbFloor() {
|
|
3164
|
+
return FfiConverterUInt64.lift(uniffiCaller.rustCall(
|
|
3165
|
+
/*caller:*/ (callStatus) => {
|
|
3166
|
+
return nativeModule().ubrn_uniffi_bitcoin_ffi_fn_method_feerate_to_sat_per_vb_floor(uniffiTypeFeeRateObjectFactory.clonePointer(this), callStatus);
|
|
3167
|
+
},
|
|
3168
|
+
/*liftString:*/ FfiConverterString.lift));
|
|
3169
|
+
}
|
|
3170
|
+
/**
|
|
3171
|
+
* {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
|
|
3172
|
+
*/
|
|
3173
|
+
uniffiDestroy() {
|
|
3174
|
+
const ptr = this[destructorGuardSymbol];
|
|
3175
|
+
if (ptr !== undefined) {
|
|
3176
|
+
const pointer = uniffiTypeFeeRateObjectFactory.pointer(this);
|
|
3177
|
+
uniffiTypeFeeRateObjectFactory.freePointer(pointer);
|
|
3178
|
+
uniffiTypeFeeRateObjectFactory.unbless(ptr);
|
|
3179
|
+
delete this[destructorGuardSymbol];
|
|
3180
|
+
}
|
|
3181
|
+
}
|
|
3182
|
+
static instanceOf(obj) {
|
|
3183
|
+
return uniffiTypeFeeRateObjectFactory.isConcreteType(obj);
|
|
3184
|
+
}
|
|
3185
|
+
}
|
|
3186
|
+
const uniffiTypeFeeRateObjectFactory = (() => {
|
|
3187
|
+
/// <reference lib="es2021" />
|
|
3188
|
+
const registry = typeof FinalizationRegistry !== "undefined"
|
|
3189
|
+
? new FinalizationRegistry((heldValue) => {
|
|
3190
|
+
uniffiTypeFeeRateObjectFactory.freePointer(heldValue);
|
|
3191
|
+
})
|
|
3192
|
+
: null;
|
|
3193
|
+
return {
|
|
3194
|
+
create(pointer) {
|
|
3195
|
+
const instance = Object.create(FeeRate.prototype);
|
|
3196
|
+
instance[pointerLiteralSymbol] = pointer;
|
|
3197
|
+
instance[destructorGuardSymbol] = this.bless(pointer);
|
|
3198
|
+
instance[uniffiTypeNameSymbol] = "FeeRate";
|
|
3199
|
+
return instance;
|
|
3200
|
+
},
|
|
3201
|
+
bless(p) {
|
|
3202
|
+
const ptr = {
|
|
3203
|
+
p, // make sure this object doesn't get optimized away.
|
|
3204
|
+
markDestroyed: () => undefined,
|
|
3205
|
+
};
|
|
3206
|
+
if (registry) {
|
|
3207
|
+
registry.register(ptr, p, ptr);
|
|
3208
|
+
}
|
|
3209
|
+
return ptr;
|
|
3210
|
+
},
|
|
3211
|
+
unbless(ptr) {
|
|
3212
|
+
if (registry) {
|
|
3213
|
+
registry.unregister(ptr);
|
|
3214
|
+
}
|
|
3215
|
+
},
|
|
3216
|
+
pointer(obj) {
|
|
3217
|
+
if (obj[destructorGuardSymbol] === undefined) {
|
|
3218
|
+
throw new UniffiInternalError.UnexpectedNullPointer();
|
|
3219
|
+
}
|
|
3220
|
+
return obj[pointerLiteralSymbol];
|
|
3221
|
+
},
|
|
3222
|
+
clonePointer(obj) {
|
|
3223
|
+
const pointer = this.pointer(obj);
|
|
3224
|
+
return uniffiCaller.rustCall(
|
|
3225
|
+
/*caller:*/ (callStatus) => nativeModule().ubrn_uniffi_bitcoin_ffi_fn_clone_feerate(pointer, callStatus),
|
|
3226
|
+
/*liftString:*/ FfiConverterString.lift);
|
|
3227
|
+
},
|
|
3228
|
+
freePointer(pointer) {
|
|
3229
|
+
uniffiCaller.rustCall(
|
|
3230
|
+
/*caller:*/ (callStatus) => nativeModule().ubrn_uniffi_bitcoin_ffi_fn_free_feerate(pointer, callStatus),
|
|
3231
|
+
/*liftString:*/ FfiConverterString.lift);
|
|
3232
|
+
},
|
|
3233
|
+
isConcreteType(obj) {
|
|
3234
|
+
return (obj[destructorGuardSymbol] &&
|
|
3235
|
+
obj[uniffiTypeNameSymbol] === "FeeRate");
|
|
3236
|
+
},
|
|
3237
|
+
};
|
|
3238
|
+
})();
|
|
3239
|
+
// FfiConverter for FeeRateInterface
|
|
3240
|
+
const FfiConverterTypeFeeRate = new FfiConverterObject(uniffiTypeFeeRateObjectFactory);
|
|
3241
|
+
export class Psbt extends UniffiAbstractObject {
|
|
3242
|
+
[uniffiTypeNameSymbol] = "Psbt";
|
|
3243
|
+
[destructorGuardSymbol];
|
|
3244
|
+
[pointerLiteralSymbol];
|
|
3245
|
+
// No primary constructor declared for this class.
|
|
3246
|
+
constructor(pointer) {
|
|
3247
|
+
super();
|
|
3248
|
+
this[pointerLiteralSymbol] = pointer;
|
|
3249
|
+
this[destructorGuardSymbol] =
|
|
3250
|
+
uniffiTypePsbtObjectFactory.bless(pointer);
|
|
3251
|
+
}
|
|
3252
|
+
static deserialize(psbtBytes) {
|
|
3253
|
+
return FfiConverterTypePsbt.lift(uniffiCaller.rustCallWithError(
|
|
3254
|
+
/*liftError:*/ FfiConverterTypePsbtError.lift.bind(FfiConverterTypePsbtError),
|
|
3255
|
+
/*caller:*/ (callStatus) => {
|
|
3256
|
+
return nativeModule().ubrn_uniffi_bitcoin_ffi_fn_constructor_psbt_deserialize(FfiConverterArrayBuffer.lower(psbtBytes), callStatus);
|
|
3257
|
+
},
|
|
3258
|
+
/*liftString:*/ FfiConverterString.lift));
|
|
3259
|
+
}
|
|
3260
|
+
static deserializeBase64(psbtBase64) {
|
|
3261
|
+
return FfiConverterTypePsbt.lift(uniffiCaller.rustCallWithError(
|
|
3262
|
+
/*liftError:*/ FfiConverterTypePsbtParseError.lift.bind(FfiConverterTypePsbtParseError),
|
|
3263
|
+
/*caller:*/ (callStatus) => {
|
|
3264
|
+
return nativeModule().ubrn_uniffi_bitcoin_ffi_fn_constructor_psbt_deserialize_base64(FfiConverterString.lower(psbtBase64), callStatus);
|
|
3265
|
+
},
|
|
3266
|
+
/*liftString:*/ FfiConverterString.lift));
|
|
3267
|
+
}
|
|
3268
|
+
static fromUnsignedTx(tx) {
|
|
3269
|
+
return FfiConverterTypePsbt.lift(uniffiCaller.rustCallWithError(
|
|
3270
|
+
/*liftError:*/ FfiConverterTypePsbtError.lift.bind(FfiConverterTypePsbtError),
|
|
3271
|
+
/*caller:*/ (callStatus) => {
|
|
3272
|
+
return nativeModule().ubrn_uniffi_bitcoin_ffi_fn_constructor_psbt_from_unsigned_tx(FfiConverterTypeTransaction.lower(tx), callStatus);
|
|
3273
|
+
},
|
|
3274
|
+
/*liftString:*/ FfiConverterString.lift));
|
|
3275
|
+
}
|
|
3276
|
+
combine(other) {
|
|
3277
|
+
return FfiConverterTypePsbt.lift(uniffiCaller.rustCallWithError(
|
|
3278
|
+
/*liftError:*/ FfiConverterTypePsbtError.lift.bind(FfiConverterTypePsbtError),
|
|
3279
|
+
/*caller:*/ (callStatus) => {
|
|
3280
|
+
return nativeModule().ubrn_uniffi_bitcoin_ffi_fn_method_psbt_combine(uniffiTypePsbtObjectFactory.clonePointer(this), FfiConverterTypePsbt.lower(other), callStatus);
|
|
3281
|
+
},
|
|
3282
|
+
/*liftString:*/ FfiConverterString.lift));
|
|
3283
|
+
}
|
|
3284
|
+
extractTx() {
|
|
3285
|
+
return FfiConverterTypeTransaction.lift(uniffiCaller.rustCallWithError(
|
|
3286
|
+
/*liftError:*/ FfiConverterTypeExtractTxError.lift.bind(FfiConverterTypeExtractTxError),
|
|
3287
|
+
/*caller:*/ (callStatus) => {
|
|
3288
|
+
return nativeModule().ubrn_uniffi_bitcoin_ffi_fn_method_psbt_extract_tx(uniffiTypePsbtObjectFactory.clonePointer(this), callStatus);
|
|
3289
|
+
},
|
|
3290
|
+
/*liftString:*/ FfiConverterString.lift));
|
|
3291
|
+
}
|
|
3292
|
+
fee() {
|
|
3293
|
+
return FfiConverterTypeAmount.lift(uniffiCaller.rustCallWithError(
|
|
3294
|
+
/*liftError:*/ FfiConverterTypePsbtError.lift.bind(FfiConverterTypePsbtError),
|
|
3295
|
+
/*caller:*/ (callStatus) => {
|
|
3296
|
+
return nativeModule().ubrn_uniffi_bitcoin_ffi_fn_method_psbt_fee(uniffiTypePsbtObjectFactory.clonePointer(this), callStatus);
|
|
3297
|
+
},
|
|
3298
|
+
/*liftString:*/ FfiConverterString.lift));
|
|
3299
|
+
}
|
|
3300
|
+
serialize() {
|
|
3301
|
+
return FfiConverterArrayBuffer.lift(uniffiCaller.rustCall(
|
|
3302
|
+
/*caller:*/ (callStatus) => {
|
|
3303
|
+
return nativeModule().ubrn_uniffi_bitcoin_ffi_fn_method_psbt_serialize(uniffiTypePsbtObjectFactory.clonePointer(this), callStatus);
|
|
3304
|
+
},
|
|
3305
|
+
/*liftString:*/ FfiConverterString.lift));
|
|
3306
|
+
}
|
|
3307
|
+
serializeBase64() {
|
|
3308
|
+
return FfiConverterString.lift(uniffiCaller.rustCall(
|
|
3309
|
+
/*caller:*/ (callStatus) => {
|
|
3310
|
+
return nativeModule().ubrn_uniffi_bitcoin_ffi_fn_method_psbt_serialize_base64(uniffiTypePsbtObjectFactory.clonePointer(this), callStatus);
|
|
3311
|
+
},
|
|
3312
|
+
/*liftString:*/ FfiConverterString.lift));
|
|
3313
|
+
}
|
|
3314
|
+
serializeHex() {
|
|
3315
|
+
return FfiConverterString.lift(uniffiCaller.rustCall(
|
|
3316
|
+
/*caller:*/ (callStatus) => {
|
|
3317
|
+
return nativeModule().ubrn_uniffi_bitcoin_ffi_fn_method_psbt_serialize_hex(uniffiTypePsbtObjectFactory.clonePointer(this), callStatus);
|
|
3318
|
+
},
|
|
3319
|
+
/*liftString:*/ FfiConverterString.lift));
|
|
3320
|
+
}
|
|
3321
|
+
/**
|
|
3322
|
+
* {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
|
|
3323
|
+
*/
|
|
3324
|
+
uniffiDestroy() {
|
|
3325
|
+
const ptr = this[destructorGuardSymbol];
|
|
3326
|
+
if (ptr !== undefined) {
|
|
3327
|
+
const pointer = uniffiTypePsbtObjectFactory.pointer(this);
|
|
3328
|
+
uniffiTypePsbtObjectFactory.freePointer(pointer);
|
|
3329
|
+
uniffiTypePsbtObjectFactory.unbless(ptr);
|
|
3330
|
+
delete this[destructorGuardSymbol];
|
|
3331
|
+
}
|
|
3332
|
+
}
|
|
3333
|
+
static instanceOf(obj) {
|
|
3334
|
+
return uniffiTypePsbtObjectFactory.isConcreteType(obj);
|
|
3335
|
+
}
|
|
3336
|
+
}
|
|
3337
|
+
const uniffiTypePsbtObjectFactory = (() => {
|
|
3338
|
+
/// <reference lib="es2021" />
|
|
3339
|
+
const registry = typeof FinalizationRegistry !== "undefined"
|
|
3340
|
+
? new FinalizationRegistry((heldValue) => {
|
|
3341
|
+
uniffiTypePsbtObjectFactory.freePointer(heldValue);
|
|
3342
|
+
})
|
|
3343
|
+
: null;
|
|
3344
|
+
return {
|
|
3345
|
+
create(pointer) {
|
|
3346
|
+
const instance = Object.create(Psbt.prototype);
|
|
3347
|
+
instance[pointerLiteralSymbol] = pointer;
|
|
3348
|
+
instance[destructorGuardSymbol] = this.bless(pointer);
|
|
3349
|
+
instance[uniffiTypeNameSymbol] = "Psbt";
|
|
3350
|
+
return instance;
|
|
3351
|
+
},
|
|
3352
|
+
bless(p) {
|
|
3353
|
+
const ptr = {
|
|
3354
|
+
p, // make sure this object doesn't get optimized away.
|
|
3355
|
+
markDestroyed: () => undefined,
|
|
3356
|
+
};
|
|
3357
|
+
if (registry) {
|
|
3358
|
+
registry.register(ptr, p, ptr);
|
|
3359
|
+
}
|
|
3360
|
+
return ptr;
|
|
3361
|
+
},
|
|
3362
|
+
unbless(ptr) {
|
|
3363
|
+
if (registry) {
|
|
3364
|
+
registry.unregister(ptr);
|
|
3365
|
+
}
|
|
3366
|
+
},
|
|
3367
|
+
pointer(obj) {
|
|
3368
|
+
if (obj[destructorGuardSymbol] === undefined) {
|
|
3369
|
+
throw new UniffiInternalError.UnexpectedNullPointer();
|
|
3370
|
+
}
|
|
3371
|
+
return obj[pointerLiteralSymbol];
|
|
3372
|
+
},
|
|
3373
|
+
clonePointer(obj) {
|
|
3374
|
+
const pointer = this.pointer(obj);
|
|
3375
|
+
return uniffiCaller.rustCall(
|
|
3376
|
+
/*caller:*/ (callStatus) => nativeModule().ubrn_uniffi_bitcoin_ffi_fn_clone_psbt(pointer, callStatus),
|
|
3377
|
+
/*liftString:*/ FfiConverterString.lift);
|
|
3378
|
+
},
|
|
3379
|
+
freePointer(pointer) {
|
|
3380
|
+
uniffiCaller.rustCall(
|
|
3381
|
+
/*caller:*/ (callStatus) => nativeModule().ubrn_uniffi_bitcoin_ffi_fn_free_psbt(pointer, callStatus),
|
|
3382
|
+
/*liftString:*/ FfiConverterString.lift);
|
|
3383
|
+
},
|
|
3384
|
+
isConcreteType(obj) {
|
|
3385
|
+
return (obj[destructorGuardSymbol] &&
|
|
3386
|
+
obj[uniffiTypeNameSymbol] === "Psbt");
|
|
3387
|
+
},
|
|
3388
|
+
};
|
|
3389
|
+
})();
|
|
3390
|
+
// FfiConverter for PsbtInterface
|
|
3391
|
+
const FfiConverterTypePsbt = new FfiConverterObject(uniffiTypePsbtObjectFactory);
|
|
3392
|
+
export class Script extends UniffiAbstractObject {
|
|
3393
|
+
[uniffiTypeNameSymbol] = "Script";
|
|
3394
|
+
[destructorGuardSymbol];
|
|
3395
|
+
[pointerLiteralSymbol];
|
|
3396
|
+
constructor(rawOutputScript) {
|
|
3397
|
+
super();
|
|
3398
|
+
const pointer = uniffiCaller.rustCall(
|
|
3399
|
+
/*caller:*/ (callStatus) => {
|
|
3400
|
+
return nativeModule().ubrn_uniffi_bitcoin_ffi_fn_constructor_script_new(FfiConverterArrayBuffer.lower(rawOutputScript), callStatus);
|
|
3401
|
+
},
|
|
3402
|
+
/*liftString:*/ FfiConverterString.lift);
|
|
3403
|
+
this[pointerLiteralSymbol] = pointer;
|
|
3404
|
+
this[destructorGuardSymbol] =
|
|
3405
|
+
uniffiTypeScriptObjectFactory.bless(pointer);
|
|
3406
|
+
}
|
|
3407
|
+
toBytes() {
|
|
3408
|
+
return FfiConverterArrayBuffer.lift(uniffiCaller.rustCall(
|
|
3409
|
+
/*caller:*/ (callStatus) => {
|
|
3410
|
+
return nativeModule().ubrn_uniffi_bitcoin_ffi_fn_method_script_to_bytes(uniffiTypeScriptObjectFactory.clonePointer(this), callStatus);
|
|
3411
|
+
},
|
|
3412
|
+
/*liftString:*/ FfiConverterString.lift));
|
|
3413
|
+
}
|
|
3414
|
+
/**
|
|
3415
|
+
* {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
|
|
3416
|
+
*/
|
|
3417
|
+
uniffiDestroy() {
|
|
3418
|
+
const ptr = this[destructorGuardSymbol];
|
|
3419
|
+
if (ptr !== undefined) {
|
|
3420
|
+
const pointer = uniffiTypeScriptObjectFactory.pointer(this);
|
|
3421
|
+
uniffiTypeScriptObjectFactory.freePointer(pointer);
|
|
3422
|
+
uniffiTypeScriptObjectFactory.unbless(ptr);
|
|
3423
|
+
delete this[destructorGuardSymbol];
|
|
3424
|
+
}
|
|
3425
|
+
}
|
|
3426
|
+
static instanceOf(obj) {
|
|
3427
|
+
return uniffiTypeScriptObjectFactory.isConcreteType(obj);
|
|
3428
|
+
}
|
|
3429
|
+
}
|
|
3430
|
+
const uniffiTypeScriptObjectFactory = (() => {
|
|
3431
|
+
/// <reference lib="es2021" />
|
|
3432
|
+
const registry = typeof FinalizationRegistry !== "undefined"
|
|
3433
|
+
? new FinalizationRegistry((heldValue) => {
|
|
3434
|
+
uniffiTypeScriptObjectFactory.freePointer(heldValue);
|
|
3435
|
+
})
|
|
3436
|
+
: null;
|
|
3437
|
+
return {
|
|
3438
|
+
create(pointer) {
|
|
3439
|
+
const instance = Object.create(Script.prototype);
|
|
3440
|
+
instance[pointerLiteralSymbol] = pointer;
|
|
3441
|
+
instance[destructorGuardSymbol] = this.bless(pointer);
|
|
3442
|
+
instance[uniffiTypeNameSymbol] = "Script";
|
|
3443
|
+
return instance;
|
|
3444
|
+
},
|
|
3445
|
+
bless(p) {
|
|
3446
|
+
const ptr = {
|
|
3447
|
+
p, // make sure this object doesn't get optimized away.
|
|
3448
|
+
markDestroyed: () => undefined,
|
|
3449
|
+
};
|
|
3450
|
+
if (registry) {
|
|
3451
|
+
registry.register(ptr, p, ptr);
|
|
3452
|
+
}
|
|
3453
|
+
return ptr;
|
|
3454
|
+
},
|
|
3455
|
+
unbless(ptr) {
|
|
3456
|
+
if (registry) {
|
|
3457
|
+
registry.unregister(ptr);
|
|
3458
|
+
}
|
|
3459
|
+
},
|
|
3460
|
+
pointer(obj) {
|
|
3461
|
+
if (obj[destructorGuardSymbol] === undefined) {
|
|
3462
|
+
throw new UniffiInternalError.UnexpectedNullPointer();
|
|
3463
|
+
}
|
|
3464
|
+
return obj[pointerLiteralSymbol];
|
|
3465
|
+
},
|
|
3466
|
+
clonePointer(obj) {
|
|
3467
|
+
const pointer = this.pointer(obj);
|
|
3468
|
+
return uniffiCaller.rustCall(
|
|
3469
|
+
/*caller:*/ (callStatus) => nativeModule().ubrn_uniffi_bitcoin_ffi_fn_clone_script(pointer, callStatus),
|
|
3470
|
+
/*liftString:*/ FfiConverterString.lift);
|
|
3471
|
+
},
|
|
3472
|
+
freePointer(pointer) {
|
|
3473
|
+
uniffiCaller.rustCall(
|
|
3474
|
+
/*caller:*/ (callStatus) => nativeModule().ubrn_uniffi_bitcoin_ffi_fn_free_script(pointer, callStatus),
|
|
3475
|
+
/*liftString:*/ FfiConverterString.lift);
|
|
3476
|
+
},
|
|
3477
|
+
isConcreteType(obj) {
|
|
3478
|
+
return (obj[destructorGuardSymbol] &&
|
|
3479
|
+
obj[uniffiTypeNameSymbol] === "Script");
|
|
3480
|
+
},
|
|
3481
|
+
};
|
|
3482
|
+
})();
|
|
3483
|
+
// FfiConverter for ScriptInterface
|
|
3484
|
+
const FfiConverterTypeScript = new FfiConverterObject(uniffiTypeScriptObjectFactory);
|
|
3485
|
+
export class Transaction extends UniffiAbstractObject {
|
|
3486
|
+
[uniffiTypeNameSymbol] = "Transaction";
|
|
3487
|
+
[destructorGuardSymbol];
|
|
3488
|
+
[pointerLiteralSymbol];
|
|
3489
|
+
// No primary constructor declared for this class.
|
|
3490
|
+
constructor(pointer) {
|
|
3491
|
+
super();
|
|
3492
|
+
this[pointerLiteralSymbol] = pointer;
|
|
3493
|
+
this[destructorGuardSymbol] =
|
|
3494
|
+
uniffiTypeTransactionObjectFactory.bless(pointer);
|
|
3495
|
+
}
|
|
3496
|
+
static deserialize(transactionBytes) {
|
|
3497
|
+
return FfiConverterTypeTransaction.lift(uniffiCaller.rustCallWithError(
|
|
3498
|
+
/*liftError:*/ FfiConverterTypeEncodeError.lift.bind(FfiConverterTypeEncodeError),
|
|
3499
|
+
/*caller:*/ (callStatus) => {
|
|
3500
|
+
return nativeModule().ubrn_uniffi_bitcoin_ffi_fn_constructor_transaction_deserialize(FfiConverterArrayBuffer.lower(transactionBytes), callStatus);
|
|
3501
|
+
},
|
|
3502
|
+
/*liftString:*/ FfiConverterString.lift));
|
|
3503
|
+
}
|
|
3504
|
+
computeTxid() {
|
|
3505
|
+
return FfiConverterString.lift(uniffiCaller.rustCall(
|
|
3506
|
+
/*caller:*/ (callStatus) => {
|
|
3507
|
+
return nativeModule().ubrn_uniffi_bitcoin_ffi_fn_method_transaction_compute_txid(uniffiTypeTransactionObjectFactory.clonePointer(this), callStatus);
|
|
3508
|
+
},
|
|
3509
|
+
/*liftString:*/ FfiConverterString.lift));
|
|
3510
|
+
}
|
|
3511
|
+
input() {
|
|
3512
|
+
return FfiConverterArrayTypeTxIn.lift(uniffiCaller.rustCall(
|
|
3513
|
+
/*caller:*/ (callStatus) => {
|
|
3514
|
+
return nativeModule().ubrn_uniffi_bitcoin_ffi_fn_method_transaction_input(uniffiTypeTransactionObjectFactory.clonePointer(this), callStatus);
|
|
3515
|
+
},
|
|
3516
|
+
/*liftString:*/ FfiConverterString.lift));
|
|
3517
|
+
}
|
|
3518
|
+
isCoinbase() {
|
|
3519
|
+
return FfiConverterBool.lift(uniffiCaller.rustCall(
|
|
3520
|
+
/*caller:*/ (callStatus) => {
|
|
3521
|
+
return nativeModule().ubrn_uniffi_bitcoin_ffi_fn_method_transaction_is_coinbase(uniffiTypeTransactionObjectFactory.clonePointer(this), callStatus);
|
|
3522
|
+
},
|
|
3523
|
+
/*liftString:*/ FfiConverterString.lift));
|
|
3524
|
+
}
|
|
3525
|
+
isExplicitlyRbf() {
|
|
3526
|
+
return FfiConverterBool.lift(uniffiCaller.rustCall(
|
|
3527
|
+
/*caller:*/ (callStatus) => {
|
|
3528
|
+
return nativeModule().ubrn_uniffi_bitcoin_ffi_fn_method_transaction_is_explicitly_rbf(uniffiTypeTransactionObjectFactory.clonePointer(this), callStatus);
|
|
3529
|
+
},
|
|
3530
|
+
/*liftString:*/ FfiConverterString.lift));
|
|
3531
|
+
}
|
|
3532
|
+
isLockTimeEnabled() {
|
|
3533
|
+
return FfiConverterBool.lift(uniffiCaller.rustCall(
|
|
3534
|
+
/*caller:*/ (callStatus) => {
|
|
3535
|
+
return nativeModule().ubrn_uniffi_bitcoin_ffi_fn_method_transaction_is_lock_time_enabled(uniffiTypeTransactionObjectFactory.clonePointer(this), callStatus);
|
|
3536
|
+
},
|
|
3537
|
+
/*liftString:*/ FfiConverterString.lift));
|
|
3538
|
+
}
|
|
3539
|
+
lockTime() {
|
|
3540
|
+
return FfiConverterUInt32.lift(uniffiCaller.rustCall(
|
|
3541
|
+
/*caller:*/ (callStatus) => {
|
|
3542
|
+
return nativeModule().ubrn_uniffi_bitcoin_ffi_fn_method_transaction_lock_time(uniffiTypeTransactionObjectFactory.clonePointer(this), callStatus);
|
|
3543
|
+
},
|
|
3544
|
+
/*liftString:*/ FfiConverterString.lift));
|
|
3545
|
+
}
|
|
3546
|
+
output() {
|
|
3547
|
+
return FfiConverterArrayTypeTxOut.lift(uniffiCaller.rustCall(
|
|
3548
|
+
/*caller:*/ (callStatus) => {
|
|
3549
|
+
return nativeModule().ubrn_uniffi_bitcoin_ffi_fn_method_transaction_output(uniffiTypeTransactionObjectFactory.clonePointer(this), callStatus);
|
|
3550
|
+
},
|
|
3551
|
+
/*liftString:*/ FfiConverterString.lift));
|
|
3552
|
+
}
|
|
3553
|
+
serialize() {
|
|
3554
|
+
return FfiConverterArrayBuffer.lift(uniffiCaller.rustCall(
|
|
3555
|
+
/*caller:*/ (callStatus) => {
|
|
3556
|
+
return nativeModule().ubrn_uniffi_bitcoin_ffi_fn_method_transaction_serialize(uniffiTypeTransactionObjectFactory.clonePointer(this), callStatus);
|
|
3557
|
+
},
|
|
3558
|
+
/*liftString:*/ FfiConverterString.lift));
|
|
3559
|
+
}
|
|
3560
|
+
totalSize() {
|
|
3561
|
+
return FfiConverterUInt64.lift(uniffiCaller.rustCall(
|
|
3562
|
+
/*caller:*/ (callStatus) => {
|
|
3563
|
+
return nativeModule().ubrn_uniffi_bitcoin_ffi_fn_method_transaction_total_size(uniffiTypeTransactionObjectFactory.clonePointer(this), callStatus);
|
|
3564
|
+
},
|
|
3565
|
+
/*liftString:*/ FfiConverterString.lift));
|
|
3566
|
+
}
|
|
3567
|
+
version() {
|
|
3568
|
+
return FfiConverterInt32.lift(uniffiCaller.rustCall(
|
|
3569
|
+
/*caller:*/ (callStatus) => {
|
|
3570
|
+
return nativeModule().ubrn_uniffi_bitcoin_ffi_fn_method_transaction_version(uniffiTypeTransactionObjectFactory.clonePointer(this), callStatus);
|
|
3571
|
+
},
|
|
3572
|
+
/*liftString:*/ FfiConverterString.lift));
|
|
3573
|
+
}
|
|
3574
|
+
vsize() {
|
|
3575
|
+
return FfiConverterUInt64.lift(uniffiCaller.rustCall(
|
|
3576
|
+
/*caller:*/ (callStatus) => {
|
|
3577
|
+
return nativeModule().ubrn_uniffi_bitcoin_ffi_fn_method_transaction_vsize(uniffiTypeTransactionObjectFactory.clonePointer(this), callStatus);
|
|
3578
|
+
},
|
|
3579
|
+
/*liftString:*/ FfiConverterString.lift));
|
|
3580
|
+
}
|
|
3581
|
+
weight() {
|
|
3582
|
+
return FfiConverterUInt64.lift(uniffiCaller.rustCall(
|
|
3583
|
+
/*caller:*/ (callStatus) => {
|
|
3584
|
+
return nativeModule().ubrn_uniffi_bitcoin_ffi_fn_method_transaction_weight(uniffiTypeTransactionObjectFactory.clonePointer(this), callStatus);
|
|
3585
|
+
},
|
|
3586
|
+
/*liftString:*/ FfiConverterString.lift));
|
|
3587
|
+
}
|
|
3588
|
+
/**
|
|
3589
|
+
* {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
|
|
3590
|
+
*/
|
|
3591
|
+
uniffiDestroy() {
|
|
3592
|
+
const ptr = this[destructorGuardSymbol];
|
|
3593
|
+
if (ptr !== undefined) {
|
|
3594
|
+
const pointer = uniffiTypeTransactionObjectFactory.pointer(this);
|
|
3595
|
+
uniffiTypeTransactionObjectFactory.freePointer(pointer);
|
|
3596
|
+
uniffiTypeTransactionObjectFactory.unbless(ptr);
|
|
3597
|
+
delete this[destructorGuardSymbol];
|
|
3598
|
+
}
|
|
3599
|
+
}
|
|
3600
|
+
static instanceOf(obj) {
|
|
3601
|
+
return uniffiTypeTransactionObjectFactory.isConcreteType(obj);
|
|
3602
|
+
}
|
|
3603
|
+
}
|
|
3604
|
+
const uniffiTypeTransactionObjectFactory = (() => {
|
|
3605
|
+
/// <reference lib="es2021" />
|
|
3606
|
+
const registry = typeof FinalizationRegistry !== "undefined"
|
|
3607
|
+
? new FinalizationRegistry((heldValue) => {
|
|
3608
|
+
uniffiTypeTransactionObjectFactory.freePointer(heldValue);
|
|
3609
|
+
})
|
|
3610
|
+
: null;
|
|
3611
|
+
return {
|
|
3612
|
+
create(pointer) {
|
|
3613
|
+
const instance = Object.create(Transaction.prototype);
|
|
3614
|
+
instance[pointerLiteralSymbol] = pointer;
|
|
3615
|
+
instance[destructorGuardSymbol] = this.bless(pointer);
|
|
3616
|
+
instance[uniffiTypeNameSymbol] = "Transaction";
|
|
3617
|
+
return instance;
|
|
3618
|
+
},
|
|
3619
|
+
bless(p) {
|
|
3620
|
+
const ptr = {
|
|
3621
|
+
p, // make sure this object doesn't get optimized away.
|
|
3622
|
+
markDestroyed: () => undefined,
|
|
3623
|
+
};
|
|
3624
|
+
if (registry) {
|
|
3625
|
+
registry.register(ptr, p, ptr);
|
|
3626
|
+
}
|
|
3627
|
+
return ptr;
|
|
3628
|
+
},
|
|
3629
|
+
unbless(ptr) {
|
|
3630
|
+
if (registry) {
|
|
3631
|
+
registry.unregister(ptr);
|
|
3632
|
+
}
|
|
3633
|
+
},
|
|
3634
|
+
pointer(obj) {
|
|
3635
|
+
if (obj[destructorGuardSymbol] === undefined) {
|
|
3636
|
+
throw new UniffiInternalError.UnexpectedNullPointer();
|
|
3637
|
+
}
|
|
3638
|
+
return obj[pointerLiteralSymbol];
|
|
3639
|
+
},
|
|
3640
|
+
clonePointer(obj) {
|
|
3641
|
+
const pointer = this.pointer(obj);
|
|
3642
|
+
return uniffiCaller.rustCall(
|
|
3643
|
+
/*caller:*/ (callStatus) => nativeModule().ubrn_uniffi_bitcoin_ffi_fn_clone_transaction(pointer, callStatus),
|
|
3644
|
+
/*liftString:*/ FfiConverterString.lift);
|
|
3645
|
+
},
|
|
3646
|
+
freePointer(pointer) {
|
|
3647
|
+
uniffiCaller.rustCall(
|
|
3648
|
+
/*caller:*/ (callStatus) => nativeModule().ubrn_uniffi_bitcoin_ffi_fn_free_transaction(pointer, callStatus),
|
|
3649
|
+
/*liftString:*/ FfiConverterString.lift);
|
|
3650
|
+
},
|
|
3651
|
+
isConcreteType(obj) {
|
|
3652
|
+
return (obj[destructorGuardSymbol] &&
|
|
3653
|
+
obj[uniffiTypeNameSymbol] === "Transaction");
|
|
3654
|
+
},
|
|
3655
|
+
};
|
|
3656
|
+
})();
|
|
3657
|
+
// FfiConverter for TransactionInterface
|
|
3658
|
+
const FfiConverterTypeTransaction = new FfiConverterObject(uniffiTypeTransactionObjectFactory);
|
|
3659
|
+
// FfiConverter for Array<ArrayBuffer>
|
|
3660
|
+
const FfiConverterArrayArrayBuffer = new FfiConverterArray(FfiConverterArrayBuffer);
|
|
3661
|
+
// FfiConverter for Array<TxIn>
|
|
3662
|
+
const FfiConverterArrayTypeTxIn = new FfiConverterArray(FfiConverterTypeTxIn);
|
|
3663
|
+
// FfiConverter for Array<TxOut>
|
|
3664
|
+
const FfiConverterArrayTypeTxOut = new FfiConverterArray(FfiConverterTypeTxOut);
|
|
3665
|
+
/**
|
|
3666
|
+
* This should be called before anything else.
|
|
3667
|
+
*
|
|
3668
|
+
* It is likely that this is being done for you by the library's `index.ts`.
|
|
3669
|
+
*
|
|
3670
|
+
* It checks versions of uniffi between when the Rust scaffolding was generated
|
|
3671
|
+
* and when the bindings were generated.
|
|
3672
|
+
*
|
|
3673
|
+
* It also initializes the machinery to enable Rust to talk back to Javascript.
|
|
3674
|
+
*/
|
|
3675
|
+
function uniffiEnsureInitialized() {
|
|
3676
|
+
// Get the bindings contract version from our ComponentInterface
|
|
3677
|
+
const bindingsContractVersion = 29;
|
|
3678
|
+
// Get the scaffolding contract version by calling the into the dylib
|
|
3679
|
+
const scaffoldingContractVersion = nativeModule().ubrn_ffi_bitcoin_ffi_uniffi_contract_version();
|
|
3680
|
+
if (bindingsContractVersion !== scaffoldingContractVersion) {
|
|
3681
|
+
throw new UniffiInternalError.ContractVersionMismatch(scaffoldingContractVersion, bindingsContractVersion);
|
|
3682
|
+
}
|
|
3683
|
+
if (nativeModule().ubrn_uniffi_bitcoin_ffi_checksum_method_address_is_valid_for_network() !==
|
|
3684
|
+
55428) {
|
|
3685
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bitcoin_ffi_checksum_method_address_is_valid_for_network");
|
|
3686
|
+
}
|
|
3687
|
+
if (nativeModule().ubrn_uniffi_bitcoin_ffi_checksum_method_address_script_pubkey() !==
|
|
3688
|
+
7086) {
|
|
3689
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bitcoin_ffi_checksum_method_address_script_pubkey");
|
|
3690
|
+
}
|
|
3691
|
+
if (nativeModule().ubrn_uniffi_bitcoin_ffi_checksum_method_address_to_qr_uri() !==
|
|
3692
|
+
34272) {
|
|
3693
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bitcoin_ffi_checksum_method_address_to_qr_uri");
|
|
3694
|
+
}
|
|
3695
|
+
if (nativeModule().ubrn_uniffi_bitcoin_ffi_checksum_method_amount_to_btc() !==
|
|
3696
|
+
20425) {
|
|
3697
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bitcoin_ffi_checksum_method_amount_to_btc");
|
|
3698
|
+
}
|
|
3699
|
+
if (nativeModule().ubrn_uniffi_bitcoin_ffi_checksum_method_amount_to_sat() !==
|
|
3700
|
+
8831) {
|
|
3701
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bitcoin_ffi_checksum_method_amount_to_sat");
|
|
3702
|
+
}
|
|
3703
|
+
if (nativeModule().ubrn_uniffi_bitcoin_ffi_checksum_method_feerate_to_sat_per_kwu() !==
|
|
3704
|
+
30352) {
|
|
3705
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bitcoin_ffi_checksum_method_feerate_to_sat_per_kwu");
|
|
3706
|
+
}
|
|
3707
|
+
if (nativeModule().ubrn_uniffi_bitcoin_ffi_checksum_method_feerate_to_sat_per_vb_ceil() !==
|
|
3708
|
+
35371) {
|
|
3709
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bitcoin_ffi_checksum_method_feerate_to_sat_per_vb_ceil");
|
|
3710
|
+
}
|
|
3711
|
+
if (nativeModule().ubrn_uniffi_bitcoin_ffi_checksum_method_feerate_to_sat_per_vb_floor() !==
|
|
3712
|
+
55263) {
|
|
3713
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bitcoin_ffi_checksum_method_feerate_to_sat_per_vb_floor");
|
|
3714
|
+
}
|
|
3715
|
+
if (nativeModule().ubrn_uniffi_bitcoin_ffi_checksum_method_psbt_combine() !==
|
|
3716
|
+
42095) {
|
|
3717
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bitcoin_ffi_checksum_method_psbt_combine");
|
|
3718
|
+
}
|
|
3719
|
+
if (nativeModule().ubrn_uniffi_bitcoin_ffi_checksum_method_psbt_extract_tx() !==
|
|
3720
|
+
31319) {
|
|
3721
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bitcoin_ffi_checksum_method_psbt_extract_tx");
|
|
3722
|
+
}
|
|
3723
|
+
if (nativeModule().ubrn_uniffi_bitcoin_ffi_checksum_method_psbt_fee() !==
|
|
3724
|
+
21708) {
|
|
3725
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bitcoin_ffi_checksum_method_psbt_fee");
|
|
3726
|
+
}
|
|
3727
|
+
if (nativeModule().ubrn_uniffi_bitcoin_ffi_checksum_method_psbt_serialize() !==
|
|
3728
|
+
50542) {
|
|
3729
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bitcoin_ffi_checksum_method_psbt_serialize");
|
|
3730
|
+
}
|
|
3731
|
+
if (nativeModule().ubrn_uniffi_bitcoin_ffi_checksum_method_psbt_serialize_base64() !==
|
|
3732
|
+
43319) {
|
|
3733
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bitcoin_ffi_checksum_method_psbt_serialize_base64");
|
|
3734
|
+
}
|
|
3735
|
+
if (nativeModule().ubrn_uniffi_bitcoin_ffi_checksum_method_psbt_serialize_hex() !==
|
|
3736
|
+
62751) {
|
|
3737
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bitcoin_ffi_checksum_method_psbt_serialize_hex");
|
|
3738
|
+
}
|
|
3739
|
+
if (nativeModule().ubrn_uniffi_bitcoin_ffi_checksum_method_script_to_bytes() !==
|
|
3740
|
+
44421) {
|
|
3741
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bitcoin_ffi_checksum_method_script_to_bytes");
|
|
3742
|
+
}
|
|
3743
|
+
if (nativeModule().ubrn_uniffi_bitcoin_ffi_checksum_method_transaction_compute_txid() !==
|
|
3744
|
+
54056) {
|
|
3745
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bitcoin_ffi_checksum_method_transaction_compute_txid");
|
|
3746
|
+
}
|
|
3747
|
+
if (nativeModule().ubrn_uniffi_bitcoin_ffi_checksum_method_transaction_input() !==
|
|
3748
|
+
57477) {
|
|
3749
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bitcoin_ffi_checksum_method_transaction_input");
|
|
3750
|
+
}
|
|
3751
|
+
if (nativeModule().ubrn_uniffi_bitcoin_ffi_checksum_method_transaction_is_coinbase() !==
|
|
3752
|
+
30082) {
|
|
3753
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bitcoin_ffi_checksum_method_transaction_is_coinbase");
|
|
3754
|
+
}
|
|
3755
|
+
if (nativeModule().ubrn_uniffi_bitcoin_ffi_checksum_method_transaction_is_explicitly_rbf() !==
|
|
3756
|
+
27333) {
|
|
3757
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bitcoin_ffi_checksum_method_transaction_is_explicitly_rbf");
|
|
3758
|
+
}
|
|
3759
|
+
if (nativeModule().ubrn_uniffi_bitcoin_ffi_checksum_method_transaction_is_lock_time_enabled() !==
|
|
3760
|
+
60902) {
|
|
3761
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bitcoin_ffi_checksum_method_transaction_is_lock_time_enabled");
|
|
3762
|
+
}
|
|
3763
|
+
if (nativeModule().ubrn_uniffi_bitcoin_ffi_checksum_method_transaction_lock_time() !==
|
|
3764
|
+
47596) {
|
|
3765
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bitcoin_ffi_checksum_method_transaction_lock_time");
|
|
3766
|
+
}
|
|
3767
|
+
if (nativeModule().ubrn_uniffi_bitcoin_ffi_checksum_method_transaction_output() !==
|
|
3768
|
+
61951) {
|
|
3769
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bitcoin_ffi_checksum_method_transaction_output");
|
|
3770
|
+
}
|
|
3771
|
+
if (nativeModule().ubrn_uniffi_bitcoin_ffi_checksum_method_transaction_serialize() !==
|
|
3772
|
+
53292) {
|
|
3773
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bitcoin_ffi_checksum_method_transaction_serialize");
|
|
3774
|
+
}
|
|
3775
|
+
if (nativeModule().ubrn_uniffi_bitcoin_ffi_checksum_method_transaction_total_size() !==
|
|
3776
|
+
51597) {
|
|
3777
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bitcoin_ffi_checksum_method_transaction_total_size");
|
|
3778
|
+
}
|
|
3779
|
+
if (nativeModule().ubrn_uniffi_bitcoin_ffi_checksum_method_transaction_version() !==
|
|
3780
|
+
47252) {
|
|
3781
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bitcoin_ffi_checksum_method_transaction_version");
|
|
3782
|
+
}
|
|
3783
|
+
if (nativeModule().ubrn_uniffi_bitcoin_ffi_checksum_method_transaction_vsize() !==
|
|
3784
|
+
58879) {
|
|
3785
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bitcoin_ffi_checksum_method_transaction_vsize");
|
|
3786
|
+
}
|
|
3787
|
+
if (nativeModule().ubrn_uniffi_bitcoin_ffi_checksum_method_transaction_weight() !==
|
|
3788
|
+
12807) {
|
|
3789
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bitcoin_ffi_checksum_method_transaction_weight");
|
|
3790
|
+
}
|
|
3791
|
+
if (nativeModule().ubrn_uniffi_bitcoin_ffi_checksum_constructor_address_from_script() !==
|
|
3792
|
+
62411) {
|
|
3793
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bitcoin_ffi_checksum_constructor_address_from_script");
|
|
3794
|
+
}
|
|
3795
|
+
if (nativeModule().ubrn_uniffi_bitcoin_ffi_checksum_constructor_address_new() !==
|
|
3796
|
+
26098) {
|
|
3797
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bitcoin_ffi_checksum_constructor_address_new");
|
|
3798
|
+
}
|
|
3799
|
+
if (nativeModule().ubrn_uniffi_bitcoin_ffi_checksum_constructor_amount_from_btc() !==
|
|
3800
|
+
52219) {
|
|
3801
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bitcoin_ffi_checksum_constructor_amount_from_btc");
|
|
3802
|
+
}
|
|
3803
|
+
if (nativeModule().ubrn_uniffi_bitcoin_ffi_checksum_constructor_amount_from_sat() !==
|
|
3804
|
+
5551) {
|
|
3805
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bitcoin_ffi_checksum_constructor_amount_from_sat");
|
|
3806
|
+
}
|
|
3807
|
+
if (nativeModule().ubrn_uniffi_bitcoin_ffi_checksum_constructor_feerate_from_sat_per_kwu() !==
|
|
3808
|
+
60257) {
|
|
3809
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bitcoin_ffi_checksum_constructor_feerate_from_sat_per_kwu");
|
|
3810
|
+
}
|
|
3811
|
+
if (nativeModule().ubrn_uniffi_bitcoin_ffi_checksum_constructor_feerate_from_sat_per_vb() !==
|
|
3812
|
+
48712) {
|
|
3813
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bitcoin_ffi_checksum_constructor_feerate_from_sat_per_vb");
|
|
3814
|
+
}
|
|
3815
|
+
if (nativeModule().ubrn_uniffi_bitcoin_ffi_checksum_constructor_psbt_deserialize() !==
|
|
3816
|
+
4447) {
|
|
3817
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bitcoin_ffi_checksum_constructor_psbt_deserialize");
|
|
3818
|
+
}
|
|
3819
|
+
if (nativeModule().ubrn_uniffi_bitcoin_ffi_checksum_constructor_psbt_deserialize_base64() !==
|
|
3820
|
+
61367) {
|
|
3821
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bitcoin_ffi_checksum_constructor_psbt_deserialize_base64");
|
|
3822
|
+
}
|
|
3823
|
+
if (nativeModule().ubrn_uniffi_bitcoin_ffi_checksum_constructor_psbt_from_unsigned_tx() !==
|
|
3824
|
+
28547) {
|
|
3825
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bitcoin_ffi_checksum_constructor_psbt_from_unsigned_tx");
|
|
3826
|
+
}
|
|
3827
|
+
if (nativeModule().ubrn_uniffi_bitcoin_ffi_checksum_constructor_script_new() !==
|
|
3828
|
+
16741) {
|
|
3829
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bitcoin_ffi_checksum_constructor_script_new");
|
|
3830
|
+
}
|
|
3831
|
+
if (nativeModule().ubrn_uniffi_bitcoin_ffi_checksum_constructor_transaction_deserialize() !==
|
|
3832
|
+
44363) {
|
|
3833
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bitcoin_ffi_checksum_constructor_transaction_deserialize");
|
|
3834
|
+
}
|
|
3835
|
+
}
|
|
3836
|
+
export default Object.freeze({
|
|
3837
|
+
initialize: uniffiEnsureInitialized,
|
|
3838
|
+
converters: {
|
|
3839
|
+
FfiConverterTypeAddress,
|
|
3840
|
+
FfiConverterTypeAddressParseError,
|
|
3841
|
+
FfiConverterTypeAmount,
|
|
3842
|
+
FfiConverterTypeBlockHash,
|
|
3843
|
+
FfiConverterTypeEncodeError,
|
|
3844
|
+
FfiConverterTypeExtractTxError,
|
|
3845
|
+
FfiConverterTypeFeeRate,
|
|
3846
|
+
FfiConverterTypeFeeRateError,
|
|
3847
|
+
FfiConverterTypeFromScriptError,
|
|
3848
|
+
FfiConverterTypeNetwork,
|
|
3849
|
+
FfiConverterTypeOutPoint,
|
|
3850
|
+
FfiConverterTypeParseAmountError,
|
|
3851
|
+
FfiConverterTypePsbt,
|
|
3852
|
+
FfiConverterTypePsbtError,
|
|
3853
|
+
FfiConverterTypePsbtParseError,
|
|
3854
|
+
FfiConverterTypeScript,
|
|
3855
|
+
FfiConverterTypeTransaction,
|
|
3856
|
+
FfiConverterTypeTxIn,
|
|
3857
|
+
FfiConverterTypeTxOut,
|
|
3858
|
+
FfiConverterTypeTxid,
|
|
3859
|
+
},
|
|
3860
|
+
});
|
|
3861
|
+
//# sourceMappingURL=bitcoin.js.map
|