Skip to content

feat: multi-network client configuration - #493

Merged
Chuks-coderr merged 2 commits into
SoroStream:mainfrom
fridaypetra55-afk:feat/393-multi-network-client
Aug 27, 2026
Merged

Chuks-coderr merged 2 commits into
SoroStream:mainfrom
fridaypetra55-afk:feat/393-multi-network-client

Conversation

@fridaypetra55-afk

Copy link
Copy Markdown
Contributor

Summary

Support initialising the SDK with multiple network configurations so a single client instance can query streams across mainnet and testnet without requiring separate client instances.

Changes

  • New src/multiNetwork.ts:
    • MultiNetworkClient(configs[]) – constructs one SoroStreamClient per network entry; rejects duplicate networks with MultiNetworkConfigError
    • getClient(network) – returns the underlying client for direct write access; throws MultiNetworkNotFoundError for unconfigured networks
    • hasNetwork(network) – boolean check
    • Targeted reads: getStream, getStreamsByRecipient, getStreamsBySender, getClaimable
    • Fan-out reads: getStreamsByRecipientAllNetworks, getStreamsBySenderAllNetworks – query all networks in parallel; per-network errors are captured in the result, never reject the whole call
    • findStreamAcrossNetworks(streamId) – search every configured network, returns all matches
    • destroy() / disconnect() – delegate to all underlying clients
    • MultiNetworkConfigError / MultiNetworkNotFoundError error types
  • All symbols exported from src/index.ts
  • 18 unit tests in test/multi_network.test.ts

Testing

  • 18 new tests pass
  • Full test suite passes
  • Lint/type check clean

Closes #393

Support initialising the SDK with multiple network configurations so a
single client instance can query streams across mainnet and testnet
without requiring separate client instances.

- New src/multiNetwork.ts:
  - MultiNetworkClient(configs[]) constructor - one SoroStreamClient
    per network, duplicate networks rejected
  - getClient(network) - returns the underlying client for a network
  - hasNetwork(network) - checks if a network is configured
  - getStream(network, streamId) - targeted single-network fetch
  - getStreamsByRecipient/Sender(network, address) - targeted fetch
  - getClaimable(network, streamId) - targeted fetch
  - getStreamsByRecipientAllNetworks(recipient) - fan-out to all networks
  - getStreamsBySenderAllNetworks(sender) - fan-out to all networks
  - findStreamAcrossNetworks(streamId) - search every network
  - Per-network errors captured; fan-out never rejects whole call
  - destroy() / disconnect() delegate to all underlying clients
  - MultiNetworkConfigError / MultiNetworkNotFoundError error types
- All symbols exported from src/index.ts
- 18 unit tests in test/multi_network.test.ts

Closes SoroStream#393
@drips-wave

drips-wave Bot commented Aug 25, 2026

Copy link
Copy Markdown

@fridaypetra55-afk 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

@Chuks-coderr
Chuks-coderr merged commit 6e6b0db into SoroStream:main Aug 27, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement multi-network stream aggregation across testnet and mainnet

2 participants