Skip to content

Validate stream creation and recover typed events - #1197

Merged
Jaydbrown merged 1 commit into
conduit-protocol:mainfrom
Chigozie8876:feat/stream-validation-event-replay
Nov 21, 2026
Merged

Jaydbrown merged 1 commit into
conduit-protocol:mainfrom
Chigozie8876:feat/stream-validation-event-replay

Conversation

@Chigozie8876

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds builder-side safeguards for retroactive start dates and invalid deposits, and completes typed decoding for the two new stream events. Polling subscriptions resume from the last fully acknowledged ledger after a transient RPC failure.

Type of change

  • Bug fix
  • New feature / method
  • Refactor
  • Test coverage
  • Documentation
  • Dependency update

Related issue

Closes #1065
Closes #1066
Closes #1067
Closes #1068

Changes

File Change
src/builder.ts Enforce the 30-day retroactive start-time limit and validate positive deposits through ValidationError during build.
src/events.ts, src/types/index.ts Add typed StreamCliffReached and StreamTopUpExtended decoding/listeners and restart polling from the last acknowledged ledger after reconnection.
src/index.ts, src/mock-indexer.ts Export the event map and support the new typed event history entries.
src/tests/ Add focused builder, event-decoding, and reconnect-replay cases.
CHANGELOG.md Document the four issue fixes.

Checklist

  • npm run typecheck — no errors
  • npm run lint — no warnings
  • npm test — all tests pass
  • npm run build — bundle compiles cleanly
  • No any types introduced
  • New public methods documented in docs/api.md
  • All on-chain amounts kept as bigint — no Number() conversion in arithmetic
  • New methods mock-tested in src/tests/
  • CHANGELOG.md updated under [Unreleased]
  • src/index.ts updated if new exports added

Breaking changes?

  • No
  • Yes — describe below and add BREAKING CHANGE: footer to relevant commit

Notes for reviewers

Checks were not run per request. The new tests are included but were not executed. No new public methods were added; the new event handlers and types are exported through the existing public type exports.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@drips-wave

drips-wave Bot commented Nov 21, 2026

Copy link
Copy Markdown

@Chigozie8876 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Jaydbrown
Jaydbrown merged commit 48c1e1d into conduit-protocol:main Nov 21, 2026
ashokwebs added a commit to ashokwebs/streamFi-sdk that referenced this pull request Nov 22, 2026
conduit-protocol#1197 deliberately allows a startTime up to 30 days in the past and changed
the error to 'startTime cannot be more than 30 days in the past'. This test
still expected the old message. startTime(1) is still rejected; only the
expected text is updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ashokwebs added a commit to ashokwebs/streamFi-sdk that referenced this pull request Nov 22, 2026
conduit-protocol#1197 added cliff_reached to StreamHistoryEntry and grouped it with
top_up_extended in actorAddressesOf, reading entry.event.sender. The
StreamCliffReached event has no sender (only recipient, timestamp,
unlockAmount), so this failed typecheck and a recipient filter never
matched cliff events. Return the recipient instead, with a test that fails
without the fix.

Cliff events also carry no sequence topic, so the mock-event-stream test
narrows with 'sequence' in e.event instead of reading it directly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants