A Base mini app that allows users to view their ERC20 token balances and swap multiple tokens to USDC using batch transactions.
- ERC20 Token Balance Display: View balances for popular tokens on Base network (USDC, WETH, DAI)
- Batch Token Swapping: Swap multiple ERC20 tokens to USDC in a single transaction (demo mode)
- Swap Tracking: Track total swap amounts and fees using Supabase
- Rewards System: Calculate and display rewards based on swap volume (10% of fees)
- Modern UI: Clean, responsive design optimized for mobile with fixed bottom button
This mini app demonstrates:
- Connecting to user's wallet via OnchainKit
- Fetching ERC20 token balances
- Displaying total swap history
- Calculating rewards based on swap activity
- Preparing batch swap transactions (demo implementation)
Before getting started, make sure you have:
- Base app account
- A Farcaster account
- Vercel account for hosting the application
- Coinbase Developer Platform Client API Key
git clone https://github.com/base/demos.gitcd demos/minikit/waitlist-mini-app-qs
npm installCreate a .env.local file and add your environment variables:
NEXT_PUBLIC_PROJECT_NAME="Your App Name"
NEXT_PUBLIC_ONCHAINKIT_API_KEY=<Replace-WITH-YOUR-CDP-API-KEY>
NEXT_PUBLIC_URL=npm run devThe minikit.config.ts file configures your manifest located at app/.well-known/farcaster.json.
Skip the accountAssociation object for now.
To personalize your app, change the name, subtitle, and description fields and add images to your /public folder. Then update their URLs in the file.
vercel --prodYou should have a URL deployed to a domain similar to: https://your-vercel-project-name.vercel.app/
Add your production URL to your local .env file:
NEXT_PUBLIC_PROJECT_NAME="Your App Name"
NEXT_PUBLIC_ONCHAINKIT_API_KEY=<Replace-WITH-YOUR-CDP-API-KEY>
NEXT_PUBLIC_URL=https://your-vercel-project-name.vercel.app/Add environment variables to your production environment:
vercel env add NEXT_PUBLIC_PROJECT_NAME production
vercel env add NEXT_PUBLIC_ONCHAINKIT_API_KEY production
vercel env add NEXT_PUBLIC_URL production- Navigate to Farcaster Manifest tool
- Paste your domain in the form field (ex: your-vercel-project-name.vercel.app)
- Click the
Generate account associationbutton and follow the on-screen instructions for signing with your Farcaster wallet - Copy the
accountAssociationobject
Update your minikit.config.ts file to include the accountAssociation object:
export const minikitConfig = {
accountAssociation: {
"header": "your-header-here",
"payload": "your-payload-here",
"signature": "your-signature-here"
},
frame: {
// ... rest of your frame configuration
},
}vercel --prodGo to base.dev/preview to validate your app:
- Add your app URL to view the embeds and click the launch button to verify the app launches as expected
- Use the "Account association" tab to verify the association credentials were created correctly
- Use the "Metadata" tab to see the metadata added from the manifest and identify any missing fields
To publish your app, create a post in the Base app with your app's URL.
For detailed step-by-step instructions, see the Create a Mini App tutorial in the Base documentation.
This project is a demo application created by the Base / Coinbase Developer Relations team for educational and demonstration purposes only.
There is no token, cryptocurrency, or investment product associated with Cubey, Base, or Coinbase.
Any social media pages, tokens, or applications claiming to be affiliated with, endorsed by, or officially connected to Cubey, Base, or Coinbase are unauthorized and fraudulent.
We do not endorse or support any third-party tokens, apps, or projects using the Cubey name or branding.
Warning
Do not purchase, trade, or interact with any tokens or applications claiming affiliation with Coinbase, Base, or Cubey.
Coinbase and Base will never issue a token or ask you to connect your wallet for this demo.
For official Base developer resources, please visit: