Skip to content

createEntriesProperties

createEntriesProperties(registryId, tx_hash, blob): Promise<IRegistryEntry>

Constructs the properties required to create a registry entry in the CORD blockchain.

Prepares the data for a new registry entry, including the registry URI, transaction hash, and optional blob. If no tx_hash is provided, it computes one from the blob. The blob, if present, is serialized and encoded in CBOR format for chain dispatch.

Parameters

registryId: string

The id of the registry

tx_hash: any= null

The hash of the entry’s content, or null if computed from blob.

blob: null | string= null

The optional serialized data for the entry, or null.

Returns

Promise<IRegistryEntry>

A promise resolving to an IRegistryEntry object with the entry properties.

Throws

If neither tx_hash nor blob is provided, or if tx_hash is invalid.

Throws

If entry validation fails.

Example

const entry = await createEntriesProperties(
'2Lwed3xygo...',
null,
'{"key":"value"}'
);
console.log('✅ Entry Properties:', entry);

Source

entry/src/Entry.ts:111