From 1fd2ab33f52bf9cbf4e03fa26752547af3706425 Mon Sep 17 00:00:00 2001 From: Roland Bewick Date: Wed, 4 Sep 2024 00:49:30 +0700 Subject: [PATCH 1/3] feat: show pending balances from channel closures (LDK) --- frontend/src/screens/channels/Channels.tsx | 30 ++++++++++++- frontend/src/types.ts | 1 + lnclient/ldk/ldk.go | 49 ++++++++++++++++++++-- lnclient/models.go | 7 ++-- 4 files changed, 79 insertions(+), 8 deletions(-) diff --git a/frontend/src/screens/channels/Channels.tsx b/frontend/src/screens/channels/Channels.tsx index c29f3bbf..70cd5795 100644 --- a/frontend/src/screens/channels/Channels.tsx +++ b/frontend/src/screens/channels/Channels.tsx @@ -7,6 +7,7 @@ import { CopyIcon, Heart, Hotel, + HourglassIcon, InfoIcon, Unplug, } from "lucide-react"; @@ -300,11 +301,15 @@ export default function Channels() { {new Intl.NumberFormat().format(balances.onchain.spendable)}{" "} sats {balances && - balances.onchain.spendable !== balances.onchain.total && ( + (balances.onchain.spendable !== balances.onchain.total || + balances.onchain.pendingBalancesFromChannelClosures > + 0) && (

+ {new Intl.NumberFormat().format( - balances.onchain.total - balances.onchain.spendable + balances.onchain.total - + balances.onchain.spendable + + balances.onchain.pendingBalancesFromChannelClosures )}{" "} sats incoming

@@ -403,6 +408,27 @@ export default function Channels() { + {balances && balances.onchain.pendingBalancesFromChannelClosures > 0 && ( + + + Pending Closed Channels + + You have{" "} + {new Intl.NumberFormat().format( + balances.onchain.pendingBalancesFromChannelClosures + )}{" "} + sats pending from one or more closed channels. These may take up to + 2 weeks to return to your savings balance.{" "} + + Learn more + + + + )} + {channels && channels.length === 0 && ( Date: Wed, 4 Sep 2024 10:54:49 +0700 Subject: [PATCH 2/3] chore: improve pending balances copy Co-authored-by: Michael Bumann --- frontend/src/screens/channels/Channels.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/screens/channels/Channels.tsx b/frontend/src/screens/channels/Channels.tsx index 70cd5795..ba0345ca 100644 --- a/frontend/src/screens/channels/Channels.tsx +++ b/frontend/src/screens/channels/Channels.tsx @@ -417,8 +417,8 @@ export default function Channels() { {new Intl.NumberFormat().format( balances.onchain.pendingBalancesFromChannelClosures )}{" "} - sats pending from one or more closed channels. These may take up to - 2 weeks to return to your savings balance.{" "} + sats pending from one or more closed channels. Once spendable again these + will become available in your savings balance.{" "} Date: Wed, 4 Sep 2024 10:56:46 +0700 Subject: [PATCH 3/3] chore: format --- frontend/src/screens/channels/Channels.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/screens/channels/Channels.tsx b/frontend/src/screens/channels/Channels.tsx index ba0345ca..a6bdf083 100644 --- a/frontend/src/screens/channels/Channels.tsx +++ b/frontend/src/screens/channels/Channels.tsx @@ -417,8 +417,8 @@ export default function Channels() { {new Intl.NumberFormat().format( balances.onchain.pendingBalancesFromChannelClosures )}{" "} - sats pending from one or more closed channels. Once spendable again these - will become available in your savings balance.{" "} + sats pending from one or more closed channels. Once spendable again + these will become available in your savings balance.{" "}