@breeztech/breez-sdk-spark-react-native 0.24.1 → 0.26.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@breeztech/breez-sdk-spark-react-native",
3
- "version": "0.24.1",
3
+ "version": "0.26.0",
4
4
  "description": "React Native bindings for the Breez SDK - Nodeless (Spark Implementation)",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/commonjs/index.js",
@@ -97,7 +97,7 @@
97
97
  "registry": "https://registry.npmjs.org/"
98
98
  },
99
99
  "dependencies": {
100
- "uniffi-bindgen-react-native": "^0.29.3-1"
100
+ "uniffi-bindgen-react-native": "git+https://github.com/breez/uniffi-bindgen-react-native.git#309bc8fa7fc56d4358dc75a78135a54d8225786b"
101
101
  },
102
102
  "devDependencies": {
103
103
  "@commitlint/config-conventional": "^17.0.2",
@@ -211,7 +211,7 @@
211
211
  "version": "0.49.0"
212
212
  },
213
213
  "checksums": {
214
- "android": "65fa06d137ca825811b090345826f5c8a97c882bb3dc5933459742816b5304f1",
215
- "ios": "01cc715f93532aaa9175b895872c2174e186e63d548bffd5b10d9f073ada1d8f"
214
+ "android": "e2ac09ed947629c6041e2dc95ec9ffe2c3571e2b7c542affaa25c9551df1e4b4",
215
+ "ios": "770946ef5a536aa582e51c492055667e3097940303d4eba7cdebd91193a6089b"
216
216
  }
217
217
  }
@@ -15,6 +15,9 @@
15
15
  * those hand-written files (which live under
16
16
  * `android/src/main/kotlin/...` to survive `yarn ubrn:clean`)
17
17
  * are actually compiled
18
+ * - guard `apply plugin: "kotlin-android"` so it is skipped when AGP
19
+ * has already registered the `kotlin` extension (AGP 9+ built-in
20
+ * Kotlin), which otherwise fails configuration
18
21
  *
19
22
  * 2. android/src/main/java/.../BreezSdkSparkReactNativePackage.kt
20
23
  * - register BreezSdkSparkPasskeyModule alongside the generated
@@ -137,6 +140,32 @@ patchFile(
137
140
  }
138
141
  );
139
142
 
143
+ patchFile(
144
+ 'android/build.gradle',
145
+ 'AGP 9 built-in Kotlin guard',
146
+ (content, label, relPath) => {
147
+ if (content.includes("project.extensions.findByName('kotlin')")) {
148
+ return content;
149
+ }
150
+ // Anchored on both applies, not just the Kotlin one: the guard is only
151
+ // correct after AGP has registered its extensions, so a reordering
152
+ // upstream must fail here rather than inject it where findByName always
153
+ // returns null.
154
+ const anchor = `apply plugin: "com.android.library"
155
+ apply plugin: "kotlin-android"`;
156
+ requireAnchor(content, anchor, label, relPath);
157
+ const injected = `apply plugin: "com.android.library"
158
+ // AGP 9 ships built-in Kotlin support and registers the \`kotlin\` extension
159
+ // itself. Applying the Kotlin plugin on top of it fails configuration with
160
+ // "Cannot add extension with name 'kotlin'". Only apply it when nothing has
161
+ // registered that extension yet.
162
+ if (project.extensions.findByName('kotlin') == null) {
163
+ apply plugin: "kotlin-android"
164
+ }`;
165
+ return content.replace(anchor, injected);
166
+ }
167
+ );
168
+
140
169
  // ---------------------------------------------------------------------------
141
170
  // 2. android/src/main/java/.../BreezSdkSparkReactNativePackage.kt
142
171
  // ---------------------------------------------------------------------------
@@ -109,6 +109,10 @@ interface NativeModuleInterface {
109
109
  ptr: bigint,
110
110
  request: Uint8Array
111
111
  ): bigint;
112
+ ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_check_unilateral_exit(
113
+ ptr: bigint,
114
+ request: Uint8Array
115
+ ): bigint;
112
116
  ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_claim_deposit(
113
117
  ptr: bigint,
114
118
  request: Uint8Array
@@ -783,6 +787,14 @@ interface NativeModuleInterface {
783
787
  vout: number,
784
788
  payload: Uint8Array
785
789
  ): bigint;
790
+ ubrn_uniffi_breez_sdk_spark_fn_method_storage_list_watched_deposit_addresses(
791
+ ptr: bigint
792
+ ): bigint;
793
+ ubrn_uniffi_breez_sdk_spark_fn_method_storage_update_watched_deposit_address(
794
+ ptr: bigint,
795
+ address: Uint8Array,
796
+ payload: Uint8Array
797
+ ): bigint;
786
798
  ubrn_uniffi_breez_sdk_spark_fn_method_storage_set_lnurl_metadata(
787
799
  ptr: bigint,
788
800
  metadata: Uint8Array
@@ -1144,6 +1156,7 @@ interface NativeModuleInterface {
1144
1156
  ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_buy_bitcoin(): number;
1145
1157
  ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_check_lightning_address_available(): number;
1146
1158
  ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_check_message(): number;
1159
+ ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_check_unilateral_exit(): number;
1147
1160
  ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_claim_deposit(): number;
1148
1161
  ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_claim_htlc_payment(): number;
1149
1162
  ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_claim_lightning_address_transfer(): number;
@@ -1268,6 +1281,8 @@ interface NativeModuleInterface {
1268
1281
  ubrn_uniffi_breez_sdk_spark_checksum_method_storage_delete_deposit(): number;
1269
1282
  ubrn_uniffi_breez_sdk_spark_checksum_method_storage_list_deposits(): number;
1270
1283
  ubrn_uniffi_breez_sdk_spark_checksum_method_storage_update_deposit(): number;
1284
+ ubrn_uniffi_breez_sdk_spark_checksum_method_storage_list_watched_deposit_addresses(): number;
1285
+ ubrn_uniffi_breez_sdk_spark_checksum_method_storage_update_watched_deposit_address(): number;
1271
1286
  ubrn_uniffi_breez_sdk_spark_checksum_method_storage_set_lnurl_metadata(): number;
1272
1287
  ubrn_uniffi_breez_sdk_spark_checksum_method_storage_list_contacts(): number;
1273
1288
  ubrn_uniffi_breez_sdk_spark_checksum_method_storage_get_contact(): number;
@@ -1905,102 +1920,114 @@ type UniffiCallbackInterfaceStorageMethod12 = (
1905
1920
  uniffiCallbackData: bigint
1906
1921
  ) => UniffiForeignFuture;
1907
1922
  type UniffiCallbackInterfaceStorageMethod13 = (
1923
+ uniffiHandle: bigint,
1924
+ uniffiFutureCallback: UniffiForeignFutureCompleteRustBuffer,
1925
+ uniffiCallbackData: bigint
1926
+ ) => UniffiForeignFuture;
1927
+ type UniffiCallbackInterfaceStorageMethod14 = (
1928
+ uniffiHandle: bigint,
1929
+ address: Uint8Array,
1930
+ payload: Uint8Array,
1931
+ uniffiFutureCallback: UniffiForeignFutureCompleteVoid,
1932
+ uniffiCallbackData: bigint
1933
+ ) => UniffiForeignFuture;
1934
+ type UniffiCallbackInterfaceStorageMethod15 = (
1908
1935
  uniffiHandle: bigint,
1909
1936
  metadata: Uint8Array,
1910
1937
  uniffiFutureCallback: UniffiForeignFutureCompleteVoid,
1911
1938
  uniffiCallbackData: bigint
1912
1939
  ) => UniffiForeignFuture;
1913
- type UniffiCallbackInterfaceStorageMethod14 = (
1940
+ type UniffiCallbackInterfaceStorageMethod16 = (
1914
1941
  uniffiHandle: bigint,
1915
1942
  request: Uint8Array,
1916
1943
  uniffiFutureCallback: UniffiForeignFutureCompleteRustBuffer,
1917
1944
  uniffiCallbackData: bigint
1918
1945
  ) => UniffiForeignFuture;
1919
- type UniffiCallbackInterfaceStorageMethod15 = (
1946
+ type UniffiCallbackInterfaceStorageMethod17 = (
1920
1947
  uniffiHandle: bigint,
1921
1948
  id: Uint8Array,
1922
1949
  uniffiFutureCallback: UniffiForeignFutureCompleteRustBuffer,
1923
1950
  uniffiCallbackData: bigint
1924
1951
  ) => UniffiForeignFuture;
1925
- type UniffiCallbackInterfaceStorageMethod16 = (
1952
+ type UniffiCallbackInterfaceStorageMethod18 = (
1926
1953
  uniffiHandle: bigint,
1927
1954
  contact: Uint8Array,
1928
1955
  uniffiFutureCallback: UniffiForeignFutureCompleteVoid,
1929
1956
  uniffiCallbackData: bigint
1930
1957
  ) => UniffiForeignFuture;
1931
- type UniffiCallbackInterfaceStorageMethod17 = (
1958
+ type UniffiCallbackInterfaceStorageMethod19 = (
1932
1959
  uniffiHandle: bigint,
1933
1960
  id: Uint8Array,
1934
1961
  uniffiFutureCallback: UniffiForeignFutureCompleteVoid,
1935
1962
  uniffiCallbackData: bigint
1936
1963
  ) => UniffiForeignFuture;
1937
- type UniffiCallbackInterfaceStorageMethod18 = (
1964
+ type UniffiCallbackInterfaceStorageMethod20 = (
1938
1965
  uniffiHandle: bigint,
1939
1966
  swap: Uint8Array,
1940
1967
  uniffiFutureCallback: UniffiForeignFutureCompleteVoid,
1941
1968
  uniffiCallbackData: bigint
1942
1969
  ) => UniffiForeignFuture;
1943
- type UniffiCallbackInterfaceStorageMethod19 = (
1970
+ type UniffiCallbackInterfaceStorageMethod21 = (
1944
1971
  uniffiHandle: bigint,
1945
1972
  provider: Uint8Array,
1946
1973
  id: Uint8Array,
1947
1974
  uniffiFutureCallback: UniffiForeignFutureCompleteRustBuffer,
1948
1975
  uniffiCallbackData: bigint
1949
1976
  ) => UniffiForeignFuture;
1950
- type UniffiCallbackInterfaceStorageMethod20 = (
1977
+ type UniffiCallbackInterfaceStorageMethod22 = (
1951
1978
  uniffiHandle: bigint,
1952
1979
  provider: Uint8Array,
1953
1980
  uniffiFutureCallback: UniffiForeignFutureCompleteRustBuffer,
1954
1981
  uniffiCallbackData: bigint
1955
1982
  ) => UniffiForeignFuture;
1956
- type UniffiCallbackInterfaceStorageMethod21 = (
1983
+ type UniffiCallbackInterfaceStorageMethod23 = (
1957
1984
  uniffiHandle: bigint,
1958
1985
  record: Uint8Array,
1959
1986
  uniffiFutureCallback: UniffiForeignFutureCompleteU64,
1960
1987
  uniffiCallbackData: bigint
1961
1988
  ) => UniffiForeignFuture;
1962
- type UniffiCallbackInterfaceStorageMethod22 = (
1989
+ type UniffiCallbackInterfaceStorageMethod24 = (
1963
1990
  uniffiHandle: bigint,
1964
1991
  record: Uint8Array,
1965
1992
  localRevision: bigint,
1966
1993
  uniffiFutureCallback: UniffiForeignFutureCompleteVoid,
1967
1994
  uniffiCallbackData: bigint
1968
1995
  ) => UniffiForeignFuture;
1969
- type UniffiCallbackInterfaceStorageMethod23 = (
1996
+ type UniffiCallbackInterfaceStorageMethod25 = (
1970
1997
  uniffiHandle: bigint,
1971
1998
  limit: number,
1972
1999
  uniffiFutureCallback: UniffiForeignFutureCompleteRustBuffer,
1973
2000
  uniffiCallbackData: bigint
1974
2001
  ) => UniffiForeignFuture;
1975
- type UniffiCallbackInterfaceStorageMethod24 = (
2002
+ type UniffiCallbackInterfaceStorageMethod26 = (
1976
2003
  uniffiHandle: bigint,
1977
2004
  uniffiFutureCallback: UniffiForeignFutureCompleteU64,
1978
2005
  uniffiCallbackData: bigint
1979
2006
  ) => UniffiForeignFuture;
1980
- type UniffiCallbackInterfaceStorageMethod25 = (
2007
+ type UniffiCallbackInterfaceStorageMethod27 = (
1981
2008
  uniffiHandle: bigint,
1982
2009
  records: Uint8Array,
1983
2010
  uniffiFutureCallback: UniffiForeignFutureCompleteVoid,
1984
2011
  uniffiCallbackData: bigint
1985
2012
  ) => UniffiForeignFuture;
1986
- type UniffiCallbackInterfaceStorageMethod26 = (
2013
+ type UniffiCallbackInterfaceStorageMethod28 = (
1987
2014
  uniffiHandle: bigint,
1988
2015
  record: Uint8Array,
1989
2016
  uniffiFutureCallback: UniffiForeignFutureCompleteVoid,
1990
2017
  uniffiCallbackData: bigint
1991
2018
  ) => UniffiForeignFuture;
1992
- type UniffiCallbackInterfaceStorageMethod27 = (
2019
+ type UniffiCallbackInterfaceStorageMethod29 = (
1993
2020
  uniffiHandle: bigint,
1994
2021
  limit: number,
1995
2022
  uniffiFutureCallback: UniffiForeignFutureCompleteRustBuffer,
1996
2023
  uniffiCallbackData: bigint
1997
2024
  ) => UniffiForeignFuture;
1998
- type UniffiCallbackInterfaceStorageMethod28 = (
2025
+ type UniffiCallbackInterfaceStorageMethod30 = (
1999
2026
  uniffiHandle: bigint,
2000
2027
  uniffiFutureCallback: UniffiForeignFutureCompleteRustBuffer,
2001
2028
  uniffiCallbackData: bigint
2002
2029
  ) => UniffiForeignFuture;
2003
- type UniffiCallbackInterfaceStorageMethod29 = (
2030
+ type UniffiCallbackInterfaceStorageMethod31 = (
2004
2031
  uniffiHandle: bigint,
2005
2032
  record: Uint8Array,
2006
2033
  uniffiFutureCallback: UniffiForeignFutureCompleteVoid,
@@ -2115,23 +2142,25 @@ export type UniffiVTableCallbackInterfaceStorage = {
2115
2142
  deleteDeposit: UniffiCallbackInterfaceStorageMethod10;
2116
2143
  listDeposits: UniffiCallbackInterfaceStorageMethod11;
2117
2144
  updateDeposit: UniffiCallbackInterfaceStorageMethod12;
2118
- setLnurlMetadata: UniffiCallbackInterfaceStorageMethod13;
2119
- listContacts: UniffiCallbackInterfaceStorageMethod14;
2120
- getContact: UniffiCallbackInterfaceStorageMethod15;
2121
- insertContact: UniffiCallbackInterfaceStorageMethod16;
2122
- deleteContact: UniffiCallbackInterfaceStorageMethod17;
2123
- setCrossChainSwap: UniffiCallbackInterfaceStorageMethod18;
2124
- getCrossChainSwap: UniffiCallbackInterfaceStorageMethod19;
2125
- listActiveCrossChainSwaps: UniffiCallbackInterfaceStorageMethod20;
2126
- addOutgoingChange: UniffiCallbackInterfaceStorageMethod21;
2127
- completeOutgoingSync: UniffiCallbackInterfaceStorageMethod22;
2128
- getPendingOutgoingChanges: UniffiCallbackInterfaceStorageMethod23;
2129
- getLastRevision: UniffiCallbackInterfaceStorageMethod24;
2130
- insertIncomingRecords: UniffiCallbackInterfaceStorageMethod25;
2131
- deleteIncomingRecord: UniffiCallbackInterfaceStorageMethod26;
2132
- getIncomingRecords: UniffiCallbackInterfaceStorageMethod27;
2133
- getLatestOutgoingChange: UniffiCallbackInterfaceStorageMethod28;
2134
- updateRecordFromIncoming: UniffiCallbackInterfaceStorageMethod29;
2145
+ listWatchedDepositAddresses: UniffiCallbackInterfaceStorageMethod13;
2146
+ updateWatchedDepositAddress: UniffiCallbackInterfaceStorageMethod14;
2147
+ setLnurlMetadata: UniffiCallbackInterfaceStorageMethod15;
2148
+ listContacts: UniffiCallbackInterfaceStorageMethod16;
2149
+ getContact: UniffiCallbackInterfaceStorageMethod17;
2150
+ insertContact: UniffiCallbackInterfaceStorageMethod18;
2151
+ deleteContact: UniffiCallbackInterfaceStorageMethod19;
2152
+ setCrossChainSwap: UniffiCallbackInterfaceStorageMethod20;
2153
+ getCrossChainSwap: UniffiCallbackInterfaceStorageMethod21;
2154
+ listActiveCrossChainSwaps: UniffiCallbackInterfaceStorageMethod22;
2155
+ addOutgoingChange: UniffiCallbackInterfaceStorageMethod23;
2156
+ completeOutgoingSync: UniffiCallbackInterfaceStorageMethod24;
2157
+ getPendingOutgoingChanges: UniffiCallbackInterfaceStorageMethod25;
2158
+ getLastRevision: UniffiCallbackInterfaceStorageMethod26;
2159
+ insertIncomingRecords: UniffiCallbackInterfaceStorageMethod27;
2160
+ deleteIncomingRecord: UniffiCallbackInterfaceStorageMethod28;
2161
+ getIncomingRecords: UniffiCallbackInterfaceStorageMethod29;
2162
+ getLatestOutgoingChange: UniffiCallbackInterfaceStorageMethod30;
2163
+ updateRecordFromIncoming: UniffiCallbackInterfaceStorageMethod31;
2135
2164
  uniffiFree: UniffiCallbackInterfaceFree;
2136
2165
  };
2137
2166
  export type UniffiVTableCallbackInterfaceStorageBackend = {