This simple node script demonstrates how to use thirdweb to deploy and use Smart Wallets - ERC4337 smart contracts - using the Wallet SDK.
The script will:
- generate a personal wallet using LocalWallet
- connect to the corresponding smart wallet
- claim a ERC20 token using the thirdweb SDK
- create a scoped session key
- claim a ERC20 using the session key
- revoke the session key
yarn install
The script requires a thirdweb API key.
paste your thirdweb API secret key in your .env file:
THIRDWEB_SECRET_KEY={{your_secret_key}}
yarn dev
Full documentation at: https://portal.thirdweb.com/wallet/smart-wallet