@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.
Files changed (103) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +54 -0
  3. package/android/CMakeLists.txt +79 -0
  4. package/android/build.gradle +143 -0
  5. package/android/cpp-adapter.cpp +63 -0
  6. package/android/generated/android/app/build/generated/source/codegen/java/com/facebook/fbreact/specs/NativeBreezSdkSparkReactNativeSpec.java +41 -0
  7. package/android/generated/android/app/build/generated/source/codegen/jni/BreezSdkSparkReactNativeSpec-generated.cpp +38 -0
  8. package/android/generated/android/app/build/generated/source/codegen/jni/BreezSdkSparkReactNativeSpec.h +31 -0
  9. package/android/generated/android/app/build/generated/source/codegen/jni/CMakeLists.txt +36 -0
  10. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/BreezSdkSparkReactNativeSpec/BreezSdkSparkReactNativeSpecJSI-generated.cpp +32 -0
  11. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/BreezSdkSparkReactNativeSpec/BreezSdkSparkReactNativeSpecJSI.h +80 -0
  12. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/BreezSdkSparkReactNativeSpec/ComponentDescriptors.cpp +22 -0
  13. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/BreezSdkSparkReactNativeSpec/ComponentDescriptors.h +24 -0
  14. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/BreezSdkSparkReactNativeSpec/EventEmitters.cpp +16 -0
  15. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/BreezSdkSparkReactNativeSpec/EventEmitters.h +17 -0
  16. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/BreezSdkSparkReactNativeSpec/Props.cpp +19 -0
  17. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/BreezSdkSparkReactNativeSpec/Props.h +18 -0
  18. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/BreezSdkSparkReactNativeSpec/ShadowNodes.cpp +17 -0
  19. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/BreezSdkSparkReactNativeSpec/ShadowNodes.h +23 -0
  20. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/BreezSdkSparkReactNativeSpec/States.cpp +16 -0
  21. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/BreezSdkSparkReactNativeSpec/States.h +19 -0
  22. package/android/gradle.properties +5 -0
  23. package/android/src/main/AndroidManifest.xml +5 -0
  24. package/android/src/main/AndroidManifestNew.xml +2 -0
  25. package/android/src/main/java/com/breeztech/breezsdkspark/BreezSdkSparkReactNativeModule.kt +43 -0
  26. package/android/src/main/java/com/breeztech/breezsdkspark/BreezSdkSparkReactNativePackage.kt +34 -0
  27. package/breeztech-breez-sdk-spark-react-native.podspec +44 -0
  28. package/cpp/breeztech-breez-sdk-spark-react-native.cpp +20 -0
  29. package/cpp/breeztech-breez-sdk-spark-react-native.h +15 -0
  30. package/cpp/generated/breez_sdk_common.cpp +3834 -0
  31. package/cpp/generated/breez_sdk_common.hpp +251 -0
  32. package/cpp/generated/breez_sdk_spark.cpp +8722 -0
  33. package/cpp/generated/breez_sdk_spark.hpp +589 -0
  34. package/cpp/generated/breez_sdk_spark_bindings.cpp +1750 -0
  35. package/cpp/generated/breez_sdk_spark_bindings.hpp +65 -0
  36. package/ios/BreezSdkSparkReactNative.h +16 -0
  37. package/ios/BreezSdkSparkReactNative.mm +66 -0
  38. package/ios/generated/build/generated/ios/BreezSdkSparkReactNativeSpec/BreezSdkSparkReactNativeSpec-generated.mm +46 -0
  39. package/ios/generated/build/generated/ios/BreezSdkSparkReactNativeSpec/BreezSdkSparkReactNativeSpec.h +63 -0
  40. package/ios/generated/build/generated/ios/BreezSdkSparkReactNativeSpecJSI-generated.cpp +32 -0
  41. package/ios/generated/build/generated/ios/BreezSdkSparkReactNativeSpecJSI.h +80 -0
  42. package/ios/generated/build/generated/ios/react/renderer/components/BreezSdkSparkReactNativeSpec/ComponentDescriptors.cpp +22 -0
  43. package/ios/generated/build/generated/ios/react/renderer/components/BreezSdkSparkReactNativeSpec/ComponentDescriptors.h +24 -0
  44. package/ios/generated/build/generated/ios/react/renderer/components/BreezSdkSparkReactNativeSpec/EventEmitters.cpp +16 -0
  45. package/ios/generated/build/generated/ios/react/renderer/components/BreezSdkSparkReactNativeSpec/EventEmitters.h +17 -0
  46. package/ios/generated/build/generated/ios/react/renderer/components/BreezSdkSparkReactNativeSpec/Props.cpp +19 -0
  47. package/ios/generated/build/generated/ios/react/renderer/components/BreezSdkSparkReactNativeSpec/Props.h +18 -0
  48. package/ios/generated/build/generated/ios/react/renderer/components/BreezSdkSparkReactNativeSpec/RCTComponentViewHelpers.h +18 -0
  49. package/ios/generated/build/generated/ios/react/renderer/components/BreezSdkSparkReactNativeSpec/ShadowNodes.cpp +17 -0
  50. package/ios/generated/build/generated/ios/react/renderer/components/BreezSdkSparkReactNativeSpec/ShadowNodes.h +23 -0
  51. package/ios/generated/build/generated/ios/react/renderer/components/BreezSdkSparkReactNativeSpec/States.cpp +16 -0
  52. package/ios/generated/build/generated/ios/react/renderer/components/BreezSdkSparkReactNativeSpec/States.h +19 -0
  53. package/lib/commonjs/NativeBreezSdkSparkReactNative.js +10 -0
  54. package/lib/commonjs/NativeBreezSdkSparkReactNative.js.map +1 -0
  55. package/lib/commonjs/generated/breez_sdk_common-ffi.js +44 -0
  56. package/lib/commonjs/generated/breez_sdk_common-ffi.js.map +1 -0
  57. package/lib/commonjs/generated/breez_sdk_common.js +3948 -0
  58. package/lib/commonjs/generated/breez_sdk_common.js.map +1 -0
  59. package/lib/commonjs/generated/breez_sdk_spark-ffi.js +44 -0
  60. package/lib/commonjs/generated/breez_sdk_spark-ffi.js.map +1 -0
  61. package/lib/commonjs/generated/breez_sdk_spark.js +5775 -0
  62. package/lib/commonjs/generated/breez_sdk_spark.js.map +1 -0
  63. package/lib/commonjs/generated/breez_sdk_spark_bindings-ffi.js +44 -0
  64. package/lib/commonjs/generated/breez_sdk_spark_bindings-ffi.js.map +1 -0
  65. package/lib/commonjs/generated/breez_sdk_spark_bindings.js +51 -0
  66. package/lib/commonjs/generated/breez_sdk_spark_bindings.js.map +1 -0
  67. package/lib/commonjs/index.js +81 -0
  68. package/lib/commonjs/index.js.map +1 -0
  69. package/lib/commonjs/package.json +1 -0
  70. package/lib/module/NativeBreezSdkSparkReactNative.js +7 -0
  71. package/lib/module/NativeBreezSdkSparkReactNative.js.map +1 -0
  72. package/lib/module/generated/breez_sdk_common-ffi.js +43 -0
  73. package/lib/module/generated/breez_sdk_common-ffi.js.map +1 -0
  74. package/lib/module/generated/breez_sdk_common.js +3942 -0
  75. package/lib/module/generated/breez_sdk_common.js.map +1 -0
  76. package/lib/module/generated/breez_sdk_spark-ffi.js +43 -0
  77. package/lib/module/generated/breez_sdk_spark-ffi.js.map +1 -0
  78. package/lib/module/generated/breez_sdk_spark.js +5759 -0
  79. package/lib/module/generated/breez_sdk_spark.js.map +1 -0
  80. package/lib/module/generated/breez_sdk_spark_bindings-ffi.js +43 -0
  81. package/lib/module/generated/breez_sdk_spark_bindings-ffi.js.map +1 -0
  82. package/lib/module/generated/breez_sdk_spark_bindings.js +46 -0
  83. package/lib/module/generated/breez_sdk_spark_bindings.js.map +1 -0
  84. package/lib/module/index.js +44 -0
  85. package/lib/module/index.js.map +1 -0
  86. package/lib/module/package.json +1 -0
  87. package/lib/typescript/commonjs/package.json +1 -0
  88. package/lib/typescript/commonjs/src/NativeBreezSdkSparkReactNative.d.ts +8 -0
  89. package/lib/typescript/commonjs/src/NativeBreezSdkSparkReactNative.d.ts.map +1 -0
  90. package/lib/typescript/module/package.json +1 -0
  91. package/lib/typescript/module/src/NativeBreezSdkSparkReactNative.d.ts +8 -0
  92. package/lib/typescript/module/src/NativeBreezSdkSparkReactNative.d.ts.map +1 -0
  93. package/package.json +189 -0
  94. package/react-native.config.js +12 -0
  95. package/scripts/postinstall.sh +14 -0
  96. package/src/NativeBreezSdkSparkReactNative.ts +10 -0
  97. package/src/generated/breez_sdk_common-ffi.ts +394 -0
  98. package/src/generated/breez_sdk_common.ts +5502 -0
  99. package/src/generated/breez_sdk_spark-ffi.ts +751 -0
  100. package/src/generated/breez_sdk_spark.ts +9179 -0
  101. package/src/generated/breez_sdk_spark_bindings-ffi.ts +185 -0
  102. package/src/generated/breez_sdk_spark_bindings.ts +103 -0
  103. package/src/index.tsx +42 -0
@@ -0,0 +1,185 @@
1
+ // This file was autogenerated by some hot garbage in the `uniffi-bindgen-react-native` crate.
2
+ // Trust me, you don't want to mess with it!
3
+
4
+ import {
5
+ type StructuralEquality as UniffiStructuralEquality,
6
+ type UniffiForeignFuture as RuntimeUniffiForeignFuture,
7
+ type UniffiRustCallStatus,
8
+ type UniffiRustArcPtr,
9
+ type UniffiRustFutureContinuationCallback as RuntimeUniffiRustFutureContinuationCallback,
10
+ type UniffiResult,
11
+ } from 'uniffi-bindgen-react-native';
12
+
13
+ interface NativeModuleInterface {
14
+ ubrn_uniffi_internal_fn_func_ffi__string_to_byte_length(
15
+ string: string,
16
+ uniffi_out_err: UniffiRustCallStatus
17
+ ): number;
18
+ ubrn_uniffi_internal_fn_func_ffi__string_to_arraybuffer(
19
+ string: string,
20
+ uniffi_out_err: UniffiRustCallStatus
21
+ ): Uint8Array;
22
+ ubrn_uniffi_internal_fn_func_ffi__arraybuffer_to_string(
23
+ buffer: Uint8Array,
24
+ uniffi_out_err: UniffiRustCallStatus
25
+ ): string;
26
+ ubrn_ffi_breez_sdk_spark_bindings_uniffi_contract_version(): number;
27
+ }
28
+
29
+ // Casting globalThis to any allows us to look for `NativeBreezSdkSparkBindings`
30
+ // if it was added via JSI.
31
+ //
32
+ // We use a getter here rather than simply `globalThis.NativeBreezSdkSparkBindings` so that
33
+ // if/when the startup sequence isn't just so, an empty value isn't inadvertantly cached.
34
+ const getter: () => NativeModuleInterface = () =>
35
+ (globalThis as any).NativeBreezSdkSparkBindings;
36
+ export default getter;
37
+
38
+ // Structs and function types for calling back into Typescript from Rust.
39
+ export type UniffiRustFutureContinuationCallback = (
40
+ data: bigint,
41
+ pollResult: number
42
+ ) => void;
43
+ type UniffiForeignFutureFree = (handle: bigint) => void;
44
+ type UniffiCallbackInterfaceFree = (handle: bigint) => void;
45
+ export type UniffiForeignFuture = {
46
+ handle: bigint;
47
+ free: UniffiForeignFutureFree;
48
+ };
49
+ export type UniffiForeignFutureStructU8 = {
50
+ returnValue: number;
51
+ callStatus: UniffiRustCallStatus;
52
+ };
53
+ export type UniffiForeignFutureCompleteU8 = (
54
+ callbackData: bigint,
55
+ result: UniffiForeignFutureStructU8
56
+ ) => void;
57
+ export type UniffiForeignFutureStructI8 = {
58
+ returnValue: number;
59
+ callStatus: UniffiRustCallStatus;
60
+ };
61
+ export type UniffiForeignFutureCompleteI8 = (
62
+ callbackData: bigint,
63
+ result: UniffiForeignFutureStructI8
64
+ ) => void;
65
+ export type UniffiForeignFutureStructU16 = {
66
+ returnValue: number;
67
+ callStatus: UniffiRustCallStatus;
68
+ };
69
+ export type UniffiForeignFutureCompleteU16 = (
70
+ callbackData: bigint,
71
+ result: UniffiForeignFutureStructU16
72
+ ) => void;
73
+ export type UniffiForeignFutureStructI16 = {
74
+ returnValue: number;
75
+ callStatus: UniffiRustCallStatus;
76
+ };
77
+ export type UniffiForeignFutureCompleteI16 = (
78
+ callbackData: bigint,
79
+ result: UniffiForeignFutureStructI16
80
+ ) => void;
81
+ export type UniffiForeignFutureStructU32 = {
82
+ returnValue: number;
83
+ callStatus: UniffiRustCallStatus;
84
+ };
85
+ export type UniffiForeignFutureCompleteU32 = (
86
+ callbackData: bigint,
87
+ result: UniffiForeignFutureStructU32
88
+ ) => void;
89
+ export type UniffiForeignFutureStructI32 = {
90
+ returnValue: number;
91
+ callStatus: UniffiRustCallStatus;
92
+ };
93
+ export type UniffiForeignFutureCompleteI32 = (
94
+ callbackData: bigint,
95
+ result: UniffiForeignFutureStructI32
96
+ ) => void;
97
+ export type UniffiForeignFutureStructU64 = {
98
+ returnValue: bigint;
99
+ callStatus: UniffiRustCallStatus;
100
+ };
101
+ export type UniffiForeignFutureCompleteU64 = (
102
+ callbackData: bigint,
103
+ result: UniffiForeignFutureStructU64
104
+ ) => void;
105
+ export type UniffiForeignFutureStructI64 = {
106
+ returnValue: bigint;
107
+ callStatus: UniffiRustCallStatus;
108
+ };
109
+ export type UniffiForeignFutureCompleteI64 = (
110
+ callbackData: bigint,
111
+ result: UniffiForeignFutureStructI64
112
+ ) => void;
113
+ export type UniffiForeignFutureStructF32 = {
114
+ returnValue: number;
115
+ callStatus: UniffiRustCallStatus;
116
+ };
117
+ export type UniffiForeignFutureCompleteF32 = (
118
+ callbackData: bigint,
119
+ result: UniffiForeignFutureStructF32
120
+ ) => void;
121
+ export type UniffiForeignFutureStructF64 = {
122
+ returnValue: number;
123
+ callStatus: UniffiRustCallStatus;
124
+ };
125
+ export type UniffiForeignFutureCompleteF64 = (
126
+ callbackData: bigint,
127
+ result: UniffiForeignFutureStructF64
128
+ ) => void;
129
+ export type UniffiForeignFutureStructPointer = {
130
+ returnValue: bigint;
131
+ callStatus: UniffiRustCallStatus;
132
+ };
133
+ export type UniffiForeignFutureCompletePointer = (
134
+ callbackData: bigint,
135
+ result: UniffiForeignFutureStructPointer
136
+ ) => void;
137
+ export type UniffiForeignFutureStructRustBuffer = {
138
+ returnValue: Uint8Array;
139
+ callStatus: UniffiRustCallStatus;
140
+ };
141
+ export type UniffiForeignFutureCompleteRustBuffer = (
142
+ callbackData: bigint,
143
+ result: UniffiForeignFutureStructRustBuffer
144
+ ) => void;
145
+ export type UniffiForeignFutureStructVoid = {
146
+ callStatus: UniffiRustCallStatus;
147
+ };
148
+ export type UniffiForeignFutureCompleteVoid = (
149
+ callbackData: bigint,
150
+ result: UniffiForeignFutureStructVoid
151
+ ) => void;
152
+
153
+ // UniffiRustFutureContinuationCallback is generated as part of the component interface's
154
+ // ffi_definitions. However, we need it in the runtime.
155
+ // We could:
156
+ // (a) do some complicated template logic to ensure the declaration is not generated here (possible)
157
+ // (b) import the generated declaration into the runtime (m a y b e) or…
158
+ // (c) generate the declaration anyway, and use a different declaration in the runtime.
159
+ //
160
+ // We chose (c) here as the simplest. In addition, we perform a compile time check that
161
+ // the two versions of `UniffiRustFutureContinuationCallback` are structurally equivalent.
162
+ //
163
+ // If you see the error:
164
+ // ```
165
+ // Type 'true' is not assignable to type 'false'.(2322)
166
+ // ```
167
+ // Then a new version of uniffi has changed the signature of the callback. Most likely, code in
168
+ // `typescript/src/async-rust-call.ts` will need to be changed.
169
+ //
170
+ // If you see the error:
171
+ // ```
172
+ // Cannot find name 'UniffiRustFutureContinuationCallback'. Did you mean 'RuntimeUniffiRustFutureContinuationCallback'?(2552)
173
+ // ```
174
+ // then you may not be using callbacks or promises, and uniffi is now not generating Futures and callbacks.
175
+ // You should not generate this if that is the case.
176
+ //
177
+ // ('You' being the bindings generator maintainer).
178
+ const isRustFutureContinuationCallbackTypeCompatible: UniffiStructuralEquality<
179
+ RuntimeUniffiRustFutureContinuationCallback,
180
+ UniffiRustFutureContinuationCallback
181
+ > = true;
182
+ const isUniffiForeignFutureTypeCompatible: UniffiStructuralEquality<
183
+ RuntimeUniffiForeignFuture,
184
+ UniffiForeignFuture
185
+ > = true;
@@ -0,0 +1,103 @@
1
+ // This file was autogenerated by some hot garbage in the `uniffi-bindgen-react-native` crate.
2
+ // Trust me, you don't want to mess with it!
3
+ import nativeModule, {
4
+ type UniffiRustFutureContinuationCallback,
5
+ type UniffiForeignFuture,
6
+ type UniffiForeignFutureStructU8,
7
+ type UniffiForeignFutureCompleteU8,
8
+ type UniffiForeignFutureStructI8,
9
+ type UniffiForeignFutureCompleteI8,
10
+ type UniffiForeignFutureStructU16,
11
+ type UniffiForeignFutureCompleteU16,
12
+ type UniffiForeignFutureStructI16,
13
+ type UniffiForeignFutureCompleteI16,
14
+ type UniffiForeignFutureStructU32,
15
+ type UniffiForeignFutureCompleteU32,
16
+ type UniffiForeignFutureStructI32,
17
+ type UniffiForeignFutureCompleteI32,
18
+ type UniffiForeignFutureStructU64,
19
+ type UniffiForeignFutureCompleteU64,
20
+ type UniffiForeignFutureStructI64,
21
+ type UniffiForeignFutureCompleteI64,
22
+ type UniffiForeignFutureStructF32,
23
+ type UniffiForeignFutureCompleteF32,
24
+ type UniffiForeignFutureStructF64,
25
+ type UniffiForeignFutureCompleteF64,
26
+ type UniffiForeignFutureStructPointer,
27
+ type UniffiForeignFutureCompletePointer,
28
+ type UniffiForeignFutureStructRustBuffer,
29
+ type UniffiForeignFutureCompleteRustBuffer,
30
+ type UniffiForeignFutureStructVoid,
31
+ type UniffiForeignFutureCompleteVoid,
32
+ } from './breez_sdk_spark_bindings-ffi';
33
+ import {
34
+ type UniffiByteArray,
35
+ RustBuffer,
36
+ UniffiInternalError,
37
+ UniffiRustCaller,
38
+ uniffiCreateFfiConverterString,
39
+ } from 'uniffi-bindgen-react-native';
40
+
41
+ // Get converters from the other files, if any.
42
+ const uniffiCaller = new UniffiRustCaller();
43
+
44
+ const uniffiIsDebug =
45
+ // @ts-ignore -- The process global might not be defined
46
+ typeof process !== 'object' ||
47
+ // @ts-ignore -- The process global might not be defined
48
+ process?.env?.NODE_ENV !== 'production' ||
49
+ false;
50
+ // Public interface members begin here.
51
+
52
+ const stringConverter = {
53
+ stringToBytes: (s: string) =>
54
+ uniffiCaller.rustCall((status) =>
55
+ nativeModule().ubrn_uniffi_internal_fn_func_ffi__string_to_arraybuffer(
56
+ s,
57
+ status
58
+ )
59
+ ),
60
+ bytesToString: (ab: UniffiByteArray) =>
61
+ uniffiCaller.rustCall((status) =>
62
+ nativeModule().ubrn_uniffi_internal_fn_func_ffi__arraybuffer_to_string(
63
+ ab,
64
+ status
65
+ )
66
+ ),
67
+ stringByteLength: (s: string) =>
68
+ uniffiCaller.rustCall((status) =>
69
+ nativeModule().ubrn_uniffi_internal_fn_func_ffi__string_to_byte_length(
70
+ s,
71
+ status
72
+ )
73
+ ),
74
+ };
75
+ const FfiConverterString = uniffiCreateFfiConverterString(stringConverter);
76
+
77
+ /**
78
+ * This should be called before anything else.
79
+ *
80
+ * It is likely that this is being done for you by the library's `index.ts`.
81
+ *
82
+ * It checks versions of uniffi between when the Rust scaffolding was generated
83
+ * and when the bindings were generated.
84
+ *
85
+ * It also initializes the machinery to enable Rust to talk back to Javascript.
86
+ */
87
+ function uniffiEnsureInitialized() {
88
+ // Get the bindings contract version from our ComponentInterface
89
+ const bindingsContractVersion = 26;
90
+ // Get the scaffolding contract version by calling the into the dylib
91
+ const scaffoldingContractVersion =
92
+ nativeModule().ubrn_ffi_breez_sdk_spark_bindings_uniffi_contract_version();
93
+ if (bindingsContractVersion !== scaffoldingContractVersion) {
94
+ throw new UniffiInternalError.ContractVersionMismatch(
95
+ scaffoldingContractVersion,
96
+ bindingsContractVersion
97
+ );
98
+ }
99
+ }
100
+
101
+ export default Object.freeze({
102
+ initialize: uniffiEnsureInitialized,
103
+ });
package/src/index.tsx ADDED
@@ -0,0 +1,42 @@
1
+ // Generated by uniffi-bindgen-react-native
2
+ import installer from './NativeBreezSdkSparkReactNative';
3
+
4
+ // Register the rust crate with Hermes
5
+ // - the boolean flag ensures this loads exactly once, even if the JS
6
+ // code is reloaded (e.g. during development with metro).
7
+ let rustInstalled = false;
8
+ if (!rustInstalled) {
9
+ installer.installRustCrate();
10
+ rustInstalled = true;
11
+ }
12
+
13
+ // Export the generated bindings to the app.
14
+ export * from './generated/breez_sdk_common';
15
+ export * from './generated/breez_sdk_spark';
16
+ export * from './generated/breez_sdk_spark_bindings';
17
+
18
+ // Now import the bindings so we can:
19
+ // - intialize them
20
+ // - export them as namespaced objects as the default export.
21
+ import * as breez_sdk_common from './generated/breez_sdk_common';
22
+ import * as breez_sdk_spark from './generated/breez_sdk_spark';
23
+ import * as breez_sdk_spark_bindings from './generated/breez_sdk_spark_bindings';
24
+
25
+ // Initialize the generated bindings: mostly checksums, but also callbacks.
26
+ // - the boolean flag ensures this loads exactly once, even if the JS code
27
+ // is reloaded (e.g. during development with metro).
28
+ let initialized = false;
29
+ if (!initialized) {
30
+ breez_sdk_common.default.initialize();
31
+ breez_sdk_spark.default.initialize();
32
+ breez_sdk_spark_bindings.default.initialize();
33
+ initialized = true;
34
+ }
35
+
36
+ // Export the crates as individually namespaced objects.
37
+ export default {
38
+ breez_sdk_common,
39
+ breez_sdk_spark,
40
+ breez_sdk_spark_bindings,
41
+ };
42
+