- Automatic routing: Specify a total spend amount and let App Kit choose which blockchains to draw from based on your confirmed balances.
- Explicit amounts: Set how much USDC comes from each source blockchain yourself.
Prerequisites
Before you begin, ensure that you’ve: These are required so any example below runs with a validkit and adapter.
App Kit allocates for you
App Kit chooses how to fund the spend from your confirmed balances. The kit prefers the destination blockchain first, then pulls from your other blockchains from highest balance to lowest. Ethereum mainnet is the exception: it is always last, including when it is the spend destination. Passamount, from with only an adapter (no allocations), and to.
This example spends 2.00 USDC with automatic routing:
TypeScript
Explicit per-chain allocations
List each blockchain and how much USDC to draw infrom.allocations. Each entry
contains an amount and chain. When you use allocations, their amounts must
add up to the top-level amount.
This example spends 2.00 USDC (1.00 USDC from Arc Testnet and 1.00 USDC from
Base Sepolia) delivered to the recipient on Arc Testnet:
TypeScript
from when you need separate sources (for
example EVM and Solana). Each source uses the same shape: adapter and optional
allocations. The top-level amount must still match the sum of all allocation
amounts you provide.
Validation rules
- Amount: The top-level
amountis always required. It is the total USDC for the spend. - Sums: If you pass
allocations, the kit checks that they sum toamount. If they do not match, you get a clear error with both values. - Consistency: Either every
fromentry specifiesallocations, or none do. Mixing sources with allocations and sources without is not supported. If you need a computed split first, useestimateSpend, then pass the returnedallocationsintospend. - Retry: Retrying only the mint step after a failure uses a separate
retrySpendflow and parameters, not a partialspendcall.