Skip to content

registryAuthorizationProperties

registryAuthorizationProperties(registryUri, delegateAddress, permission, delegatorAddress): Promise<IRegistryAuthorization>

Creates properties for registry authorization, including URIs for the registry, delegate, and delegator, as well as the associated permission for the authorization.

This function constructs the authorization properties required for a delegate to act on behalf of a registrant in a specified registry. It generates the delegate and delegator URIs and retrieves the authorization URI for the specified registry.

Parameters

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

The URI of the registry for which authorization is being created.

delegateAddress: string

The address of the delegate who will be granted permissions.

permission: number

The type of permission being granted to the delegate in the registry.

delegatorAddress: string

The address of the delegator who is granting the permission to the delegate.

Returns

Promise<IRegistryAuthorization>

A promise that resolves to an object containing the properties of the registry authorization, including the registry URI, authorization URI, delegate URI, permission type, and delegator URI.

Throws

If any input parameter is malformed or invalid.

Example

const authorizationProperties = await registryAuthorizationProperties(
'registryUri123', // registryUri
'5F3s...', // delegateAddress
'delegate', // permission
'5F3x...' // delegatorAddress
);
// authorizationProperties will contain the created registry authorization properties.

Source

registries/src/Registries.ts:591