Summary
Docs and app code currently create viem clients like this:
createPublicClient({
chain: calibration,
transport: getTransport(calibration),
})
chain is passed twice: once to the factory, once to derive the transport. That feels odd and is easy to get wrong (mismatched chain vs transport).
Raised on #909: #909 (comment)
Ideas
createFilecoinClient(chain) / createFilecoinWalletClient({ chain, account }) wrappers that call getTransport(chain) internally
- Or a small
{ chain, transport: getTransport(chain) } helper used by both public and wallet factories
Keep viem's factories as the escape hatch for custom transports.
Out of scope for #909
#909 is the client/type split. This is a follow-up API, not a blocker.
Summary
Docs and app code currently create viem clients like this:
chainis passed twice: once to the factory, once to derive the transport. That feels odd and is easy to get wrong (mismatched chain vs transport).Raised on #909: #909 (comment)
Ideas
createFilecoinClient(chain)/createFilecoinWalletClient({ chain, account })wrappers that callgetTransport(chain)internally{ chain, transport: getTransport(chain) }helper used by both public and wallet factoriesKeep viem's factories as the escape hatch for custom transports.
Out of scope for #909
#909 is the client/type split. This is a follow-up API, not a blocker.