Skip to content

Feat/add solana communtiy token banner#5

Open
jeremie-olivier wants to merge 2 commits intorawgroundbeef:mainfrom
jeremie-olivier:feat/add-solana-communtiy-token-banner
Open

Feat/add solana communtiy token banner#5
jeremie-olivier wants to merge 2 commits intorawgroundbeef:mainfrom
jeremie-olivier:feat/add-solana-communtiy-token-banner

Conversation

@jeremie-olivier
Copy link

@jeremie-olivier jeremie-olivier commented Feb 9, 2026

Add Token Section Displaying bags.fm Community Token Earnings

Summary

Adds a new token section banner at the top of the homepage that displays information about the claw.fm community token created on Solana via bags.fm, including lifetime trading fees and a link to view the token on bags.fm.

Screenshots

image image

Changes

Frontend (web/src/components/TokenSection.tsx)

  • New Component: Created TokenSection component displaying:

    • Community token information and description
    • Token address with copy-to-clipboard functionality
    • Lifetime fees earned (displayed in USD or SOL)
    • "View on bags.fm" button with bags.fm logo
  • Layout: 3-column responsive grid layout:

    1. Column 1: Token description + token address
    2. Column 2: Trading fees description + fees amount
    3. Column 3: View on bags.fm button
  • Styling:

    • Discrete button styling matching navbar design
    • Compact spacing and padding
    • Responsive design that stacks on mobile
    • Self-contained wrapper with max-width and padding

Backend (api/src/routes/bags-token.ts)

  • New API Route: GET /api/bags-token/earnings

    • Fetches lifetime fees from bags.fm API
    • Converts SOL fees to USD using multiple price sources:
      1. CoinGecko (primary)
      2. Binance (fallback)
      3. Jupiter (final fallback)
    • Returns earnings in both SOL and USD formats
    • Handles API key configuration gracefully
  • Type Safety:

    • Proper TypeScript types for Hono route handlers
    • Type definitions for Jupiter API responses
    • Fixed all TypeScript linting errors

Other Changes

  • Footer: Updated GitHub link from anthropics/claw.fm to rawgroundbeef/claw.fm
  • Environment Variables: Added BAGS_API_KEY to .dev.vars and .env.example
  • Formatting: Fees displayed as integer dollars (no decimals) with comma separators

Technical Details

  • Token Mint: 3W6H1ZUPArP4qhfVp8gGvZtay7ucE8swqNPeAGhiBAGS
  • API Integration: Uses bags.fm public API v2 (/token-launch/lifetime-fees)
  • Price Sources: Multi-source fallback for SOL/USD conversion reliability
  • Auto-refresh: Token earnings refresh every 5 minutes
  • Error Handling: Graceful degradation when API key is not configured

Testing

  • Component renders correctly on homepage
  • Token address copy functionality works
  • Fees display correctly in USD when SOL price is available
  • Falls back to SOL display when USD price unavailable
  • Responsive layout works on mobile
  • API route handles missing API key gracefully
  • TypeScript compilation passes without errors

Notes

  • The component is positioned at the very top of the homepage
  • Fees are displayed as whole dollars (rounded, no decimals)
  • The bags.fm API key is optional - the component will still display ( without fee earnings ) if unavailable
  • All styling is self-contained within the component

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.

1 participant