config: { transferSpeed: "FAST" } with to. Omitting it
fails validation rather than falling back to a slower deposit.
Prerequisites
Before you begin, ensure that you’ve: These are required so any example below runs with a validkit and adapter.
Supported blockchains
The following blockchains support a fast transfer as the source or destination.This list differs from Unified Balance’s
supported blockchains: some sources
are not full deposit blockchains, and only a subset of Unified Balance
blockchains are fast deposit destinations. For chain identifiers used in code,
see
Chain identifiers.
Optional: set an allowance in advance
A fast deposit uses theTokenMessengerWithFees contract to spend the deposit
amount and forwarder fee from your wallet. If the remaining USDC allowance is
too low, the kit submits an approval transaction and waits for it to be mined
before it submits the burn transaction.
To remove that wait from the deposit path, set an allowance before you estimate
and execute the deposit. The allowance applies only to the same signing wallet
and source blockchain. Each fast deposit consumes part of it, so the
optimization lasts only while the remaining allowance covers the deposit amount
plus the forwarder fee.
All supported EVM source blockchains share the same address in an environment:
Approval isn’t part of the Unified Balance API. This example uses a
user-controlled EVM adapter on Ethereum Sepolia:
TypeScript
maxUint256 grants the largest possible uint256 USDC allowance. Later fast
deposits from the same wallet and source blockchain can skip the approval wait.
The allowance stays active until you change or revoke it. Use a bounded amount
if you want to limit how much USDC the contract can spend.
Pre-approving moves the approval cost earlier; it doesn’t remove the cost. If
you use a developer-controlled adapter, also include its wallet
address in the
prepareAction context.Estimate fees before depositing
Fast deposits carry two fees:- Gas fee: the cost to submit the source transaction. Paid in the source blockchain’s native token, such as ETH.
- Forwarder fee: charged in USDC from your source chain wallet on top of the deposit amount. Your wallet needs deposit + fee available; the full deposit amount arrives on the destination chain.
estimateDeposit to preview fees before committing. The returned quote
locks in the forwarder fee, preventing fee changes from affecting your deposit.
For broader fee estimation guidance, see
Estimate spend fees.
TypeScript
The gas fee estimate may differ from the actual fee due to network conditions at
execution time. Review the estimate before proceeding.
Execute the fast deposit
Pass theestimate object into deposit() to reuse the locked fee quote. If
you omit the quote, the kit fetches a fresh one. If a supplied quote expired,
deposit() throws an error. Call estimateDeposit() again and pass the new
estimate without changing its quoted fields.
TypeScript
allowanceStrategy cannot be used with the to parameter. Fast deposits manage
USDC approval internally. A fast finality source blockchain (for example
Avalanche or Polygon PoS) is rejected rather than silently falling back to a
standard deposit. Use a supported source instead.Deposit for another account
depositFor is permissionless. Any wallet can fund another account’s Unified
Balance. Estimate first, then pass the same to and config fields as
deposit:
TypeScript
Handle the deposit result
Circle’s relayer runs in the background.deposit() returns a progress field
alongside the transaction details:
TypeScript
PENDING doesn’t confirm that the source transaction succeeded. Check the
source txHash before you act. Don’t submit another deposit while its receipt
is pending or after the receipt succeeds. For receipt, polling, and recovery
guidance, see
Troubleshoot Unified Balance deposits.JSON