Description
The account page currently shows only xlm_balance and asset_count. Users with multiple trust lines cannot see what assets they actually hold or at what balances. This issue adds a complete asset breakdown — backend exposes the data, frontend renders it with an expandable list.
Part 1 — Backend
The Horizon /accounts/:id response already returns a balances array. The backend needs to pass it through to the AccountExplanation response.
Add to AccountExplanation in src/explain/account.rs:
pub struct Balance {
pub asset_code: String, // "XLM" for native
pub asset_issuer: String, // "native" for XLM
pub balance: String, // e.g. "271.1484471"
pub limit: String, // "unlimited" for XLM, otherwise the trust limit
pub is_authorized: bool, // whether the issuer has authorized this trust line
}
pub struct AccountExplanation {
// ... existing fields ...
pub balances: Vec<Balance>, // ADD THIS
}
Map from Horizon response in src/services/horizon.rs — the HorizonBalance struct already exists or needs adding with fields: balance, asset_type, asset_code, asset_issuer, limit, is_authorized.
Key files (backend):
packages/core/src/explain/account.rs
packages/core/src/services/horizon.rs
packages/core/src/models/account.rs
Part 2 — Frontend
Update src/types/index.ts:
export interface Balance {
asset_code: string;
asset_issuer: string;
balance: string;
limit: string;
is_authorized: boolean;
}
// Add to AccountExplanation:
balances: Balance[];
Create src/components/account/AssetList.tsx:
- XLM always shown first, always visible
- Remaining assets hidden behind "Show all N assets ▼" toggle
- Each row: asset code (bold), truncated issuer address with copy-to-clipboard, balance right-aligned, limit as subtitle
- Zero-balance assets rendered in muted style (trust line exists but holds nothing)
- Integrate below
AccountBalances in AccountResult.tsx
Key files (frontend):
src/types/index.ts
src/components/account/AssetList.tsx
src/components/AccountResult.tsx
Acceptance Criteria
Complexity: High · 200 pts
Stage: S8 — Account Depth
Description
The account page currently shows only
xlm_balanceandasset_count. Users with multiple trust lines cannot see what assets they actually hold or at what balances. This issue adds a complete asset breakdown — backend exposes the data, frontend renders it with an expandable list.Part 1 — Backend
The Horizon
/accounts/:idresponse already returns abalancesarray. The backend needs to pass it through to theAccountExplanationresponse.Add to
AccountExplanationinsrc/explain/account.rs:Map from Horizon response in
src/services/horizon.rs— theHorizonBalancestruct already exists or needs adding with fields:balance,asset_type,asset_code,asset_issuer,limit,is_authorized.Key files (backend):
packages/core/src/explain/account.rspackages/core/src/services/horizon.rspackages/core/src/models/account.rsPart 2 — Frontend
Update
src/types/index.ts:Create
src/components/account/AssetList.tsx:AccountBalancesinAccountResult.tsxKey files (frontend):
src/types/index.tssrc/components/account/AssetList.tsxsrc/components/AccountResult.tsxAcceptance Criteria
AccountExplanationJSON includesbalances[]arrayasset_issuer: "native"balancesis empty or contains only XLMComplexity: High · 200 pts
Stage: S8 — Account Depth