Skip to main content

Overview

This guide provides a comprehensive, step-by-step tutorial for integrating thirdweb’s Account Abstraction SDK on Sei. By the end of this guide, you will understand how to create seamless wallet connectivity with social logins and build decentralized applications with sponsored gas transactions.

What This Guide Covers

  • Core concepts and benefits for user experience
  • Creating a React application with thirdweb SDK and Vite
  • Setting up social logins and gasless transactions
  • Interacting with smart contracts

Prerequisites

Before starting, ensure you have:
  • Node.js v18+ installed
  • Basic knowledge of React and TypeScript
  • A thirdweb account with API key from thirdweb Dashboard
  • A deployed smart contract on SEI (we’ll use a simple Storage contract)
For Mainnet: An active thirdweb Pay As You Go subscription ($5/month minimum) is required for gas sponsorship on mainnet.

What is Account Abstraction?

Account Abstraction (AA) is a paradigm that transforms how users interact with blockchain applications. Instead of traditional externally-owned accounts (EOAs), users get smart contract wallets that enable advanced features.

Core Concepts

  • Smart Wallets: Contract-based accounts with programmable logic
  • Gas Sponsorship: Dapps pay transaction fees on behalf of users
  • Social Recovery: Alternative authentication methods beyond private keys
  • Batch Transactions: Multiple operations in a single transaction

Network Information

SEI Mainnet Configuration

  • Network Name: SEI EVM
  • Chain ID: 1329
  • Public RPC URL: https://evm-rpc.sei-apis.com
  • Explorer: https://seiscan.io/
  • Currency: SEI
  • thirdweb RPC: https://1329.rpc.thirdweb.com/{YOUR_CLIENT_ID}

Step 1: Deploy a Storage Contract

Before integrating the SDK, deploy a simple Storage contract on SEI. This contract will store and retrieve a number.

Storage Contract (Solidity)

Storage.sol
Deploy this contract using Remix on Sei. Note down the contract address - you’ll need it in the code.

Step 2: Project Setup

Create a New Project

Install Dependencies

Configure Environment Variables

Create a .env file in your project root:
.env
Get your Client ID from thirdweb Dashboard → Settings → API Keys.

Enable Gas Sponsorship

If you want to sponsor gas on mainnet:
  1. Go to thirdweb Dashboard Billing
  2. Subscribe to the Pay As You Go plan ($5/month)
  3. Without this, sponsored transactions will fail on mainnet

Step 3: Configure thirdweb Client

Create src/client.ts:
src/client.ts

Step 4: Smart Contract Integration

Replace src/App.tsx:
src/App.tsx

Understanding Key Components

Step 5: Package Configuration

Ensure your package.json includes:
package.json

Step 6: Run the Application

Start Development Server

Test the Application

  1. Open your browser and navigate to http://localhost:5173
  2. Click “Connect to Sei Network”
  3. Choose your preferred login method (Google, email, etc.)
  4. A smart wallet is automatically created for you (no gas!)
  5. After connecting, you’ll see three interaction buttons
  6. Try storing number 37 or a custom number
  7. Retrieve the stored value - all transactions are gasless!
  8. Monitor the browser console for: - Transaction hashes - Error messages - Connection status - Smart contract interactions
Gas fees are automatically sponsored when using Account Abstraction, so users don’t need SEI tokens to interact with the contract.

Step 7: Done!

You’ve successfully integrated thirdweb’s Account Abstraction SDK with Sei! Users can now connect with social logins and interact with your contracts without needing to hold SEI tokens for gas.

What You’ve Accomplished

  • Created a React application with thirdweb SDK v5
  • Configured Account Abstraction for SEI network
  • Implemented social login authentication
  • Deployed gasless transaction capabilities
  • Built contract interaction interfaces
  • Learned error handling for web3 applications

Troubleshooting

Common Issues and Solutions

Network Connection Issues

If the RPC endpoint is not responding:
  1. Verify your Client ID is active
  2. Check internet connectivity
  3. Try using the public RPC: https://evm-rpc.sei-apis.com

Resources