registryUpdateProperties
registryUpdateProperties(
registryUri
,namespaceAuthorizationUri
,authorizationUri
,creatorAddress
,digest
,blob
):Promise
<IRegistryUpdate
>
Updates properties for an existing registry, including the registry URI, creator URI, digest, and optionally serialized and CBOR-encoded blob.
This function requires either a digest or a blob to update the registry properties. If a blob is provided without a digest, the digest will be computed from the serialized blob. The blob will be CBOR-encoded before dispatching to the blockchain.
If only digest is provided, it will be dispatched as-is into CORD Registry.
If both digest
and blob
are provided, the function will:
- Validate the
blob
for serialization. - Encode the
blob
in CBOR before dispatching it. - Use the existing
digest
as-is for the registry update process, without computing a new digest from theblob
.
Parameters
• registryUri: `registry:cord:${string}`
The URI of the registry to be updated.
• namespaceAuthorizationUri: `namespaceauth:cord:${string}`
The authorization URI for the namespace.
• authorizationUri: `registryauth:cord:${string}`
The authorization URI for the registry update.
• creatorAddress: string
The address of the creator initiating the registry update.
• digest: any
= null
An optional hex string representing the digest. If not provided, it will be computed from the blob.
• blob: null
| string
= null
An optional string representing the data to be stored in the registry.
Returns
Promise
<IRegistryUpdate
>
A promise that resolves to an object containing the updated properties of the registry, including the URI, creator URI, digest, blob, and namespace, registry authorization URIs.
Throws
If neither digest nor blob is provided, or if the digest is empty after processing.
Example
const updatedRegistryProperties = await registryUpdateProperties( 'registryUri', // registryUri 'authorizationUri', // authorizationUri '5F3s...', // creatorAddress null, // digest '{"key":"newValue"}' // blob);// updatedRegistryProperties will contain the updated registry properties.