Skip to content

[Backend] Sync wallet balance and transaction history from chain #305

@Kaylahray

Description

@Kaylahray

Description

The wallet balance endpoint still falls back to local ledger data and a placeholder XLM asset snapshot instead of reconciling with live chain state.

User Story

As a wallet user,
I want to see my real balances and transfer history,
so that the wallet page matches the ledger.

Requirements and Context

  • Files: app/app/api/wallet/balance/route.ts, app/app/api/wallet/transactions/route.ts, app/lib/prisma.ts
  • Pull live asset balances from Stellar when non-simulated mode is used
  • Reconcile local wallet history with on-chain transfer records
  • Return consistent balance, asset, and transaction payloads to the frontend

Suggested Implementation

// BALANCE AND TRANSACTIONS
// 1. Load chain balances for the wallet address.
// 2. Merge live chain state with local transaction history.
// 3. Return the normalized payload to the client.
// 4. Keep simulated mode as a fallback only.

Acceptance Criteria

  • Live balances are returned when the app requests non-simulated data.
  • Transaction history reflects the wallet's real transfer activity.
  • The response schema remains stable for the frontend.

Submission Guidelines

  • Branch: feat/wallet-sync
  • Depends on: Stellar read utilities and wallet address lookup
  • PR: feat(backend): sync wallet balances and transaction history from chain

Metadata

Metadata

Assignees

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions