Skip to content

feat(vault): read vault and wallet USDC balances via Soroban simulation - #1358

Merged
greatest0fallt1me merged 2 commits into
CalloraOrg:mainfrom
IFEANYIBRIGHT:feat/vault-soroban-balance-reads
Oct 21, 2026
Merged

greatest0fallt1me merged 2 commits into
CalloraOrg:mainfrom
IFEANYIBRIGHT:feat/vault-soroban-balance-reads

Conversation

@IFEANYIBRIGHT

Copy link
Copy Markdown
Contributor

closes #1313

feat(vault): read vault and wallet balances via Soroban simulation
Replaces hardcoded vault (284.62) and wallet (1260.5) USDC balances with read-only Soroban simulation reads.
Changes

  • src/services/vaultReads.ts — readVaultBalance(), readUsdcToken() (session-cached), readWalletUsdcBalance(address); all return stroops as bigint
  • src/hooks/useVaultBalances.ts — React hook with { vault, wallet, status, error, configured, refresh, updatedAt, revision }; wallet read gated by Freighter address; 300ms debounced refresh with in-flight dedupe; superseded responses ignored
  • src/App.tsx — Removed hardcoded balances; billing cards, deposit modal, Max button, validation, preview rows now use chain values; optimistic "pending refresh" after deposit cleared on re-read; LiveRegion polite announcements
  • src/pages/DashboardOverview.tsx — Accepts balances prop; uses BalanceReadout; fixed network label from "Public Net" → STELLAR_NETWORK_LABEL
  • src/App.deposit.test.tsx — Mocks useVaultBalances; updated Max expectation (1260.5) and vault balance assertions
  • docs/Deposit-Flow.md — Documents on-chain balance reads and post-deposit read-back
    Verification
  • grep -n "284.62|1260.5" src/App.tsx → no matches
  • npm run typecheck ✓
  • npm run build ✓
  • npx vitest run ✓ (2187 tests pass)

@drips-wave

drips-wave Bot commented Oct 20, 2026

Copy link
Copy Markdown

@IFEANYIBRIGHT Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

Read vault and wallet USDC balances from Soroban instead of hardcoded values

2 participants