ModuleSDK
Modules
getSmartSessionsValidator

getSmartSessionsValidator

Get the smart sessions module object.

Usage

const module = getSmartSessionsValidator({
  sessions: [
    {
      sessionValidator: '0x1234...',
      sessionValidatorInitData: '0xabcd...',
      salt: toHex(toBytes('1', { size: 32 })),
      userOpPolicies: [],
      erc7739Policies: {
        allowedERC7739Content: [],
        erc1271Policies: [],
      },
      actions: [
        {
          actionTarget: '0x1234...',
          actionTargetSelector: '0x00112233',
          actionPolicies: [
            {
              policy: '0x1234...',
              initData: '0xabcd...',
            },
          ],
        },
      ],
      permitERC4337Paymaster: false,
    },
  ],
})

Parameters

sessions

List of sessions to enable in the smart sessions validator.

useRegistry (optional)

  • Type: boolean

Defaults to true. When installing the module during account creation, it could be the case that the account, such as Safe7579 or Nexus, installs the module before setting their trusted attesters on the Registry. In this case, the flag should be set to false.

hook (optional)

The address of the hook to use. This is only required for the Kernel account.

Returns

module

The smart sessions validator module object.