@breeztech/breez-sdk-spark-react-native 0.3.4 → 0.4.0-dev3

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.
Files changed (50) hide show
  1. package/android/CMakeLists.txt +0 -1
  2. package/cpp/breeztech-breez-sdk-spark-react-native.cpp +0 -2
  3. package/cpp/generated/breez_sdk_spark.cpp +4822 -825
  4. package/cpp/generated/breez_sdk_spark.hpp +185 -6
  5. package/lib/commonjs/generated/breez_sdk_spark-ffi.js.map +1 -1
  6. package/lib/commonjs/generated/breez_sdk_spark.js +1244 -7338
  7. package/lib/commonjs/generated/breez_sdk_spark.js.map +1 -1
  8. package/lib/commonjs/index.js +0 -14
  9. package/lib/commonjs/index.js.map +1 -1
  10. package/lib/module/generated/breez_sdk_spark-ffi.js.map +1 -1
  11. package/lib/module/generated/breez_sdk_spark.js +1245 -7323
  12. package/lib/module/generated/breez_sdk_spark.js.map +1 -1
  13. package/lib/module/index.js +0 -4
  14. package/lib/module/index.js.map +1 -1
  15. package/lib/typescript/commonjs/src/generated/breez_sdk_spark-ffi.d.ts +92 -3
  16. package/lib/typescript/commonjs/src/generated/breez_sdk_spark-ffi.d.ts.map +1 -1
  17. package/lib/typescript/commonjs/src/generated/breez_sdk_spark.d.ts +4997 -1208
  18. package/lib/typescript/commonjs/src/generated/breez_sdk_spark.d.ts.map +1 -1
  19. package/lib/typescript/commonjs/src/index.d.ts +0 -3
  20. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  21. package/lib/typescript/module/src/generated/breez_sdk_spark-ffi.d.ts +92 -3
  22. package/lib/typescript/module/src/generated/breez_sdk_spark-ffi.d.ts.map +1 -1
  23. package/lib/typescript/module/src/generated/breez_sdk_spark.d.ts +4997 -1208
  24. package/lib/typescript/module/src/generated/breez_sdk_spark.d.ts.map +1 -1
  25. package/lib/typescript/module/src/index.d.ts +0 -3
  26. package/lib/typescript/module/src/index.d.ts.map +1 -1
  27. package/package.json +1 -1
  28. package/src/generated/breez_sdk_spark-ffi.ts +260 -6
  29. package/src/generated/breez_sdk_spark.ts +15269 -7810
  30. package/src/index.tsx +0 -4
  31. package/cpp/generated/breez_sdk_common.cpp +0 -4486
  32. package/cpp/generated/breez_sdk_common.hpp +0 -280
  33. package/lib/commonjs/generated/breez_sdk_common-ffi.js +0 -44
  34. package/lib/commonjs/generated/breez_sdk_common-ffi.js.map +0 -1
  35. package/lib/commonjs/generated/breez_sdk_common.js +0 -4010
  36. package/lib/commonjs/generated/breez_sdk_common.js.map +0 -1
  37. package/lib/module/generated/breez_sdk_common-ffi.js +0 -43
  38. package/lib/module/generated/breez_sdk_common-ffi.js.map +0 -1
  39. package/lib/module/generated/breez_sdk_common.js +0 -4003
  40. package/lib/module/generated/breez_sdk_common.js.map +0 -1
  41. package/lib/typescript/commonjs/src/generated/breez_sdk_common-ffi.d.ts +0 -167
  42. package/lib/typescript/commonjs/src/generated/breez_sdk_common-ffi.d.ts.map +0 -1
  43. package/lib/typescript/commonjs/src/generated/breez_sdk_common.d.ts +0 -3191
  44. package/lib/typescript/commonjs/src/generated/breez_sdk_common.d.ts.map +0 -1
  45. package/lib/typescript/module/src/generated/breez_sdk_common-ffi.d.ts +0 -167
  46. package/lib/typescript/module/src/generated/breez_sdk_common-ffi.d.ts.map +0 -1
  47. package/lib/typescript/module/src/generated/breez_sdk_common.d.ts +0 -3191
  48. package/lib/typescript/module/src/generated/breez_sdk_common.d.ts.map +0 -1
  49. package/src/generated/breez_sdk_common-ffi.ts +0 -432
  50. package/src/generated/breez_sdk_common.ts +0 -5700
@@ -1,4003 +0,0 @@
1
- "use strict";
2
-
3
- // This file was autogenerated by some hot garbage in the `uniffi-bindgen-react-native` crate.
4
- // Trust me, you don't want to mess with it!
5
- import nativeModule from "./breez_sdk_common-ffi.js";
6
- import { AbstractFfiConverterByteArray, FfiConverterArray, FfiConverterBool, FfiConverterFloat64, FfiConverterInt32, FfiConverterMap, FfiConverterObjectWithCallbacks, FfiConverterOptional, FfiConverterUInt16, FfiConverterUInt32, FfiConverterUInt64, UniffiAbstractObject, UniffiEnum, UniffiError, UniffiInternalError, UniffiResult, UniffiRustCaller, destructorGuardSymbol, pointerLiteralSymbol, uniffiCreateFfiConverterString, uniffiCreateRecord, uniffiRustCallAsync, uniffiTraitInterfaceCallAsyncWithError, uniffiTypeNameSymbol } from 'uniffi-bindgen-react-native';
7
-
8
- // Get converters from the other files, if any.
9
- const uniffiCaller = new UniffiRustCaller();
10
- const uniffiIsDebug =
11
- // @ts-ignore -- The process global might not be defined
12
- typeof process !== 'object' ||
13
- // @ts-ignore -- The process global might not be defined
14
- process?.env?.NODE_ENV !== 'production' || false;
15
- // Public interface members begin here.
16
-
17
- /**
18
- * Payload of the AES success action, as received from the LNURL endpoint
19
- *
20
- * See [`AesSuccessActionDataDecrypted`] for a similar wrapper containing the decrypted payload
21
- */
22
-
23
- /**
24
- * Generated factory for {@link AesSuccessActionData} record objects.
25
- */
26
- export const AesSuccessActionData = (() => {
27
- const defaults = () => ({});
28
- const create = (() => {
29
- return uniffiCreateRecord(defaults);
30
- })();
31
- return Object.freeze({
32
- /**
33
- * Create a frozen instance of {@link AesSuccessActionData}, with defaults specified
34
- * in Rust, in the {@link breez_sdk_common} crate.
35
- */
36
- create,
37
- /**
38
- * Create a frozen instance of {@link AesSuccessActionData}, with defaults specified
39
- * in Rust, in the {@link breez_sdk_common} crate.
40
- */
41
- new: create,
42
- /**
43
- * Defaults specified in the {@link breez_sdk_common} crate.
44
- */
45
- defaults: () => Object.freeze(defaults())
46
- });
47
- })();
48
- const FfiConverterTypeAesSuccessActionData = (() => {
49
- class FFIConverter extends AbstractFfiConverterByteArray {
50
- read(from) {
51
- return {
52
- description: FfiConverterString.read(from),
53
- ciphertext: FfiConverterString.read(from),
54
- iv: FfiConverterString.read(from)
55
- };
56
- }
57
- write(value, into) {
58
- FfiConverterString.write(value.description, into);
59
- FfiConverterString.write(value.ciphertext, into);
60
- FfiConverterString.write(value.iv, into);
61
- }
62
- allocationSize(value) {
63
- return FfiConverterString.allocationSize(value.description) + FfiConverterString.allocationSize(value.ciphertext) + FfiConverterString.allocationSize(value.iv);
64
- }
65
- }
66
- return new FFIConverter();
67
- })();
68
-
69
- /**
70
- * Wrapper for the decrypted [`AesSuccessActionData`] payload
71
- */
72
-
73
- /**
74
- * Generated factory for {@link AesSuccessActionDataDecrypted} record objects.
75
- */
76
- export const AesSuccessActionDataDecrypted = (() => {
77
- const defaults = () => ({});
78
- const create = (() => {
79
- return uniffiCreateRecord(defaults);
80
- })();
81
- return Object.freeze({
82
- /**
83
- * Create a frozen instance of {@link AesSuccessActionDataDecrypted}, with defaults specified
84
- * in Rust, in the {@link breez_sdk_common} crate.
85
- */
86
- create,
87
- /**
88
- * Create a frozen instance of {@link AesSuccessActionDataDecrypted}, with defaults specified
89
- * in Rust, in the {@link breez_sdk_common} crate.
90
- */
91
- new: create,
92
- /**
93
- * Defaults specified in the {@link breez_sdk_common} crate.
94
- */
95
- defaults: () => Object.freeze(defaults())
96
- });
97
- })();
98
- const FfiConverterTypeAesSuccessActionDataDecrypted = (() => {
99
- class FFIConverter extends AbstractFfiConverterByteArray {
100
- read(from) {
101
- return {
102
- description: FfiConverterString.read(from),
103
- plaintext: FfiConverterString.read(from)
104
- };
105
- }
106
- write(value, into) {
107
- FfiConverterString.write(value.description, into);
108
- FfiConverterString.write(value.plaintext, into);
109
- }
110
- allocationSize(value) {
111
- return FfiConverterString.allocationSize(value.description) + FfiConverterString.allocationSize(value.plaintext);
112
- }
113
- }
114
- return new FFIConverter();
115
- })();
116
- /**
117
- * Generated factory for {@link Bip21Details} record objects.
118
- */
119
- export const Bip21Details = (() => {
120
- const defaults = () => ({});
121
- const create = (() => {
122
- return uniffiCreateRecord(defaults);
123
- })();
124
- return Object.freeze({
125
- /**
126
- * Create a frozen instance of {@link Bip21Details}, with defaults specified
127
- * in Rust, in the {@link breez_sdk_common} crate.
128
- */
129
- create,
130
- /**
131
- * Create a frozen instance of {@link Bip21Details}, with defaults specified
132
- * in Rust, in the {@link breez_sdk_common} crate.
133
- */
134
- new: create,
135
- /**
136
- * Defaults specified in the {@link breez_sdk_common} crate.
137
- */
138
- defaults: () => Object.freeze(defaults())
139
- });
140
- })();
141
- const FfiConverterTypeBip21Details = (() => {
142
- class FFIConverter extends AbstractFfiConverterByteArray {
143
- read(from) {
144
- return {
145
- amountSat: FfiConverterOptionalUInt64.read(from),
146
- assetId: FfiConverterOptionalString.read(from),
147
- uri: FfiConverterString.read(from),
148
- extras: FfiConverterArrayTypeBip21Extra.read(from),
149
- label: FfiConverterOptionalString.read(from),
150
- message: FfiConverterOptionalString.read(from),
151
- paymentMethods: FfiConverterArrayTypeInputType.read(from)
152
- };
153
- }
154
- write(value, into) {
155
- FfiConverterOptionalUInt64.write(value.amountSat, into);
156
- FfiConverterOptionalString.write(value.assetId, into);
157
- FfiConverterString.write(value.uri, into);
158
- FfiConverterArrayTypeBip21Extra.write(value.extras, into);
159
- FfiConverterOptionalString.write(value.label, into);
160
- FfiConverterOptionalString.write(value.message, into);
161
- FfiConverterArrayTypeInputType.write(value.paymentMethods, into);
162
- }
163
- allocationSize(value) {
164
- return FfiConverterOptionalUInt64.allocationSize(value.amountSat) + FfiConverterOptionalString.allocationSize(value.assetId) + FfiConverterString.allocationSize(value.uri) + FfiConverterArrayTypeBip21Extra.allocationSize(value.extras) + FfiConverterOptionalString.allocationSize(value.label) + FfiConverterOptionalString.allocationSize(value.message) + FfiConverterArrayTypeInputType.allocationSize(value.paymentMethods);
165
- }
166
- }
167
- return new FFIConverter();
168
- })();
169
- /**
170
- * Generated factory for {@link Bip21Extra} record objects.
171
- */
172
- export const Bip21Extra = (() => {
173
- const defaults = () => ({});
174
- const create = (() => {
175
- return uniffiCreateRecord(defaults);
176
- })();
177
- return Object.freeze({
178
- /**
179
- * Create a frozen instance of {@link Bip21Extra}, with defaults specified
180
- * in Rust, in the {@link breez_sdk_common} crate.
181
- */
182
- create,
183
- /**
184
- * Create a frozen instance of {@link Bip21Extra}, with defaults specified
185
- * in Rust, in the {@link breez_sdk_common} crate.
186
- */
187
- new: create,
188
- /**
189
- * Defaults specified in the {@link breez_sdk_common} crate.
190
- */
191
- defaults: () => Object.freeze(defaults())
192
- });
193
- })();
194
- const FfiConverterTypeBip21Extra = (() => {
195
- class FFIConverter extends AbstractFfiConverterByteArray {
196
- read(from) {
197
- return {
198
- key: FfiConverterString.read(from),
199
- value: FfiConverterString.read(from)
200
- };
201
- }
202
- write(value, into) {
203
- FfiConverterString.write(value.key, into);
204
- FfiConverterString.write(value.value, into);
205
- }
206
- allocationSize(value) {
207
- return FfiConverterString.allocationSize(value.key) + FfiConverterString.allocationSize(value.value);
208
- }
209
- }
210
- return new FFIConverter();
211
- })();
212
- /**
213
- * Generated factory for {@link BitcoinAddressDetails} record objects.
214
- */
215
- export const BitcoinAddressDetails = (() => {
216
- const defaults = () => ({});
217
- const create = (() => {
218
- return uniffiCreateRecord(defaults);
219
- })();
220
- return Object.freeze({
221
- /**
222
- * Create a frozen instance of {@link BitcoinAddressDetails}, with defaults specified
223
- * in Rust, in the {@link breez_sdk_common} crate.
224
- */
225
- create,
226
- /**
227
- * Create a frozen instance of {@link BitcoinAddressDetails}, with defaults specified
228
- * in Rust, in the {@link breez_sdk_common} crate.
229
- */
230
- new: create,
231
- /**
232
- * Defaults specified in the {@link breez_sdk_common} crate.
233
- */
234
- defaults: () => Object.freeze(defaults())
235
- });
236
- })();
237
- const FfiConverterTypeBitcoinAddressDetails = (() => {
238
- class FFIConverter extends AbstractFfiConverterByteArray {
239
- read(from) {
240
- return {
241
- address: FfiConverterString.read(from),
242
- network: FfiConverterTypeBitcoinNetwork.read(from),
243
- source: FfiConverterTypePaymentRequestSource.read(from)
244
- };
245
- }
246
- write(value, into) {
247
- FfiConverterString.write(value.address, into);
248
- FfiConverterTypeBitcoinNetwork.write(value.network, into);
249
- FfiConverterTypePaymentRequestSource.write(value.source, into);
250
- }
251
- allocationSize(value) {
252
- return FfiConverterString.allocationSize(value.address) + FfiConverterTypeBitcoinNetwork.allocationSize(value.network) + FfiConverterTypePaymentRequestSource.allocationSize(value.source);
253
- }
254
- }
255
- return new FFIConverter();
256
- })();
257
- /**
258
- * Generated factory for {@link Bolt11Invoice} record objects.
259
- */
260
- export const Bolt11Invoice = (() => {
261
- const defaults = () => ({});
262
- const create = (() => {
263
- return uniffiCreateRecord(defaults);
264
- })();
265
- return Object.freeze({
266
- /**
267
- * Create a frozen instance of {@link Bolt11Invoice}, with defaults specified
268
- * in Rust, in the {@link breez_sdk_common} crate.
269
- */
270
- create,
271
- /**
272
- * Create a frozen instance of {@link Bolt11Invoice}, with defaults specified
273
- * in Rust, in the {@link breez_sdk_common} crate.
274
- */
275
- new: create,
276
- /**
277
- * Defaults specified in the {@link breez_sdk_common} crate.
278
- */
279
- defaults: () => Object.freeze(defaults())
280
- });
281
- })();
282
- const FfiConverterTypeBolt11Invoice = (() => {
283
- class FFIConverter extends AbstractFfiConverterByteArray {
284
- read(from) {
285
- return {
286
- bolt11: FfiConverterString.read(from),
287
- source: FfiConverterTypePaymentRequestSource.read(from)
288
- };
289
- }
290
- write(value, into) {
291
- FfiConverterString.write(value.bolt11, into);
292
- FfiConverterTypePaymentRequestSource.write(value.source, into);
293
- }
294
- allocationSize(value) {
295
- return FfiConverterString.allocationSize(value.bolt11) + FfiConverterTypePaymentRequestSource.allocationSize(value.source);
296
- }
297
- }
298
- return new FFIConverter();
299
- })();
300
- /**
301
- * Generated factory for {@link Bolt11InvoiceDetails} record objects.
302
- */
303
- export const Bolt11InvoiceDetails = (() => {
304
- const defaults = () => ({});
305
- const create = (() => {
306
- return uniffiCreateRecord(defaults);
307
- })();
308
- return Object.freeze({
309
- /**
310
- * Create a frozen instance of {@link Bolt11InvoiceDetails}, with defaults specified
311
- * in Rust, in the {@link breez_sdk_common} crate.
312
- */
313
- create,
314
- /**
315
- * Create a frozen instance of {@link Bolt11InvoiceDetails}, with defaults specified
316
- * in Rust, in the {@link breez_sdk_common} crate.
317
- */
318
- new: create,
319
- /**
320
- * Defaults specified in the {@link breez_sdk_common} crate.
321
- */
322
- defaults: () => Object.freeze(defaults())
323
- });
324
- })();
325
- const FfiConverterTypeBolt11InvoiceDetails = (() => {
326
- class FFIConverter extends AbstractFfiConverterByteArray {
327
- read(from) {
328
- return {
329
- amountMsat: FfiConverterOptionalUInt64.read(from),
330
- description: FfiConverterOptionalString.read(from),
331
- descriptionHash: FfiConverterOptionalString.read(from),
332
- expiry: FfiConverterUInt64.read(from),
333
- invoice: FfiConverterTypeBolt11Invoice.read(from),
334
- minFinalCltvExpiryDelta: FfiConverterUInt64.read(from),
335
- network: FfiConverterTypeBitcoinNetwork.read(from),
336
- payeePubkey: FfiConverterString.read(from),
337
- paymentHash: FfiConverterString.read(from),
338
- paymentSecret: FfiConverterString.read(from),
339
- routingHints: FfiConverterArrayTypeBolt11RouteHint.read(from),
340
- timestamp: FfiConverterUInt64.read(from)
341
- };
342
- }
343
- write(value, into) {
344
- FfiConverterOptionalUInt64.write(value.amountMsat, into);
345
- FfiConverterOptionalString.write(value.description, into);
346
- FfiConverterOptionalString.write(value.descriptionHash, into);
347
- FfiConverterUInt64.write(value.expiry, into);
348
- FfiConverterTypeBolt11Invoice.write(value.invoice, into);
349
- FfiConverterUInt64.write(value.minFinalCltvExpiryDelta, into);
350
- FfiConverterTypeBitcoinNetwork.write(value.network, into);
351
- FfiConverterString.write(value.payeePubkey, into);
352
- FfiConverterString.write(value.paymentHash, into);
353
- FfiConverterString.write(value.paymentSecret, into);
354
- FfiConverterArrayTypeBolt11RouteHint.write(value.routingHints, into);
355
- FfiConverterUInt64.write(value.timestamp, into);
356
- }
357
- allocationSize(value) {
358
- return FfiConverterOptionalUInt64.allocationSize(value.amountMsat) + FfiConverterOptionalString.allocationSize(value.description) + FfiConverterOptionalString.allocationSize(value.descriptionHash) + FfiConverterUInt64.allocationSize(value.expiry) + FfiConverterTypeBolt11Invoice.allocationSize(value.invoice) + FfiConverterUInt64.allocationSize(value.minFinalCltvExpiryDelta) + FfiConverterTypeBitcoinNetwork.allocationSize(value.network) + FfiConverterString.allocationSize(value.payeePubkey) + FfiConverterString.allocationSize(value.paymentHash) + FfiConverterString.allocationSize(value.paymentSecret) + FfiConverterArrayTypeBolt11RouteHint.allocationSize(value.routingHints) + FfiConverterUInt64.allocationSize(value.timestamp);
359
- }
360
- }
361
- return new FFIConverter();
362
- })();
363
- /**
364
- * Generated factory for {@link Bolt11RouteHint} record objects.
365
- */
366
- export const Bolt11RouteHint = (() => {
367
- const defaults = () => ({});
368
- const create = (() => {
369
- return uniffiCreateRecord(defaults);
370
- })();
371
- return Object.freeze({
372
- /**
373
- * Create a frozen instance of {@link Bolt11RouteHint}, with defaults specified
374
- * in Rust, in the {@link breez_sdk_common} crate.
375
- */
376
- create,
377
- /**
378
- * Create a frozen instance of {@link Bolt11RouteHint}, with defaults specified
379
- * in Rust, in the {@link breez_sdk_common} crate.
380
- */
381
- new: create,
382
- /**
383
- * Defaults specified in the {@link breez_sdk_common} crate.
384
- */
385
- defaults: () => Object.freeze(defaults())
386
- });
387
- })();
388
- const FfiConverterTypeBolt11RouteHint = (() => {
389
- class FFIConverter extends AbstractFfiConverterByteArray {
390
- read(from) {
391
- return {
392
- hops: FfiConverterArrayTypeBolt11RouteHintHop.read(from)
393
- };
394
- }
395
- write(value, into) {
396
- FfiConverterArrayTypeBolt11RouteHintHop.write(value.hops, into);
397
- }
398
- allocationSize(value) {
399
- return FfiConverterArrayTypeBolt11RouteHintHop.allocationSize(value.hops);
400
- }
401
- }
402
- return new FFIConverter();
403
- })();
404
- /**
405
- * Generated factory for {@link Bolt11RouteHintHop} record objects.
406
- */
407
- export const Bolt11RouteHintHop = (() => {
408
- const defaults = () => ({});
409
- const create = (() => {
410
- return uniffiCreateRecord(defaults);
411
- })();
412
- return Object.freeze({
413
- /**
414
- * Create a frozen instance of {@link Bolt11RouteHintHop}, with defaults specified
415
- * in Rust, in the {@link breez_sdk_common} crate.
416
- */
417
- create,
418
- /**
419
- * Create a frozen instance of {@link Bolt11RouteHintHop}, with defaults specified
420
- * in Rust, in the {@link breez_sdk_common} crate.
421
- */
422
- new: create,
423
- /**
424
- * Defaults specified in the {@link breez_sdk_common} crate.
425
- */
426
- defaults: () => Object.freeze(defaults())
427
- });
428
- })();
429
- const FfiConverterTypeBolt11RouteHintHop = (() => {
430
- class FFIConverter extends AbstractFfiConverterByteArray {
431
- read(from) {
432
- return {
433
- srcNodeId: FfiConverterString.read(from),
434
- shortChannelId: FfiConverterString.read(from),
435
- feesBaseMsat: FfiConverterUInt32.read(from),
436
- feesProportionalMillionths: FfiConverterUInt32.read(from),
437
- cltvExpiryDelta: FfiConverterUInt16.read(from),
438
- htlcMinimumMsat: FfiConverterOptionalUInt64.read(from),
439
- htlcMaximumMsat: FfiConverterOptionalUInt64.read(from)
440
- };
441
- }
442
- write(value, into) {
443
- FfiConverterString.write(value.srcNodeId, into);
444
- FfiConverterString.write(value.shortChannelId, into);
445
- FfiConverterUInt32.write(value.feesBaseMsat, into);
446
- FfiConverterUInt32.write(value.feesProportionalMillionths, into);
447
- FfiConverterUInt16.write(value.cltvExpiryDelta, into);
448
- FfiConverterOptionalUInt64.write(value.htlcMinimumMsat, into);
449
- FfiConverterOptionalUInt64.write(value.htlcMaximumMsat, into);
450
- }
451
- allocationSize(value) {
452
- return FfiConverterString.allocationSize(value.srcNodeId) + FfiConverterString.allocationSize(value.shortChannelId) + FfiConverterUInt32.allocationSize(value.feesBaseMsat) + FfiConverterUInt32.allocationSize(value.feesProportionalMillionths) + FfiConverterUInt16.allocationSize(value.cltvExpiryDelta) + FfiConverterOptionalUInt64.allocationSize(value.htlcMinimumMsat) + FfiConverterOptionalUInt64.allocationSize(value.htlcMaximumMsat);
453
- }
454
- }
455
- return new FFIConverter();
456
- })();
457
- /**
458
- * Generated factory for {@link Bolt12Invoice} record objects.
459
- */
460
- export const Bolt12Invoice = (() => {
461
- const defaults = () => ({});
462
- const create = (() => {
463
- return uniffiCreateRecord(defaults);
464
- })();
465
- return Object.freeze({
466
- /**
467
- * Create a frozen instance of {@link Bolt12Invoice}, with defaults specified
468
- * in Rust, in the {@link breez_sdk_common} crate.
469
- */
470
- create,
471
- /**
472
- * Create a frozen instance of {@link Bolt12Invoice}, with defaults specified
473
- * in Rust, in the {@link breez_sdk_common} crate.
474
- */
475
- new: create,
476
- /**
477
- * Defaults specified in the {@link breez_sdk_common} crate.
478
- */
479
- defaults: () => Object.freeze(defaults())
480
- });
481
- })();
482
- const FfiConverterTypeBolt12Invoice = (() => {
483
- class FFIConverter extends AbstractFfiConverterByteArray {
484
- read(from) {
485
- return {
486
- invoice: FfiConverterString.read(from),
487
- source: FfiConverterTypePaymentRequestSource.read(from)
488
- };
489
- }
490
- write(value, into) {
491
- FfiConverterString.write(value.invoice, into);
492
- FfiConverterTypePaymentRequestSource.write(value.source, into);
493
- }
494
- allocationSize(value) {
495
- return FfiConverterString.allocationSize(value.invoice) + FfiConverterTypePaymentRequestSource.allocationSize(value.source);
496
- }
497
- }
498
- return new FFIConverter();
499
- })();
500
- /**
501
- * Generated factory for {@link Bolt12InvoiceDetails} record objects.
502
- */
503
- export const Bolt12InvoiceDetails = (() => {
504
- const defaults = () => ({});
505
- const create = (() => {
506
- return uniffiCreateRecord(defaults);
507
- })();
508
- return Object.freeze({
509
- /**
510
- * Create a frozen instance of {@link Bolt12InvoiceDetails}, with defaults specified
511
- * in Rust, in the {@link breez_sdk_common} crate.
512
- */
513
- create,
514
- /**
515
- * Create a frozen instance of {@link Bolt12InvoiceDetails}, with defaults specified
516
- * in Rust, in the {@link breez_sdk_common} crate.
517
- */
518
- new: create,
519
- /**
520
- * Defaults specified in the {@link breez_sdk_common} crate.
521
- */
522
- defaults: () => Object.freeze(defaults())
523
- });
524
- })();
525
- const FfiConverterTypeBolt12InvoiceDetails = (() => {
526
- class FFIConverter extends AbstractFfiConverterByteArray {
527
- read(from) {
528
- return {
529
- amountMsat: FfiConverterUInt64.read(from),
530
- invoice: FfiConverterTypeBolt12Invoice.read(from)
531
- };
532
- }
533
- write(value, into) {
534
- FfiConverterUInt64.write(value.amountMsat, into);
535
- FfiConverterTypeBolt12Invoice.write(value.invoice, into);
536
- }
537
- allocationSize(value) {
538
- return FfiConverterUInt64.allocationSize(value.amountMsat) + FfiConverterTypeBolt12Invoice.allocationSize(value.invoice);
539
- }
540
- }
541
- return new FFIConverter();
542
- })();
543
- /**
544
- * Generated factory for {@link Bolt12InvoiceRequestDetails} record objects.
545
- */
546
- export const Bolt12InvoiceRequestDetails = (() => {
547
- const defaults = () => ({});
548
- const create = (() => {
549
- return uniffiCreateRecord(defaults);
550
- })();
551
- return Object.freeze({
552
- /**
553
- * Create a frozen instance of {@link Bolt12InvoiceRequestDetails}, with defaults specified
554
- * in Rust, in the {@link breez_sdk_common} crate.
555
- */
556
- create,
557
- /**
558
- * Create a frozen instance of {@link Bolt12InvoiceRequestDetails}, with defaults specified
559
- * in Rust, in the {@link breez_sdk_common} crate.
560
- */
561
- new: create,
562
- /**
563
- * Defaults specified in the {@link breez_sdk_common} crate.
564
- */
565
- defaults: () => Object.freeze(defaults())
566
- });
567
- })();
568
- const FfiConverterTypeBolt12InvoiceRequestDetails = (() => {
569
- class FFIConverter extends AbstractFfiConverterByteArray {
570
- read(from) {
571
- return {};
572
- }
573
- write(value, into) {}
574
- allocationSize(value) {
575
- return 0;
576
- }
577
- }
578
- return new FFIConverter();
579
- })();
580
- /**
581
- * Generated factory for {@link Bolt12Offer} record objects.
582
- */
583
- export const Bolt12Offer = (() => {
584
- const defaults = () => ({});
585
- const create = (() => {
586
- return uniffiCreateRecord(defaults);
587
- })();
588
- return Object.freeze({
589
- /**
590
- * Create a frozen instance of {@link Bolt12Offer}, with defaults specified
591
- * in Rust, in the {@link breez_sdk_common} crate.
592
- */
593
- create,
594
- /**
595
- * Create a frozen instance of {@link Bolt12Offer}, with defaults specified
596
- * in Rust, in the {@link breez_sdk_common} crate.
597
- */
598
- new: create,
599
- /**
600
- * Defaults specified in the {@link breez_sdk_common} crate.
601
- */
602
- defaults: () => Object.freeze(defaults())
603
- });
604
- })();
605
- const FfiConverterTypeBolt12Offer = (() => {
606
- class FFIConverter extends AbstractFfiConverterByteArray {
607
- read(from) {
608
- return {
609
- offer: FfiConverterString.read(from),
610
- source: FfiConverterTypePaymentRequestSource.read(from)
611
- };
612
- }
613
- write(value, into) {
614
- FfiConverterString.write(value.offer, into);
615
- FfiConverterTypePaymentRequestSource.write(value.source, into);
616
- }
617
- allocationSize(value) {
618
- return FfiConverterString.allocationSize(value.offer) + FfiConverterTypePaymentRequestSource.allocationSize(value.source);
619
- }
620
- }
621
- return new FFIConverter();
622
- })();
623
- /**
624
- * Generated factory for {@link Bolt12OfferBlindedPath} record objects.
625
- */
626
- export const Bolt12OfferBlindedPath = (() => {
627
- const defaults = () => ({});
628
- const create = (() => {
629
- return uniffiCreateRecord(defaults);
630
- })();
631
- return Object.freeze({
632
- /**
633
- * Create a frozen instance of {@link Bolt12OfferBlindedPath}, with defaults specified
634
- * in Rust, in the {@link breez_sdk_common} crate.
635
- */
636
- create,
637
- /**
638
- * Create a frozen instance of {@link Bolt12OfferBlindedPath}, with defaults specified
639
- * in Rust, in the {@link breez_sdk_common} crate.
640
- */
641
- new: create,
642
- /**
643
- * Defaults specified in the {@link breez_sdk_common} crate.
644
- */
645
- defaults: () => Object.freeze(defaults())
646
- });
647
- })();
648
- const FfiConverterTypeBolt12OfferBlindedPath = (() => {
649
- class FFIConverter extends AbstractFfiConverterByteArray {
650
- read(from) {
651
- return {
652
- blindedHops: FfiConverterArrayString.read(from)
653
- };
654
- }
655
- write(value, into) {
656
- FfiConverterArrayString.write(value.blindedHops, into);
657
- }
658
- allocationSize(value) {
659
- return FfiConverterArrayString.allocationSize(value.blindedHops);
660
- }
661
- }
662
- return new FFIConverter();
663
- })();
664
- /**
665
- * Generated factory for {@link Bolt12OfferDetails} record objects.
666
- */
667
- export const Bolt12OfferDetails = (() => {
668
- const defaults = () => ({});
669
- const create = (() => {
670
- return uniffiCreateRecord(defaults);
671
- })();
672
- return Object.freeze({
673
- /**
674
- * Create a frozen instance of {@link Bolt12OfferDetails}, with defaults specified
675
- * in Rust, in the {@link breez_sdk_common} crate.
676
- */
677
- create,
678
- /**
679
- * Create a frozen instance of {@link Bolt12OfferDetails}, with defaults specified
680
- * in Rust, in the {@link breez_sdk_common} crate.
681
- */
682
- new: create,
683
- /**
684
- * Defaults specified in the {@link breez_sdk_common} crate.
685
- */
686
- defaults: () => Object.freeze(defaults())
687
- });
688
- })();
689
- const FfiConverterTypeBolt12OfferDetails = (() => {
690
- class FFIConverter extends AbstractFfiConverterByteArray {
691
- read(from) {
692
- return {
693
- absoluteExpiry: FfiConverterOptionalUInt64.read(from),
694
- chains: FfiConverterArrayString.read(from),
695
- description: FfiConverterOptionalString.read(from),
696
- issuer: FfiConverterOptionalString.read(from),
697
- minAmount: FfiConverterOptionalTypeAmount.read(from),
698
- offer: FfiConverterTypeBolt12Offer.read(from),
699
- paths: FfiConverterArrayTypeBolt12OfferBlindedPath.read(from),
700
- signingPubkey: FfiConverterOptionalString.read(from)
701
- };
702
- }
703
- write(value, into) {
704
- FfiConverterOptionalUInt64.write(value.absoluteExpiry, into);
705
- FfiConverterArrayString.write(value.chains, into);
706
- FfiConverterOptionalString.write(value.description, into);
707
- FfiConverterOptionalString.write(value.issuer, into);
708
- FfiConverterOptionalTypeAmount.write(value.minAmount, into);
709
- FfiConverterTypeBolt12Offer.write(value.offer, into);
710
- FfiConverterArrayTypeBolt12OfferBlindedPath.write(value.paths, into);
711
- FfiConverterOptionalString.write(value.signingPubkey, into);
712
- }
713
- allocationSize(value) {
714
- return FfiConverterOptionalUInt64.allocationSize(value.absoluteExpiry) + FfiConverterArrayString.allocationSize(value.chains) + FfiConverterOptionalString.allocationSize(value.description) + FfiConverterOptionalString.allocationSize(value.issuer) + FfiConverterOptionalTypeAmount.allocationSize(value.minAmount) + FfiConverterTypeBolt12Offer.allocationSize(value.offer) + FfiConverterArrayTypeBolt12OfferBlindedPath.allocationSize(value.paths) + FfiConverterOptionalString.allocationSize(value.signingPubkey);
715
- }
716
- }
717
- return new FFIConverter();
718
- })();
719
-
720
- /**
721
- * Details about a supported currency in the fiat rate feed
722
- */
723
-
724
- /**
725
- * Generated factory for {@link CurrencyInfo} record objects.
726
- */
727
- export const CurrencyInfo = (() => {
728
- const defaults = () => ({});
729
- const create = (() => {
730
- return uniffiCreateRecord(defaults);
731
- })();
732
- return Object.freeze({
733
- /**
734
- * Create a frozen instance of {@link CurrencyInfo}, with defaults specified
735
- * in Rust, in the {@link breez_sdk_common} crate.
736
- */
737
- create,
738
- /**
739
- * Create a frozen instance of {@link CurrencyInfo}, with defaults specified
740
- * in Rust, in the {@link breez_sdk_common} crate.
741
- */
742
- new: create,
743
- /**
744
- * Defaults specified in the {@link breez_sdk_common} crate.
745
- */
746
- defaults: () => Object.freeze(defaults())
747
- });
748
- })();
749
- const FfiConverterTypeCurrencyInfo = (() => {
750
- class FFIConverter extends AbstractFfiConverterByteArray {
751
- read(from) {
752
- return {
753
- name: FfiConverterString.read(from),
754
- fractionSize: FfiConverterUInt32.read(from),
755
- spacing: FfiConverterOptionalUInt32.read(from),
756
- symbol: FfiConverterOptionalTypeSymbol.read(from),
757
- uniqSymbol: FfiConverterOptionalTypeSymbol.read(from),
758
- localizedName: FfiConverterArrayTypeLocalizedName.read(from),
759
- localeOverrides: FfiConverterArrayTypeLocaleOverrides.read(from)
760
- };
761
- }
762
- write(value, into) {
763
- FfiConverterString.write(value.name, into);
764
- FfiConverterUInt32.write(value.fractionSize, into);
765
- FfiConverterOptionalUInt32.write(value.spacing, into);
766
- FfiConverterOptionalTypeSymbol.write(value.symbol, into);
767
- FfiConverterOptionalTypeSymbol.write(value.uniqSymbol, into);
768
- FfiConverterArrayTypeLocalizedName.write(value.localizedName, into);
769
- FfiConverterArrayTypeLocaleOverrides.write(value.localeOverrides, into);
770
- }
771
- allocationSize(value) {
772
- return FfiConverterString.allocationSize(value.name) + FfiConverterUInt32.allocationSize(value.fractionSize) + FfiConverterOptionalUInt32.allocationSize(value.spacing) + FfiConverterOptionalTypeSymbol.allocationSize(value.symbol) + FfiConverterOptionalTypeSymbol.allocationSize(value.uniqSymbol) + FfiConverterArrayTypeLocalizedName.allocationSize(value.localizedName) + FfiConverterArrayTypeLocaleOverrides.allocationSize(value.localeOverrides);
773
- }
774
- }
775
- return new FFIConverter();
776
- })();
777
-
778
- /**
779
- * Configuration for an external input parser
780
- */
781
-
782
- /**
783
- * Generated factory for {@link ExternalInputParser} record objects.
784
- */
785
- export const ExternalInputParser = (() => {
786
- const defaults = () => ({});
787
- const create = (() => {
788
- return uniffiCreateRecord(defaults);
789
- })();
790
- return Object.freeze({
791
- /**
792
- * Create a frozen instance of {@link ExternalInputParser}, with defaults specified
793
- * in Rust, in the {@link breez_sdk_common} crate.
794
- */
795
- create,
796
- /**
797
- * Create a frozen instance of {@link ExternalInputParser}, with defaults specified
798
- * in Rust, in the {@link breez_sdk_common} crate.
799
- */
800
- new: create,
801
- /**
802
- * Defaults specified in the {@link breez_sdk_common} crate.
803
- */
804
- defaults: () => Object.freeze(defaults())
805
- });
806
- })();
807
- const FfiConverterTypeExternalInputParser = (() => {
808
- class FFIConverter extends AbstractFfiConverterByteArray {
809
- read(from) {
810
- return {
811
- providerId: FfiConverterString.read(from),
812
- inputRegex: FfiConverterString.read(from),
813
- parserUrl: FfiConverterString.read(from)
814
- };
815
- }
816
- write(value, into) {
817
- FfiConverterString.write(value.providerId, into);
818
- FfiConverterString.write(value.inputRegex, into);
819
- FfiConverterString.write(value.parserUrl, into);
820
- }
821
- allocationSize(value) {
822
- return FfiConverterString.allocationSize(value.providerId) + FfiConverterString.allocationSize(value.inputRegex) + FfiConverterString.allocationSize(value.parserUrl);
823
- }
824
- }
825
- return new FFIConverter();
826
- })();
827
-
828
- /**
829
- * Wrapper around the [`CurrencyInfo`] of a fiat currency
830
- */
831
-
832
- /**
833
- * Generated factory for {@link FiatCurrency} record objects.
834
- */
835
- export const FiatCurrency = (() => {
836
- const defaults = () => ({});
837
- const create = (() => {
838
- return uniffiCreateRecord(defaults);
839
- })();
840
- return Object.freeze({
841
- /**
842
- * Create a frozen instance of {@link FiatCurrency}, with defaults specified
843
- * in Rust, in the {@link breez_sdk_common} crate.
844
- */
845
- create,
846
- /**
847
- * Create a frozen instance of {@link FiatCurrency}, with defaults specified
848
- * in Rust, in the {@link breez_sdk_common} crate.
849
- */
850
- new: create,
851
- /**
852
- * Defaults specified in the {@link breez_sdk_common} crate.
853
- */
854
- defaults: () => Object.freeze(defaults())
855
- });
856
- })();
857
- const FfiConverterTypeFiatCurrency = (() => {
858
- class FFIConverter extends AbstractFfiConverterByteArray {
859
- read(from) {
860
- return {
861
- id: FfiConverterString.read(from),
862
- info: FfiConverterTypeCurrencyInfo.read(from)
863
- };
864
- }
865
- write(value, into) {
866
- FfiConverterString.write(value.id, into);
867
- FfiConverterTypeCurrencyInfo.write(value.info, into);
868
- }
869
- allocationSize(value) {
870
- return FfiConverterString.allocationSize(value.id) + FfiConverterTypeCurrencyInfo.allocationSize(value.info);
871
- }
872
- }
873
- return new FFIConverter();
874
- })();
875
- /**
876
- * Generated factory for {@link LightningAddressDetails} record objects.
877
- */
878
- export const LightningAddressDetails = (() => {
879
- const defaults = () => ({});
880
- const create = (() => {
881
- return uniffiCreateRecord(defaults);
882
- })();
883
- return Object.freeze({
884
- /**
885
- * Create a frozen instance of {@link LightningAddressDetails}, with defaults specified
886
- * in Rust, in the {@link breez_sdk_common} crate.
887
- */
888
- create,
889
- /**
890
- * Create a frozen instance of {@link LightningAddressDetails}, with defaults specified
891
- * in Rust, in the {@link breez_sdk_common} crate.
892
- */
893
- new: create,
894
- /**
895
- * Defaults specified in the {@link breez_sdk_common} crate.
896
- */
897
- defaults: () => Object.freeze(defaults())
898
- });
899
- })();
900
- const FfiConverterTypeLightningAddressDetails = (() => {
901
- class FFIConverter extends AbstractFfiConverterByteArray {
902
- read(from) {
903
- return {
904
- address: FfiConverterString.read(from),
905
- payRequest: FfiConverterTypeLnurlPayRequestDetails.read(from)
906
- };
907
- }
908
- write(value, into) {
909
- FfiConverterString.write(value.address, into);
910
- FfiConverterTypeLnurlPayRequestDetails.write(value.payRequest, into);
911
- }
912
- allocationSize(value) {
913
- return FfiConverterString.allocationSize(value.address) + FfiConverterTypeLnurlPayRequestDetails.allocationSize(value.payRequest);
914
- }
915
- }
916
- return new FFIConverter();
917
- })();
918
-
919
- /**
920
- * Wrapped in a [`LnurlAuth`], this is the result of [`parse`] when given a LNURL-auth endpoint.
921
- *
922
- * It represents the endpoint's parameters for the LNURL workflow.
923
- *
924
- * See <https://github.com/lnurl/luds/blob/luds/04.md>
925
- */
926
-
927
- /**
928
- * Generated factory for {@link LnurlAuthRequestDetails} record objects.
929
- */
930
- export const LnurlAuthRequestDetails = (() => {
931
- const defaults = () => ({});
932
- const create = (() => {
933
- return uniffiCreateRecord(defaults);
934
- })();
935
- return Object.freeze({
936
- /**
937
- * Create a frozen instance of {@link LnurlAuthRequestDetails}, with defaults specified
938
- * in Rust, in the {@link breez_sdk_common} crate.
939
- */
940
- create,
941
- /**
942
- * Create a frozen instance of {@link LnurlAuthRequestDetails}, with defaults specified
943
- * in Rust, in the {@link breez_sdk_common} crate.
944
- */
945
- new: create,
946
- /**
947
- * Defaults specified in the {@link breez_sdk_common} crate.
948
- */
949
- defaults: () => Object.freeze(defaults())
950
- });
951
- })();
952
- const FfiConverterTypeLnurlAuthRequestDetails = (() => {
953
- class FFIConverter extends AbstractFfiConverterByteArray {
954
- read(from) {
955
- return {
956
- k1: FfiConverterString.read(from),
957
- action: FfiConverterOptionalString.read(from),
958
- domain: FfiConverterString.read(from),
959
- url: FfiConverterString.read(from)
960
- };
961
- }
962
- write(value, into) {
963
- FfiConverterString.write(value.k1, into);
964
- FfiConverterOptionalString.write(value.action, into);
965
- FfiConverterString.write(value.domain, into);
966
- FfiConverterString.write(value.url, into);
967
- }
968
- allocationSize(value) {
969
- return FfiConverterString.allocationSize(value.k1) + FfiConverterOptionalString.allocationSize(value.action) + FfiConverterString.allocationSize(value.domain) + FfiConverterString.allocationSize(value.url);
970
- }
971
- }
972
- return new FFIConverter();
973
- })();
974
-
975
- /**
976
- * Wrapped in a [`LnUrlError`], this represents a LNURL-endpoint error.
977
- */
978
-
979
- /**
980
- * Generated factory for {@link LnurlErrorDetails} record objects.
981
- */
982
- export const LnurlErrorDetails = (() => {
983
- const defaults = () => ({});
984
- const create = (() => {
985
- return uniffiCreateRecord(defaults);
986
- })();
987
- return Object.freeze({
988
- /**
989
- * Create a frozen instance of {@link LnurlErrorDetails}, with defaults specified
990
- * in Rust, in the {@link breez_sdk_common} crate.
991
- */
992
- create,
993
- /**
994
- * Create a frozen instance of {@link LnurlErrorDetails}, with defaults specified
995
- * in Rust, in the {@link breez_sdk_common} crate.
996
- */
997
- new: create,
998
- /**
999
- * Defaults specified in the {@link breez_sdk_common} crate.
1000
- */
1001
- defaults: () => Object.freeze(defaults())
1002
- });
1003
- })();
1004
- const FfiConverterTypeLnurlErrorDetails = (() => {
1005
- class FFIConverter extends AbstractFfiConverterByteArray {
1006
- read(from) {
1007
- return {
1008
- reason: FfiConverterString.read(from)
1009
- };
1010
- }
1011
- write(value, into) {
1012
- FfiConverterString.write(value.reason, into);
1013
- }
1014
- allocationSize(value) {
1015
- return FfiConverterString.allocationSize(value.reason);
1016
- }
1017
- }
1018
- return new FFIConverter();
1019
- })();
1020
- /**
1021
- * Generated factory for {@link LnurlPayRequestDetails} record objects.
1022
- */
1023
- export const LnurlPayRequestDetails = (() => {
1024
- const defaults = () => ({});
1025
- const create = (() => {
1026
- return uniffiCreateRecord(defaults);
1027
- })();
1028
- return Object.freeze({
1029
- /**
1030
- * Create a frozen instance of {@link LnurlPayRequestDetails}, with defaults specified
1031
- * in Rust, in the {@link breez_sdk_common} crate.
1032
- */
1033
- create,
1034
- /**
1035
- * Create a frozen instance of {@link LnurlPayRequestDetails}, with defaults specified
1036
- * in Rust, in the {@link breez_sdk_common} crate.
1037
- */
1038
- new: create,
1039
- /**
1040
- * Defaults specified in the {@link breez_sdk_common} crate.
1041
- */
1042
- defaults: () => Object.freeze(defaults())
1043
- });
1044
- })();
1045
- const FfiConverterTypeLnurlPayRequestDetails = (() => {
1046
- class FFIConverter extends AbstractFfiConverterByteArray {
1047
- read(from) {
1048
- return {
1049
- callback: FfiConverterString.read(from),
1050
- minSendable: FfiConverterUInt64.read(from),
1051
- maxSendable: FfiConverterUInt64.read(from),
1052
- metadataStr: FfiConverterString.read(from),
1053
- commentAllowed: FfiConverterUInt16.read(from),
1054
- domain: FfiConverterString.read(from),
1055
- url: FfiConverterString.read(from),
1056
- address: FfiConverterOptionalString.read(from),
1057
- allowsNostr: FfiConverterOptionalBool.read(from),
1058
- nostrPubkey: FfiConverterOptionalString.read(from)
1059
- };
1060
- }
1061
- write(value, into) {
1062
- FfiConverterString.write(value.callback, into);
1063
- FfiConverterUInt64.write(value.minSendable, into);
1064
- FfiConverterUInt64.write(value.maxSendable, into);
1065
- FfiConverterString.write(value.metadataStr, into);
1066
- FfiConverterUInt16.write(value.commentAllowed, into);
1067
- FfiConverterString.write(value.domain, into);
1068
- FfiConverterString.write(value.url, into);
1069
- FfiConverterOptionalString.write(value.address, into);
1070
- FfiConverterOptionalBool.write(value.allowsNostr, into);
1071
- FfiConverterOptionalString.write(value.nostrPubkey, into);
1072
- }
1073
- allocationSize(value) {
1074
- return FfiConverterString.allocationSize(value.callback) + FfiConverterUInt64.allocationSize(value.minSendable) + FfiConverterUInt64.allocationSize(value.maxSendable) + FfiConverterString.allocationSize(value.metadataStr) + FfiConverterUInt16.allocationSize(value.commentAllowed) + FfiConverterString.allocationSize(value.domain) + FfiConverterString.allocationSize(value.url) + FfiConverterOptionalString.allocationSize(value.address) + FfiConverterOptionalBool.allocationSize(value.allowsNostr) + FfiConverterOptionalString.allocationSize(value.nostrPubkey);
1075
- }
1076
- }
1077
- return new FFIConverter();
1078
- })();
1079
- /**
1080
- * Generated factory for {@link LnurlWithdrawRequestDetails} record objects.
1081
- */
1082
- export const LnurlWithdrawRequestDetails = (() => {
1083
- const defaults = () => ({});
1084
- const create = (() => {
1085
- return uniffiCreateRecord(defaults);
1086
- })();
1087
- return Object.freeze({
1088
- /**
1089
- * Create a frozen instance of {@link LnurlWithdrawRequestDetails}, with defaults specified
1090
- * in Rust, in the {@link breez_sdk_common} crate.
1091
- */
1092
- create,
1093
- /**
1094
- * Create a frozen instance of {@link LnurlWithdrawRequestDetails}, with defaults specified
1095
- * in Rust, in the {@link breez_sdk_common} crate.
1096
- */
1097
- new: create,
1098
- /**
1099
- * Defaults specified in the {@link breez_sdk_common} crate.
1100
- */
1101
- defaults: () => Object.freeze(defaults())
1102
- });
1103
- })();
1104
- const FfiConverterTypeLnurlWithdrawRequestDetails = (() => {
1105
- class FFIConverter extends AbstractFfiConverterByteArray {
1106
- read(from) {
1107
- return {
1108
- callback: FfiConverterString.read(from),
1109
- k1: FfiConverterString.read(from),
1110
- defaultDescription: FfiConverterString.read(from),
1111
- minWithdrawable: FfiConverterUInt64.read(from),
1112
- maxWithdrawable: FfiConverterUInt64.read(from)
1113
- };
1114
- }
1115
- write(value, into) {
1116
- FfiConverterString.write(value.callback, into);
1117
- FfiConverterString.write(value.k1, into);
1118
- FfiConverterString.write(value.defaultDescription, into);
1119
- FfiConverterUInt64.write(value.minWithdrawable, into);
1120
- FfiConverterUInt64.write(value.maxWithdrawable, into);
1121
- }
1122
- allocationSize(value) {
1123
- return FfiConverterString.allocationSize(value.callback) + FfiConverterString.allocationSize(value.k1) + FfiConverterString.allocationSize(value.defaultDescription) + FfiConverterUInt64.allocationSize(value.minWithdrawable) + FfiConverterUInt64.allocationSize(value.maxWithdrawable);
1124
- }
1125
- }
1126
- return new FFIConverter();
1127
- })();
1128
-
1129
- /**
1130
- * Locale-specific settings for the representation of a currency
1131
- */
1132
-
1133
- /**
1134
- * Generated factory for {@link LocaleOverrides} record objects.
1135
- */
1136
- export const LocaleOverrides = (() => {
1137
- const defaults = () => ({});
1138
- const create = (() => {
1139
- return uniffiCreateRecord(defaults);
1140
- })();
1141
- return Object.freeze({
1142
- /**
1143
- * Create a frozen instance of {@link LocaleOverrides}, with defaults specified
1144
- * in Rust, in the {@link breez_sdk_common} crate.
1145
- */
1146
- create,
1147
- /**
1148
- * Create a frozen instance of {@link LocaleOverrides}, with defaults specified
1149
- * in Rust, in the {@link breez_sdk_common} crate.
1150
- */
1151
- new: create,
1152
- /**
1153
- * Defaults specified in the {@link breez_sdk_common} crate.
1154
- */
1155
- defaults: () => Object.freeze(defaults())
1156
- });
1157
- })();
1158
- const FfiConverterTypeLocaleOverrides = (() => {
1159
- class FFIConverter extends AbstractFfiConverterByteArray {
1160
- read(from) {
1161
- return {
1162
- locale: FfiConverterString.read(from),
1163
- spacing: FfiConverterOptionalUInt32.read(from),
1164
- symbol: FfiConverterTypeSymbol.read(from)
1165
- };
1166
- }
1167
- write(value, into) {
1168
- FfiConverterString.write(value.locale, into);
1169
- FfiConverterOptionalUInt32.write(value.spacing, into);
1170
- FfiConverterTypeSymbol.write(value.symbol, into);
1171
- }
1172
- allocationSize(value) {
1173
- return FfiConverterString.allocationSize(value.locale) + FfiConverterOptionalUInt32.allocationSize(value.spacing) + FfiConverterTypeSymbol.allocationSize(value.symbol);
1174
- }
1175
- }
1176
- return new FFIConverter();
1177
- })();
1178
-
1179
- /**
1180
- * Localized name of a currency
1181
- */
1182
-
1183
- /**
1184
- * Generated factory for {@link LocalizedName} record objects.
1185
- */
1186
- export const LocalizedName = (() => {
1187
- const defaults = () => ({});
1188
- const create = (() => {
1189
- return uniffiCreateRecord(defaults);
1190
- })();
1191
- return Object.freeze({
1192
- /**
1193
- * Create a frozen instance of {@link LocalizedName}, with defaults specified
1194
- * in Rust, in the {@link breez_sdk_common} crate.
1195
- */
1196
- create,
1197
- /**
1198
- * Create a frozen instance of {@link LocalizedName}, with defaults specified
1199
- * in Rust, in the {@link breez_sdk_common} crate.
1200
- */
1201
- new: create,
1202
- /**
1203
- * Defaults specified in the {@link breez_sdk_common} crate.
1204
- */
1205
- defaults: () => Object.freeze(defaults())
1206
- });
1207
- })();
1208
- const FfiConverterTypeLocalizedName = (() => {
1209
- class FFIConverter extends AbstractFfiConverterByteArray {
1210
- read(from) {
1211
- return {
1212
- locale: FfiConverterString.read(from),
1213
- name: FfiConverterString.read(from)
1214
- };
1215
- }
1216
- write(value, into) {
1217
- FfiConverterString.write(value.locale, into);
1218
- FfiConverterString.write(value.name, into);
1219
- }
1220
- allocationSize(value) {
1221
- return FfiConverterString.allocationSize(value.locale) + FfiConverterString.allocationSize(value.name);
1222
- }
1223
- }
1224
- return new FFIConverter();
1225
- })();
1226
- /**
1227
- * Generated factory for {@link MessageSuccessActionData} record objects.
1228
- */
1229
- export const MessageSuccessActionData = (() => {
1230
- const defaults = () => ({});
1231
- const create = (() => {
1232
- return uniffiCreateRecord(defaults);
1233
- })();
1234
- return Object.freeze({
1235
- /**
1236
- * Create a frozen instance of {@link MessageSuccessActionData}, with defaults specified
1237
- * in Rust, in the {@link breez_sdk_common} crate.
1238
- */
1239
- create,
1240
- /**
1241
- * Create a frozen instance of {@link MessageSuccessActionData}, with defaults specified
1242
- * in Rust, in the {@link breez_sdk_common} crate.
1243
- */
1244
- new: create,
1245
- /**
1246
- * Defaults specified in the {@link breez_sdk_common} crate.
1247
- */
1248
- defaults: () => Object.freeze(defaults())
1249
- });
1250
- })();
1251
- const FfiConverterTypeMessageSuccessActionData = (() => {
1252
- class FFIConverter extends AbstractFfiConverterByteArray {
1253
- read(from) {
1254
- return {
1255
- message: FfiConverterString.read(from)
1256
- };
1257
- }
1258
- write(value, into) {
1259
- FfiConverterString.write(value.message, into);
1260
- }
1261
- allocationSize(value) {
1262
- return FfiConverterString.allocationSize(value.message);
1263
- }
1264
- }
1265
- return new FFIConverter();
1266
- })();
1267
- /**
1268
- * Generated factory for {@link PaymentRequestSource} record objects.
1269
- */
1270
- export const PaymentRequestSource = (() => {
1271
- const defaults = () => ({});
1272
- const create = (() => {
1273
- return uniffiCreateRecord(defaults);
1274
- })();
1275
- return Object.freeze({
1276
- /**
1277
- * Create a frozen instance of {@link PaymentRequestSource}, with defaults specified
1278
- * in Rust, in the {@link breez_sdk_common} crate.
1279
- */
1280
- create,
1281
- /**
1282
- * Create a frozen instance of {@link PaymentRequestSource}, with defaults specified
1283
- * in Rust, in the {@link breez_sdk_common} crate.
1284
- */
1285
- new: create,
1286
- /**
1287
- * Defaults specified in the {@link breez_sdk_common} crate.
1288
- */
1289
- defaults: () => Object.freeze(defaults())
1290
- });
1291
- })();
1292
- const FfiConverterTypePaymentRequestSource = (() => {
1293
- class FFIConverter extends AbstractFfiConverterByteArray {
1294
- read(from) {
1295
- return {
1296
- bip21Uri: FfiConverterOptionalString.read(from),
1297
- bip353Address: FfiConverterOptionalString.read(from)
1298
- };
1299
- }
1300
- write(value, into) {
1301
- FfiConverterOptionalString.write(value.bip21Uri, into);
1302
- FfiConverterOptionalString.write(value.bip353Address, into);
1303
- }
1304
- allocationSize(value) {
1305
- return FfiConverterOptionalString.allocationSize(value.bip21Uri) + FfiConverterOptionalString.allocationSize(value.bip353Address);
1306
- }
1307
- }
1308
- return new FFIConverter();
1309
- })();
1310
-
1311
- /**
1312
- * Denominator in an exchange rate
1313
- */
1314
-
1315
- /**
1316
- * Generated factory for {@link Rate} record objects.
1317
- */
1318
- export const Rate = (() => {
1319
- const defaults = () => ({});
1320
- const create = (() => {
1321
- return uniffiCreateRecord(defaults);
1322
- })();
1323
- return Object.freeze({
1324
- /**
1325
- * Create a frozen instance of {@link Rate}, with defaults specified
1326
- * in Rust, in the {@link breez_sdk_common} crate.
1327
- */
1328
- create,
1329
- /**
1330
- * Create a frozen instance of {@link Rate}, with defaults specified
1331
- * in Rust, in the {@link breez_sdk_common} crate.
1332
- */
1333
- new: create,
1334
- /**
1335
- * Defaults specified in the {@link breez_sdk_common} crate.
1336
- */
1337
- defaults: () => Object.freeze(defaults())
1338
- });
1339
- })();
1340
- const FfiConverterTypeRate = (() => {
1341
- class FFIConverter extends AbstractFfiConverterByteArray {
1342
- read(from) {
1343
- return {
1344
- coin: FfiConverterString.read(from),
1345
- value: FfiConverterFloat64.read(from)
1346
- };
1347
- }
1348
- write(value, into) {
1349
- FfiConverterString.write(value.coin, into);
1350
- FfiConverterFloat64.write(value.value, into);
1351
- }
1352
- allocationSize(value) {
1353
- return FfiConverterString.allocationSize(value.coin) + FfiConverterFloat64.allocationSize(value.value);
1354
- }
1355
- }
1356
- return new FFIConverter();
1357
- })();
1358
- /**
1359
- * Generated factory for {@link RestResponse} record objects.
1360
- */
1361
- export const RestResponse = (() => {
1362
- const defaults = () => ({});
1363
- const create = (() => {
1364
- return uniffiCreateRecord(defaults);
1365
- })();
1366
- return Object.freeze({
1367
- /**
1368
- * Create a frozen instance of {@link RestResponse}, with defaults specified
1369
- * in Rust, in the {@link breez_sdk_common} crate.
1370
- */
1371
- create,
1372
- /**
1373
- * Create a frozen instance of {@link RestResponse}, with defaults specified
1374
- * in Rust, in the {@link breez_sdk_common} crate.
1375
- */
1376
- new: create,
1377
- /**
1378
- * Defaults specified in the {@link breez_sdk_common} crate.
1379
- */
1380
- defaults: () => Object.freeze(defaults())
1381
- });
1382
- })();
1383
- const FfiConverterTypeRestResponse = (() => {
1384
- class FFIConverter extends AbstractFfiConverterByteArray {
1385
- read(from) {
1386
- return {
1387
- status: FfiConverterUInt16.read(from),
1388
- body: FfiConverterString.read(from)
1389
- };
1390
- }
1391
- write(value, into) {
1392
- FfiConverterUInt16.write(value.status, into);
1393
- FfiConverterString.write(value.body, into);
1394
- }
1395
- allocationSize(value) {
1396
- return FfiConverterUInt16.allocationSize(value.status) + FfiConverterString.allocationSize(value.body);
1397
- }
1398
- }
1399
- return new FFIConverter();
1400
- })();
1401
- /**
1402
- * Generated factory for {@link SilentPaymentAddressDetails} record objects.
1403
- */
1404
- export const SilentPaymentAddressDetails = (() => {
1405
- const defaults = () => ({});
1406
- const create = (() => {
1407
- return uniffiCreateRecord(defaults);
1408
- })();
1409
- return Object.freeze({
1410
- /**
1411
- * Create a frozen instance of {@link SilentPaymentAddressDetails}, with defaults specified
1412
- * in Rust, in the {@link breez_sdk_common} crate.
1413
- */
1414
- create,
1415
- /**
1416
- * Create a frozen instance of {@link SilentPaymentAddressDetails}, with defaults specified
1417
- * in Rust, in the {@link breez_sdk_common} crate.
1418
- */
1419
- new: create,
1420
- /**
1421
- * Defaults specified in the {@link breez_sdk_common} crate.
1422
- */
1423
- defaults: () => Object.freeze(defaults())
1424
- });
1425
- })();
1426
- const FfiConverterTypeSilentPaymentAddressDetails = (() => {
1427
- class FFIConverter extends AbstractFfiConverterByteArray {
1428
- read(from) {
1429
- return {
1430
- address: FfiConverterString.read(from),
1431
- network: FfiConverterTypeBitcoinNetwork.read(from),
1432
- source: FfiConverterTypePaymentRequestSource.read(from)
1433
- };
1434
- }
1435
- write(value, into) {
1436
- FfiConverterString.write(value.address, into);
1437
- FfiConverterTypeBitcoinNetwork.write(value.network, into);
1438
- FfiConverterTypePaymentRequestSource.write(value.source, into);
1439
- }
1440
- allocationSize(value) {
1441
- return FfiConverterString.allocationSize(value.address) + FfiConverterTypeBitcoinNetwork.allocationSize(value.network) + FfiConverterTypePaymentRequestSource.allocationSize(value.source);
1442
- }
1443
- }
1444
- return new FFIConverter();
1445
- })();
1446
- /**
1447
- * Generated factory for {@link SparkAddressDetails} record objects.
1448
- */
1449
- export const SparkAddressDetails = (() => {
1450
- const defaults = () => ({});
1451
- const create = (() => {
1452
- return uniffiCreateRecord(defaults);
1453
- })();
1454
- return Object.freeze({
1455
- /**
1456
- * Create a frozen instance of {@link SparkAddressDetails}, with defaults specified
1457
- * in Rust, in the {@link breez_sdk_common} crate.
1458
- */
1459
- create,
1460
- /**
1461
- * Create a frozen instance of {@link SparkAddressDetails}, with defaults specified
1462
- * in Rust, in the {@link breez_sdk_common} crate.
1463
- */
1464
- new: create,
1465
- /**
1466
- * Defaults specified in the {@link breez_sdk_common} crate.
1467
- */
1468
- defaults: () => Object.freeze(defaults())
1469
- });
1470
- })();
1471
- const FfiConverterTypeSparkAddressDetails = (() => {
1472
- class FFIConverter extends AbstractFfiConverterByteArray {
1473
- read(from) {
1474
- return {
1475
- address: FfiConverterString.read(from),
1476
- identityPublicKey: FfiConverterString.read(from),
1477
- network: FfiConverterTypeBitcoinNetwork.read(from),
1478
- source: FfiConverterTypePaymentRequestSource.read(from)
1479
- };
1480
- }
1481
- write(value, into) {
1482
- FfiConverterString.write(value.address, into);
1483
- FfiConverterString.write(value.identityPublicKey, into);
1484
- FfiConverterTypeBitcoinNetwork.write(value.network, into);
1485
- FfiConverterTypePaymentRequestSource.write(value.source, into);
1486
- }
1487
- allocationSize(value) {
1488
- return FfiConverterString.allocationSize(value.address) + FfiConverterString.allocationSize(value.identityPublicKey) + FfiConverterTypeBitcoinNetwork.allocationSize(value.network) + FfiConverterTypePaymentRequestSource.allocationSize(value.source);
1489
- }
1490
- }
1491
- return new FFIConverter();
1492
- })();
1493
- /**
1494
- * Generated factory for {@link SparkInvoiceDetails} record objects.
1495
- */
1496
- export const SparkInvoiceDetails = (() => {
1497
- const defaults = () => ({});
1498
- const create = (() => {
1499
- return uniffiCreateRecord(defaults);
1500
- })();
1501
- return Object.freeze({
1502
- /**
1503
- * Create a frozen instance of {@link SparkInvoiceDetails}, with defaults specified
1504
- * in Rust, in the {@link breez_sdk_common} crate.
1505
- */
1506
- create,
1507
- /**
1508
- * Create a frozen instance of {@link SparkInvoiceDetails}, with defaults specified
1509
- * in Rust, in the {@link breez_sdk_common} crate.
1510
- */
1511
- new: create,
1512
- /**
1513
- * Defaults specified in the {@link breez_sdk_common} crate.
1514
- */
1515
- defaults: () => Object.freeze(defaults())
1516
- });
1517
- })();
1518
- const FfiConverterTypeSparkInvoiceDetails = (() => {
1519
- class FFIConverter extends AbstractFfiConverterByteArray {
1520
- read(from) {
1521
- return {
1522
- invoice: FfiConverterString.read(from),
1523
- identityPublicKey: FfiConverterString.read(from),
1524
- network: FfiConverterTypeBitcoinNetwork.read(from),
1525
- amount: FfiConverterOptionalTypecommon_u128.read(from),
1526
- tokenIdentifier: FfiConverterOptionalString.read(from),
1527
- expiryTime: FfiConverterOptionalUInt64.read(from),
1528
- description: FfiConverterOptionalString.read(from),
1529
- senderPublicKey: FfiConverterOptionalString.read(from)
1530
- };
1531
- }
1532
- write(value, into) {
1533
- FfiConverterString.write(value.invoice, into);
1534
- FfiConverterString.write(value.identityPublicKey, into);
1535
- FfiConverterTypeBitcoinNetwork.write(value.network, into);
1536
- FfiConverterOptionalTypecommon_u128.write(value.amount, into);
1537
- FfiConverterOptionalString.write(value.tokenIdentifier, into);
1538
- FfiConverterOptionalUInt64.write(value.expiryTime, into);
1539
- FfiConverterOptionalString.write(value.description, into);
1540
- FfiConverterOptionalString.write(value.senderPublicKey, into);
1541
- }
1542
- allocationSize(value) {
1543
- return FfiConverterString.allocationSize(value.invoice) + FfiConverterString.allocationSize(value.identityPublicKey) + FfiConverterTypeBitcoinNetwork.allocationSize(value.network) + FfiConverterOptionalTypecommon_u128.allocationSize(value.amount) + FfiConverterOptionalString.allocationSize(value.tokenIdentifier) + FfiConverterOptionalUInt64.allocationSize(value.expiryTime) + FfiConverterOptionalString.allocationSize(value.description) + FfiConverterOptionalString.allocationSize(value.senderPublicKey);
1544
- }
1545
- }
1546
- return new FFIConverter();
1547
- })();
1548
-
1549
- /**
1550
- * Settings for the symbol representation of a currency
1551
- */
1552
-
1553
- /**
1554
- * Generated factory for {@link Symbol} record objects.
1555
- */
1556
- export const Symbol = (() => {
1557
- const defaults = () => ({});
1558
- const create = (() => {
1559
- return uniffiCreateRecord(defaults);
1560
- })();
1561
- return Object.freeze({
1562
- /**
1563
- * Create a frozen instance of {@link Symbol}, with defaults specified
1564
- * in Rust, in the {@link breez_sdk_common} crate.
1565
- */
1566
- create,
1567
- /**
1568
- * Create a frozen instance of {@link Symbol}, with defaults specified
1569
- * in Rust, in the {@link breez_sdk_common} crate.
1570
- */
1571
- new: create,
1572
- /**
1573
- * Defaults specified in the {@link breez_sdk_common} crate.
1574
- */
1575
- defaults: () => Object.freeze(defaults())
1576
- });
1577
- })();
1578
- const FfiConverterTypeSymbol = (() => {
1579
- class FFIConverter extends AbstractFfiConverterByteArray {
1580
- read(from) {
1581
- return {
1582
- grapheme: FfiConverterOptionalString.read(from),
1583
- template: FfiConverterOptionalString.read(from),
1584
- rtl: FfiConverterOptionalBool.read(from),
1585
- position: FfiConverterOptionalUInt32.read(from)
1586
- };
1587
- }
1588
- write(value, into) {
1589
- FfiConverterOptionalString.write(value.grapheme, into);
1590
- FfiConverterOptionalString.write(value.template, into);
1591
- FfiConverterOptionalBool.write(value.rtl, into);
1592
- FfiConverterOptionalUInt32.write(value.position, into);
1593
- }
1594
- allocationSize(value) {
1595
- return FfiConverterOptionalString.allocationSize(value.grapheme) + FfiConverterOptionalString.allocationSize(value.template) + FfiConverterOptionalBool.allocationSize(value.rtl) + FfiConverterOptionalUInt32.allocationSize(value.position);
1596
- }
1597
- }
1598
- return new FFIConverter();
1599
- })();
1600
- /**
1601
- * Generated factory for {@link UrlSuccessActionData} record objects.
1602
- */
1603
- export const UrlSuccessActionData = (() => {
1604
- const defaults = () => ({});
1605
- const create = (() => {
1606
- return uniffiCreateRecord(defaults);
1607
- })();
1608
- return Object.freeze({
1609
- /**
1610
- * Create a frozen instance of {@link UrlSuccessActionData}, with defaults specified
1611
- * in Rust, in the {@link breez_sdk_common} crate.
1612
- */
1613
- create,
1614
- /**
1615
- * Create a frozen instance of {@link UrlSuccessActionData}, with defaults specified
1616
- * in Rust, in the {@link breez_sdk_common} crate.
1617
- */
1618
- new: create,
1619
- /**
1620
- * Defaults specified in the {@link breez_sdk_common} crate.
1621
- */
1622
- defaults: () => Object.freeze(defaults())
1623
- });
1624
- })();
1625
- const FfiConverterTypeUrlSuccessActionData = (() => {
1626
- class FFIConverter extends AbstractFfiConverterByteArray {
1627
- read(from) {
1628
- return {
1629
- description: FfiConverterString.read(from),
1630
- url: FfiConverterString.read(from),
1631
- matchesCallbackDomain: FfiConverterBool.read(from)
1632
- };
1633
- }
1634
- write(value, into) {
1635
- FfiConverterString.write(value.description, into);
1636
- FfiConverterString.write(value.url, into);
1637
- FfiConverterBool.write(value.matchesCallbackDomain, into);
1638
- }
1639
- allocationSize(value) {
1640
- return FfiConverterString.allocationSize(value.description) + FfiConverterString.allocationSize(value.url) + FfiConverterBool.allocationSize(value.matchesCallbackDomain);
1641
- }
1642
- }
1643
- return new FFIConverter();
1644
- })();
1645
- const stringConverter = {
1646
- stringToBytes: s => uniffiCaller.rustCall(status => nativeModule().ubrn_uniffi_internal_fn_func_ffi__string_to_arraybuffer(s, status)),
1647
- bytesToString: ab => uniffiCaller.rustCall(status => nativeModule().ubrn_uniffi_internal_fn_func_ffi__arraybuffer_to_string(ab, status)),
1648
- stringByteLength: s => uniffiCaller.rustCall(status => nativeModule().ubrn_uniffi_internal_fn_func_ffi__string_to_byte_length(s, status))
1649
- };
1650
- const FfiConverterString = uniffiCreateFfiConverterString(stringConverter);
1651
-
1652
- /**
1653
- * Typealias from the type name used in the UDL file to the custom type. This
1654
- * is needed because the UDL type name is used in function/method signatures.
1655
- */
1656
-
1657
- // FfiConverter for CommonU128
1658
- const FfiConverterTypecommon_u128 = (() => {
1659
- const intermediateConverter = FfiConverterString;
1660
- class FFIConverter {
1661
- lift(value) {
1662
- const intermediate = intermediateConverter.lift(value);
1663
- return BigInt(intermediate);
1664
- }
1665
- lower(value) {
1666
- const intermediate = value.toString();
1667
- return intermediateConverter.lower(intermediate);
1668
- }
1669
- read(from) {
1670
- const intermediate = intermediateConverter.read(from);
1671
- return BigInt(intermediate);
1672
- }
1673
- write(value, into) {
1674
- const intermediate = value.toString();
1675
- intermediateConverter.write(intermediate, into);
1676
- }
1677
- allocationSize(value) {
1678
- const intermediate = value.toString();
1679
- return intermediateConverter.allocationSize(intermediate);
1680
- }
1681
- }
1682
- return new FFIConverter();
1683
- })();
1684
-
1685
- // Enum: AesSuccessActionDataResult
1686
- export let AesSuccessActionDataResult_Tags = /*#__PURE__*/function (AesSuccessActionDataResult_Tags) {
1687
- AesSuccessActionDataResult_Tags["Decrypted"] = "Decrypted";
1688
- AesSuccessActionDataResult_Tags["ErrorStatus"] = "ErrorStatus";
1689
- return AesSuccessActionDataResult_Tags;
1690
- }({});
1691
- /**
1692
- * Result of decryption of [`AesSuccessActionData`] payload
1693
- */
1694
- export const AesSuccessActionDataResult = (() => {
1695
- class Decrypted_ extends UniffiEnum {
1696
- /**
1697
- * @private
1698
- * This field is private and should not be used, use `tag` instead.
1699
- */
1700
- [uniffiTypeNameSymbol] = 'AesSuccessActionDataResult';
1701
- tag = AesSuccessActionDataResult_Tags.Decrypted;
1702
- constructor(inner) {
1703
- super('AesSuccessActionDataResult', 'Decrypted');
1704
- this.inner = Object.freeze(inner);
1705
- }
1706
- static new(inner) {
1707
- return new Decrypted_(inner);
1708
- }
1709
- static instanceOf(obj) {
1710
- return obj.tag === AesSuccessActionDataResult_Tags.Decrypted;
1711
- }
1712
- }
1713
- class ErrorStatus_ extends UniffiEnum {
1714
- /**
1715
- * @private
1716
- * This field is private and should not be used, use `tag` instead.
1717
- */
1718
- [uniffiTypeNameSymbol] = 'AesSuccessActionDataResult';
1719
- tag = AesSuccessActionDataResult_Tags.ErrorStatus;
1720
- constructor(inner) {
1721
- super('AesSuccessActionDataResult', 'ErrorStatus');
1722
- this.inner = Object.freeze(inner);
1723
- }
1724
- static new(inner) {
1725
- return new ErrorStatus_(inner);
1726
- }
1727
- static instanceOf(obj) {
1728
- return obj.tag === AesSuccessActionDataResult_Tags.ErrorStatus;
1729
- }
1730
- }
1731
- function instanceOf(obj) {
1732
- return obj[uniffiTypeNameSymbol] === 'AesSuccessActionDataResult';
1733
- }
1734
- return Object.freeze({
1735
- instanceOf,
1736
- Decrypted: Decrypted_,
1737
- ErrorStatus: ErrorStatus_
1738
- });
1739
- })();
1740
-
1741
- /**
1742
- * Result of decryption of [`AesSuccessActionData`] payload
1743
- */
1744
-
1745
- // FfiConverter for enum AesSuccessActionDataResult
1746
- const FfiConverterTypeAesSuccessActionDataResult = (() => {
1747
- const ordinalConverter = FfiConverterInt32;
1748
- class FFIConverter extends AbstractFfiConverterByteArray {
1749
- read(from) {
1750
- switch (ordinalConverter.read(from)) {
1751
- case 1:
1752
- return new AesSuccessActionDataResult.Decrypted({
1753
- data: FfiConverterTypeAesSuccessActionDataDecrypted.read(from)
1754
- });
1755
- case 2:
1756
- return new AesSuccessActionDataResult.ErrorStatus({
1757
- reason: FfiConverterString.read(from)
1758
- });
1759
- default:
1760
- throw new UniffiInternalError.UnexpectedEnumCase();
1761
- }
1762
- }
1763
- write(value, into) {
1764
- switch (value.tag) {
1765
- case AesSuccessActionDataResult_Tags.Decrypted:
1766
- {
1767
- ordinalConverter.write(1, into);
1768
- const inner = value.inner;
1769
- FfiConverterTypeAesSuccessActionDataDecrypted.write(inner.data, into);
1770
- return;
1771
- }
1772
- case AesSuccessActionDataResult_Tags.ErrorStatus:
1773
- {
1774
- ordinalConverter.write(2, into);
1775
- const inner = value.inner;
1776
- FfiConverterString.write(inner.reason, into);
1777
- return;
1778
- }
1779
- default:
1780
- // Throwing from here means that AesSuccessActionDataResult_Tags hasn't matched an ordinal.
1781
- throw new UniffiInternalError.UnexpectedEnumCase();
1782
- }
1783
- }
1784
- allocationSize(value) {
1785
- switch (value.tag) {
1786
- case AesSuccessActionDataResult_Tags.Decrypted:
1787
- {
1788
- const inner = value.inner;
1789
- let size = ordinalConverter.allocationSize(1);
1790
- size += FfiConverterTypeAesSuccessActionDataDecrypted.allocationSize(inner.data);
1791
- return size;
1792
- }
1793
- case AesSuccessActionDataResult_Tags.ErrorStatus:
1794
- {
1795
- const inner = value.inner;
1796
- let size = ordinalConverter.allocationSize(2);
1797
- size += FfiConverterString.allocationSize(inner.reason);
1798
- return size;
1799
- }
1800
- default:
1801
- throw new UniffiInternalError.UnexpectedEnumCase();
1802
- }
1803
- }
1804
- }
1805
- return new FFIConverter();
1806
- })();
1807
-
1808
- // Enum: Amount
1809
- export let Amount_Tags = /*#__PURE__*/function (Amount_Tags) {
1810
- Amount_Tags["Bitcoin"] = "Bitcoin";
1811
- Amount_Tags["Currency"] = "Currency";
1812
- return Amount_Tags;
1813
- }({});
1814
- export const Amount = (() => {
1815
- class Bitcoin_ extends UniffiEnum {
1816
- /**
1817
- * @private
1818
- * This field is private and should not be used, use `tag` instead.
1819
- */
1820
- [uniffiTypeNameSymbol] = 'Amount';
1821
- tag = Amount_Tags.Bitcoin;
1822
- constructor(inner) {
1823
- super('Amount', 'Bitcoin');
1824
- this.inner = Object.freeze(inner);
1825
- }
1826
- static new(inner) {
1827
- return new Bitcoin_(inner);
1828
- }
1829
- static instanceOf(obj) {
1830
- return obj.tag === Amount_Tags.Bitcoin;
1831
- }
1832
- }
1833
- /**
1834
- * An amount of currency specified using ISO 4712.
1835
- */
1836
- class Currency_ extends UniffiEnum {
1837
- /**
1838
- * @private
1839
- * This field is private and should not be used, use `tag` instead.
1840
- */
1841
- [uniffiTypeNameSymbol] = 'Amount';
1842
- tag = Amount_Tags.Currency;
1843
- constructor(inner) {
1844
- super('Amount', 'Currency');
1845
- this.inner = Object.freeze(inner);
1846
- }
1847
- static new(inner) {
1848
- return new Currency_(inner);
1849
- }
1850
- static instanceOf(obj) {
1851
- return obj.tag === Amount_Tags.Currency;
1852
- }
1853
- }
1854
- function instanceOf(obj) {
1855
- return obj[uniffiTypeNameSymbol] === 'Amount';
1856
- }
1857
- return Object.freeze({
1858
- instanceOf,
1859
- Bitcoin: Bitcoin_,
1860
- Currency: Currency_
1861
- });
1862
- })();
1863
- // FfiConverter for enum Amount
1864
- const FfiConverterTypeAmount = (() => {
1865
- const ordinalConverter = FfiConverterInt32;
1866
- class FFIConverter extends AbstractFfiConverterByteArray {
1867
- read(from) {
1868
- switch (ordinalConverter.read(from)) {
1869
- case 1:
1870
- return new Amount.Bitcoin({
1871
- amountMsat: FfiConverterUInt64.read(from)
1872
- });
1873
- case 2:
1874
- return new Amount.Currency({
1875
- iso4217Code: FfiConverterString.read(from),
1876
- fractionalAmount: FfiConverterUInt64.read(from)
1877
- });
1878
- default:
1879
- throw new UniffiInternalError.UnexpectedEnumCase();
1880
- }
1881
- }
1882
- write(value, into) {
1883
- switch (value.tag) {
1884
- case Amount_Tags.Bitcoin:
1885
- {
1886
- ordinalConverter.write(1, into);
1887
- const inner = value.inner;
1888
- FfiConverterUInt64.write(inner.amountMsat, into);
1889
- return;
1890
- }
1891
- case Amount_Tags.Currency:
1892
- {
1893
- ordinalConverter.write(2, into);
1894
- const inner = value.inner;
1895
- FfiConverterString.write(inner.iso4217Code, into);
1896
- FfiConverterUInt64.write(inner.fractionalAmount, into);
1897
- return;
1898
- }
1899
- default:
1900
- // Throwing from here means that Amount_Tags hasn't matched an ordinal.
1901
- throw new UniffiInternalError.UnexpectedEnumCase();
1902
- }
1903
- }
1904
- allocationSize(value) {
1905
- switch (value.tag) {
1906
- case Amount_Tags.Bitcoin:
1907
- {
1908
- const inner = value.inner;
1909
- let size = ordinalConverter.allocationSize(1);
1910
- size += FfiConverterUInt64.allocationSize(inner.amountMsat);
1911
- return size;
1912
- }
1913
- case Amount_Tags.Currency:
1914
- {
1915
- const inner = value.inner;
1916
- let size = ordinalConverter.allocationSize(2);
1917
- size += FfiConverterString.allocationSize(inner.iso4217Code);
1918
- size += FfiConverterUInt64.allocationSize(inner.fractionalAmount);
1919
- return size;
1920
- }
1921
- default:
1922
- throw new UniffiInternalError.UnexpectedEnumCase();
1923
- }
1924
- }
1925
- }
1926
- return new FFIConverter();
1927
- })();
1928
- export let BitcoinNetwork = /*#__PURE__*/function (BitcoinNetwork) {
1929
- /**
1930
- * Mainnet
1931
- */
1932
- BitcoinNetwork[BitcoinNetwork["Bitcoin"] = 0] = "Bitcoin";
1933
- BitcoinNetwork[BitcoinNetwork["Testnet3"] = 1] = "Testnet3";
1934
- BitcoinNetwork[BitcoinNetwork["Testnet4"] = 2] = "Testnet4";
1935
- BitcoinNetwork[BitcoinNetwork["Signet"] = 3] = "Signet";
1936
- BitcoinNetwork[BitcoinNetwork["Regtest"] = 4] = "Regtest";
1937
- return BitcoinNetwork;
1938
- }({});
1939
- const FfiConverterTypeBitcoinNetwork = (() => {
1940
- const ordinalConverter = FfiConverterInt32;
1941
- class FFIConverter extends AbstractFfiConverterByteArray {
1942
- read(from) {
1943
- switch (ordinalConverter.read(from)) {
1944
- case 1:
1945
- return BitcoinNetwork.Bitcoin;
1946
- case 2:
1947
- return BitcoinNetwork.Testnet3;
1948
- case 3:
1949
- return BitcoinNetwork.Testnet4;
1950
- case 4:
1951
- return BitcoinNetwork.Signet;
1952
- case 5:
1953
- return BitcoinNetwork.Regtest;
1954
- default:
1955
- throw new UniffiInternalError.UnexpectedEnumCase();
1956
- }
1957
- }
1958
- write(value, into) {
1959
- switch (value) {
1960
- case BitcoinNetwork.Bitcoin:
1961
- return ordinalConverter.write(1, into);
1962
- case BitcoinNetwork.Testnet3:
1963
- return ordinalConverter.write(2, into);
1964
- case BitcoinNetwork.Testnet4:
1965
- return ordinalConverter.write(3, into);
1966
- case BitcoinNetwork.Signet:
1967
- return ordinalConverter.write(4, into);
1968
- case BitcoinNetwork.Regtest:
1969
- return ordinalConverter.write(5, into);
1970
- }
1971
- }
1972
- allocationSize(value) {
1973
- return ordinalConverter.allocationSize(0);
1974
- }
1975
- }
1976
- return new FFIConverter();
1977
- })();
1978
-
1979
- // Enum: InputType
1980
- export let InputType_Tags = /*#__PURE__*/function (InputType_Tags) {
1981
- InputType_Tags["BitcoinAddress"] = "BitcoinAddress";
1982
- InputType_Tags["Bolt11Invoice"] = "Bolt11Invoice";
1983
- InputType_Tags["Bolt12Invoice"] = "Bolt12Invoice";
1984
- InputType_Tags["Bolt12Offer"] = "Bolt12Offer";
1985
- InputType_Tags["LightningAddress"] = "LightningAddress";
1986
- InputType_Tags["LnurlPay"] = "LnurlPay";
1987
- InputType_Tags["SilentPaymentAddress"] = "SilentPaymentAddress";
1988
- InputType_Tags["LnurlAuth"] = "LnurlAuth";
1989
- InputType_Tags["Url"] = "Url";
1990
- InputType_Tags["Bip21"] = "Bip21";
1991
- InputType_Tags["Bolt12InvoiceRequest"] = "Bolt12InvoiceRequest";
1992
- InputType_Tags["LnurlWithdraw"] = "LnurlWithdraw";
1993
- InputType_Tags["SparkAddress"] = "SparkAddress";
1994
- InputType_Tags["SparkInvoice"] = "SparkInvoice";
1995
- return InputType_Tags;
1996
- }({});
1997
- export const InputType = (() => {
1998
- class BitcoinAddress_ extends UniffiEnum {
1999
- /**
2000
- * @private
2001
- * This field is private and should not be used, use `tag` instead.
2002
- */
2003
- [uniffiTypeNameSymbol] = 'InputType';
2004
- tag = InputType_Tags.BitcoinAddress;
2005
- constructor(v0) {
2006
- super('InputType', 'BitcoinAddress');
2007
- this.inner = Object.freeze([v0]);
2008
- }
2009
- static new(v0) {
2010
- return new BitcoinAddress_(v0);
2011
- }
2012
- static instanceOf(obj) {
2013
- return obj.tag === InputType_Tags.BitcoinAddress;
2014
- }
2015
- }
2016
- class Bolt11Invoice_ extends UniffiEnum {
2017
- /**
2018
- * @private
2019
- * This field is private and should not be used, use `tag` instead.
2020
- */
2021
- [uniffiTypeNameSymbol] = 'InputType';
2022
- tag = InputType_Tags.Bolt11Invoice;
2023
- constructor(v0) {
2024
- super('InputType', 'Bolt11Invoice');
2025
- this.inner = Object.freeze([v0]);
2026
- }
2027
- static new(v0) {
2028
- return new Bolt11Invoice_(v0);
2029
- }
2030
- static instanceOf(obj) {
2031
- return obj.tag === InputType_Tags.Bolt11Invoice;
2032
- }
2033
- }
2034
- class Bolt12Invoice_ extends UniffiEnum {
2035
- /**
2036
- * @private
2037
- * This field is private and should not be used, use `tag` instead.
2038
- */
2039
- [uniffiTypeNameSymbol] = 'InputType';
2040
- tag = InputType_Tags.Bolt12Invoice;
2041
- constructor(v0) {
2042
- super('InputType', 'Bolt12Invoice');
2043
- this.inner = Object.freeze([v0]);
2044
- }
2045
- static new(v0) {
2046
- return new Bolt12Invoice_(v0);
2047
- }
2048
- static instanceOf(obj) {
2049
- return obj.tag === InputType_Tags.Bolt12Invoice;
2050
- }
2051
- }
2052
- class Bolt12Offer_ extends UniffiEnum {
2053
- /**
2054
- * @private
2055
- * This field is private and should not be used, use `tag` instead.
2056
- */
2057
- [uniffiTypeNameSymbol] = 'InputType';
2058
- tag = InputType_Tags.Bolt12Offer;
2059
- constructor(v0) {
2060
- super('InputType', 'Bolt12Offer');
2061
- this.inner = Object.freeze([v0]);
2062
- }
2063
- static new(v0) {
2064
- return new Bolt12Offer_(v0);
2065
- }
2066
- static instanceOf(obj) {
2067
- return obj.tag === InputType_Tags.Bolt12Offer;
2068
- }
2069
- }
2070
- class LightningAddress_ extends UniffiEnum {
2071
- /**
2072
- * @private
2073
- * This field is private and should not be used, use `tag` instead.
2074
- */
2075
- [uniffiTypeNameSymbol] = 'InputType';
2076
- tag = InputType_Tags.LightningAddress;
2077
- constructor(v0) {
2078
- super('InputType', 'LightningAddress');
2079
- this.inner = Object.freeze([v0]);
2080
- }
2081
- static new(v0) {
2082
- return new LightningAddress_(v0);
2083
- }
2084
- static instanceOf(obj) {
2085
- return obj.tag === InputType_Tags.LightningAddress;
2086
- }
2087
- }
2088
- class LnurlPay_ extends UniffiEnum {
2089
- /**
2090
- * @private
2091
- * This field is private and should not be used, use `tag` instead.
2092
- */
2093
- [uniffiTypeNameSymbol] = 'InputType';
2094
- tag = InputType_Tags.LnurlPay;
2095
- constructor(v0) {
2096
- super('InputType', 'LnurlPay');
2097
- this.inner = Object.freeze([v0]);
2098
- }
2099
- static new(v0) {
2100
- return new LnurlPay_(v0);
2101
- }
2102
- static instanceOf(obj) {
2103
- return obj.tag === InputType_Tags.LnurlPay;
2104
- }
2105
- }
2106
- class SilentPaymentAddress_ extends UniffiEnum {
2107
- /**
2108
- * @private
2109
- * This field is private and should not be used, use `tag` instead.
2110
- */
2111
- [uniffiTypeNameSymbol] = 'InputType';
2112
- tag = InputType_Tags.SilentPaymentAddress;
2113
- constructor(v0) {
2114
- super('InputType', 'SilentPaymentAddress');
2115
- this.inner = Object.freeze([v0]);
2116
- }
2117
- static new(v0) {
2118
- return new SilentPaymentAddress_(v0);
2119
- }
2120
- static instanceOf(obj) {
2121
- return obj.tag === InputType_Tags.SilentPaymentAddress;
2122
- }
2123
- }
2124
- class LnurlAuth_ extends UniffiEnum {
2125
- /**
2126
- * @private
2127
- * This field is private and should not be used, use `tag` instead.
2128
- */
2129
- [uniffiTypeNameSymbol] = 'InputType';
2130
- tag = InputType_Tags.LnurlAuth;
2131
- constructor(v0) {
2132
- super('InputType', 'LnurlAuth');
2133
- this.inner = Object.freeze([v0]);
2134
- }
2135
- static new(v0) {
2136
- return new LnurlAuth_(v0);
2137
- }
2138
- static instanceOf(obj) {
2139
- return obj.tag === InputType_Tags.LnurlAuth;
2140
- }
2141
- }
2142
- class Url_ extends UniffiEnum {
2143
- /**
2144
- * @private
2145
- * This field is private and should not be used, use `tag` instead.
2146
- */
2147
- [uniffiTypeNameSymbol] = 'InputType';
2148
- tag = InputType_Tags.Url;
2149
- constructor(v0) {
2150
- super('InputType', 'Url');
2151
- this.inner = Object.freeze([v0]);
2152
- }
2153
- static new(v0) {
2154
- return new Url_(v0);
2155
- }
2156
- static instanceOf(obj) {
2157
- return obj.tag === InputType_Tags.Url;
2158
- }
2159
- }
2160
- class Bip21_ extends UniffiEnum {
2161
- /**
2162
- * @private
2163
- * This field is private and should not be used, use `tag` instead.
2164
- */
2165
- [uniffiTypeNameSymbol] = 'InputType';
2166
- tag = InputType_Tags.Bip21;
2167
- constructor(v0) {
2168
- super('InputType', 'Bip21');
2169
- this.inner = Object.freeze([v0]);
2170
- }
2171
- static new(v0) {
2172
- return new Bip21_(v0);
2173
- }
2174
- static instanceOf(obj) {
2175
- return obj.tag === InputType_Tags.Bip21;
2176
- }
2177
- }
2178
- class Bolt12InvoiceRequest_ extends UniffiEnum {
2179
- /**
2180
- * @private
2181
- * This field is private and should not be used, use `tag` instead.
2182
- */
2183
- [uniffiTypeNameSymbol] = 'InputType';
2184
- tag = InputType_Tags.Bolt12InvoiceRequest;
2185
- constructor(v0) {
2186
- super('InputType', 'Bolt12InvoiceRequest');
2187
- this.inner = Object.freeze([v0]);
2188
- }
2189
- static new(v0) {
2190
- return new Bolt12InvoiceRequest_(v0);
2191
- }
2192
- static instanceOf(obj) {
2193
- return obj.tag === InputType_Tags.Bolt12InvoiceRequest;
2194
- }
2195
- }
2196
- class LnurlWithdraw_ extends UniffiEnum {
2197
- /**
2198
- * @private
2199
- * This field is private and should not be used, use `tag` instead.
2200
- */
2201
- [uniffiTypeNameSymbol] = 'InputType';
2202
- tag = InputType_Tags.LnurlWithdraw;
2203
- constructor(v0) {
2204
- super('InputType', 'LnurlWithdraw');
2205
- this.inner = Object.freeze([v0]);
2206
- }
2207
- static new(v0) {
2208
- return new LnurlWithdraw_(v0);
2209
- }
2210
- static instanceOf(obj) {
2211
- return obj.tag === InputType_Tags.LnurlWithdraw;
2212
- }
2213
- }
2214
- class SparkAddress_ extends UniffiEnum {
2215
- /**
2216
- * @private
2217
- * This field is private and should not be used, use `tag` instead.
2218
- */
2219
- [uniffiTypeNameSymbol] = 'InputType';
2220
- tag = InputType_Tags.SparkAddress;
2221
- constructor(v0) {
2222
- super('InputType', 'SparkAddress');
2223
- this.inner = Object.freeze([v0]);
2224
- }
2225
- static new(v0) {
2226
- return new SparkAddress_(v0);
2227
- }
2228
- static instanceOf(obj) {
2229
- return obj.tag === InputType_Tags.SparkAddress;
2230
- }
2231
- }
2232
- class SparkInvoice_ extends UniffiEnum {
2233
- /**
2234
- * @private
2235
- * This field is private and should not be used, use `tag` instead.
2236
- */
2237
- [uniffiTypeNameSymbol] = 'InputType';
2238
- tag = InputType_Tags.SparkInvoice;
2239
- constructor(v0) {
2240
- super('InputType', 'SparkInvoice');
2241
- this.inner = Object.freeze([v0]);
2242
- }
2243
- static new(v0) {
2244
- return new SparkInvoice_(v0);
2245
- }
2246
- static instanceOf(obj) {
2247
- return obj.tag === InputType_Tags.SparkInvoice;
2248
- }
2249
- }
2250
- function instanceOf(obj) {
2251
- return obj[uniffiTypeNameSymbol] === 'InputType';
2252
- }
2253
- return Object.freeze({
2254
- instanceOf,
2255
- BitcoinAddress: BitcoinAddress_,
2256
- Bolt11Invoice: Bolt11Invoice_,
2257
- Bolt12Invoice: Bolt12Invoice_,
2258
- Bolt12Offer: Bolt12Offer_,
2259
- LightningAddress: LightningAddress_,
2260
- LnurlPay: LnurlPay_,
2261
- SilentPaymentAddress: SilentPaymentAddress_,
2262
- LnurlAuth: LnurlAuth_,
2263
- Url: Url_,
2264
- Bip21: Bip21_,
2265
- Bolt12InvoiceRequest: Bolt12InvoiceRequest_,
2266
- LnurlWithdraw: LnurlWithdraw_,
2267
- SparkAddress: SparkAddress_,
2268
- SparkInvoice: SparkInvoice_
2269
- });
2270
- })();
2271
- // FfiConverter for enum InputType
2272
- const FfiConverterTypeInputType = (() => {
2273
- const ordinalConverter = FfiConverterInt32;
2274
- class FFIConverter extends AbstractFfiConverterByteArray {
2275
- read(from) {
2276
- switch (ordinalConverter.read(from)) {
2277
- case 1:
2278
- return new InputType.BitcoinAddress(FfiConverterTypeBitcoinAddressDetails.read(from));
2279
- case 2:
2280
- return new InputType.Bolt11Invoice(FfiConverterTypeBolt11InvoiceDetails.read(from));
2281
- case 3:
2282
- return new InputType.Bolt12Invoice(FfiConverterTypeBolt12InvoiceDetails.read(from));
2283
- case 4:
2284
- return new InputType.Bolt12Offer(FfiConverterTypeBolt12OfferDetails.read(from));
2285
- case 5:
2286
- return new InputType.LightningAddress(FfiConverterTypeLightningAddressDetails.read(from));
2287
- case 6:
2288
- return new InputType.LnurlPay(FfiConverterTypeLnurlPayRequestDetails.read(from));
2289
- case 7:
2290
- return new InputType.SilentPaymentAddress(FfiConverterTypeSilentPaymentAddressDetails.read(from));
2291
- case 8:
2292
- return new InputType.LnurlAuth(FfiConverterTypeLnurlAuthRequestDetails.read(from));
2293
- case 9:
2294
- return new InputType.Url(FfiConverterString.read(from));
2295
- case 10:
2296
- return new InputType.Bip21(FfiConverterTypeBip21Details.read(from));
2297
- case 11:
2298
- return new InputType.Bolt12InvoiceRequest(FfiConverterTypeBolt12InvoiceRequestDetails.read(from));
2299
- case 12:
2300
- return new InputType.LnurlWithdraw(FfiConverterTypeLnurlWithdrawRequestDetails.read(from));
2301
- case 13:
2302
- return new InputType.SparkAddress(FfiConverterTypeSparkAddressDetails.read(from));
2303
- case 14:
2304
- return new InputType.SparkInvoice(FfiConverterTypeSparkInvoiceDetails.read(from));
2305
- default:
2306
- throw new UniffiInternalError.UnexpectedEnumCase();
2307
- }
2308
- }
2309
- write(value, into) {
2310
- switch (value.tag) {
2311
- case InputType_Tags.BitcoinAddress:
2312
- {
2313
- ordinalConverter.write(1, into);
2314
- const inner = value.inner;
2315
- FfiConverterTypeBitcoinAddressDetails.write(inner[0], into);
2316
- return;
2317
- }
2318
- case InputType_Tags.Bolt11Invoice:
2319
- {
2320
- ordinalConverter.write(2, into);
2321
- const inner = value.inner;
2322
- FfiConverterTypeBolt11InvoiceDetails.write(inner[0], into);
2323
- return;
2324
- }
2325
- case InputType_Tags.Bolt12Invoice:
2326
- {
2327
- ordinalConverter.write(3, into);
2328
- const inner = value.inner;
2329
- FfiConverterTypeBolt12InvoiceDetails.write(inner[0], into);
2330
- return;
2331
- }
2332
- case InputType_Tags.Bolt12Offer:
2333
- {
2334
- ordinalConverter.write(4, into);
2335
- const inner = value.inner;
2336
- FfiConverterTypeBolt12OfferDetails.write(inner[0], into);
2337
- return;
2338
- }
2339
- case InputType_Tags.LightningAddress:
2340
- {
2341
- ordinalConverter.write(5, into);
2342
- const inner = value.inner;
2343
- FfiConverterTypeLightningAddressDetails.write(inner[0], into);
2344
- return;
2345
- }
2346
- case InputType_Tags.LnurlPay:
2347
- {
2348
- ordinalConverter.write(6, into);
2349
- const inner = value.inner;
2350
- FfiConverterTypeLnurlPayRequestDetails.write(inner[0], into);
2351
- return;
2352
- }
2353
- case InputType_Tags.SilentPaymentAddress:
2354
- {
2355
- ordinalConverter.write(7, into);
2356
- const inner = value.inner;
2357
- FfiConverterTypeSilentPaymentAddressDetails.write(inner[0], into);
2358
- return;
2359
- }
2360
- case InputType_Tags.LnurlAuth:
2361
- {
2362
- ordinalConverter.write(8, into);
2363
- const inner = value.inner;
2364
- FfiConverterTypeLnurlAuthRequestDetails.write(inner[0], into);
2365
- return;
2366
- }
2367
- case InputType_Tags.Url:
2368
- {
2369
- ordinalConverter.write(9, into);
2370
- const inner = value.inner;
2371
- FfiConverterString.write(inner[0], into);
2372
- return;
2373
- }
2374
- case InputType_Tags.Bip21:
2375
- {
2376
- ordinalConverter.write(10, into);
2377
- const inner = value.inner;
2378
- FfiConverterTypeBip21Details.write(inner[0], into);
2379
- return;
2380
- }
2381
- case InputType_Tags.Bolt12InvoiceRequest:
2382
- {
2383
- ordinalConverter.write(11, into);
2384
- const inner = value.inner;
2385
- FfiConverterTypeBolt12InvoiceRequestDetails.write(inner[0], into);
2386
- return;
2387
- }
2388
- case InputType_Tags.LnurlWithdraw:
2389
- {
2390
- ordinalConverter.write(12, into);
2391
- const inner = value.inner;
2392
- FfiConverterTypeLnurlWithdrawRequestDetails.write(inner[0], into);
2393
- return;
2394
- }
2395
- case InputType_Tags.SparkAddress:
2396
- {
2397
- ordinalConverter.write(13, into);
2398
- const inner = value.inner;
2399
- FfiConverterTypeSparkAddressDetails.write(inner[0], into);
2400
- return;
2401
- }
2402
- case InputType_Tags.SparkInvoice:
2403
- {
2404
- ordinalConverter.write(14, into);
2405
- const inner = value.inner;
2406
- FfiConverterTypeSparkInvoiceDetails.write(inner[0], into);
2407
- return;
2408
- }
2409
- default:
2410
- // Throwing from here means that InputType_Tags hasn't matched an ordinal.
2411
- throw new UniffiInternalError.UnexpectedEnumCase();
2412
- }
2413
- }
2414
- allocationSize(value) {
2415
- switch (value.tag) {
2416
- case InputType_Tags.BitcoinAddress:
2417
- {
2418
- const inner = value.inner;
2419
- let size = ordinalConverter.allocationSize(1);
2420
- size += FfiConverterTypeBitcoinAddressDetails.allocationSize(inner[0]);
2421
- return size;
2422
- }
2423
- case InputType_Tags.Bolt11Invoice:
2424
- {
2425
- const inner = value.inner;
2426
- let size = ordinalConverter.allocationSize(2);
2427
- size += FfiConverterTypeBolt11InvoiceDetails.allocationSize(inner[0]);
2428
- return size;
2429
- }
2430
- case InputType_Tags.Bolt12Invoice:
2431
- {
2432
- const inner = value.inner;
2433
- let size = ordinalConverter.allocationSize(3);
2434
- size += FfiConverterTypeBolt12InvoiceDetails.allocationSize(inner[0]);
2435
- return size;
2436
- }
2437
- case InputType_Tags.Bolt12Offer:
2438
- {
2439
- const inner = value.inner;
2440
- let size = ordinalConverter.allocationSize(4);
2441
- size += FfiConverterTypeBolt12OfferDetails.allocationSize(inner[0]);
2442
- return size;
2443
- }
2444
- case InputType_Tags.LightningAddress:
2445
- {
2446
- const inner = value.inner;
2447
- let size = ordinalConverter.allocationSize(5);
2448
- size += FfiConverterTypeLightningAddressDetails.allocationSize(inner[0]);
2449
- return size;
2450
- }
2451
- case InputType_Tags.LnurlPay:
2452
- {
2453
- const inner = value.inner;
2454
- let size = ordinalConverter.allocationSize(6);
2455
- size += FfiConverterTypeLnurlPayRequestDetails.allocationSize(inner[0]);
2456
- return size;
2457
- }
2458
- case InputType_Tags.SilentPaymentAddress:
2459
- {
2460
- const inner = value.inner;
2461
- let size = ordinalConverter.allocationSize(7);
2462
- size += FfiConverterTypeSilentPaymentAddressDetails.allocationSize(inner[0]);
2463
- return size;
2464
- }
2465
- case InputType_Tags.LnurlAuth:
2466
- {
2467
- const inner = value.inner;
2468
- let size = ordinalConverter.allocationSize(8);
2469
- size += FfiConverterTypeLnurlAuthRequestDetails.allocationSize(inner[0]);
2470
- return size;
2471
- }
2472
- case InputType_Tags.Url:
2473
- {
2474
- const inner = value.inner;
2475
- let size = ordinalConverter.allocationSize(9);
2476
- size += FfiConverterString.allocationSize(inner[0]);
2477
- return size;
2478
- }
2479
- case InputType_Tags.Bip21:
2480
- {
2481
- const inner = value.inner;
2482
- let size = ordinalConverter.allocationSize(10);
2483
- size += FfiConverterTypeBip21Details.allocationSize(inner[0]);
2484
- return size;
2485
- }
2486
- case InputType_Tags.Bolt12InvoiceRequest:
2487
- {
2488
- const inner = value.inner;
2489
- let size = ordinalConverter.allocationSize(11);
2490
- size += FfiConverterTypeBolt12InvoiceRequestDetails.allocationSize(inner[0]);
2491
- return size;
2492
- }
2493
- case InputType_Tags.LnurlWithdraw:
2494
- {
2495
- const inner = value.inner;
2496
- let size = ordinalConverter.allocationSize(12);
2497
- size += FfiConverterTypeLnurlWithdrawRequestDetails.allocationSize(inner[0]);
2498
- return size;
2499
- }
2500
- case InputType_Tags.SparkAddress:
2501
- {
2502
- const inner = value.inner;
2503
- let size = ordinalConverter.allocationSize(13);
2504
- size += FfiConverterTypeSparkAddressDetails.allocationSize(inner[0]);
2505
- return size;
2506
- }
2507
- case InputType_Tags.SparkInvoice:
2508
- {
2509
- const inner = value.inner;
2510
- let size = ordinalConverter.allocationSize(14);
2511
- size += FfiConverterTypeSparkInvoiceDetails.allocationSize(inner[0]);
2512
- return size;
2513
- }
2514
- default:
2515
- throw new UniffiInternalError.UnexpectedEnumCase();
2516
- }
2517
- }
2518
- }
2519
- return new FFIConverter();
2520
- })();
2521
-
2522
- // Enum: LnurlCallbackStatus
2523
- export let LnurlCallbackStatus_Tags = /*#__PURE__*/function (LnurlCallbackStatus_Tags) {
2524
- LnurlCallbackStatus_Tags["Ok"] = "Ok";
2525
- LnurlCallbackStatus_Tags["ErrorStatus"] = "ErrorStatus";
2526
- return LnurlCallbackStatus_Tags;
2527
- }({});
2528
- /**
2529
- * Contains the result of the entire LNURL interaction, as reported by the LNURL endpoint.
2530
- *
2531
- * * `Ok` indicates the interaction with the endpoint was valid, and the endpoint
2532
- * - started to pay the invoice asynchronously in the case of LNURL-withdraw,
2533
- * - verified the client signature in the case of LNURL-auth
2534
- * * `Error` indicates a generic issue the LNURL endpoint encountered, including a freetext
2535
- * description of the reason.
2536
- *
2537
- * Both cases are described in LUD-03 <https://github.com/lnurl/luds/blob/luds/03.md> & LUD-04: <https://github.com/lnurl/luds/blob/luds/04.md>
2538
- */
2539
- export const LnurlCallbackStatus = (() => {
2540
- /**
2541
- * On-wire format is: `{"status": "OK"}`
2542
- */
2543
- class Ok_ extends UniffiEnum {
2544
- /**
2545
- * @private
2546
- * This field is private and should not be used, use `tag` instead.
2547
- */
2548
- [uniffiTypeNameSymbol] = 'LnurlCallbackStatus';
2549
- tag = LnurlCallbackStatus_Tags.Ok;
2550
- constructor() {
2551
- super('LnurlCallbackStatus', 'Ok');
2552
- }
2553
- static new() {
2554
- return new Ok_();
2555
- }
2556
- static instanceOf(obj) {
2557
- return obj.tag === LnurlCallbackStatus_Tags.Ok;
2558
- }
2559
- }
2560
- /**
2561
- * On-wire format is: `{"status": "ERROR", "reason": "error details..."}`
2562
- */
2563
- class ErrorStatus_ extends UniffiEnum {
2564
- /**
2565
- * @private
2566
- * This field is private and should not be used, use `tag` instead.
2567
- */
2568
- [uniffiTypeNameSymbol] = 'LnurlCallbackStatus';
2569
- tag = LnurlCallbackStatus_Tags.ErrorStatus;
2570
- constructor(inner) {
2571
- super('LnurlCallbackStatus', 'ErrorStatus');
2572
- this.inner = Object.freeze(inner);
2573
- }
2574
- static new(inner) {
2575
- return new ErrorStatus_(inner);
2576
- }
2577
- static instanceOf(obj) {
2578
- return obj.tag === LnurlCallbackStatus_Tags.ErrorStatus;
2579
- }
2580
- }
2581
- function instanceOf(obj) {
2582
- return obj[uniffiTypeNameSymbol] === 'LnurlCallbackStatus';
2583
- }
2584
- return Object.freeze({
2585
- instanceOf,
2586
- Ok: Ok_,
2587
- ErrorStatus: ErrorStatus_
2588
- });
2589
- })();
2590
-
2591
- /**
2592
- * Contains the result of the entire LNURL interaction, as reported by the LNURL endpoint.
2593
- *
2594
- * * `Ok` indicates the interaction with the endpoint was valid, and the endpoint
2595
- * - started to pay the invoice asynchronously in the case of LNURL-withdraw,
2596
- * - verified the client signature in the case of LNURL-auth
2597
- * * `Error` indicates a generic issue the LNURL endpoint encountered, including a freetext
2598
- * description of the reason.
2599
- *
2600
- * Both cases are described in LUD-03 <https://github.com/lnurl/luds/blob/luds/03.md> & LUD-04: <https://github.com/lnurl/luds/blob/luds/04.md>
2601
- */
2602
-
2603
- // FfiConverter for enum LnurlCallbackStatus
2604
- const FfiConverterTypeLnurlCallbackStatus = (() => {
2605
- const ordinalConverter = FfiConverterInt32;
2606
- class FFIConverter extends AbstractFfiConverterByteArray {
2607
- read(from) {
2608
- switch (ordinalConverter.read(from)) {
2609
- case 1:
2610
- return new LnurlCallbackStatus.Ok();
2611
- case 2:
2612
- return new LnurlCallbackStatus.ErrorStatus({
2613
- errorDetails: FfiConverterTypeLnurlErrorDetails.read(from)
2614
- });
2615
- default:
2616
- throw new UniffiInternalError.UnexpectedEnumCase();
2617
- }
2618
- }
2619
- write(value, into) {
2620
- switch (value.tag) {
2621
- case LnurlCallbackStatus_Tags.Ok:
2622
- {
2623
- ordinalConverter.write(1, into);
2624
- return;
2625
- }
2626
- case LnurlCallbackStatus_Tags.ErrorStatus:
2627
- {
2628
- ordinalConverter.write(2, into);
2629
- const inner = value.inner;
2630
- FfiConverterTypeLnurlErrorDetails.write(inner.errorDetails, into);
2631
- return;
2632
- }
2633
- default:
2634
- // Throwing from here means that LnurlCallbackStatus_Tags hasn't matched an ordinal.
2635
- throw new UniffiInternalError.UnexpectedEnumCase();
2636
- }
2637
- }
2638
- allocationSize(value) {
2639
- switch (value.tag) {
2640
- case LnurlCallbackStatus_Tags.Ok:
2641
- {
2642
- return ordinalConverter.allocationSize(1);
2643
- }
2644
- case LnurlCallbackStatus_Tags.ErrorStatus:
2645
- {
2646
- const inner = value.inner;
2647
- let size = ordinalConverter.allocationSize(2);
2648
- size += FfiConverterTypeLnurlErrorDetails.allocationSize(inner.errorDetails);
2649
- return size;
2650
- }
2651
- default:
2652
- throw new UniffiInternalError.UnexpectedEnumCase();
2653
- }
2654
- }
2655
- }
2656
- return new FFIConverter();
2657
- })();
2658
-
2659
- // Error type: ServiceConnectivityError
2660
-
2661
- // Enum: ServiceConnectivityError
2662
- export let ServiceConnectivityError_Tags = /*#__PURE__*/function (ServiceConnectivityError_Tags) {
2663
- ServiceConnectivityError_Tags["Builder"] = "Builder";
2664
- ServiceConnectivityError_Tags["Redirect"] = "Redirect";
2665
- ServiceConnectivityError_Tags["Status"] = "Status";
2666
- ServiceConnectivityError_Tags["Timeout"] = "Timeout";
2667
- ServiceConnectivityError_Tags["Request"] = "Request";
2668
- ServiceConnectivityError_Tags["Connect"] = "Connect";
2669
- ServiceConnectivityError_Tags["Body"] = "Body";
2670
- ServiceConnectivityError_Tags["Decode"] = "Decode";
2671
- ServiceConnectivityError_Tags["Json"] = "Json";
2672
- ServiceConnectivityError_Tags["Other"] = "Other";
2673
- return ServiceConnectivityError_Tags;
2674
- }({});
2675
- export const ServiceConnectivityError = (() => {
2676
- class Builder_ extends UniffiError {
2677
- /**
2678
- * @private
2679
- * This field is private and should not be used, use `tag` instead.
2680
- */
2681
- [uniffiTypeNameSymbol] = 'ServiceConnectivityError';
2682
- tag = ServiceConnectivityError_Tags.Builder;
2683
- constructor(v0) {
2684
- super('ServiceConnectivityError', 'Builder');
2685
- this.inner = Object.freeze([v0]);
2686
- }
2687
- static new(v0) {
2688
- return new Builder_(v0);
2689
- }
2690
- static instanceOf(obj) {
2691
- return obj.tag === ServiceConnectivityError_Tags.Builder;
2692
- }
2693
- static hasInner(obj) {
2694
- return Builder_.instanceOf(obj);
2695
- }
2696
- static getInner(obj) {
2697
- return obj.inner;
2698
- }
2699
- }
2700
- class Redirect_ extends UniffiError {
2701
- /**
2702
- * @private
2703
- * This field is private and should not be used, use `tag` instead.
2704
- */
2705
- [uniffiTypeNameSymbol] = 'ServiceConnectivityError';
2706
- tag = ServiceConnectivityError_Tags.Redirect;
2707
- constructor(v0) {
2708
- super('ServiceConnectivityError', 'Redirect');
2709
- this.inner = Object.freeze([v0]);
2710
- }
2711
- static new(v0) {
2712
- return new Redirect_(v0);
2713
- }
2714
- static instanceOf(obj) {
2715
- return obj.tag === ServiceConnectivityError_Tags.Redirect;
2716
- }
2717
- static hasInner(obj) {
2718
- return Redirect_.instanceOf(obj);
2719
- }
2720
- static getInner(obj) {
2721
- return obj.inner;
2722
- }
2723
- }
2724
- class Status_ extends UniffiError {
2725
- /**
2726
- * @private
2727
- * This field is private and should not be used, use `tag` instead.
2728
- */
2729
- [uniffiTypeNameSymbol] = 'ServiceConnectivityError';
2730
- tag = ServiceConnectivityError_Tags.Status;
2731
- constructor(inner) {
2732
- super('ServiceConnectivityError', 'Status');
2733
- this.inner = Object.freeze(inner);
2734
- }
2735
- static new(inner) {
2736
- return new Status_(inner);
2737
- }
2738
- static instanceOf(obj) {
2739
- return obj.tag === ServiceConnectivityError_Tags.Status;
2740
- }
2741
- static hasInner(obj) {
2742
- return Status_.instanceOf(obj);
2743
- }
2744
- static getInner(obj) {
2745
- return obj.inner;
2746
- }
2747
- }
2748
- class Timeout_ extends UniffiError {
2749
- /**
2750
- * @private
2751
- * This field is private and should not be used, use `tag` instead.
2752
- */
2753
- [uniffiTypeNameSymbol] = 'ServiceConnectivityError';
2754
- tag = ServiceConnectivityError_Tags.Timeout;
2755
- constructor(v0) {
2756
- super('ServiceConnectivityError', 'Timeout');
2757
- this.inner = Object.freeze([v0]);
2758
- }
2759
- static new(v0) {
2760
- return new Timeout_(v0);
2761
- }
2762
- static instanceOf(obj) {
2763
- return obj.tag === ServiceConnectivityError_Tags.Timeout;
2764
- }
2765
- static hasInner(obj) {
2766
- return Timeout_.instanceOf(obj);
2767
- }
2768
- static getInner(obj) {
2769
- return obj.inner;
2770
- }
2771
- }
2772
- class Request_ extends UniffiError {
2773
- /**
2774
- * @private
2775
- * This field is private and should not be used, use `tag` instead.
2776
- */
2777
- [uniffiTypeNameSymbol] = 'ServiceConnectivityError';
2778
- tag = ServiceConnectivityError_Tags.Request;
2779
- constructor(v0) {
2780
- super('ServiceConnectivityError', 'Request');
2781
- this.inner = Object.freeze([v0]);
2782
- }
2783
- static new(v0) {
2784
- return new Request_(v0);
2785
- }
2786
- static instanceOf(obj) {
2787
- return obj.tag === ServiceConnectivityError_Tags.Request;
2788
- }
2789
- static hasInner(obj) {
2790
- return Request_.instanceOf(obj);
2791
- }
2792
- static getInner(obj) {
2793
- return obj.inner;
2794
- }
2795
- }
2796
- class Connect_ extends UniffiError {
2797
- /**
2798
- * @private
2799
- * This field is private and should not be used, use `tag` instead.
2800
- */
2801
- [uniffiTypeNameSymbol] = 'ServiceConnectivityError';
2802
- tag = ServiceConnectivityError_Tags.Connect;
2803
- constructor(v0) {
2804
- super('ServiceConnectivityError', 'Connect');
2805
- this.inner = Object.freeze([v0]);
2806
- }
2807
- static new(v0) {
2808
- return new Connect_(v0);
2809
- }
2810
- static instanceOf(obj) {
2811
- return obj.tag === ServiceConnectivityError_Tags.Connect;
2812
- }
2813
- static hasInner(obj) {
2814
- return Connect_.instanceOf(obj);
2815
- }
2816
- static getInner(obj) {
2817
- return obj.inner;
2818
- }
2819
- }
2820
- class Body_ extends UniffiError {
2821
- /**
2822
- * @private
2823
- * This field is private and should not be used, use `tag` instead.
2824
- */
2825
- [uniffiTypeNameSymbol] = 'ServiceConnectivityError';
2826
- tag = ServiceConnectivityError_Tags.Body;
2827
- constructor(v0) {
2828
- super('ServiceConnectivityError', 'Body');
2829
- this.inner = Object.freeze([v0]);
2830
- }
2831
- static new(v0) {
2832
- return new Body_(v0);
2833
- }
2834
- static instanceOf(obj) {
2835
- return obj.tag === ServiceConnectivityError_Tags.Body;
2836
- }
2837
- static hasInner(obj) {
2838
- return Body_.instanceOf(obj);
2839
- }
2840
- static getInner(obj) {
2841
- return obj.inner;
2842
- }
2843
- }
2844
- class Decode_ extends UniffiError {
2845
- /**
2846
- * @private
2847
- * This field is private and should not be used, use `tag` instead.
2848
- */
2849
- [uniffiTypeNameSymbol] = 'ServiceConnectivityError';
2850
- tag = ServiceConnectivityError_Tags.Decode;
2851
- constructor(v0) {
2852
- super('ServiceConnectivityError', 'Decode');
2853
- this.inner = Object.freeze([v0]);
2854
- }
2855
- static new(v0) {
2856
- return new Decode_(v0);
2857
- }
2858
- static instanceOf(obj) {
2859
- return obj.tag === ServiceConnectivityError_Tags.Decode;
2860
- }
2861
- static hasInner(obj) {
2862
- return Decode_.instanceOf(obj);
2863
- }
2864
- static getInner(obj) {
2865
- return obj.inner;
2866
- }
2867
- }
2868
- class Json_ extends UniffiError {
2869
- /**
2870
- * @private
2871
- * This field is private and should not be used, use `tag` instead.
2872
- */
2873
- [uniffiTypeNameSymbol] = 'ServiceConnectivityError';
2874
- tag = ServiceConnectivityError_Tags.Json;
2875
- constructor(v0) {
2876
- super('ServiceConnectivityError', 'Json');
2877
- this.inner = Object.freeze([v0]);
2878
- }
2879
- static new(v0) {
2880
- return new Json_(v0);
2881
- }
2882
- static instanceOf(obj) {
2883
- return obj.tag === ServiceConnectivityError_Tags.Json;
2884
- }
2885
- static hasInner(obj) {
2886
- return Json_.instanceOf(obj);
2887
- }
2888
- static getInner(obj) {
2889
- return obj.inner;
2890
- }
2891
- }
2892
- class Other_ extends UniffiError {
2893
- /**
2894
- * @private
2895
- * This field is private and should not be used, use `tag` instead.
2896
- */
2897
- [uniffiTypeNameSymbol] = 'ServiceConnectivityError';
2898
- tag = ServiceConnectivityError_Tags.Other;
2899
- constructor(v0) {
2900
- super('ServiceConnectivityError', 'Other');
2901
- this.inner = Object.freeze([v0]);
2902
- }
2903
- static new(v0) {
2904
- return new Other_(v0);
2905
- }
2906
- static instanceOf(obj) {
2907
- return obj.tag === ServiceConnectivityError_Tags.Other;
2908
- }
2909
- static hasInner(obj) {
2910
- return Other_.instanceOf(obj);
2911
- }
2912
- static getInner(obj) {
2913
- return obj.inner;
2914
- }
2915
- }
2916
- function instanceOf(obj) {
2917
- return obj[uniffiTypeNameSymbol] === 'ServiceConnectivityError';
2918
- }
2919
- return Object.freeze({
2920
- instanceOf,
2921
- Builder: Builder_,
2922
- Redirect: Redirect_,
2923
- Status: Status_,
2924
- Timeout: Timeout_,
2925
- Request: Request_,
2926
- Connect: Connect_,
2927
- Body: Body_,
2928
- Decode: Decode_,
2929
- Json: Json_,
2930
- Other: Other_
2931
- });
2932
- })();
2933
- // FfiConverter for enum ServiceConnectivityError
2934
- const FfiConverterTypeServiceConnectivityError = (() => {
2935
- const ordinalConverter = FfiConverterInt32;
2936
- class FFIConverter extends AbstractFfiConverterByteArray {
2937
- read(from) {
2938
- switch (ordinalConverter.read(from)) {
2939
- case 1:
2940
- return new ServiceConnectivityError.Builder(FfiConverterString.read(from));
2941
- case 2:
2942
- return new ServiceConnectivityError.Redirect(FfiConverterString.read(from));
2943
- case 3:
2944
- return new ServiceConnectivityError.Status({
2945
- status: FfiConverterUInt16.read(from),
2946
- body: FfiConverterString.read(from)
2947
- });
2948
- case 4:
2949
- return new ServiceConnectivityError.Timeout(FfiConverterString.read(from));
2950
- case 5:
2951
- return new ServiceConnectivityError.Request(FfiConverterString.read(from));
2952
- case 6:
2953
- return new ServiceConnectivityError.Connect(FfiConverterString.read(from));
2954
- case 7:
2955
- return new ServiceConnectivityError.Body(FfiConverterString.read(from));
2956
- case 8:
2957
- return new ServiceConnectivityError.Decode(FfiConverterString.read(from));
2958
- case 9:
2959
- return new ServiceConnectivityError.Json(FfiConverterString.read(from));
2960
- case 10:
2961
- return new ServiceConnectivityError.Other(FfiConverterString.read(from));
2962
- default:
2963
- throw new UniffiInternalError.UnexpectedEnumCase();
2964
- }
2965
- }
2966
- write(value, into) {
2967
- switch (value.tag) {
2968
- case ServiceConnectivityError_Tags.Builder:
2969
- {
2970
- ordinalConverter.write(1, into);
2971
- const inner = value.inner;
2972
- FfiConverterString.write(inner[0], into);
2973
- return;
2974
- }
2975
- case ServiceConnectivityError_Tags.Redirect:
2976
- {
2977
- ordinalConverter.write(2, into);
2978
- const inner = value.inner;
2979
- FfiConverterString.write(inner[0], into);
2980
- return;
2981
- }
2982
- case ServiceConnectivityError_Tags.Status:
2983
- {
2984
- ordinalConverter.write(3, into);
2985
- const inner = value.inner;
2986
- FfiConverterUInt16.write(inner.status, into);
2987
- FfiConverterString.write(inner.body, into);
2988
- return;
2989
- }
2990
- case ServiceConnectivityError_Tags.Timeout:
2991
- {
2992
- ordinalConverter.write(4, into);
2993
- const inner = value.inner;
2994
- FfiConverterString.write(inner[0], into);
2995
- return;
2996
- }
2997
- case ServiceConnectivityError_Tags.Request:
2998
- {
2999
- ordinalConverter.write(5, into);
3000
- const inner = value.inner;
3001
- FfiConverterString.write(inner[0], into);
3002
- return;
3003
- }
3004
- case ServiceConnectivityError_Tags.Connect:
3005
- {
3006
- ordinalConverter.write(6, into);
3007
- const inner = value.inner;
3008
- FfiConverterString.write(inner[0], into);
3009
- return;
3010
- }
3011
- case ServiceConnectivityError_Tags.Body:
3012
- {
3013
- ordinalConverter.write(7, into);
3014
- const inner = value.inner;
3015
- FfiConverterString.write(inner[0], into);
3016
- return;
3017
- }
3018
- case ServiceConnectivityError_Tags.Decode:
3019
- {
3020
- ordinalConverter.write(8, into);
3021
- const inner = value.inner;
3022
- FfiConverterString.write(inner[0], into);
3023
- return;
3024
- }
3025
- case ServiceConnectivityError_Tags.Json:
3026
- {
3027
- ordinalConverter.write(9, into);
3028
- const inner = value.inner;
3029
- FfiConverterString.write(inner[0], into);
3030
- return;
3031
- }
3032
- case ServiceConnectivityError_Tags.Other:
3033
- {
3034
- ordinalConverter.write(10, into);
3035
- const inner = value.inner;
3036
- FfiConverterString.write(inner[0], into);
3037
- return;
3038
- }
3039
- default:
3040
- // Throwing from here means that ServiceConnectivityError_Tags hasn't matched an ordinal.
3041
- throw new UniffiInternalError.UnexpectedEnumCase();
3042
- }
3043
- }
3044
- allocationSize(value) {
3045
- switch (value.tag) {
3046
- case ServiceConnectivityError_Tags.Builder:
3047
- {
3048
- const inner = value.inner;
3049
- let size = ordinalConverter.allocationSize(1);
3050
- size += FfiConverterString.allocationSize(inner[0]);
3051
- return size;
3052
- }
3053
- case ServiceConnectivityError_Tags.Redirect:
3054
- {
3055
- const inner = value.inner;
3056
- let size = ordinalConverter.allocationSize(2);
3057
- size += FfiConverterString.allocationSize(inner[0]);
3058
- return size;
3059
- }
3060
- case ServiceConnectivityError_Tags.Status:
3061
- {
3062
- const inner = value.inner;
3063
- let size = ordinalConverter.allocationSize(3);
3064
- size += FfiConverterUInt16.allocationSize(inner.status);
3065
- size += FfiConverterString.allocationSize(inner.body);
3066
- return size;
3067
- }
3068
- case ServiceConnectivityError_Tags.Timeout:
3069
- {
3070
- const inner = value.inner;
3071
- let size = ordinalConverter.allocationSize(4);
3072
- size += FfiConverterString.allocationSize(inner[0]);
3073
- return size;
3074
- }
3075
- case ServiceConnectivityError_Tags.Request:
3076
- {
3077
- const inner = value.inner;
3078
- let size = ordinalConverter.allocationSize(5);
3079
- size += FfiConverterString.allocationSize(inner[0]);
3080
- return size;
3081
- }
3082
- case ServiceConnectivityError_Tags.Connect:
3083
- {
3084
- const inner = value.inner;
3085
- let size = ordinalConverter.allocationSize(6);
3086
- size += FfiConverterString.allocationSize(inner[0]);
3087
- return size;
3088
- }
3089
- case ServiceConnectivityError_Tags.Body:
3090
- {
3091
- const inner = value.inner;
3092
- let size = ordinalConverter.allocationSize(7);
3093
- size += FfiConverterString.allocationSize(inner[0]);
3094
- return size;
3095
- }
3096
- case ServiceConnectivityError_Tags.Decode:
3097
- {
3098
- const inner = value.inner;
3099
- let size = ordinalConverter.allocationSize(8);
3100
- size += FfiConverterString.allocationSize(inner[0]);
3101
- return size;
3102
- }
3103
- case ServiceConnectivityError_Tags.Json:
3104
- {
3105
- const inner = value.inner;
3106
- let size = ordinalConverter.allocationSize(9);
3107
- size += FfiConverterString.allocationSize(inner[0]);
3108
- return size;
3109
- }
3110
- case ServiceConnectivityError_Tags.Other:
3111
- {
3112
- const inner = value.inner;
3113
- let size = ordinalConverter.allocationSize(10);
3114
- size += FfiConverterString.allocationSize(inner[0]);
3115
- return size;
3116
- }
3117
- default:
3118
- throw new UniffiInternalError.UnexpectedEnumCase();
3119
- }
3120
- }
3121
- }
3122
- return new FFIConverter();
3123
- })();
3124
-
3125
- // Enum: SuccessAction
3126
- export let SuccessAction_Tags = /*#__PURE__*/function (SuccessAction_Tags) {
3127
- SuccessAction_Tags["Aes"] = "Aes";
3128
- SuccessAction_Tags["Message"] = "Message";
3129
- SuccessAction_Tags["Url"] = "Url";
3130
- return SuccessAction_Tags;
3131
- }({});
3132
- /**
3133
- * Supported success action types
3134
- *
3135
- * Receiving any other (unsupported) success action type will result in a failed parsing,
3136
- * which will abort the LNURL-pay workflow, as per LUD-09.
3137
- */
3138
- export const SuccessAction = (() => {
3139
- /**
3140
- * AES type, described in LUD-10
3141
- */
3142
- class Aes_ extends UniffiEnum {
3143
- /**
3144
- * @private
3145
- * This field is private and should not be used, use `tag` instead.
3146
- */
3147
- [uniffiTypeNameSymbol] = 'SuccessAction';
3148
- tag = SuccessAction_Tags.Aes;
3149
- constructor(inner) {
3150
- super('SuccessAction', 'Aes');
3151
- this.inner = Object.freeze(inner);
3152
- }
3153
- static new(inner) {
3154
- return new Aes_(inner);
3155
- }
3156
- static instanceOf(obj) {
3157
- return obj.tag === SuccessAction_Tags.Aes;
3158
- }
3159
- }
3160
- /**
3161
- * Message type, described in LUD-09
3162
- */
3163
- class Message_ extends UniffiEnum {
3164
- /**
3165
- * @private
3166
- * This field is private and should not be used, use `tag` instead.
3167
- */
3168
- [uniffiTypeNameSymbol] = 'SuccessAction';
3169
- tag = SuccessAction_Tags.Message;
3170
- constructor(inner) {
3171
- super('SuccessAction', 'Message');
3172
- this.inner = Object.freeze(inner);
3173
- }
3174
- static new(inner) {
3175
- return new Message_(inner);
3176
- }
3177
- static instanceOf(obj) {
3178
- return obj.tag === SuccessAction_Tags.Message;
3179
- }
3180
- }
3181
- /**
3182
- * URL type, described in LUD-09
3183
- */
3184
- class Url_ extends UniffiEnum {
3185
- /**
3186
- * @private
3187
- * This field is private and should not be used, use `tag` instead.
3188
- */
3189
- [uniffiTypeNameSymbol] = 'SuccessAction';
3190
- tag = SuccessAction_Tags.Url;
3191
- constructor(inner) {
3192
- super('SuccessAction', 'Url');
3193
- this.inner = Object.freeze(inner);
3194
- }
3195
- static new(inner) {
3196
- return new Url_(inner);
3197
- }
3198
- static instanceOf(obj) {
3199
- return obj.tag === SuccessAction_Tags.Url;
3200
- }
3201
- }
3202
- function instanceOf(obj) {
3203
- return obj[uniffiTypeNameSymbol] === 'SuccessAction';
3204
- }
3205
- return Object.freeze({
3206
- instanceOf,
3207
- Aes: Aes_,
3208
- Message: Message_,
3209
- Url: Url_
3210
- });
3211
- })();
3212
-
3213
- /**
3214
- * Supported success action types
3215
- *
3216
- * Receiving any other (unsupported) success action type will result in a failed parsing,
3217
- * which will abort the LNURL-pay workflow, as per LUD-09.
3218
- */
3219
-
3220
- // FfiConverter for enum SuccessAction
3221
- const FfiConverterTypeSuccessAction = (() => {
3222
- const ordinalConverter = FfiConverterInt32;
3223
- class FFIConverter extends AbstractFfiConverterByteArray {
3224
- read(from) {
3225
- switch (ordinalConverter.read(from)) {
3226
- case 1:
3227
- return new SuccessAction.Aes({
3228
- data: FfiConverterTypeAesSuccessActionData.read(from)
3229
- });
3230
- case 2:
3231
- return new SuccessAction.Message({
3232
- data: FfiConverterTypeMessageSuccessActionData.read(from)
3233
- });
3234
- case 3:
3235
- return new SuccessAction.Url({
3236
- data: FfiConverterTypeUrlSuccessActionData.read(from)
3237
- });
3238
- default:
3239
- throw new UniffiInternalError.UnexpectedEnumCase();
3240
- }
3241
- }
3242
- write(value, into) {
3243
- switch (value.tag) {
3244
- case SuccessAction_Tags.Aes:
3245
- {
3246
- ordinalConverter.write(1, into);
3247
- const inner = value.inner;
3248
- FfiConverterTypeAesSuccessActionData.write(inner.data, into);
3249
- return;
3250
- }
3251
- case SuccessAction_Tags.Message:
3252
- {
3253
- ordinalConverter.write(2, into);
3254
- const inner = value.inner;
3255
- FfiConverterTypeMessageSuccessActionData.write(inner.data, into);
3256
- return;
3257
- }
3258
- case SuccessAction_Tags.Url:
3259
- {
3260
- ordinalConverter.write(3, into);
3261
- const inner = value.inner;
3262
- FfiConverterTypeUrlSuccessActionData.write(inner.data, into);
3263
- return;
3264
- }
3265
- default:
3266
- // Throwing from here means that SuccessAction_Tags hasn't matched an ordinal.
3267
- throw new UniffiInternalError.UnexpectedEnumCase();
3268
- }
3269
- }
3270
- allocationSize(value) {
3271
- switch (value.tag) {
3272
- case SuccessAction_Tags.Aes:
3273
- {
3274
- const inner = value.inner;
3275
- let size = ordinalConverter.allocationSize(1);
3276
- size += FfiConverterTypeAesSuccessActionData.allocationSize(inner.data);
3277
- return size;
3278
- }
3279
- case SuccessAction_Tags.Message:
3280
- {
3281
- const inner = value.inner;
3282
- let size = ordinalConverter.allocationSize(2);
3283
- size += FfiConverterTypeMessageSuccessActionData.allocationSize(inner.data);
3284
- return size;
3285
- }
3286
- case SuccessAction_Tags.Url:
3287
- {
3288
- const inner = value.inner;
3289
- let size = ordinalConverter.allocationSize(3);
3290
- size += FfiConverterTypeUrlSuccessActionData.allocationSize(inner.data);
3291
- return size;
3292
- }
3293
- default:
3294
- throw new UniffiInternalError.UnexpectedEnumCase();
3295
- }
3296
- }
3297
- }
3298
- return new FFIConverter();
3299
- })();
3300
-
3301
- // Enum: SuccessActionProcessed
3302
- export let SuccessActionProcessed_Tags = /*#__PURE__*/function (SuccessActionProcessed_Tags) {
3303
- SuccessActionProcessed_Tags["Aes"] = "Aes";
3304
- SuccessActionProcessed_Tags["Message"] = "Message";
3305
- SuccessActionProcessed_Tags["Url"] = "Url";
3306
- return SuccessActionProcessed_Tags;
3307
- }({});
3308
- /**
3309
- * [`SuccessAction`] where contents are ready to be consumed by the caller
3310
- *
3311
- * Contents are identical to [`SuccessAction`], except for AES where the ciphertext is decrypted.
3312
- */
3313
- export const SuccessActionProcessed = (() => {
3314
- /**
3315
- * See [`SuccessAction::Aes`] for received payload
3316
- *
3317
- * See [`AesSuccessActionDataDecrypted`] for decrypted payload
3318
- */
3319
- class Aes_ extends UniffiEnum {
3320
- /**
3321
- * @private
3322
- * This field is private and should not be used, use `tag` instead.
3323
- */
3324
- [uniffiTypeNameSymbol] = 'SuccessActionProcessed';
3325
- tag = SuccessActionProcessed_Tags.Aes;
3326
- constructor(inner) {
3327
- super('SuccessActionProcessed', 'Aes');
3328
- this.inner = Object.freeze(inner);
3329
- }
3330
- static new(inner) {
3331
- return new Aes_(inner);
3332
- }
3333
- static instanceOf(obj) {
3334
- return obj.tag === SuccessActionProcessed_Tags.Aes;
3335
- }
3336
- }
3337
- /**
3338
- * See [`SuccessAction::Message`]
3339
- */
3340
- class Message_ extends UniffiEnum {
3341
- /**
3342
- * @private
3343
- * This field is private and should not be used, use `tag` instead.
3344
- */
3345
- [uniffiTypeNameSymbol] = 'SuccessActionProcessed';
3346
- tag = SuccessActionProcessed_Tags.Message;
3347
- constructor(inner) {
3348
- super('SuccessActionProcessed', 'Message');
3349
- this.inner = Object.freeze(inner);
3350
- }
3351
- static new(inner) {
3352
- return new Message_(inner);
3353
- }
3354
- static instanceOf(obj) {
3355
- return obj.tag === SuccessActionProcessed_Tags.Message;
3356
- }
3357
- }
3358
- /**
3359
- * See [`SuccessAction::Url`]
3360
- */
3361
- class Url_ extends UniffiEnum {
3362
- /**
3363
- * @private
3364
- * This field is private and should not be used, use `tag` instead.
3365
- */
3366
- [uniffiTypeNameSymbol] = 'SuccessActionProcessed';
3367
- tag = SuccessActionProcessed_Tags.Url;
3368
- constructor(inner) {
3369
- super('SuccessActionProcessed', 'Url');
3370
- this.inner = Object.freeze(inner);
3371
- }
3372
- static new(inner) {
3373
- return new Url_(inner);
3374
- }
3375
- static instanceOf(obj) {
3376
- return obj.tag === SuccessActionProcessed_Tags.Url;
3377
- }
3378
- }
3379
- function instanceOf(obj) {
3380
- return obj[uniffiTypeNameSymbol] === 'SuccessActionProcessed';
3381
- }
3382
- return Object.freeze({
3383
- instanceOf,
3384
- Aes: Aes_,
3385
- Message: Message_,
3386
- Url: Url_
3387
- });
3388
- })();
3389
-
3390
- /**
3391
- * [`SuccessAction`] where contents are ready to be consumed by the caller
3392
- *
3393
- * Contents are identical to [`SuccessAction`], except for AES where the ciphertext is decrypted.
3394
- */
3395
-
3396
- // FfiConverter for enum SuccessActionProcessed
3397
- const FfiConverterTypeSuccessActionProcessed = (() => {
3398
- const ordinalConverter = FfiConverterInt32;
3399
- class FFIConverter extends AbstractFfiConverterByteArray {
3400
- read(from) {
3401
- switch (ordinalConverter.read(from)) {
3402
- case 1:
3403
- return new SuccessActionProcessed.Aes({
3404
- result: FfiConverterTypeAesSuccessActionDataResult.read(from)
3405
- });
3406
- case 2:
3407
- return new SuccessActionProcessed.Message({
3408
- data: FfiConverterTypeMessageSuccessActionData.read(from)
3409
- });
3410
- case 3:
3411
- return new SuccessActionProcessed.Url({
3412
- data: FfiConverterTypeUrlSuccessActionData.read(from)
3413
- });
3414
- default:
3415
- throw new UniffiInternalError.UnexpectedEnumCase();
3416
- }
3417
- }
3418
- write(value, into) {
3419
- switch (value.tag) {
3420
- case SuccessActionProcessed_Tags.Aes:
3421
- {
3422
- ordinalConverter.write(1, into);
3423
- const inner = value.inner;
3424
- FfiConverterTypeAesSuccessActionDataResult.write(inner.result, into);
3425
- return;
3426
- }
3427
- case SuccessActionProcessed_Tags.Message:
3428
- {
3429
- ordinalConverter.write(2, into);
3430
- const inner = value.inner;
3431
- FfiConverterTypeMessageSuccessActionData.write(inner.data, into);
3432
- return;
3433
- }
3434
- case SuccessActionProcessed_Tags.Url:
3435
- {
3436
- ordinalConverter.write(3, into);
3437
- const inner = value.inner;
3438
- FfiConverterTypeUrlSuccessActionData.write(inner.data, into);
3439
- return;
3440
- }
3441
- default:
3442
- // Throwing from here means that SuccessActionProcessed_Tags hasn't matched an ordinal.
3443
- throw new UniffiInternalError.UnexpectedEnumCase();
3444
- }
3445
- }
3446
- allocationSize(value) {
3447
- switch (value.tag) {
3448
- case SuccessActionProcessed_Tags.Aes:
3449
- {
3450
- const inner = value.inner;
3451
- let size = ordinalConverter.allocationSize(1);
3452
- size += FfiConverterTypeAesSuccessActionDataResult.allocationSize(inner.result);
3453
- return size;
3454
- }
3455
- case SuccessActionProcessed_Tags.Message:
3456
- {
3457
- const inner = value.inner;
3458
- let size = ordinalConverter.allocationSize(2);
3459
- size += FfiConverterTypeMessageSuccessActionData.allocationSize(inner.data);
3460
- return size;
3461
- }
3462
- case SuccessActionProcessed_Tags.Url:
3463
- {
3464
- const inner = value.inner;
3465
- let size = ordinalConverter.allocationSize(3);
3466
- size += FfiConverterTypeUrlSuccessActionData.allocationSize(inner.data);
3467
- return size;
3468
- }
3469
- default:
3470
- throw new UniffiInternalError.UnexpectedEnumCase();
3471
- }
3472
- }
3473
- }
3474
- return new FFIConverter();
3475
- })();
3476
-
3477
- // FfiConverter for Map<string, string>
3478
- const FfiConverterMapStringString = new FfiConverterMap(FfiConverterString, FfiConverterString);
3479
-
3480
- /**
3481
- * Trait covering fiat-related functionality
3482
- */
3483
-
3484
- /**
3485
- * Trait covering fiat-related functionality
3486
- */
3487
- export class FiatServiceImpl extends UniffiAbstractObject {
3488
- [uniffiTypeNameSymbol] = 'FiatServiceImpl';
3489
- // No primary constructor declared for this class.
3490
- constructor(pointer) {
3491
- super();
3492
- this[pointerLiteralSymbol] = pointer;
3493
- this[destructorGuardSymbol] = uniffiTypeFiatServiceImplObjectFactory.bless(pointer);
3494
- }
3495
-
3496
- /**
3497
- * List all supported fiat currencies for which there is a known exchange rate.
3498
- */
3499
- async fetchFiatCurrencies(asyncOpts_) /*throws*/{
3500
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
3501
- try {
3502
- return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
3503
- return nativeModule().ubrn_uniffi_breez_sdk_common_fn_method_fiatservice_fetch_fiat_currencies(uniffiTypeFiatServiceImplObjectFactory.clonePointer(this));
3504
- }, /*pollFunc:*/nativeModule().ubrn_ffi_breez_sdk_common_rust_future_poll_rust_buffer, /*cancelFunc:*/nativeModule().ubrn_ffi_breez_sdk_common_rust_future_cancel_rust_buffer, /*completeFunc:*/nativeModule().ubrn_ffi_breez_sdk_common_rust_future_complete_rust_buffer, /*freeFunc:*/nativeModule().ubrn_ffi_breez_sdk_common_rust_future_free_rust_buffer, /*liftFunc:*/FfiConverterArrayTypeFiatCurrency.lift.bind(FfiConverterArrayTypeFiatCurrency), /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeServiceConnectivityError.lift.bind(FfiConverterTypeServiceConnectivityError));
3505
- } catch (__error) {
3506
- if (uniffiIsDebug && __error instanceof Error) {
3507
- __error.stack = __stack;
3508
- }
3509
- throw __error;
3510
- }
3511
- }
3512
-
3513
- /**
3514
- * Get the live rates from the server.
3515
- */
3516
- async fetchFiatRates(asyncOpts_) /*throws*/{
3517
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
3518
- try {
3519
- return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
3520
- return nativeModule().ubrn_uniffi_breez_sdk_common_fn_method_fiatservice_fetch_fiat_rates(uniffiTypeFiatServiceImplObjectFactory.clonePointer(this));
3521
- }, /*pollFunc:*/nativeModule().ubrn_ffi_breez_sdk_common_rust_future_poll_rust_buffer, /*cancelFunc:*/nativeModule().ubrn_ffi_breez_sdk_common_rust_future_cancel_rust_buffer, /*completeFunc:*/nativeModule().ubrn_ffi_breez_sdk_common_rust_future_complete_rust_buffer, /*freeFunc:*/nativeModule().ubrn_ffi_breez_sdk_common_rust_future_free_rust_buffer, /*liftFunc:*/FfiConverterArrayTypeRate.lift.bind(FfiConverterArrayTypeRate), /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeServiceConnectivityError.lift.bind(FfiConverterTypeServiceConnectivityError));
3522
- } catch (__error) {
3523
- if (uniffiIsDebug && __error instanceof Error) {
3524
- __error.stack = __stack;
3525
- }
3526
- throw __error;
3527
- }
3528
- }
3529
-
3530
- /**
3531
- * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
3532
- */
3533
- uniffiDestroy() {
3534
- const ptr = this[destructorGuardSymbol];
3535
- if (ptr !== undefined) {
3536
- const pointer = uniffiTypeFiatServiceImplObjectFactory.pointer(this);
3537
- uniffiTypeFiatServiceImplObjectFactory.freePointer(pointer);
3538
- uniffiTypeFiatServiceImplObjectFactory.unbless(ptr);
3539
- delete this[destructorGuardSymbol];
3540
- }
3541
- }
3542
- static instanceOf(obj) {
3543
- return uniffiTypeFiatServiceImplObjectFactory.isConcreteType(obj);
3544
- }
3545
- }
3546
- const uniffiTypeFiatServiceImplObjectFactory = {
3547
- create(pointer) {
3548
- const instance = Object.create(FiatServiceImpl.prototype);
3549
- instance[pointerLiteralSymbol] = pointer;
3550
- instance[destructorGuardSymbol] = this.bless(pointer);
3551
- instance[uniffiTypeNameSymbol] = 'FiatServiceImpl';
3552
- return instance;
3553
- },
3554
- bless(p) {
3555
- return uniffiCaller.rustCall(/*caller:*/status => nativeModule().ubrn_uniffi_internal_fn_method_fiatservice_ffi__bless_pointer(p, status), /*liftString:*/FfiConverterString.lift);
3556
- },
3557
- unbless(ptr) {
3558
- ptr.markDestroyed();
3559
- },
3560
- pointer(obj) {
3561
- if (obj[destructorGuardSymbol] === undefined) {
3562
- throw new UniffiInternalError.UnexpectedNullPointer();
3563
- }
3564
- return obj[pointerLiteralSymbol];
3565
- },
3566
- clonePointer(obj) {
3567
- const pointer = this.pointer(obj);
3568
- return uniffiCaller.rustCall(/*caller:*/callStatus => nativeModule().ubrn_uniffi_breez_sdk_common_fn_clone_fiatservice(pointer, callStatus), /*liftString:*/FfiConverterString.lift);
3569
- },
3570
- freePointer(pointer) {
3571
- uniffiCaller.rustCall(/*caller:*/callStatus => nativeModule().ubrn_uniffi_breez_sdk_common_fn_free_fiatservice(pointer, callStatus), /*liftString:*/FfiConverterString.lift);
3572
- },
3573
- isConcreteType(obj) {
3574
- return obj[destructorGuardSymbol] && obj[uniffiTypeNameSymbol] === 'FiatServiceImpl';
3575
- }
3576
- };
3577
- // FfiConverter for FiatService
3578
- const FfiConverterTypeFiatService = new FfiConverterObjectWithCallbacks(uniffiTypeFiatServiceImplObjectFactory);
3579
-
3580
- // Add a vtavble for the callbacks that go in FiatService.
3581
-
3582
- // Put the implementation in a struct so we don't pollute the top-level namespace
3583
- const uniffiCallbackInterfaceFiatService = {
3584
- // Create the VTable using a series of closures.
3585
- // ts automatically converts these into C callback functions.
3586
- vtable: {
3587
- fetchFiatCurrencies: (uniffiHandle, uniffiFutureCallback, uniffiCallbackData) => {
3588
- const uniffiMakeCall = async signal => {
3589
- const jsCallback = FfiConverterTypeFiatService.lift(uniffiHandle);
3590
- return await jsCallback.fetchFiatCurrencies({
3591
- signal
3592
- });
3593
- };
3594
- const uniffiHandleSuccess = returnValue => {
3595
- uniffiFutureCallback(uniffiCallbackData, /* UniffiForeignFutureStructRustBuffer */{
3596
- returnValue: FfiConverterArrayTypeFiatCurrency.lower(returnValue),
3597
- callStatus: uniffiCaller.createCallStatus()
3598
- });
3599
- };
3600
- const uniffiHandleError = (code, errorBuf) => {
3601
- uniffiFutureCallback(uniffiCallbackData, /* UniffiForeignFutureStructRustBuffer */{
3602
- returnValue: /*empty*/new Uint8Array(0),
3603
- // TODO create callstatus with error.
3604
- callStatus: {
3605
- code,
3606
- errorBuf
3607
- }
3608
- });
3609
- };
3610
- const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(/*makeCall:*/uniffiMakeCall, /*handleSuccess:*/uniffiHandleSuccess, /*handleError:*/uniffiHandleError, /*isErrorType:*/ServiceConnectivityError.instanceOf, /*lowerError:*/FfiConverterTypeServiceConnectivityError.lower.bind(FfiConverterTypeServiceConnectivityError), /*lowerString:*/FfiConverterString.lower);
3611
- return UniffiResult.success(uniffiForeignFuture);
3612
- },
3613
- fetchFiatRates: (uniffiHandle, uniffiFutureCallback, uniffiCallbackData) => {
3614
- const uniffiMakeCall = async signal => {
3615
- const jsCallback = FfiConverterTypeFiatService.lift(uniffiHandle);
3616
- return await jsCallback.fetchFiatRates({
3617
- signal
3618
- });
3619
- };
3620
- const uniffiHandleSuccess = returnValue => {
3621
- uniffiFutureCallback(uniffiCallbackData, /* UniffiForeignFutureStructRustBuffer */{
3622
- returnValue: FfiConverterArrayTypeRate.lower(returnValue),
3623
- callStatus: uniffiCaller.createCallStatus()
3624
- });
3625
- };
3626
- const uniffiHandleError = (code, errorBuf) => {
3627
- uniffiFutureCallback(uniffiCallbackData, /* UniffiForeignFutureStructRustBuffer */{
3628
- returnValue: /*empty*/new Uint8Array(0),
3629
- // TODO create callstatus with error.
3630
- callStatus: {
3631
- code,
3632
- errorBuf
3633
- }
3634
- });
3635
- };
3636
- const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(/*makeCall:*/uniffiMakeCall, /*handleSuccess:*/uniffiHandleSuccess, /*handleError:*/uniffiHandleError, /*isErrorType:*/ServiceConnectivityError.instanceOf, /*lowerError:*/FfiConverterTypeServiceConnectivityError.lower.bind(FfiConverterTypeServiceConnectivityError), /*lowerString:*/FfiConverterString.lower);
3637
- return UniffiResult.success(uniffiForeignFuture);
3638
- },
3639
- uniffiFree: uniffiHandle => {
3640
- // FiatService: this will throw a stale handle error if the handle isn't found.
3641
- FfiConverterTypeFiatService.drop(uniffiHandle);
3642
- }
3643
- },
3644
- register: () => {
3645
- nativeModule().ubrn_uniffi_breez_sdk_common_fn_init_callback_vtable_fiatservice(uniffiCallbackInterfaceFiatService.vtable);
3646
- }
3647
- };
3648
- export class RestClientImpl extends UniffiAbstractObject {
3649
- [uniffiTypeNameSymbol] = 'RestClientImpl';
3650
- // No primary constructor declared for this class.
3651
- constructor(pointer) {
3652
- super();
3653
- this[pointerLiteralSymbol] = pointer;
3654
- this[destructorGuardSymbol] = uniffiTypeRestClientImplObjectFactory.bless(pointer);
3655
- }
3656
-
3657
- /**
3658
- * Makes a GET request and logs on DEBUG.
3659
- * ### Arguments
3660
- * - `url`: the URL on which GET will be called
3661
- * - `headers`: optional headers that will be set on the request
3662
- */
3663
- async getRequest(url, headers, asyncOpts_) /*throws*/{
3664
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
3665
- try {
3666
- return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
3667
- return nativeModule().ubrn_uniffi_breez_sdk_common_fn_method_restclient_get_request(uniffiTypeRestClientImplObjectFactory.clonePointer(this), FfiConverterString.lower(url), FfiConverterOptionalMapStringString.lower(headers));
3668
- }, /*pollFunc:*/nativeModule().ubrn_ffi_breez_sdk_common_rust_future_poll_rust_buffer, /*cancelFunc:*/nativeModule().ubrn_ffi_breez_sdk_common_rust_future_cancel_rust_buffer, /*completeFunc:*/nativeModule().ubrn_ffi_breez_sdk_common_rust_future_complete_rust_buffer, /*freeFunc:*/nativeModule().ubrn_ffi_breez_sdk_common_rust_future_free_rust_buffer, /*liftFunc:*/FfiConverterTypeRestResponse.lift.bind(FfiConverterTypeRestResponse), /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeServiceConnectivityError.lift.bind(FfiConverterTypeServiceConnectivityError));
3669
- } catch (__error) {
3670
- if (uniffiIsDebug && __error instanceof Error) {
3671
- __error.stack = __stack;
3672
- }
3673
- throw __error;
3674
- }
3675
- }
3676
-
3677
- /**
3678
- * Makes a POST request, and logs on DEBUG.
3679
- * ### Arguments
3680
- * - `url`: the URL on which POST will be called
3681
- * - `headers`: the optional POST headers
3682
- * - `body`: the optional POST body
3683
- */
3684
- async postRequest(url, headers, body, asyncOpts_) /*throws*/{
3685
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
3686
- try {
3687
- return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
3688
- return nativeModule().ubrn_uniffi_breez_sdk_common_fn_method_restclient_post_request(uniffiTypeRestClientImplObjectFactory.clonePointer(this), FfiConverterString.lower(url), FfiConverterOptionalMapStringString.lower(headers), FfiConverterOptionalString.lower(body));
3689
- }, /*pollFunc:*/nativeModule().ubrn_ffi_breez_sdk_common_rust_future_poll_rust_buffer, /*cancelFunc:*/nativeModule().ubrn_ffi_breez_sdk_common_rust_future_cancel_rust_buffer, /*completeFunc:*/nativeModule().ubrn_ffi_breez_sdk_common_rust_future_complete_rust_buffer, /*freeFunc:*/nativeModule().ubrn_ffi_breez_sdk_common_rust_future_free_rust_buffer, /*liftFunc:*/FfiConverterTypeRestResponse.lift.bind(FfiConverterTypeRestResponse), /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeServiceConnectivityError.lift.bind(FfiConverterTypeServiceConnectivityError));
3690
- } catch (__error) {
3691
- if (uniffiIsDebug && __error instanceof Error) {
3692
- __error.stack = __stack;
3693
- }
3694
- throw __error;
3695
- }
3696
- }
3697
-
3698
- /**
3699
- * Makes a DELETE request, and logs on DEBUG.
3700
- * ### Arguments
3701
- * - `url`: the URL on which DELETE will be called
3702
- * - `headers`: the optional DELETE headers
3703
- * - `body`: the optional DELETE body
3704
- */
3705
- async deleteRequest(url, headers, body, asyncOpts_) /*throws*/{
3706
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
3707
- try {
3708
- return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
3709
- return nativeModule().ubrn_uniffi_breez_sdk_common_fn_method_restclient_delete_request(uniffiTypeRestClientImplObjectFactory.clonePointer(this), FfiConverterString.lower(url), FfiConverterOptionalMapStringString.lower(headers), FfiConverterOptionalString.lower(body));
3710
- }, /*pollFunc:*/nativeModule().ubrn_ffi_breez_sdk_common_rust_future_poll_rust_buffer, /*cancelFunc:*/nativeModule().ubrn_ffi_breez_sdk_common_rust_future_cancel_rust_buffer, /*completeFunc:*/nativeModule().ubrn_ffi_breez_sdk_common_rust_future_complete_rust_buffer, /*freeFunc:*/nativeModule().ubrn_ffi_breez_sdk_common_rust_future_free_rust_buffer, /*liftFunc:*/FfiConverterTypeRestResponse.lift.bind(FfiConverterTypeRestResponse), /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeServiceConnectivityError.lift.bind(FfiConverterTypeServiceConnectivityError));
3711
- } catch (__error) {
3712
- if (uniffiIsDebug && __error instanceof Error) {
3713
- __error.stack = __stack;
3714
- }
3715
- throw __error;
3716
- }
3717
- }
3718
-
3719
- /**
3720
- * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
3721
- */
3722
- uniffiDestroy() {
3723
- const ptr = this[destructorGuardSymbol];
3724
- if (ptr !== undefined) {
3725
- const pointer = uniffiTypeRestClientImplObjectFactory.pointer(this);
3726
- uniffiTypeRestClientImplObjectFactory.freePointer(pointer);
3727
- uniffiTypeRestClientImplObjectFactory.unbless(ptr);
3728
- delete this[destructorGuardSymbol];
3729
- }
3730
- }
3731
- static instanceOf(obj) {
3732
- return uniffiTypeRestClientImplObjectFactory.isConcreteType(obj);
3733
- }
3734
- }
3735
- const uniffiTypeRestClientImplObjectFactory = {
3736
- create(pointer) {
3737
- const instance = Object.create(RestClientImpl.prototype);
3738
- instance[pointerLiteralSymbol] = pointer;
3739
- instance[destructorGuardSymbol] = this.bless(pointer);
3740
- instance[uniffiTypeNameSymbol] = 'RestClientImpl';
3741
- return instance;
3742
- },
3743
- bless(p) {
3744
- return uniffiCaller.rustCall(/*caller:*/status => nativeModule().ubrn_uniffi_internal_fn_method_restclient_ffi__bless_pointer(p, status), /*liftString:*/FfiConverterString.lift);
3745
- },
3746
- unbless(ptr) {
3747
- ptr.markDestroyed();
3748
- },
3749
- pointer(obj) {
3750
- if (obj[destructorGuardSymbol] === undefined) {
3751
- throw new UniffiInternalError.UnexpectedNullPointer();
3752
- }
3753
- return obj[pointerLiteralSymbol];
3754
- },
3755
- clonePointer(obj) {
3756
- const pointer = this.pointer(obj);
3757
- return uniffiCaller.rustCall(/*caller:*/callStatus => nativeModule().ubrn_uniffi_breez_sdk_common_fn_clone_restclient(pointer, callStatus), /*liftString:*/FfiConverterString.lift);
3758
- },
3759
- freePointer(pointer) {
3760
- uniffiCaller.rustCall(/*caller:*/callStatus => nativeModule().ubrn_uniffi_breez_sdk_common_fn_free_restclient(pointer, callStatus), /*liftString:*/FfiConverterString.lift);
3761
- },
3762
- isConcreteType(obj) {
3763
- return obj[destructorGuardSymbol] && obj[uniffiTypeNameSymbol] === 'RestClientImpl';
3764
- }
3765
- };
3766
- // FfiConverter for RestClient
3767
- const FfiConverterTypeRestClient = new FfiConverterObjectWithCallbacks(uniffiTypeRestClientImplObjectFactory);
3768
-
3769
- // Add a vtavble for the callbacks that go in RestClient.
3770
-
3771
- // Put the implementation in a struct so we don't pollute the top-level namespace
3772
- const uniffiCallbackInterfaceRestClient = {
3773
- // Create the VTable using a series of closures.
3774
- // ts automatically converts these into C callback functions.
3775
- vtable: {
3776
- getRequest: (uniffiHandle, url, headers, uniffiFutureCallback, uniffiCallbackData) => {
3777
- const uniffiMakeCall = async signal => {
3778
- const jsCallback = FfiConverterTypeRestClient.lift(uniffiHandle);
3779
- return await jsCallback.getRequest(FfiConverterString.lift(url), FfiConverterOptionalMapStringString.lift(headers), {
3780
- signal
3781
- });
3782
- };
3783
- const uniffiHandleSuccess = returnValue => {
3784
- uniffiFutureCallback(uniffiCallbackData, /* UniffiForeignFutureStructRustBuffer */{
3785
- returnValue: FfiConverterTypeRestResponse.lower(returnValue),
3786
- callStatus: uniffiCaller.createCallStatus()
3787
- });
3788
- };
3789
- const uniffiHandleError = (code, errorBuf) => {
3790
- uniffiFutureCallback(uniffiCallbackData, /* UniffiForeignFutureStructRustBuffer */{
3791
- returnValue: /*empty*/new Uint8Array(0),
3792
- // TODO create callstatus with error.
3793
- callStatus: {
3794
- code,
3795
- errorBuf
3796
- }
3797
- });
3798
- };
3799
- const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(/*makeCall:*/uniffiMakeCall, /*handleSuccess:*/uniffiHandleSuccess, /*handleError:*/uniffiHandleError, /*isErrorType:*/ServiceConnectivityError.instanceOf, /*lowerError:*/FfiConverterTypeServiceConnectivityError.lower.bind(FfiConverterTypeServiceConnectivityError), /*lowerString:*/FfiConverterString.lower);
3800
- return UniffiResult.success(uniffiForeignFuture);
3801
- },
3802
- postRequest: (uniffiHandle, url, headers, body, uniffiFutureCallback, uniffiCallbackData) => {
3803
- const uniffiMakeCall = async signal => {
3804
- const jsCallback = FfiConverterTypeRestClient.lift(uniffiHandle);
3805
- return await jsCallback.postRequest(FfiConverterString.lift(url), FfiConverterOptionalMapStringString.lift(headers), FfiConverterOptionalString.lift(body), {
3806
- signal
3807
- });
3808
- };
3809
- const uniffiHandleSuccess = returnValue => {
3810
- uniffiFutureCallback(uniffiCallbackData, /* UniffiForeignFutureStructRustBuffer */{
3811
- returnValue: FfiConverterTypeRestResponse.lower(returnValue),
3812
- callStatus: uniffiCaller.createCallStatus()
3813
- });
3814
- };
3815
- const uniffiHandleError = (code, errorBuf) => {
3816
- uniffiFutureCallback(uniffiCallbackData, /* UniffiForeignFutureStructRustBuffer */{
3817
- returnValue: /*empty*/new Uint8Array(0),
3818
- // TODO create callstatus with error.
3819
- callStatus: {
3820
- code,
3821
- errorBuf
3822
- }
3823
- });
3824
- };
3825
- const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(/*makeCall:*/uniffiMakeCall, /*handleSuccess:*/uniffiHandleSuccess, /*handleError:*/uniffiHandleError, /*isErrorType:*/ServiceConnectivityError.instanceOf, /*lowerError:*/FfiConverterTypeServiceConnectivityError.lower.bind(FfiConverterTypeServiceConnectivityError), /*lowerString:*/FfiConverterString.lower);
3826
- return UniffiResult.success(uniffiForeignFuture);
3827
- },
3828
- deleteRequest: (uniffiHandle, url, headers, body, uniffiFutureCallback, uniffiCallbackData) => {
3829
- const uniffiMakeCall = async signal => {
3830
- const jsCallback = FfiConverterTypeRestClient.lift(uniffiHandle);
3831
- return await jsCallback.deleteRequest(FfiConverterString.lift(url), FfiConverterOptionalMapStringString.lift(headers), FfiConverterOptionalString.lift(body), {
3832
- signal
3833
- });
3834
- };
3835
- const uniffiHandleSuccess = returnValue => {
3836
- uniffiFutureCallback(uniffiCallbackData, /* UniffiForeignFutureStructRustBuffer */{
3837
- returnValue: FfiConverterTypeRestResponse.lower(returnValue),
3838
- callStatus: uniffiCaller.createCallStatus()
3839
- });
3840
- };
3841
- const uniffiHandleError = (code, errorBuf) => {
3842
- uniffiFutureCallback(uniffiCallbackData, /* UniffiForeignFutureStructRustBuffer */{
3843
- returnValue: /*empty*/new Uint8Array(0),
3844
- // TODO create callstatus with error.
3845
- callStatus: {
3846
- code,
3847
- errorBuf
3848
- }
3849
- });
3850
- };
3851
- const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(/*makeCall:*/uniffiMakeCall, /*handleSuccess:*/uniffiHandleSuccess, /*handleError:*/uniffiHandleError, /*isErrorType:*/ServiceConnectivityError.instanceOf, /*lowerError:*/FfiConverterTypeServiceConnectivityError.lower.bind(FfiConverterTypeServiceConnectivityError), /*lowerString:*/FfiConverterString.lower);
3852
- return UniffiResult.success(uniffiForeignFuture);
3853
- },
3854
- uniffiFree: uniffiHandle => {
3855
- // RestClient: this will throw a stale handle error if the handle isn't found.
3856
- FfiConverterTypeRestClient.drop(uniffiHandle);
3857
- }
3858
- },
3859
- register: () => {
3860
- nativeModule().ubrn_uniffi_breez_sdk_common_fn_init_callback_vtable_restclient(uniffiCallbackInterfaceRestClient.vtable);
3861
- }
3862
- };
3863
-
3864
- // FfiConverter for boolean | undefined
3865
- const FfiConverterOptionalBool = new FfiConverterOptional(FfiConverterBool);
3866
-
3867
- // FfiConverter for Symbol | undefined
3868
- const FfiConverterOptionalTypeSymbol = new FfiConverterOptional(FfiConverterTypeSymbol);
3869
-
3870
- // FfiConverter for string | undefined
3871
- const FfiConverterOptionalString = new FfiConverterOptional(FfiConverterString);
3872
-
3873
- // FfiConverter for /*u32*/number | undefined
3874
- const FfiConverterOptionalUInt32 = new FfiConverterOptional(FfiConverterUInt32);
3875
-
3876
- // FfiConverter for /*u64*/bigint | undefined
3877
- const FfiConverterOptionalUInt64 = new FfiConverterOptional(FfiConverterUInt64);
3878
-
3879
- // FfiConverter for Array<Bip21Extra>
3880
- const FfiConverterArrayTypeBip21Extra = new FfiConverterArray(FfiConverterTypeBip21Extra);
3881
-
3882
- // FfiConverter for Array<Bolt11RouteHint>
3883
- const FfiConverterArrayTypeBolt11RouteHint = new FfiConverterArray(FfiConverterTypeBolt11RouteHint);
3884
-
3885
- // FfiConverter for Array<Bolt11RouteHintHop>
3886
- const FfiConverterArrayTypeBolt11RouteHintHop = new FfiConverterArray(FfiConverterTypeBolt11RouteHintHop);
3887
-
3888
- // FfiConverter for Array<Bolt12OfferBlindedPath>
3889
- const FfiConverterArrayTypeBolt12OfferBlindedPath = new FfiConverterArray(FfiConverterTypeBolt12OfferBlindedPath);
3890
-
3891
- // FfiConverter for Array<FiatCurrency>
3892
- const FfiConverterArrayTypeFiatCurrency = new FfiConverterArray(FfiConverterTypeFiatCurrency);
3893
-
3894
- // FfiConverter for Array<LocaleOverrides>
3895
- const FfiConverterArrayTypeLocaleOverrides = new FfiConverterArray(FfiConverterTypeLocaleOverrides);
3896
-
3897
- // FfiConverter for Array<LocalizedName>
3898
- const FfiConverterArrayTypeLocalizedName = new FfiConverterArray(FfiConverterTypeLocalizedName);
3899
-
3900
- // FfiConverter for Array<Rate>
3901
- const FfiConverterArrayTypeRate = new FfiConverterArray(FfiConverterTypeRate);
3902
-
3903
- // FfiConverter for Array<string>
3904
- const FfiConverterArrayString = new FfiConverterArray(FfiConverterString);
3905
-
3906
- // FfiConverter for CommonU128 | undefined
3907
- const FfiConverterOptionalTypecommon_u128 = new FfiConverterOptional(FfiConverterTypecommon_u128);
3908
-
3909
- // FfiConverter for Amount | undefined
3910
- const FfiConverterOptionalTypeAmount = new FfiConverterOptional(FfiConverterTypeAmount);
3911
-
3912
- // FfiConverter for Map<string, string> | undefined
3913
- const FfiConverterOptionalMapStringString = new FfiConverterOptional(FfiConverterMapStringString);
3914
-
3915
- // FfiConverter for Array<InputType>
3916
- const FfiConverterArrayTypeInputType = new FfiConverterArray(FfiConverterTypeInputType);
3917
-
3918
- /**
3919
- * This should be called before anything else.
3920
- *
3921
- * It is likely that this is being done for you by the library's `index.ts`.
3922
- *
3923
- * It checks versions of uniffi between when the Rust scaffolding was generated
3924
- * and when the bindings were generated.
3925
- *
3926
- * It also initializes the machinery to enable Rust to talk back to Javascript.
3927
- */
3928
- function uniffiEnsureInitialized() {
3929
- // Get the bindings contract version from our ComponentInterface
3930
- const bindingsContractVersion = 26;
3931
- // Get the scaffolding contract version by calling the into the dylib
3932
- const scaffoldingContractVersion = nativeModule().ubrn_ffi_breez_sdk_common_uniffi_contract_version();
3933
- if (bindingsContractVersion !== scaffoldingContractVersion) {
3934
- throw new UniffiInternalError.ContractVersionMismatch(scaffoldingContractVersion, bindingsContractVersion);
3935
- }
3936
- if (nativeModule().ubrn_uniffi_breez_sdk_common_checksum_method_fiatservice_fetch_fiat_currencies() !== 63089) {
3937
- throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_common_checksum_method_fiatservice_fetch_fiat_currencies');
3938
- }
3939
- if (nativeModule().ubrn_uniffi_breez_sdk_common_checksum_method_fiatservice_fetch_fiat_rates() !== 48636) {
3940
- throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_common_checksum_method_fiatservice_fetch_fiat_rates');
3941
- }
3942
- if (nativeModule().ubrn_uniffi_breez_sdk_common_checksum_method_restclient_get_request() !== 1702) {
3943
- throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_common_checksum_method_restclient_get_request');
3944
- }
3945
- if (nativeModule().ubrn_uniffi_breez_sdk_common_checksum_method_restclient_post_request() !== 38998) {
3946
- throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_common_checksum_method_restclient_post_request');
3947
- }
3948
- if (nativeModule().ubrn_uniffi_breez_sdk_common_checksum_method_restclient_delete_request() !== 26893) {
3949
- throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_common_checksum_method_restclient_delete_request');
3950
- }
3951
- uniffiCallbackInterfaceFiatService.register();
3952
- uniffiCallbackInterfaceRestClient.register();
3953
- }
3954
- export default Object.freeze({
3955
- initialize: uniffiEnsureInitialized,
3956
- converters: {
3957
- FfiConverterTypeAesSuccessActionData,
3958
- FfiConverterTypeAesSuccessActionDataDecrypted,
3959
- FfiConverterTypeAesSuccessActionDataResult,
3960
- FfiConverterTypeAmount,
3961
- FfiConverterTypeBip21Details,
3962
- FfiConverterTypeBip21Extra,
3963
- FfiConverterTypeBitcoinAddressDetails,
3964
- FfiConverterTypeBitcoinNetwork,
3965
- FfiConverterTypeBolt11Invoice,
3966
- FfiConverterTypeBolt11InvoiceDetails,
3967
- FfiConverterTypeBolt11RouteHint,
3968
- FfiConverterTypeBolt11RouteHintHop,
3969
- FfiConverterTypeBolt12Invoice,
3970
- FfiConverterTypeBolt12InvoiceDetails,
3971
- FfiConverterTypeBolt12InvoiceRequestDetails,
3972
- FfiConverterTypeBolt12Offer,
3973
- FfiConverterTypeBolt12OfferBlindedPath,
3974
- FfiConverterTypeBolt12OfferDetails,
3975
- FfiConverterTypeCurrencyInfo,
3976
- FfiConverterTypeExternalInputParser,
3977
- FfiConverterTypeFiatCurrency,
3978
- FfiConverterTypeFiatService,
3979
- FfiConverterTypeInputType,
3980
- FfiConverterTypeLightningAddressDetails,
3981
- FfiConverterTypeLnurlAuthRequestDetails,
3982
- FfiConverterTypeLnurlCallbackStatus,
3983
- FfiConverterTypeLnurlErrorDetails,
3984
- FfiConverterTypeLnurlPayRequestDetails,
3985
- FfiConverterTypeLnurlWithdrawRequestDetails,
3986
- FfiConverterTypeLocaleOverrides,
3987
- FfiConverterTypeLocalizedName,
3988
- FfiConverterTypeMessageSuccessActionData,
3989
- FfiConverterTypePaymentRequestSource,
3990
- FfiConverterTypeRate,
3991
- FfiConverterTypeRestClient,
3992
- FfiConverterTypeRestResponse,
3993
- FfiConverterTypeSilentPaymentAddressDetails,
3994
- FfiConverterTypeSparkAddressDetails,
3995
- FfiConverterTypeSparkInvoiceDetails,
3996
- FfiConverterTypeSuccessAction,
3997
- FfiConverterTypeSuccessActionProcessed,
3998
- FfiConverterTypeSymbol,
3999
- FfiConverterTypeUrlSuccessActionData,
4000
- FfiConverterTypecommon_u128
4001
- }
4002
- });
4003
- //# sourceMappingURL=breez_sdk_common.js.map