Skip to content

@ecp.eth/sdk


@ecp.eth/sdk / comments / createMetadataEntry

Function: createMetadataEntry()

function createMetadataEntry(
   keyString, 
   valueType, 
   value): MetadataEntry;

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

Creates a metadata entry from a key-value pair with explicit type specification

Parameters

keyString

string

The key string e.g. "status", "author", etc.

valueType

MetadataType

The metadata type (string, bool, uint256, etc.)

value

The value (string, boolean, number, bigint, or JsonObject). Will be encoded to the appropriate type.

string | number | bigint | boolean | JsonObject | Uint8Array<ArrayBufferLike>

Returns

MetadataEntry

The MetadataEntry