Skip to content

dispatchRevokeToChain

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

Dispatches a request to revoke 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 revokes 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 revoked.

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

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

The URI of the authorization to be revoked.

authorAccount: CordKeyringPair

The account that will authorize the revocation of the authorization.

Returns

Promise<object>

A promise that resolves to an object containing the revoked registry’s URI, 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: Revoking authorization for a registry
const revokedAuthorization = await dispatchRevokeToChain(
'registry:cord:example_registry_uri',
'auth:cord:example_namespace_authorization_uri',
'auth:cord:example_authorization_uri',
authorAccount
);
console.log('Revoked Registry URI:', revokedAuthorization.uri);

Source

registries/src/Registries.chain.ts:350