hirosystems / hirosystems/stacks-blockchain-api
Add block-based filtering to prevent pagination issues in endpoints
- 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.**
The current pagination with `limit` and `offset` is causing issues when dealing with live blockchain data. Since new blocks are constantly being added, the pages keep shifting around between requests, which means we can end up missing transactions or getting duplicates when paginating through results.
**Describe the solution you'd like**
I'd like to see block-based filtering added (similar to how Ethereum handles this) with `fromBlock` and `toBlock` parameters. This way we can query data from a specific block range that won't change while we're paginating through it.
Could we start by adding these parameters to the contract events endpoint: https://api.mainnet.hiro.so/extended/v1/contract/{contract_id}/events?
If it works well there, we could roll it out to other endpoints that have similar pagination issues.
I am opening this issue to start the discussion on this
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.