Documentation Index
Fetch the complete documentation index at: https://seilabs.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
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)
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
Step 2: Project Setup
Create a New Project
Install Dependencies
Configure Environment Variables
Create a.env file in your project root:
.env
Enable Gas Sponsorship
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
Step 3: Configure thirdweb Client
Createsrc/client.ts:
src/client.ts
Step 4: Smart Contract Integration
Replacesrc/App.tsx:
src/App.tsx
Understanding Key Components
| Component | Description |
|---|---|
ConnectButton | Pre-built UI component for wallet connection |
TransactionButton | Simplified transaction execution with loading states |
useActiveAccount | Hook to get currently connected account |
prepareContractCall | Prepares transaction for contract interaction |
inAppWallet | Smart wallet with social login capabilities |
Step 5: Package Configuration
Ensure yourpackage.json includes:
package.json
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 fees!)
- 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
| Error | Problem | Solution |
|---|---|---|
Client ID not found | Environment variable not loading | Check .env file and restart dev server |
Sponsored transactions failing | No active subscription | Subscribe to Pay As You Go plan |
Transaction reverted | Invalid contract address | Verify contract on Sei Explorer |
Cannot connect wallet | Network configuration issue | Check Client ID and RPC URL format |
Gas estimation failed | Contract method issue | Verify contract ABI and function signature |
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
- thirdweb Documentation: https://portal.thirdweb.com/
- thirdweb Dashboard: https://thirdweb.com/dashboard
- SEI Explorer: https://seiscan.io/
- Remix IDE: https://remix.ethereum.org/