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?: { key?: bigint }) => Promise<bigint>;
                  isDeployed: () => Promise<boolean>;
                  type: "smart";
              },
          > & {
              address: `0x${string}`;
              getNonce: (parameters?: { key?: bigint }) => 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<`0x${string}`>

    The hash of the user operation as a hexadecimal string.

    If the account is not found.

    import { installModules } from '@biconomy/abstractjs'

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