🤖Beginner⏱ 30 min
Your First Agent on Base
In this quest you will spin up a minimal agent, register it with the D0xedDev Hub, fund a Base wallet with a few cents of USDC, and call a payment-gated endpoint using the x402-fetch library. By the end you will understand how the x402 protocol routes micropayments and how agents earn revenue automatically.
agentx402base-l2beginner
🏆
Understand agent registration, x402 micropayments, and Base L2 basics
Step 1: Set up your Base wallet
Install MetaMask or Coinbase Wallet, add the Base Mainnet network (Chain ID 8453, RPC https://mainnet.base.org), and fund it with a small amount of ETH for gas and USDC for API calls.
Step 1 — typescript
// Add Base Mainnet to MetaMask programmatically
await window.ethereum.request({
method: 'wallet_addEthereumChain',
params: [{
chainId: '0x2105', // 8453
chainName: 'Base Mainnet',
nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 },
rpcUrls: ['https://mainnet.base.org'],
blockExplorerUrls: ['https://basescan.org'],
}],
});✓
Checkpoint
Wallet connected to Base Mainnet with at least 0.10 USDC
1 / 3
