diff --git a/.gitignore b/.gitignore index 4b9f3d03..bf70bcda 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,6 @@ example/.watchman* # docker example/docker/lnd/ example/docker/clightning/ + +#AI +CLAUDE.md \ No newline at end of file diff --git a/example/metro.config.js b/example/metro.config.js index 32860c78..e0401a6a 100644 --- a/example/metro.config.js +++ b/example/metro.config.js @@ -20,6 +20,10 @@ const config = { vm: path.resolve(__dirname, 'node_modules/vm-browserify/'), process: path.resolve(__dirname, 'node_modules/process/'), }, + blockList: [ + // Exclude nested node_modules in the lib package to avoid bundling conflicts + /node_modules\/@synonymdev\/react-native-ldk\/node_modules\/.*/, + ], }, }; diff --git a/example/tests/eclair.ts b/example/tests/eclair.ts index 4da4f0a8..1ecdafef 100644 --- a/example/tests/eclair.ts +++ b/example/tests/eclair.ts @@ -113,7 +113,7 @@ describe('Eclair', function () { channelCloseMinimum: 5, outputSpendingFee: 10, urgentOnChainSweep: 30, - maximumFeeEstimate: 30 + maximumFeeEstimate: 30, }); }, }); diff --git a/lib/android/src/main/java/com/reactnativeldk/LdkModule.kt b/lib/android/src/main/java/com/reactnativeldk/LdkModule.kt index e16d74de..8b48b850 100644 --- a/lib/android/src/main/java/com/reactnativeldk/LdkModule.kt +++ b/lib/android/src/main/java/com/reactnativeldk/LdkModule.kt @@ -1730,6 +1730,10 @@ object LdkEventEmitter { this.reactContext = reactContext } + fun getReactContext(): ReactContext? { + return this.reactContext + } + fun send(eventType: EventTypes, body: Any) { if (this.reactContext === null) { return diff --git a/lib/android/src/main/java/com/reactnativeldk/classes/LdkPersister.kt b/lib/android/src/main/java/com/reactnativeldk/classes/LdkPersister.kt index 713190c3..61914c69 100644 --- a/lib/android/src/main/java/com/reactnativeldk/classes/LdkPersister.kt +++ b/lib/android/src/main/java/com/reactnativeldk/classes/LdkPersister.kt @@ -39,7 +39,7 @@ class LdkPersister { file.writeBytes(serialized) // Update chain monitor on main thread - LdkModule.reactContext?.runOnUiThread { + LdkEventEmitter.getReactContext()?.runOnUiQueueThread { val res = LdkModule.chainMonitor?.channel_monitor_updated(channelFundingOutpoint, data._latest_update_id) if (res == null || !res.is_ok) { LdkEventEmitter.send(EventTypes.native_log, "Failed to update chain monitor with persisted channel (${channelId})") @@ -75,7 +75,7 @@ class LdkPersister { } //Update chain monitor with successful persist on main thread - LdkModule.reactContext?.runOnUiThread { + LdkEventEmitter.getReactContext()?.runOnUiQueueThread { val res = LdkModule.chainMonitor?.channel_monitor_updated(channelFundingOutpoint, data._latest_update_id) if (res == null || !res.is_ok) { LdkEventEmitter.send(EventTypes.native_log, "Failed to update chain monitor with persisted channel (${channelId})") diff --git a/lib/package.json b/lib/package.json index 8bf4b949..75c6e003 100644 --- a/lib/package.json +++ b/lib/package.json @@ -1,7 +1,7 @@ { "name": "@synonymdev/react-native-ldk", "title": "React Native LDK", - "version": "0.0.161", + "version": "0.0.162", "description": "React Native wrapper for LDK", "main": "./dist/index.js", "types": "./dist/index.d.ts",