use std :: string;
use sui :: dynamic_field;
use sui :: package;
use sui :: table;
use sage_admin :: admin;
Explore this module further in the Mover Registry: @sage/admin
Structs
App
Object that represents the application operating in the protocol, e.g. “Sage”, “instagram-clone”, “bucket”, or “double-up”. Developers may create different apps within the protocol to build social applications or augment their application with social capabilities.
public struct App has key
id : UID ,
name : String ,
rewards_enabled : bool
AppRegistry
Registry that maintains a reference to every App on the protocol and maintains name-uniqueness.
public struct AppRegistry has key
id : UID ,
registry : Table < String , address >
Functions
get_address
Returns the address of the App’s id.
public fun get_address ( app : & App ) : address
public fun get_address (
app : & App
) : address {
app . id . to_address ()
}
get_name
Returns the name of the App.
public fun get_name ( app : & App ) : String
public fun get_name (
app : & App
) : String {
app . name
}
has_record
Returns true if the case-insensitive app name is already in use, and false otherwise.
public fun has_record ( app : & App ) : bool
public fun has_record (
app_registry : & AppRegistry ,
app_key : String
) : bool {
app_registry . registry . contains ( app_key )
}
has_rewards_enabled
Returns true if rewards are enabled in the App, and false otherwise.
public fun has_rewards_enabled ( app : & App ) : bool
public fun has_rewards_enabled (
app : & App
) : bool {
app . rewards_enabled
}