Skip to main content

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

NameTypeDescription
iduint64Unique identifier for the new kind
metastruct ObjectMetaMetadata associated with the kind
codebytes32Unique code associated with the kind
stateSpecenum ElementType[]Array describing the state specification
relSpecuint64[]Array describing the relation specification
descbytes32Description of the kind
owneraddressOwner 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

NameTypeDescription
iduint64Identifier of the kind being updated
metastruct ObjectMetaUpdated metadata
codebytes32Updated code
relSpecuint64[]Updated relation specification
descbytes32Updated description

KindUpgraded

event KindUpgraded(uint64 id, struct ObjectMeta meta)

Event emitted when a kind is upgraded

Parameters

NameTypeDescription
iduint64Identifier of the kind being upgraded
metastruct ObjectMetaUpdated 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

NameTypeDescription
iduint64Identifier of the kind being touched
metastruct ObjectMetaMetadata 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

NameTypeDescription
iduint64Identifier of the destroyed kind
metastruct ObjectMetaMetadata 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

NameTypeDescription
codebytes32Unique code for the kind
stateSpecenum ElementType[]State specification for the kind
relSpecuint64[]Relation specification for the kind
descbytes32Description of the kind

Return Values

NameTypeDescription
[0]uint64id 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

NameTypeDescription
iduint64Identifier of the kind to update
codebytes32Updated code for the kind
descbytes32Updated description of the kind

Return Values

NameTypeDescription
[0]struct ObjectMetameta 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

NameTypeDescription
iduint64Identifier of the kind to update
codebytes32Updated code for the kind
descbytes32Updated description of the kind
relSpecuint64[]Updated relation specification

Return Values

NameTypeDescription
[0]struct ObjectMetameta 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

NameTypeDescription
iduint64Identifier of the kind
revuint32Revision number

Return Values

NameTypeDescription
[0]bytes32The 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

NameTypeDescription
iduint64Identifier of the kind
revuint32Revision number

Return Values

NameTypeDescription
[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

NameTypeDescription
iduint64Identifier of the kind
revuint32Revision number

Return Values

NameTypeDescription
[0]uint64[]An array of uint64 representing the relation specification