Today the only way to add funds to or lengthen a stream is to cancel and recreate it. Add first-class support.
What to do
top_up(stream_id, amount) — sender deposits additional tokens into an active stream, recalculating rate_per_sec (or extending end_time, document which).
extend(stream_id, new_end_time) — push out the end time, lowering the effective rate over the remaining deposit.
Requirements
- Sender-authed; only valid on
Active streams.
- Must preserve already-earned/
claimed amounts — a top-up or extend may never reduce what the recipient has already accrued.
- Checked integer math only (no overflow, no truncation that strands funds — see the dust handling in
get_claimable).
- Emit events for the new state.
Acceptance criteria
Today the only way to add funds to or lengthen a stream is to cancel and recreate it. Add first-class support.
What to do
top_up(stream_id, amount)— sender deposits additional tokens into an active stream, recalculatingrate_per_sec(or extendingend_time, document which).extend(stream_id, new_end_time)— push out the end time, lowering the effective rate over the remaining deposit.Requirements
Activestreams.claimedamounts — a top-up or extend may never reduce what the recipient has already accrued.get_claimable).Acceptance criteria
cargo testpasses.