For a complete working app that transfers tokens, see the Circle Smart
Account
example
in the modular wallets web SDK repository.
Before you begin
Before you begin, ensure that you’ve:- Created a modular wallet and have
access to the
smartAccountandbundlerClientfrom that tutorial. - Funded the smart account address with USDC on Arc Testnet from faucet.circle.com.
- Configured a Gas Station policy in the Circle Console if you plan to sponsor gas on mainnet. Testnet usage is sponsored automatically.
Before shipping to production, also set up passkey
recovery so users can restore
access if they lose their passkey.
Steps
Send the user operation
A user operation packages a contract call, in this case an ERC-20
transfer,
for the bundler to submit through the user’s MSCA. Setting paymaster: true (or
Paymaster.True() on iOS and Android) sponsors gas through your Gas Station
policy.Testnet usage is sponsored automatically. For mainnet, configure a policy in the
Circle Console first.sendUserOperation returns a userOpHash, a 66-character hex string that
identifies the user operation.encodeTransfer supports the tokens listed in the ContractAddress enum,
including USDC. See the full list in the
Web,
iOS, or
Android SDK reference.For tokens not listed in
ContractAddress, or when batching multiple
contract calls in a single user operation, build calls manually. Each
entry is a { to, data } pair executed by the MSCA. See
Batch and parallel user operations
for the pattern.Wait for the receipt
Poll for the receipt to confirm the transfer landed onchain.The receipt contains
transactionHash, the onchain transaction hash. Look it up
on the block explorer to confirm the transfer landed.waitForUserOperationReceipt polls locally. To be notified of transfer
activity on the wallet asynchronously, including inbound transfers from
external senders, set up a webhook
endpoint.