Base ERC-7579 Methods
installModule
Installs the module on the smart account.
Usage Exampleconst userOpReceipt: UserOpReceipt = await smartAccount.installModule({
    moduleAddress: K1_VALIDATOR,
    type: 'validator',
    data: encodePacked(["address"], [await smartAccount.getAddress()])
})- moduleAddress (Address, required)
- type (ModuleType, required)
- data (0x${string}| undefined, optional)
- Promise<UserOpReceipt>: A promise of UserOpReceipt
uninstallModule
Uninstalls the module of the smart account.
Usage Exampleawait smartAccount.uninstallModule(moduleAddress, ModuleType.Validation);- moduleAddress (Address, required)
- type (ModuleType, required)
- moduleSelector (0x${string}| undefined, optional) This will only be needed when uninstallingFallbackmodules
- data (0x${string}| undefined, optional)
- Promise<UserOpReceipt>: A promise of UserOpReceipt
isModuleInstalled
Checks if a module is installed on the smart account.
Usage Exampleconst isInstalled: boolean = await smartAccount.isModuleInstalled({
    type,
    moduleAddress
});- type (ModuleType, required)
- moduleAddress (Address, required)
- data (0x${string}| undefined, optional)
- Promise<boolean>: A promise of a boolean
getPreviousModule
Gets the pointer to the previously installed module based on given moduleAddress and type
const previousModule = await smartAccount.getPreviousModule({
    moduleAddress,
    type
});- moduleAddress (Address, required)
- type (ModuleType, required)
- Promise<{moduleAddress: Address; type: ModuleType}>: A promise of an object
getInstalledValidators
Gets the installed validators
Usage Exampleconst validators = await smartAccount.getInstalledValidators();- Promise<Address[]>: A promise of validator addresses
getInstalledExecutors
Gets the installed executors
Usage Exampleconst executors = await smartAccount.getInstalledExecutors();- Promise<Address[]>: A promise of executor addresses
getInstalledModules
Gets all the installed modules
Usage Exampleconst modules = await smartAccount.getInstalledModules();- Promise<Address[]>: A promise of module addresses
getActiveHook
Gets the active hook module
Usage Exampleconst hook = await smartAccount.getActiveHook();- Promise<Address>: A promise of a hook address
getFallbackBySelector
Gets the fallback module by the selector
Usage Exampleconst fallback = await smartAccount.getFallbackBySelector();- selector (Hex, optional) The fallback module selector, if not passed, the GENERIC_FALLBACK_SELECTOR will be used
- Promise<Address>: A promise of a fallback module address
supportsModule
Check if the smart account supports a module
Usage Exampleconst isSupported = await smartAccount.supportsModule(ModuleType.Hook);- type (ModuleType, required)
- Promise<boolean>: A promise of a boolean
sendTransactionWithExecutor
Sends a transaction using an active executor module.
Usage Exampleconst userOpReceipt: UserOpReceipt = await smartAccount.sendTransactionWithExecutor(
    [transaction], 
    ownedAccountAddress
)- manyOrOneTransactions (Transaction | Transaction[], required)
- ownedAccountAddress (Address, required)
- Promise<UserOpReceipt>: A promise of UserOpReceipt