package
0.0.121
Repository: https://github.com/layer-3/clearsync.git
Documentation: pkg.go.dev

# README

SmartWallet GoLang library

Overview

SmartWallet is a golang library that provides helper functions to user operations.

Features

This package introduces the following types and helper functionality:

  • Config - A struct that holds the configuration for the SmartWallet.
  • Type - an enum that represents the type of the wallet. Currently only ZeroDev Kernel v2.2, Biconomy v2.0 and eth-infinitism SimpleAccount v0.6 (still in progress) are supported.
  • IsAccountDeployed(swAddress) - a function that checks if the smart wallet is deployed.
  • GetAccountAddress(owner, index) - a function that calculates the address of the smart wallet.
  • GetInitCode(smartWalletConfig) - a function that returns the init code of the smart wallet.
  • Get<SmartWalletType>InitCode(...) - a function that returns the init code for the supported types of smart wallets.
  • GetInitCodeFromFactoryCallData(smartWalletConfig, factoryCallData) - a function that builds the init code from the smart wallet config and factory call data.
  • GetFactoryCallData(smartWalletConfig) - a function that returns the call data for the smart wallet factory.
  • Get<SmartWalletType>FactoryCallData(...) - a function that returns the factory call data for the supported types of smart wallets.

# Functions

No description provided by the author
No description provided by the author
GetKernelInitData returns the calldata needed call the factory to deploy a Biconomy smart account.
GetBiconomyInitCode returns the init code for a Biconomy smart account.
GetBiconomyInitCodeFromFactoryCallData returns the init code for a Biconomy smart account, given the Biconomy Factory calldata.
GetFactoryCallData returns the calldata for a smart wallet factory to deploy a wallet of a given type for a given smart wallet owner with a given wallet index.
GetInitCode builds the InitCode (defined in the ERC-4337) for a smart wallet.
GetInitCodeFromFactoryCallData builds the InitCode (defined in the ERC-4337) from a factory calldata, that contains the deployment data for the smart wallet.
GetKernelInitData returns the calldata needed call the factory to deploy a Zerodev Kernel smart account.
GetKernelInitCode the init code for a Zerodev Kernel smart account.
GetKernelInitCodeFromFactoryCallData returns the init code for a Zerodev Kernel smart account, given the Kernel Factory calldata.
No description provided by the author
UnpackCallsForKernel unpacks CallData for Zerodev Kernel smart wallet.
UnpackCallsForSimpleAccount unpacks CallData for SimpleAccount smart wallet.

# Variables

BiconomyType represents a type for BiconomyType Smart Account wallet.
ErrNoSmartWalletType is returned when no smart wallet type is specified.
ErrSmartWalletNotSupported is returned on attempt to perform some actions with an unsupported smart wallet type.
kernelExecuteABI is used to execute a transaction on Zerodev Kernel smart account.
KernelType represents a type for Zerodev KernelType wallet.
SimpleAccountType represents a smart wallet type for a Simple Account wallet.

# Structs

Call represents sufficient data to build a single transaction, which is a part of a user operation to be executed in a batch with other ones.
SmartWalletConfig represents the configuration for the smart wallet to be used with the client.
Type represents an enum for supported ERC-4337 smart wallets that can be used with the client to send user operations from.

# Type aliases

No description provided by the author