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
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)
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
Create a .env file in your project root:
Get your Client ID from thirdweb Dashboard → Settings → API Keys.
If you want to sponsor gas on mainnet:
- Go to thirdweb Dashboard Billing
- Subscribe to the Pay As You Go plan ($5/month)
- Without this, sponsored transactions will fail on mainnet
Create src/client.ts:
Step 4: Smart Contract Integration
Replace src/App.tsx:
Understanding Key Components
Step 5: Package Configuration
Ensure your package.json includes:
Step 6: Run the Application
Start Development Server
Test the Application
- Open your browser and navigate to
http://localhost:5173
- Click “Connect to Sei Network”
- Choose your preferred login method (Google, email, etc.)
- A smart wallet is automatically created for you (no gas!)
- After connecting, you’ll see three interaction buttons
- Try storing number 37 or a custom number
- Retrieve the stored value - all transactions are gasless!
- 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:
- Verify your Client ID is active
- Check internet connectivity
- Try using the public RPC:
https://evm-rpc.sei-apis.com
Resources