Skip to content
This repository was archived by the owner on Feb 8, 2026. It is now read-only.

Commit 28079b9

Browse files
committed
chore(lightning): Upgrade react-native-ldk to 0.0.96
Upgrades react-native-ldk to 0.0.96. Changes resetLdk method name to restartLdk. Replaces ldk.reset() with ldk.restart() in restartLdk method. Replaces setupLdk with refreshLdk in handleOrderStateChange method. Replaces resetLdk() with ldk.stop() in setupLdk method. Removes resetLdk() from refreshLdk method.
1 parent e0ef9aa commit 28079b9

7 files changed

Lines changed: 19 additions & 20 deletions

File tree

ios/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ PODS:
348348
- React-Core
349349
- react-native-image-picker (5.3.1):
350350
- React-Core
351-
- react-native-ldk (0.0.95):
351+
- react-native-ldk (0.0.96):
352352
- React
353353
- react-native-libsodium (0.7.0):
354354
- React-Core
@@ -835,7 +835,7 @@ SPEC CHECKSUMS:
835835
react-native-document-picker: 495c444c0c773c6e83a5d91165890ecb1c0a399a
836836
react-native-flipper: 5d8dcbcb905a7e8076c9a61a3709944c23cf48ee
837837
react-native-image-picker: ec9b713e248760bfa0f879f0715391de4651a7cb
838-
react-native-ldk: 3608ec98dc228dc8ea4ca15e68a8b4562be7cfb5
838+
react-native-ldk: d74fff362f75541785d504c78407a1d89efc83e4
839839
react-native-libsodium: 2834a805c906aef4b7609019bcc87e7d9eb86b23
840840
react-native-mmkv: 7da5e18e55c04a9af9a7e0ab9792a1e8d33765a1
841841
react-native-netinfo: 22c082970cbd99071a4e5aa7a612ac20d66b08f0

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"@reduxjs/toolkit": "^1.9.3",
5151
"@shopify/react-native-skia": "0.1.182",
5252
"@synonymdev/blocktank-client": "0.0.50",
53-
"@synonymdev/react-native-ldk": "0.0.95",
53+
"@synonymdev/react-native-ldk": "0.0.96",
5454
"@synonymdev/react-native-lnurl": "0.0.3",
5555
"@synonymdev/result": "0.0.2",
5656
"@synonymdev/slashtags-auth": "^1.0.0-alpha.5",

src/screens/Settings/AddressViewer/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ import {
7878
resetActivityStore,
7979
updateActivityList,
8080
} from '../../../store/actions/activity';
81-
import { resetLdk } from '../../../utils/lightning';
81+
import { restartLdk } from '../../../utils/lightning';
8282
import { startWalletServices } from '../../../utils/startup';
8383
import { updateOnchainFeeEstimates } from '../../../store/actions/fees';
8484
import { viewControllerIsOpenSelector } from '../../../store/reselect/ui';
@@ -820,7 +820,7 @@ const AddressViewer = ({
820820
addressType: config.addressType,
821821
});
822822
// Switching networks requires us to reset LDK.
823-
await resetLdk();
823+
await restartLdk();
824824
// Start wallet services with the newly selected network.
825825
await startWalletServices({
826826
selectedNetwork: config.selectedNetwork,

src/screens/Settings/Bitcoin/BitcoinNetworkSelection.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { connectToElectrum } from '../../../utils/wallet/electrum';
1818
import { startWalletServices } from '../../../utils/startup';
1919
import { EAvailableNetworks } from '../../../utils/networks';
2020
import { getNetworkData } from '../../../utils/helpers';
21-
import { resetLdk } from '../../../utils/lightning';
21+
import { restartLdk } from '../../../utils/lightning';
2222
import {
2323
getCurrentWallet,
2424
getSelectedAddressType,
@@ -62,7 +62,7 @@ const BitcoinNetworkSelection = ({
6262
addressType,
6363
});
6464
// Switching networks requires us to reset LDK.
65-
await resetLdk();
65+
await restartLdk();
6666
// Start wallet services with the newly selected network.
6767
await startWalletServices({ selectedNetwork: network });
6868
await updateOnchainFeeEstimates({

src/store/actions/blocktank.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import {
3535
} from '../../utils/notifications';
3636
import { getDisplayValues } from '../../utils/displayValues';
3737
import i18n from '../../utils/i18n';
38-
import { setupLdk } from '../../utils/lightning';
38+
import { refreshLdk } from '../../utils/lightning';
3939
import { TWalletName } from '../types/wallet';
4040
import { IBlocktank } from '../types/blocktank';
4141

@@ -425,8 +425,8 @@ const handleOrderStateChange = (order: IGetOrderResponse): void => {
425425
removeTodo('transferToSpending');
426426
}
427427

428-
// restart LDK after channel open
429-
setupLdk();
428+
// refresh LDK after channel open
429+
refreshLdk({});
430430
}
431431
};
432432

src/utils/lightning/index.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export const wipeLdkStorage = async ({
103103
selectedNetwork = getSelectedNetwork();
104104
}
105105

106-
await ldk.reset();
106+
await ldk.stop();
107107
const path = `${RNFS.DocumentDirectoryPath}/ldk/${lm.account.name}`;
108108

109109
const deleteAllFiles = async (dirpath: string): Promise<void> => {
@@ -159,7 +159,7 @@ export const setupLdk = async ({
159159
}
160160

161161
// start from a clean slate
162-
await resetLdk();
162+
await ldk.stop();
163163

164164
const account = await getAccount({ selectedWallet });
165165
if (account.isErr()) {
@@ -414,13 +414,13 @@ export const unsubscribeFromLightningSubscriptions = (): void => {
414414
onSpendableOutputsSubscription?.remove();
415415
};
416416

417-
export const resetLdk = async (): Promise<Result<string>> => {
417+
export const restartLdk = async (): Promise<Result<string>> => {
418418
// wait for interactions/animations to be completed
419419
await new Promise((resolve) => {
420420
InteractionManager.runAfterInteractions(() => resolve(null));
421421
});
422422

423-
return await ldk.reset();
423+
return await ldk.restart();
424424
};
425425

426426
/**
@@ -450,8 +450,7 @@ export const refreshLdk = async ({
450450

451451
const isRunning = await isLdkRunning();
452452
if (!isRunning) {
453-
await resetLdk();
454-
// Attempt to reset LDK.
453+
// Attempt to setup and start LDK.
455454
const setupResponse = await setupLdk({
456455
selectedNetwork,
457456
selectedWallet,

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2603,10 +2603,10 @@
26032603
cross-fetch "^3.1.4"
26042604
node-fetch "3.1.1"
26052605

2606-
"@synonymdev/[email protected].95":
2607-
version "0.0.95"
2608-
resolved "https://registry.yarnpkg.com/@synonymdev/react-native-ldk/-/react-native-ldk-0.0.95.tgz#b352dd05e4fd0ecc1d720f23ae932660483a900c"
2609-
integrity sha512-vT5cVCY9LtxeI+LtwnhbwG6PjH8/BDu6B8bgtOmJvmoHbHPl5QmKh8cRbddaZq2M39SSvWdF8IHKU3y3GF2PeA==
2606+
"@synonymdev/[email protected].96":
2607+
version "0.0.96"
2608+
resolved "https://registry.yarnpkg.com/@synonymdev/react-native-ldk/-/react-native-ldk-0.0.96.tgz#7fd8d9fc60784ead20f62ca684e30099af146ea9"
2609+
integrity sha512-zyvUCmVSM7uidPXgx+X1Ygi0aO9sbjtKmX75GTm2urw2PVESV840DhHcO0ojWYq3efrRYDf3AofDylRjCmHLqw==
26102610
dependencies:
26112611
bitcoinjs-lib "^6.0.2"
26122612

0 commit comments

Comments
 (0)