feat(streams): add StreamsModule.streamedTotal() wrapper for streamed_total - #464
Closed
YazarAyobami wants to merge 1 commit into
Closed
feat(streams): add StreamsModule.streamedTotal() wrapper for streamed_total#464YazarAyobami wants to merge 1 commit into
YazarAyobami wants to merge 1 commit into
Conversation
…_total (conduit-protocol#455) Adds a read-only wrapper for DripStream::streamed_total, exposing the cumulative amount streamed since start regardless of withdrawals. Unlike withdrawable(), which reflects only the unwithdrawn portion, this value does not reset after a withdrawal — useful for progress displays. Also fixes the npm optional-dependency lockfile metadata (npm bug #4828) that left @rolldown/binding-linux-x64-gnu uninstallable, which broke the vitest test suite. Closes conduit-protocol#455 Generated with Codebuff 🤖 Co-Authored-By: Codebuff <noreply@codebuff.com>
|
@YazarAyobami 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! 🚀 |
Contributor
|
Thanks for the contribution here — squash-merging this now. Any follow-ups we'll track in a fresh issue. 🚀 |
Jaydbrown
added a commit
that referenced
this pull request
Aug 26, 2026
…_total (#464) Co-authored-by: YazarAyobami <YazarAyobami@users.noreply.github.com>
Contributor
|
Merged into |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
StreamsModule.streamedTotal(streamId)— a read-only wrapper for theDripStream::streamed_totalcontract method.Closes #455
Motivation
docs/architecture.md's "What's not wrapped yet" section listedDripStream::streamed_totalas an existing contract method with noStreamsModuleequivalent.Unlike
withdrawable()(which reflects only the unwithdrawn portion),streamed_totalexposes the cumulative amount streamed since the stream started, regardless of withdrawals. This is useful for progress displays that shouldn't reset visually after a withdrawal. Previously a caller had to reconstruct this value client-side fromStreamInfo.withdrawn + withdrawableLocal(), duplicating on-chain accounting logic instead of reading it directly.Changes
src/streams.ts— newstreamedTotal(streamId: bigint | string): Promise<bigint>method, mirroring the existingwithdrawable()read-only pattern (resolve address → build contract call tx → simulate → parsei128retval). No signing, no transaction, nokeypairrequired.src/tests/streams-success.test.ts— 3 new tests: returns cumulative amount from simulation retval; keeps counting past withdrawals; surfacesConduitErrorscoped to'stream'on simulation failure.docs/api.md— newstreamedTotal(streamId)reference section.docs/architecture.md— updated module map line; removedstreamed_totalfrom "What's not wrapped yet".README.md— newstreamedTotal(streamId)API section.CHANGELOG.md— Added entry under [Unreleased].Verification
npm run typecheck— passesnpm run lint(on changed files) — passesnpm test— 725 passed, 2 skippednpm run build— ESM + CJS bundles build cleanlyNote
Includes a
package-lock.jsonfix for npm bug #4828: spurious"peer": truemarkers on optional dependencies left@rolldown/binding-linux-x64-gnuuninstallable, which broke the vitest test suite with "Cannot find native binding". This was a pre-existing failure in the working tree; the corrected lockfile metadata is included so CI can run the tests.