Use @circle-fin/app-kit
to discover earn vaults on Arc Testnet, deposit USDC, check a position, and
withdraw with a browser wallet and the viem adapter.
This Vite + TypeScript page connects an EIP-6963 wallet (for example MetaMask),
creates a Circle adapter from the provider, then calls earn.exploreVaults(),
earn.getDepositQuote(), earn.deposit(), earn.getPosition(),
earn.getWithdrawalQuote(), and earn.withdraw().
- Node.js 22 or later
- An EIP-6963 browser wallet such as MetaMask
- Testnet USDC on Arc Testnet
- Native gas token on Arc Testnet for the wallet transaction
This project does not require environment variables or API keys.
npm install
npm run devOpen the local Vite URL in a browser with your wallet installed.
npm run build- Discovers an EIP-6963 browser wallet and requests account access.
- Lists active vaults on
Arc_Testnetwithkit.earn.exploreVaults(). - Creates a viem adapter with
createViemAdapterFromProvider(). - Previews and deposits 1 USDC with
kit.earn.getDepositQuote()andkit.earn.deposit(). - Reads the position with
kit.earn.getPosition(). - Previews and withdraws 1 USDC with
kit.earn.getWithdrawalQuote()andkit.earn.withdraw().
src/main.ts— wallet connect, vault discovery, quotes, deposit, position, and withdraw. Changechain,amount, and the selected vault for a different chain, amount, or opportunity.
This sample deposits on the same chain as the vault (Arc_Testnet). To deposit
USDC from a wallet on another blockchain into that vault, pass a different
from.chain and a to destination on the same kit.earn.deposit() call in
src/main.ts — for example Ethereum Sepolia → Arc Testnet:
const result = await kit.earn.deposit({
from: { adapter, chain: "Ethereum_Sepolia" },
to: {
chain: "Arc_Testnet",
recipientAddress, // position owner on the vault chain
},
vaultAddress,
amount: "1",
transferSpeed: "FAST", // optional: "FAST" | "SLOW"
});Fund the source wallet with USDC and gas on the source chain (not Arc). Testnet sources are Ethereum Sepolia, Arbitrum Sepolia, and Base Sepolia; the vault destination is Arc Testnet.
A crosschain deposit returns when the bridge submit succeeds
(result.kind === "cross-chain"), not when the vault position is funded. Use
kit.earn.getCrossChainDepositStatus() or
kit.earn.waitForCrossChainDeposit() with result.execId to track settlement.
Preview fees with the same from / to shape on kit.earn.getDepositQuote().
See Deposit crosschain into an Earn vault for routes, fees, and status tracking.