Function toSmartSessionsValidator

  • Creates a Smart Sessions module for a modular smart account.

    This function sets up a Smart Sessions module with the specified parameters, including session mode, permission ID, and session data.

    Parameters

    Returns SmartSessionModule

    A Module object representing the created Smart Sessions module.

    Example

    const smartSessionsModule = toSmartSessionsValidator({
    account: mySmartAccount,
    signer: mySigner,
    moduleData: {
    permissionId: '0x1234...',
    mode: SmartSessionMode.USE,
    enableSessionData: '0x5678...'
    }
    });

    Remarks

    • The function generates stub signatures and can sign user operation hashes.
    • It uses the SmartSession address from the predefined addresses.
    • The default session mode is USE if not specified.