Utilities

User Utilities

The User Utilities module provides methods for managing user profile addresses and collections within the Mirage system. It handles address generation for both individual user profiles and the overall profile collection.

Address Generation

getUserProfileAddress

Generates a unique token address for a specific user's profile.

getUserProfileAddress(
  userAddress: string
): string

Parameters:

  • userAddress: The address of the user as a string

Returns:

  • A string representing the generated token address for the user's profile

Example:

const userAddress = "0x123..."
const profileAddress = mirageClient.userProfile.getUserProfileAddress(userAddress)
console.log(profileAddress) // Returns token address string

getUserProfileCollectionAddress

Generates the address for the collection that contains all user profiles.

getUserProfileCollectionAddress(): string

Returns:

  • A string representing the object address for the user profile collection

Example:

const collectionAddress = mirageClient.userProfile.getUserProfileCollectionAddress()
console.log(collectionAddress) // Returns object address string