Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,21 @@ const config = {
}
```

### Bundler Headers

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new configuration is useful. Let's keep this change in draft until we release the ERC-4337 package version containing bundlerHeaders and paymasterHeaders, then verify the examples against that released version before moving it forward.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Converted to draft — will verify the examples against the released package version once the ERC-4337 release containing bundlerHeaders/paymasterHeaders ships, then mark ready.


The `bundlerHeaders` option sets HTTP headers sent on every request to the bundler. Use it for bundlers that authenticate with a header (e.g. `Authorization: Bearer <key>`). When omitted, no extra headers are sent, so bundlers that authenticate via the URL keep working unchanged.

**Type:** `Record<string, string>`
**Required:** No (optional)

**Example:**
```javascript
const config = {
bundlerUrl: 'https://bundler.example.com/rpc',
bundlerHeaders: { Authorization: 'Bearer YOUR_KEY' }
}
```

### Paymaster URL

The `paymasterUrl` option specifies the URL of the paymaster service that sponsors transaction fees using ERC-20 tokens or sponsorship policies.
Expand All @@ -169,6 +184,21 @@ const config = {
}
```

### Paymaster Headers

The `paymasterHeaders` option sets HTTP headers sent on every request to the paymaster. Use it for paymasters that authenticate with a header (e.g. `Authorization: Bearer <key>`). When omitted, no extra headers are sent, so paymasters that authenticate via the URL keep working unchanged.

**Type:** `Record<string, string>`
**Required:** No (optional)

**Example:**
```javascript
const config = {
paymasterUrl: 'https://paymaster.example.com/rpc',
paymasterHeaders: { Authorization: 'Bearer YOUR_KEY' }
}
```

### Paymaster Address

The `paymasterAddress` option specifies the address of the paymaster smart contract.
Expand Down Expand Up @@ -349,6 +379,37 @@ try {
}
```

## Authenticated Bundlers and Paymasters

Some providers authenticate requests with an HTTP header instead of an API key in the URL. Use `bundlerHeaders` and `paymasterHeaders` to attach the required headers.

### Openfort

[Openfort](https://www.openfort.io) serves an ERC-4337 bundler and an ERC-7677 paymaster from a single RPC endpoint per chain, authenticated with your project's publishable key as a bearer token. The same URL and header serve as both `bundlerUrl` and `paymasterUrl`, and gas is sponsored through an Openfort gas policy passed as `sponsorshipPolicyId`.

```javascript
const OPENFORT_RPC = 'https://api.openfort.io/rpc/11155111' // Sepolia
const OPENFORT_HEADERS = { Authorization: 'Bearer pk_test_your_publishable_key' }

const config = {
chainId: 11155111,
provider: 'https://sepolia.drpc.org',
safeModulesVersion: '0.3.0',

bundlerUrl: OPENFORT_RPC,
bundlerHeaders: OPENFORT_HEADERS,

isSponsored: true,
paymasterUrl: OPENFORT_RPC,
paymasterHeaders: OPENFORT_HEADERS,
sponsorshipPolicyId: 'pol_your_policy_id'
}
```

<Callout type="warn">
The account's EntryPoint version must match the version the provider's bundler serves. This module creates accounts on EntryPoint v0.7; a provider that only serves other versions (e.g. v0.6/v0.8/v0.9) rejects the operation with `-32602 Unsupported EntryPoint`. Confirm your provider serves v0.7 before using it with this module.
</Callout>

## Network-Specific Configurations

### Ethereum Mainnet
Expand Down