Skip to main content
USDC is an ERC-20 token, so a transfer is a transfer(to, value) call on the USDC contract. The JS SDK exposes a viem WalletClient for any wallet account via createWalletClientForWalletAccount — you read the account from getWalletAccounts (or useGetWalletAccounts in React), encode the call with viem’s erc20Abi, and you’re done.

Setup

Follow the JavaScript Quickstart for a vanilla setup, or the React Quickstart (JS SDK) for a Vite + React app with <DynamicProvider> and the EVM extension. The rest of this guide picks up from there. Install viem alongside the SDK packages:

Step 1: Get the USDC contract address

USDC is deployed at a different address on every chain. Look up the right one on Circle’s references: USDC has 6 decimals on every EVM chain — always convert with parseUnits(amount, 6).

Step 2: Build the send function

Read the user’s EVM wallet account with getWalletAccounts (or useGetWalletAccounts in React), narrow it with isEvmWalletAccount, then call writeContract against the USDC contract using viem’s built-in erc20Abi.
createWalletClientForWalletAccount signs on whatever network the wallet is currently on. To target a specific chain, switch the wallet first with switchActiveNetworkuseSwitchActiveNetwork in React.
The sender needs native token (ETH, and so on) to pay gas for the transfer. To pay it for them instead, use EVM gas sponsorship: sendSponsoredTransaction takes the same transfer call as encoded calldata.

Handling errors

Wrap the send call (sendUsdc in the JavaScript tab, handleSend in the React tab) in a try/catch and match on the message to tell the common failures apart:
To catch a failing transfer before the user signs, preview it with simulateEvmTransaction, which returns the expected asset changes plus a security verdict.
Last modified on August 18, 2026