# installValidationActions

> Overview of the installValidationActions function

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

{/* This file is auto-generated by TypeDoc. Do not edit manually. */}

```ts
function installValidationActions<TTransport, TChain, TAccount>(
  client,
): InstallValidationActions<
  IsUndefined<TAccount> extends true ? undefined : ModularAccountV2
>;
```

Defined in: [packages/smart-accounts/src/ma-v2/decorators/installValidation.ts:95](https://github.com/alchemyplatform/aa-sdk/blob/v5.x.x/packages/smart-accounts/src/ma-v2/decorators/installValidation.ts#L95)

Provides validation installation and uninstallation encoding functionalities for a MA v2 client.

## Example

```ts
import { installValidationActions, SingleSignerValidationModule } from "@alchemy/smart-accounts";
import { Address } from "viem";

const client = (await createModularAccountV2Client({ ... })).extend(installValidationActions);
const sessionKeyAddress: Address = "0x1234";
const sessionKeyEntityId: number = 1;

const callData = await client.encodeInstallValidation({
  validationConfig: {
    moduleAddress: getDefaultSingleSignerValidationModuleAddress(client.chain),
    entityId: sessionKeyEntityId,
    isGlobal: true,
    isSignatureValidation: false,
    isUserOpValidation: true,
  },
  selectors: [],
  installData: SingleSignerValidationModule.encodeOnInstallData({
    entityId: sessionKeyEntityId,
    signer: sessionKeyAddress,
  }),
  hooks: [],
});

await client.sendUserOperation({ callData, account });
```

## Type Parameters

<table>
  <thead>
    <tr>
      <th align="left">Type Parameter</th>
      <th align="left">Default type</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `TTransport` *extends* [`Transport`](https://viem.sh)
      </td>

      <td>
        [`Transport`](https://viem.sh)
      </td>
    </tr>

    <tr>
      <td>
        `TChain` *extends* `undefined` | [`Chain`](https://viem.sh)
      </td>

      <td>
        `undefined` | [`Chain`](https://viem.sh)
      </td>
    </tr>

    <tr>
      <td>
        `TAccount` *extends* `undefined` | [`SmartAccount`](https://viem.sh)
      </td>

      <td>
        `undefined` | [`SmartAccount`](https://viem.sh)
      </td>
    </tr>

  </tbody>
</table>

## Parameters

<table>
  <thead>
    <tr>
      <th align="left">Parameter</th>
      <th align="left">Type</th>
      <th align="left">Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `client`
      </td>

      <td>
        [`Client`](https://viem.sh)\<`TTransport`, `TChain`, `TAccount`>
      </td>

      <td>
        The client instance which provides account functionality.
      </td>
    </tr>

  </tbody>
</table>

## Returns

[`InstallValidationActions`](../type-aliases/InstallValidationActions)\<[`IsUndefined`](https://viem.sh)\<`TAccount`> _extends_ `true` ? `undefined` : [`ModularAccountV2`](../type-aliases/ModularAccountV2)>

- An object containing `encodeInstallValidation` and `encodeUninstallValidation`.