use std::string;
use sui::package;
use sui::table;
use sage_utils::string_helpers;

Explore this module further in the Mover Registry: @sage/user

Structs

UserRegistry

Registry that contains a map to all Users.

public struct UserRegistry has key

Constants

Error code when a wallet address does not have an associated User.

const EAddressRecordDoesNotExist: u64 = 370;

Error code when a User name does not exist in the registry.

const EUsernameRecordDoesNotExist: u64 = 371;

Functions

assert_user_address_exists

Aborts with EAddressRecordDoesNotExist when a wallet address is not associated with a User.

public fun assert_user_address_exists(user_registry: &UserRegistry, wallet_address: address)

assert_user_name_exists

Aborts with EUsernameRecordDoesNotExist when the User name does not exist in the registry.

public fun assert_user_name_exists(user_registry: &UserRegistry, username: String)

get_owner_address_from_key

Returns the wallet address for the User with the specified lowercase name.

public fun get_owner_address_from_key(user_registry: &UserRegistry, user_key: String): address

get_owned_user_address_from_key

Returns the address for the OwnedUser with the specified lowercase name.

public fun get_owned_user_address_from_key(user_registry: &UserRegistry, user_key: String): address

get_shared_user_address_from_key

Returns the address for the SharedUser with the specified lowercase name.

public fun get_shared_user_address_from_key (user_registry: &UserRegistry, user_key: String): address

get_key_from_owner_address

Returns the User lowercase name associated with the wallet address.

public fun get_key_from_owner_address(user_registry: &UserRegistry, user_address: address): String

get_key_from_owned_user_address

Returns the User lowercase name associated with the OwnedUser address.

public fun get_key_from_owned_user_address(user_registry: &UserRegistry, user_address: address): String

get_key_from_shared_user_address

Returns the User lowercase name associated with the SharedUser address.

public fun get_key_from_shared_user_address(user_registry: &UserRegistry, user_address: address): String

has_address_record

Returns true or false based on whether the wallet address has an associated User.

public fun has_address_record(user_registry: &UserRegistry, wallet_address: address): bool

has_username_record

Returns true or false based on whether the specified lowercase User name is in use.

public fun has_username_record(user_registry: &UserRegistry, username: String): bool