Skip to content

Implement proper asset balance display with trustlines #113

Description

@therealjhay

Description: The wallet page shows hardcoded USDC and XLM balances. A real implementation should fetch balances from the Stellar Horizon API and display all assets the account holds (including non-standard assets via trustlines).

Requirements:

  • Replace the mock refreshBalances with actual Horizon API calls
  • Fetch /accounts/{address} from Horizon and parse the balances array
  • Display all assets: native (XLM), issued assets (USDC, etc.)
  • Show the asset issuer for non-native assets
  • Show a loading state while fetching, an error state on failure, and an empty state for new accounts

Suggested execution steps:

  1. In lib/store/walletStore.ts, update refreshBalances to call Horizon
  2. Use the HORIZON_URL from constants.ts
  3. Parse the response into the AssetBalance[] type
  4. Update the wallet page to render dynamic balances instead of hardcoded ones
  5. Add trustline support: show which assets the account has trustlines for
  6. Handle the "account not found" Horizon response (account not funded yet)

Example commit message:

feat(stellar): replace mock wallet balances with real Horizon API data

Updated refreshBalances to fetch from Stellar Horizon /accounts/{address}
endpoint. Displays all held assets (XLM, USDC, custom) with issuer info.
Handles loading, error, and unfunded account states. Removes hardcoded
balance mock data from the wallet page.

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions