Solidity API
IKindRegistry
This interface manages different kinds of registry entries for a specific application or protocol
KindCreated
event KindCreated(uint64 id, struct ObjectMeta meta, bytes32 code, enum ElementType[] stateSpec, uint64[] relSpec, bytes32 desc, address owner)
Event emitted when a new kind is created
Parameters
Name | Type | Description |
---|---|---|
id | uint64 | Unique identifier for the new kind |
meta | struct ObjectMeta | Metadata associated with the kind |
code | bytes32 | Unique code associated with the kind |
stateSpec | enum ElementType[] | Array describing the state specification |
relSpec | uint64[] | Array describing the relation specification |
desc | bytes32 | Description of the kind |
owner | address | Owner address of the new kind |
KindUpdated
event KindUpdated(uint64 id, struct ObjectMeta meta, bytes32 code, uint64[] relSpec, bytes32 desc)
Event emitted when a kind is updated
Parameters
Name | Type | Description |
---|---|---|
id | uint64 | Identifier of the kind being updated |
meta | struct ObjectMeta | Updated metadata |
code | bytes32 | Updated code |
relSpec | uint64[] | Updated relation specification |
desc | bytes32 | Updated description |
KindUpgraded
event KindUpgraded(uint64 id, struct ObjectMeta meta)
Event emitted when a kind is upgraded
Parameters
Name | Type | Description |
---|---|---|
id | uint64 | Identifier of the kind being upgraded |
meta | struct ObjectMeta | Updated metadata after the upgrade |
KindTouched
event KindTouched(uint64 id, struct ObjectMeta meta)
Event emitted when a kind is touched (potentially triggering updates or checks)
Parameters
Name | Type | Description |
---|---|---|
id | uint64 | Identifier of the kind being touched |
meta | struct ObjectMeta | Metadata of the kind at the time of the touch |
KindDestroyed
event KindDestroyed(uint64 id, struct ObjectMeta meta)
Event emitted when a kind is destroyed
Parameters
Name | Type | Description |
---|---|---|
id | uint64 | Identifier of the destroyed kind |
meta | struct ObjectMeta | Metadata of the kind at the time of destruction |
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 |