A showcase application demonstrating unified Base Account and CDP Embedded Wallet integration on Base Sepolia.
Simple Send demonstrates how to build onchain apps that support existing Base users and newcomers through a unified auth interface.
supported auth methods:
- 🟦 Base Account - Passkey-based auth for existing Base users
- 📱 CDP Embedded Wallet - Email-based authentication for new users (you can add Mobile SMS auth if desired, and more Social OAuth methods are coming to CDP Embedded Wallet soon!)
core features:
- connected wallet details - top-right component indicates whether the connected wallet is a Base Account or Embedded Wallet, shows beginning & end of address, lets you copy the address & disconnect
- balances - view ETH and USDC holdings of the connected wallet using CDP Data APIs
- faucet - get ETH and USDC on Base Sepolia into the connected wallet, using CDP Faucet API
- send on Base Sepolia - Transfer ETH or USDC to any address on Base Sepolia
- ENS & Basename resolution - Enter an ENS or Basename in the destination field
- single interface supporting both wallet types
- automatic wallet persistence (users get existing wallets, not new ones)
- seamless switching between auth methods
- realtime balance checking using CDP Token Balances API
- faucet integration for getting Base Sepolia testnet tokens
- support for both ETH & USDC sends
- ENS support - Resolve .eth names (e.g.,
vitalik.eth) - Basename support - Resolve .base.eth names (e.g.,
jnix.base.eth) - direct addresses - Standard 0x addresses
- Node.js 18+
- CDP Portal account with Project ID
- Base Account (for testing Base Account flow)
-
clone the repo
git clone https://github.com/jnix2007/simple-send.git cd simple-send npm install -
setup env variables
cp .env.example .env.local
edit
.env.localwith your stuff:# CDP Configuration (get from https://portal.cdp.coinbase.com/) NEXT_PUBLIC_CDP_PROJECT_ID=your-cdp-project-id NEXT_PUBLIC_APP_NAME=Simple Send # CDP API Keys (for faucet and balance APIs) CDP_API_KEY_ID=your-api-key-id CDP_API_KEY_SECRET=your-api-key-secret
-
configure domains (CORS) in CDP Portal
- go to CDP Portal → Wallets → Embedded Wallet → Domains
- add these domains to allowed origins so you can test locally:
http://localhost:3000http://localhost:3001http://localhost:3002
-
start dev server
npm run dev
-
open the app locally
- visit
http://localhost:3000or whatever port your terminal says - try both auth methods out
- faucet some testnet tokens
- test sending transactions!
- visit
- Base Account: Wagmi connector with passkey auth
- Embedded Wallet: CDP React provider with email OTP
- unified hook:
useUnifiedAuthmanages both wallet types
- Base Account: Wagmi
useSendTransactionfor ETH & USDC - Embedded Wallet: CDP
useSendEvmTransactionfor ETH & USDC - routing: uses the right method based on the connected wallet type
- balances: CDP
listTokenBalancesfor realtime balances on the connected wallet - faucet: CDP
requestFaucetfor testnet tokens - ENS resolution: ENS API
went for a fun cyberpunk feel, using CSS custom properties, you can re-skin however you want:
:root {
--cyber-blue: #00ffff; /* Primary color */
--cyber-pink: #ff00ff; /* Secondary color */
--cyber-green: #00ff00; /* Accent color */
--cyber-black: #000000; /* Background */
}defaults to Base Sepolia but you can switch to Base Mainnet if you want:
-
update Wagmi config (
src/config/wagmi.ts):import { base } from 'wagmi/chains'; // Change chains: [baseSepolia] to chains: [base]
-
update API calls - Change
base-sepoliatobasein:- balance API route
- transaction components
- probably wanna replace faucet API route with Coinbase Onramp integration here
-
update CA's - Use mainnet USDC contract address instead of Base Sepolia
you can add stuff like:
- more tokens - add token definitions & update the UI
- more networks - extend the Wagmi config
src/
├── app/
│ ├── api/
│ │ ├── balances/route.ts # CDP Token Balances API
│ │ └── faucet/route.ts # CDP Faucet API
│ ├── globals.css # Cyberpunk theme styles
│ ├── layout.tsx # Provider setup
│ └── page.tsx # Main application
├── components/
│ ├── BalanceModal.tsx # Token balance display
│ ├── SendTransaction.tsx # Transaction interface
│ ├── TopNav.tsx # Navigation with modals
│ └── WalletAuthButton.tsx # Authentication UI
├── config/
│ └── wagmi.ts # Wagmi configuration
└── hooks/
└── useUnifiedAuth.ts # Unified authentication hook
- Base Account + CDP Embedded Wallets Integration Guide
- Base Account docs
- Base Account Wagmi integration)
- CDP Embedded Wallets docs
- CDP React Hooks
MIT License - feel free to use this code as a starting point for your own projects.
Base is for everyone 🟦 stay based
