Skip to main content

Introduction

The Item service allow you to manage your in-game assets, on and off chain.

Concepts#

Schema#

A Schema defines the shape of your Items with a set of Attributes specific to each type of Items.

Attributes#

Attributes are defined by their names, unique within a given Schema.

  • on-chain Attributes will be synchronized in the blockchain where the item lives
  • off-chain Attributes only exists inside the L3V3L API

Example#

In an RPG game, we could create a Weapons Schema to handle all the weapons of the game, with the following Attributes:

  • attack
  • defense
  • range
  • rarity

We could also create different Schemas for different types of weapons, if they don't share the same characteristics.

Swords Schema with the following Attributes:

  • hands number
  • damages
  • rarity

Bow Schema with the following Attributes:

  • arrows per minute
  • accuracy
  • rarity

etc...

Template#

A Template allow for fine-grained categorization of Items within a Schema.

The Template will allow to pre-define some Attributes of the Schema and to fix a supply limit (coming soon) for the NFTs generated from the Template. The Template will also restrict the usage of NFTs VS non-NFTs Items.

Example#

Given the Weapons Schema from the previous example, we could create a first Basic Sword Template that will allow us to create an unlimited number of non-NFTs common swords. We can create another Steel Sword Template that will allow us to mint a maximum of 5000 uncommon NFTs swords.

Item#

An Item is a unique in-game asset.

Items are always produced from a single Template, and by transitiveness, a single Schema. Items inherit all attributes of the Schema, with the pre-defined values from the Template. Attributes that are not contained in the Template can be set independently on each Item.

NFTs items#

NFTs items are minted asynchronously after a request is sent to the API. When the NFT backing up the Item will be minted on chain, the Item will be created in the API. As ownership of the NFT can change on-chain, through direct transfers or marketplace sells, the Blockchain containing the NFTs are continuously scanned to ensure the correct owner is known from the API.

Non-NFTs items#

Non-NFTs items exists only off-chain. They can be fully managed with the L3V3L API but can never be written on-chain.

Publication and on-chain writing#

In many cases, you have to publish some of the objects you have created in the API, in order for them to be available on-chain. In other cases you will create them on-chain objects directly.

The process is always asynchronous and requires 3 steps:

  • As a developer you will send a publication request for a specific element
  • The publication will be processed asynchronously by a scheduled task
  • The resulting blockchain transaction is verified to ensure its consistency

Depending on the blockchain used by your project this could take a few seconds to several minutes, or even hours.

API documentation#

You can find the detailed API documentation of the items service at https://api.playtix.team/docs