Skip to content

Show reserved_balance_anchor_chan on On-chain section#3676

Closed
aryanraj45 wants to merge 1 commit intoZeusLN:masterfrom
aryanraj45:display-reserved-anchor-balance
Closed

Show reserved_balance_anchor_chan on On-chain section#3676
aryanraj45 wants to merge 1 commit intoZeusLN:masterfrom
aryanraj45:display-reserved-anchor-balance

Conversation

@aryanraj45
Copy link
Copy Markdown
Contributor

Fixes #3092

Description

Relates to issue: ZEUS-3092

Displays reserved_balance_anchor_chan from LND wallet balance API as a subtitle under the On-chain balance row. This makes it explicit to users how much of their on-chain balance is reserved for anchor channel commitments and cannot be spent.

Changes:

  • Added reservedBalanceAnchorChan observable to BalanceStore
  • Display subtitle "Reserved for anchor channels: X sats" when value > 0
  • Added locale string general.reservedBalanceAnchorChan

Screenshots:

image *LND confirmation showing `reserved_balance_anchor_chan: 20000`:* ```json image This pull request is categorized as a:
  • New feature
  • Bug fix
  • Code refactor
  • Configuration change
  • Locales update
  • Quality assurance
  • Other

Checklist

  • I’ve run yarn run tsc and made sure my code compiles correctly
  • I’ve run yarn run lint and made sure my code didn’t contain any problematic patterns
    -[x] I’ve run yarn run prettier and made sure my code is formatted correctly
  • I’ve run yarn run test and made sure all of the tests pass

Testing

If you modified or added a utility file, did you add new unit tests?

  • No, I’m a fool
  • Yes
  • N/A

I have tested this PR on the following platforms (please specify OS version and phone model/VM):

  • Android
  • iOS

I have tested this PR with the following types of nodes (please specify node version and API version where appropriate):

  • Embedded LND
  • LND (REST) - v0.20.0-beta via Polar regtest with anchor channels
  • LND (Lightning Node Connect)
  • Core Lightning (CLNRest)
  • Nostr Wallet Connect
  • LndHub

Locales

  • I’ve added new locale text that requires translations
  • I’m aware that new translations should be made on the ZEUS Transfix page and not directly to this repo

Third Party Dependencies and Packages

  • Contributors will need to run yarn after this PR is merged in
  • 3rd party dependencies have been modified:
    • verify that package.json and yarn.lock have been properly updated
    • verify that dependencies are installed for both iOS and Android platforms

Other:

  • Changes were made that require an update to the README
  • Changes were made that require an update to onboarding

Copilot AI review requested due to automatic review settings February 7, 2026 21:43
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @aryanraj45, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the user interface by providing greater transparency into on-chain balances. It specifically addresses the display of funds reserved for anchor channels, making it clear to users which portion of their on-chain balance is not immediately spendable due to these commitments. This improves user understanding of their available funds and the implications of anchor channels.

Highlights

  • New Balance Display: Introduced a new subtitle under the 'On-chain' balance to explicitly show the amount reserved for anchor channel commitments.
  • Balance Store Update: Added a new observable property, reservedBalanceAnchorChan, to the BalanceStore to track the reserved balance from the LND wallet API.
  • Localization Support: Added a new locale string general.reservedBalanceAnchorChan to support internationalization for the new display text.
Changelog
  • components/LayerBalances/index.tsx
    • Imported reservedBalanceAnchorChan from BalanceStore.
    • Implemented conditional rendering to display a subtitle 'Reserved for anchor channels: X sats' below the 'On-chain' balance if reservedBalanceAnchorChan is greater than zero.
  • locales/en.json
    • Added a new locale key general.reservedBalanceAnchorChan with the value 'Reserved for anchor channels'.
  • stores/BalanceStore.ts
    • Added @observable public reservedBalanceAnchorChan: number | string; to the BalanceStore class.
    • Initialized reservedBalanceAnchorChan to 0 in the reset() method.
    • Extracted reserved_balance_anchor_chan from the LND API response within getBlockchainBalance() and assigned it to the reservedBalanceAnchorChan observable.
    • Included reservedBalanceAnchorChan in the return object of getBlockchainBalance().
    • Updated updateBalances() to correctly set this.reservedBalanceAnchorChan from the onChain object.
Activity
  • This pull request addresses and fixes issue Show reserved_balance_achor_chan on On-chain section #3092, which is related to ZEUS-3092.
  • The changes are categorized as a new feature.
  • The author has confirmed that the code compiles (yarn run tsc), passes linting (yarn run lint), is formatted correctly (yarn run prettier), and all tests pass (yarn run test).
  • Testing was performed on Android using LND (REST) v0.20.0-beta with Polar regtest and anchor channels.
  • New locale text has been added, requiring translations to be made on the ZEUS Transfix page.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds the display of reserved_balance_anchor_chan to the on-chain balance section. The changes in BalanceStore.ts correctly fetch and manage this new piece of data, and the locale update is appropriate. In LayerBalances/index.tsx, a small refinement is suggested to improve code clarity by removing a redundant type conversion. Overall, the implementation is solid and addresses the feature request effectively.

Comment on lines +473 to +479
...(Number(reservedBalanceAnchorChan) > 0 && {
subtitle: `${localeString(
'general.reservedBalanceAnchorChan'
)}: ${Number(
reservedBalanceAnchorChan
).toLocaleString()} sats`
})
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Based on my analysis of BalanceStore.ts, the reservedBalanceAnchorChan property is always a number. The explicit Number() casting here is redundant. Removing it would improve code clarity and avoid confusion.

                ...(reservedBalanceAnchorChan > 0 && {
                    subtitle: `${localeString('general.reservedBalanceAnchorChan')}: ${reservedBalanceAnchorChan.toLocaleString()} sats`
                })

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds visibility into LND’s reserved_balance_anchor_chan by surfacing it in the UI under the On-chain balance row, so users can see how much of their on-chain balance is reserved for anchor channel commitments.

Changes:

  • Added reservedBalanceAnchorChan to BalanceStore and populated it from the wallet balance API response.
  • Updated the On-chain row in LayerBalances to display a subtitle when the reserved amount is > 0.
  • Added an English locale string for the subtitle label.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
stores/BalanceStore.ts Stores and propagates reserved_balance_anchor_chan from the backend balance response.
components/LayerBalances/index.tsx Renders a conditional subtitle under the On-chain row showing reserved sats.
locales/en.json Adds general.reservedBalanceAnchorChan locale label used in the subtitle.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +474 to +479
subtitle: `${localeString(
'general.reservedBalanceAnchorChan'
)}: ${Number(
reservedBalanceAnchorChan
).toLocaleString()} sats`
})
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The subtitle hard-codes the unit label "sats". Elsewhere the app uses the localized unit string (e.g. localeString('general.sats')), so this new text will remain partially untranslated and inconsistent across locales. Consider using the existing locale key for the unit (and/or existing amount-formatting helpers) when building the subtitle.

Copilot uses AI. Check for mistakes.
@aryanraj45 aryanraj45 force-pushed the display-reserved-anchor-balance branch from c6d0c6b to cd29b20 Compare February 8, 2026 07:47
@aryanraj45
Copy link
Copy Markdown
Contributor Author

Hi @kaloudis @ajaysehwal @shubhamkmr04 please take a look whenever u get time. thank you

@kaloudis
Copy link
Copy Markdown
Contributor

Solid concept but not a fan of the UI here. Maybe it can just show below the main chain balance on the right side with an info icon to pop up a modal with an explainer.

@kaloudis
Copy link
Copy Markdown
Contributor

kaloudis commented Mar 6, 2026

Closing in favor of #3799

@kaloudis kaloudis closed this Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show reserved_balance_achor_chan on On-chain section

3 participants