From 6e19491a76e20668baaeec52a5240b8f455e2439 Mon Sep 17 00:00:00 2001 From: Jason Date: Fri, 30 Aug 2024 14:20:37 +0200 Subject: [PATCH] feat: example app channel funding Update lightning-manager.ts --- example/Dev.tsx | 100 ++++++++++++++---- .../main/java/com/reactnativeldk/LdkModule.kt | 12 +++ .../classes/LdkChannelManagerPersister.kt | 2 +- lib/src/lightning-manager.ts | 2 - 4 files changed, 93 insertions(+), 23 deletions(-) diff --git a/example/Dev.tsx b/example/Dev.tsx index ab2086f6..3a848a18 100644 --- a/example/Dev.tsx +++ b/example/Dev.tsx @@ -25,7 +25,12 @@ import lm, { TChannelUpdate, } from '@synonymdev/react-native-ldk'; import { backupServerDetails, peers } from './utils/constants'; -import { createNewAccount, getAccount, getAddress } from './utils/helpers'; +import { + createNewAccount, + getAccount, + getAddress, + getAddressFromScriptPubKey, +} from './utils/helpers'; import RNFS from 'react-native-fs'; let logSubscription: EmitterSubscription | undefined; @@ -41,6 +46,7 @@ const Dev = (): ReactElement => { const [nodeStarted, setNodeStarted] = useState(false); const [showLogs, setShowLogs] = useState(false); const [logContent, setLogContent] = useState(''); + const [temporaryChannelId, setTemporaryChannelId] = useState(''); //For funding channels locally useEffect(() => { //Restarting LDK on each code update causes constant errors. @@ -231,7 +237,6 @@ const Dev = (): ReactElement => { } }} /> -