Best Practices/Recommendations:
- We recommend users to rely on the exact values returned by the gas estimation endpoints rather than applying buffers, as the values provided by our bundler are designed to handle gas price volatility effectively.
- In case you want to estimate gas cost with some state overrides such as balance, code, etc., you can check our state override section.
Implementations
- Gelato Gasless SDK
- Viem
- Bundler API Endpoints
Create an API Key
Check out our How-To Guide for detailed instructions on generating an API key.
Get Fee Quote (with Token Payment)
Use
getUserOperationQuote() to get gas estimation plus fee in your payment token:State Overrides
While estimating gas, you can include state overrides such as balance, code, etc. to test the gas cost with different state values.- Gelato Gasless SDK / Viem
- Bundler API Endpoints
SDK Methods Reference
| Method | Description | Returns |
|---|---|---|
estimateUserOperationGas() | Standard ERC-4337 gas estimation | Gas limits only |
getUserOperationQuote() | Gas estimation + fee in payment token | Gas limits + fee |
getUserOperationGasPrice() | Current gas prices | maxFeePerGas, maxPriorityFeePerGas |