Guides
KindRegistry
InvalidDesc
error InvalidDesc()
InvalidCode
error InvalidCode()
InvalidStateSpec
error InvalidStateSpec()
InvalidRelationSpec
error InvalidRelationSpec()
MethodDisabled
error MethodDisabled()
PseduoStateArray
struct PseduoStateArray {
bytes32 stateSpec;
bytes32 code;
bytes32 relSpec0;
bytes32 relSpec1;
bytes32 desc;
}
STATE_SPEC_FIELD
uint256 STATE_SPEC_FIELD
CODE_FIELD
uint256 CODE_FIELD
REL_SPEC_FIELD0
uint256 REL_SPEC_FIELD0
REL_SPEC_FIELD1
uint256 REL_SPEC_FIELD1
DESC_FIELD
uint256 DESC_FIELD
STATE_SIZE
uint256 STATE_SIZE
constructor
constructor() public
initialize
function initialize(address initialOwner, uint64 universe, string baseUri, address setRegistry, address relRegistry, bytes32 codeKindOfKind, bytes32 descKindOfKind, bytes32 codeKindOfSet, bytes32 descKindOfSet) public
register
function register(bytes32 code, enum ElementType[] stateSpec, uint64[] relSpec, bytes32 desc) external returns (uint64)
Registers a new kind in the registry
Parameters
Name | Type | Description |
---|---|---|
code | bytes32 | Unique code for the kind |
stateSpec | enum ElementType[] | State specification for the kind |
relSpec | uint64[] | Relation specification for the kind |
desc | bytes32 | Description of the kind |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint64 | id The unique identifier of the newly created kind |
update
function update(uint64 id, bytes32 code, bytes32 desc) external returns (struct ObjectMeta)
Updates the kind identified by id
Parameters
Name | Type | Description |
---|---|---|
id | uint64 | Identifier of the kind to update |
code | bytes32 | Updated code for the kind |
desc | bytes32 | Updated description of the kind |
Return Values
Name | Type | Description |
---|---|---|
[0] | struct ObjectMeta | meta Updated metadata of the kind |
update
function update(uint64 id, bytes32 code, bytes32 desc, uint64[] relSpec) external returns (struct ObjectMeta)
Overloaded update function with relation specification
Parameters
Name | Type | Description |
---|---|---|
id | uint64 | Identifier of the kind to update |
code | bytes32 | Updated code for the kind |
desc | bytes32 | Updated description of the kind |
relSpec | uint64[] | Updated relation specification |
Return Values
Name | Type | Description |
---|---|---|
[0] | struct ObjectMeta | meta Updated metadata of the kind |
codeAt
function codeAt(uint64 id, uint32 rev) external view returns (bytes32)
Retrieves the code of a kind by id and revision number
Parameters
Name | Type | Description |
---|---|---|
id | uint64 | Identifier of the kind |
rev | uint32 | Revision number |
Return Values
Name | Type | Description |
---|---|---|
[0] | bytes32 | The code associated with the specified id and revision |
stateSpecAt
function stateSpecAt(uint64 id, uint32 rev) external view returns (enum ElementType[])
Retrieves the state specification of a kind by id and revision number
Parameters
Name | Type | Description |
---|---|---|
id | uint64 | Identifier of the kind |
rev | uint32 | Revision number |
Return Values
Name | Type | Description |
---|---|---|
[0] | enum ElementType[] | An array of ElementType representing the state specification |
relSpecAt
function relSpecAt(uint64 id, uint32 rev) external view returns (uint64[])
Retrieves the relation specification of a kind by id and revision number
Parameters
Name | Type | Description |
---|---|---|
id | uint64 | Identifier of the kind |
rev | uint32 | Revision number |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint64[] | An array of uint64 representing the relation specification |
update
function update(uint64, bytes32[]) public pure returns (struct ObjectMeta)