Skip to content

feat: add user profile page with held keys, staking positions, and tr… - #1010

Merged
Chucks1093 merged 1 commit into
accesslayerorg:devfrom
CHKM001:feat/921-user-profile-dashboard
Sep 27, 2026
Merged

Chucks1093 merged 1 commit into
accesslayerorg:devfrom
CHKM001:feat/921-user-profile-dashboard

Conversation

@CHKM001

@CHKM001 CHKM001 commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

PR #921 User Profile Page with Held Keys, Staking Positions & Trade History

Summary

Turns the profile page into a full portfolio dashboard. The page serves two audiences from one component: the owner at /profile, and anyone via the shareable /profile/:wallet link.

Tabs:

  • Holdings — every creator key the wallet holds, valued at its live bond-curve price, with per-position unrealised PnL, sorted by total value.
  • Staking — active positions with staked quantity, current value, a live lock countdown, and claimable rewards.
  • Trade History — cursor-paginated buy/sell history with infinite scroll.
  • Activity — wallet activity feed for the viewed wallet address.

Changes

New Components & Services

  • src/services/wallet.service.ts — GET /wallets/:address/holdings
  • src/services/stakingPositions.service.ts — positions + claim flow
  • src/hooks/useCreatorPrices.ts — current bonding-curve creator prices
  • src/hooks/useStakingPositions.ts — staking-positions query
  • src/utils/stakingPositions.utils.ts — lock status, countdowns, staked value
  • src/components/common/HeldKeysGrid.tsx
  • src/components/common/StakingPositionsList.tsx
  • src/components/common/PortfolioSummaryHeader.tsx

Modified & Integration

  • src/pages/ProfilePage.tsx — owner + public portfolio view, gated wallet actions (isOwnWallet)
  • src/components/common/TradeHistoryTable.tsx — cursor-based infinite scroll via IntersectionObserver sentinel with manual fallback
  • src/hooks/useWallet.ts — useWalletHoldings fetches holdings from wallet service; claim invalidates staking-positions cache
  • src/utils/portfolioValue.utils.ts — held-key valuation and unrealised PnL calculation
  • src/lib/queryKeys.ts — wallet holdings, staking positions, creator prices
  • src/routes.tsx — shareable /profile/:wallet public route

Verification & Testing

  • pnpm exec tsc -b --noEmit: 0 errors
  • Test suite: 35 unit & integration tests passing
    • ProfilePage.integration.test.tsx (owner + public views, tab gating)
    • HeldKeysGrid / PortfolioSummaryHeader / StakingPositionsList
    • TradeHistoryTable.infiniteScroll.test.tsx
    • useWalletHoldings, wallet.service, stakingPositions.service
    • stakingPositions.utils, portfolioValue.pnl

Closes #921

…ade history (accesslayerorg#921)

Build the user profile page showing all creator keys held, active staking
positions, and a paginated trading history for the connected wallet.

- ProfilePage now serves both the owner dashboard (/profile) and a shareable
  public portfolio (/profile/:wallet). Wallet-specific actions (buy/sell,
  claim, share) render only when the viewer owns the profile.
- PortfolioSummaryHeader sums held keys and staked positions at current
  bond-curve prices, with per-segment breakdown and unrealised PnL.
- HeldKeysGrid values every held key from its bonding-curve price and shows
  per-position unrealised PnL, sorted by total value.
- StakingPositionsList renders staked quantity, current value, a live lock
  countdown, and claimable rewards with a Claim action for the owner.
- TradeHistoryTable gains cursor-based infinite scroll via an
  IntersectionObserver sentinel, keeping the Load More button as a manual
  fallback.
- New wallet.service / stakingPositions.service back the holdings and
  staking-positions queries; useWalletHoldings now fetches real holdings
  instead of resolving empty.
- Profile claim invalidates the staking-positions cache on success.

Tests stub @/services/wallet.service in the LandingPage buy/sell flow
integrations: those suites drive the real useWalletHoldings query, which now
performs a network request with no backend behind it in tests.
@drips-wave

drips-wave Bot commented Sep 26, 2026

Copy link
Copy Markdown

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

@Chucks1093
Chucks1093 merged commit ffdcf6b into accesslayerorg:dev Sep 27, 2026
1 check 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

Development

Successfully merging this pull request may close these issues.

Create user profile page with held keys, staking positions, and trading history

2 participants