π Description
The AccountOverview component currently displays a hardcoded balance of β¦ 325,980.65 and a placeholder wallet address 0x1234567890123456789012345678901234567890. Neither value is fetched from the backend. The InstantDepositModal also uses a hardcoded sample wallet address 0x5A08FcdBEA516Cf086572157791dB12CA3beF1B32.
These need to be replaced with the authenticated user's real balance and wallet address from the API, with proper loading and error states.
π Context
The app has an existing auth store (hooks/use-auth-store.ts) and API helper layer (lib/api/users.ts). The user profile is already fetched in ProfileOverview and PersonalInfo components using getProfile(). The balance and wallet address fields likely come from the same profile endpoint or a dedicated wallet endpoint β check the backend API for the correct fields.
The AccountOverview component currently takes no props related to data fetching β it will need to either fetch data internally or receive it via props/a shared hook.
π Key Files
components/dashboard/account-overview.tsx β hardcoded balance and wallet address
components/dashboard/InstantDepositModal.tsx β hardcoded sample wallet address
lib/api/users.ts β add balance/wallet fetch here if not already present
hooks/use-auth-store.ts β user data available here after login
β
Acceptance Criteria
π οΈ Suggested Execution
1. Setup
git checkout -b <your-branch-name>
2. Implement changes
- Check the backend API for the correct endpoint returning wallet balance and address (e.g.
/users/profile, /users/wallet, or /wallets)
- Add a fetch function in
lib/api/users.ts if one does not exist
- In
AccountOverview, add a useEffect to fetch balance and wallet address on mount; manage loading/error state
- Replace the hardcoded values with the fetched data
- Pass the wallet address down to
InstantDepositModal as a prop or fetch it there using the same method
- Add a skeleton loader for balance (a pulsing placeholder matching the text size)
3. Validate
- Log in and open the dashboard β your real balance should appear
- The wallet address shown should match your account
- Open the deposit modal β the same wallet address should appear and be copyable
- Temporarily break the API call (wrong URL) β a graceful error state should appear
4. Commit & PR
git commit -m "feat: fetch real balance and wallet address from API"
π Guidelines
- PR description must include:
Closes #[issue_number]
- PR must include screenshots showing real data loaded in both components
- Follow existing code style β TypeScript strict, Tailwind for styling
- Do not introduce new dependencies without prior discussion
π Reward
This issue is worth 200 points in the Drips Wave program.
π Description
The
AccountOverviewcomponent currently displays a hardcoded balance of⦠325,980.65and a placeholder wallet address0x1234567890123456789012345678901234567890. Neither value is fetched from the backend. TheInstantDepositModalalso uses a hardcoded sample wallet address0x5A08FcdBEA516Cf086572157791dB12CA3beF1B32.These need to be replaced with the authenticated user's real balance and wallet address from the API, with proper loading and error states.
π Context
The app has an existing auth store (
hooks/use-auth-store.ts) and API helper layer (lib/api/users.ts). The user profile is already fetched inProfileOverviewandPersonalInfocomponents usinggetProfile(). The balance and wallet address fields likely come from the same profile endpoint or a dedicated wallet endpoint β check the backend API for the correct fields.The
AccountOverviewcomponent currently takes no props related to data fetching β it will need to either fetch data internally or receive it via props/a shared hook.π Key Files
components/dashboard/account-overview.tsxβ hardcoded balance and wallet addresscomponents/dashboard/InstantDepositModal.tsxβ hardcoded sample wallet addresslib/api/users.tsβ add balance/wallet fetch here if not already presenthooks/use-auth-store.tsβ user data available here after loginβ Acceptance Criteria
AccountOverviewdisplays the authenticated user's real balance fetched from the APIAccountOverviewdisplays the authenticated user's real wallet addressInstantDepositModaluses the same real wallet addressπ οΈ Suggested Execution
1. Setup
2. Implement changes
/users/profile,/users/wallet, or/wallets)lib/api/users.tsif one does not existAccountOverview, add auseEffectto fetch balance and wallet address on mount; manage loading/error stateInstantDepositModalas a prop or fetch it there using the same method3. Validate
4. Commit & PR
git commit -m "feat: fetch real balance and wallet address from API"π Guidelines
Closes #[issue_number]π Reward
This issue is worth 200 points in the Drips Wave program.