flowfi icon indicating copy to clipboard operation
flowfi copied to clipboard

[Contracts] Add stream_count view function

Open ogazboiz opened this issue 7 months ago â€ĸ 10 comments

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) -> u64 view is implemented
  • [ ] Returns 0 on 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.

ogazboiz avatar Apr 28 '26 21:04 ogazboiz

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 🌊

drips-wave[bot] avatar Apr 28 '26 21:04 drips-wave[bot]

@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.

Alaka-ibr avatar Jun 27 '26 09:06 Alaka-ibr

@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.

Caneryy avatar Jun 30 '26 01:06 Caneryy

@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.

Anthony-19 avatar Jun 30 '26 01:06 Anthony-19

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 🌊

drips-wave[bot] avatar Jun 30 '26 01:06 drips-wave[bot]

đŸĻŠ GrantFox — @Anthony-19 has been assigned to this issue!

Next steps:

  1. Open a Pull Request referencing this issue (e.g., Closes #421)
  2. Your PR will be reviewed by the LabsCrypt maintainers

Good luck! Track your progress on GrantFox.

grantfox-oss[bot] avatar Jun 30 '26 01:06 grantfox-oss[bot]

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.

drips-wave[bot] avatar Nov 18 '26 18:11 drips-wave[bot]

@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.

e-simileoluwa avatar Nov 21 '26 12:11 e-simileoluwa

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 🌊

drips-wave[bot] avatar Nov 21 '26 12:11 drips-wave[bot]

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.

drips-wave[bot] avatar Nov 22 '26 09:11 drips-wave[bot]