Quick look
- Same-chain swap
- Crosschain swap
This example swaps 1 USDC for EURC on Arc Testnet:See Swap tokens on a blockchain
for a full working example.
TypeScript
API key
Swap accepts an optional Circle API key obtained from the Circle Console. Pass one asapiKey
in the swap config. Without one, requests share a rate limit. Production traffic
typically needs a key to avoid hitting it.
API keys are environment specific. Testnet and mainnet each need their own key.
Moving from a kit key? Kit keys are legacy, and new ones cannot be created.
Existing kit keys remain valid, but new integrations use an API key. Rename the
kitKey parameter in your swap config to apiKey when you upgrade the SDK.Installation
Install the App Kit SDK to use Swap. If you only need to swap and don’t want to install the full App Kit SDK, install the standalone Swap Kit for your preferred adapter below.- Viem
- Ethers
- Solana
- Circle Wallets