@mysten/suins
Version:
68 lines (66 loc) • 2.39 kB
JavaScript
import { MoveStruct } from "../utils/index.mjs";
import { Balance } from "./deps/sui/balance.mjs";
import { bcs } from "@mysten/sui/bcs";
//#region src/contracts/suins/suins.ts
/**************************************************************
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
**************************************************************/
/**
* The main module of the SuiNS application, defines the `SuiNS` object and the
* authorization mechanism for interacting with the main data storage.
*
* Authorization mechanic: The Admin can authorize applications to access protected
* features of the SuiNS, they're named with a prefix `app_*`. Once authorized,
* application can get mutable access to the `Registry` and add to the application
* `Balance`.
*
* At any moment any of the applications can be deathorized by the Admin making it
* impossible for the deauthorized module to access the registry.
*
* ---
*
* Package Upgrades in mind:
*
* - None of the public functions of the SuiNS feature any specific types - instead
* we use generics to define the actual types in arbitrary modules.
* - The `Registry` itself (the main feature of the application) is stored as a
* dynamic field so that we can change the type and the module that serves the
* registry without breaking the SuiNS compatibility.
* - Any of the old modules can be deauthorized hence disabling its access to the
* registry and the balance.
*/
const $moduleName = "@suins/core::suins";
const AdminCap = new MoveStruct({
name: `${$moduleName}::AdminCap`,
fields: { id: bcs.Address }
});
const SuiNS = new MoveStruct({
name: `${$moduleName}::SuiNS`,
fields: {
id: bcs.Address,
balance: Balance
}
});
const SUINS = new MoveStruct({
name: `${$moduleName}::SUINS`,
fields: { dummy_field: bcs.bool() }
});
const ConfigKey = new MoveStruct({
name: `${$moduleName}::ConfigKey<phantom Config>`,
fields: { dummy_field: bcs.bool() }
});
const RegistryKey = new MoveStruct({
name: `${$moduleName}::RegistryKey<phantom Config>`,
fields: { dummy_field: bcs.bool() }
});
const BalanceKey = new MoveStruct({
name: `${$moduleName}::BalanceKey<phantom T>`,
fields: { dummy_field: bcs.bool() }
});
const AppKey = new MoveStruct({
name: `${$moduleName}::AppKey<phantom App>`,
fields: { dummy_field: bcs.bool() }
});
//#endregion
export { ConfigKey };
//# sourceMappingURL=suins.mjs.map