Skip to content
Alchemy Logo

serializeModuleEntity

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

Defined in: packages/smart-accounts/src/ma-v2/utils/account.ts:118

Serializes a module entity into a hexadecimal format by concatenating the module address and entity ID.

import { serializeModuleEntity } from "@alchemy/smart-accounts";
import { Address } from "viem";
 
const moduleAddress: Address = "0x1234";
const entityId: number = 1234;
 
const moduleEntityHex = serializeModuleEntity({
  moduleAddress,
  entityId,
});

ParameterTypeDescription

config

ModuleEntity

The module entity configuration containing the module address and entity ID

`0x${string}`

A hexadecimal string representation of the serialized module entity

Was this page helpful?