Skip to content

[Frontend] Add real-time claimable amount countdown on stream detail #419

Description

@ogazboiz

Telegram (ask questions / claim the issue here first): https://t.me/+DOylgFv1jyJlNzM0

Labels: frontend, Stellar Wave

The claimable amount on the stream detail page is fetched once and then just sits there, which looks broken for a streaming-payment product.

We already call get_claimable_amount on load. What's missing is a ticking display. The cleanest approach is to compute the value locally from rate_per_second * elapsed_seconds_since_last_checkpoint so it updates instantly, then re-sync against the API every 30s so it doesn't drift. Only tick while the stream is ACTIVE.

What the fix has to hold to

  • Local counter is display-only; the API stays the source of truth via periodic re-sync
  • Interval clears on unmount so we don't leak timers
  • No ticking while PAUSED or COMPLETED

Done when

  • Claimable amount updates every second while the stream is ACTIVE
  • Value is computed client-side (rate_per_second * elapsed) with an API re-sync every 30s
  • Counter pauses on PAUSED/COMPLETED and cleans up its interval on unmount
  • Uses the existing amount-formatting util (e.g. 7.0000312 XLM)
  • Small highlight pulse on each tick
  • Tests + lint pass, CI green

Where to start
New src/hooks/useClaimableAmount.ts holds the interval + remote sync. Pull the display out into src/components/streams/ClaimableAmountDisplay.tsx and wire it up in src/app/streams/[id]/page.tsx. Add getClaimableAmount(id) to src/lib/api/streams.ts if it isn't there yet. Small frontend change, mostly hook + cleanup logic.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26Stellar WaveIssues in the Stellar wave programfrontendFrontend related tasks

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions