Skip to content

feat: Add meter events query endpoint#498

Merged
Dev-AdeTutu merged 2 commits into
Dev-AdeTutu:mainfrom
lajay-faith:feat/meter-events-endpoint
Jun 29, 2026
Merged

feat: Add meter events query endpoint#498
Dev-AdeTutu merged 2 commits into
Dev-AdeTutu:mainfrom
lajay-faith:feat/meter-events-endpoint

Conversation

@lajay-faith

@lajay-faith lajay-faith commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Closes #439


Summary

Expose a query endpoint that pages through Soroban contract events filtered to a single meter ID. This lets the frontend display a full on-chain activity log without parsing raw event streams client-side.

Changes

  • Added GET /api/meters/:id/events endpoint with pagination support
  • Reuses event-fetching logic similar to payments.ts but filters by meter topic
  • Returns structured event data with { events: [...], pagination: { page, limit, total } }
  • Returns 404 when meter does not exist
  • Added parseContractEvent helper function to parse Soroban events

Acceptance Criteria

  • GET /api/meters/:id/events?page=1&limit=20&days=30 works
  • Reuses event-fetching logic filtered by meter topic
  • Returns { events: [...], pagination: { page, limit, total } }
  • Returns 404 when meter does not exist
  • Added /:id/events sub-route in meters.ts

@drips-wave

drips-wave Bot commented Jun 29, 2026

Copy link
Copy Markdown

@lajay-faith 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

@Dev-AdeTutu Dev-AdeTutu merged commit be74a98 into Dev-AdeTutu:main Jun 29, 2026
0 of 2 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(backend): add GET /api/meters/:id/events endpoint returning contract events for a specific meter

2 participants