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
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.
Labels:
good first issue,contracts,Stellar Wave,smart-contractThere'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) -> u64that 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
0Done when
stream_count(env: Env) -> u64view is implemented0on a freshly-deployed contractcreate_streamWhere to start
Add the function in
contracts/flowfi/src/lib.rs, test incontracts/flowfi/src/test.rs, then regenpackages/sdk/src/index.ts. Small, good first contract issue.