Template & Examples
Smart Wallet SDK Examples
Check out the full example code for implementing the Smart Wallet SDK.
Note: The examples are pre-configured for baseSepolia
, but you can easily switch to other supported networks.
Setup Instructions
1
Clone the Repository
2
Set Up Environment Variables
3
Generate a API Key
Create a API Key using the Gelato App.
Paste the key into your
.env
file. Check out the How-To Guides here.4
Add Your Private Key (Optional)
You can either include your private key in the
.env
file, or leave it empty—example files will automatically generate a random private key if none is provided.5
Install Dependencies
6
Run Example Use Cases
Sponsored Transactions:ERC20 Gas Payments:Native Gas Payments:Estimate Gas:Kernel Smart Account Transactions:Safe Smart Account Transactions:
Installation
Gelato Smart Wallets SDK
Check out the NPM package for the Gelato Smart Wallets SDK.
- Creating API Keys : Create a API key to kickstart your Smart Wallet journey.
- Sponsoring gas for users : A third-party sponsor (Gas Tank) covers the gas fees, allowing users to transact without holding any native tokens.
- Allowing users to pay gas with their ERC20 tokens : Users can pay gas fees using supported ERC-20 tokens, eliminating the need to acquire native tokens.
- Allowing users to pay gas with their Native tokens : Users cover gas fees directly using native tokens like ETH—the default and most widely supported method.
- Using Dynamic/Privy as wallet providers with React SDK : Users can interact with applications using email, phone, or social logins through wallet providers like Dynamic and Privy, enjoying full dApp functionality with a seamless Web2-like experience.
- Estimating Gas before sending transactions on-chain : Developers can simulate transactions to estimate gas costs in advance, improving reliability and user experience.