Skip to content

isRegistryAuthorizationStored

isRegistryAuthorizationStored(authorizationUri): Promise<boolean>

Checks whether a registry authorization is stored in the CORD blockchain.

This function queries the chain for the existence of a registry authorization using the provided authorization URI. It returns true if the authorization exists; otherwise, it returns false.

Parameters

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

The URI of the registry authorization to check for existence.

Returns

Promise<boolean>

A promise that resolves to a boolean indicating whether the registry authorization exists.

Throws

If an error occurs while querying the registry storage.

Example

// Example: Checking if a registry authorization exists
const authorizationExists = await isRegistryAuthorizationStored('auth:cord:example_authorization_uri');
console.log('Authorization exists:', authorizationExists);

Source

registries/src/Registries.chain.ts:148