Open 0xruhum opened 1 year ago
The separation between wallet and public clients is deliberate. Forcing the usage of only one wallet could be an issue if the wallet client in a frontend project doesn't support public methods:
https://viem.sh/docs/faq.html#why-doesn-t-wallet-client-support-public-actions
We currently execute the simulation using the public client. But, we can do it with the wallet client as well. That way the user isn't forced to provide the account in the call options:
vault.ts L131-140
Can be changed to:
That way, you don't have to call
deposit()
like this anymore since theaccount
will be embedded in the wallet client:This will need some changes to the
walletClient
parameter's type as well.