Skip to content

feat: improve reward history, balance display, connect button, and header (#261-#264) - #405

Merged
DeFiVC merged 1 commit into
ChainLearnOfficial:mainfrom
Lekan101:feat/reward-components-261-262-263-264
Sep 1, 2026
Merged

feat: improve reward history, balance display, connect button, and header (#261-#264)#405
DeFiVC merged 1 commit into
ChainLearnOfficial:mainfrom
Lekan101:feat/reward-components-261-262-263-264

Conversation

@Lekan101

@Lekan101 Lekan101 commented Sep 1, 2026

Copy link
Copy Markdown

Summary

Improves the four Stellar-wave wallet/reward components to satisfy the acceptance criteria in issues #261#264.

#261reward-history.tsx

The component already ships combinable filters (status, course search, date range), CSV export, and summary stats. This PR adds test coverage for the summary stats (total earned, confirmed, pending, failed) to lock in the behavior.

#262balance-display.tsx (main change)

  • Real USD equivalent: new useTokenPrice hook fetches a live USD quote for the token via the public Stellar Index pricing API, with an NEXT_PUBLIC_FALLBACK_TOKEN_USD env fallback and graceful loading/error states.
  • Fixed USD math: corrects a real bug where the raw (7-decimal) balance was multiplied by the price instead of the human-readable amount, inflating the USD value ~10^7×.
  • Token details: now shows token decimals and issuer alongside the balance.
  • Copy contract/asset address: copy button uses the real issuer address and is disabled when unavailable.
  • Refresh action to reload balances.

#263connect-button.tsx

Verified complete: connected wallet name (Freighter), network indicator, truncated copyable address, and dropdown with copy address / switch network / disconnect all present.

#264header.tsx

Verified complete: authenticated user menu (avatar/initials, profile, settings, logout), notification bell with unread count, and sticky header all present.

Acceptance criteria coverage

Verification

  • eslint (next lint): no warnings/errors on changed files
  • tsc --noEmit: no new errors (pre-existing unrelated errors remain on main)
  • vitest: new balance-display (5) and reward-history (4) tests pass

Closes #261
Closes #262
Closes #263
Closes #264

ChainLearnOfficial#261, ChainLearnOfficial#262)

- balance-display: real USD price via new useTokenPrice hook (Stellar Index public API with env fallback), correct USD conversion from the human-readable token amount (was multiplying raw balance), show token decimals and issuer, copy asset address, add refresh action
- reward-history: add test coverage for summary stats (total earned, confirmed, pending, failed)
- add NEXT_PUBLIC_FALLBACK_TOKEN_USD to env example
@netlify

netlify Bot commented Sep 1, 2026

Copy link
Copy Markdown

Deploy Preview for chainlearn failed.

Name Link
🔨 Latest commit 142c734
🔍 Latest deploy log https://app.netlify.com/projects/chainlearn/deploys/6a96a105726ac200081670f4

@drips-wave

drips-wave Bot commented Sep 1, 2026

Copy link
Copy Markdown

@Lekan101 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

@DeFiVC
DeFiVC merged commit 3474e83 into ChainLearnOfficial:main Sep 1, 2026
0 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants