Conversation
Re-exports DataSource and SyncOptions from the package barrel so consumers (such as wallet-sdk) can type their data-source parameters structurally instead of importing concrete provider classes. Adds the implements clause to SourceAggregator and surfaces head() and isLiveProvider — both delegate to the last (live) source — so the aggregator now satisfies the same interface as the underlying providers. No runtime behavior change.
mattgle
marked this pull request as ready for review
May 4, 2026 18:23
mattgle
marked this pull request as draft
May 4, 2026 21:16
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.
Context
wallet-sdk'sRailgunWalletSDK.scan()accepts a data source but currently types the parameter asanybecause theDataSourceinterface — defined inside this package atsrc/sources/data-source.ts— is not part of the public package surface. To let consumers type against it structurally instead of importing concrete provider classes for typing, this PR exposes it.Changes
DataSourceandSyncOptionsfromsrc/sources/index.tsand the package rootsrc/index.ts.SourceAggregatornow declaresimplements DataSource<T>and gainshead()andisLiveProvider. Both delegate to the last (highest-cost) source, which by the aggregator's existing convention is the live provider. This is consistent with howfrom()already treats the last source as the live tail.Why now
Unblocks the wallet-sdk-side change that types
scan()'s provider parameter asDataSource<EVMBlock>, removing twoanycasts and the need to import concrete provider classes purely for typing.