hirosystems / hirosystems/stacks-blockchain-api
Additional data needed in contract events endpoint
- Dominant language
- TypeScript
- Stars
- 193
- Forks
- 127
- Avg merge
- 16h 35m
- Merged PRs (30d)
- 46
Description
**Is your feature request related to a problem? Please describe.**
Because there is no `total` key, no `block` number, no timestamp whatsoever, and no way to sort the output (desc/asc), we have to query all the contract events instead of just the data for the last five cycles (all we need).
If we put offset 0, we see the most recent records instead of the oldest records. But to only query the records up until five cycles ago, we don't need ALL contract events (until our loop returns less than the 'limit'), but just until block number or timestamp is 'less than' X.
**Describe the solution you'd like**
I'd like `total`, `blocknumber`, and `timestamp` per event in the output and maybe even a `sort` as query parameter. That way, we can do: `total - total db records = records to retrieve`.
**Endpoint**: https://docs.hiro.so/apis/stacks-blockchain-api/reference/smart-contracts/events
**Link to point in source code:** https://github.com/hirosystems/stacks-blockchain-api/blob/develop/src/api/routes/contract.ts#L100
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.