Gasless Wallet
Gasless Wallet allows externally owned accounts (EOAs) to deploy their own smart contract wallet whilst ensuring the same address across EVM networks by using the CREATE2 opcode. This means that you can predict the contract address pre-deployment. Our Gasless Wallet SDK under the hood utilises one of the most secure and widespread smart contract wallets, Safe. This approach gives developers the flexibility to have their users' transactions relayed and sponsored with 1Balance without needing to update their existing contracts.
yarn add @gelatonetwork/gasless-wallet
or
npm install @gelatonetwork/gasless-wallet
class GaslessWallet
constructor(eoaProvider: EoaProvider, config: GaslessWalletConfig);
type EoaProvider =
| ethers.providers.ExternalProvider
| ethers.providers.JsonRpcFetchFunc;
type GaslessWalletConfig = {
apiKey: string;
}
apiKey
: an API key used to authenticate your sponsorship
init(): Promise<void>;
The init function should be invoked before using other methods as it sets up the instance for further processing.
getAddress(): string;
This function returns the address of the gasless wallet, regardless of whether the wallet on the chain has already been deployed or not.
sendTransaction(to: string, data: string, value?: BigNumberish): Promise<RelayResponse>;
This function relays the transaction data to the target address via the EOA's Safe Proxy, their gasless wallet. Therefore, the
msg.sender
is this gasless wallet. This transaction is sponsored via a 1Balance api key which is passed into the constructor of the GaslessWallet
class.to
: The target addressdata
: The transaction datavalue
: Optional value for payable
isInitialized(): boolean;
This function returns whether the
init
function is already invoked or not.isDeployed(): Promise<boolean>;
This function returns whether the gasless wallet has already been deployed.
Last modified 4mo ago