Skip to content

getUriForRegistry

getUriForRegistry(registryDigest, creatorAddress): Promise<RegistryDetails>

Generates URIs for a registry based on its digest and the creator’s address.

Parameters

registryDigest: HexString

The unique digest of the registry, used for identification.

creatorAddress: string

The address of the creator of the registry, represented as a string.

Returns

Promise<RegistryDetails>

A promise that resolves to an object containing the URIs:

  • uri: The unique URI for the registry.
  • authorizationUri: The URI for authorization related to the registry.

Throws

Throws an error if URI generation fails or if the API call encounters an issue.

Usage Example:

const registryDetails = await getUriForRegistry(registryDigest, creatorAddress);
console.log(registryDetails.uri); // Logs the registry URI
console.log(registryDetails.authorizationUri); // Logs the authorization URI

This function constructs a unique registry URI by combining the scale-encoded registry digest with the creator’s address, hashes them using Blake2, and formats the result into a URI structure. It also constructs an authorization URI to manage access and permissions related to the registry.

Source

registries/src/Registries.ts:230