Function getPreviousModule

  • Gets the address of the previous module of the same type as the given module.

    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

    Returns Promise<Hex>

    The address of the previous module, or the sentinel address if it's the first module.

    Throws

    If the account is not found.

    Throws

    If the module type is unknown or the module is not found.

    Example

    import { getPreviousModule } from '@biconomy/sdk'

    const previousModuleAddress = await getPreviousModule(nexusClient, {
    module: {
    type: 'validator',
    moduleAddress: '0x...',
    }
    })
    console.log(previousModuleAddress) // '0x...'