Items

What are Digital Items?

Digital Items are individual, ownable objects stored by the Marble contract. A Digital Item can represent anything from a trading card to a deed of ownership to an in-game spaceship.

Upon creation, every Item is given a unique contract-wide serial number used to identify it among all other Items in the contract.

Ownership of an Item can be proven by controlling the account that owns a given Item. Every Item also belongs to one and only one Group, which dictates the different kinds of behaviors the Item can perform.

Behavior Rules

Items follow the behavior rules set by their respective groups. For example, if an Item belongs to a group whose transfer behavior is set to false, then the Item is not transferrable. If the group manager were to activate transferability with the toggle() action, the Item would become transferrable. See the Behaviors section for more information on behaviors.

Table Breakdown

Table Name: items

Table Scope: self

Additional Indices

bygroup, byowner

Mint New Item

To create a new Item, call the mintitem() action on your Marble contract.

Required Authority: group.manager

Action Parameters

Examples

cleos push action {account} mintitem '[ {params} ]' -p {manager}

Transfer an Item

To transfer an Item, call the transferitem() action on your Marble contract.

All items included in the transfer must be owned by the "from" account to be a valid transfer.

Required Authority: item.owner

Notified Accounts: from, to

Action Parameters

Examples

cleos push action {account} transferitem '[ {params} ]' -p {owner}

Activate an Item

Items can be activated with the activateitem() action. Developers can interpret what activations do in reference to their own applications. Items can be activated any number of times.

Required Authority: item.owner and group.manager

Action Parameters

Examples

cleos push action {account} activateitem '[ {params} ]'

Consume an Item

Some Items can be consumed by the owner. Consumable Items will be destroyed after consumption. Developers determine what Item consumption translates to in their projects.

Required Authority: item.owner

Action Parameters

Examples

cleos push action {account} consumeitem '[ {params} ]' -p {owner}

Destroy an Item

To destroy an Item, call the destroyitem() action on your Marble contract.

Required Authority: group.manager

Action Parameters

Examples

cleos push action {account} destroyitem '[ {params} ]' -p {manager}

Last updated