viem
in a couple ways:
toAccount
function. See the Wallet Client Example below.toAccount
function and get back a viem Custom Account, which can be used wherever viem expects an account. For example, you can create a viem Wallet Client from this account and use the Wallet Client to send transactions.
The following code snippet demonstrates how to use a viem Wallet Client to send a transaction.
If you followed the quickstart, you will have a project that you can use to follow along with the example below.
viem
in your project:
toAccount
from viem/accounts
to wrap a CDP account in a viem Custom Account, which is immediately passed to the createWalletClient
function to create a viem Wallet Client.