dispatchArchiveToChain
dispatchArchiveToChain(
registryUri
,namespaceAuthorizationUri
,authorizationUri
,authorAccount
):Promise
<object
>
Dispatches a request to archive a specified registry on the CORD blockchain.
This function checks if the specified registry exists. If it does not exist, an error is thrown. If the registry is found, it archives the specified registry and submits the transaction to the chain.
Parameters
• registryUri: `registry:cord:${string}`
The URI of the registry to be archived.
• namespaceAuthorizationUri: `namespaceauth:cord:${string}`
The URI of the namespace authorization associated with the registry.
• authorizationUri: `registryauth:cord:${string}`
The URI of the authorization associated with the registry.
• authorAccount: CordKeyringPair
The account that will authorize the archiving of the registry.
Returns
Promise
<object
>
A promise that resolves to an object containing the archived registry’s URI and namespace, registry authorization URIs.
authorizationUri
authorizationUri:
RegistryAuthorizationUri
uri
uri:
RegistryUri
Throws
If the registry does not exist or if an error occurs while dispatching to the chain.
Example
// Example: Archive a registryconst archivedRegistry = await dispatchArchiveToChain( 'registry:cord:example_registry_uri', 'auth:cord:example_namespace_authorization_uri', 'auth:cord:example_authorization_uri', authorAccount);console.log('Archived Registry URI:', archivedRegistry.uri);