Sui Framework
Sui Framework is a default dependency set in the Package Manifest. It depends on the Standard Library and provides Sui-specific features, including the interaction with the storage, and Sui-specific native types and modules.
For convenience, we grouped the modules in the Sui Framework into multiple categories. But they're still part of the same framework.
Core
Module | Description | Chapter |
---|---|---|
sui::address | Adds conversion methods to the address type | Address |
sui::transfer | Implements the storage operations for Objects | It starts with an Object |
sui::tx_context | Contains the TxContext struct and methods to read it | Transaction Context |
sui::object | Defines the UID and ID type, required for creating objects | It starts with an Object |
sui::clock | Defines the Clock type and its methods | Epoch and Time |
sui::dynamic_field | Implements methods to add, use and remove dynamic fields | Dynamic Fields |
sui::dynamic_object_field | Implements methods to add, use and remove dynamic object fields | Dynamic Object Fields |
sui::event | Allows emitting events for off-chain listeners | Events |
sui::package | Defines the Publisher type and package upgrade methods | Publisher, Package Upgrades |
sui::display | Implements the Display object and ways to create and update it | Display |
Collections
Module | Description | Chapter |
---|---|---|
sui::vec_set | Implements a set type | Collections |
sui::vec_map | Implements a map with vector keys | Collections |
sui::table | Implements the Table type and methods to interact with it | Dynamic Collections |
sui::linked_table | Implements the LinkedTable type and methods to interact with it | Dynamic Collections |
sui::bag | Implements the Bag type and methods to interact with it | Dynamic Collections |
sui::object_table | Implements the ObjectTable type and methods to interact with it | Dynamic Collections |
sui::object_bag | Implements the ObjectBag type and methods to interact with it | Dynamic Collections |
Utilities
Module | Description | Chapter |
---|---|---|
sui::bcs | Implements the BCS encoding and decoding functions | Binary Canonical Serialization |
sui::borrow | Implements the borrowing mechanic for borrowing by value | Hot Potato |
sui::hex | Implements the hex encoding and decoding functions | - |
sui::types | Provides a way to check if the type is a One-Time-Witness | One Time Witness |
Exported Addresses
Sui Framework exports two named addresses: sui = 0x2
and std = 0x1
from the std dependency.
[addresses]
sui = "0x2"
# Exported from the MoveStdlib dependency
std = "0x1"
Implicit Imports
Just like with Standard Library, some of
the modules and types are imported implicitly in the Sui Framework. This is the list of modules and
types that are available without explicit use
import:
- sui::object
- sui::object::ID
- sui::object::UID
- sui::tx_context
- sui::tx_context::TxContext
- sui::transfer
Source Code
The source code of the Sui Framework is available in the Sui repository.