Skip to content

sorted the /assets/popular endpoint#112

Merged
Miracle656 merged 1 commit into
Miracle656:mainfrom
ALLEN-AYODEJI:popular_endpoint
Jun 25, 2026
Merged

sorted the /assets/popular endpoint#112
Miracle656 merged 1 commit into
Miracle656:mainfrom
ALLEN-AYODEJI:popular_endpoint

Conversation

@ALLEN-AYODEJI

Copy link
Copy Markdown
Contributor

src/routes/assets/popular.ts (new) — GET /assets/popular?window=24h&by=transfers

  • Validates window (1h/24h/7d) and by (transfers/volume)
  • Defaults: window=24h, by=transfers, limit=20, offset=0
    src/db.ts (modified)
  • Exported toDisplayAmount
  • Added queryPopularAssets — raw SQL aggregation: GROUP BY contractId, COUNT(*) for transfer count, SUM(CAST(amount AS NUMERIC)) for volume, ordered by the by param
    src/api.ts (modified) — mounted router at /assets
    Response shape:
    {
    "window": "24h",
    "by": "transfers",
    "limit": 20,
    "offset": 0,
    "total": 50,
    "assets": [
    { "contractId": "C...", "transferCount": 1234, "volume": "5000000000000000", "displayVolume": "500.0000000" }
    ]
    }

Closes #109

@drips-wave

drips-wave Bot commented Jun 23, 2026

Copy link
Copy Markdown

@ALLEN-AYODEJI 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

@Miracle656 Miracle656 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Reviewed — clean, additive, well-scoped, closes its linked issue. Red checks are pre-existing infra/chaos failures and Vercel auth, not introduced here. Merging.

@Miracle656 Miracle656 merged commit 2b4a574 into Miracle656:main Jun 25, 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.

/assets/popular endpoint

2 participants