Invite
Defines:
public struct Invite has copy, drop, store {
hash: vector<u8>,
user: address
}
public struct InviteConfig has key, store {
id: UID,
required: bool
}
public struct UserInviteRegistry has key, store {
id: UID,
registry: Table<String, Invite>
}
Assert Invite Exists
The assert_invite_exists
functions have these effects:
Throws error (371 - EInviteDoesNotExist) if the invite does not exist in the registry
Assert Invite Not Required
The assert_invite_not_required
functions have these effects:
Throws error (370 - EInviteNotAllowed) if invites are required
Assert Valid Invite
The assert_invite_is_valid
functions have these effects:
Throws error (373 - EInviteInvalid) if the invite is not valid
Create
The create_invite
function has these effects:
Asserts invite with key does not exist
Creates invite
Adds invite to registry
Delete
The delete_invite
function has these effects:
Removes invite from registry
Emits the "InviteDeleted" event:
public struct InviteDeleted has copy, drop { invite_key: String }
Get Destructured Invite
The get_destructured_invite
functions have these effects:
Borrows invite from registry
Returns (invite vector hash, user wallet address)
Has Record
The has_record
function has these effects:
Returns boolean if the String key exists in the Invites registry
Is Invite Required
The is_invite_required
function has these effects:
Returns boolean if invite is required or not
Is Invite Valid
The is_invite_valid
function has these effects:
Returns boolean if the invite is valid or not
Set Invite Config
The set_invite_config
function has these effects:
Sets whether invites are required or not
Last updated