Skip to content

Base ERC-7579 Methods

The Nexus Client provides several methods for interacting with User Operations and the blockchain:

installModule

Installs the module on the smart account.

Usage Example
const userOpReceipt: UserOpReceipt = await smartAccount.installModule({
    moduleAddress: K1_VALIDATOR,
    type: 'validator',
    data: encodePacked(["address"], [await smartAccount.getAddress()])
})
Parameters
  • moduleAddress (Address, required)
  • type (ModuleType, required)
  • data (0x${string} | undefined, optional)
Returns

uninstallModule

Uninstalls the module of the smart account.

Usage Example
await smartAccount.uninstallModule(moduleAddress, ModuleType.Validation);
Parameters
  • moduleAddress (Address, required)
  • type (ModuleType, required)
  • moduleSelector (0x${string} | undefined, optional) This will only be needed when uninstalling Fallback modules
  • data (0x${string} | undefined, optional)
Returns

isModuleInstalled

Checks if a module is installed on the smart account.

Usage Example
const isInstalled: boolean = await smartAccount.isModuleInstalled({
    type,
    moduleAddress
});
Parameters
  • type (ModuleType, required)
  • moduleAddress (Address, required)
  • data (0x${string} | undefined, optional)
Returns
  • Promise<boolean>: A promise of a boolean

getPreviousModule

Gets the pointer to the previously installed module based on given moduleAddress and type

Usage Example
const previousModule = await smartAccount.getPreviousModule({
    moduleAddress,
    type
});
Parameters
  • moduleAddress (Address, required)
  • type (ModuleType, required)
Returns
  • Promise<{moduleAddress: Address; type: ModuleType}>: A promise of an object

getInstalledValidators

Gets the installed validators

Usage Example
const validators = await smartAccount.getInstalledValidators();
Returns
  • Promise<Address[]>: A promise of validator addresses

getInstalledExecutors

Gets the installed executors

Usage Example
const executors = await smartAccount.getInstalledExecutors();
Returns
  • Promise<Address[]>: A promise of executor addresses

getInstalledModules

Gets all the installed modules

Usage Example
const modules = await smartAccount.getInstalledModules();
Returns
  • Promise<Address[]>: A promise of module addresses

getActiveHook

Gets the active hook module

Usage Example
const hook = await smartAccount.getActiveHook();
Returns
  • Promise<Address>: A promise of a hook address

getFallbackBySelector

Gets the fallback module by the selector

Usage Example
const fallback = await smartAccount.getFallbackBySelector();
Parameters Returns
  • Promise<Address>: A promise of a fallback module address

supportsModule

Check if the smart account supports a module

Usage Example
const isSupported = await smartAccount.supportsModule(ModuleType.Hook);
Parameters Returns
  • Promise<boolean>: A promise of a boolean

sendTransactionWithExecutor

Sends a transaction using an active executor module.

Usage Example
const userOpReceipt: UserOpReceipt = await smartAccount.sendTransactionWithExecutor(
    [transaction], 
    ownedAccountAddress
)
Parameters
  • manyOrOneTransactions (Transaction | Transaction[], required)
  • ownedAccountAddress (Address, required)
Returns

Transaction Methods

Preparation Methods

Status & Information Methods

Network Methods