Skip to main content
Gelato is deprecating the Smart Wallet SDK (@gelatonetwork/smartwallet) in favor of the new Gasless SDK (@gelatocloud/gasless). The old prepareCalls and sendPreparedCalls methods will no longer be available. Migrate to the Gasless SDK which supports Kernel smart accounts with EIP-7702 using ZeroDev SDK.

What’s Being Deprecated?

The following patterns from the Smart Wallet SDK will no longer be supported:
  • @gelatonetwork/smartwallet package
  • @gelatonetwork/smartwallet/accounts (kernel)
  • createGelatoSmartWalletClient function
  • prepareCalls and sendPreparedCalls methods
// DEPRECATED - Will no longer work
import {
  createGelatoSmartWalletClient,
  sponsored,
} from "@gelatonetwork/smartwallet";
import { kernel } from "@gelatonetwork/smartwallet/accounts";

const account = await kernel({
  owner: owner,
  client: publicClient,
  eip7702: true,
});

const swc = await createGelatoSmartWalletClient(client, {
  apiKey: API_KEY,
});

const preparedCalls = await swc.prepareCalls({
  payment: sponsored(),
  calls: [{ to, data, value: 0n }],
});

const response = await swc.sendPreparedCalls({ preparedCalls });

Migration Overview

Old (Smart Wallet SDK)New (Gasless SDK + ZeroDev)
@gelatonetwork/smartwallet@gelatocloud/gasless + @zerodev/sdk
kernel() from @gelatonetwork/smartwallet/accountscreateKernelAccount() from @zerodev/sdk
createGelatoSmartWalletClient()createGelatoBundlerClient()
prepareCalls() + sendPreparedCalls()sendUserOperation()
Event-based status (response.on('success'))Await-based (waitForUserOperationReceipt())

Migration Steps

1

Update Dependencies

Remove the old SDK and install the new packages:
# Remove old SDK
npm uninstall @gelatonetwork/smartwallet

# Install new SDKs
npm install @gelatocloud/gasless @zerodev/sdk viem
2

Update Imports

Before (Smart Wallet SDK):
import {
  createGelatoSmartWalletClient,
  type GelatoTaskStatus,
  sponsored,
} from "@gelatonetwork/smartwallet";
import { kernel } from "@gelatonetwork/smartwallet/accounts";
After (Gasless SDK + ZeroDev):
import { createGelatoBundlerClient, sponsored } from "@gelatocloud/gasless";
import { createKernelAccount } from "@zerodev/sdk";
import { KERNEL_V3_3 } from "@zerodev/sdk/constants";
import { entryPoint07Address } from "viem/account-abstraction";
3

Update Account Creation

Before (Smart Wallet SDK):
import { kernel } from "@gelatonetwork/smartwallet/accounts";

const account = await kernel({
  owner: owner,
  client: publicClient,
  eip7702: true,
});
After (ZeroDev SDK with EIP-7702):
import { createKernelAccount } from "@zerodev/sdk";
import { KERNEL_V3_3 } from "@zerodev/sdk/constants";
import { entryPoint07Address } from "viem/account-abstraction";

const account = await createKernelAccount(client, {
  entryPoint: {
    address: entryPoint07Address,
    version: "0.7",
  },
  kernelVersion: KERNEL_V3_3,
  eip7702Account: owner,
});
4

Update Client Initialization

Before (Smart Wallet SDK):
const client = createWalletClient({
  account,
  chain: chain,
  transport: http(),
});

const swc = await createGelatoSmartWalletClient(client, {
  apiKey: API_KEY,
});
After (Gasless SDK Bundler Client):
const bundler = await createGelatoBundlerClient({
  account,
  apiKey: GELATO_API_KEY,
  client,
  payment: sponsored(),
});
5

Update Transaction Sending

Before (prepareCalls + sendPreparedCalls with events):
const preparedCalls = await swc.prepareCalls({
  payment: sponsored(),
  calls: [
    {
      to: CONTRACT_ADDRESS,
      data: callData,
      value: 0n,
    },
  ],
});

const response = await swc.sendPreparedCalls({
  preparedCalls,
});

console.log(`Your Gelato id is: ${response.id}`);

// Event-based status handling
response.on("success", (status: GelatoTaskStatus) => {
  console.log(`Transaction hash: ${status.transactionHash}`);
});
response.on("error", (error: Error) => {
  console.error(`Transaction failed: ${error.message}`);
});
After (sendUserOperation with EIP-7702 authorization):
// Get EIP-7702 authorization if needed (first transaction only)
const authorization = await account.eip7702Authorization?.();

// Send the user operation
const hash = await bundler.sendUserOperation({
  calls: [
    {
      to: CONTRACT_ADDRESS,
      data: callData,
    },
  ],
  authorization,
});

console.log(`User operation hash: ${hash}`);

// Wait for receipt
const { receipt } = await bundler.waitForUserOperationReceipt({ hash });
console.log(`Transaction hash: ${receipt.transactionHash}`);
6

Update Batching Transactions

Batching works similarly - just pass multiple calls:Before:
const preparedCalls = await swc.prepareCalls({
  payment: sponsored(),
  calls: [
    { to: token1, data: approveData, value: 0n },
    { to: swap, data: swapData, value: 0n },
    { to: token2, data: transferData, value: 0n }
  ],
});
const response = await swc.sendPreparedCalls({ preparedCalls });
After:
const hash = await bundler.sendUserOperation({
  calls: [
    { to: token1, data: approveData },
    { to: swap, data: swapData },
    { to: token2, data: transferData }
  ],
  authorization,
});

const { receipt } = await bundler.waitForUserOperationReceipt({ hash });

Key Differences

Architecture

AspectSmart Wallet SDKGasless SDK + ZeroDev
Account Setupkernel({ eip7702: true })createKernelAccount({ eip7702Account })
ClientcreateGelatoSmartWalletClientcreateGelatoBundlerClient
SendingprepareCalls + sendPreparedCallssendUserOperation
Status HandlingEvent-based (.on('success'))Await-based (waitForUserOperationReceipt)
EIP-7702 AuthAutomaticExplicit via eip7702Authorization()

EIP-7702 Authorization

The new SDK requires explicit handling of EIP-7702 authorization for the first transaction:
// ZeroDev SDK automatically checks if EOA needs authorization
const authorization = await account.eip7702Authorization?.();

// Pass authorization with the user operation (only needed once)
const hash = await bundler.sendUserOperation({
  calls: [...],
  authorization, // undefined if already delegated
});

Status Handling

Before (Event-based):
response.on("success", (status: GelatoTaskStatus) => {
  console.log(`Hash: ${status.transactionHash}`);
});
response.on("error", (error: Error) => {
  console.error(`Failed: ${error.message}`);
});
After (Await-based):
const hash = await bundler.sendUserOperation({ calls, authorization });
const { receipt } = await bundler.waitForUserOperationReceipt({ hash });
console.log(`Hash: ${receipt.transactionHash}`);

Payment Methods

Both use sponsored() - but it’s configured at client creation in the new SDK:
// New SDK: payment configured at client creation
const bundler = await createGelatoBundlerClient({
  account,
  apiKey: GELATO_API_KEY,
  client,
  payment: sponsored(), // Configured here
});

Complete Migration Example

import {
  createGelatoSmartWalletClient,
  type GelatoTaskStatus,
  sponsored,
} from "@gelatonetwork/smartwallet";
import {
  http,
  type Hex,
  createWalletClient,
  createPublicClient,
} from "viem";
import { privateKeyToAccount } from "viem/accounts";
import { kernel } from "@gelatonetwork/smartwallet/accounts";
import { baseSepolia } from "viem/chains";

const API_KEY = process.env.GELATO_API_KEY as string;
const privateKey = process.env.PRIVATE_KEY as Hex;
const owner = privateKeyToAccount(privateKey);

const publicClient = createPublicClient({
  chain: baseSepolia,
  transport: http(),
});

(async () => {
  // Create Kernel account with EIP-7702
  const account = await kernel({
    owner: owner,
    client: publicClient,
    eip7702: true,
  });

  console.log("Account address:", account.address);

  const client = createWalletClient({
    account,
    chain: baseSepolia,
    transport: http(),
  });

  const swc = await createGelatoSmartWalletClient(client, {
    apiKey: API_KEY,
  });

  // Prepare calls
  const preparedCalls = await swc.prepareCalls({
    payment: sponsored(),
    calls: [{
      to: "0xEEeBe2F778AA186e88dCf2FEb8f8231565769C27",
      data: "0xd09de08a", // increment()
      value: 0n,
    }],
  });

  // Send prepared calls
  const response = await swc.sendPreparedCalls({ preparedCalls });

  console.log(`Gelato ID: ${response.id}`);

  // Event-based status handling
  response.on("success", (status: GelatoTaskStatus) => {
    console.log(`Transaction hash: ${status.transactionHash}`);
    process.exit(0);
  });
  response.on("error", (error: Error) => {
    console.error(`Failed: ${error.message}`);
    process.exit(1);
  });
})();

Need Help?

If you have questions about migrating from the Smart Wallet SDK, please reach out through our Discord or GitHub.