Skip to content

Add token swap interface to /token page#463

Merged
realproject7 merged 3 commits intomainfrom
task/462-token-swap
Mar 23, 2026
Merged

Add token swap interface to /token page#463
realproject7 merged 3 commits intomainfrom
task/462-token-swap

Conversation

@realproject7
Copy link
Copy Markdown
Owner

Summary

  • Adds SwapInterface component with platform-aware behavior:
    • Web: "Buy PLOT on Uniswap" button (opens Uniswap in new tab)
    • Farcaster/Base: "Swap to PLOT" button (triggers native sdk.actions.swapToken())
  • Adds usePlatformDetection hook (Farcaster/Base/web detection)
  • Enhances Token Information section with Dropcast card-style layout:
    • Icon-based external links (Mint Club, Hunt Town, Basescan)
    • Copy/check icon states for contract address
    • Network badge (Base Mainnet ERC-20)
    • Background cards for stats grid

Fixes #462

New files

  • src/components/token/SwapInterface.tsx
  • src/hooks/usePlatformDetection.ts

Test plan

  • Verify swap button renders on web (links to Uniswap)
  • Verify Token Information section shows icons for Mint Club, Hunt Town, Basescan
  • Verify copy button toggles to checkmark on click
  • Verify Network badge shows "Base Mainnet (ERC-20)"
  • Verify mobile responsive layout
  • Build passes

🤖 Generated with Claude Code

- Add SwapInterface component: web links to Uniswap, Farcaster/Base
  uses native sdk.actions.swapToken()
- Add usePlatformDetection hook for Farcaster/Base/web detection
- Enhance Token Information section with icon-based card layout:
  Mint Club, Hunt Town, Basescan links with proper icons
  Copy button with check/copy icon states
  Network badge (Base Mainnet ERC-20)
- Place swap interface between token utility and how-to sections

Fixes #462

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: REQUEST CHANGES

Summary

The swap interface direction looks reasonable, but the Token Information section misses core acceptance criteria from the issue.

Findings

  • [high] Token Information does not implement the required live price and market cap data
    • File: src/app/token/page.tsx
    • Suggestion: Add the required Price display and compute Market Cap from current supply x current price, using the data source called for in the issue (MCV2_Bond or CoinGecko). Right now the new card grid shows Total Supply plus a Market Cap placeholder of , and there is no Price field in the section, so the main product requirement is still missing.

Decision

Requesting changes because the PR does not yet satisfy the issue acceptance criteria for the Token Information section.

- Add live Price field via MCV2_Bond.priceForNextMint on-chain read
- Add Market Cap calculation (supply × price) with loading states
- Commit SVG icons to git (mc-icon-light, hunt-token, basescan-icon)
- Extract Base App clientFid to named constant BASE_APP_CLIENT_FID

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: REQUEST CHANGES

Summary

The previously missing data and assets are now present, but the price section is still semantically incorrect relative to the issue requirements.

Findings

  • [high] Price and Market Cap are still not shown in USD as required
    • File: src/app/token/page.tsx
    • Suggestion: The issue explicitly asks for current PLOT price in USD and market cap derived from that USD price. This implementation uses priceForNextMint from MCV2_Bond, whose ABI comment defines it as the current cost in the reserve token to mint 1 unit, then labels the displayed value as PLOT. That is not a USD price, and the derived market cap is therefore also not USD market cap. Convert the reserve-token quote to USD, or use a USD source such as CoinGecko as the issue allows.

Decision

Requesting changes because the PR still does not satisfy the issue’s USD pricing requirement for the Token Information section.

…ator

Replaces raw MCV2_Bond reserve-token price with proper USD conversion:
- useTokenInfo hook: PLOT price in HUNT (via priceForNextMint) × HUNT/USD
  rate (via 1inch Spot Price Aggregator on Base)
- Market cap = USD price × total supply
- 24h price change via block diff (~43200 blocks)
- formatPrice helper with subscript notation for tiny prices

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE

Summary

The USD pricing implementation now satisfies the issue requirements, the missing assets are present, and the swap/token information changes remain focused.

Findings

  • None.

Decision

Approving because the previous blockers are resolved and CI is green.

@realproject7 realproject7 merged commit 71b4ed8 into main Mar 23, 2026
3 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

Development

Successfully merging this pull request may close these issues.

[Feat] Add token swap interface to /token page

2 participants