Skip to content

feat: return spendable and pot balances from userbalance (sync #226 to dev) - #227

Merged
xbuddhi merged 2 commits into
devfrom
xbuddhi/sync/userbalance-pots-dev
Nov 25, 2026
Merged

xbuddhi merged 2 commits into
devfrom
xbuddhi/sync/userbalance-pots-dev

Conversation

@xbuddhi

@xbuddhi xbuddhi commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

Brings #226 (merged to main) to dev. /api/v1/userbalance\ now returns \�vailable_balance\ (wallet minus pots and in-flight payments), \pot_balance\ and \pots. The original commits are cherry-picked unchanged.

@xbuddhi
xbuddhi merged commit 74a5681 into dev Nov 25, 2026
/api/v1/userbalance only returned the whole LNbits wallet, which includes
sats earmarked in savings pots. Add available_balance (wallet minus pots,
never below 0), pot_balance and the per-pot list so callers can show locked
funds and check spendable sats. balance keeps its meaning (whole wallet).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FBZc7gWkW4RodtHSrGXGQq
@coderabbitai

coderabbitai Bot commented Nov 25, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a92741c3-77c6-427e-96e9-999cca93aec1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Address review on #226: available_balance now also subtracts sats held by
the user's in-flight payments (ReservedBalance), so it matches what
ReserveBalance lets a send use. Failure answers keep the success shape
(pots: []), docs say the figure is a snapshot and the two reads aren't
atomic.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FBZc7gWkW4RodtHSrGXGQq
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.

2 participants