Paying gas fees with native tokens like ETH remains the standard approach across most blockchains. It’s deeply integrated into the protocol and offers the most direct and compatible method for covering transaction costs.
Steps
1. Import required dependencies
import { createGelatoSmartWalletClient, native } from "@gelatonetwork/smartwallet";
import { gelato, kernel, safe } from "@gelatonetwork/smartwallet/accounts";
import { createWalletClient, createPublicClient, http, type Hex } from "viem";
import { generatePrivateKey, privateKeyToAccount } from "viem/accounts";
2. Setup Smart Account
You can set up a Smart Account as per your needs. In the case of Gelato, the Gelato Smart Account address will be the same as your EOA, enabling EIP-7702 features.
When using a Kernel Account, you have the option to use EIP-7702 and ERC-4337 together. Setting eip7702 parameter to true will make your EOA the sender address. However, if you want to utilize existing Kernel accounts only with ERC-4337 features, set it to false.
For a Safe Account, it defaults to the ERC-4337 standard. You can either use an already deployed Safe Account or create a new one, while enhancing the experience with Gelato’s best-in-class infrastructure.
Quickly get started by creating a wallet client using createWalletClient from viem with local account for your specified network. Checkout supported networks .
To send transactions with native gas payments, select Native as the payment method and ensure your account has enough native currency to cover the gas fees.
View example code implementing native gas payments using the Gelato Smart Wallet SDK .