Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

paymasters

Custom paymaster configuration for fully sponsoring gas fees on different blockchain networks.

Type: Record<number, { url: string; context?: Record<string, unknown> }> Required: No Default: undefined

Usage

With Wagmi (Recommended)

import { jaw } from '@jaw.id/wagmi';
 
const connector = jaw({
  apiKey: 'your-api-key',
  paymasters: {
    1: { url: 'https://paymaster.example.com/mainnet' },
    8453: {
            url: 'https://paymaster.example.com/base',
            context: { sponsorshipPolicyId: 'sp_my_policy' }
          },
  },
});

With Provider Directly

import { JAW } from '@jaw.id/core';
 
const jaw = JAW.create({
  apiKey: 'your-api-key',
  paymasters: {
    1: { url: 'https://paymaster.example.com/mainnet' },
    8453: {
            url: 'https://paymaster.example.com/base',
            context: { sponsorshipPolicyId: 'sp_my_policy' }
          },
  },
});

Description

Paymasters are services that sponsor transaction gas fees, enabling gasless transactions for your users. The paymasters configuration allows you to specify custom paymaster endpoints and context for each supported network.

Benefits:
  • Gasless Transactions: Users don't need native tokens to pay gas
  • Better UX: Remove friction from onboarding
  • Flexible Sponsorship: Control which transactions to sponsor via context/policies
  • Cost Management: Use your own paymaster infrastructure

Sponsorship Levels

You can configure sponsorship at two levels:

Global (SDK Config)

Configure paymasters in the SDK initialization to sponsor all transactions by default:

const connector = jaw({
  apiKey: 'your-api-key',
  paymasters: {
    8453: { url: 'https://paymaster.example.com/base' },
  },
});

Per-Call Override

Override or specify paymasters for individual transactions using EIP-5792 capabilities:

await provider.request({
  method: 'wallet_sendCalls',
  params: [{
    calls: [{ to: '0x...', value: '0x0', data: '0x...' }],
    capabilities: {
      paymasterService: {
        url: 'https://different-paymaster.com',
        context: { sponsorshipPolicyId: 'special-policy' }
      }
    }
  }]
});

Priority: Per-call capabilities.paymasterService > Global paymasters config > No sponsorship

Important Requirements

EntryPoint Version

JAW SDK only supports EntryPoint v0.8 (ERC-4337 v0.8). Your paymaster service must be compatible with:

Compatible Paymaster Providers

Works with any EIP-7677 compliant paymaster that supports EntryPoint v0.8:

Configuration Format

paymasters: {
  [chainId: number]: {
    url: string;                        // Paymaster service URL (required)
    context?: Record<string, unknown>;  // Additional context sent with requests (optional)
  }
}

Properties

PropertyTypeRequiredDescription
urlstringYesThe paymaster service endpoint URL
contextRecord<string, unknown>NoAdditional context passed to the paymaster (e.g., sponsorship policy ID)

Examples

Basic Configuration

import { jaw } from '@jaw.id/wagmi';
 
const connector = jaw({
  apiKey: 'your-api-key',
  paymasters: {
    8453: { url: 'https://paymaster.etherspot.io/base' },
  },
});

With Sponsorship Policy

import { jaw } from '@jaw.id/wagmi';
 
const connector = jaw({
  apiKey: 'your-api-key',
  paymasters: {
    8453: {
      url: 'https://paymaster.etherspot.io/base',
      context: {
        sponsorshipPolicyId: 'sp_my_policy_id'
      }
    },
  },
});

Multiple Networks

import { jaw } from '@jaw.id/wagmi';
 
const connector = jaw({
  apiKey: 'your-api-key',
  paymasters: {
    1: { url: 'https://pm.etherspot.io/eth' },         // Ethereum Mainnet
    10: { url: 'https://pm.etherspot.io/op' },         // Optimism
    8453: { url: 'https://pm.etherspot.io/base' },     // Base
    42161: { url: 'https://pm.etherspot.io/arb' },     // Arbitrum
    84532: {
      url: 'https://api.pimlico.io/v2/84532/rpc?apikey=YOUR_API_KEY',        // Base Sepolia
      context: { sponsorshipPolicyId: 'sp_test_policy' }
    },
  },
});

Paymaster Services

Recommended Provider

Other Compatible Providers

Ensure any provider you use supports:

  • EntryPoint v0.8
  • EIP-7677 Paymaster Web Service Capability

Related