Skip to main content
Enable gasless transactions for users by configuring paymasters with your EIP-4337 provider.

Prerequisites

Setup Smart Account Client

Gas Sponsorship Configuration

Gas sponsorship is typically configured during client setup. Here’s how each provider enables it:
Gas sponsorship is enabled via the policyId parameter from your Alchemy dashboard.
import { createModularAccountV2Client } from "@account-kit/smart-contracts";
import { alchemy, sepolia } from "@account-kit/infra";
import { WalletClientSigner } from "@aa-sdk/core";

const client = await createModularAccountV2Client({
  transport: alchemy({ apiKey: ALCHEMY_API_KEY }),
  chain: sepolia,
  signer,
  policyId: GAS_POLICY_ID,
});

const userOpHash = await client.sendUserOperation({
  uo: {
    target: "0x...",
    data: "0x",
    value: 0n,
  },
});

const hash = await client.waitForUserOperationTransaction(userOpHash);
Create a gas policy in the Alchemy Dashboard under Account Kit → Gas Manager.

Key Points

  • Configuration at setup - Gas sponsorship is configured when creating the client
  • Automatic sponsorship - Once configured, transactions are automatically sponsored
  • No ETH required - Users don’t need ETH for gas fees
  • Provider limits - Check your provider dashboard for sponsorship limits and policies
  • Smart wallet deployment - First transaction may deploy the smart wallet (also sponsored)

Next Steps