0.0.7 • Published 2 years ago
@gnosischain/gasless-wallet v0.0.7
Gelato Gasless Wallet
Gelato's Gasless Wallet package is an account abstraction implementation that creates and uses EOA-owned Gnosis Safe Proxies, and relays the transactions using Gelato's 1Balance Service where the transactions can be sponsored by the Dapps.
- npm install
- npm run build
GaslessWallet is the main class where the developers can create smart contract wallets owned by their users' EOA and sponsor the transactions by using Gelato's 1Balance Service
Installation
yarn add @gnosischain/gasless-wallet
npm install @gnosischain/gasless-wallet
Usage
Imports
import {
GaslessWallet,
GaslessWalletConfig,
} from "@gnosischain/gasless-wallet";
import { ethers } from "ethers";
Initialization
const eoaProvider:
| ethers.providers.ExternalProvider
| ethers.providers.JsonRpcFetchFunc = ...
const gaslessWalletConfig: GaslessWalletConfig = {
apiKey: "1BALANCE_API_KEY",
};
const gaslessWallet = new GaslessWallet(eoaProvider, gaslessWalletConfig);
await gaslessWallet.init();
Get Gasless Wallet Contract Gnosis Safe Proxy Address
const gaslessWalletContractAddress = gaslessWallet.getAddress();
Helper Functions
const isGaslessWalletAlreadyDeployed = await gaslessWallet.isDeployed();
const isGaslessWalletAlreadyInitiated = gaslessWallet.isInitiated();
Sponsor Transaction
Sponsored Transaction that is sent through EOA's Gnosis Safe Proxy
const { taskId } = await gaslessWallet.sponsorTransaction(
TARGET_ADDRESS,
TX_DATA
);