Skip to main content

What is Base Account?

Base Account is a Smart Wallet-backed account that provides:
  • Universal sign-on – one passkey works across every Base-enabled app
  • One-tap USDC payments – low-friction payments built into the account layer
  • Gasless transactions – apps can sponsor user transaction fees
  • Batch transactions – combine multiple operations into a single confirmation
  • Multi-chain support – works across nine EVM networks including Base, Arbitrum, Optimism, and more
Mini Apps launched within the Base App are automatically connected to the user’s Base Account, eliminating wallet connection flows and enabling instant onchain interactions.

Base Pay in Mini Apps

Accept one-tap USDC payments with the Base Pay helper function. No additional setup required—just import and call:
import { pay, getPaymentStatus } from '@base-org/account';

async function handlePayment() {
  try {
    const payment = await pay({
      amount: '5.00',           // USD amount
      to: '0xYourAddress',      // your recipient address
      testnet: true             // set false for mainnet
    });
    
    console.log(`Payment sent! ID: ${payment.id}`);
    
    // Check payment status
    const { status } = await getPaymentStatus({ 
      id: payment.id,
      testnet: true 
    });
    
    if (status === 'completed') {
      console.log('Payment confirmed!');
    }
  } catch (error) {
    console.error('Payment failed:', error.message);
  }
}
Collecting user info at checkoutYou can request email, phone, or shipping address by passing a payerInfo object. See the Accept Payments Guide for details.However, this is not supported in Mini Apps yet.

Using Base Account Features

Get the Ethereum Provider

In Mini Apps, access Base Account through the standard Ethereum provider:
app.tsx
// [...]

// Get the provider
const provider = window.ethereum;

if (!provider) {
  console.error('No Ethereum provider found');
  return;
}

// Request account access
const accounts = await provider.request({ 
  method: 'eth_requestAccounts' 
});

console.log('Connected account:', accounts[0]);
Getting the provider allows you to use the Base Account SDK to interact with the user’s Base Account. Follow the Base Account guides to use these features.

Available RPC Methods

Once you have the provider, you can call Base Account RPC methods. See the full RPC methods reference for complete details.
Unsupported Methods and Capabilities in Mini AppsThe following methods and capabilities are not yet supported in Mini Apps but will be added soon:
  • wallet_sign
  • wallet_connect
  • wallet_getSubAccounts
  • wallet_addSubAccount
  • coinbase_fetchPermissions
  • coinbase_fetchPermission
  • signTypedData
  • datacallback
All other standard Ethereum and Base Account RPC methods work as expected.

Key Features & Examples

1. Batch Transactions

Combine multiple operations into a single user confirmation using wallet_sendCalls:
components/batchTransfer.tsx
import { numberToHex, parseEther } from 'viem';

async function batchTransfer() {
  const provider = window.ethereum;
  const accounts = await provider.request({ method: 'eth_requestAccounts' });
  
  const result = await provider.request({
    method: 'wallet_sendCalls',
    params: [{
      version: '1.0',
      from: accounts[0],
      chainId: numberToHex(8453), // Base mainnet
      calls: [
        {
          to: '0xRecipient1',
          value: numberToHex(parseEther('0.01')),
          data: '0x'
        },
        {
          to: '0xRecipient2',
          value: numberToHex(parseEther('0.01')),
          data: '0x'
        }
      ]
    }]
  });
  
  console.log('Batch transaction sent:', result);
}

Batch Transactions Full Guide

Learn about atomic batching and how to use it with Base Account

2. Sponsored Gas Transactions

Let your Mini App pay gas fees for users with paymaster capabilities:
components/sponsoredMint.tsx
import { numberToHex, encodeFunctionData } from 'viem';

async function sponsoredMint() {
  const provider = window.ethereum;
  const accounts = await provider.request({ method: 'eth_requestAccounts' });
  
  const nftABI = [
    {
      name: 'mint',
      type: 'function',
      stateMutability: 'nonpayable',
      inputs: [{ name: 'to', type: 'address' }],
      outputs: []
    }
  ];
  
  const result = await provider.request({
    method: 'wallet_sendCalls',
    params: [{
      version: '1.0',
      from: accounts[0],
      chainId: numberToHex(8453),
      calls: [{
        to: '0xNFTContract',
        value: '0x0',
        data: encodeFunctionData({
          abi: nftABI,
          functionName: 'mint',
          args: [accounts[0]]
        })
      }],
      capabilities: {
        paymasterService: {
          url: 'https://api.developer.coinbase.com/rpc/v1/base/YOUR_KEY'
        }
      }
    }]
  });
  
  console.log('Sponsored transaction sent:', result);
}
You can get your paymaster API key from Coinbase Developer Platform.

Sponsor Gas Full Guide

Set up paymasters and manage gas sponsorship

3. Check Wallet Capabilities

EIP-5792 introduced capabilities detection to allow wallets to declare what capabilities they support. In order to detect what capabilities the mini apps supports, you can use the wallet_getCapabilities method.
components/checkCapabilities.tsx
async function checkCapabilities() {
  const provider = window.ethereum;
  const accounts = await provider.request({ method: 'eth_requestAccounts' });
  
  const capabilities = await provider.request({
    method: 'wallet_getCapabilities',
    params: [accounts[0]]
  });
  
  const baseCapabilities = capabilities['0x2105']; // Base mainnet chain ID
  
  console.log('Atomic batch:', baseCapabilities?.atomicBatch?.supported);
  console.log('Paymaster:', baseCapabilities?.paymasterService?.supported);
  console.log('Auxiliary funds:', baseCapabilities?.auxiliaryFunds?.supported);
}

Capabilities Reference

Full list of Base Account capabilities

Additional Resources

I