# serializeHookConfig

> Overview of the serializeHookConfig function

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

```ts
function serializeHookConfig(config): `0x${string}`;
```

Defined in: [packages/smart-accounts/src/ma-v2/utils/hooks.ts:68](https://github.com/alchemyplatform/aa-sdk/blob/v5.x.x/packages/smart-accounts/src/ma-v2/utils/hooks.ts#L68)

Serializes a `HookConfig` object into a `Hex` format by encoding the hook type, presence of post/pre hooks, address, and entity ID.

## Example

```ts
import { type HookType, serializeHookConfig } from "@alchemy/smart-accounts";
import { Address } from "viem";

const moduleAddress: Address = "0x1234";
const entityId: number = 1234;
const hookType: HookType = HookType.Validation;
const hasPostHooks: boolean = false;
const hasPreHooks: boolean = true;

const hookConfigHex = serializeHookConfig({
  moduleAddress,
  entityId,
  hookType,
  hasPostHooks,
  hasPreHooks,
});
```

## Parameters

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

  <tbody>
    <tr>
      <td>
        `config`
      </td>

      <td>
        [`HookConfig`](../type-aliases/HookConfig)
      </td>

      <td>
        The hook configuration containing address, entity ID, hook type, and post/pre hook indicators
      </td>
    </tr>

  </tbody>
</table>

## Returns

`` `0x${string}` ``

The serialized hook configuration in hexadecimal format