You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's two very different use cases that we need to consider, Dapps and backend services.
Dapps need public nodes and should use the fallback transport
Backend services can use authenticated private node and probably also the fallback transport or something like ERPC
We need to split these out and also take into considerations that Dapps use Wagmi and not viem directly.
The issue is how we handle the "clients" in the SDK we should not make reads go through the wallets, we can do that by default and provide a config if the developer wants to configure the "read client" manually.
Considerations
We need to rethink how the SDK gets the "client" it can be from viem directly or Wagmi
The SDK should have a clear split between a read client and a write (or wallet) client
The Core should be specific which type of client it needs for each action
In the SDK we can turn a wallet client into a read client with good defaults using fallback transport but also provide a config for manual configuration
For backend service, when the wallet transport is not a custom EIP-1193 we can assume "backend" and keep the same transport for the read client or use default to the public fallback
Add a new option to configure manually the read client, this can be just the transport and we use the wallet client to complete the config or just accept a full client from the user.
We can optimize by enabling multicall by default on any client in the SDK
There's two very different use cases that we need to consider, Dapps and backend services.
We need to split these out and also take into considerations that Dapps use Wagmi and not viem directly.
The issue is how we handle the "clients" in the SDK we should not make reads go through the wallets, we can do that by default and provide a config if the developer wants to configure the "read client" manually.
Considerations
References: