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
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 Account relies on the Blockaid platform to flag apps as unsafe. If your app is being flagged as unsafe or if you are concerned about your app being flagged as unsafe, you can follow the steps detailed in the Common Issues & Debugging guide.

Implementation

1

Set Up Wagmi Provider

Configure Wagmi with the Farcaster Mini App connector and Base Account connector to enable Base Account features in your Mini App:
wagmi.ts
"use client";

import { createConfig, http, WagmiProvider } from "wagmi";
import { base, optimism } from "wagmi/chains";
import { baseAccount } from "wagmi/connectors";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { farcasterMiniApp } from "@farcaster/miniapp-wagmi-connector";
import { METADATA } from "../lib/utils";

export const config = createConfig({
  chains: [base, optimism],
  transports: {
    [base.id]: http(),
    [optimism.id]: http(),
  },
  connectors: [
    farcasterMiniApp(), 
    baseAccount({
      appName: METADATA.name,
      appLogoUrl: METADATA.iconImageUrl,
    })
  ],
});

const queryClient = new QueryClient();

export default function Provider({ children }: { children: React.ReactNode }) {
  return (
    <WagmiProvider config={config}>
      <QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
    </WagmiProvider>
  );
}
The farcasterMiniApp() connector automatically connects to the user’s Base Account when the Mini App launches within the Base App.
2

Send Batch Transactions with Capabilities

Use Wagmi’s sendCalls to send batched transactions. First, check if the wallet supports paymaster capabilities using getCapabilities, then conditionally include paymaster settings in your transaction:
components/BatchTransaction.tsx
import { parseEther } from 'viem';
import { sendCalls, getCapabilities } from '@wagmi/core';
import { config } from '../providers/Provider';

async function sendBatchTransaction() {
  // Get the connected account
  const [account] = await config.getClient().getAddresses();
  
  // Check if paymaster capability is supported
  const capabilities = await getCapabilities(config, {
    account,
  });
  
  const baseCapabilities = capabilities[8453]; // Base mainnet chain ID
  const supportsPaymaster = baseCapabilities?.paymasterService?.supported;
  
  // Prepare transaction calls
  const calls = [
    {
      to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
      value: parseEther('0.01'),
    },
    {
      to: '0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC',
      value: parseEther('0.01'),
    },
  ];
  
  // Send calls with optional paymaster capability
  const id = await sendCalls(config, {
    account,
    calls,
    chainId: 8453,
    capabilities: supportsPaymaster
      ? {
          paymasterService: {
            url: 'https://api.developer.coinbase.com/rpc/v1/base/YOUR_KEY',
          },
        }
      : undefined,
  });
  
  console.log('Transaction batch ID:', id);
}
You can get your paymaster API key from Coinbase Developer Platform to sponsor gas fees for your users.
3

Explore Additional Methods and Capabilities

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.Once you have the provider, you can call Base Account RPC methods. See the full RPC methods reference for complete details.The next section lists the methods and capabilities that are not supported in Mini Apps yet.

Unsupported Methods and Capabilities

The following methods and capabilities are not yet supported in Mini Apps but will be added soon:
FeatureMethod/Capability
Sign in with Basewallet_connect
Sub accountswallet_getSubAccounts, wallet_addSubAccount
Spend permissionscoinbase_fetchPermissions, coinbase_fetchPermission
Profilesdatacallback
Signing typed datasignTypedData
Signing messageswallet_sign
All other standard Ethereum and Base Account RPC methods work as expected.
The above list is not exhaustive and may be updated in the future.

Additional Resources