registryUpdateHashProperties
registryUpdateHashProperties(
registryId,tx_hash,blob):Promise<IRegistryTxHashUpdate>
Generates properties to update an existing registry with a new transaction hash and optional blob.
This function requires either a transaction hash or a blob to generate the update properties. If a blob is provided without a transaction hash, the hash will be computed from the serialized blob. The blob will be CBOR-encoded before dispatching to the blockchain.
If only a transaction hash is provided, it will be dispatched as-is into the CORD Registry.
If both tx_hash and blob are provided, the function will:
- Validate the
blobfor serialization. - Encode the
blobin CBOR before dispatching it. - Use the existing
tx_hashas-is for the registry update process, without computing a new hash from theblob.
Parameters
Section titled “Parameters”• registryId: string
The Identifier of the registry to update (e.g., ‘2Lxygo…’).
• tx_hash: HexString
A hex string representing the new transaction hash.
• blob: null | string= null
An optional string representing the new data to be stored in the registry.
Returns
Section titled “Returns”Promise<IRegistryTxHashUpdate>
A promise that resolves to an object containing the registry identifier, transaction hash, and blob.
Throws
Section titled “Throws”If neither transaction hash nor blob is provided, or if the transaction hash is empty after processing.
Example
Section titled “Example”const updateProperties = await registryUpdateHashProperties( '2Lewf3xygo...', // registryId '0x456...', // tx_hash '{"key":"newValue"}' // blob);console.log(updateProperties);