@ecp.eth/sdk / comments / createCustomMetadataEntry
Function: createCustomMetadataEntry()
function createCustomMetadataEntry(
keyString,
valueType,
encodedValue): MetadataEntry;Defined in: packages/sdk/src/comments/metadata.ts:504
Creates a metadata entry with a custom type
Parameters
keyString
string
The key string e.g. "status", "author", etc.
valueType
The type string MetadataType e.g. "string", "uint256", etc.
encodedValue
`0x${string}`
The pre-hex-encoded value as hex. For example by using encodeStringValue, encodeBoolValue, encodeNumberValue, encodeJsonValue, etc.
Returns
The MetadataEntry
Example
const metadataEntry = createCustomMetadataEntry("status", "string", encodeStringValue("status"));
console.log(metadataEntry);
// {
// key: "0x0000000000000000000000000000000000000000000000000000000000000000",
// value: "0x0000000000000000000000000000000000000000000000000000000000000000",
// }