@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 @@
1
+ {"type":"module"}
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
@@ -0,0 +1,8 @@
1
+ import type { TurboModule } from 'react-native';
2
+ export interface Spec extends TurboModule {
3
+ installRustCrate(): boolean;
4
+ cleanupRustCrate(): boolean;
5
+ }
6
+ declare const _default: Spec;
7
+ export default _default;
8
+ //# sourceMappingURL=NativeBreezSdkSparkReactNative.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeBreezSdkSparkReactNative.d.ts","sourceRoot":"","sources":["../../../../src/NativeBreezSdkSparkReactNative.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,gBAAgB,IAAI,OAAO,CAAC;IAC5B,gBAAgB,IAAI,OAAO,CAAC;CAC7B;;AAED,wBAAkF"}
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1,8 @@
1
+ import type { TurboModule } from 'react-native';
2
+ export interface Spec extends TurboModule {
3
+ installRustCrate(): boolean;
4
+ cleanupRustCrate(): boolean;
5
+ }
6
+ declare const _default: Spec;
7
+ export default _default;
8
+ //# sourceMappingURL=NativeBreezSdkSparkReactNative.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeBreezSdkSparkReactNative.d.ts","sourceRoot":"","sources":["../../../../src/NativeBreezSdkSparkReactNative.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,gBAAgB,IAAI,OAAO,CAAC;IAC5B,gBAAgB,IAAI,OAAO,CAAC;CAC7B;;AAED,wBAAkF"}
package/package.json ADDED
@@ -0,0 +1,189 @@
1
+ {
2
+ "name": "@breeztech/breez-sdk-spark-react-native",
3
+ "version": "0.1.8-dev1",
4
+ "description": "React Native bindings for the Breez SDK - Nodeless (Spark Implementation)",
5
+ "source": "./src/index.tsx",
6
+ "main": "./lib/commonjs/index.js",
7
+ "module": "./lib/module/index.js",
8
+ "exports": {
9
+ ".": {
10
+ "import": {
11
+ "types": "./lib/typescript/module/src/NativeBreezSdkSparkReactNative.d.ts",
12
+ "default": "./lib/module/index.js"
13
+ },
14
+ "require": {
15
+ "types": "./lib/typescript/commonjs/src/NativeBreezSdkSparkReactNative.d.ts",
16
+ "default": "./lib/commonjs/index.js"
17
+ }
18
+ }
19
+ },
20
+ "files": [
21
+ "src",
22
+ "lib",
23
+ "android",
24
+ "ios",
25
+ "cpp",
26
+ "*.podspec",
27
+ "react-native.config.js",
28
+ "swift",
29
+ "scripts",
30
+ "!ios/build",
31
+ "!android/build",
32
+ "!android/gradle",
33
+ "!android/gradlew",
34
+ "!android/gradlew.bat",
35
+ "!android/local.properties",
36
+ "!**/__tests__",
37
+ "!**/__fixtures__",
38
+ "!**/__mocks__",
39
+ "!**/.*"
40
+ ],
41
+ "scripts": {
42
+ "clean": "del-cli android/generated ios/generated lib",
43
+ "lint": "eslint \"**/*.{js,ts,tsx}\"",
44
+ "postinstall": "./scripts/postinstall.sh",
45
+ "prepare": "bob build",
46
+ "release": "release-it --only-version",
47
+ "typecheck": "tsc",
48
+ "ubrn:android": "ubrn build android --release --config ubrn.config.yaml --and-generate",
49
+ "ubrn:build": "yarn ubrn:ios && yarn ubrn:android",
50
+ "ubrn:checkout": "ubrn checkout --config ubrn.config.yaml",
51
+ "ubrn:clean": "rm -rfv cpp/ android/CMakeLists.txt android/src/main/java android/*.cpp ios/ src/Native* src/index.*ts* src/generated/",
52
+ "ubrn:ios": "ubrn build ios --release --config ubrn.config.yaml --and-generate"
53
+ },
54
+ "keywords": [
55
+ "react-native",
56
+ "ios",
57
+ "android",
58
+ "breez",
59
+ "sdk",
60
+ "lightning",
61
+ "bitcoin",
62
+ "nodeless",
63
+ "spark"
64
+ ],
65
+ "repository": {
66
+ "type": "git",
67
+ "url": "git+https://github.com/breez/spark-sdk.git"
68
+ },
69
+ "author": "Breez <contact@breez.technology> (https://github.com/breez)",
70
+ "license": "MIT",
71
+ "bugs": {
72
+ "url": "https://github.com/breez/spark-sdk/issues"
73
+ },
74
+ "homepage": "https://github.com/breez/spark-sdk#readme",
75
+ "publishConfig": {
76
+ "registry": "https://registry.npmjs.org/"
77
+ },
78
+ "dependencies": {
79
+ "uniffi-bindgen-react-native": "^0.28.3-5"
80
+ },
81
+ "devDependencies": {
82
+ "@commitlint/config-conventional": "^17.0.2",
83
+ "@react-native-community/cli": "15.0.1",
84
+ "@react-native/eslint-config": "^0.73.1",
85
+ "@release-it/conventional-changelog": "^9.0.2",
86
+ "@types/jest": "^29.5.5",
87
+ "@types/react": "^18.2.44",
88
+ "commitlint": "^17.0.2",
89
+ "del-cli": "^5.1.0",
90
+ "eslint": "^8.51.0",
91
+ "eslint-config-prettier": "^9.0.0",
92
+ "eslint-plugin-prettier": "^5.0.1",
93
+ "jest": "^29.7.0",
94
+ "prettier": "^3.0.3",
95
+ "react": "19.0.0",
96
+ "react-native": "0.78.0",
97
+ "react-native-builder-bob": "^0.40.3",
98
+ "release-it": "^17.10.0",
99
+ "turbo": "^1.10.7",
100
+ "typescript": "^5.2.2"
101
+ },
102
+ "peerDependencies": {
103
+ "react": "*",
104
+ "react-native": "*"
105
+ },
106
+ "packageManager": "yarn@3.6.1",
107
+ "jest": {
108
+ "preset": "react-native",
109
+ "modulePathIgnorePatterns": [
110
+ "<rootDir>/example/node_modules",
111
+ "<rootDir>/lib/"
112
+ ]
113
+ },
114
+ "commitlint": {
115
+ "extends": [
116
+ "@commitlint/config-conventional"
117
+ ]
118
+ },
119
+ "release-it": {
120
+ "git": {
121
+ "commitMessage": "chore: release ${version}",
122
+ "tagName": "v${version}"
123
+ },
124
+ "npm": {
125
+ "publish": true
126
+ },
127
+ "github": {
128
+ "release": true
129
+ },
130
+ "plugins": {
131
+ "@release-it/conventional-changelog": {
132
+ "preset": {
133
+ "name": "angular"
134
+ }
135
+ }
136
+ }
137
+ },
138
+ "prettier": {
139
+ "quoteProps": "consistent",
140
+ "singleQuote": true,
141
+ "tabWidth": 2,
142
+ "trailingComma": "es5",
143
+ "useTabs": false
144
+ },
145
+ "react-native-builder-bob": {
146
+ "source": "src",
147
+ "output": "lib",
148
+ "exclude": "rust_modules/**",
149
+ "targets": [
150
+ "codegen",
151
+ [
152
+ "module",
153
+ {
154
+ "esm": true
155
+ }
156
+ ],
157
+ [
158
+ "commonjs",
159
+ {
160
+ "esm": true
161
+ }
162
+ ],
163
+ [
164
+ "typescript",
165
+ {
166
+ "project": "tsconfig.build.json"
167
+ }
168
+ ]
169
+ ]
170
+ },
171
+ "codegenConfig": {
172
+ "name": "BreezSdkSparkReactNativeSpec",
173
+ "type": "all",
174
+ "jsSrcsDir": "src",
175
+ "outputDir": {
176
+ "ios": "ios/generated",
177
+ "android": "android/generated"
178
+ },
179
+ "android": {
180
+ "javaPackageName": "com.breeztech.breezsdkspark"
181
+ },
182
+ "includesGeneratedCode": false
183
+ },
184
+ "create-react-native-library": {
185
+ "type": "turbo-module",
186
+ "languages": "cpp",
187
+ "version": "0.49.0"
188
+ }
189
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @type {import('@react-native-community/cli-types').UserDependencyConfig}
3
+ */
4
+ module.exports = {
5
+ dependency: {
6
+ platforms: {
7
+ android: {
8
+ cmakeListsPath: 'generated/android/app/build/generated/source/codegen/jni/CMakeLists.txt',
9
+ },
10
+ },
11
+ },
12
+ };
@@ -0,0 +1,14 @@
1
+ #!/bin/sh
2
+ # Download prebuilt binary artifacts from the release
3
+ REPO=https://github.com/breez/breez-sdk-spark-react-native
4
+ TAG=$(node -p "require('./package.json').version")
5
+
6
+ ANDROID_URL=$REPO/releases/download/$TAG/android-artifacts.zip
7
+ curl -L $ANDROID_URL --output android-artifacts.zip
8
+ unzip -o android-artifacts.zip
9
+ rm -rf android-artifacts.zip
10
+
11
+ IOS_URL=$REPO/releases/download/$TAG/ios-artifacts.zip
12
+ curl -L $IOS_URL --output ios-artifacts.zip
13
+ unzip -o ios-artifacts.zip
14
+ rm -rf ios-artifacts.zip
@@ -0,0 +1,10 @@
1
+ // Generated by uniffi-bindgen-react-native
2
+ import type { TurboModule } from 'react-native';
3
+ import { TurboModuleRegistry } from 'react-native';
4
+
5
+ export interface Spec extends TurboModule {
6
+ installRustCrate(): boolean;
7
+ cleanupRustCrate(): boolean;
8
+ }
9
+
10
+ export default TurboModuleRegistry.getEnforcing<Spec>('BreezSdkSparkReactNative');
@@ -0,0 +1,394 @@
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_uniffi_breez_sdk_common_fn_clone_restclient(
27
+ ptr: bigint,
28
+ uniffi_out_err: UniffiRustCallStatus
29
+ ): bigint;
30
+ ubrn_uniffi_breez_sdk_common_fn_free_restclient(
31
+ ptr: bigint,
32
+ uniffi_out_err: UniffiRustCallStatus
33
+ ): void;
34
+ ubrn_uniffi_breez_sdk_common_fn_method_restclient_get(
35
+ ptr: bigint,
36
+ url: Uint8Array,
37
+ headers: Uint8Array
38
+ ): bigint;
39
+ ubrn_uniffi_breez_sdk_common_fn_method_restclient_post(
40
+ ptr: bigint,
41
+ url: Uint8Array,
42
+ headers: Uint8Array,
43
+ body: Uint8Array
44
+ ): bigint;
45
+ ubrn_uniffi_breez_sdk_common_fn_method_restclient_delete(
46
+ ptr: bigint,
47
+ url: Uint8Array,
48
+ headers: Uint8Array,
49
+ body: Uint8Array
50
+ ): bigint;
51
+ ubrn_ffi_breez_sdk_common_rust_future_poll_u8(
52
+ handle: bigint,
53
+ callback: UniffiRustFutureContinuationCallback,
54
+ callbackData: bigint
55
+ ): void;
56
+ ubrn_ffi_breez_sdk_common_rust_future_cancel_u8(handle: bigint): void;
57
+ ubrn_ffi_breez_sdk_common_rust_future_free_u8(handle: bigint): void;
58
+ ubrn_ffi_breez_sdk_common_rust_future_complete_u8(
59
+ handle: bigint,
60
+ uniffi_out_err: UniffiRustCallStatus
61
+ ): number;
62
+ ubrn_ffi_breez_sdk_common_rust_future_poll_i8(
63
+ handle: bigint,
64
+ callback: UniffiRustFutureContinuationCallback,
65
+ callbackData: bigint
66
+ ): void;
67
+ ubrn_ffi_breez_sdk_common_rust_future_cancel_i8(handle: bigint): void;
68
+ ubrn_ffi_breez_sdk_common_rust_future_free_i8(handle: bigint): void;
69
+ ubrn_ffi_breez_sdk_common_rust_future_complete_i8(
70
+ handle: bigint,
71
+ uniffi_out_err: UniffiRustCallStatus
72
+ ): number;
73
+ ubrn_ffi_breez_sdk_common_rust_future_poll_u16(
74
+ handle: bigint,
75
+ callback: UniffiRustFutureContinuationCallback,
76
+ callbackData: bigint
77
+ ): void;
78
+ ubrn_ffi_breez_sdk_common_rust_future_cancel_u16(handle: bigint): void;
79
+ ubrn_ffi_breez_sdk_common_rust_future_free_u16(handle: bigint): void;
80
+ ubrn_ffi_breez_sdk_common_rust_future_complete_u16(
81
+ handle: bigint,
82
+ uniffi_out_err: UniffiRustCallStatus
83
+ ): number;
84
+ ubrn_ffi_breez_sdk_common_rust_future_poll_i16(
85
+ handle: bigint,
86
+ callback: UniffiRustFutureContinuationCallback,
87
+ callbackData: bigint
88
+ ): void;
89
+ ubrn_ffi_breez_sdk_common_rust_future_cancel_i16(handle: bigint): void;
90
+ ubrn_ffi_breez_sdk_common_rust_future_free_i16(handle: bigint): void;
91
+ ubrn_ffi_breez_sdk_common_rust_future_complete_i16(
92
+ handle: bigint,
93
+ uniffi_out_err: UniffiRustCallStatus
94
+ ): number;
95
+ ubrn_ffi_breez_sdk_common_rust_future_poll_u32(
96
+ handle: bigint,
97
+ callback: UniffiRustFutureContinuationCallback,
98
+ callbackData: bigint
99
+ ): void;
100
+ ubrn_ffi_breez_sdk_common_rust_future_cancel_u32(handle: bigint): void;
101
+ ubrn_ffi_breez_sdk_common_rust_future_free_u32(handle: bigint): void;
102
+ ubrn_ffi_breez_sdk_common_rust_future_complete_u32(
103
+ handle: bigint,
104
+ uniffi_out_err: UniffiRustCallStatus
105
+ ): number;
106
+ ubrn_ffi_breez_sdk_common_rust_future_poll_i32(
107
+ handle: bigint,
108
+ callback: UniffiRustFutureContinuationCallback,
109
+ callbackData: bigint
110
+ ): void;
111
+ ubrn_ffi_breez_sdk_common_rust_future_cancel_i32(handle: bigint): void;
112
+ ubrn_ffi_breez_sdk_common_rust_future_free_i32(handle: bigint): void;
113
+ ubrn_ffi_breez_sdk_common_rust_future_complete_i32(
114
+ handle: bigint,
115
+ uniffi_out_err: UniffiRustCallStatus
116
+ ): number;
117
+ ubrn_ffi_breez_sdk_common_rust_future_poll_u64(
118
+ handle: bigint,
119
+ callback: UniffiRustFutureContinuationCallback,
120
+ callbackData: bigint
121
+ ): void;
122
+ ubrn_ffi_breez_sdk_common_rust_future_cancel_u64(handle: bigint): void;
123
+ ubrn_ffi_breez_sdk_common_rust_future_free_u64(handle: bigint): void;
124
+ ubrn_ffi_breez_sdk_common_rust_future_complete_u64(
125
+ handle: bigint,
126
+ uniffi_out_err: UniffiRustCallStatus
127
+ ): bigint;
128
+ ubrn_ffi_breez_sdk_common_rust_future_poll_i64(
129
+ handle: bigint,
130
+ callback: UniffiRustFutureContinuationCallback,
131
+ callbackData: bigint
132
+ ): void;
133
+ ubrn_ffi_breez_sdk_common_rust_future_cancel_i64(handle: bigint): void;
134
+ ubrn_ffi_breez_sdk_common_rust_future_free_i64(handle: bigint): void;
135
+ ubrn_ffi_breez_sdk_common_rust_future_complete_i64(
136
+ handle: bigint,
137
+ uniffi_out_err: UniffiRustCallStatus
138
+ ): bigint;
139
+ ubrn_ffi_breez_sdk_common_rust_future_poll_f32(
140
+ handle: bigint,
141
+ callback: UniffiRustFutureContinuationCallback,
142
+ callbackData: bigint
143
+ ): void;
144
+ ubrn_ffi_breez_sdk_common_rust_future_cancel_f32(handle: bigint): void;
145
+ ubrn_ffi_breez_sdk_common_rust_future_free_f32(handle: bigint): void;
146
+ ubrn_ffi_breez_sdk_common_rust_future_complete_f32(
147
+ handle: bigint,
148
+ uniffi_out_err: UniffiRustCallStatus
149
+ ): number;
150
+ ubrn_ffi_breez_sdk_common_rust_future_poll_f64(
151
+ handle: bigint,
152
+ callback: UniffiRustFutureContinuationCallback,
153
+ callbackData: bigint
154
+ ): void;
155
+ ubrn_ffi_breez_sdk_common_rust_future_cancel_f64(handle: bigint): void;
156
+ ubrn_ffi_breez_sdk_common_rust_future_free_f64(handle: bigint): void;
157
+ ubrn_ffi_breez_sdk_common_rust_future_complete_f64(
158
+ handle: bigint,
159
+ uniffi_out_err: UniffiRustCallStatus
160
+ ): number;
161
+ ubrn_ffi_breez_sdk_common_rust_future_poll_pointer(
162
+ handle: bigint,
163
+ callback: UniffiRustFutureContinuationCallback,
164
+ callbackData: bigint
165
+ ): void;
166
+ ubrn_ffi_breez_sdk_common_rust_future_cancel_pointer(handle: bigint): void;
167
+ ubrn_ffi_breez_sdk_common_rust_future_free_pointer(handle: bigint): void;
168
+ ubrn_ffi_breez_sdk_common_rust_future_complete_pointer(
169
+ handle: bigint,
170
+ uniffi_out_err: UniffiRustCallStatus
171
+ ): bigint;
172
+ ubrn_ffi_breez_sdk_common_rust_future_poll_rust_buffer(
173
+ handle: bigint,
174
+ callback: UniffiRustFutureContinuationCallback,
175
+ callbackData: bigint
176
+ ): void;
177
+ ubrn_ffi_breez_sdk_common_rust_future_cancel_rust_buffer(
178
+ handle: bigint
179
+ ): void;
180
+ ubrn_ffi_breez_sdk_common_rust_future_free_rust_buffer(handle: bigint): void;
181
+ ubrn_ffi_breez_sdk_common_rust_future_complete_rust_buffer(
182
+ handle: bigint,
183
+ uniffi_out_err: UniffiRustCallStatus
184
+ ): Uint8Array;
185
+ ubrn_ffi_breez_sdk_common_rust_future_poll_void(
186
+ handle: bigint,
187
+ callback: UniffiRustFutureContinuationCallback,
188
+ callbackData: bigint
189
+ ): void;
190
+ ubrn_ffi_breez_sdk_common_rust_future_cancel_void(handle: bigint): void;
191
+ ubrn_ffi_breez_sdk_common_rust_future_free_void(handle: bigint): void;
192
+ ubrn_ffi_breez_sdk_common_rust_future_complete_void(
193
+ handle: bigint,
194
+ uniffi_out_err: UniffiRustCallStatus
195
+ ): void;
196
+ ubrn_uniffi_breez_sdk_common_checksum_method_restclient_get(): number;
197
+ ubrn_uniffi_breez_sdk_common_checksum_method_restclient_post(): number;
198
+ ubrn_uniffi_breez_sdk_common_checksum_method_restclient_delete(): number;
199
+ ubrn_ffi_breez_sdk_common_uniffi_contract_version(): number;
200
+ ubrn_uniffi_breez_sdk_common_fn_init_callback_vtable_restclient(
201
+ vtable: UniffiVTableCallbackInterfaceRestClient
202
+ ): void;
203
+ ubrn_uniffi_internal_fn_method_restclient_ffi__bless_pointer(
204
+ pointer: bigint,
205
+ uniffi_out_err: UniffiRustCallStatus
206
+ ): UniffiRustArcPtr;
207
+ }
208
+
209
+ // Casting globalThis to any allows us to look for `NativeBreezSdkCommon`
210
+ // if it was added via JSI.
211
+ //
212
+ // We use a getter here rather than simply `globalThis.NativeBreezSdkCommon` so that
213
+ // if/when the startup sequence isn't just so, an empty value isn't inadvertantly cached.
214
+ const getter: () => NativeModuleInterface = () =>
215
+ (globalThis as any).NativeBreezSdkCommon;
216
+ export default getter;
217
+
218
+ // Structs and function types for calling back into Typescript from Rust.
219
+ export type UniffiRustFutureContinuationCallback = (
220
+ data: bigint,
221
+ pollResult: number
222
+ ) => void;
223
+ type UniffiForeignFutureFree = (handle: bigint) => void;
224
+ type UniffiCallbackInterfaceFree = (handle: bigint) => void;
225
+ export type UniffiForeignFuture = {
226
+ handle: bigint;
227
+ free: UniffiForeignFutureFree;
228
+ };
229
+ export type UniffiForeignFutureStructU8 = {
230
+ returnValue: number;
231
+ callStatus: UniffiRustCallStatus;
232
+ };
233
+ export type UniffiForeignFutureCompleteU8 = (
234
+ callbackData: bigint,
235
+ result: UniffiForeignFutureStructU8
236
+ ) => void;
237
+ export type UniffiForeignFutureStructI8 = {
238
+ returnValue: number;
239
+ callStatus: UniffiRustCallStatus;
240
+ };
241
+ export type UniffiForeignFutureCompleteI8 = (
242
+ callbackData: bigint,
243
+ result: UniffiForeignFutureStructI8
244
+ ) => void;
245
+ export type UniffiForeignFutureStructU16 = {
246
+ returnValue: number;
247
+ callStatus: UniffiRustCallStatus;
248
+ };
249
+ export type UniffiForeignFutureCompleteU16 = (
250
+ callbackData: bigint,
251
+ result: UniffiForeignFutureStructU16
252
+ ) => void;
253
+ export type UniffiForeignFutureStructI16 = {
254
+ returnValue: number;
255
+ callStatus: UniffiRustCallStatus;
256
+ };
257
+ export type UniffiForeignFutureCompleteI16 = (
258
+ callbackData: bigint,
259
+ result: UniffiForeignFutureStructI16
260
+ ) => void;
261
+ export type UniffiForeignFutureStructU32 = {
262
+ returnValue: number;
263
+ callStatus: UniffiRustCallStatus;
264
+ };
265
+ export type UniffiForeignFutureCompleteU32 = (
266
+ callbackData: bigint,
267
+ result: UniffiForeignFutureStructU32
268
+ ) => void;
269
+ export type UniffiForeignFutureStructI32 = {
270
+ returnValue: number;
271
+ callStatus: UniffiRustCallStatus;
272
+ };
273
+ export type UniffiForeignFutureCompleteI32 = (
274
+ callbackData: bigint,
275
+ result: UniffiForeignFutureStructI32
276
+ ) => void;
277
+ export type UniffiForeignFutureStructU64 = {
278
+ returnValue: bigint;
279
+ callStatus: UniffiRustCallStatus;
280
+ };
281
+ export type UniffiForeignFutureCompleteU64 = (
282
+ callbackData: bigint,
283
+ result: UniffiForeignFutureStructU64
284
+ ) => void;
285
+ export type UniffiForeignFutureStructI64 = {
286
+ returnValue: bigint;
287
+ callStatus: UniffiRustCallStatus;
288
+ };
289
+ export type UniffiForeignFutureCompleteI64 = (
290
+ callbackData: bigint,
291
+ result: UniffiForeignFutureStructI64
292
+ ) => void;
293
+ export type UniffiForeignFutureStructF32 = {
294
+ returnValue: number;
295
+ callStatus: UniffiRustCallStatus;
296
+ };
297
+ export type UniffiForeignFutureCompleteF32 = (
298
+ callbackData: bigint,
299
+ result: UniffiForeignFutureStructF32
300
+ ) => void;
301
+ export type UniffiForeignFutureStructF64 = {
302
+ returnValue: number;
303
+ callStatus: UniffiRustCallStatus;
304
+ };
305
+ export type UniffiForeignFutureCompleteF64 = (
306
+ callbackData: bigint,
307
+ result: UniffiForeignFutureStructF64
308
+ ) => void;
309
+ export type UniffiForeignFutureStructPointer = {
310
+ returnValue: bigint;
311
+ callStatus: UniffiRustCallStatus;
312
+ };
313
+ export type UniffiForeignFutureCompletePointer = (
314
+ callbackData: bigint,
315
+ result: UniffiForeignFutureStructPointer
316
+ ) => void;
317
+ export type UniffiForeignFutureStructRustBuffer = {
318
+ returnValue: Uint8Array;
319
+ callStatus: UniffiRustCallStatus;
320
+ };
321
+ export type UniffiForeignFutureCompleteRustBuffer = (
322
+ callbackData: bigint,
323
+ result: UniffiForeignFutureStructRustBuffer
324
+ ) => void;
325
+ export type UniffiForeignFutureStructVoid = {
326
+ callStatus: UniffiRustCallStatus;
327
+ };
328
+ export type UniffiForeignFutureCompleteVoid = (
329
+ callbackData: bigint,
330
+ result: UniffiForeignFutureStructVoid
331
+ ) => void;
332
+ type UniffiCallbackInterfaceRestClientMethod0 = (
333
+ uniffiHandle: bigint,
334
+ url: Uint8Array,
335
+ headers: Uint8Array,
336
+ uniffiFutureCallback: UniffiForeignFutureCompleteRustBuffer,
337
+ uniffiCallbackData: bigint
338
+ ) => UniffiResult<UniffiForeignFuture>;
339
+ type UniffiCallbackInterfaceRestClientMethod1 = (
340
+ uniffiHandle: bigint,
341
+ url: Uint8Array,
342
+ headers: Uint8Array,
343
+ body: Uint8Array,
344
+ uniffiFutureCallback: UniffiForeignFutureCompleteRustBuffer,
345
+ uniffiCallbackData: bigint
346
+ ) => UniffiResult<UniffiForeignFuture>;
347
+ type UniffiCallbackInterfaceRestClientMethod2 = (
348
+ uniffiHandle: bigint,
349
+ url: Uint8Array,
350
+ headers: Uint8Array,
351
+ body: Uint8Array,
352
+ uniffiFutureCallback: UniffiForeignFutureCompleteRustBuffer,
353
+ uniffiCallbackData: bigint
354
+ ) => UniffiResult<UniffiForeignFuture>;
355
+ export type UniffiVTableCallbackInterfaceRestClient = {
356
+ get: UniffiCallbackInterfaceRestClientMethod0;
357
+ post: UniffiCallbackInterfaceRestClientMethod1;
358
+ delete_: UniffiCallbackInterfaceRestClientMethod2;
359
+ uniffiFree: UniffiCallbackInterfaceFree;
360
+ };
361
+
362
+ // UniffiRustFutureContinuationCallback is generated as part of the component interface's
363
+ // ffi_definitions. However, we need it in the runtime.
364
+ // We could:
365
+ // (a) do some complicated template logic to ensure the declaration is not generated here (possible)
366
+ // (b) import the generated declaration into the runtime (m a y b e) or…
367
+ // (c) generate the declaration anyway, and use a different declaration in the runtime.
368
+ //
369
+ // We chose (c) here as the simplest. In addition, we perform a compile time check that
370
+ // the two versions of `UniffiRustFutureContinuationCallback` are structurally equivalent.
371
+ //
372
+ // If you see the error:
373
+ // ```
374
+ // Type 'true' is not assignable to type 'false'.(2322)
375
+ // ```
376
+ // Then a new version of uniffi has changed the signature of the callback. Most likely, code in
377
+ // `typescript/src/async-rust-call.ts` will need to be changed.
378
+ //
379
+ // If you see the error:
380
+ // ```
381
+ // Cannot find name 'UniffiRustFutureContinuationCallback'. Did you mean 'RuntimeUniffiRustFutureContinuationCallback'?(2552)
382
+ // ```
383
+ // then you may not be using callbacks or promises, and uniffi is now not generating Futures and callbacks.
384
+ // You should not generate this if that is the case.
385
+ //
386
+ // ('You' being the bindings generator maintainer).
387
+ const isRustFutureContinuationCallbackTypeCompatible: UniffiStructuralEquality<
388
+ RuntimeUniffiRustFutureContinuationCallback,
389
+ UniffiRustFutureContinuationCallback
390
+ > = true;
391
+ const isUniffiForeignFutureTypeCompatible: UniffiStructuralEquality<
392
+ RuntimeUniffiForeignFuture,
393
+ UniffiForeignFuture
394
+ > = true;