hirosystems / hirosystems/stacks-blockchain-api
API's for bulk reward claiming app
- 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.**
I built a bulk reward-claiming app for PoX-5 signer-manager operators on the new v3 staking endpoints, and they're great for what I suspect they were designed for (wallets and dashboards) but a claiming app needs two things they don't carry.
**Describe the solution you'd like**
First: /staking/signers/:principal/stakers returns bare principals; adding each staker's locked amount and lock/unlock heights (you already materialize them in stx_locked_balances) plus an include=past option for stakers whose lock expired but who still hold unclaimed rewards would let me drop the custom event scanning entirely.
Second: claims are constructed per reward cycle on chain (claim-staker-rewards takes a cycle, never an amount), so the lifetime claimable aggregate on /principals/:principal/staking can't build a transaction; a per-cycle breakdown (cycle, accrued, claimed, claimable) under that resource would. This is what I have now I think you already had some ideas about this when I demo-ed it last week.
**Describe alternatives you've considered**
the current custom event scanner, mostly because I like to use the public hiro api with a max 50 RPM limit as a default (although configurable to a custom api for read only calls).
**Additional context**
https://stx.fan/zero_to/claiming for the current version.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing the existing /staking/signers/:principal/stakers and /principals/:principal/staking endpoints, including how stx_locked_balances is exposed. Check the current response shapes and staking data sources, then define tests for locked and expired stakers and per-cycle accrued, claimed, and claimable rewards. Done means both endpoints provide the information needed without custom event scanning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, backend, blockchain
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100