Ready To Use
Catalog
Catalog Extended

IRMRKCatalogExtended

RMRK team

IRMRKCatalogExtended

An extended interface for Catalog for RMRK equippable module.

Methods

checkIsEquippable

function checkIsEquippable(uint64 partId, address targetAddress) external view returns (bool isEquippable)

Used to check whether the given address is allowed to equip the desired Part.

Returns true if a collection may equip asset with partId.

Parameters

NameTypeDescription
partIduint64The ID of the part that we are checking
targetAddressaddressThe address that we are checking for whether the part can be equipped into it or not

Returns

NameTypeDescription
isEquippableboolThe status indicating whether the targetAddress can be equipped into Part with partId or not

checkIsEquippableToAll

function checkIsEquippableToAll(uint64 partId) external view returns (bool isEquippableToAll)

Used to check if the part is equippable by all addresses.

Returns true if part is equippable to all.

Parameters

NameTypeDescription
partIduint64ID of the part that we are checking

Returns

NameTypeDescription
isEquippableToAllboolThe status indicating whether the part with partId can be equipped by any address or not

getAllPartIds

function getAllPartIds() external view returns (uint64[] partIds)

Used to get all the part IDs in the catalog.

Can get at least 10k parts. Higher limits were not tested.It may fail if there are too many parts, in that case use either getPaginatedPartIds or getTotalParts and getPartByIndex.

Returns

NameTypeDescription
partIdsuint64[]An array of all the part IDs in the catalog

getMetadataURI

function getMetadataURI() external view returns (string)

Used to return the metadata URI of the associated Catalog.

Returns

NameTypeDescription
_0stringCatalog metadata URI

getPaginatedPartIds

function getPaginatedPartIds(uint256 offset, uint256 limit) external view returns (uint64[] partIds)

Used to get all the part IDs in the catalog.

Parameters

NameTypeDescription
offsetuint256The offset to start from
limituint256The maximum number of parts to return

Returns

NameTypeDescription
partIdsuint64[]An array of all the part IDs in the catalog

getPart

function getPart(uint64 partId) external view returns (struct IRMRKCatalog.Part part)

Used to retrieve a Part with id partId

Parameters

NameTypeDescription
partIduint64ID of the part that we are retrieving

Returns

NameTypeDescription
partIRMRKCatalog.PartThe Part struct associated with given partId

getPartByIndex

function getPartByIndex(uint256 index) external view returns (struct IRMRKCatalog.Part part)

Used to get a single Part by the index of its partId.

Parameters

NameTypeDescription
indexuint256The index of the partId.

Returns

NameTypeDescription
partIRMRKCatalog.PartThe Part struct associated with the partId at the given index

getParts

function getParts(uint64[] partIds) external view returns (struct IRMRKCatalog.Part[] part)

Used to retrieve multiple parts at the same time.

Parameters

NameTypeDescription
partIdsuint64[]An array of part IDs that we want to retrieve

Returns

NameTypeDescription
partIRMRKCatalog.Part[]An array of Part structs associated with given partIds

getTotalParts

function getTotalParts() external view returns (uint256 totalParts)

Used to get the total number of parts in the catalog.

Returns

NameTypeDescription
totalPartsuint256The total number of parts in the catalog

getType

function getType() external view returns (string)

Used to return the itemType of the associated Catalog

Returns

NameTypeDescription
_0stringitemType of the associated Catalog

setMetadataURI

function setMetadataURI(string newContractURI) external nonpayable

Used to set the metadata URI of the catalog.

emits ContractURIUpdated event

Parameters

NameTypeDescription
newContractURIstringThe new metadata URI

setType

function setType(string newType) external nonpayable

Used to set the type of the catalog.

emits TypeUpdated event

Parameters

NameTypeDescription
newTypestringThe new type of the catalog

supportsInterface

function supportsInterface(bytes4 interfaceId) external view returns (bool)

Returns true if this contract implements the interface defined by interfaceId. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP (opens in a new tab) section] to learn more about how these ids are created. This function call must use less than 30 000 gas.

Parameters

NameTypeDescription
interfaceIdbytes4undefined

Returns

NameTypeDescription
_0boolundefined

Events

AddedEquippables

event AddedEquippables(uint64 indexed partId, address[] equippableAddresses)

Event to announce new equippables to the part.

It is emitted when new addresses are marked as equippable for partId.

Parameters

NameTypeDescription
partId indexeduint64ID of the part that had new equippable addresses added
equippableAddressesaddress[]An array of the new addresses that can equip this part

AddedPart

event AddedPart(uint64 indexed partId, enum IRMRKCatalog.ItemType indexed itemType, uint8 zIndex, address[] equippableAddresses, string metadataURI)

Event to announce addition of a new part.

It is emitted when a new part is added.

Parameters

NameTypeDescription
partId indexeduint64ID of the part that was added
itemType indexedenum IRMRKCatalog.ItemTypeEnum value specifying whether the part is None, Slot and Fixed
zIndexuint8An uint specifying the z value of the part. It is used to specify the depth which the part should be rendered at
equippableAddressesaddress[]An array of addresses that can equip this part
metadataURIstringThe metadata URI of the part

ContractURIUpdated

event ContractURIUpdated()

From ERC7572 (Draft) Emitted when the contract-level metadata is updated

SetEquippableToAll

event SetEquippableToAll(uint64 indexed partId)

Event to announce that a given part can be equipped by any address.

It is emitted when a given part is marked as equippable by any.

Parameters

NameTypeDescription
partId indexeduint64ID of the part marked as equippable by any address

SetEquippables

event SetEquippables(uint64 indexed partId, address[] equippableAddresses)

Event to announce the overriding of equippable addresses of the part.

It is emitted when the existing list of addresses marked as equippable for partId is overwritten by a new one.

Parameters

NameTypeDescription
partId indexeduint64ID of the part whose list of equippable addresses was overwritten
equippableAddressesaddress[]The new, full, list of addresses that can equip this part

TypeUpdated

event TypeUpdated(string newType)

Emited when the type of the catalog is updated

Parameters

NameTypeDescription
newTypestringThe new type of the catalog