The gasLimitOverride capability allows apps to specify gas limits for individual calls within a
wallet_sendCalls batch. Gas limits can be partially specified — you can provide overrides for only the calls you have context about, and the wallet estimates gas for the rest. Apps often have more context about the gas requirements of their own contract calls than the wallet, making app-provided gas limits more accurate.Parameters
This is a call-level capability, meaning it is specified on individual calls within awallet_sendCalls batch rather than at the top level.
Hex-encoded gas limit for the call. Must be a non-zero value that does not exceed the block gas limit of the target chain.
Returns
The gasLimitOverride capability configuration.
Example usage
Error handling
| Code | Message | Description |
|---|---|---|
| -32602 | Invalid params | Gas limit is zero or exceeds the block gas limit of the target chain |
| 5700 | Capability required | Call includes gasLimitOverride but wallet doesn’t support it |
How it works
When a wallet receives calls withgasLimitOverride capabilities:
- The wallet uses the app-provided gas limit for that call’s portion of the batch gas limit.
- For calls without a
gasLimitOverride, the wallet estimates gas as usual. - The wallet may add additional gas to account for batch processing overhead (such as smart account execution or EIP-7702 delegation).
Use cases
Nondeterministic gas usage
Some contract calls have nondeterministic gas costs that are difficult for wallets to estimate accurately. Apps with deep knowledge of their contracts can provide better gas limits:Partial gas limit specification
You can specify gas limits for only the calls you have context about and let the wallet estimate the rest:Best practices
- Check capabilities first: Verify
gasLimitOverridesupport viawallet_getCapabilitiesbefore including it in calls - Use
optional: truefor compatibility: Mark the capability as optional if your app can function without it, so wallets that don’t support it can still process the batch - Provide accurate limits: Use gas limits based on your contract’s actual requirements — overly tight limits cause reverts, overly generous limits waste block space
- Let the wallet handle overhead: Only specify gas for the call itself. The wallet accounts for batch processing overhead separately
Related capabilities
- atomic - Use with atomic batch transactions
- paymasterService - Combine with sponsored transactions