@breeztech/breez-sdk-spark-react-native 0.1.8-dev1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -0
- package/README.md +54 -0
- package/android/CMakeLists.txt +79 -0
- package/android/build.gradle +143 -0
- package/android/cpp-adapter.cpp +63 -0
- package/android/generated/android/app/build/generated/source/codegen/java/com/facebook/fbreact/specs/NativeBreezSdkSparkReactNativeSpec.java +41 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/BreezSdkSparkReactNativeSpec-generated.cpp +38 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/BreezSdkSparkReactNativeSpec.h +31 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/CMakeLists.txt +36 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/BreezSdkSparkReactNativeSpec/BreezSdkSparkReactNativeSpecJSI-generated.cpp +32 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/BreezSdkSparkReactNativeSpec/BreezSdkSparkReactNativeSpecJSI.h +80 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/BreezSdkSparkReactNativeSpec/ComponentDescriptors.cpp +22 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/BreezSdkSparkReactNativeSpec/ComponentDescriptors.h +24 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/BreezSdkSparkReactNativeSpec/EventEmitters.cpp +16 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/BreezSdkSparkReactNativeSpec/EventEmitters.h +17 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/BreezSdkSparkReactNativeSpec/Props.cpp +19 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/BreezSdkSparkReactNativeSpec/Props.h +18 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/BreezSdkSparkReactNativeSpec/ShadowNodes.cpp +17 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/BreezSdkSparkReactNativeSpec/ShadowNodes.h +23 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/BreezSdkSparkReactNativeSpec/States.cpp +16 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/BreezSdkSparkReactNativeSpec/States.h +19 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +5 -0
- package/android/src/main/AndroidManifestNew.xml +2 -0
- package/android/src/main/java/com/breeztech/breezsdkspark/BreezSdkSparkReactNativeModule.kt +43 -0
- package/android/src/main/java/com/breeztech/breezsdkspark/BreezSdkSparkReactNativePackage.kt +34 -0
- package/breeztech-breez-sdk-spark-react-native.podspec +44 -0
- package/cpp/breeztech-breez-sdk-spark-react-native.cpp +20 -0
- package/cpp/breeztech-breez-sdk-spark-react-native.h +15 -0
- package/cpp/generated/breez_sdk_common.cpp +3834 -0
- package/cpp/generated/breez_sdk_common.hpp +251 -0
- package/cpp/generated/breez_sdk_spark.cpp +8722 -0
- package/cpp/generated/breez_sdk_spark.hpp +589 -0
- package/cpp/generated/breez_sdk_spark_bindings.cpp +1750 -0
- package/cpp/generated/breez_sdk_spark_bindings.hpp +65 -0
- package/ios/BreezSdkSparkReactNative.h +16 -0
- package/ios/BreezSdkSparkReactNative.mm +66 -0
- package/ios/generated/build/generated/ios/BreezSdkSparkReactNativeSpec/BreezSdkSparkReactNativeSpec-generated.mm +46 -0
- package/ios/generated/build/generated/ios/BreezSdkSparkReactNativeSpec/BreezSdkSparkReactNativeSpec.h +63 -0
- package/ios/generated/build/generated/ios/BreezSdkSparkReactNativeSpecJSI-generated.cpp +32 -0
- package/ios/generated/build/generated/ios/BreezSdkSparkReactNativeSpecJSI.h +80 -0
- package/ios/generated/build/generated/ios/react/renderer/components/BreezSdkSparkReactNativeSpec/ComponentDescriptors.cpp +22 -0
- package/ios/generated/build/generated/ios/react/renderer/components/BreezSdkSparkReactNativeSpec/ComponentDescriptors.h +24 -0
- package/ios/generated/build/generated/ios/react/renderer/components/BreezSdkSparkReactNativeSpec/EventEmitters.cpp +16 -0
- package/ios/generated/build/generated/ios/react/renderer/components/BreezSdkSparkReactNativeSpec/EventEmitters.h +17 -0
- package/ios/generated/build/generated/ios/react/renderer/components/BreezSdkSparkReactNativeSpec/Props.cpp +19 -0
- package/ios/generated/build/generated/ios/react/renderer/components/BreezSdkSparkReactNativeSpec/Props.h +18 -0
- package/ios/generated/build/generated/ios/react/renderer/components/BreezSdkSparkReactNativeSpec/RCTComponentViewHelpers.h +18 -0
- package/ios/generated/build/generated/ios/react/renderer/components/BreezSdkSparkReactNativeSpec/ShadowNodes.cpp +17 -0
- package/ios/generated/build/generated/ios/react/renderer/components/BreezSdkSparkReactNativeSpec/ShadowNodes.h +23 -0
- package/ios/generated/build/generated/ios/react/renderer/components/BreezSdkSparkReactNativeSpec/States.cpp +16 -0
- package/ios/generated/build/generated/ios/react/renderer/components/BreezSdkSparkReactNativeSpec/States.h +19 -0
- package/lib/commonjs/NativeBreezSdkSparkReactNative.js +10 -0
- package/lib/commonjs/NativeBreezSdkSparkReactNative.js.map +1 -0
- package/lib/commonjs/generated/breez_sdk_common-ffi.js +44 -0
- package/lib/commonjs/generated/breez_sdk_common-ffi.js.map +1 -0
- package/lib/commonjs/generated/breez_sdk_common.js +3948 -0
- package/lib/commonjs/generated/breez_sdk_common.js.map +1 -0
- package/lib/commonjs/generated/breez_sdk_spark-ffi.js +44 -0
- package/lib/commonjs/generated/breez_sdk_spark-ffi.js.map +1 -0
- package/lib/commonjs/generated/breez_sdk_spark.js +5775 -0
- package/lib/commonjs/generated/breez_sdk_spark.js.map +1 -0
- package/lib/commonjs/generated/breez_sdk_spark_bindings-ffi.js +44 -0
- package/lib/commonjs/generated/breez_sdk_spark_bindings-ffi.js.map +1 -0
- package/lib/commonjs/generated/breez_sdk_spark_bindings.js +51 -0
- package/lib/commonjs/generated/breez_sdk_spark_bindings.js.map +1 -0
- package/lib/commonjs/index.js +81 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/module/NativeBreezSdkSparkReactNative.js +7 -0
- package/lib/module/NativeBreezSdkSparkReactNative.js.map +1 -0
- package/lib/module/generated/breez_sdk_common-ffi.js +43 -0
- package/lib/module/generated/breez_sdk_common-ffi.js.map +1 -0
- package/lib/module/generated/breez_sdk_common.js +3942 -0
- package/lib/module/generated/breez_sdk_common.js.map +1 -0
- package/lib/module/generated/breez_sdk_spark-ffi.js +43 -0
- package/lib/module/generated/breez_sdk_spark-ffi.js.map +1 -0
- package/lib/module/generated/breez_sdk_spark.js +5759 -0
- package/lib/module/generated/breez_sdk_spark.js.map +1 -0
- package/lib/module/generated/breez_sdk_spark_bindings-ffi.js +43 -0
- package/lib/module/generated/breez_sdk_spark_bindings-ffi.js.map +1 -0
- package/lib/module/generated/breez_sdk_spark_bindings.js +46 -0
- package/lib/module/generated/breez_sdk_spark_bindings.js.map +1 -0
- package/lib/module/index.js +44 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/src/NativeBreezSdkSparkReactNative.d.ts +8 -0
- package/lib/typescript/commonjs/src/NativeBreezSdkSparkReactNative.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/src/NativeBreezSdkSparkReactNative.d.ts +8 -0
- package/lib/typescript/module/src/NativeBreezSdkSparkReactNative.d.ts.map +1 -0
- package/package.json +189 -0
- package/react-native.config.js +12 -0
- package/scripts/postinstall.sh +14 -0
- package/src/NativeBreezSdkSparkReactNative.ts +10 -0
- package/src/generated/breez_sdk_common-ffi.ts +394 -0
- package/src/generated/breez_sdk_common.ts +5502 -0
- package/src/generated/breez_sdk_spark-ffi.ts +751 -0
- package/src/generated/breez_sdk_spark.ts +9179 -0
- package/src/generated/breez_sdk_spark_bindings-ffi.ts +185 -0
- package/src/generated/breez_sdk_spark_bindings.ts +103 -0
- package/src/index.tsx +42 -0
|
@@ -0,0 +1,3942 @@
|
|
|
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
|
+
* Wrapper around the [`CurrencyInfo`] of a fiat currency
|
|
780
|
+
*/
|
|
781
|
+
|
|
782
|
+
/**
|
|
783
|
+
* Generated factory for {@link FiatCurrency} record objects.
|
|
784
|
+
*/
|
|
785
|
+
export const FiatCurrency = (() => {
|
|
786
|
+
const defaults = () => ({});
|
|
787
|
+
const create = (() => {
|
|
788
|
+
return uniffiCreateRecord(defaults);
|
|
789
|
+
})();
|
|
790
|
+
return Object.freeze({
|
|
791
|
+
/**
|
|
792
|
+
* Create a frozen instance of {@link FiatCurrency}, with defaults specified
|
|
793
|
+
* in Rust, in the {@link breez_sdk_common} crate.
|
|
794
|
+
*/
|
|
795
|
+
create,
|
|
796
|
+
/**
|
|
797
|
+
* Create a frozen instance of {@link FiatCurrency}, 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 FfiConverterTypeFiatCurrency = (() => {
|
|
808
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
809
|
+
read(from) {
|
|
810
|
+
return {
|
|
811
|
+
id: FfiConverterString.read(from),
|
|
812
|
+
info: FfiConverterTypeCurrencyInfo.read(from)
|
|
813
|
+
};
|
|
814
|
+
}
|
|
815
|
+
write(value, into) {
|
|
816
|
+
FfiConverterString.write(value.id, into);
|
|
817
|
+
FfiConverterTypeCurrencyInfo.write(value.info, into);
|
|
818
|
+
}
|
|
819
|
+
allocationSize(value) {
|
|
820
|
+
return FfiConverterString.allocationSize(value.id) + FfiConverterTypeCurrencyInfo.allocationSize(value.info);
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
return new FFIConverter();
|
|
824
|
+
})();
|
|
825
|
+
/**
|
|
826
|
+
* Generated factory for {@link LightningAddressDetails} record objects.
|
|
827
|
+
*/
|
|
828
|
+
export const LightningAddressDetails = (() => {
|
|
829
|
+
const defaults = () => ({});
|
|
830
|
+
const create = (() => {
|
|
831
|
+
return uniffiCreateRecord(defaults);
|
|
832
|
+
})();
|
|
833
|
+
return Object.freeze({
|
|
834
|
+
/**
|
|
835
|
+
* Create a frozen instance of {@link LightningAddressDetails}, with defaults specified
|
|
836
|
+
* in Rust, in the {@link breez_sdk_common} crate.
|
|
837
|
+
*/
|
|
838
|
+
create,
|
|
839
|
+
/**
|
|
840
|
+
* Create a frozen instance of {@link LightningAddressDetails}, with defaults specified
|
|
841
|
+
* in Rust, in the {@link breez_sdk_common} crate.
|
|
842
|
+
*/
|
|
843
|
+
new: create,
|
|
844
|
+
/**
|
|
845
|
+
* Defaults specified in the {@link breez_sdk_common} crate.
|
|
846
|
+
*/
|
|
847
|
+
defaults: () => Object.freeze(defaults())
|
|
848
|
+
});
|
|
849
|
+
})();
|
|
850
|
+
const FfiConverterTypeLightningAddressDetails = (() => {
|
|
851
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
852
|
+
read(from) {
|
|
853
|
+
return {
|
|
854
|
+
address: FfiConverterString.read(from),
|
|
855
|
+
payRequest: FfiConverterTypeLnurlPayRequestDetails.read(from)
|
|
856
|
+
};
|
|
857
|
+
}
|
|
858
|
+
write(value, into) {
|
|
859
|
+
FfiConverterString.write(value.address, into);
|
|
860
|
+
FfiConverterTypeLnurlPayRequestDetails.write(value.payRequest, into);
|
|
861
|
+
}
|
|
862
|
+
allocationSize(value) {
|
|
863
|
+
return FfiConverterString.allocationSize(value.address) + FfiConverterTypeLnurlPayRequestDetails.allocationSize(value.payRequest);
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
return new FFIConverter();
|
|
867
|
+
})();
|
|
868
|
+
|
|
869
|
+
/**
|
|
870
|
+
* Wrapped in a [`LnurlAuth`], this is the result of [`parse`] when given a LNURL-auth endpoint.
|
|
871
|
+
*
|
|
872
|
+
* It represents the endpoint's parameters for the LNURL workflow.
|
|
873
|
+
*
|
|
874
|
+
* See <https://github.com/lnurl/luds/blob/luds/04.md>
|
|
875
|
+
*/
|
|
876
|
+
|
|
877
|
+
/**
|
|
878
|
+
* Generated factory for {@link LnurlAuthRequestDetails} record objects.
|
|
879
|
+
*/
|
|
880
|
+
export const LnurlAuthRequestDetails = (() => {
|
|
881
|
+
const defaults = () => ({});
|
|
882
|
+
const create = (() => {
|
|
883
|
+
return uniffiCreateRecord(defaults);
|
|
884
|
+
})();
|
|
885
|
+
return Object.freeze({
|
|
886
|
+
/**
|
|
887
|
+
* Create a frozen instance of {@link LnurlAuthRequestDetails}, with defaults specified
|
|
888
|
+
* in Rust, in the {@link breez_sdk_common} crate.
|
|
889
|
+
*/
|
|
890
|
+
create,
|
|
891
|
+
/**
|
|
892
|
+
* Create a frozen instance of {@link LnurlAuthRequestDetails}, with defaults specified
|
|
893
|
+
* in Rust, in the {@link breez_sdk_common} crate.
|
|
894
|
+
*/
|
|
895
|
+
new: create,
|
|
896
|
+
/**
|
|
897
|
+
* Defaults specified in the {@link breez_sdk_common} crate.
|
|
898
|
+
*/
|
|
899
|
+
defaults: () => Object.freeze(defaults())
|
|
900
|
+
});
|
|
901
|
+
})();
|
|
902
|
+
const FfiConverterTypeLnurlAuthRequestDetails = (() => {
|
|
903
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
904
|
+
read(from) {
|
|
905
|
+
return {
|
|
906
|
+
k1: FfiConverterString.read(from),
|
|
907
|
+
action: FfiConverterOptionalString.read(from),
|
|
908
|
+
domain: FfiConverterString.read(from),
|
|
909
|
+
url: FfiConverterString.read(from)
|
|
910
|
+
};
|
|
911
|
+
}
|
|
912
|
+
write(value, into) {
|
|
913
|
+
FfiConverterString.write(value.k1, into);
|
|
914
|
+
FfiConverterOptionalString.write(value.action, into);
|
|
915
|
+
FfiConverterString.write(value.domain, into);
|
|
916
|
+
FfiConverterString.write(value.url, into);
|
|
917
|
+
}
|
|
918
|
+
allocationSize(value) {
|
|
919
|
+
return FfiConverterString.allocationSize(value.k1) + FfiConverterOptionalString.allocationSize(value.action) + FfiConverterString.allocationSize(value.domain) + FfiConverterString.allocationSize(value.url);
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
return new FFIConverter();
|
|
923
|
+
})();
|
|
924
|
+
|
|
925
|
+
/**
|
|
926
|
+
* Wrapped in a [`LnUrlError`], this represents a LNURL-endpoint error.
|
|
927
|
+
*/
|
|
928
|
+
|
|
929
|
+
/**
|
|
930
|
+
* Generated factory for {@link LnurlErrorDetails} record objects.
|
|
931
|
+
*/
|
|
932
|
+
export const LnurlErrorDetails = (() => {
|
|
933
|
+
const defaults = () => ({});
|
|
934
|
+
const create = (() => {
|
|
935
|
+
return uniffiCreateRecord(defaults);
|
|
936
|
+
})();
|
|
937
|
+
return Object.freeze({
|
|
938
|
+
/**
|
|
939
|
+
* Create a frozen instance of {@link LnurlErrorDetails}, with defaults specified
|
|
940
|
+
* in Rust, in the {@link breez_sdk_common} crate.
|
|
941
|
+
*/
|
|
942
|
+
create,
|
|
943
|
+
/**
|
|
944
|
+
* Create a frozen instance of {@link LnurlErrorDetails}, with defaults specified
|
|
945
|
+
* in Rust, in the {@link breez_sdk_common} crate.
|
|
946
|
+
*/
|
|
947
|
+
new: create,
|
|
948
|
+
/**
|
|
949
|
+
* Defaults specified in the {@link breez_sdk_common} crate.
|
|
950
|
+
*/
|
|
951
|
+
defaults: () => Object.freeze(defaults())
|
|
952
|
+
});
|
|
953
|
+
})();
|
|
954
|
+
const FfiConverterTypeLnurlErrorDetails = (() => {
|
|
955
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
956
|
+
read(from) {
|
|
957
|
+
return {
|
|
958
|
+
reason: FfiConverterString.read(from)
|
|
959
|
+
};
|
|
960
|
+
}
|
|
961
|
+
write(value, into) {
|
|
962
|
+
FfiConverterString.write(value.reason, into);
|
|
963
|
+
}
|
|
964
|
+
allocationSize(value) {
|
|
965
|
+
return FfiConverterString.allocationSize(value.reason);
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
return new FFIConverter();
|
|
969
|
+
})();
|
|
970
|
+
/**
|
|
971
|
+
* Generated factory for {@link LnurlPayRequestDetails} record objects.
|
|
972
|
+
*/
|
|
973
|
+
export const LnurlPayRequestDetails = (() => {
|
|
974
|
+
const defaults = () => ({});
|
|
975
|
+
const create = (() => {
|
|
976
|
+
return uniffiCreateRecord(defaults);
|
|
977
|
+
})();
|
|
978
|
+
return Object.freeze({
|
|
979
|
+
/**
|
|
980
|
+
* Create a frozen instance of {@link LnurlPayRequestDetails}, with defaults specified
|
|
981
|
+
* in Rust, in the {@link breez_sdk_common} crate.
|
|
982
|
+
*/
|
|
983
|
+
create,
|
|
984
|
+
/**
|
|
985
|
+
* Create a frozen instance of {@link LnurlPayRequestDetails}, with defaults specified
|
|
986
|
+
* in Rust, in the {@link breez_sdk_common} crate.
|
|
987
|
+
*/
|
|
988
|
+
new: create,
|
|
989
|
+
/**
|
|
990
|
+
* Defaults specified in the {@link breez_sdk_common} crate.
|
|
991
|
+
*/
|
|
992
|
+
defaults: () => Object.freeze(defaults())
|
|
993
|
+
});
|
|
994
|
+
})();
|
|
995
|
+
const FfiConverterTypeLnurlPayRequestDetails = (() => {
|
|
996
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
997
|
+
read(from) {
|
|
998
|
+
return {
|
|
999
|
+
callback: FfiConverterString.read(from),
|
|
1000
|
+
minSendable: FfiConverterUInt64.read(from),
|
|
1001
|
+
maxSendable: FfiConverterUInt64.read(from),
|
|
1002
|
+
metadataStr: FfiConverterString.read(from),
|
|
1003
|
+
commentAllowed: FfiConverterUInt16.read(from),
|
|
1004
|
+
domain: FfiConverterString.read(from),
|
|
1005
|
+
url: FfiConverterString.read(from),
|
|
1006
|
+
address: FfiConverterOptionalString.read(from),
|
|
1007
|
+
allowsNostr: FfiConverterOptionalBool.read(from),
|
|
1008
|
+
nostrPubkey: FfiConverterOptionalString.read(from)
|
|
1009
|
+
};
|
|
1010
|
+
}
|
|
1011
|
+
write(value, into) {
|
|
1012
|
+
FfiConverterString.write(value.callback, into);
|
|
1013
|
+
FfiConverterUInt64.write(value.minSendable, into);
|
|
1014
|
+
FfiConverterUInt64.write(value.maxSendable, into);
|
|
1015
|
+
FfiConverterString.write(value.metadataStr, into);
|
|
1016
|
+
FfiConverterUInt16.write(value.commentAllowed, into);
|
|
1017
|
+
FfiConverterString.write(value.domain, into);
|
|
1018
|
+
FfiConverterString.write(value.url, into);
|
|
1019
|
+
FfiConverterOptionalString.write(value.address, into);
|
|
1020
|
+
FfiConverterOptionalBool.write(value.allowsNostr, into);
|
|
1021
|
+
FfiConverterOptionalString.write(value.nostrPubkey, into);
|
|
1022
|
+
}
|
|
1023
|
+
allocationSize(value) {
|
|
1024
|
+
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);
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1027
|
+
return new FFIConverter();
|
|
1028
|
+
})();
|
|
1029
|
+
/**
|
|
1030
|
+
* Generated factory for {@link LnurlWithdrawRequestDetails} record objects.
|
|
1031
|
+
*/
|
|
1032
|
+
export const LnurlWithdrawRequestDetails = (() => {
|
|
1033
|
+
const defaults = () => ({});
|
|
1034
|
+
const create = (() => {
|
|
1035
|
+
return uniffiCreateRecord(defaults);
|
|
1036
|
+
})();
|
|
1037
|
+
return Object.freeze({
|
|
1038
|
+
/**
|
|
1039
|
+
* Create a frozen instance of {@link LnurlWithdrawRequestDetails}, with defaults specified
|
|
1040
|
+
* in Rust, in the {@link breez_sdk_common} crate.
|
|
1041
|
+
*/
|
|
1042
|
+
create,
|
|
1043
|
+
/**
|
|
1044
|
+
* Create a frozen instance of {@link LnurlWithdrawRequestDetails}, with defaults specified
|
|
1045
|
+
* in Rust, in the {@link breez_sdk_common} crate.
|
|
1046
|
+
*/
|
|
1047
|
+
new: create,
|
|
1048
|
+
/**
|
|
1049
|
+
* Defaults specified in the {@link breez_sdk_common} crate.
|
|
1050
|
+
*/
|
|
1051
|
+
defaults: () => Object.freeze(defaults())
|
|
1052
|
+
});
|
|
1053
|
+
})();
|
|
1054
|
+
const FfiConverterTypeLnurlWithdrawRequestDetails = (() => {
|
|
1055
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
1056
|
+
read(from) {
|
|
1057
|
+
return {
|
|
1058
|
+
callback: FfiConverterString.read(from),
|
|
1059
|
+
k1: FfiConverterString.read(from),
|
|
1060
|
+
defaultDescription: FfiConverterString.read(from),
|
|
1061
|
+
minWithdrawable: FfiConverterUInt64.read(from),
|
|
1062
|
+
maxWithdrawable: FfiConverterUInt64.read(from)
|
|
1063
|
+
};
|
|
1064
|
+
}
|
|
1065
|
+
write(value, into) {
|
|
1066
|
+
FfiConverterString.write(value.callback, into);
|
|
1067
|
+
FfiConverterString.write(value.k1, into);
|
|
1068
|
+
FfiConverterString.write(value.defaultDescription, into);
|
|
1069
|
+
FfiConverterUInt64.write(value.minWithdrawable, into);
|
|
1070
|
+
FfiConverterUInt64.write(value.maxWithdrawable, into);
|
|
1071
|
+
}
|
|
1072
|
+
allocationSize(value) {
|
|
1073
|
+
return FfiConverterString.allocationSize(value.callback) + FfiConverterString.allocationSize(value.k1) + FfiConverterString.allocationSize(value.defaultDescription) + FfiConverterUInt64.allocationSize(value.minWithdrawable) + FfiConverterUInt64.allocationSize(value.maxWithdrawable);
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
return new FFIConverter();
|
|
1077
|
+
})();
|
|
1078
|
+
|
|
1079
|
+
/**
|
|
1080
|
+
* Locale-specific settings for the representation of a currency
|
|
1081
|
+
*/
|
|
1082
|
+
|
|
1083
|
+
/**
|
|
1084
|
+
* Generated factory for {@link LocaleOverrides} record objects.
|
|
1085
|
+
*/
|
|
1086
|
+
export const LocaleOverrides = (() => {
|
|
1087
|
+
const defaults = () => ({});
|
|
1088
|
+
const create = (() => {
|
|
1089
|
+
return uniffiCreateRecord(defaults);
|
|
1090
|
+
})();
|
|
1091
|
+
return Object.freeze({
|
|
1092
|
+
/**
|
|
1093
|
+
* Create a frozen instance of {@link LocaleOverrides}, with defaults specified
|
|
1094
|
+
* in Rust, in the {@link breez_sdk_common} crate.
|
|
1095
|
+
*/
|
|
1096
|
+
create,
|
|
1097
|
+
/**
|
|
1098
|
+
* Create a frozen instance of {@link LocaleOverrides}, with defaults specified
|
|
1099
|
+
* in Rust, in the {@link breez_sdk_common} crate.
|
|
1100
|
+
*/
|
|
1101
|
+
new: create,
|
|
1102
|
+
/**
|
|
1103
|
+
* Defaults specified in the {@link breez_sdk_common} crate.
|
|
1104
|
+
*/
|
|
1105
|
+
defaults: () => Object.freeze(defaults())
|
|
1106
|
+
});
|
|
1107
|
+
})();
|
|
1108
|
+
const FfiConverterTypeLocaleOverrides = (() => {
|
|
1109
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
1110
|
+
read(from) {
|
|
1111
|
+
return {
|
|
1112
|
+
locale: FfiConverterString.read(from),
|
|
1113
|
+
spacing: FfiConverterOptionalUInt32.read(from),
|
|
1114
|
+
symbol: FfiConverterTypeSymbol.read(from)
|
|
1115
|
+
};
|
|
1116
|
+
}
|
|
1117
|
+
write(value, into) {
|
|
1118
|
+
FfiConverterString.write(value.locale, into);
|
|
1119
|
+
FfiConverterOptionalUInt32.write(value.spacing, into);
|
|
1120
|
+
FfiConverterTypeSymbol.write(value.symbol, into);
|
|
1121
|
+
}
|
|
1122
|
+
allocationSize(value) {
|
|
1123
|
+
return FfiConverterString.allocationSize(value.locale) + FfiConverterOptionalUInt32.allocationSize(value.spacing) + FfiConverterTypeSymbol.allocationSize(value.symbol);
|
|
1124
|
+
}
|
|
1125
|
+
}
|
|
1126
|
+
return new FFIConverter();
|
|
1127
|
+
})();
|
|
1128
|
+
|
|
1129
|
+
/**
|
|
1130
|
+
* Localized name of a currency
|
|
1131
|
+
*/
|
|
1132
|
+
|
|
1133
|
+
/**
|
|
1134
|
+
* Generated factory for {@link LocalizedName} record objects.
|
|
1135
|
+
*/
|
|
1136
|
+
export const LocalizedName = (() => {
|
|
1137
|
+
const defaults = () => ({});
|
|
1138
|
+
const create = (() => {
|
|
1139
|
+
return uniffiCreateRecord(defaults);
|
|
1140
|
+
})();
|
|
1141
|
+
return Object.freeze({
|
|
1142
|
+
/**
|
|
1143
|
+
* Create a frozen instance of {@link LocalizedName}, with defaults specified
|
|
1144
|
+
* in Rust, in the {@link breez_sdk_common} crate.
|
|
1145
|
+
*/
|
|
1146
|
+
create,
|
|
1147
|
+
/**
|
|
1148
|
+
* Create a frozen instance of {@link LocalizedName}, 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 FfiConverterTypeLocalizedName = (() => {
|
|
1159
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
1160
|
+
read(from) {
|
|
1161
|
+
return {
|
|
1162
|
+
locale: FfiConverterString.read(from),
|
|
1163
|
+
name: FfiConverterString.read(from)
|
|
1164
|
+
};
|
|
1165
|
+
}
|
|
1166
|
+
write(value, into) {
|
|
1167
|
+
FfiConverterString.write(value.locale, into);
|
|
1168
|
+
FfiConverterString.write(value.name, into);
|
|
1169
|
+
}
|
|
1170
|
+
allocationSize(value) {
|
|
1171
|
+
return FfiConverterString.allocationSize(value.locale) + FfiConverterString.allocationSize(value.name);
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1174
|
+
return new FFIConverter();
|
|
1175
|
+
})();
|
|
1176
|
+
/**
|
|
1177
|
+
* Generated factory for {@link MessageSuccessActionData} record objects.
|
|
1178
|
+
*/
|
|
1179
|
+
export const MessageSuccessActionData = (() => {
|
|
1180
|
+
const defaults = () => ({});
|
|
1181
|
+
const create = (() => {
|
|
1182
|
+
return uniffiCreateRecord(defaults);
|
|
1183
|
+
})();
|
|
1184
|
+
return Object.freeze({
|
|
1185
|
+
/**
|
|
1186
|
+
* Create a frozen instance of {@link MessageSuccessActionData}, with defaults specified
|
|
1187
|
+
* in Rust, in the {@link breez_sdk_common} crate.
|
|
1188
|
+
*/
|
|
1189
|
+
create,
|
|
1190
|
+
/**
|
|
1191
|
+
* Create a frozen instance of {@link MessageSuccessActionData}, with defaults specified
|
|
1192
|
+
* in Rust, in the {@link breez_sdk_common} crate.
|
|
1193
|
+
*/
|
|
1194
|
+
new: create,
|
|
1195
|
+
/**
|
|
1196
|
+
* Defaults specified in the {@link breez_sdk_common} crate.
|
|
1197
|
+
*/
|
|
1198
|
+
defaults: () => Object.freeze(defaults())
|
|
1199
|
+
});
|
|
1200
|
+
})();
|
|
1201
|
+
const FfiConverterTypeMessageSuccessActionData = (() => {
|
|
1202
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
1203
|
+
read(from) {
|
|
1204
|
+
return {
|
|
1205
|
+
message: FfiConverterString.read(from)
|
|
1206
|
+
};
|
|
1207
|
+
}
|
|
1208
|
+
write(value, into) {
|
|
1209
|
+
FfiConverterString.write(value.message, into);
|
|
1210
|
+
}
|
|
1211
|
+
allocationSize(value) {
|
|
1212
|
+
return FfiConverterString.allocationSize(value.message);
|
|
1213
|
+
}
|
|
1214
|
+
}
|
|
1215
|
+
return new FFIConverter();
|
|
1216
|
+
})();
|
|
1217
|
+
/**
|
|
1218
|
+
* Generated factory for {@link PaymentRequestSource} record objects.
|
|
1219
|
+
*/
|
|
1220
|
+
export const PaymentRequestSource = (() => {
|
|
1221
|
+
const defaults = () => ({});
|
|
1222
|
+
const create = (() => {
|
|
1223
|
+
return uniffiCreateRecord(defaults);
|
|
1224
|
+
})();
|
|
1225
|
+
return Object.freeze({
|
|
1226
|
+
/**
|
|
1227
|
+
* Create a frozen instance of {@link PaymentRequestSource}, with defaults specified
|
|
1228
|
+
* in Rust, in the {@link breez_sdk_common} crate.
|
|
1229
|
+
*/
|
|
1230
|
+
create,
|
|
1231
|
+
/**
|
|
1232
|
+
* Create a frozen instance of {@link PaymentRequestSource}, with defaults specified
|
|
1233
|
+
* in Rust, in the {@link breez_sdk_common} crate.
|
|
1234
|
+
*/
|
|
1235
|
+
new: create,
|
|
1236
|
+
/**
|
|
1237
|
+
* Defaults specified in the {@link breez_sdk_common} crate.
|
|
1238
|
+
*/
|
|
1239
|
+
defaults: () => Object.freeze(defaults())
|
|
1240
|
+
});
|
|
1241
|
+
})();
|
|
1242
|
+
const FfiConverterTypePaymentRequestSource = (() => {
|
|
1243
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
1244
|
+
read(from) {
|
|
1245
|
+
return {
|
|
1246
|
+
bip21Uri: FfiConverterOptionalString.read(from),
|
|
1247
|
+
bip353Address: FfiConverterOptionalString.read(from)
|
|
1248
|
+
};
|
|
1249
|
+
}
|
|
1250
|
+
write(value, into) {
|
|
1251
|
+
FfiConverterOptionalString.write(value.bip21Uri, into);
|
|
1252
|
+
FfiConverterOptionalString.write(value.bip353Address, into);
|
|
1253
|
+
}
|
|
1254
|
+
allocationSize(value) {
|
|
1255
|
+
return FfiConverterOptionalString.allocationSize(value.bip21Uri) + FfiConverterOptionalString.allocationSize(value.bip353Address);
|
|
1256
|
+
}
|
|
1257
|
+
}
|
|
1258
|
+
return new FFIConverter();
|
|
1259
|
+
})();
|
|
1260
|
+
|
|
1261
|
+
/**
|
|
1262
|
+
* Denominator in an exchange rate
|
|
1263
|
+
*/
|
|
1264
|
+
|
|
1265
|
+
/**
|
|
1266
|
+
* Generated factory for {@link Rate} record objects.
|
|
1267
|
+
*/
|
|
1268
|
+
export const Rate = (() => {
|
|
1269
|
+
const defaults = () => ({});
|
|
1270
|
+
const create = (() => {
|
|
1271
|
+
return uniffiCreateRecord(defaults);
|
|
1272
|
+
})();
|
|
1273
|
+
return Object.freeze({
|
|
1274
|
+
/**
|
|
1275
|
+
* Create a frozen instance of {@link Rate}, with defaults specified
|
|
1276
|
+
* in Rust, in the {@link breez_sdk_common} crate.
|
|
1277
|
+
*/
|
|
1278
|
+
create,
|
|
1279
|
+
/**
|
|
1280
|
+
* Create a frozen instance of {@link Rate}, with defaults specified
|
|
1281
|
+
* in Rust, in the {@link breez_sdk_common} crate.
|
|
1282
|
+
*/
|
|
1283
|
+
new: create,
|
|
1284
|
+
/**
|
|
1285
|
+
* Defaults specified in the {@link breez_sdk_common} crate.
|
|
1286
|
+
*/
|
|
1287
|
+
defaults: () => Object.freeze(defaults())
|
|
1288
|
+
});
|
|
1289
|
+
})();
|
|
1290
|
+
const FfiConverterTypeRate = (() => {
|
|
1291
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
1292
|
+
read(from) {
|
|
1293
|
+
return {
|
|
1294
|
+
coin: FfiConverterString.read(from),
|
|
1295
|
+
value: FfiConverterFloat64.read(from)
|
|
1296
|
+
};
|
|
1297
|
+
}
|
|
1298
|
+
write(value, into) {
|
|
1299
|
+
FfiConverterString.write(value.coin, into);
|
|
1300
|
+
FfiConverterFloat64.write(value.value, into);
|
|
1301
|
+
}
|
|
1302
|
+
allocationSize(value) {
|
|
1303
|
+
return FfiConverterString.allocationSize(value.coin) + FfiConverterFloat64.allocationSize(value.value);
|
|
1304
|
+
}
|
|
1305
|
+
}
|
|
1306
|
+
return new FFIConverter();
|
|
1307
|
+
})();
|
|
1308
|
+
/**
|
|
1309
|
+
* Generated factory for {@link RestResponse} record objects.
|
|
1310
|
+
*/
|
|
1311
|
+
export const RestResponse = (() => {
|
|
1312
|
+
const defaults = () => ({});
|
|
1313
|
+
const create = (() => {
|
|
1314
|
+
return uniffiCreateRecord(defaults);
|
|
1315
|
+
})();
|
|
1316
|
+
return Object.freeze({
|
|
1317
|
+
/**
|
|
1318
|
+
* Create a frozen instance of {@link RestResponse}, with defaults specified
|
|
1319
|
+
* in Rust, in the {@link breez_sdk_common} crate.
|
|
1320
|
+
*/
|
|
1321
|
+
create,
|
|
1322
|
+
/**
|
|
1323
|
+
* Create a frozen instance of {@link RestResponse}, with defaults specified
|
|
1324
|
+
* in Rust, in the {@link breez_sdk_common} crate.
|
|
1325
|
+
*/
|
|
1326
|
+
new: create,
|
|
1327
|
+
/**
|
|
1328
|
+
* Defaults specified in the {@link breez_sdk_common} crate.
|
|
1329
|
+
*/
|
|
1330
|
+
defaults: () => Object.freeze(defaults())
|
|
1331
|
+
});
|
|
1332
|
+
})();
|
|
1333
|
+
const FfiConverterTypeRestResponse = (() => {
|
|
1334
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
1335
|
+
read(from) {
|
|
1336
|
+
return {
|
|
1337
|
+
status: FfiConverterUInt16.read(from),
|
|
1338
|
+
body: FfiConverterString.read(from)
|
|
1339
|
+
};
|
|
1340
|
+
}
|
|
1341
|
+
write(value, into) {
|
|
1342
|
+
FfiConverterUInt16.write(value.status, into);
|
|
1343
|
+
FfiConverterString.write(value.body, into);
|
|
1344
|
+
}
|
|
1345
|
+
allocationSize(value) {
|
|
1346
|
+
return FfiConverterUInt16.allocationSize(value.status) + FfiConverterString.allocationSize(value.body);
|
|
1347
|
+
}
|
|
1348
|
+
}
|
|
1349
|
+
return new FFIConverter();
|
|
1350
|
+
})();
|
|
1351
|
+
/**
|
|
1352
|
+
* Generated factory for {@link SatsPaymentDetails} record objects.
|
|
1353
|
+
*/
|
|
1354
|
+
export const SatsPaymentDetails = (() => {
|
|
1355
|
+
const defaults = () => ({});
|
|
1356
|
+
const create = (() => {
|
|
1357
|
+
return uniffiCreateRecord(defaults);
|
|
1358
|
+
})();
|
|
1359
|
+
return Object.freeze({
|
|
1360
|
+
/**
|
|
1361
|
+
* Create a frozen instance of {@link SatsPaymentDetails}, with defaults specified
|
|
1362
|
+
* in Rust, in the {@link breez_sdk_common} crate.
|
|
1363
|
+
*/
|
|
1364
|
+
create,
|
|
1365
|
+
/**
|
|
1366
|
+
* Create a frozen instance of {@link SatsPaymentDetails}, with defaults specified
|
|
1367
|
+
* in Rust, in the {@link breez_sdk_common} crate.
|
|
1368
|
+
*/
|
|
1369
|
+
new: create,
|
|
1370
|
+
/**
|
|
1371
|
+
* Defaults specified in the {@link breez_sdk_common} crate.
|
|
1372
|
+
*/
|
|
1373
|
+
defaults: () => Object.freeze(defaults())
|
|
1374
|
+
});
|
|
1375
|
+
})();
|
|
1376
|
+
const FfiConverterTypeSatsPaymentDetails = (() => {
|
|
1377
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
1378
|
+
read(from) {
|
|
1379
|
+
return {
|
|
1380
|
+
amount: FfiConverterOptionalUInt64.read(from)
|
|
1381
|
+
};
|
|
1382
|
+
}
|
|
1383
|
+
write(value, into) {
|
|
1384
|
+
FfiConverterOptionalUInt64.write(value.amount, into);
|
|
1385
|
+
}
|
|
1386
|
+
allocationSize(value) {
|
|
1387
|
+
return FfiConverterOptionalUInt64.allocationSize(value.amount);
|
|
1388
|
+
}
|
|
1389
|
+
}
|
|
1390
|
+
return new FFIConverter();
|
|
1391
|
+
})();
|
|
1392
|
+
/**
|
|
1393
|
+
* Generated factory for {@link SilentPaymentAddressDetails} record objects.
|
|
1394
|
+
*/
|
|
1395
|
+
export const SilentPaymentAddressDetails = (() => {
|
|
1396
|
+
const defaults = () => ({});
|
|
1397
|
+
const create = (() => {
|
|
1398
|
+
return uniffiCreateRecord(defaults);
|
|
1399
|
+
})();
|
|
1400
|
+
return Object.freeze({
|
|
1401
|
+
/**
|
|
1402
|
+
* Create a frozen instance of {@link SilentPaymentAddressDetails}, with defaults specified
|
|
1403
|
+
* in Rust, in the {@link breez_sdk_common} crate.
|
|
1404
|
+
*/
|
|
1405
|
+
create,
|
|
1406
|
+
/**
|
|
1407
|
+
* Create a frozen instance of {@link SilentPaymentAddressDetails}, with defaults specified
|
|
1408
|
+
* in Rust, in the {@link breez_sdk_common} crate.
|
|
1409
|
+
*/
|
|
1410
|
+
new: create,
|
|
1411
|
+
/**
|
|
1412
|
+
* Defaults specified in the {@link breez_sdk_common} crate.
|
|
1413
|
+
*/
|
|
1414
|
+
defaults: () => Object.freeze(defaults())
|
|
1415
|
+
});
|
|
1416
|
+
})();
|
|
1417
|
+
const FfiConverterTypeSilentPaymentAddressDetails = (() => {
|
|
1418
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
1419
|
+
read(from) {
|
|
1420
|
+
return {
|
|
1421
|
+
address: FfiConverterString.read(from),
|
|
1422
|
+
network: FfiConverterTypeBitcoinNetwork.read(from),
|
|
1423
|
+
source: FfiConverterTypePaymentRequestSource.read(from)
|
|
1424
|
+
};
|
|
1425
|
+
}
|
|
1426
|
+
write(value, into) {
|
|
1427
|
+
FfiConverterString.write(value.address, into);
|
|
1428
|
+
FfiConverterTypeBitcoinNetwork.write(value.network, into);
|
|
1429
|
+
FfiConverterTypePaymentRequestSource.write(value.source, into);
|
|
1430
|
+
}
|
|
1431
|
+
allocationSize(value) {
|
|
1432
|
+
return FfiConverterString.allocationSize(value.address) + FfiConverterTypeBitcoinNetwork.allocationSize(value.network) + FfiConverterTypePaymentRequestSource.allocationSize(value.source);
|
|
1433
|
+
}
|
|
1434
|
+
}
|
|
1435
|
+
return new FFIConverter();
|
|
1436
|
+
})();
|
|
1437
|
+
/**
|
|
1438
|
+
* Generated factory for {@link SparkAddress} record objects.
|
|
1439
|
+
*/
|
|
1440
|
+
export const SparkAddress = (() => {
|
|
1441
|
+
const defaults = () => ({});
|
|
1442
|
+
const create = (() => {
|
|
1443
|
+
return uniffiCreateRecord(defaults);
|
|
1444
|
+
})();
|
|
1445
|
+
return Object.freeze({
|
|
1446
|
+
/**
|
|
1447
|
+
* Create a frozen instance of {@link SparkAddress}, with defaults specified
|
|
1448
|
+
* in Rust, in the {@link breez_sdk_common} crate.
|
|
1449
|
+
*/
|
|
1450
|
+
create,
|
|
1451
|
+
/**
|
|
1452
|
+
* Create a frozen instance of {@link SparkAddress}, with defaults specified
|
|
1453
|
+
* in Rust, in the {@link breez_sdk_common} crate.
|
|
1454
|
+
*/
|
|
1455
|
+
new: create,
|
|
1456
|
+
/**
|
|
1457
|
+
* Defaults specified in the {@link breez_sdk_common} crate.
|
|
1458
|
+
*/
|
|
1459
|
+
defaults: () => Object.freeze(defaults())
|
|
1460
|
+
});
|
|
1461
|
+
})();
|
|
1462
|
+
const FfiConverterTypeSparkAddress = (() => {
|
|
1463
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
1464
|
+
read(from) {
|
|
1465
|
+
return {
|
|
1466
|
+
identityPublicKey: FfiConverterString.read(from),
|
|
1467
|
+
network: FfiConverterTypeBitcoinNetwork.read(from),
|
|
1468
|
+
sparkInvoiceFields: FfiConverterOptionalTypeSparkInvoiceFields.read(from),
|
|
1469
|
+
signature: FfiConverterOptionalString.read(from)
|
|
1470
|
+
};
|
|
1471
|
+
}
|
|
1472
|
+
write(value, into) {
|
|
1473
|
+
FfiConverterString.write(value.identityPublicKey, into);
|
|
1474
|
+
FfiConverterTypeBitcoinNetwork.write(value.network, into);
|
|
1475
|
+
FfiConverterOptionalTypeSparkInvoiceFields.write(value.sparkInvoiceFields, into);
|
|
1476
|
+
FfiConverterOptionalString.write(value.signature, into);
|
|
1477
|
+
}
|
|
1478
|
+
allocationSize(value) {
|
|
1479
|
+
return FfiConverterString.allocationSize(value.identityPublicKey) + FfiConverterTypeBitcoinNetwork.allocationSize(value.network) + FfiConverterOptionalTypeSparkInvoiceFields.allocationSize(value.sparkInvoiceFields) + FfiConverterOptionalString.allocationSize(value.signature);
|
|
1480
|
+
}
|
|
1481
|
+
}
|
|
1482
|
+
return new FFIConverter();
|
|
1483
|
+
})();
|
|
1484
|
+
/**
|
|
1485
|
+
* Generated factory for {@link SparkAddressDetails} record objects.
|
|
1486
|
+
*/
|
|
1487
|
+
export const SparkAddressDetails = (() => {
|
|
1488
|
+
const defaults = () => ({});
|
|
1489
|
+
const create = (() => {
|
|
1490
|
+
return uniffiCreateRecord(defaults);
|
|
1491
|
+
})();
|
|
1492
|
+
return Object.freeze({
|
|
1493
|
+
/**
|
|
1494
|
+
* Create a frozen instance of {@link SparkAddressDetails}, with defaults specified
|
|
1495
|
+
* in Rust, in the {@link breez_sdk_common} crate.
|
|
1496
|
+
*/
|
|
1497
|
+
create,
|
|
1498
|
+
/**
|
|
1499
|
+
* Create a frozen instance of {@link SparkAddressDetails}, with defaults specified
|
|
1500
|
+
* in Rust, in the {@link breez_sdk_common} crate.
|
|
1501
|
+
*/
|
|
1502
|
+
new: create,
|
|
1503
|
+
/**
|
|
1504
|
+
* Defaults specified in the {@link breez_sdk_common} crate.
|
|
1505
|
+
*/
|
|
1506
|
+
defaults: () => Object.freeze(defaults())
|
|
1507
|
+
});
|
|
1508
|
+
})();
|
|
1509
|
+
const FfiConverterTypeSparkAddressDetails = (() => {
|
|
1510
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
1511
|
+
read(from) {
|
|
1512
|
+
return {
|
|
1513
|
+
address: FfiConverterString.read(from),
|
|
1514
|
+
decodedAddress: FfiConverterTypeSparkAddress.read(from),
|
|
1515
|
+
source: FfiConverterTypePaymentRequestSource.read(from)
|
|
1516
|
+
};
|
|
1517
|
+
}
|
|
1518
|
+
write(value, into) {
|
|
1519
|
+
FfiConverterString.write(value.address, into);
|
|
1520
|
+
FfiConverterTypeSparkAddress.write(value.decodedAddress, into);
|
|
1521
|
+
FfiConverterTypePaymentRequestSource.write(value.source, into);
|
|
1522
|
+
}
|
|
1523
|
+
allocationSize(value) {
|
|
1524
|
+
return FfiConverterString.allocationSize(value.address) + FfiConverterTypeSparkAddress.allocationSize(value.decodedAddress) + FfiConverterTypePaymentRequestSource.allocationSize(value.source);
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1527
|
+
return new FFIConverter();
|
|
1528
|
+
})();
|
|
1529
|
+
/**
|
|
1530
|
+
* Generated factory for {@link SparkInvoiceFields} record objects.
|
|
1531
|
+
*/
|
|
1532
|
+
export const SparkInvoiceFields = (() => {
|
|
1533
|
+
const defaults = () => ({});
|
|
1534
|
+
const create = (() => {
|
|
1535
|
+
return uniffiCreateRecord(defaults);
|
|
1536
|
+
})();
|
|
1537
|
+
return Object.freeze({
|
|
1538
|
+
/**
|
|
1539
|
+
* Create a frozen instance of {@link SparkInvoiceFields}, with defaults specified
|
|
1540
|
+
* in Rust, in the {@link breez_sdk_common} crate.
|
|
1541
|
+
*/
|
|
1542
|
+
create,
|
|
1543
|
+
/**
|
|
1544
|
+
* Create a frozen instance of {@link SparkInvoiceFields}, with defaults specified
|
|
1545
|
+
* in Rust, in the {@link breez_sdk_common} crate.
|
|
1546
|
+
*/
|
|
1547
|
+
new: create,
|
|
1548
|
+
/**
|
|
1549
|
+
* Defaults specified in the {@link breez_sdk_common} crate.
|
|
1550
|
+
*/
|
|
1551
|
+
defaults: () => Object.freeze(defaults())
|
|
1552
|
+
});
|
|
1553
|
+
})();
|
|
1554
|
+
const FfiConverterTypeSparkInvoiceFields = (() => {
|
|
1555
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
1556
|
+
read(from) {
|
|
1557
|
+
return {
|
|
1558
|
+
id: FfiConverterString.read(from),
|
|
1559
|
+
version: FfiConverterUInt32.read(from),
|
|
1560
|
+
memo: FfiConverterOptionalString.read(from),
|
|
1561
|
+
senderPublicKey: FfiConverterOptionalString.read(from),
|
|
1562
|
+
expiryTime: FfiConverterOptionalUInt64.read(from),
|
|
1563
|
+
paymentType: FfiConverterOptionalTypeSparkAddressPaymentType.read(from)
|
|
1564
|
+
};
|
|
1565
|
+
}
|
|
1566
|
+
write(value, into) {
|
|
1567
|
+
FfiConverterString.write(value.id, into);
|
|
1568
|
+
FfiConverterUInt32.write(value.version, into);
|
|
1569
|
+
FfiConverterOptionalString.write(value.memo, into);
|
|
1570
|
+
FfiConverterOptionalString.write(value.senderPublicKey, into);
|
|
1571
|
+
FfiConverterOptionalUInt64.write(value.expiryTime, into);
|
|
1572
|
+
FfiConverterOptionalTypeSparkAddressPaymentType.write(value.paymentType, into);
|
|
1573
|
+
}
|
|
1574
|
+
allocationSize(value) {
|
|
1575
|
+
return FfiConverterString.allocationSize(value.id) + FfiConverterUInt32.allocationSize(value.version) + FfiConverterOptionalString.allocationSize(value.memo) + FfiConverterOptionalString.allocationSize(value.senderPublicKey) + FfiConverterOptionalUInt64.allocationSize(value.expiryTime) + FfiConverterOptionalTypeSparkAddressPaymentType.allocationSize(value.paymentType);
|
|
1576
|
+
}
|
|
1577
|
+
}
|
|
1578
|
+
return new FFIConverter();
|
|
1579
|
+
})();
|
|
1580
|
+
|
|
1581
|
+
/**
|
|
1582
|
+
* Settings for the symbol representation of a currency
|
|
1583
|
+
*/
|
|
1584
|
+
|
|
1585
|
+
/**
|
|
1586
|
+
* Generated factory for {@link Symbol} record objects.
|
|
1587
|
+
*/
|
|
1588
|
+
export const Symbol = (() => {
|
|
1589
|
+
const defaults = () => ({});
|
|
1590
|
+
const create = (() => {
|
|
1591
|
+
return uniffiCreateRecord(defaults);
|
|
1592
|
+
})();
|
|
1593
|
+
return Object.freeze({
|
|
1594
|
+
/**
|
|
1595
|
+
* Create a frozen instance of {@link Symbol}, with defaults specified
|
|
1596
|
+
* in Rust, in the {@link breez_sdk_common} crate.
|
|
1597
|
+
*/
|
|
1598
|
+
create,
|
|
1599
|
+
/**
|
|
1600
|
+
* Create a frozen instance of {@link Symbol}, with defaults specified
|
|
1601
|
+
* in Rust, in the {@link breez_sdk_common} crate.
|
|
1602
|
+
*/
|
|
1603
|
+
new: create,
|
|
1604
|
+
/**
|
|
1605
|
+
* Defaults specified in the {@link breez_sdk_common} crate.
|
|
1606
|
+
*/
|
|
1607
|
+
defaults: () => Object.freeze(defaults())
|
|
1608
|
+
});
|
|
1609
|
+
})();
|
|
1610
|
+
const FfiConverterTypeSymbol = (() => {
|
|
1611
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
1612
|
+
read(from) {
|
|
1613
|
+
return {
|
|
1614
|
+
grapheme: FfiConverterOptionalString.read(from),
|
|
1615
|
+
template: FfiConverterOptionalString.read(from),
|
|
1616
|
+
rtl: FfiConverterOptionalBool.read(from),
|
|
1617
|
+
position: FfiConverterOptionalUInt32.read(from)
|
|
1618
|
+
};
|
|
1619
|
+
}
|
|
1620
|
+
write(value, into) {
|
|
1621
|
+
FfiConverterOptionalString.write(value.grapheme, into);
|
|
1622
|
+
FfiConverterOptionalString.write(value.template, into);
|
|
1623
|
+
FfiConverterOptionalBool.write(value.rtl, into);
|
|
1624
|
+
FfiConverterOptionalUInt32.write(value.position, into);
|
|
1625
|
+
}
|
|
1626
|
+
allocationSize(value) {
|
|
1627
|
+
return FfiConverterOptionalString.allocationSize(value.grapheme) + FfiConverterOptionalString.allocationSize(value.template) + FfiConverterOptionalBool.allocationSize(value.rtl) + FfiConverterOptionalUInt32.allocationSize(value.position);
|
|
1628
|
+
}
|
|
1629
|
+
}
|
|
1630
|
+
return new FFIConverter();
|
|
1631
|
+
})();
|
|
1632
|
+
/**
|
|
1633
|
+
* Generated factory for {@link TokensPaymentDetails} record objects.
|
|
1634
|
+
*/
|
|
1635
|
+
export const TokensPaymentDetails = (() => {
|
|
1636
|
+
const defaults = () => ({});
|
|
1637
|
+
const create = (() => {
|
|
1638
|
+
return uniffiCreateRecord(defaults);
|
|
1639
|
+
})();
|
|
1640
|
+
return Object.freeze({
|
|
1641
|
+
/**
|
|
1642
|
+
* Create a frozen instance of {@link TokensPaymentDetails}, with defaults specified
|
|
1643
|
+
* in Rust, in the {@link breez_sdk_common} crate.
|
|
1644
|
+
*/
|
|
1645
|
+
create,
|
|
1646
|
+
/**
|
|
1647
|
+
* Create a frozen instance of {@link TokensPaymentDetails}, with defaults specified
|
|
1648
|
+
* in Rust, in the {@link breez_sdk_common} crate.
|
|
1649
|
+
*/
|
|
1650
|
+
new: create,
|
|
1651
|
+
/**
|
|
1652
|
+
* Defaults specified in the {@link breez_sdk_common} crate.
|
|
1653
|
+
*/
|
|
1654
|
+
defaults: () => Object.freeze(defaults())
|
|
1655
|
+
});
|
|
1656
|
+
})();
|
|
1657
|
+
const FfiConverterTypeTokensPaymentDetails = (() => {
|
|
1658
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
1659
|
+
read(from) {
|
|
1660
|
+
return {
|
|
1661
|
+
tokenIdentifier: FfiConverterOptionalString.read(from),
|
|
1662
|
+
amount: FfiConverterOptionalUInt64.read(from)
|
|
1663
|
+
};
|
|
1664
|
+
}
|
|
1665
|
+
write(value, into) {
|
|
1666
|
+
FfiConverterOptionalString.write(value.tokenIdentifier, into);
|
|
1667
|
+
FfiConverterOptionalUInt64.write(value.amount, into);
|
|
1668
|
+
}
|
|
1669
|
+
allocationSize(value) {
|
|
1670
|
+
return FfiConverterOptionalString.allocationSize(value.tokenIdentifier) + FfiConverterOptionalUInt64.allocationSize(value.amount);
|
|
1671
|
+
}
|
|
1672
|
+
}
|
|
1673
|
+
return new FFIConverter();
|
|
1674
|
+
})();
|
|
1675
|
+
/**
|
|
1676
|
+
* Generated factory for {@link UrlSuccessActionData} record objects.
|
|
1677
|
+
*/
|
|
1678
|
+
export const UrlSuccessActionData = (() => {
|
|
1679
|
+
const defaults = () => ({});
|
|
1680
|
+
const create = (() => {
|
|
1681
|
+
return uniffiCreateRecord(defaults);
|
|
1682
|
+
})();
|
|
1683
|
+
return Object.freeze({
|
|
1684
|
+
/**
|
|
1685
|
+
* Create a frozen instance of {@link UrlSuccessActionData}, with defaults specified
|
|
1686
|
+
* in Rust, in the {@link breez_sdk_common} crate.
|
|
1687
|
+
*/
|
|
1688
|
+
create,
|
|
1689
|
+
/**
|
|
1690
|
+
* Create a frozen instance of {@link UrlSuccessActionData}, with defaults specified
|
|
1691
|
+
* in Rust, in the {@link breez_sdk_common} crate.
|
|
1692
|
+
*/
|
|
1693
|
+
new: create,
|
|
1694
|
+
/**
|
|
1695
|
+
* Defaults specified in the {@link breez_sdk_common} crate.
|
|
1696
|
+
*/
|
|
1697
|
+
defaults: () => Object.freeze(defaults())
|
|
1698
|
+
});
|
|
1699
|
+
})();
|
|
1700
|
+
const FfiConverterTypeUrlSuccessActionData = (() => {
|
|
1701
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
1702
|
+
read(from) {
|
|
1703
|
+
return {
|
|
1704
|
+
description: FfiConverterString.read(from),
|
|
1705
|
+
url: FfiConverterString.read(from),
|
|
1706
|
+
matchesCallbackDomain: FfiConverterBool.read(from)
|
|
1707
|
+
};
|
|
1708
|
+
}
|
|
1709
|
+
write(value, into) {
|
|
1710
|
+
FfiConverterString.write(value.description, into);
|
|
1711
|
+
FfiConverterString.write(value.url, into);
|
|
1712
|
+
FfiConverterBool.write(value.matchesCallbackDomain, into);
|
|
1713
|
+
}
|
|
1714
|
+
allocationSize(value) {
|
|
1715
|
+
return FfiConverterString.allocationSize(value.description) + FfiConverterString.allocationSize(value.url) + FfiConverterBool.allocationSize(value.matchesCallbackDomain);
|
|
1716
|
+
}
|
|
1717
|
+
}
|
|
1718
|
+
return new FFIConverter();
|
|
1719
|
+
})();
|
|
1720
|
+
const stringConverter = {
|
|
1721
|
+
stringToBytes: s => uniffiCaller.rustCall(status => nativeModule().ubrn_uniffi_internal_fn_func_ffi__string_to_arraybuffer(s, status)),
|
|
1722
|
+
bytesToString: ab => uniffiCaller.rustCall(status => nativeModule().ubrn_uniffi_internal_fn_func_ffi__arraybuffer_to_string(ab, status)),
|
|
1723
|
+
stringByteLength: s => uniffiCaller.rustCall(status => nativeModule().ubrn_uniffi_internal_fn_func_ffi__string_to_byte_length(s, status))
|
|
1724
|
+
};
|
|
1725
|
+
const FfiConverterString = uniffiCreateFfiConverterString(stringConverter);
|
|
1726
|
+
|
|
1727
|
+
// Enum: AesSuccessActionDataResult
|
|
1728
|
+
export let AesSuccessActionDataResult_Tags = /*#__PURE__*/function (AesSuccessActionDataResult_Tags) {
|
|
1729
|
+
AesSuccessActionDataResult_Tags["Decrypted"] = "Decrypted";
|
|
1730
|
+
AesSuccessActionDataResult_Tags["ErrorStatus"] = "ErrorStatus";
|
|
1731
|
+
return AesSuccessActionDataResult_Tags;
|
|
1732
|
+
}({});
|
|
1733
|
+
/**
|
|
1734
|
+
* Result of decryption of [`AesSuccessActionData`] payload
|
|
1735
|
+
*/
|
|
1736
|
+
export const AesSuccessActionDataResult = (() => {
|
|
1737
|
+
class Decrypted_ extends UniffiEnum {
|
|
1738
|
+
/**
|
|
1739
|
+
* @private
|
|
1740
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1741
|
+
*/
|
|
1742
|
+
[uniffiTypeNameSymbol] = 'AesSuccessActionDataResult';
|
|
1743
|
+
tag = AesSuccessActionDataResult_Tags.Decrypted;
|
|
1744
|
+
constructor(inner) {
|
|
1745
|
+
super('AesSuccessActionDataResult', 'Decrypted');
|
|
1746
|
+
this.inner = Object.freeze(inner);
|
|
1747
|
+
}
|
|
1748
|
+
static new(inner) {
|
|
1749
|
+
return new Decrypted_(inner);
|
|
1750
|
+
}
|
|
1751
|
+
static instanceOf(obj) {
|
|
1752
|
+
return obj.tag === AesSuccessActionDataResult_Tags.Decrypted;
|
|
1753
|
+
}
|
|
1754
|
+
}
|
|
1755
|
+
class ErrorStatus_ extends UniffiEnum {
|
|
1756
|
+
/**
|
|
1757
|
+
* @private
|
|
1758
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1759
|
+
*/
|
|
1760
|
+
[uniffiTypeNameSymbol] = 'AesSuccessActionDataResult';
|
|
1761
|
+
tag = AesSuccessActionDataResult_Tags.ErrorStatus;
|
|
1762
|
+
constructor(inner) {
|
|
1763
|
+
super('AesSuccessActionDataResult', 'ErrorStatus');
|
|
1764
|
+
this.inner = Object.freeze(inner);
|
|
1765
|
+
}
|
|
1766
|
+
static new(inner) {
|
|
1767
|
+
return new ErrorStatus_(inner);
|
|
1768
|
+
}
|
|
1769
|
+
static instanceOf(obj) {
|
|
1770
|
+
return obj.tag === AesSuccessActionDataResult_Tags.ErrorStatus;
|
|
1771
|
+
}
|
|
1772
|
+
}
|
|
1773
|
+
function instanceOf(obj) {
|
|
1774
|
+
return obj[uniffiTypeNameSymbol] === 'AesSuccessActionDataResult';
|
|
1775
|
+
}
|
|
1776
|
+
return Object.freeze({
|
|
1777
|
+
instanceOf,
|
|
1778
|
+
Decrypted: Decrypted_,
|
|
1779
|
+
ErrorStatus: ErrorStatus_
|
|
1780
|
+
});
|
|
1781
|
+
})();
|
|
1782
|
+
|
|
1783
|
+
/**
|
|
1784
|
+
* Result of decryption of [`AesSuccessActionData`] payload
|
|
1785
|
+
*/
|
|
1786
|
+
|
|
1787
|
+
// FfiConverter for enum AesSuccessActionDataResult
|
|
1788
|
+
const FfiConverterTypeAesSuccessActionDataResult = (() => {
|
|
1789
|
+
const ordinalConverter = FfiConverterInt32;
|
|
1790
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
1791
|
+
read(from) {
|
|
1792
|
+
switch (ordinalConverter.read(from)) {
|
|
1793
|
+
case 1:
|
|
1794
|
+
return new AesSuccessActionDataResult.Decrypted({
|
|
1795
|
+
data: FfiConverterTypeAesSuccessActionDataDecrypted.read(from)
|
|
1796
|
+
});
|
|
1797
|
+
case 2:
|
|
1798
|
+
return new AesSuccessActionDataResult.ErrorStatus({
|
|
1799
|
+
reason: FfiConverterString.read(from)
|
|
1800
|
+
});
|
|
1801
|
+
default:
|
|
1802
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
1803
|
+
}
|
|
1804
|
+
}
|
|
1805
|
+
write(value, into) {
|
|
1806
|
+
switch (value.tag) {
|
|
1807
|
+
case AesSuccessActionDataResult_Tags.Decrypted:
|
|
1808
|
+
{
|
|
1809
|
+
ordinalConverter.write(1, into);
|
|
1810
|
+
const inner = value.inner;
|
|
1811
|
+
FfiConverterTypeAesSuccessActionDataDecrypted.write(inner.data, into);
|
|
1812
|
+
return;
|
|
1813
|
+
}
|
|
1814
|
+
case AesSuccessActionDataResult_Tags.ErrorStatus:
|
|
1815
|
+
{
|
|
1816
|
+
ordinalConverter.write(2, into);
|
|
1817
|
+
const inner = value.inner;
|
|
1818
|
+
FfiConverterString.write(inner.reason, into);
|
|
1819
|
+
return;
|
|
1820
|
+
}
|
|
1821
|
+
default:
|
|
1822
|
+
// Throwing from here means that AesSuccessActionDataResult_Tags hasn't matched an ordinal.
|
|
1823
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
1824
|
+
}
|
|
1825
|
+
}
|
|
1826
|
+
allocationSize(value) {
|
|
1827
|
+
switch (value.tag) {
|
|
1828
|
+
case AesSuccessActionDataResult_Tags.Decrypted:
|
|
1829
|
+
{
|
|
1830
|
+
const inner = value.inner;
|
|
1831
|
+
let size = ordinalConverter.allocationSize(1);
|
|
1832
|
+
size += FfiConverterTypeAesSuccessActionDataDecrypted.allocationSize(inner.data);
|
|
1833
|
+
return size;
|
|
1834
|
+
}
|
|
1835
|
+
case AesSuccessActionDataResult_Tags.ErrorStatus:
|
|
1836
|
+
{
|
|
1837
|
+
const inner = value.inner;
|
|
1838
|
+
let size = ordinalConverter.allocationSize(2);
|
|
1839
|
+
size += FfiConverterString.allocationSize(inner.reason);
|
|
1840
|
+
return size;
|
|
1841
|
+
}
|
|
1842
|
+
default:
|
|
1843
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
1844
|
+
}
|
|
1845
|
+
}
|
|
1846
|
+
}
|
|
1847
|
+
return new FFIConverter();
|
|
1848
|
+
})();
|
|
1849
|
+
|
|
1850
|
+
// Enum: Amount
|
|
1851
|
+
export let Amount_Tags = /*#__PURE__*/function (Amount_Tags) {
|
|
1852
|
+
Amount_Tags["Bitcoin"] = "Bitcoin";
|
|
1853
|
+
Amount_Tags["Currency"] = "Currency";
|
|
1854
|
+
return Amount_Tags;
|
|
1855
|
+
}({});
|
|
1856
|
+
export const Amount = (() => {
|
|
1857
|
+
class Bitcoin_ extends UniffiEnum {
|
|
1858
|
+
/**
|
|
1859
|
+
* @private
|
|
1860
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1861
|
+
*/
|
|
1862
|
+
[uniffiTypeNameSymbol] = 'Amount';
|
|
1863
|
+
tag = Amount_Tags.Bitcoin;
|
|
1864
|
+
constructor(inner) {
|
|
1865
|
+
super('Amount', 'Bitcoin');
|
|
1866
|
+
this.inner = Object.freeze(inner);
|
|
1867
|
+
}
|
|
1868
|
+
static new(inner) {
|
|
1869
|
+
return new Bitcoin_(inner);
|
|
1870
|
+
}
|
|
1871
|
+
static instanceOf(obj) {
|
|
1872
|
+
return obj.tag === Amount_Tags.Bitcoin;
|
|
1873
|
+
}
|
|
1874
|
+
}
|
|
1875
|
+
/**
|
|
1876
|
+
* An amount of currency specified using ISO 4712.
|
|
1877
|
+
*/
|
|
1878
|
+
class Currency_ extends UniffiEnum {
|
|
1879
|
+
/**
|
|
1880
|
+
* @private
|
|
1881
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1882
|
+
*/
|
|
1883
|
+
[uniffiTypeNameSymbol] = 'Amount';
|
|
1884
|
+
tag = Amount_Tags.Currency;
|
|
1885
|
+
constructor(inner) {
|
|
1886
|
+
super('Amount', 'Currency');
|
|
1887
|
+
this.inner = Object.freeze(inner);
|
|
1888
|
+
}
|
|
1889
|
+
static new(inner) {
|
|
1890
|
+
return new Currency_(inner);
|
|
1891
|
+
}
|
|
1892
|
+
static instanceOf(obj) {
|
|
1893
|
+
return obj.tag === Amount_Tags.Currency;
|
|
1894
|
+
}
|
|
1895
|
+
}
|
|
1896
|
+
function instanceOf(obj) {
|
|
1897
|
+
return obj[uniffiTypeNameSymbol] === 'Amount';
|
|
1898
|
+
}
|
|
1899
|
+
return Object.freeze({
|
|
1900
|
+
instanceOf,
|
|
1901
|
+
Bitcoin: Bitcoin_,
|
|
1902
|
+
Currency: Currency_
|
|
1903
|
+
});
|
|
1904
|
+
})();
|
|
1905
|
+
// FfiConverter for enum Amount
|
|
1906
|
+
const FfiConverterTypeAmount = (() => {
|
|
1907
|
+
const ordinalConverter = FfiConverterInt32;
|
|
1908
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
1909
|
+
read(from) {
|
|
1910
|
+
switch (ordinalConverter.read(from)) {
|
|
1911
|
+
case 1:
|
|
1912
|
+
return new Amount.Bitcoin({
|
|
1913
|
+
amountMsat: FfiConverterUInt64.read(from)
|
|
1914
|
+
});
|
|
1915
|
+
case 2:
|
|
1916
|
+
return new Amount.Currency({
|
|
1917
|
+
iso4217Code: FfiConverterString.read(from),
|
|
1918
|
+
fractionalAmount: FfiConverterUInt64.read(from)
|
|
1919
|
+
});
|
|
1920
|
+
default:
|
|
1921
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
1922
|
+
}
|
|
1923
|
+
}
|
|
1924
|
+
write(value, into) {
|
|
1925
|
+
switch (value.tag) {
|
|
1926
|
+
case Amount_Tags.Bitcoin:
|
|
1927
|
+
{
|
|
1928
|
+
ordinalConverter.write(1, into);
|
|
1929
|
+
const inner = value.inner;
|
|
1930
|
+
FfiConverterUInt64.write(inner.amountMsat, into);
|
|
1931
|
+
return;
|
|
1932
|
+
}
|
|
1933
|
+
case Amount_Tags.Currency:
|
|
1934
|
+
{
|
|
1935
|
+
ordinalConverter.write(2, into);
|
|
1936
|
+
const inner = value.inner;
|
|
1937
|
+
FfiConverterString.write(inner.iso4217Code, into);
|
|
1938
|
+
FfiConverterUInt64.write(inner.fractionalAmount, into);
|
|
1939
|
+
return;
|
|
1940
|
+
}
|
|
1941
|
+
default:
|
|
1942
|
+
// Throwing from here means that Amount_Tags hasn't matched an ordinal.
|
|
1943
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
1944
|
+
}
|
|
1945
|
+
}
|
|
1946
|
+
allocationSize(value) {
|
|
1947
|
+
switch (value.tag) {
|
|
1948
|
+
case Amount_Tags.Bitcoin:
|
|
1949
|
+
{
|
|
1950
|
+
const inner = value.inner;
|
|
1951
|
+
let size = ordinalConverter.allocationSize(1);
|
|
1952
|
+
size += FfiConverterUInt64.allocationSize(inner.amountMsat);
|
|
1953
|
+
return size;
|
|
1954
|
+
}
|
|
1955
|
+
case Amount_Tags.Currency:
|
|
1956
|
+
{
|
|
1957
|
+
const inner = value.inner;
|
|
1958
|
+
let size = ordinalConverter.allocationSize(2);
|
|
1959
|
+
size += FfiConverterString.allocationSize(inner.iso4217Code);
|
|
1960
|
+
size += FfiConverterUInt64.allocationSize(inner.fractionalAmount);
|
|
1961
|
+
return size;
|
|
1962
|
+
}
|
|
1963
|
+
default:
|
|
1964
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
1965
|
+
}
|
|
1966
|
+
}
|
|
1967
|
+
}
|
|
1968
|
+
return new FFIConverter();
|
|
1969
|
+
})();
|
|
1970
|
+
export let BitcoinNetwork = /*#__PURE__*/function (BitcoinNetwork) {
|
|
1971
|
+
/**
|
|
1972
|
+
* Mainnet
|
|
1973
|
+
*/
|
|
1974
|
+
BitcoinNetwork[BitcoinNetwork["Bitcoin"] = 0] = "Bitcoin";
|
|
1975
|
+
BitcoinNetwork[BitcoinNetwork["Testnet3"] = 1] = "Testnet3";
|
|
1976
|
+
BitcoinNetwork[BitcoinNetwork["Testnet4"] = 2] = "Testnet4";
|
|
1977
|
+
BitcoinNetwork[BitcoinNetwork["Signet"] = 3] = "Signet";
|
|
1978
|
+
BitcoinNetwork[BitcoinNetwork["Regtest"] = 4] = "Regtest";
|
|
1979
|
+
return BitcoinNetwork;
|
|
1980
|
+
}({});
|
|
1981
|
+
const FfiConverterTypeBitcoinNetwork = (() => {
|
|
1982
|
+
const ordinalConverter = FfiConverterInt32;
|
|
1983
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
1984
|
+
read(from) {
|
|
1985
|
+
switch (ordinalConverter.read(from)) {
|
|
1986
|
+
case 1:
|
|
1987
|
+
return BitcoinNetwork.Bitcoin;
|
|
1988
|
+
case 2:
|
|
1989
|
+
return BitcoinNetwork.Testnet3;
|
|
1990
|
+
case 3:
|
|
1991
|
+
return BitcoinNetwork.Testnet4;
|
|
1992
|
+
case 4:
|
|
1993
|
+
return BitcoinNetwork.Signet;
|
|
1994
|
+
case 5:
|
|
1995
|
+
return BitcoinNetwork.Regtest;
|
|
1996
|
+
default:
|
|
1997
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
1998
|
+
}
|
|
1999
|
+
}
|
|
2000
|
+
write(value, into) {
|
|
2001
|
+
switch (value) {
|
|
2002
|
+
case BitcoinNetwork.Bitcoin:
|
|
2003
|
+
return ordinalConverter.write(1, into);
|
|
2004
|
+
case BitcoinNetwork.Testnet3:
|
|
2005
|
+
return ordinalConverter.write(2, into);
|
|
2006
|
+
case BitcoinNetwork.Testnet4:
|
|
2007
|
+
return ordinalConverter.write(3, into);
|
|
2008
|
+
case BitcoinNetwork.Signet:
|
|
2009
|
+
return ordinalConverter.write(4, into);
|
|
2010
|
+
case BitcoinNetwork.Regtest:
|
|
2011
|
+
return ordinalConverter.write(5, into);
|
|
2012
|
+
}
|
|
2013
|
+
}
|
|
2014
|
+
allocationSize(value) {
|
|
2015
|
+
return ordinalConverter.allocationSize(0);
|
|
2016
|
+
}
|
|
2017
|
+
}
|
|
2018
|
+
return new FFIConverter();
|
|
2019
|
+
})();
|
|
2020
|
+
|
|
2021
|
+
// Enum: InputType
|
|
2022
|
+
export let InputType_Tags = /*#__PURE__*/function (InputType_Tags) {
|
|
2023
|
+
InputType_Tags["BitcoinAddress"] = "BitcoinAddress";
|
|
2024
|
+
InputType_Tags["Bolt11Invoice"] = "Bolt11Invoice";
|
|
2025
|
+
InputType_Tags["Bolt12Invoice"] = "Bolt12Invoice";
|
|
2026
|
+
InputType_Tags["Bolt12Offer"] = "Bolt12Offer";
|
|
2027
|
+
InputType_Tags["LightningAddress"] = "LightningAddress";
|
|
2028
|
+
InputType_Tags["LnurlPay"] = "LnurlPay";
|
|
2029
|
+
InputType_Tags["SilentPaymentAddress"] = "SilentPaymentAddress";
|
|
2030
|
+
InputType_Tags["LnurlAuth"] = "LnurlAuth";
|
|
2031
|
+
InputType_Tags["Url"] = "Url";
|
|
2032
|
+
InputType_Tags["Bip21"] = "Bip21";
|
|
2033
|
+
InputType_Tags["Bolt12InvoiceRequest"] = "Bolt12InvoiceRequest";
|
|
2034
|
+
InputType_Tags["LnurlWithdraw"] = "LnurlWithdraw";
|
|
2035
|
+
InputType_Tags["SparkAddress"] = "SparkAddress";
|
|
2036
|
+
return InputType_Tags;
|
|
2037
|
+
}({});
|
|
2038
|
+
export const InputType = (() => {
|
|
2039
|
+
class BitcoinAddress_ extends UniffiEnum {
|
|
2040
|
+
/**
|
|
2041
|
+
* @private
|
|
2042
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2043
|
+
*/
|
|
2044
|
+
[uniffiTypeNameSymbol] = 'InputType';
|
|
2045
|
+
tag = InputType_Tags.BitcoinAddress;
|
|
2046
|
+
constructor(v0) {
|
|
2047
|
+
super('InputType', 'BitcoinAddress');
|
|
2048
|
+
this.inner = Object.freeze([v0]);
|
|
2049
|
+
}
|
|
2050
|
+
static new(v0) {
|
|
2051
|
+
return new BitcoinAddress_(v0);
|
|
2052
|
+
}
|
|
2053
|
+
static instanceOf(obj) {
|
|
2054
|
+
return obj.tag === InputType_Tags.BitcoinAddress;
|
|
2055
|
+
}
|
|
2056
|
+
}
|
|
2057
|
+
class Bolt11Invoice_ extends UniffiEnum {
|
|
2058
|
+
/**
|
|
2059
|
+
* @private
|
|
2060
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2061
|
+
*/
|
|
2062
|
+
[uniffiTypeNameSymbol] = 'InputType';
|
|
2063
|
+
tag = InputType_Tags.Bolt11Invoice;
|
|
2064
|
+
constructor(v0) {
|
|
2065
|
+
super('InputType', 'Bolt11Invoice');
|
|
2066
|
+
this.inner = Object.freeze([v0]);
|
|
2067
|
+
}
|
|
2068
|
+
static new(v0) {
|
|
2069
|
+
return new Bolt11Invoice_(v0);
|
|
2070
|
+
}
|
|
2071
|
+
static instanceOf(obj) {
|
|
2072
|
+
return obj.tag === InputType_Tags.Bolt11Invoice;
|
|
2073
|
+
}
|
|
2074
|
+
}
|
|
2075
|
+
class Bolt12Invoice_ extends UniffiEnum {
|
|
2076
|
+
/**
|
|
2077
|
+
* @private
|
|
2078
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2079
|
+
*/
|
|
2080
|
+
[uniffiTypeNameSymbol] = 'InputType';
|
|
2081
|
+
tag = InputType_Tags.Bolt12Invoice;
|
|
2082
|
+
constructor(v0) {
|
|
2083
|
+
super('InputType', 'Bolt12Invoice');
|
|
2084
|
+
this.inner = Object.freeze([v0]);
|
|
2085
|
+
}
|
|
2086
|
+
static new(v0) {
|
|
2087
|
+
return new Bolt12Invoice_(v0);
|
|
2088
|
+
}
|
|
2089
|
+
static instanceOf(obj) {
|
|
2090
|
+
return obj.tag === InputType_Tags.Bolt12Invoice;
|
|
2091
|
+
}
|
|
2092
|
+
}
|
|
2093
|
+
class Bolt12Offer_ extends UniffiEnum {
|
|
2094
|
+
/**
|
|
2095
|
+
* @private
|
|
2096
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2097
|
+
*/
|
|
2098
|
+
[uniffiTypeNameSymbol] = 'InputType';
|
|
2099
|
+
tag = InputType_Tags.Bolt12Offer;
|
|
2100
|
+
constructor(v0) {
|
|
2101
|
+
super('InputType', 'Bolt12Offer');
|
|
2102
|
+
this.inner = Object.freeze([v0]);
|
|
2103
|
+
}
|
|
2104
|
+
static new(v0) {
|
|
2105
|
+
return new Bolt12Offer_(v0);
|
|
2106
|
+
}
|
|
2107
|
+
static instanceOf(obj) {
|
|
2108
|
+
return obj.tag === InputType_Tags.Bolt12Offer;
|
|
2109
|
+
}
|
|
2110
|
+
}
|
|
2111
|
+
class LightningAddress_ extends UniffiEnum {
|
|
2112
|
+
/**
|
|
2113
|
+
* @private
|
|
2114
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2115
|
+
*/
|
|
2116
|
+
[uniffiTypeNameSymbol] = 'InputType';
|
|
2117
|
+
tag = InputType_Tags.LightningAddress;
|
|
2118
|
+
constructor(v0) {
|
|
2119
|
+
super('InputType', 'LightningAddress');
|
|
2120
|
+
this.inner = Object.freeze([v0]);
|
|
2121
|
+
}
|
|
2122
|
+
static new(v0) {
|
|
2123
|
+
return new LightningAddress_(v0);
|
|
2124
|
+
}
|
|
2125
|
+
static instanceOf(obj) {
|
|
2126
|
+
return obj.tag === InputType_Tags.LightningAddress;
|
|
2127
|
+
}
|
|
2128
|
+
}
|
|
2129
|
+
class LnurlPay_ extends UniffiEnum {
|
|
2130
|
+
/**
|
|
2131
|
+
* @private
|
|
2132
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2133
|
+
*/
|
|
2134
|
+
[uniffiTypeNameSymbol] = 'InputType';
|
|
2135
|
+
tag = InputType_Tags.LnurlPay;
|
|
2136
|
+
constructor(v0) {
|
|
2137
|
+
super('InputType', 'LnurlPay');
|
|
2138
|
+
this.inner = Object.freeze([v0]);
|
|
2139
|
+
}
|
|
2140
|
+
static new(v0) {
|
|
2141
|
+
return new LnurlPay_(v0);
|
|
2142
|
+
}
|
|
2143
|
+
static instanceOf(obj) {
|
|
2144
|
+
return obj.tag === InputType_Tags.LnurlPay;
|
|
2145
|
+
}
|
|
2146
|
+
}
|
|
2147
|
+
class SilentPaymentAddress_ extends UniffiEnum {
|
|
2148
|
+
/**
|
|
2149
|
+
* @private
|
|
2150
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2151
|
+
*/
|
|
2152
|
+
[uniffiTypeNameSymbol] = 'InputType';
|
|
2153
|
+
tag = InputType_Tags.SilentPaymentAddress;
|
|
2154
|
+
constructor(v0) {
|
|
2155
|
+
super('InputType', 'SilentPaymentAddress');
|
|
2156
|
+
this.inner = Object.freeze([v0]);
|
|
2157
|
+
}
|
|
2158
|
+
static new(v0) {
|
|
2159
|
+
return new SilentPaymentAddress_(v0);
|
|
2160
|
+
}
|
|
2161
|
+
static instanceOf(obj) {
|
|
2162
|
+
return obj.tag === InputType_Tags.SilentPaymentAddress;
|
|
2163
|
+
}
|
|
2164
|
+
}
|
|
2165
|
+
class LnurlAuth_ extends UniffiEnum {
|
|
2166
|
+
/**
|
|
2167
|
+
* @private
|
|
2168
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2169
|
+
*/
|
|
2170
|
+
[uniffiTypeNameSymbol] = 'InputType';
|
|
2171
|
+
tag = InputType_Tags.LnurlAuth;
|
|
2172
|
+
constructor(v0) {
|
|
2173
|
+
super('InputType', 'LnurlAuth');
|
|
2174
|
+
this.inner = Object.freeze([v0]);
|
|
2175
|
+
}
|
|
2176
|
+
static new(v0) {
|
|
2177
|
+
return new LnurlAuth_(v0);
|
|
2178
|
+
}
|
|
2179
|
+
static instanceOf(obj) {
|
|
2180
|
+
return obj.tag === InputType_Tags.LnurlAuth;
|
|
2181
|
+
}
|
|
2182
|
+
}
|
|
2183
|
+
class Url_ extends UniffiEnum {
|
|
2184
|
+
/**
|
|
2185
|
+
* @private
|
|
2186
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2187
|
+
*/
|
|
2188
|
+
[uniffiTypeNameSymbol] = 'InputType';
|
|
2189
|
+
tag = InputType_Tags.Url;
|
|
2190
|
+
constructor(v0) {
|
|
2191
|
+
super('InputType', 'Url');
|
|
2192
|
+
this.inner = Object.freeze([v0]);
|
|
2193
|
+
}
|
|
2194
|
+
static new(v0) {
|
|
2195
|
+
return new Url_(v0);
|
|
2196
|
+
}
|
|
2197
|
+
static instanceOf(obj) {
|
|
2198
|
+
return obj.tag === InputType_Tags.Url;
|
|
2199
|
+
}
|
|
2200
|
+
}
|
|
2201
|
+
class Bip21_ extends UniffiEnum {
|
|
2202
|
+
/**
|
|
2203
|
+
* @private
|
|
2204
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2205
|
+
*/
|
|
2206
|
+
[uniffiTypeNameSymbol] = 'InputType';
|
|
2207
|
+
tag = InputType_Tags.Bip21;
|
|
2208
|
+
constructor(v0) {
|
|
2209
|
+
super('InputType', 'Bip21');
|
|
2210
|
+
this.inner = Object.freeze([v0]);
|
|
2211
|
+
}
|
|
2212
|
+
static new(v0) {
|
|
2213
|
+
return new Bip21_(v0);
|
|
2214
|
+
}
|
|
2215
|
+
static instanceOf(obj) {
|
|
2216
|
+
return obj.tag === InputType_Tags.Bip21;
|
|
2217
|
+
}
|
|
2218
|
+
}
|
|
2219
|
+
class Bolt12InvoiceRequest_ extends UniffiEnum {
|
|
2220
|
+
/**
|
|
2221
|
+
* @private
|
|
2222
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2223
|
+
*/
|
|
2224
|
+
[uniffiTypeNameSymbol] = 'InputType';
|
|
2225
|
+
tag = InputType_Tags.Bolt12InvoiceRequest;
|
|
2226
|
+
constructor(v0) {
|
|
2227
|
+
super('InputType', 'Bolt12InvoiceRequest');
|
|
2228
|
+
this.inner = Object.freeze([v0]);
|
|
2229
|
+
}
|
|
2230
|
+
static new(v0) {
|
|
2231
|
+
return new Bolt12InvoiceRequest_(v0);
|
|
2232
|
+
}
|
|
2233
|
+
static instanceOf(obj) {
|
|
2234
|
+
return obj.tag === InputType_Tags.Bolt12InvoiceRequest;
|
|
2235
|
+
}
|
|
2236
|
+
}
|
|
2237
|
+
class LnurlWithdraw_ extends UniffiEnum {
|
|
2238
|
+
/**
|
|
2239
|
+
* @private
|
|
2240
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2241
|
+
*/
|
|
2242
|
+
[uniffiTypeNameSymbol] = 'InputType';
|
|
2243
|
+
tag = InputType_Tags.LnurlWithdraw;
|
|
2244
|
+
constructor(v0) {
|
|
2245
|
+
super('InputType', 'LnurlWithdraw');
|
|
2246
|
+
this.inner = Object.freeze([v0]);
|
|
2247
|
+
}
|
|
2248
|
+
static new(v0) {
|
|
2249
|
+
return new LnurlWithdraw_(v0);
|
|
2250
|
+
}
|
|
2251
|
+
static instanceOf(obj) {
|
|
2252
|
+
return obj.tag === InputType_Tags.LnurlWithdraw;
|
|
2253
|
+
}
|
|
2254
|
+
}
|
|
2255
|
+
class SparkAddress_ extends UniffiEnum {
|
|
2256
|
+
/**
|
|
2257
|
+
* @private
|
|
2258
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2259
|
+
*/
|
|
2260
|
+
[uniffiTypeNameSymbol] = 'InputType';
|
|
2261
|
+
tag = InputType_Tags.SparkAddress;
|
|
2262
|
+
constructor(v0) {
|
|
2263
|
+
super('InputType', 'SparkAddress');
|
|
2264
|
+
this.inner = Object.freeze([v0]);
|
|
2265
|
+
}
|
|
2266
|
+
static new(v0) {
|
|
2267
|
+
return new SparkAddress_(v0);
|
|
2268
|
+
}
|
|
2269
|
+
static instanceOf(obj) {
|
|
2270
|
+
return obj.tag === InputType_Tags.SparkAddress;
|
|
2271
|
+
}
|
|
2272
|
+
}
|
|
2273
|
+
function instanceOf(obj) {
|
|
2274
|
+
return obj[uniffiTypeNameSymbol] === 'InputType';
|
|
2275
|
+
}
|
|
2276
|
+
return Object.freeze({
|
|
2277
|
+
instanceOf,
|
|
2278
|
+
BitcoinAddress: BitcoinAddress_,
|
|
2279
|
+
Bolt11Invoice: Bolt11Invoice_,
|
|
2280
|
+
Bolt12Invoice: Bolt12Invoice_,
|
|
2281
|
+
Bolt12Offer: Bolt12Offer_,
|
|
2282
|
+
LightningAddress: LightningAddress_,
|
|
2283
|
+
LnurlPay: LnurlPay_,
|
|
2284
|
+
SilentPaymentAddress: SilentPaymentAddress_,
|
|
2285
|
+
LnurlAuth: LnurlAuth_,
|
|
2286
|
+
Url: Url_,
|
|
2287
|
+
Bip21: Bip21_,
|
|
2288
|
+
Bolt12InvoiceRequest: Bolt12InvoiceRequest_,
|
|
2289
|
+
LnurlWithdraw: LnurlWithdraw_,
|
|
2290
|
+
SparkAddress: SparkAddress_
|
|
2291
|
+
});
|
|
2292
|
+
})();
|
|
2293
|
+
// FfiConverter for enum InputType
|
|
2294
|
+
const FfiConverterTypeInputType = (() => {
|
|
2295
|
+
const ordinalConverter = FfiConverterInt32;
|
|
2296
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
2297
|
+
read(from) {
|
|
2298
|
+
switch (ordinalConverter.read(from)) {
|
|
2299
|
+
case 1:
|
|
2300
|
+
return new InputType.BitcoinAddress(FfiConverterTypeBitcoinAddressDetails.read(from));
|
|
2301
|
+
case 2:
|
|
2302
|
+
return new InputType.Bolt11Invoice(FfiConverterTypeBolt11InvoiceDetails.read(from));
|
|
2303
|
+
case 3:
|
|
2304
|
+
return new InputType.Bolt12Invoice(FfiConverterTypeBolt12InvoiceDetails.read(from));
|
|
2305
|
+
case 4:
|
|
2306
|
+
return new InputType.Bolt12Offer(FfiConverterTypeBolt12OfferDetails.read(from));
|
|
2307
|
+
case 5:
|
|
2308
|
+
return new InputType.LightningAddress(FfiConverterTypeLightningAddressDetails.read(from));
|
|
2309
|
+
case 6:
|
|
2310
|
+
return new InputType.LnurlPay(FfiConverterTypeLnurlPayRequestDetails.read(from));
|
|
2311
|
+
case 7:
|
|
2312
|
+
return new InputType.SilentPaymentAddress(FfiConverterTypeSilentPaymentAddressDetails.read(from));
|
|
2313
|
+
case 8:
|
|
2314
|
+
return new InputType.LnurlAuth(FfiConverterTypeLnurlAuthRequestDetails.read(from));
|
|
2315
|
+
case 9:
|
|
2316
|
+
return new InputType.Url(FfiConverterString.read(from));
|
|
2317
|
+
case 10:
|
|
2318
|
+
return new InputType.Bip21(FfiConverterTypeBip21Details.read(from));
|
|
2319
|
+
case 11:
|
|
2320
|
+
return new InputType.Bolt12InvoiceRequest(FfiConverterTypeBolt12InvoiceRequestDetails.read(from));
|
|
2321
|
+
case 12:
|
|
2322
|
+
return new InputType.LnurlWithdraw(FfiConverterTypeLnurlWithdrawRequestDetails.read(from));
|
|
2323
|
+
case 13:
|
|
2324
|
+
return new InputType.SparkAddress(FfiConverterTypeSparkAddressDetails.read(from));
|
|
2325
|
+
default:
|
|
2326
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
2327
|
+
}
|
|
2328
|
+
}
|
|
2329
|
+
write(value, into) {
|
|
2330
|
+
switch (value.tag) {
|
|
2331
|
+
case InputType_Tags.BitcoinAddress:
|
|
2332
|
+
{
|
|
2333
|
+
ordinalConverter.write(1, into);
|
|
2334
|
+
const inner = value.inner;
|
|
2335
|
+
FfiConverterTypeBitcoinAddressDetails.write(inner[0], into);
|
|
2336
|
+
return;
|
|
2337
|
+
}
|
|
2338
|
+
case InputType_Tags.Bolt11Invoice:
|
|
2339
|
+
{
|
|
2340
|
+
ordinalConverter.write(2, into);
|
|
2341
|
+
const inner = value.inner;
|
|
2342
|
+
FfiConverterTypeBolt11InvoiceDetails.write(inner[0], into);
|
|
2343
|
+
return;
|
|
2344
|
+
}
|
|
2345
|
+
case InputType_Tags.Bolt12Invoice:
|
|
2346
|
+
{
|
|
2347
|
+
ordinalConverter.write(3, into);
|
|
2348
|
+
const inner = value.inner;
|
|
2349
|
+
FfiConverterTypeBolt12InvoiceDetails.write(inner[0], into);
|
|
2350
|
+
return;
|
|
2351
|
+
}
|
|
2352
|
+
case InputType_Tags.Bolt12Offer:
|
|
2353
|
+
{
|
|
2354
|
+
ordinalConverter.write(4, into);
|
|
2355
|
+
const inner = value.inner;
|
|
2356
|
+
FfiConverterTypeBolt12OfferDetails.write(inner[0], into);
|
|
2357
|
+
return;
|
|
2358
|
+
}
|
|
2359
|
+
case InputType_Tags.LightningAddress:
|
|
2360
|
+
{
|
|
2361
|
+
ordinalConverter.write(5, into);
|
|
2362
|
+
const inner = value.inner;
|
|
2363
|
+
FfiConverterTypeLightningAddressDetails.write(inner[0], into);
|
|
2364
|
+
return;
|
|
2365
|
+
}
|
|
2366
|
+
case InputType_Tags.LnurlPay:
|
|
2367
|
+
{
|
|
2368
|
+
ordinalConverter.write(6, into);
|
|
2369
|
+
const inner = value.inner;
|
|
2370
|
+
FfiConverterTypeLnurlPayRequestDetails.write(inner[0], into);
|
|
2371
|
+
return;
|
|
2372
|
+
}
|
|
2373
|
+
case InputType_Tags.SilentPaymentAddress:
|
|
2374
|
+
{
|
|
2375
|
+
ordinalConverter.write(7, into);
|
|
2376
|
+
const inner = value.inner;
|
|
2377
|
+
FfiConverterTypeSilentPaymentAddressDetails.write(inner[0], into);
|
|
2378
|
+
return;
|
|
2379
|
+
}
|
|
2380
|
+
case InputType_Tags.LnurlAuth:
|
|
2381
|
+
{
|
|
2382
|
+
ordinalConverter.write(8, into);
|
|
2383
|
+
const inner = value.inner;
|
|
2384
|
+
FfiConverterTypeLnurlAuthRequestDetails.write(inner[0], into);
|
|
2385
|
+
return;
|
|
2386
|
+
}
|
|
2387
|
+
case InputType_Tags.Url:
|
|
2388
|
+
{
|
|
2389
|
+
ordinalConverter.write(9, into);
|
|
2390
|
+
const inner = value.inner;
|
|
2391
|
+
FfiConverterString.write(inner[0], into);
|
|
2392
|
+
return;
|
|
2393
|
+
}
|
|
2394
|
+
case InputType_Tags.Bip21:
|
|
2395
|
+
{
|
|
2396
|
+
ordinalConverter.write(10, into);
|
|
2397
|
+
const inner = value.inner;
|
|
2398
|
+
FfiConverterTypeBip21Details.write(inner[0], into);
|
|
2399
|
+
return;
|
|
2400
|
+
}
|
|
2401
|
+
case InputType_Tags.Bolt12InvoiceRequest:
|
|
2402
|
+
{
|
|
2403
|
+
ordinalConverter.write(11, into);
|
|
2404
|
+
const inner = value.inner;
|
|
2405
|
+
FfiConverterTypeBolt12InvoiceRequestDetails.write(inner[0], into);
|
|
2406
|
+
return;
|
|
2407
|
+
}
|
|
2408
|
+
case InputType_Tags.LnurlWithdraw:
|
|
2409
|
+
{
|
|
2410
|
+
ordinalConverter.write(12, into);
|
|
2411
|
+
const inner = value.inner;
|
|
2412
|
+
FfiConverterTypeLnurlWithdrawRequestDetails.write(inner[0], into);
|
|
2413
|
+
return;
|
|
2414
|
+
}
|
|
2415
|
+
case InputType_Tags.SparkAddress:
|
|
2416
|
+
{
|
|
2417
|
+
ordinalConverter.write(13, into);
|
|
2418
|
+
const inner = value.inner;
|
|
2419
|
+
FfiConverterTypeSparkAddressDetails.write(inner[0], into);
|
|
2420
|
+
return;
|
|
2421
|
+
}
|
|
2422
|
+
default:
|
|
2423
|
+
// Throwing from here means that InputType_Tags hasn't matched an ordinal.
|
|
2424
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
2425
|
+
}
|
|
2426
|
+
}
|
|
2427
|
+
allocationSize(value) {
|
|
2428
|
+
switch (value.tag) {
|
|
2429
|
+
case InputType_Tags.BitcoinAddress:
|
|
2430
|
+
{
|
|
2431
|
+
const inner = value.inner;
|
|
2432
|
+
let size = ordinalConverter.allocationSize(1);
|
|
2433
|
+
size += FfiConverterTypeBitcoinAddressDetails.allocationSize(inner[0]);
|
|
2434
|
+
return size;
|
|
2435
|
+
}
|
|
2436
|
+
case InputType_Tags.Bolt11Invoice:
|
|
2437
|
+
{
|
|
2438
|
+
const inner = value.inner;
|
|
2439
|
+
let size = ordinalConverter.allocationSize(2);
|
|
2440
|
+
size += FfiConverterTypeBolt11InvoiceDetails.allocationSize(inner[0]);
|
|
2441
|
+
return size;
|
|
2442
|
+
}
|
|
2443
|
+
case InputType_Tags.Bolt12Invoice:
|
|
2444
|
+
{
|
|
2445
|
+
const inner = value.inner;
|
|
2446
|
+
let size = ordinalConverter.allocationSize(3);
|
|
2447
|
+
size += FfiConverterTypeBolt12InvoiceDetails.allocationSize(inner[0]);
|
|
2448
|
+
return size;
|
|
2449
|
+
}
|
|
2450
|
+
case InputType_Tags.Bolt12Offer:
|
|
2451
|
+
{
|
|
2452
|
+
const inner = value.inner;
|
|
2453
|
+
let size = ordinalConverter.allocationSize(4);
|
|
2454
|
+
size += FfiConverterTypeBolt12OfferDetails.allocationSize(inner[0]);
|
|
2455
|
+
return size;
|
|
2456
|
+
}
|
|
2457
|
+
case InputType_Tags.LightningAddress:
|
|
2458
|
+
{
|
|
2459
|
+
const inner = value.inner;
|
|
2460
|
+
let size = ordinalConverter.allocationSize(5);
|
|
2461
|
+
size += FfiConverterTypeLightningAddressDetails.allocationSize(inner[0]);
|
|
2462
|
+
return size;
|
|
2463
|
+
}
|
|
2464
|
+
case InputType_Tags.LnurlPay:
|
|
2465
|
+
{
|
|
2466
|
+
const inner = value.inner;
|
|
2467
|
+
let size = ordinalConverter.allocationSize(6);
|
|
2468
|
+
size += FfiConverterTypeLnurlPayRequestDetails.allocationSize(inner[0]);
|
|
2469
|
+
return size;
|
|
2470
|
+
}
|
|
2471
|
+
case InputType_Tags.SilentPaymentAddress:
|
|
2472
|
+
{
|
|
2473
|
+
const inner = value.inner;
|
|
2474
|
+
let size = ordinalConverter.allocationSize(7);
|
|
2475
|
+
size += FfiConverterTypeSilentPaymentAddressDetails.allocationSize(inner[0]);
|
|
2476
|
+
return size;
|
|
2477
|
+
}
|
|
2478
|
+
case InputType_Tags.LnurlAuth:
|
|
2479
|
+
{
|
|
2480
|
+
const inner = value.inner;
|
|
2481
|
+
let size = ordinalConverter.allocationSize(8);
|
|
2482
|
+
size += FfiConverterTypeLnurlAuthRequestDetails.allocationSize(inner[0]);
|
|
2483
|
+
return size;
|
|
2484
|
+
}
|
|
2485
|
+
case InputType_Tags.Url:
|
|
2486
|
+
{
|
|
2487
|
+
const inner = value.inner;
|
|
2488
|
+
let size = ordinalConverter.allocationSize(9);
|
|
2489
|
+
size += FfiConverterString.allocationSize(inner[0]);
|
|
2490
|
+
return size;
|
|
2491
|
+
}
|
|
2492
|
+
case InputType_Tags.Bip21:
|
|
2493
|
+
{
|
|
2494
|
+
const inner = value.inner;
|
|
2495
|
+
let size = ordinalConverter.allocationSize(10);
|
|
2496
|
+
size += FfiConverterTypeBip21Details.allocationSize(inner[0]);
|
|
2497
|
+
return size;
|
|
2498
|
+
}
|
|
2499
|
+
case InputType_Tags.Bolt12InvoiceRequest:
|
|
2500
|
+
{
|
|
2501
|
+
const inner = value.inner;
|
|
2502
|
+
let size = ordinalConverter.allocationSize(11);
|
|
2503
|
+
size += FfiConverterTypeBolt12InvoiceRequestDetails.allocationSize(inner[0]);
|
|
2504
|
+
return size;
|
|
2505
|
+
}
|
|
2506
|
+
case InputType_Tags.LnurlWithdraw:
|
|
2507
|
+
{
|
|
2508
|
+
const inner = value.inner;
|
|
2509
|
+
let size = ordinalConverter.allocationSize(12);
|
|
2510
|
+
size += FfiConverterTypeLnurlWithdrawRequestDetails.allocationSize(inner[0]);
|
|
2511
|
+
return size;
|
|
2512
|
+
}
|
|
2513
|
+
case InputType_Tags.SparkAddress:
|
|
2514
|
+
{
|
|
2515
|
+
const inner = value.inner;
|
|
2516
|
+
let size = ordinalConverter.allocationSize(13);
|
|
2517
|
+
size += FfiConverterTypeSparkAddressDetails.allocationSize(inner[0]);
|
|
2518
|
+
return size;
|
|
2519
|
+
}
|
|
2520
|
+
default:
|
|
2521
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
2522
|
+
}
|
|
2523
|
+
}
|
|
2524
|
+
}
|
|
2525
|
+
return new FFIConverter();
|
|
2526
|
+
})();
|
|
2527
|
+
|
|
2528
|
+
// Enum: LnurlCallbackStatus
|
|
2529
|
+
export let LnurlCallbackStatus_Tags = /*#__PURE__*/function (LnurlCallbackStatus_Tags) {
|
|
2530
|
+
LnurlCallbackStatus_Tags["Ok"] = "Ok";
|
|
2531
|
+
LnurlCallbackStatus_Tags["ErrorStatus"] = "ErrorStatus";
|
|
2532
|
+
return LnurlCallbackStatus_Tags;
|
|
2533
|
+
}({});
|
|
2534
|
+
/**
|
|
2535
|
+
* Contains the result of the entire LNURL interaction, as reported by the LNURL endpoint.
|
|
2536
|
+
*
|
|
2537
|
+
* * `Ok` indicates the interaction with the endpoint was valid, and the endpoint
|
|
2538
|
+
* - started to pay the invoice asynchronously in the case of LNURL-withdraw,
|
|
2539
|
+
* - verified the client signature in the case of LNURL-auth
|
|
2540
|
+
* * `Error` indicates a generic issue the LNURL endpoint encountered, including a freetext
|
|
2541
|
+
* description of the reason.
|
|
2542
|
+
*
|
|
2543
|
+
* 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>
|
|
2544
|
+
*/
|
|
2545
|
+
export const LnurlCallbackStatus = (() => {
|
|
2546
|
+
/**
|
|
2547
|
+
* On-wire format is: `{"status": "OK"}`
|
|
2548
|
+
*/
|
|
2549
|
+
class Ok_ extends UniffiEnum {
|
|
2550
|
+
/**
|
|
2551
|
+
* @private
|
|
2552
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2553
|
+
*/
|
|
2554
|
+
[uniffiTypeNameSymbol] = 'LnurlCallbackStatus';
|
|
2555
|
+
tag = LnurlCallbackStatus_Tags.Ok;
|
|
2556
|
+
constructor() {
|
|
2557
|
+
super('LnurlCallbackStatus', 'Ok');
|
|
2558
|
+
}
|
|
2559
|
+
static new() {
|
|
2560
|
+
return new Ok_();
|
|
2561
|
+
}
|
|
2562
|
+
static instanceOf(obj) {
|
|
2563
|
+
return obj.tag === LnurlCallbackStatus_Tags.Ok;
|
|
2564
|
+
}
|
|
2565
|
+
}
|
|
2566
|
+
/**
|
|
2567
|
+
* On-wire format is: `{"status": "ERROR", "reason": "error details..."}`
|
|
2568
|
+
*/
|
|
2569
|
+
class ErrorStatus_ extends UniffiEnum {
|
|
2570
|
+
/**
|
|
2571
|
+
* @private
|
|
2572
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2573
|
+
*/
|
|
2574
|
+
[uniffiTypeNameSymbol] = 'LnurlCallbackStatus';
|
|
2575
|
+
tag = LnurlCallbackStatus_Tags.ErrorStatus;
|
|
2576
|
+
constructor(inner) {
|
|
2577
|
+
super('LnurlCallbackStatus', 'ErrorStatus');
|
|
2578
|
+
this.inner = Object.freeze(inner);
|
|
2579
|
+
}
|
|
2580
|
+
static new(inner) {
|
|
2581
|
+
return new ErrorStatus_(inner);
|
|
2582
|
+
}
|
|
2583
|
+
static instanceOf(obj) {
|
|
2584
|
+
return obj.tag === LnurlCallbackStatus_Tags.ErrorStatus;
|
|
2585
|
+
}
|
|
2586
|
+
}
|
|
2587
|
+
function instanceOf(obj) {
|
|
2588
|
+
return obj[uniffiTypeNameSymbol] === 'LnurlCallbackStatus';
|
|
2589
|
+
}
|
|
2590
|
+
return Object.freeze({
|
|
2591
|
+
instanceOf,
|
|
2592
|
+
Ok: Ok_,
|
|
2593
|
+
ErrorStatus: ErrorStatus_
|
|
2594
|
+
});
|
|
2595
|
+
})();
|
|
2596
|
+
|
|
2597
|
+
/**
|
|
2598
|
+
* Contains the result of the entire LNURL interaction, as reported by the LNURL endpoint.
|
|
2599
|
+
*
|
|
2600
|
+
* * `Ok` indicates the interaction with the endpoint was valid, and the endpoint
|
|
2601
|
+
* - started to pay the invoice asynchronously in the case of LNURL-withdraw,
|
|
2602
|
+
* - verified the client signature in the case of LNURL-auth
|
|
2603
|
+
* * `Error` indicates a generic issue the LNURL endpoint encountered, including a freetext
|
|
2604
|
+
* description of the reason.
|
|
2605
|
+
*
|
|
2606
|
+
* 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>
|
|
2607
|
+
*/
|
|
2608
|
+
|
|
2609
|
+
// FfiConverter for enum LnurlCallbackStatus
|
|
2610
|
+
const FfiConverterTypeLnurlCallbackStatus = (() => {
|
|
2611
|
+
const ordinalConverter = FfiConverterInt32;
|
|
2612
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
2613
|
+
read(from) {
|
|
2614
|
+
switch (ordinalConverter.read(from)) {
|
|
2615
|
+
case 1:
|
|
2616
|
+
return new LnurlCallbackStatus.Ok();
|
|
2617
|
+
case 2:
|
|
2618
|
+
return new LnurlCallbackStatus.ErrorStatus({
|
|
2619
|
+
errorDetails: FfiConverterTypeLnurlErrorDetails.read(from)
|
|
2620
|
+
});
|
|
2621
|
+
default:
|
|
2622
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
2623
|
+
}
|
|
2624
|
+
}
|
|
2625
|
+
write(value, into) {
|
|
2626
|
+
switch (value.tag) {
|
|
2627
|
+
case LnurlCallbackStatus_Tags.Ok:
|
|
2628
|
+
{
|
|
2629
|
+
ordinalConverter.write(1, into);
|
|
2630
|
+
return;
|
|
2631
|
+
}
|
|
2632
|
+
case LnurlCallbackStatus_Tags.ErrorStatus:
|
|
2633
|
+
{
|
|
2634
|
+
ordinalConverter.write(2, into);
|
|
2635
|
+
const inner = value.inner;
|
|
2636
|
+
FfiConverterTypeLnurlErrorDetails.write(inner.errorDetails, into);
|
|
2637
|
+
return;
|
|
2638
|
+
}
|
|
2639
|
+
default:
|
|
2640
|
+
// Throwing from here means that LnurlCallbackStatus_Tags hasn't matched an ordinal.
|
|
2641
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
2642
|
+
}
|
|
2643
|
+
}
|
|
2644
|
+
allocationSize(value) {
|
|
2645
|
+
switch (value.tag) {
|
|
2646
|
+
case LnurlCallbackStatus_Tags.Ok:
|
|
2647
|
+
{
|
|
2648
|
+
return ordinalConverter.allocationSize(1);
|
|
2649
|
+
}
|
|
2650
|
+
case LnurlCallbackStatus_Tags.ErrorStatus:
|
|
2651
|
+
{
|
|
2652
|
+
const inner = value.inner;
|
|
2653
|
+
let size = ordinalConverter.allocationSize(2);
|
|
2654
|
+
size += FfiConverterTypeLnurlErrorDetails.allocationSize(inner.errorDetails);
|
|
2655
|
+
return size;
|
|
2656
|
+
}
|
|
2657
|
+
default:
|
|
2658
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
2659
|
+
}
|
|
2660
|
+
}
|
|
2661
|
+
}
|
|
2662
|
+
return new FFIConverter();
|
|
2663
|
+
})();
|
|
2664
|
+
|
|
2665
|
+
// Error type: ServiceConnectivityError
|
|
2666
|
+
|
|
2667
|
+
// Enum: ServiceConnectivityError
|
|
2668
|
+
export let ServiceConnectivityError_Tags = /*#__PURE__*/function (ServiceConnectivityError_Tags) {
|
|
2669
|
+
ServiceConnectivityError_Tags["Builder"] = "Builder";
|
|
2670
|
+
ServiceConnectivityError_Tags["Redirect"] = "Redirect";
|
|
2671
|
+
ServiceConnectivityError_Tags["Status"] = "Status";
|
|
2672
|
+
ServiceConnectivityError_Tags["Timeout"] = "Timeout";
|
|
2673
|
+
ServiceConnectivityError_Tags["Request"] = "Request";
|
|
2674
|
+
ServiceConnectivityError_Tags["Connect"] = "Connect";
|
|
2675
|
+
ServiceConnectivityError_Tags["Body"] = "Body";
|
|
2676
|
+
ServiceConnectivityError_Tags["Decode"] = "Decode";
|
|
2677
|
+
ServiceConnectivityError_Tags["Json"] = "Json";
|
|
2678
|
+
ServiceConnectivityError_Tags["Other"] = "Other";
|
|
2679
|
+
return ServiceConnectivityError_Tags;
|
|
2680
|
+
}({});
|
|
2681
|
+
export const ServiceConnectivityError = (() => {
|
|
2682
|
+
class Builder_ extends UniffiError {
|
|
2683
|
+
/**
|
|
2684
|
+
* @private
|
|
2685
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2686
|
+
*/
|
|
2687
|
+
[uniffiTypeNameSymbol] = 'ServiceConnectivityError';
|
|
2688
|
+
tag = ServiceConnectivityError_Tags.Builder;
|
|
2689
|
+
constructor(v0) {
|
|
2690
|
+
super('ServiceConnectivityError', 'Builder');
|
|
2691
|
+
this.inner = Object.freeze([v0]);
|
|
2692
|
+
}
|
|
2693
|
+
static new(v0) {
|
|
2694
|
+
return new Builder_(v0);
|
|
2695
|
+
}
|
|
2696
|
+
static instanceOf(obj) {
|
|
2697
|
+
return obj.tag === ServiceConnectivityError_Tags.Builder;
|
|
2698
|
+
}
|
|
2699
|
+
static hasInner(obj) {
|
|
2700
|
+
return Builder_.instanceOf(obj);
|
|
2701
|
+
}
|
|
2702
|
+
static getInner(obj) {
|
|
2703
|
+
return obj.inner;
|
|
2704
|
+
}
|
|
2705
|
+
}
|
|
2706
|
+
class Redirect_ extends UniffiError {
|
|
2707
|
+
/**
|
|
2708
|
+
* @private
|
|
2709
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2710
|
+
*/
|
|
2711
|
+
[uniffiTypeNameSymbol] = 'ServiceConnectivityError';
|
|
2712
|
+
tag = ServiceConnectivityError_Tags.Redirect;
|
|
2713
|
+
constructor(v0) {
|
|
2714
|
+
super('ServiceConnectivityError', 'Redirect');
|
|
2715
|
+
this.inner = Object.freeze([v0]);
|
|
2716
|
+
}
|
|
2717
|
+
static new(v0) {
|
|
2718
|
+
return new Redirect_(v0);
|
|
2719
|
+
}
|
|
2720
|
+
static instanceOf(obj) {
|
|
2721
|
+
return obj.tag === ServiceConnectivityError_Tags.Redirect;
|
|
2722
|
+
}
|
|
2723
|
+
static hasInner(obj) {
|
|
2724
|
+
return Redirect_.instanceOf(obj);
|
|
2725
|
+
}
|
|
2726
|
+
static getInner(obj) {
|
|
2727
|
+
return obj.inner;
|
|
2728
|
+
}
|
|
2729
|
+
}
|
|
2730
|
+
class Status_ extends UniffiError {
|
|
2731
|
+
/**
|
|
2732
|
+
* @private
|
|
2733
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2734
|
+
*/
|
|
2735
|
+
[uniffiTypeNameSymbol] = 'ServiceConnectivityError';
|
|
2736
|
+
tag = ServiceConnectivityError_Tags.Status;
|
|
2737
|
+
constructor(inner) {
|
|
2738
|
+
super('ServiceConnectivityError', 'Status');
|
|
2739
|
+
this.inner = Object.freeze(inner);
|
|
2740
|
+
}
|
|
2741
|
+
static new(inner) {
|
|
2742
|
+
return new Status_(inner);
|
|
2743
|
+
}
|
|
2744
|
+
static instanceOf(obj) {
|
|
2745
|
+
return obj.tag === ServiceConnectivityError_Tags.Status;
|
|
2746
|
+
}
|
|
2747
|
+
static hasInner(obj) {
|
|
2748
|
+
return Status_.instanceOf(obj);
|
|
2749
|
+
}
|
|
2750
|
+
static getInner(obj) {
|
|
2751
|
+
return obj.inner;
|
|
2752
|
+
}
|
|
2753
|
+
}
|
|
2754
|
+
class Timeout_ extends UniffiError {
|
|
2755
|
+
/**
|
|
2756
|
+
* @private
|
|
2757
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2758
|
+
*/
|
|
2759
|
+
[uniffiTypeNameSymbol] = 'ServiceConnectivityError';
|
|
2760
|
+
tag = ServiceConnectivityError_Tags.Timeout;
|
|
2761
|
+
constructor(v0) {
|
|
2762
|
+
super('ServiceConnectivityError', 'Timeout');
|
|
2763
|
+
this.inner = Object.freeze([v0]);
|
|
2764
|
+
}
|
|
2765
|
+
static new(v0) {
|
|
2766
|
+
return new Timeout_(v0);
|
|
2767
|
+
}
|
|
2768
|
+
static instanceOf(obj) {
|
|
2769
|
+
return obj.tag === ServiceConnectivityError_Tags.Timeout;
|
|
2770
|
+
}
|
|
2771
|
+
static hasInner(obj) {
|
|
2772
|
+
return Timeout_.instanceOf(obj);
|
|
2773
|
+
}
|
|
2774
|
+
static getInner(obj) {
|
|
2775
|
+
return obj.inner;
|
|
2776
|
+
}
|
|
2777
|
+
}
|
|
2778
|
+
class Request_ extends UniffiError {
|
|
2779
|
+
/**
|
|
2780
|
+
* @private
|
|
2781
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2782
|
+
*/
|
|
2783
|
+
[uniffiTypeNameSymbol] = 'ServiceConnectivityError';
|
|
2784
|
+
tag = ServiceConnectivityError_Tags.Request;
|
|
2785
|
+
constructor(v0) {
|
|
2786
|
+
super('ServiceConnectivityError', 'Request');
|
|
2787
|
+
this.inner = Object.freeze([v0]);
|
|
2788
|
+
}
|
|
2789
|
+
static new(v0) {
|
|
2790
|
+
return new Request_(v0);
|
|
2791
|
+
}
|
|
2792
|
+
static instanceOf(obj) {
|
|
2793
|
+
return obj.tag === ServiceConnectivityError_Tags.Request;
|
|
2794
|
+
}
|
|
2795
|
+
static hasInner(obj) {
|
|
2796
|
+
return Request_.instanceOf(obj);
|
|
2797
|
+
}
|
|
2798
|
+
static getInner(obj) {
|
|
2799
|
+
return obj.inner;
|
|
2800
|
+
}
|
|
2801
|
+
}
|
|
2802
|
+
class Connect_ extends UniffiError {
|
|
2803
|
+
/**
|
|
2804
|
+
* @private
|
|
2805
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2806
|
+
*/
|
|
2807
|
+
[uniffiTypeNameSymbol] = 'ServiceConnectivityError';
|
|
2808
|
+
tag = ServiceConnectivityError_Tags.Connect;
|
|
2809
|
+
constructor(v0) {
|
|
2810
|
+
super('ServiceConnectivityError', 'Connect');
|
|
2811
|
+
this.inner = Object.freeze([v0]);
|
|
2812
|
+
}
|
|
2813
|
+
static new(v0) {
|
|
2814
|
+
return new Connect_(v0);
|
|
2815
|
+
}
|
|
2816
|
+
static instanceOf(obj) {
|
|
2817
|
+
return obj.tag === ServiceConnectivityError_Tags.Connect;
|
|
2818
|
+
}
|
|
2819
|
+
static hasInner(obj) {
|
|
2820
|
+
return Connect_.instanceOf(obj);
|
|
2821
|
+
}
|
|
2822
|
+
static getInner(obj) {
|
|
2823
|
+
return obj.inner;
|
|
2824
|
+
}
|
|
2825
|
+
}
|
|
2826
|
+
class Body_ extends UniffiError {
|
|
2827
|
+
/**
|
|
2828
|
+
* @private
|
|
2829
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2830
|
+
*/
|
|
2831
|
+
[uniffiTypeNameSymbol] = 'ServiceConnectivityError';
|
|
2832
|
+
tag = ServiceConnectivityError_Tags.Body;
|
|
2833
|
+
constructor(v0) {
|
|
2834
|
+
super('ServiceConnectivityError', 'Body');
|
|
2835
|
+
this.inner = Object.freeze([v0]);
|
|
2836
|
+
}
|
|
2837
|
+
static new(v0) {
|
|
2838
|
+
return new Body_(v0);
|
|
2839
|
+
}
|
|
2840
|
+
static instanceOf(obj) {
|
|
2841
|
+
return obj.tag === ServiceConnectivityError_Tags.Body;
|
|
2842
|
+
}
|
|
2843
|
+
static hasInner(obj) {
|
|
2844
|
+
return Body_.instanceOf(obj);
|
|
2845
|
+
}
|
|
2846
|
+
static getInner(obj) {
|
|
2847
|
+
return obj.inner;
|
|
2848
|
+
}
|
|
2849
|
+
}
|
|
2850
|
+
class Decode_ extends UniffiError {
|
|
2851
|
+
/**
|
|
2852
|
+
* @private
|
|
2853
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2854
|
+
*/
|
|
2855
|
+
[uniffiTypeNameSymbol] = 'ServiceConnectivityError';
|
|
2856
|
+
tag = ServiceConnectivityError_Tags.Decode;
|
|
2857
|
+
constructor(v0) {
|
|
2858
|
+
super('ServiceConnectivityError', 'Decode');
|
|
2859
|
+
this.inner = Object.freeze([v0]);
|
|
2860
|
+
}
|
|
2861
|
+
static new(v0) {
|
|
2862
|
+
return new Decode_(v0);
|
|
2863
|
+
}
|
|
2864
|
+
static instanceOf(obj) {
|
|
2865
|
+
return obj.tag === ServiceConnectivityError_Tags.Decode;
|
|
2866
|
+
}
|
|
2867
|
+
static hasInner(obj) {
|
|
2868
|
+
return Decode_.instanceOf(obj);
|
|
2869
|
+
}
|
|
2870
|
+
static getInner(obj) {
|
|
2871
|
+
return obj.inner;
|
|
2872
|
+
}
|
|
2873
|
+
}
|
|
2874
|
+
class Json_ extends UniffiError {
|
|
2875
|
+
/**
|
|
2876
|
+
* @private
|
|
2877
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2878
|
+
*/
|
|
2879
|
+
[uniffiTypeNameSymbol] = 'ServiceConnectivityError';
|
|
2880
|
+
tag = ServiceConnectivityError_Tags.Json;
|
|
2881
|
+
constructor(v0) {
|
|
2882
|
+
super('ServiceConnectivityError', 'Json');
|
|
2883
|
+
this.inner = Object.freeze([v0]);
|
|
2884
|
+
}
|
|
2885
|
+
static new(v0) {
|
|
2886
|
+
return new Json_(v0);
|
|
2887
|
+
}
|
|
2888
|
+
static instanceOf(obj) {
|
|
2889
|
+
return obj.tag === ServiceConnectivityError_Tags.Json;
|
|
2890
|
+
}
|
|
2891
|
+
static hasInner(obj) {
|
|
2892
|
+
return Json_.instanceOf(obj);
|
|
2893
|
+
}
|
|
2894
|
+
static getInner(obj) {
|
|
2895
|
+
return obj.inner;
|
|
2896
|
+
}
|
|
2897
|
+
}
|
|
2898
|
+
class Other_ extends UniffiError {
|
|
2899
|
+
/**
|
|
2900
|
+
* @private
|
|
2901
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2902
|
+
*/
|
|
2903
|
+
[uniffiTypeNameSymbol] = 'ServiceConnectivityError';
|
|
2904
|
+
tag = ServiceConnectivityError_Tags.Other;
|
|
2905
|
+
constructor(v0) {
|
|
2906
|
+
super('ServiceConnectivityError', 'Other');
|
|
2907
|
+
this.inner = Object.freeze([v0]);
|
|
2908
|
+
}
|
|
2909
|
+
static new(v0) {
|
|
2910
|
+
return new Other_(v0);
|
|
2911
|
+
}
|
|
2912
|
+
static instanceOf(obj) {
|
|
2913
|
+
return obj.tag === ServiceConnectivityError_Tags.Other;
|
|
2914
|
+
}
|
|
2915
|
+
static hasInner(obj) {
|
|
2916
|
+
return Other_.instanceOf(obj);
|
|
2917
|
+
}
|
|
2918
|
+
static getInner(obj) {
|
|
2919
|
+
return obj.inner;
|
|
2920
|
+
}
|
|
2921
|
+
}
|
|
2922
|
+
function instanceOf(obj) {
|
|
2923
|
+
return obj[uniffiTypeNameSymbol] === 'ServiceConnectivityError';
|
|
2924
|
+
}
|
|
2925
|
+
return Object.freeze({
|
|
2926
|
+
instanceOf,
|
|
2927
|
+
Builder: Builder_,
|
|
2928
|
+
Redirect: Redirect_,
|
|
2929
|
+
Status: Status_,
|
|
2930
|
+
Timeout: Timeout_,
|
|
2931
|
+
Request: Request_,
|
|
2932
|
+
Connect: Connect_,
|
|
2933
|
+
Body: Body_,
|
|
2934
|
+
Decode: Decode_,
|
|
2935
|
+
Json: Json_,
|
|
2936
|
+
Other: Other_
|
|
2937
|
+
});
|
|
2938
|
+
})();
|
|
2939
|
+
// FfiConverter for enum ServiceConnectivityError
|
|
2940
|
+
const FfiConverterTypeServiceConnectivityError = (() => {
|
|
2941
|
+
const ordinalConverter = FfiConverterInt32;
|
|
2942
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
2943
|
+
read(from) {
|
|
2944
|
+
switch (ordinalConverter.read(from)) {
|
|
2945
|
+
case 1:
|
|
2946
|
+
return new ServiceConnectivityError.Builder(FfiConverterString.read(from));
|
|
2947
|
+
case 2:
|
|
2948
|
+
return new ServiceConnectivityError.Redirect(FfiConverterString.read(from));
|
|
2949
|
+
case 3:
|
|
2950
|
+
return new ServiceConnectivityError.Status({
|
|
2951
|
+
status: FfiConverterUInt16.read(from),
|
|
2952
|
+
body: FfiConverterString.read(from)
|
|
2953
|
+
});
|
|
2954
|
+
case 4:
|
|
2955
|
+
return new ServiceConnectivityError.Timeout(FfiConverterString.read(from));
|
|
2956
|
+
case 5:
|
|
2957
|
+
return new ServiceConnectivityError.Request(FfiConverterString.read(from));
|
|
2958
|
+
case 6:
|
|
2959
|
+
return new ServiceConnectivityError.Connect(FfiConverterString.read(from));
|
|
2960
|
+
case 7:
|
|
2961
|
+
return new ServiceConnectivityError.Body(FfiConverterString.read(from));
|
|
2962
|
+
case 8:
|
|
2963
|
+
return new ServiceConnectivityError.Decode(FfiConverterString.read(from));
|
|
2964
|
+
case 9:
|
|
2965
|
+
return new ServiceConnectivityError.Json(FfiConverterString.read(from));
|
|
2966
|
+
case 10:
|
|
2967
|
+
return new ServiceConnectivityError.Other(FfiConverterString.read(from));
|
|
2968
|
+
default:
|
|
2969
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
2970
|
+
}
|
|
2971
|
+
}
|
|
2972
|
+
write(value, into) {
|
|
2973
|
+
switch (value.tag) {
|
|
2974
|
+
case ServiceConnectivityError_Tags.Builder:
|
|
2975
|
+
{
|
|
2976
|
+
ordinalConverter.write(1, into);
|
|
2977
|
+
const inner = value.inner;
|
|
2978
|
+
FfiConverterString.write(inner[0], into);
|
|
2979
|
+
return;
|
|
2980
|
+
}
|
|
2981
|
+
case ServiceConnectivityError_Tags.Redirect:
|
|
2982
|
+
{
|
|
2983
|
+
ordinalConverter.write(2, into);
|
|
2984
|
+
const inner = value.inner;
|
|
2985
|
+
FfiConverterString.write(inner[0], into);
|
|
2986
|
+
return;
|
|
2987
|
+
}
|
|
2988
|
+
case ServiceConnectivityError_Tags.Status:
|
|
2989
|
+
{
|
|
2990
|
+
ordinalConverter.write(3, into);
|
|
2991
|
+
const inner = value.inner;
|
|
2992
|
+
FfiConverterUInt16.write(inner.status, into);
|
|
2993
|
+
FfiConverterString.write(inner.body, into);
|
|
2994
|
+
return;
|
|
2995
|
+
}
|
|
2996
|
+
case ServiceConnectivityError_Tags.Timeout:
|
|
2997
|
+
{
|
|
2998
|
+
ordinalConverter.write(4, into);
|
|
2999
|
+
const inner = value.inner;
|
|
3000
|
+
FfiConverterString.write(inner[0], into);
|
|
3001
|
+
return;
|
|
3002
|
+
}
|
|
3003
|
+
case ServiceConnectivityError_Tags.Request:
|
|
3004
|
+
{
|
|
3005
|
+
ordinalConverter.write(5, into);
|
|
3006
|
+
const inner = value.inner;
|
|
3007
|
+
FfiConverterString.write(inner[0], into);
|
|
3008
|
+
return;
|
|
3009
|
+
}
|
|
3010
|
+
case ServiceConnectivityError_Tags.Connect:
|
|
3011
|
+
{
|
|
3012
|
+
ordinalConverter.write(6, into);
|
|
3013
|
+
const inner = value.inner;
|
|
3014
|
+
FfiConverterString.write(inner[0], into);
|
|
3015
|
+
return;
|
|
3016
|
+
}
|
|
3017
|
+
case ServiceConnectivityError_Tags.Body:
|
|
3018
|
+
{
|
|
3019
|
+
ordinalConverter.write(7, into);
|
|
3020
|
+
const inner = value.inner;
|
|
3021
|
+
FfiConverterString.write(inner[0], into);
|
|
3022
|
+
return;
|
|
3023
|
+
}
|
|
3024
|
+
case ServiceConnectivityError_Tags.Decode:
|
|
3025
|
+
{
|
|
3026
|
+
ordinalConverter.write(8, into);
|
|
3027
|
+
const inner = value.inner;
|
|
3028
|
+
FfiConverterString.write(inner[0], into);
|
|
3029
|
+
return;
|
|
3030
|
+
}
|
|
3031
|
+
case ServiceConnectivityError_Tags.Json:
|
|
3032
|
+
{
|
|
3033
|
+
ordinalConverter.write(9, into);
|
|
3034
|
+
const inner = value.inner;
|
|
3035
|
+
FfiConverterString.write(inner[0], into);
|
|
3036
|
+
return;
|
|
3037
|
+
}
|
|
3038
|
+
case ServiceConnectivityError_Tags.Other:
|
|
3039
|
+
{
|
|
3040
|
+
ordinalConverter.write(10, into);
|
|
3041
|
+
const inner = value.inner;
|
|
3042
|
+
FfiConverterString.write(inner[0], into);
|
|
3043
|
+
return;
|
|
3044
|
+
}
|
|
3045
|
+
default:
|
|
3046
|
+
// Throwing from here means that ServiceConnectivityError_Tags hasn't matched an ordinal.
|
|
3047
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
3048
|
+
}
|
|
3049
|
+
}
|
|
3050
|
+
allocationSize(value) {
|
|
3051
|
+
switch (value.tag) {
|
|
3052
|
+
case ServiceConnectivityError_Tags.Builder:
|
|
3053
|
+
{
|
|
3054
|
+
const inner = value.inner;
|
|
3055
|
+
let size = ordinalConverter.allocationSize(1);
|
|
3056
|
+
size += FfiConverterString.allocationSize(inner[0]);
|
|
3057
|
+
return size;
|
|
3058
|
+
}
|
|
3059
|
+
case ServiceConnectivityError_Tags.Redirect:
|
|
3060
|
+
{
|
|
3061
|
+
const inner = value.inner;
|
|
3062
|
+
let size = ordinalConverter.allocationSize(2);
|
|
3063
|
+
size += FfiConverterString.allocationSize(inner[0]);
|
|
3064
|
+
return size;
|
|
3065
|
+
}
|
|
3066
|
+
case ServiceConnectivityError_Tags.Status:
|
|
3067
|
+
{
|
|
3068
|
+
const inner = value.inner;
|
|
3069
|
+
let size = ordinalConverter.allocationSize(3);
|
|
3070
|
+
size += FfiConverterUInt16.allocationSize(inner.status);
|
|
3071
|
+
size += FfiConverterString.allocationSize(inner.body);
|
|
3072
|
+
return size;
|
|
3073
|
+
}
|
|
3074
|
+
case ServiceConnectivityError_Tags.Timeout:
|
|
3075
|
+
{
|
|
3076
|
+
const inner = value.inner;
|
|
3077
|
+
let size = ordinalConverter.allocationSize(4);
|
|
3078
|
+
size += FfiConverterString.allocationSize(inner[0]);
|
|
3079
|
+
return size;
|
|
3080
|
+
}
|
|
3081
|
+
case ServiceConnectivityError_Tags.Request:
|
|
3082
|
+
{
|
|
3083
|
+
const inner = value.inner;
|
|
3084
|
+
let size = ordinalConverter.allocationSize(5);
|
|
3085
|
+
size += FfiConverterString.allocationSize(inner[0]);
|
|
3086
|
+
return size;
|
|
3087
|
+
}
|
|
3088
|
+
case ServiceConnectivityError_Tags.Connect:
|
|
3089
|
+
{
|
|
3090
|
+
const inner = value.inner;
|
|
3091
|
+
let size = ordinalConverter.allocationSize(6);
|
|
3092
|
+
size += FfiConverterString.allocationSize(inner[0]);
|
|
3093
|
+
return size;
|
|
3094
|
+
}
|
|
3095
|
+
case ServiceConnectivityError_Tags.Body:
|
|
3096
|
+
{
|
|
3097
|
+
const inner = value.inner;
|
|
3098
|
+
let size = ordinalConverter.allocationSize(7);
|
|
3099
|
+
size += FfiConverterString.allocationSize(inner[0]);
|
|
3100
|
+
return size;
|
|
3101
|
+
}
|
|
3102
|
+
case ServiceConnectivityError_Tags.Decode:
|
|
3103
|
+
{
|
|
3104
|
+
const inner = value.inner;
|
|
3105
|
+
let size = ordinalConverter.allocationSize(8);
|
|
3106
|
+
size += FfiConverterString.allocationSize(inner[0]);
|
|
3107
|
+
return size;
|
|
3108
|
+
}
|
|
3109
|
+
case ServiceConnectivityError_Tags.Json:
|
|
3110
|
+
{
|
|
3111
|
+
const inner = value.inner;
|
|
3112
|
+
let size = ordinalConverter.allocationSize(9);
|
|
3113
|
+
size += FfiConverterString.allocationSize(inner[0]);
|
|
3114
|
+
return size;
|
|
3115
|
+
}
|
|
3116
|
+
case ServiceConnectivityError_Tags.Other:
|
|
3117
|
+
{
|
|
3118
|
+
const inner = value.inner;
|
|
3119
|
+
let size = ordinalConverter.allocationSize(10);
|
|
3120
|
+
size += FfiConverterString.allocationSize(inner[0]);
|
|
3121
|
+
return size;
|
|
3122
|
+
}
|
|
3123
|
+
default:
|
|
3124
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
3125
|
+
}
|
|
3126
|
+
}
|
|
3127
|
+
}
|
|
3128
|
+
return new FFIConverter();
|
|
3129
|
+
})();
|
|
3130
|
+
|
|
3131
|
+
// Enum: SparkAddressPaymentType
|
|
3132
|
+
export let SparkAddressPaymentType_Tags = /*#__PURE__*/function (SparkAddressPaymentType_Tags) {
|
|
3133
|
+
SparkAddressPaymentType_Tags["TokensPayment"] = "TokensPayment";
|
|
3134
|
+
SparkAddressPaymentType_Tags["SatsPayment"] = "SatsPayment";
|
|
3135
|
+
return SparkAddressPaymentType_Tags;
|
|
3136
|
+
}({});
|
|
3137
|
+
export const SparkAddressPaymentType = (() => {
|
|
3138
|
+
class TokensPayment_ extends UniffiEnum {
|
|
3139
|
+
/**
|
|
3140
|
+
* @private
|
|
3141
|
+
* This field is private and should not be used, use `tag` instead.
|
|
3142
|
+
*/
|
|
3143
|
+
[uniffiTypeNameSymbol] = 'SparkAddressPaymentType';
|
|
3144
|
+
tag = SparkAddressPaymentType_Tags.TokensPayment;
|
|
3145
|
+
constructor(v0) {
|
|
3146
|
+
super('SparkAddressPaymentType', 'TokensPayment');
|
|
3147
|
+
this.inner = Object.freeze([v0]);
|
|
3148
|
+
}
|
|
3149
|
+
static new(v0) {
|
|
3150
|
+
return new TokensPayment_(v0);
|
|
3151
|
+
}
|
|
3152
|
+
static instanceOf(obj) {
|
|
3153
|
+
return obj.tag === SparkAddressPaymentType_Tags.TokensPayment;
|
|
3154
|
+
}
|
|
3155
|
+
}
|
|
3156
|
+
class SatsPayment_ extends UniffiEnum {
|
|
3157
|
+
/**
|
|
3158
|
+
* @private
|
|
3159
|
+
* This field is private and should not be used, use `tag` instead.
|
|
3160
|
+
*/
|
|
3161
|
+
[uniffiTypeNameSymbol] = 'SparkAddressPaymentType';
|
|
3162
|
+
tag = SparkAddressPaymentType_Tags.SatsPayment;
|
|
3163
|
+
constructor(v0) {
|
|
3164
|
+
super('SparkAddressPaymentType', 'SatsPayment');
|
|
3165
|
+
this.inner = Object.freeze([v0]);
|
|
3166
|
+
}
|
|
3167
|
+
static new(v0) {
|
|
3168
|
+
return new SatsPayment_(v0);
|
|
3169
|
+
}
|
|
3170
|
+
static instanceOf(obj) {
|
|
3171
|
+
return obj.tag === SparkAddressPaymentType_Tags.SatsPayment;
|
|
3172
|
+
}
|
|
3173
|
+
}
|
|
3174
|
+
function instanceOf(obj) {
|
|
3175
|
+
return obj[uniffiTypeNameSymbol] === 'SparkAddressPaymentType';
|
|
3176
|
+
}
|
|
3177
|
+
return Object.freeze({
|
|
3178
|
+
instanceOf,
|
|
3179
|
+
TokensPayment: TokensPayment_,
|
|
3180
|
+
SatsPayment: SatsPayment_
|
|
3181
|
+
});
|
|
3182
|
+
})();
|
|
3183
|
+
// FfiConverter for enum SparkAddressPaymentType
|
|
3184
|
+
const FfiConverterTypeSparkAddressPaymentType = (() => {
|
|
3185
|
+
const ordinalConverter = FfiConverterInt32;
|
|
3186
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
3187
|
+
read(from) {
|
|
3188
|
+
switch (ordinalConverter.read(from)) {
|
|
3189
|
+
case 1:
|
|
3190
|
+
return new SparkAddressPaymentType.TokensPayment(FfiConverterTypeTokensPaymentDetails.read(from));
|
|
3191
|
+
case 2:
|
|
3192
|
+
return new SparkAddressPaymentType.SatsPayment(FfiConverterTypeSatsPaymentDetails.read(from));
|
|
3193
|
+
default:
|
|
3194
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
3195
|
+
}
|
|
3196
|
+
}
|
|
3197
|
+
write(value, into) {
|
|
3198
|
+
switch (value.tag) {
|
|
3199
|
+
case SparkAddressPaymentType_Tags.TokensPayment:
|
|
3200
|
+
{
|
|
3201
|
+
ordinalConverter.write(1, into);
|
|
3202
|
+
const inner = value.inner;
|
|
3203
|
+
FfiConverterTypeTokensPaymentDetails.write(inner[0], into);
|
|
3204
|
+
return;
|
|
3205
|
+
}
|
|
3206
|
+
case SparkAddressPaymentType_Tags.SatsPayment:
|
|
3207
|
+
{
|
|
3208
|
+
ordinalConverter.write(2, into);
|
|
3209
|
+
const inner = value.inner;
|
|
3210
|
+
FfiConverterTypeSatsPaymentDetails.write(inner[0], into);
|
|
3211
|
+
return;
|
|
3212
|
+
}
|
|
3213
|
+
default:
|
|
3214
|
+
// Throwing from here means that SparkAddressPaymentType_Tags hasn't matched an ordinal.
|
|
3215
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
3216
|
+
}
|
|
3217
|
+
}
|
|
3218
|
+
allocationSize(value) {
|
|
3219
|
+
switch (value.tag) {
|
|
3220
|
+
case SparkAddressPaymentType_Tags.TokensPayment:
|
|
3221
|
+
{
|
|
3222
|
+
const inner = value.inner;
|
|
3223
|
+
let size = ordinalConverter.allocationSize(1);
|
|
3224
|
+
size += FfiConverterTypeTokensPaymentDetails.allocationSize(inner[0]);
|
|
3225
|
+
return size;
|
|
3226
|
+
}
|
|
3227
|
+
case SparkAddressPaymentType_Tags.SatsPayment:
|
|
3228
|
+
{
|
|
3229
|
+
const inner = value.inner;
|
|
3230
|
+
let size = ordinalConverter.allocationSize(2);
|
|
3231
|
+
size += FfiConverterTypeSatsPaymentDetails.allocationSize(inner[0]);
|
|
3232
|
+
return size;
|
|
3233
|
+
}
|
|
3234
|
+
default:
|
|
3235
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
3236
|
+
}
|
|
3237
|
+
}
|
|
3238
|
+
}
|
|
3239
|
+
return new FFIConverter();
|
|
3240
|
+
})();
|
|
3241
|
+
|
|
3242
|
+
// Enum: SuccessAction
|
|
3243
|
+
export let SuccessAction_Tags = /*#__PURE__*/function (SuccessAction_Tags) {
|
|
3244
|
+
SuccessAction_Tags["Aes"] = "Aes";
|
|
3245
|
+
SuccessAction_Tags["Message"] = "Message";
|
|
3246
|
+
SuccessAction_Tags["Url"] = "Url";
|
|
3247
|
+
return SuccessAction_Tags;
|
|
3248
|
+
}({});
|
|
3249
|
+
/**
|
|
3250
|
+
* Supported success action types
|
|
3251
|
+
*
|
|
3252
|
+
* Receiving any other (unsupported) success action type will result in a failed parsing,
|
|
3253
|
+
* which will abort the LNURL-pay workflow, as per LUD-09.
|
|
3254
|
+
*/
|
|
3255
|
+
export const SuccessAction = (() => {
|
|
3256
|
+
/**
|
|
3257
|
+
* AES type, described in LUD-10
|
|
3258
|
+
*/
|
|
3259
|
+
class Aes_ extends UniffiEnum {
|
|
3260
|
+
/**
|
|
3261
|
+
* @private
|
|
3262
|
+
* This field is private and should not be used, use `tag` instead.
|
|
3263
|
+
*/
|
|
3264
|
+
[uniffiTypeNameSymbol] = 'SuccessAction';
|
|
3265
|
+
tag = SuccessAction_Tags.Aes;
|
|
3266
|
+
constructor(inner) {
|
|
3267
|
+
super('SuccessAction', 'Aes');
|
|
3268
|
+
this.inner = Object.freeze(inner);
|
|
3269
|
+
}
|
|
3270
|
+
static new(inner) {
|
|
3271
|
+
return new Aes_(inner);
|
|
3272
|
+
}
|
|
3273
|
+
static instanceOf(obj) {
|
|
3274
|
+
return obj.tag === SuccessAction_Tags.Aes;
|
|
3275
|
+
}
|
|
3276
|
+
}
|
|
3277
|
+
/**
|
|
3278
|
+
* Message type, described in LUD-09
|
|
3279
|
+
*/
|
|
3280
|
+
class Message_ extends UniffiEnum {
|
|
3281
|
+
/**
|
|
3282
|
+
* @private
|
|
3283
|
+
* This field is private and should not be used, use `tag` instead.
|
|
3284
|
+
*/
|
|
3285
|
+
[uniffiTypeNameSymbol] = 'SuccessAction';
|
|
3286
|
+
tag = SuccessAction_Tags.Message;
|
|
3287
|
+
constructor(inner) {
|
|
3288
|
+
super('SuccessAction', 'Message');
|
|
3289
|
+
this.inner = Object.freeze(inner);
|
|
3290
|
+
}
|
|
3291
|
+
static new(inner) {
|
|
3292
|
+
return new Message_(inner);
|
|
3293
|
+
}
|
|
3294
|
+
static instanceOf(obj) {
|
|
3295
|
+
return obj.tag === SuccessAction_Tags.Message;
|
|
3296
|
+
}
|
|
3297
|
+
}
|
|
3298
|
+
/**
|
|
3299
|
+
* URL type, described in LUD-09
|
|
3300
|
+
*/
|
|
3301
|
+
class Url_ extends UniffiEnum {
|
|
3302
|
+
/**
|
|
3303
|
+
* @private
|
|
3304
|
+
* This field is private and should not be used, use `tag` instead.
|
|
3305
|
+
*/
|
|
3306
|
+
[uniffiTypeNameSymbol] = 'SuccessAction';
|
|
3307
|
+
tag = SuccessAction_Tags.Url;
|
|
3308
|
+
constructor(inner) {
|
|
3309
|
+
super('SuccessAction', 'Url');
|
|
3310
|
+
this.inner = Object.freeze(inner);
|
|
3311
|
+
}
|
|
3312
|
+
static new(inner) {
|
|
3313
|
+
return new Url_(inner);
|
|
3314
|
+
}
|
|
3315
|
+
static instanceOf(obj) {
|
|
3316
|
+
return obj.tag === SuccessAction_Tags.Url;
|
|
3317
|
+
}
|
|
3318
|
+
}
|
|
3319
|
+
function instanceOf(obj) {
|
|
3320
|
+
return obj[uniffiTypeNameSymbol] === 'SuccessAction';
|
|
3321
|
+
}
|
|
3322
|
+
return Object.freeze({
|
|
3323
|
+
instanceOf,
|
|
3324
|
+
Aes: Aes_,
|
|
3325
|
+
Message: Message_,
|
|
3326
|
+
Url: Url_
|
|
3327
|
+
});
|
|
3328
|
+
})();
|
|
3329
|
+
|
|
3330
|
+
/**
|
|
3331
|
+
* Supported success action types
|
|
3332
|
+
*
|
|
3333
|
+
* Receiving any other (unsupported) success action type will result in a failed parsing,
|
|
3334
|
+
* which will abort the LNURL-pay workflow, as per LUD-09.
|
|
3335
|
+
*/
|
|
3336
|
+
|
|
3337
|
+
// FfiConverter for enum SuccessAction
|
|
3338
|
+
const FfiConverterTypeSuccessAction = (() => {
|
|
3339
|
+
const ordinalConverter = FfiConverterInt32;
|
|
3340
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
3341
|
+
read(from) {
|
|
3342
|
+
switch (ordinalConverter.read(from)) {
|
|
3343
|
+
case 1:
|
|
3344
|
+
return new SuccessAction.Aes({
|
|
3345
|
+
data: FfiConverterTypeAesSuccessActionData.read(from)
|
|
3346
|
+
});
|
|
3347
|
+
case 2:
|
|
3348
|
+
return new SuccessAction.Message({
|
|
3349
|
+
data: FfiConverterTypeMessageSuccessActionData.read(from)
|
|
3350
|
+
});
|
|
3351
|
+
case 3:
|
|
3352
|
+
return new SuccessAction.Url({
|
|
3353
|
+
data: FfiConverterTypeUrlSuccessActionData.read(from)
|
|
3354
|
+
});
|
|
3355
|
+
default:
|
|
3356
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
3357
|
+
}
|
|
3358
|
+
}
|
|
3359
|
+
write(value, into) {
|
|
3360
|
+
switch (value.tag) {
|
|
3361
|
+
case SuccessAction_Tags.Aes:
|
|
3362
|
+
{
|
|
3363
|
+
ordinalConverter.write(1, into);
|
|
3364
|
+
const inner = value.inner;
|
|
3365
|
+
FfiConverterTypeAesSuccessActionData.write(inner.data, into);
|
|
3366
|
+
return;
|
|
3367
|
+
}
|
|
3368
|
+
case SuccessAction_Tags.Message:
|
|
3369
|
+
{
|
|
3370
|
+
ordinalConverter.write(2, into);
|
|
3371
|
+
const inner = value.inner;
|
|
3372
|
+
FfiConverterTypeMessageSuccessActionData.write(inner.data, into);
|
|
3373
|
+
return;
|
|
3374
|
+
}
|
|
3375
|
+
case SuccessAction_Tags.Url:
|
|
3376
|
+
{
|
|
3377
|
+
ordinalConverter.write(3, into);
|
|
3378
|
+
const inner = value.inner;
|
|
3379
|
+
FfiConverterTypeUrlSuccessActionData.write(inner.data, into);
|
|
3380
|
+
return;
|
|
3381
|
+
}
|
|
3382
|
+
default:
|
|
3383
|
+
// Throwing from here means that SuccessAction_Tags hasn't matched an ordinal.
|
|
3384
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
3385
|
+
}
|
|
3386
|
+
}
|
|
3387
|
+
allocationSize(value) {
|
|
3388
|
+
switch (value.tag) {
|
|
3389
|
+
case SuccessAction_Tags.Aes:
|
|
3390
|
+
{
|
|
3391
|
+
const inner = value.inner;
|
|
3392
|
+
let size = ordinalConverter.allocationSize(1);
|
|
3393
|
+
size += FfiConverterTypeAesSuccessActionData.allocationSize(inner.data);
|
|
3394
|
+
return size;
|
|
3395
|
+
}
|
|
3396
|
+
case SuccessAction_Tags.Message:
|
|
3397
|
+
{
|
|
3398
|
+
const inner = value.inner;
|
|
3399
|
+
let size = ordinalConverter.allocationSize(2);
|
|
3400
|
+
size += FfiConverterTypeMessageSuccessActionData.allocationSize(inner.data);
|
|
3401
|
+
return size;
|
|
3402
|
+
}
|
|
3403
|
+
case SuccessAction_Tags.Url:
|
|
3404
|
+
{
|
|
3405
|
+
const inner = value.inner;
|
|
3406
|
+
let size = ordinalConverter.allocationSize(3);
|
|
3407
|
+
size += FfiConverterTypeUrlSuccessActionData.allocationSize(inner.data);
|
|
3408
|
+
return size;
|
|
3409
|
+
}
|
|
3410
|
+
default:
|
|
3411
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
3412
|
+
}
|
|
3413
|
+
}
|
|
3414
|
+
}
|
|
3415
|
+
return new FFIConverter();
|
|
3416
|
+
})();
|
|
3417
|
+
|
|
3418
|
+
// Enum: SuccessActionProcessed
|
|
3419
|
+
export let SuccessActionProcessed_Tags = /*#__PURE__*/function (SuccessActionProcessed_Tags) {
|
|
3420
|
+
SuccessActionProcessed_Tags["Aes"] = "Aes";
|
|
3421
|
+
SuccessActionProcessed_Tags["Message"] = "Message";
|
|
3422
|
+
SuccessActionProcessed_Tags["Url"] = "Url";
|
|
3423
|
+
return SuccessActionProcessed_Tags;
|
|
3424
|
+
}({});
|
|
3425
|
+
/**
|
|
3426
|
+
* [`SuccessAction`] where contents are ready to be consumed by the caller
|
|
3427
|
+
*
|
|
3428
|
+
* Contents are identical to [`SuccessAction`], except for AES where the ciphertext is decrypted.
|
|
3429
|
+
*/
|
|
3430
|
+
export const SuccessActionProcessed = (() => {
|
|
3431
|
+
/**
|
|
3432
|
+
* See [`SuccessAction::Aes`] for received payload
|
|
3433
|
+
*
|
|
3434
|
+
* See [`AesSuccessActionDataDecrypted`] for decrypted payload
|
|
3435
|
+
*/
|
|
3436
|
+
class Aes_ extends UniffiEnum {
|
|
3437
|
+
/**
|
|
3438
|
+
* @private
|
|
3439
|
+
* This field is private and should not be used, use `tag` instead.
|
|
3440
|
+
*/
|
|
3441
|
+
[uniffiTypeNameSymbol] = 'SuccessActionProcessed';
|
|
3442
|
+
tag = SuccessActionProcessed_Tags.Aes;
|
|
3443
|
+
constructor(inner) {
|
|
3444
|
+
super('SuccessActionProcessed', 'Aes');
|
|
3445
|
+
this.inner = Object.freeze(inner);
|
|
3446
|
+
}
|
|
3447
|
+
static new(inner) {
|
|
3448
|
+
return new Aes_(inner);
|
|
3449
|
+
}
|
|
3450
|
+
static instanceOf(obj) {
|
|
3451
|
+
return obj.tag === SuccessActionProcessed_Tags.Aes;
|
|
3452
|
+
}
|
|
3453
|
+
}
|
|
3454
|
+
/**
|
|
3455
|
+
* See [`SuccessAction::Message`]
|
|
3456
|
+
*/
|
|
3457
|
+
class Message_ extends UniffiEnum {
|
|
3458
|
+
/**
|
|
3459
|
+
* @private
|
|
3460
|
+
* This field is private and should not be used, use `tag` instead.
|
|
3461
|
+
*/
|
|
3462
|
+
[uniffiTypeNameSymbol] = 'SuccessActionProcessed';
|
|
3463
|
+
tag = SuccessActionProcessed_Tags.Message;
|
|
3464
|
+
constructor(inner) {
|
|
3465
|
+
super('SuccessActionProcessed', 'Message');
|
|
3466
|
+
this.inner = Object.freeze(inner);
|
|
3467
|
+
}
|
|
3468
|
+
static new(inner) {
|
|
3469
|
+
return new Message_(inner);
|
|
3470
|
+
}
|
|
3471
|
+
static instanceOf(obj) {
|
|
3472
|
+
return obj.tag === SuccessActionProcessed_Tags.Message;
|
|
3473
|
+
}
|
|
3474
|
+
}
|
|
3475
|
+
/**
|
|
3476
|
+
* See [`SuccessAction::Url`]
|
|
3477
|
+
*/
|
|
3478
|
+
class Url_ extends UniffiEnum {
|
|
3479
|
+
/**
|
|
3480
|
+
* @private
|
|
3481
|
+
* This field is private and should not be used, use `tag` instead.
|
|
3482
|
+
*/
|
|
3483
|
+
[uniffiTypeNameSymbol] = 'SuccessActionProcessed';
|
|
3484
|
+
tag = SuccessActionProcessed_Tags.Url;
|
|
3485
|
+
constructor(inner) {
|
|
3486
|
+
super('SuccessActionProcessed', 'Url');
|
|
3487
|
+
this.inner = Object.freeze(inner);
|
|
3488
|
+
}
|
|
3489
|
+
static new(inner) {
|
|
3490
|
+
return new Url_(inner);
|
|
3491
|
+
}
|
|
3492
|
+
static instanceOf(obj) {
|
|
3493
|
+
return obj.tag === SuccessActionProcessed_Tags.Url;
|
|
3494
|
+
}
|
|
3495
|
+
}
|
|
3496
|
+
function instanceOf(obj) {
|
|
3497
|
+
return obj[uniffiTypeNameSymbol] === 'SuccessActionProcessed';
|
|
3498
|
+
}
|
|
3499
|
+
return Object.freeze({
|
|
3500
|
+
instanceOf,
|
|
3501
|
+
Aes: Aes_,
|
|
3502
|
+
Message: Message_,
|
|
3503
|
+
Url: Url_
|
|
3504
|
+
});
|
|
3505
|
+
})();
|
|
3506
|
+
|
|
3507
|
+
/**
|
|
3508
|
+
* [`SuccessAction`] where contents are ready to be consumed by the caller
|
|
3509
|
+
*
|
|
3510
|
+
* Contents are identical to [`SuccessAction`], except for AES where the ciphertext is decrypted.
|
|
3511
|
+
*/
|
|
3512
|
+
|
|
3513
|
+
// FfiConverter for enum SuccessActionProcessed
|
|
3514
|
+
const FfiConverterTypeSuccessActionProcessed = (() => {
|
|
3515
|
+
const ordinalConverter = FfiConverterInt32;
|
|
3516
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
3517
|
+
read(from) {
|
|
3518
|
+
switch (ordinalConverter.read(from)) {
|
|
3519
|
+
case 1:
|
|
3520
|
+
return new SuccessActionProcessed.Aes({
|
|
3521
|
+
result: FfiConverterTypeAesSuccessActionDataResult.read(from)
|
|
3522
|
+
});
|
|
3523
|
+
case 2:
|
|
3524
|
+
return new SuccessActionProcessed.Message({
|
|
3525
|
+
data: FfiConverterTypeMessageSuccessActionData.read(from)
|
|
3526
|
+
});
|
|
3527
|
+
case 3:
|
|
3528
|
+
return new SuccessActionProcessed.Url({
|
|
3529
|
+
data: FfiConverterTypeUrlSuccessActionData.read(from)
|
|
3530
|
+
});
|
|
3531
|
+
default:
|
|
3532
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
3533
|
+
}
|
|
3534
|
+
}
|
|
3535
|
+
write(value, into) {
|
|
3536
|
+
switch (value.tag) {
|
|
3537
|
+
case SuccessActionProcessed_Tags.Aes:
|
|
3538
|
+
{
|
|
3539
|
+
ordinalConverter.write(1, into);
|
|
3540
|
+
const inner = value.inner;
|
|
3541
|
+
FfiConverterTypeAesSuccessActionDataResult.write(inner.result, into);
|
|
3542
|
+
return;
|
|
3543
|
+
}
|
|
3544
|
+
case SuccessActionProcessed_Tags.Message:
|
|
3545
|
+
{
|
|
3546
|
+
ordinalConverter.write(2, into);
|
|
3547
|
+
const inner = value.inner;
|
|
3548
|
+
FfiConverterTypeMessageSuccessActionData.write(inner.data, into);
|
|
3549
|
+
return;
|
|
3550
|
+
}
|
|
3551
|
+
case SuccessActionProcessed_Tags.Url:
|
|
3552
|
+
{
|
|
3553
|
+
ordinalConverter.write(3, into);
|
|
3554
|
+
const inner = value.inner;
|
|
3555
|
+
FfiConverterTypeUrlSuccessActionData.write(inner.data, into);
|
|
3556
|
+
return;
|
|
3557
|
+
}
|
|
3558
|
+
default:
|
|
3559
|
+
// Throwing from here means that SuccessActionProcessed_Tags hasn't matched an ordinal.
|
|
3560
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
3561
|
+
}
|
|
3562
|
+
}
|
|
3563
|
+
allocationSize(value) {
|
|
3564
|
+
switch (value.tag) {
|
|
3565
|
+
case SuccessActionProcessed_Tags.Aes:
|
|
3566
|
+
{
|
|
3567
|
+
const inner = value.inner;
|
|
3568
|
+
let size = ordinalConverter.allocationSize(1);
|
|
3569
|
+
size += FfiConverterTypeAesSuccessActionDataResult.allocationSize(inner.result);
|
|
3570
|
+
return size;
|
|
3571
|
+
}
|
|
3572
|
+
case SuccessActionProcessed_Tags.Message:
|
|
3573
|
+
{
|
|
3574
|
+
const inner = value.inner;
|
|
3575
|
+
let size = ordinalConverter.allocationSize(2);
|
|
3576
|
+
size += FfiConverterTypeMessageSuccessActionData.allocationSize(inner.data);
|
|
3577
|
+
return size;
|
|
3578
|
+
}
|
|
3579
|
+
case SuccessActionProcessed_Tags.Url:
|
|
3580
|
+
{
|
|
3581
|
+
const inner = value.inner;
|
|
3582
|
+
let size = ordinalConverter.allocationSize(3);
|
|
3583
|
+
size += FfiConverterTypeUrlSuccessActionData.allocationSize(inner.data);
|
|
3584
|
+
return size;
|
|
3585
|
+
}
|
|
3586
|
+
default:
|
|
3587
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
3588
|
+
}
|
|
3589
|
+
}
|
|
3590
|
+
}
|
|
3591
|
+
return new FFIConverter();
|
|
3592
|
+
})();
|
|
3593
|
+
|
|
3594
|
+
// FfiConverter for Map<string, string>
|
|
3595
|
+
const FfiConverterMapStringString = new FfiConverterMap(FfiConverterString, FfiConverterString);
|
|
3596
|
+
export class RestClientImpl extends UniffiAbstractObject {
|
|
3597
|
+
[uniffiTypeNameSymbol] = 'RestClientImpl';
|
|
3598
|
+
// No primary constructor declared for this class.
|
|
3599
|
+
constructor(pointer) {
|
|
3600
|
+
super();
|
|
3601
|
+
this[pointerLiteralSymbol] = pointer;
|
|
3602
|
+
this[destructorGuardSymbol] = uniffiTypeRestClientImplObjectFactory.bless(pointer);
|
|
3603
|
+
}
|
|
3604
|
+
|
|
3605
|
+
/**
|
|
3606
|
+
* Makes a GET request and logs on DEBUG.
|
|
3607
|
+
* ### Arguments
|
|
3608
|
+
* - `url`: the URL on which GET will be called
|
|
3609
|
+
* - `headers`: optional headers that will be set on the request
|
|
3610
|
+
*/
|
|
3611
|
+
async get(url, headers, asyncOpts_) /*throws*/{
|
|
3612
|
+
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
3613
|
+
try {
|
|
3614
|
+
return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
|
|
3615
|
+
return nativeModule().ubrn_uniffi_breez_sdk_common_fn_method_restclient_get(uniffiTypeRestClientImplObjectFactory.clonePointer(this), FfiConverterString.lower(url), FfiConverterOptionalMapStringString.lower(headers));
|
|
3616
|
+
}, /*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));
|
|
3617
|
+
} catch (__error) {
|
|
3618
|
+
if (uniffiIsDebug && __error instanceof Error) {
|
|
3619
|
+
__error.stack = __stack;
|
|
3620
|
+
}
|
|
3621
|
+
throw __error;
|
|
3622
|
+
}
|
|
3623
|
+
}
|
|
3624
|
+
|
|
3625
|
+
/**
|
|
3626
|
+
* Makes a POST request, and logs on DEBUG.
|
|
3627
|
+
* ### Arguments
|
|
3628
|
+
* - `url`: the URL on which POST will be called
|
|
3629
|
+
* - `headers`: the optional POST headers
|
|
3630
|
+
* - `body`: the optional POST body
|
|
3631
|
+
*/
|
|
3632
|
+
async post(url, headers, body, asyncOpts_) /*throws*/{
|
|
3633
|
+
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
3634
|
+
try {
|
|
3635
|
+
return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
|
|
3636
|
+
return nativeModule().ubrn_uniffi_breez_sdk_common_fn_method_restclient_post(uniffiTypeRestClientImplObjectFactory.clonePointer(this), FfiConverterString.lower(url), FfiConverterOptionalMapStringString.lower(headers), FfiConverterOptionalString.lower(body));
|
|
3637
|
+
}, /*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));
|
|
3638
|
+
} catch (__error) {
|
|
3639
|
+
if (uniffiIsDebug && __error instanceof Error) {
|
|
3640
|
+
__error.stack = __stack;
|
|
3641
|
+
}
|
|
3642
|
+
throw __error;
|
|
3643
|
+
}
|
|
3644
|
+
}
|
|
3645
|
+
|
|
3646
|
+
/**
|
|
3647
|
+
* Makes a DELETE request, and logs on DEBUG.
|
|
3648
|
+
* ### Arguments
|
|
3649
|
+
* - `url`: the URL on which DELETE will be called
|
|
3650
|
+
* - `headers`: the optional DELETE headers
|
|
3651
|
+
* - `body`: the optional DELETE body
|
|
3652
|
+
*/
|
|
3653
|
+
async delete_(url, headers, body, asyncOpts_) /*throws*/{
|
|
3654
|
+
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
3655
|
+
try {
|
|
3656
|
+
return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
|
|
3657
|
+
return nativeModule().ubrn_uniffi_breez_sdk_common_fn_method_restclient_delete(uniffiTypeRestClientImplObjectFactory.clonePointer(this), FfiConverterString.lower(url), FfiConverterOptionalMapStringString.lower(headers), FfiConverterOptionalString.lower(body));
|
|
3658
|
+
}, /*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));
|
|
3659
|
+
} catch (__error) {
|
|
3660
|
+
if (uniffiIsDebug && __error instanceof Error) {
|
|
3661
|
+
__error.stack = __stack;
|
|
3662
|
+
}
|
|
3663
|
+
throw __error;
|
|
3664
|
+
}
|
|
3665
|
+
}
|
|
3666
|
+
|
|
3667
|
+
/**
|
|
3668
|
+
* {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
|
|
3669
|
+
*/
|
|
3670
|
+
uniffiDestroy() {
|
|
3671
|
+
const ptr = this[destructorGuardSymbol];
|
|
3672
|
+
if (ptr !== undefined) {
|
|
3673
|
+
const pointer = uniffiTypeRestClientImplObjectFactory.pointer(this);
|
|
3674
|
+
uniffiTypeRestClientImplObjectFactory.freePointer(pointer);
|
|
3675
|
+
uniffiTypeRestClientImplObjectFactory.unbless(ptr);
|
|
3676
|
+
delete this[destructorGuardSymbol];
|
|
3677
|
+
}
|
|
3678
|
+
}
|
|
3679
|
+
static instanceOf(obj) {
|
|
3680
|
+
return uniffiTypeRestClientImplObjectFactory.isConcreteType(obj);
|
|
3681
|
+
}
|
|
3682
|
+
}
|
|
3683
|
+
const uniffiTypeRestClientImplObjectFactory = {
|
|
3684
|
+
create(pointer) {
|
|
3685
|
+
const instance = Object.create(RestClientImpl.prototype);
|
|
3686
|
+
instance[pointerLiteralSymbol] = pointer;
|
|
3687
|
+
instance[destructorGuardSymbol] = this.bless(pointer);
|
|
3688
|
+
instance[uniffiTypeNameSymbol] = 'RestClientImpl';
|
|
3689
|
+
return instance;
|
|
3690
|
+
},
|
|
3691
|
+
bless(p) {
|
|
3692
|
+
return uniffiCaller.rustCall(/*caller:*/status => nativeModule().ubrn_uniffi_internal_fn_method_restclient_ffi__bless_pointer(p, status), /*liftString:*/FfiConverterString.lift);
|
|
3693
|
+
},
|
|
3694
|
+
unbless(ptr) {
|
|
3695
|
+
ptr.markDestroyed();
|
|
3696
|
+
},
|
|
3697
|
+
pointer(obj) {
|
|
3698
|
+
if (obj[destructorGuardSymbol] === undefined) {
|
|
3699
|
+
throw new UniffiInternalError.UnexpectedNullPointer();
|
|
3700
|
+
}
|
|
3701
|
+
return obj[pointerLiteralSymbol];
|
|
3702
|
+
},
|
|
3703
|
+
clonePointer(obj) {
|
|
3704
|
+
const pointer = this.pointer(obj);
|
|
3705
|
+
return uniffiCaller.rustCall(/*caller:*/callStatus => nativeModule().ubrn_uniffi_breez_sdk_common_fn_clone_restclient(pointer, callStatus), /*liftString:*/FfiConverterString.lift);
|
|
3706
|
+
},
|
|
3707
|
+
freePointer(pointer) {
|
|
3708
|
+
uniffiCaller.rustCall(/*caller:*/callStatus => nativeModule().ubrn_uniffi_breez_sdk_common_fn_free_restclient(pointer, callStatus), /*liftString:*/FfiConverterString.lift);
|
|
3709
|
+
},
|
|
3710
|
+
isConcreteType(obj) {
|
|
3711
|
+
return obj[destructorGuardSymbol] && obj[uniffiTypeNameSymbol] === 'RestClientImpl';
|
|
3712
|
+
}
|
|
3713
|
+
};
|
|
3714
|
+
// FfiConverter for RestClient
|
|
3715
|
+
const FfiConverterTypeRestClient = new FfiConverterObjectWithCallbacks(uniffiTypeRestClientImplObjectFactory);
|
|
3716
|
+
|
|
3717
|
+
// Add a vtavble for the callbacks that go in RestClient.
|
|
3718
|
+
|
|
3719
|
+
// Put the implementation in a struct so we don't pollute the top-level namespace
|
|
3720
|
+
const uniffiCallbackInterfaceRestClient = {
|
|
3721
|
+
// Create the VTable using a series of closures.
|
|
3722
|
+
// ts automatically converts these into C callback functions.
|
|
3723
|
+
vtable: {
|
|
3724
|
+
get: (uniffiHandle, url, headers, uniffiFutureCallback, uniffiCallbackData) => {
|
|
3725
|
+
const uniffiMakeCall = async signal => {
|
|
3726
|
+
const jsCallback = FfiConverterTypeRestClient.lift(uniffiHandle);
|
|
3727
|
+
return await jsCallback.get(FfiConverterString.lift(url), FfiConverterOptionalMapStringString.lift(headers), {
|
|
3728
|
+
signal
|
|
3729
|
+
});
|
|
3730
|
+
};
|
|
3731
|
+
const uniffiHandleSuccess = returnValue => {
|
|
3732
|
+
uniffiFutureCallback(uniffiCallbackData, /* UniffiForeignFutureStructRustBuffer */{
|
|
3733
|
+
returnValue: FfiConverterTypeRestResponse.lower(returnValue),
|
|
3734
|
+
callStatus: uniffiCaller.createCallStatus()
|
|
3735
|
+
});
|
|
3736
|
+
};
|
|
3737
|
+
const uniffiHandleError = (code, errorBuf) => {
|
|
3738
|
+
uniffiFutureCallback(uniffiCallbackData, /* UniffiForeignFutureStructRustBuffer */{
|
|
3739
|
+
returnValue: /*empty*/new Uint8Array(0),
|
|
3740
|
+
// TODO create callstatus with error.
|
|
3741
|
+
callStatus: {
|
|
3742
|
+
code,
|
|
3743
|
+
errorBuf
|
|
3744
|
+
}
|
|
3745
|
+
});
|
|
3746
|
+
};
|
|
3747
|
+
const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(/*makeCall:*/uniffiMakeCall, /*handleSuccess:*/uniffiHandleSuccess, /*handleError:*/uniffiHandleError, /*isErrorType:*/ServiceConnectivityError.instanceOf, /*lowerError:*/FfiConverterTypeServiceConnectivityError.lower.bind(FfiConverterTypeServiceConnectivityError), /*lowerString:*/FfiConverterString.lower);
|
|
3748
|
+
return UniffiResult.success(uniffiForeignFuture);
|
|
3749
|
+
},
|
|
3750
|
+
post: (uniffiHandle, url, headers, body, uniffiFutureCallback, uniffiCallbackData) => {
|
|
3751
|
+
const uniffiMakeCall = async signal => {
|
|
3752
|
+
const jsCallback = FfiConverterTypeRestClient.lift(uniffiHandle);
|
|
3753
|
+
return await jsCallback.post(FfiConverterString.lift(url), FfiConverterOptionalMapStringString.lift(headers), FfiConverterOptionalString.lift(body), {
|
|
3754
|
+
signal
|
|
3755
|
+
});
|
|
3756
|
+
};
|
|
3757
|
+
const uniffiHandleSuccess = returnValue => {
|
|
3758
|
+
uniffiFutureCallback(uniffiCallbackData, /* UniffiForeignFutureStructRustBuffer */{
|
|
3759
|
+
returnValue: FfiConverterTypeRestResponse.lower(returnValue),
|
|
3760
|
+
callStatus: uniffiCaller.createCallStatus()
|
|
3761
|
+
});
|
|
3762
|
+
};
|
|
3763
|
+
const uniffiHandleError = (code, errorBuf) => {
|
|
3764
|
+
uniffiFutureCallback(uniffiCallbackData, /* UniffiForeignFutureStructRustBuffer */{
|
|
3765
|
+
returnValue: /*empty*/new Uint8Array(0),
|
|
3766
|
+
// TODO create callstatus with error.
|
|
3767
|
+
callStatus: {
|
|
3768
|
+
code,
|
|
3769
|
+
errorBuf
|
|
3770
|
+
}
|
|
3771
|
+
});
|
|
3772
|
+
};
|
|
3773
|
+
const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(/*makeCall:*/uniffiMakeCall, /*handleSuccess:*/uniffiHandleSuccess, /*handleError:*/uniffiHandleError, /*isErrorType:*/ServiceConnectivityError.instanceOf, /*lowerError:*/FfiConverterTypeServiceConnectivityError.lower.bind(FfiConverterTypeServiceConnectivityError), /*lowerString:*/FfiConverterString.lower);
|
|
3774
|
+
return UniffiResult.success(uniffiForeignFuture);
|
|
3775
|
+
},
|
|
3776
|
+
delete_: (uniffiHandle, url, headers, body, uniffiFutureCallback, uniffiCallbackData) => {
|
|
3777
|
+
const uniffiMakeCall = async signal => {
|
|
3778
|
+
const jsCallback = FfiConverterTypeRestClient.lift(uniffiHandle);
|
|
3779
|
+
return await jsCallback.delete_(FfiConverterString.lift(url), FfiConverterOptionalMapStringString.lift(headers), FfiConverterOptionalString.lift(body), {
|
|
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
|
+
uniffiFree: uniffiHandle => {
|
|
3803
|
+
// RestClient: this will throw a stale handle error if the handle isn't found.
|
|
3804
|
+
FfiConverterTypeRestClient.drop(uniffiHandle);
|
|
3805
|
+
}
|
|
3806
|
+
},
|
|
3807
|
+
register: () => {
|
|
3808
|
+
nativeModule().ubrn_uniffi_breez_sdk_common_fn_init_callback_vtable_restclient(uniffiCallbackInterfaceRestClient.vtable);
|
|
3809
|
+
}
|
|
3810
|
+
};
|
|
3811
|
+
|
|
3812
|
+
// FfiConverter for boolean | undefined
|
|
3813
|
+
const FfiConverterOptionalBool = new FfiConverterOptional(FfiConverterBool);
|
|
3814
|
+
|
|
3815
|
+
// FfiConverter for SparkInvoiceFields | undefined
|
|
3816
|
+
const FfiConverterOptionalTypeSparkInvoiceFields = new FfiConverterOptional(FfiConverterTypeSparkInvoiceFields);
|
|
3817
|
+
|
|
3818
|
+
// FfiConverter for Symbol | undefined
|
|
3819
|
+
const FfiConverterOptionalTypeSymbol = new FfiConverterOptional(FfiConverterTypeSymbol);
|
|
3820
|
+
|
|
3821
|
+
// FfiConverter for string | undefined
|
|
3822
|
+
const FfiConverterOptionalString = new FfiConverterOptional(FfiConverterString);
|
|
3823
|
+
|
|
3824
|
+
// FfiConverter for /*u32*/number | undefined
|
|
3825
|
+
const FfiConverterOptionalUInt32 = new FfiConverterOptional(FfiConverterUInt32);
|
|
3826
|
+
|
|
3827
|
+
// FfiConverter for /*u64*/bigint | undefined
|
|
3828
|
+
const FfiConverterOptionalUInt64 = new FfiConverterOptional(FfiConverterUInt64);
|
|
3829
|
+
|
|
3830
|
+
// FfiConverter for Array<Bip21Extra>
|
|
3831
|
+
const FfiConverterArrayTypeBip21Extra = new FfiConverterArray(FfiConverterTypeBip21Extra);
|
|
3832
|
+
|
|
3833
|
+
// FfiConverter for Array<Bolt11RouteHint>
|
|
3834
|
+
const FfiConverterArrayTypeBolt11RouteHint = new FfiConverterArray(FfiConverterTypeBolt11RouteHint);
|
|
3835
|
+
|
|
3836
|
+
// FfiConverter for Array<Bolt11RouteHintHop>
|
|
3837
|
+
const FfiConverterArrayTypeBolt11RouteHintHop = new FfiConverterArray(FfiConverterTypeBolt11RouteHintHop);
|
|
3838
|
+
|
|
3839
|
+
// FfiConverter for Array<Bolt12OfferBlindedPath>
|
|
3840
|
+
const FfiConverterArrayTypeBolt12OfferBlindedPath = new FfiConverterArray(FfiConverterTypeBolt12OfferBlindedPath);
|
|
3841
|
+
|
|
3842
|
+
// FfiConverter for Array<LocaleOverrides>
|
|
3843
|
+
const FfiConverterArrayTypeLocaleOverrides = new FfiConverterArray(FfiConverterTypeLocaleOverrides);
|
|
3844
|
+
|
|
3845
|
+
// FfiConverter for Array<LocalizedName>
|
|
3846
|
+
const FfiConverterArrayTypeLocalizedName = new FfiConverterArray(FfiConverterTypeLocalizedName);
|
|
3847
|
+
|
|
3848
|
+
// FfiConverter for Array<string>
|
|
3849
|
+
const FfiConverterArrayString = new FfiConverterArray(FfiConverterString);
|
|
3850
|
+
|
|
3851
|
+
// FfiConverter for Amount | undefined
|
|
3852
|
+
const FfiConverterOptionalTypeAmount = new FfiConverterOptional(FfiConverterTypeAmount);
|
|
3853
|
+
|
|
3854
|
+
// FfiConverter for SparkAddressPaymentType | undefined
|
|
3855
|
+
const FfiConverterOptionalTypeSparkAddressPaymentType = new FfiConverterOptional(FfiConverterTypeSparkAddressPaymentType);
|
|
3856
|
+
|
|
3857
|
+
// FfiConverter for Map<string, string> | undefined
|
|
3858
|
+
const FfiConverterOptionalMapStringString = new FfiConverterOptional(FfiConverterMapStringString);
|
|
3859
|
+
|
|
3860
|
+
// FfiConverter for Array<InputType>
|
|
3861
|
+
const FfiConverterArrayTypeInputType = new FfiConverterArray(FfiConverterTypeInputType);
|
|
3862
|
+
|
|
3863
|
+
/**
|
|
3864
|
+
* This should be called before anything else.
|
|
3865
|
+
*
|
|
3866
|
+
* It is likely that this is being done for you by the library's `index.ts`.
|
|
3867
|
+
*
|
|
3868
|
+
* It checks versions of uniffi between when the Rust scaffolding was generated
|
|
3869
|
+
* and when the bindings were generated.
|
|
3870
|
+
*
|
|
3871
|
+
* It also initializes the machinery to enable Rust to talk back to Javascript.
|
|
3872
|
+
*/
|
|
3873
|
+
function uniffiEnsureInitialized() {
|
|
3874
|
+
// Get the bindings contract version from our ComponentInterface
|
|
3875
|
+
const bindingsContractVersion = 26;
|
|
3876
|
+
// Get the scaffolding contract version by calling the into the dylib
|
|
3877
|
+
const scaffoldingContractVersion = nativeModule().ubrn_ffi_breez_sdk_common_uniffi_contract_version();
|
|
3878
|
+
if (bindingsContractVersion !== scaffoldingContractVersion) {
|
|
3879
|
+
throw new UniffiInternalError.ContractVersionMismatch(scaffoldingContractVersion, bindingsContractVersion);
|
|
3880
|
+
}
|
|
3881
|
+
if (nativeModule().ubrn_uniffi_breez_sdk_common_checksum_method_restclient_get() !== 32450) {
|
|
3882
|
+
throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_common_checksum_method_restclient_get');
|
|
3883
|
+
}
|
|
3884
|
+
if (nativeModule().ubrn_uniffi_breez_sdk_common_checksum_method_restclient_post() !== 14213) {
|
|
3885
|
+
throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_common_checksum_method_restclient_post');
|
|
3886
|
+
}
|
|
3887
|
+
if (nativeModule().ubrn_uniffi_breez_sdk_common_checksum_method_restclient_delete() !== 56210) {
|
|
3888
|
+
throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_common_checksum_method_restclient_delete');
|
|
3889
|
+
}
|
|
3890
|
+
uniffiCallbackInterfaceRestClient.register();
|
|
3891
|
+
}
|
|
3892
|
+
export default Object.freeze({
|
|
3893
|
+
initialize: uniffiEnsureInitialized,
|
|
3894
|
+
converters: {
|
|
3895
|
+
FfiConverterTypeAesSuccessActionData,
|
|
3896
|
+
FfiConverterTypeAesSuccessActionDataDecrypted,
|
|
3897
|
+
FfiConverterTypeAesSuccessActionDataResult,
|
|
3898
|
+
FfiConverterTypeAmount,
|
|
3899
|
+
FfiConverterTypeBip21Details,
|
|
3900
|
+
FfiConverterTypeBip21Extra,
|
|
3901
|
+
FfiConverterTypeBitcoinAddressDetails,
|
|
3902
|
+
FfiConverterTypeBitcoinNetwork,
|
|
3903
|
+
FfiConverterTypeBolt11Invoice,
|
|
3904
|
+
FfiConverterTypeBolt11InvoiceDetails,
|
|
3905
|
+
FfiConverterTypeBolt11RouteHint,
|
|
3906
|
+
FfiConverterTypeBolt11RouteHintHop,
|
|
3907
|
+
FfiConverterTypeBolt12Invoice,
|
|
3908
|
+
FfiConverterTypeBolt12InvoiceDetails,
|
|
3909
|
+
FfiConverterTypeBolt12InvoiceRequestDetails,
|
|
3910
|
+
FfiConverterTypeBolt12Offer,
|
|
3911
|
+
FfiConverterTypeBolt12OfferBlindedPath,
|
|
3912
|
+
FfiConverterTypeBolt12OfferDetails,
|
|
3913
|
+
FfiConverterTypeCurrencyInfo,
|
|
3914
|
+
FfiConverterTypeFiatCurrency,
|
|
3915
|
+
FfiConverterTypeInputType,
|
|
3916
|
+
FfiConverterTypeLightningAddressDetails,
|
|
3917
|
+
FfiConverterTypeLnurlAuthRequestDetails,
|
|
3918
|
+
FfiConverterTypeLnurlCallbackStatus,
|
|
3919
|
+
FfiConverterTypeLnurlErrorDetails,
|
|
3920
|
+
FfiConverterTypeLnurlPayRequestDetails,
|
|
3921
|
+
FfiConverterTypeLnurlWithdrawRequestDetails,
|
|
3922
|
+
FfiConverterTypeLocaleOverrides,
|
|
3923
|
+
FfiConverterTypeLocalizedName,
|
|
3924
|
+
FfiConverterTypeMessageSuccessActionData,
|
|
3925
|
+
FfiConverterTypePaymentRequestSource,
|
|
3926
|
+
FfiConverterTypeRate,
|
|
3927
|
+
FfiConverterTypeRestClient,
|
|
3928
|
+
FfiConverterTypeRestResponse,
|
|
3929
|
+
FfiConverterTypeSatsPaymentDetails,
|
|
3930
|
+
FfiConverterTypeSilentPaymentAddressDetails,
|
|
3931
|
+
FfiConverterTypeSparkAddress,
|
|
3932
|
+
FfiConverterTypeSparkAddressDetails,
|
|
3933
|
+
FfiConverterTypeSparkAddressPaymentType,
|
|
3934
|
+
FfiConverterTypeSparkInvoiceFields,
|
|
3935
|
+
FfiConverterTypeSuccessAction,
|
|
3936
|
+
FfiConverterTypeSuccessActionProcessed,
|
|
3937
|
+
FfiConverterTypeSymbol,
|
|
3938
|
+
FfiConverterTypeTokensPaymentDetails,
|
|
3939
|
+
FfiConverterTypeUrlSuccessActionData
|
|
3940
|
+
}
|
|
3941
|
+
});
|
|
3942
|
+
//# sourceMappingURL=breez_sdk_common.js.map
|