Skip to content

@ecp.eth/sdk


@ecp.eth/sdk / comments / convertContractToRecordFormat

Function: convertContractToRecordFormat()

function convertContractToRecordFormat(metadataEntries, keyTypeMap?): MetadataRecord;

Defined in: packages/sdk/src/comments/metadata.ts:269

Converts from contract MetadataEntry array format to JS/SDK Record format Note: This requires knowledge of the original key string and type, which are lost in the contract format. This function attempts to reverse-engineer them from common patterns used in the codebase.

Parameters

metadataEntries

MetadataEntry[]

Array of MetadataEntry from contracts

keyTypeMap?

Record<`0x${string}`, { key: string; type: MetadataType; }>

Optional mapping of known keys to their original string and type

Returns

MetadataRecord

The metadata in Record format