Function installModules

  • Installs multiple modules on a given smart account.

    Type Parameters

    • TSmartAccount extends undefined | object & Assign_<SmartAccountImplementation<Abi, EntryPointVersion, object>, {
          address: `0x${string}`;
          getNonce: ((parameters?) => Promise<bigint>);
          isDeployed: (() => Promise<boolean>);
          type: "smart";
      }> & {
          address: `0x${string}`;
          getNonce: ((parameters?) => Promise<bigint>);
          isDeployed: (() => Promise<boolean>);
          type: "smart";
      }

    Parameters

    • client: Client<Transport, undefined | Chain, TSmartAccount>

      The client instance.

    • parameters: InstallModulesParameters<TSmartAccount>

      Parameters including the smart account, modules to install, and optional gas settings.

    Returns Promise<Hex>

    The hash of the user operation as a hexadecimal string.

    Throws

    If the account is not found.

    Example

    import { installModules } from '@biconomy/sdk'

    const userOpHash = await installModules(nexusClient, {
    modules: [
    { type: 'executor', address: '0x...', context: '0x' },
    { type: 'validator', address: '0x...', context: '0x' }
    ]
    })
    console.log(userOpHash) // '0x...'