This sample app demonstrates stablecoin FX swaps between USDC and EURC using the App Kits Swap SDK and Circle Developer Controlled Wallets on Arc.
- Node.js 20+ and npm
- Docker (for local Supabase)
- A Circle account with API key + entity secret
- A Circle App Kit
KIT_KEY
npm installnpm run db:startThis boots Postgres, Auth, etc. via the Supabase CLI and runs the migrations in
supabase/migrations/. Use npm run db:status to print the local URLs and keys,
npm run db:reset to wipe + re-migrate, and npm run db:stop to shut it down.
Copy the example file and fill in the blanks:
cp .env.example .env.localNEXT_PUBLIC_SUPABASE_URL/NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY/SUPABASE_SECRET_KEY- fromnpm run db:status.CIRCLE_API_KEY- from the Circle console.CIRCLE_ENTITY_SECRET- your 32-byte hex entity secret. Must be registered with Circle once before use.CIRCLE_BLOCKCHAIN- Circle blockchain identifier (defaultARC-TESTNET).KIT_KEY- Circle App Kit key.NEXT_PUBLIC_ARC_CHAIN- App Kit chain identifier (defaultArc_Testnet).APP_FEE_BPS- platform fee in basis points (default25= 0.25%).APP_FEE_RECIPIENT- leave blank, then run the script below.
Creates a Circle wallet to receive swap fees and writes its address back to
.env.local as APP_FEE_RECIPIENT:
npm run wallet:generatenpm run devApp is running at http://localhost:3000.
src/app/(auth)/- register / login flowssrc/app/(app)/dashboard/- authenticated swap panelsrc/app/(app)/dashboard/history/- trades historysrc/app/api/webhooks/circle/- Circle webhook receiversrc/components/swap/,src/components/trades/,src/components/wallet/- feature UIsrc/lib/circle/,src/lib/appkit/- Circle wallets + App Kit integrationsrc/lib/supabase/- Supabase client/server/admin helperssupabase/migrations/- database schemascripts/- one-off operator scripts
Sample apps provided for demonstration and educational purposes only, intended for Arc testnet use only, and not production-ready. See Arc.io for more.
