Documentation Index
Fetch the complete documentation index at: https://docs.gelato.cloud/llms.txt
Use this file to discover all available pages before exploring further.
Turbo Relayer
Send gasless transactions directly to any contract. The relayer handles gas payment and transaction submission on your behalf.
Install Dependencies
npm install @gelatocloud/gasless viem
Initialize Relayer Client
import { createGelatoEvmRelayerClient } from '@gelatocloud/gasless';
const relayer = createGelatoEvmRelayerClient({
apiKey: process.env.GELATO_API_KEY,
testnet: true
});
Send Transaction
const id = await relayer.sendTransaction({
chainId: 84532, // Base Sepolia
data: '0xd09de08a',
to: '0xE27C1359cf02B49acC6474311Bd79d1f10b1f8De'
});
try {
const receipt = await relayer.waitForReceipt({ id });
console.log(`Transaction hash: ${receipt.transactionHash}`);
} catch (error) {
console.log(`Transaction failed: ${error.message}`);
}
Turbo Relayer with Smart Account
Enable smart account features on any EOA using EIP-7702. Batch multiple calls, use session keys, and maintain the same wallet address.
Install Dependencies
npm install @gelatocloud/gasless viem
Create Gelato Smart Account
import {
createGelatoSmartAccountClient,
toGelatoSmartAccount,
} from "@gelatocloud/gasless";
import { createPublicClient, http, type Hex } from "viem";
import { baseSepolia } from "viem/chains";
import { privateKeyToAccount, generatePrivateKey } from "viem/accounts";
const owner = privateKeyToAccount(
(process.env.PRIVATE_KEY ?? generatePrivateKey()) as Hex
);
const client = createPublicClient({
chain: baseSepolia,
transport: http(),
});
const account = toGelatoSmartAccount({
client,
owner,
});
Setup Relayer Client
const relayer = await createGelatoSmartAccountClient({
account,
apiKey: process.env.GELATO_API_KEY,
});
Send Transaction
const receipt = await relayer.sendTransactionSync({
calls: [
{
to: "0xE27C1359cf02B49acC6474311Bd79d1f10b1f8De",
data: "0xd09de08a",
},
],
});
console.log(`Transaction hash: ${receipt.transactionHash}`);
Examples Repository
Explore complete working examples in our GitHub repository:
Gasless Examples
Full examples for Turbo Relayer, Smart Accounts, and more.