Summary
crates/lumenqraph-api/src/routes/stats.rs returns aggregate statistics (total event count, per-contract counts). It does not provide time-series data — e.g. events per hour or per day over the last N days — which is the primary data needed for an activity dashboard or a volume chart in the explorer UI. Consumers must write their own GROUP BY queries against the database to get this information.
Expected Behavior
The stats endpoint should expose time-bucketed event counts over a configurable window.
Proposed Solution
- Add
GET /contracts/:id/stats?resolution=1h&window=7d returning event counts bucketed by the specified time resolution
- Implement using Postgres
date_trunc
- Add the endpoint to the TypeScript SDK as
getStats(contractId, opts)
- Document in
docs/API.md
Affected Files
crates/lumenqraph-api/src/routes/stats.rs
sdk/typescript/src/index.ts
docs/API.md
Summary
crates/lumenqraph-api/src/routes/stats.rsreturns aggregate statistics (total event count, per-contract counts). It does not provide time-series data — e.g. events per hour or per day over the last N days — which is the primary data needed for an activity dashboard or a volume chart in the explorer UI. Consumers must write their own GROUP BY queries against the database to get this information.Expected Behavior
The stats endpoint should expose time-bucketed event counts over a configurable window.
Proposed Solution
GET /contracts/:id/stats?resolution=1h&window=7dreturning event counts bucketed by the specified time resolutiondate_truncgetStats(contractId, opts)docs/API.mdAffected Files
crates/lumenqraph-api/src/routes/stats.rssdk/typescript/src/index.tsdocs/API.md