Quick Start
Users can directly interact with our bundler via API endpoints—enabling actions like sending UserOperations, estimating gas, and more. Learn more about how to use the bundler endpoints here.
Examples
Bundler API Examples
Checkout out our Bundler API Examples repository for a quick start.
- Clone the repository
- Install dependencies
How to use the Bundler API Endpoints?
There are various methods of payments that can be used with Gelato Bundler, lets go through them one by one.
1. Sponsoring gas with 1Balance
Gelato’s 1Balance is a powerful alternative to traditional onchain paymasters. It acts as a cross-chain gas tank, allowing you to sponsor gas fees across any supported EVM-compatible chain — using just a single balance.
Instead of maintaining balances on multiple chains, you only need to deposit funds in one place, and you’re ready to sponsor gas anywhere.
Important: When using Gelato Bundler for Sponsoring
Transactions with 1Balance
, both maxFeePerGas
and maxPriorityFeePerGas
are set to 0
.
This allows transaction fees to be accurately settled post-execution, rather than upfront via the EntryPoint.
To start sponsoring transactions with 1Balance, follow these steps:
- Create a Sponsor API Key : Check out our How-To Guide for detailed instructions on generating a sponsor API key.
- Use the API Key in Your Requests :
When calling Gelato API endpoints, make sure to include the
sponsorAPIKey
as a query parameter. - Configure the UserOperation Parameters :
- Set
maxFeePerGas
,maxPriorityFeePerGas
, andpreVerificationGas
to0
(0x0). This allows transaction fees to be settled after execution, rather than through the EntryPoint. - Leave all paymaster-related fields empty (i.e
paymaster
,paymasterData
,paymasterPostOpGasLimit
,paymasterVerificationGasLimit
).
- Set
When you pass the sponsorAPIKey
in the query params:
- The
eth_estimateUserOperationGas
endpoint will returnpreVerificationGas
as0
. - The
eth_getUserOperationGasPrice
endpoint will returnmaxFeePerGas
andmaxPriorityFeePerGas
as0
.
Check out the required parameters for sponsoring gas with 1Balance in the following scenarios:
2. Onchain Paymasters
This is the standard method of sponsoring gas or paying gas fees with ERC-20 tokens using onchain paymasters.
To use features like gas sponsorship, ERC-20 token payments, or other custom payment methods via onchain paymasters, follow these steps:
- Include Paymaster Fields : You must pass all required paymaster-related fields along with the standard UserOperation parameters.
sponsorAPIKey
is not required for this method- Fetch Gas Parameters from Gelato APIs :
Use the following endpoints to retrieve gas-related values:
maxFeePerGas
andmaxPriorityFeePerGas
can be fetched frometh_getUserOperationGasPrice
API Endpoint.callGasLimit
,verificationGasLimit
,preVerificationGas
&paymasterVerificationGasLimit
can be fetched frometh_estimateUserOperationGas
API Endpoint.
Check out the required parameters for on-chain paymasters in the following scenarios:
- Sponsored gas payments
- ERC-20 gas payments
3. Paying Gas with Native Tokens
This is the standard method where users pay gas fees directly using their native tokens (like ETH, MATIC, etc.).
To use this method, follow these steps:
- Keep Paymaster Fields Empty : Do not include any paymaster-related fields in the UserOperation parameters. This ensures the transaction is treated as a self-sponsored native token payment.
sponsorAPIKey
is not required for this method- Fetch Gas Parameters from Gelato APIs :
Use the following endpoints to retrieve gas-related values:
maxFeePerGas
andmaxPriorityFeePerGas
can be fetched frometh_getUserOperationGasPrice
API Endpoint.callGasLimit
,verificationGasLimit
,preVerificationGas
can be fetched frometh_estimateUserOperationGas
API Endpoint.
Check out the required parameters for paying gas with native tokens in the following scenarios:
Now that you’ve learned about the required parameters for different payment methods with the Gelato Bundler, let’s move on to the next step: exploring the Bundler API Endpoints.