Overview
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
InkSepolia
, but you can easily switch to other supported networks. Check available networks inconstants/chainConfig.ts
and update the example file accordingly by changing the Network name.
Setup Instructions
Clone the Repository
Set Up Environment Variables
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.
Install Dependencies
Run Example Use Cases
Sponsored Transactions:
ERC20 Gas Payments:
To obtain WETH as the gas token on InkSepolia, run pnpm getWeth
—this will wrap 0.1 ETH into 0.1 WETH. Once completed, you can proceed by running the following command as an example.
Native Gas Payments:
Estimate Gas:
Kernel Smart Account Transactions:
Safe Smart Account Transactions:
Not using templates? Prefer a step-by-step approach? Up next: How-To Guides for implementing the Smart Wallet SDK use cases step-by-step.
Installation
Gelato Smart Wallets SDK
Check out the NPM package for the Gelato Smart Wallets SDK.
Depending on your target use case, choose from the guides below that best match your desired destination or integration flow.
- Creating Sponsor API Keys : Create a sponsor API key to allow sponsoring gas fees for users.
- Sponsoring gas for users : A third-party sponsor (1Balance) 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.