Skip to content

dispatchReinstateToChain

dispatchReinstateToChain(registryUri, namespaceAuthorizationUri, authorizationUri, authorAccount): Promise<object>

Dispatches a request to reinstate authorization for 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 reinstates the specified authorization and submits the transaction to the chain.

Parameters

registryUri: `registry:cord:${string}`

The URI of the registry for which the authorization is to be reinstated.

namespaceAuthorizationUri: `namespaceauth:cord:${string}`

authorizationUri: `registryauth:cord:${string}`

The URI of the authorization to be reinstated.

authorAccount: CordKeyringPair

The account that will authorize the reinstatement of the authorization.

Returns

Promise<object>

A promise that resolves to an object containing the reinstated registry’s URIs, namespace and 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: Reinstate authorization for a registry
const reinstatedAuthorization = await dispatchReinstateToChain(
'registry:cord:example_registry_uri',
'auth:cord:example_namespace_authorization_uri',
'auth:cord:example_authorization_uri',
authorAccount
);
console.log('Reinstated Registry URI:', reinstatedAuthorization.uri);

Source

registries/src/Registries.chain.ts:421