refactor: consolidate viem client helpers and FilecoinChain types - #909
Open
hugomrdias wants to merge 15 commits into
Open
refactor: consolidate viem client helpers and FilecoinChain types#909hugomrdias wants to merge 15 commits into
hugomrdias wants to merge 15 commits into
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
synapse-dev | d2725be | Commit Preview URL Branch Preview URL |
Aug 12 2026, 10:38 AM |
hugomrdias
marked this pull request as ready for review
August 7, 2026 10:52
rjan90
reviewed
Aug 8, 2026
Type read actions as ReadClient and write actions as AccountClient, and move toReadClient into a dedicated client export so callers strip accounts explicitly.
Avoid clashing with viem's Chain type and tighten toReadClient/asClient around FilecoinChain.
Route service reads through Synapse.readClient and type wallet clients as AccountClient.
Drop ReadClient/AccountClient from action parameters in favor of Client<Transport, Chain> and Client<Transport, Chain, Account>.
Extend Synapse clients with publicActions, thread readClient into services, and update AccountClient/ReadClient usages for the reordered generics.
Clean up leftover chain generics and unused imports after the client type updates.
Update CLI and tests to pass wallet clients through for reads, and remove obsolete read-client / PDP contract tests.
Pass the original client through for internal reads and React/CLI query paths now that account stripping is no longer required.
Also drop the last toReadClient wrap in deposit-with-permit and use FilecoinChain naming in session keys.
Let SynapseFromClientOptions accept an optional public client instead of always deriving one from the wallet client.
Update synapse-core/synapse guides for getTransport and readClient, and fix the docs site Chain type import.
Set the rank option to false for both mainnetTransport and calibrationTransport to ensure consistent fallback behavior.
hugomrdias
force-pushed
the
hugomrdias/895-split-viem-clients
branch
from
August 12, 2026 10:28
2a9afbd to
d2725be
Compare
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
@filoz/synapse-core/clientwithgetTransport,asClient, andtoReadClient(ranked Filecoin RPC transports; normalize clients toFilecoinChain; swap custom transports to HTTP for non-JSON-RPC accounts).ReadClient/AccountClient/SessionKeyClientaliases and rename the FOC chain interface toFilecoinChain(avoids clashing with viem’sChain).Client<Transport, Chain>for reads,Client<Transport, Chain, Account>for writes/signing).Synapseexposesclient+readClient(both extended withpublicActions) and threads them into payments / warm-storage / SP registry services.Test plan
pnpm --filter @filoz/synapse-core testpnpm --filter @filoz/synapse-sdk testpnpm --filter @filoz/synapse-react build