use std::hash;
use std::string;
use sui::event;
use sui::package;
use sui::table;
use sage_admin::admin;

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

Structs

Invite

An invitation to join the protocol.

public struct Invite has copy, drop, store

InviteConfig

Manages whether invites are required.

public struct InviteConfig has key

UserInviteRegistry

Collection of all outstanding invitations.

public struct UserInviteRegistry has key

Events

InviteDeleted

Fires when an Invite is deleted.

public struct InviteDeleted has copy, drop

Constants

Error code thrown when an Invite does not exist.

const EInviteDoesNotExist: u64 = 370;

Error code thrown when an Invite is not valid.

const EInviteInvalid: u64 = 371;

Error code thrown when Invites are not required.

const EInviteNotAllowed: u64 = 372;

Functions

assert_invite_exists

Aborts with EInviteDoesNotExist if the registry does not contain the invite key.

public fun assert_invite_exists(user_invite_registry: &UserInviteRegistry, invite_key: String)

assert_invite_not_required

Aborts with EInviteNotAllowed if invites are required.

public fun assert_invite_not_required(invite_config: &InviteConfig)

assert_invite_is_valid

Aborts with EInviteInvalid if the Invite is not valid.

public fun assert_invite_is_valid(invite_code: String, invite_key: String, invite_hash: vector<u8>)

get_destructured_invite

Returns the stored hash and user wallet info.

public fun get_destructured_invite(user_invite_registry: &UserInviteRegistry, invite_key: String): (vector<u8>, address)

has_record

Returns true or false based on whether the invite exists in the registry.

public fun has_record(user_invite_registry: &UserInviteRegistry, invite_key: String): bool

is_invite_required

Returns true or false based on whether invites are required.

public fun is_invite_required(invite_config: &InviteConfig): bool

is_invite_valid

Returns true or false depending on whether the Invite is valid.

public fun is_invite_valid(invite_code: String, invite_key: String, invite_hash: vector<u8>): bool