Overview
Send USDC with a simple, unified API that works across all account types and networks. TheuseSendUsdc hook automatically detects whether you’re using Solana, EVM Smart Accounts, or EVM EOAs, handling all protocol-specific complexity for you.
Making USDC transfers as simple as specifying a recipient, amount, and network.
This hook works with all account types: Solana accounts, EVM Smart Accounts, and EVM EOAs (Externally Owned Accounts). It automatically detects which type you’re using and routes the transaction accordingly.
Why use the USDC Send Hook?
Traditional USDC transfers require managing significant protocol-specific complexity:- Contract addresses - Different USDC contracts on each network
- Decimal conversion - Converting human-readable amounts to 6-decimal atomic units
- ERC-20 encoding - Manually encoding transfer function calls (EVM)
- Associated Token Accounts - Creating and managing Associated Token Accounts (Solana)
- Gas sponsorship - Configuring Paymasters and User Operations (EVM Smart Accounts)
- Account type detection - Determining if an address is EOA, Smart Account, or Solana
Key Features
Simple API
Just three parameters:
to, amount, and network — that’s itCross-Chain
Works across Solana and EVM networks with the same hook
Universal Accounts
Supports EOAs and Smart Accounts — automatically detects which you’re using
Gas Sponsorship
Built-in Paymaster support for gasless Smart Account transactions
useSendUsdc
A single hook that sends USDC across all supported account types and networks.Basic Usage
Explicit Account Selection
If auto-selection doesn’t apply (e.g., you have multiple accounts), explicitly specify which account to send from:Advanced Options
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
to | EvmAddress | SolanaAddress | Yes | The recipient address (EVM or Solana format) |
amount | string | Yes | Human-readable USDC amount (e.g., "1.50" for 1.5 USDC) |
network | SendUsdcNetwork | Yes | Network to send on (EVM or Solana network) |
from | EvmAddress | SolanaAddress | No | Sender address (auto-selected using smart heuristics if not provided) |
useCdpPaymaster | boolean | No | Use CDP Paymaster for gas sponsorship (EVM Smart Accounts only) |
paymasterUrl | string | No | Custom Paymaster URL (EVM Smart Accounts only) |
createRecipientAta | boolean | No | Auto-create recipient’s ATA (Solana only, default: false) |
Auto-Selection Logic
The hook automatically selects thefrom address when:
- You have exactly one account (Solana, Smart Account, or EOA)
| Configuration | Result |
|---|---|
| 1 Smart Account + 1 EOA | ✅ Prefers Smart Account (EOA is typically just a signer) |
| 1 EOA only (no Smart Accounts) | ✅ Uses the EOA |
| Any other EVM configuration | ❌ Error - must specify from |
| Configuration | Result |
|---|---|
| 1 Solana account | ✅ Uses that account |
| Multiple Solana accounts | ❌ Error - must specify from |
| Configuration | Result |
|---|---|
| Both EVM and Solana accounts | ❌ Error - must specify from to avoid ambiguity |
Supported Networks
EVM Networks
base- Base Mainnetbase-sepolia- Base Sepolia Testnetethereum- Ethereum Mainnetethereum-sepolia- Ethereum Sepolia Testnetavalanche- Avalanche C-Chainpolygon- Polygon Mainnetoptimism- Optimism Mainnetarbitrum- Arbitrum Mainnet
Solana Networks
solana- Solana Mainnet Betasolana-devnet- Solana Devnet
The hook automatically waits for transaction confirmation:
- EOA: Waits for
TransactionReceipt - Smart Account: Waits for User Operation completion
- Solana: Returns immediately with signature
FAQ
What happens if I have both EVM and Solana accounts?
What happens if I have both EVM and Solana accounts?
You’ll receive an error: “Multiple account types detected (EVM and Solana). Please specify ‘from’ address…”. This prevents cross-chain ambiguity—you must explicitly choose which account to send from.
What USDC decimals are used?
What USDC decimals are used?
USDC uses 6 decimals on all supported chains (both EVM and Solana). The hook handles this conversion automatically, so you can use human-readable amounts like
"1.50".What's the cost of createRecipientAta on Solana?
What's the cost of createRecipientAta on Solana?
Setting
createRecipientAta: true will create the recipient’s USDC token account if it doesn’t exist. This costs approximately ~0.002 SOL for rent exemption, which the sender pays. This is why it defaults to false—to avoid unexpected costs.Can I customize the Paymaster for gas sponsorship with EVM Smart Accounts?
Can I customize the Paymaster for gas sponsorship with EVM Smart Accounts?
Yes! Use the
paymasterUrl parameter for Smart Accounts: