Skip to content

fix: Show the Payment Channels row on the account page - #1386

Open
FawwazLawal wants to merge 1 commit into
ripple:mainfrom
FawwazLawal:payment-channels-account-row
Open

FawwazLawal wants to merge 1 commit into
ripple:mainfrom
FawwazLawal:payment-channels-account-row

Conversation

@FawwazLawal

@FawwazLawal FawwazLawal commented Nov 8, 2026 •

Copy link
Copy Markdown

High Level Overview of Change

Fixes Issue #1380. In getAccountState, read the account's payment channels from data[0], the getAccountPaychannels result, instead of data[1], the getServerInfo result, so the Payment Channels row shows on the account page again.

Context of Change

Bug: On an account that has payment channels, the Details card under Account Properties never shows the Payment Channels row.

Root cause: In src/rippled/accountState.ts, getAccountState runs Promise.all([getAccountPaychannels(...), getServerInfo(...)]), so data[0] is the channels result and data[1] is the server_info result. info reads data[1].info.validated_ledger, which is right, but paychannels was also set to data[1]. server_info has no total_available, and DetailsCard.tsx only renders the row when account.paychannels?.total_available is set, so the row never appeared.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking change that only restructures code)
  • Tests (You added tests for code that already exists, or your new feature included in this PR)
  • Documentation Updates
  • Translation Updates
  • Release

Codebase Modernization

  • Updated files to React Hooks
  • Updated files to TypeScript

accountState.ts is already TypeScript and has no React components, so there was nothing to convert.

Before / After

Mainnet account rJnQrhRTXutuSwtrwxYiTkHn4Dtp8sF2LM, Account Properties expanded. Before (left, main), the Details card shows only Current Sequence and Ticket Count. After (right, this branch), it also shows Payment Channels: 4,920.0918 available in 590 channel(s).

image

Test Plan

Ran the four jobs from nodejs.yml locally on this branch, test:ci with the environment variables that workflow sets:

  • npm run lint:ci: exit 0
  • npm run test:ci: exit 0, 312 of 312 suites and 1875 of 1875 tests passed
  • npm run build: exit 0
  • npm run build-ts: exit 0

pre-commit run --files src/rippled/accountState.ts also passed.

To check it by hand: run the explorer against mainnet (the values in .env.example), open /accounts/rJnQrhRTXutuSwtrwxYiTkHn4Dtp8sF2LM and expand Account Properties. On main the Details card has no Payment Channels row; on this branch it has one.

getAccountState set paychannels to data[1], the getServerInfo result,
instead of data[0], the getAccountPaychannels result. server_info has no
total_available, so DetailsCard never rendered the row.
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.

1 participant