Gelato
  • Introduction
    • Gelato, The Web3 Cloud Platform
  • Smart Wallets
    • Introduction
      • Understanding EIP-7702
      • Understanding ERC-4337
      • ERC-4337 vs EIP-7702
    • Templates & Examples
    • How-To Guides
      • Create a Sponsor API Key
      • Sponsor gas for your users
      • Allow users to pay gas with erc20
      • Allow users to pay gas with native
      • Create Dynamic's Environment Id
      • Use Dynamic/Privy signers with React SDK
      • Estimate Gas for your transactions
    • React SDK
    • Demo
    • Supported Networks
  • Rollup As A Service
    • Introduction
    • Rollup Stacks
      • Arbitrum Orbit
        • Run a Full Orbit Node
      • OP Stack
        • Run OP Node
    • Deploy your Rollup
    • Customization
      • Data Availability
        • Celestia
        • Avail
        • Eigen DA
      • Custom Gas Token
      • Marketplace
        • Gelato Services
        • Data Indexers
        • Block Explorers
        • Oracles
        • Bridges
        • Account Abstraction
        • On & Off-ramp
        • Community
        • Identity & KYC
        • Others
      • Verifier Node Package
    • Public Testnet
  • RPC Nodes
    • Introduction
    • Compute Units
    • Using RPC Nodes
    • Supported Networks
    • Pricing and Plans
    • FAQ
  • Web3 Services
    • Web3 Functions
      • Understanding Web3 Functions
        • Trigger Types
        • Typescript Function
        • Solidity Function
        • Automated Transactions
      • Security Considerations
      • Template & Use Cases
      • Quick Start
        • Writing Typescript Functions
          • Event Trigger
          • Private Typescript Functions
          • Callbacks
        • Test, Deploy & Run Typescript functions
        • Writing Solidity Functions
        • Test, Deploy & Run Solidity Functions
        • Initiate an Automated Transaction
      • Create a Web3 Function Task
        • Using the UI
        • Using the Safe App
        • Using a Smart Contract
        • Using the Automate SDK
      • Analytics & Monitoring
      • Supported Networks
      • Subscription & Payments
      • Legacy Automate Migration Guide
    • Relay
      • What is Relaying?
      • Security Considerations
        • ERC-2771 Delegatecall Vulnerability
      • Templates
      • Quick Start
        • Sponsored Calls
        • Non-Sponsored Calls
      • ERC-2771 (recommended)
        • SponsoredCallERC2771
        • CallWithSyncFeeERC2771
          • Relay Context Contracts ERC2771
      • Non-ERC-2771
        • SponsoredCall
        • CallWithSyncFee
          • Relay Context Contracts
      • Relay API
      • Gelato's Fee Oracle
      • Tracking your Relay Request
      • Supported Networks
      • Subscriptions and Payments
        • 1Balance & Relay
        • SyncFee Payment Tokens
        • Relay Pricing
      • ERC2771 Migration Guide
    • VRF
      • Understanding VRF
      • How does Gelato VRF Work?
      • Security Considerations
      • Template
      • Quick Start
      • Create a VRF Task
        • Create a Fallback VRF
        • Migrating from Chainlink VRF
      • Supported Networks
      • Pricing & Rate Limits
    • Oracles
      • Understanding Gelato Oracles
      • Quick Start
      • Data Providers
        • Stork
        • Choas Labs
      • Migrating from Chainlink Oracles
      • Available Price Feeds
      • Supported Networks
      • Pricing & Rate Limits
    • Account Abstraction
      • Understanding ERC-4337
      • Introduction to Gelato Bundler
      • Templates & Examples
      • Quick Start
      • Supported Networks
      • Bundler API Endpoints
        • eth_sendUserOperation
        • eth_estimateUserOperationGas
        • eth_getUserOperationByHash
        • eth_getUserOperationReceipt
        • eth_supportedEntryPoints
        • eth_maxPriorityFeePerGas
        • eth_chainId
    • 1Balance
      • 1Balance Alerts
      • Subscription Plans
      • Subscription Notifications
      • USDC Addresses
    • AI Agents
    • Teams
  • GELATO DAO
    • DAO & Token (GEL)
    • GEL Token Contracts
    • Governance Process
  • Social Media
Powered by GitBook
On this page
  • Option 1: Sponsoring some/all of your users' gas
  • Option 2: Your users pay for for their own gas
  • Get Started
  • Relay-API
  • Relay-SDK
  1. Web3 Services
  2. Relay

Quick Start

Gelato Relay, as easy as 0xabc...

PreviousTemplatesNextSponsored Calls

Last updated 8 days ago

Please see for supported networks and contract addresses.

After reading this page:

  • You'll go through a decision process to understand the best way to integrate with Gelato Relay.

  • You'll know exactly which SDK/API method is for you.

Depending on your final destination, please click the corresponding link to find about your chosen SDK method:

Option 1: Sponsoring some/all of your users' gas

Sponsoring some of your user's gas:

Gelato Relay allows for partial sponsoring of gas based on certain conditions with developer-defined rules! For example, an app could sponsor user's gas based on a certain NFT being present in their wallet, or perhaps the NFT allows the user to have 10 gasless transactions a day. As a sponsor, you will able to customize with Gelato Relay's sponsor dashboard, coming soon™.

Sponsoring all of your user's gas:

  • Gelato handles user signature verification: go ahead and use where Gelato handles user signature verification for you. In this method, you can use 's _msgSender() to validate your relay calls on-chain. This will require an upgrade to your target contract for support, if it does not support it already.

  • You handle user signature verification: If your app workflow already handles its security in-house (i.e. use of user signatures, replay/reentrancy protection etc.) and you do want to sponsor all of your user's gas, you are ready to use Gelato Relay without any change to your existing smart contract logic. This will be using the method.

Option 2: Your users pay for for their own gas

Get Started

Relay-API

or

Relay-SDK

Installation

Note: please make sure to use version v4.0.0 and above.

npm install @gelatonetwork/relay-sdk
yarn add @gelatonetwork/relay-sdk

or

Now Supporting Viem: The Relay SDK has expanded its capabilities to include support for Viem, providing an alternative to Ethers.

npm install @gelatonetwork/relay-sdk-viem
yarn add @gelatonetwork/relay-sdk-viem

Dive in, and let's get started with using Relay's functionalities with Relay-SDK!

If you do not want to sponsor your user's gas, you will use the or SDK method with the payment method. This will require you to deploy a new contract (or upgrade if you can) to be compatible with Gelato's .

You can start using relay functionalities directly through the Relay API endpoints, including sending relay requests, performing oracle queries, and accessing debug endpoints for relay tasks. Learn more about using the Relay API .

@gelatonetwork/relay-sdk package v5 and above is using ethers v6. If you are using @gelatonetwork/relay-sdk v4 or below, please follow this migration guide to migrate from ethers v5 to v6. If you are using @gelatonetwork/relay-sdk v3 or contracts from the package @gelatonetwork/relay-context v2 please follow the to migrate to the new versions.

here
ERC2771 Migration guide
here
sponsoredCallERC2771
callWithSyncFeeERC2771
sponsoredCall
callWithSyncFee
sponsoredCallERC2771
ERC-2771
sponsoredCall
callWithSyncFeeERC2771
callWithSyncFee
relay context contracts
npm: @gelatonetwork/relay-sdknpm
SyncFee
npm: @gelatonetwork/relay-sdk-viemnpm
ERC2771Context
Logo
Logo