[Contracts] Add stream_count view function
Telegram (ask questions / claim the issue here first): https://t.me/+DOylgFv1jyJlNzM0
Labels: good first issue, contracts, Stellar Wave, smart-contract
There's no way to ask the contract how many streams exist, so the backend can't paginate without a full DB scan.
Add a read-only stream_count(env: Env) -> u64 that returns the global stream ID counter. That's the total number of streams ever created, not the active count. With it, the backend or any external indexer can do cursor/offset pagination without an extra roundtrip.
What the fix has to hold to
- Returns the monotonic stream ID counter, not a filtered/active count
- Doesn't panic on a fresh deploy, returns
0
Done when
- [ ]
stream_count(env: Env) -> u64view is implemented - [ ] Returns
0on a freshly-deployed contract - [ ] Unit test asserts the count goes up by 1 after each
create_stream - [ ] TypeScript bindings regenerated
- [ ] Tests + fmt pass, CI green
Where to start
Add the function in contracts/flowfi/src/lib.rs, test in contracts/flowfi/src/test.rs, then regen packages/sdk/src/index.ts. Small, good first contract issue.
Congratulations, @dubemoyibe-star! đ Your application was accepted by the repo's maintainers, and the issue is due on April 29, 2026.
đ§âđģ @dubemoyibe-star: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.
[!WARNING] When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.
đ¤ Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.
đ Happy Wave đ
@Alaka-ibr has applied to work on this issue as part of the Stellar Wave Program's 6th wave.
Hi maintainer, will love to work on this.
âšī¸ Repo Maintainers: To accept this application, review their application or assign @Alaka-ibr to this issue.
@Caneryy has applied to work on this issue as part of the Stellar Wave Program's 6th wave.
Hello, I'd like to work on this issue.
âšī¸ Repo Maintainers: To accept this application, review their application or assign @Caneryy to this issue.
@Anthony-19 has applied to work on this issue as part of the Stellar Wave Program's 6th wave.
Hi Maintainer, i would love to jump on this
âšī¸ Repo Maintainers: To accept this application, review their application or assign @Anthony-19 to this issue.
Congratulations, @Anthony-19! đ Your application was accepted by the repo's maintainers, and the issue is due on June 30, 2026.
đ§âđģ @Anthony-19: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.
[!WARNING] When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.
đ¤ Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.
đ Happy Wave đ
đĻ GrantFox â @Anthony-19 has been assigned to this issue!
Next steps:
- Open a Pull Request referencing this issue (e.g.,
Closes #421) - Your PR will be reviewed by the LabsCrypt maintainers
Good luck! Track your progress on GrantFox.
This issue has been removed from the Stellar Wave Program by the repository maintainers.
@Anthony-19, you have been unassigned from this issue. If you have any questions, please reach out to the repo maintainers.
@e-simileoluwa has applied to work on this issue as part of the Stellar Wave Program's 11th wave.
Hi maintainer, I can get this issue fixed quickly. Please assign it to me
âšī¸ Repo Maintainers: To accept this application, review their application or assign @e-simileoluwa to this issue.
Congratulations, @e-simileoluwa! đ Your application was accepted by the repo's maintainers, and the issue is due on November 25, 2026.
đ§âđģ @e-simileoluwa: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.
[!WARNING] When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.
đ¤ Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.
đ Happy Wave đ
This issue has been completed by @e-simileoluwa as part of the Stellar Wave Program's 11th Wave đĨŗ
đ @e-simileoluwa: You earned 200 Points for completing this issue! Once the Wave's rewards are finalized, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.
đ§âđģ Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.