InventoryDefinitionRequest inventory.definition-request@1

Generated at from openvibe-contracts v0.127.0 and openvibe-sdk v0.37.0.

Version
1.0.0
Owner
inventory
Visibility
public
Status
active
Compatibility
backward
Decision
ADR-054
Schema
https://openvibe.network/contracts/inventory/definition-request.v1.json

Create or edit a definition in the issuer's namespace (inventory.definition.manage). A service's or app's definition is published when it asks; a creator's goes to staff review (in_review) first.

Fields

FieldTypeRequiredDescriptionConstraints
kindstringyes
  • pattern ^[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*)+$
  • maxLength 64
namestringyes
  • minLength 1
  • maxLength 80
descriptionstring
  • maxLength 500
artobjectyes
  • no other fields
art.media_idstringAn OpenVibe.Media object (an image, an animation).
  • pattern ^med_[0-9A-HJKMNP-TV-Z]{26}$
art.tokenstringA token the kind's renderers know (a CSS class, a speech preset).
  • minLength 1
  • maxLength 80
art.emojistring
  • maxLength 16
rarityenumyes
  • one of "common", "uncommon", "rare", "epic", "legendary"
attributesobject
supply_capinteger | null
  • minimum 1
aliasesarray of string
  • maxItems 8
  • unique items
  • items: pattern ^[a-z0-9][a-z0-9_.-]{0,63}$
publishbooleanAsk for publication (a creator's definition goes to review).
grantorsarray of stringOther services or apps the issuer lets grant this one item (ADR-054 §3): Quest giving Live's hats as quest rewards. They grant only (origin earned or granted, idempotent per key); defining, editing, consuming and revoking stay the issuer's.
  • maxItems 8
  • unique items
  • items: pattern ^(service:[a-z][a-z0-9-]*|app:app_[0-9A-HJKMNP-TV-Z]{26})$

Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

Valid: frame
{
  "kind": "network.profile_frame",
  "name": "Aurora frame",
  "art": {
    "media_id": "med_01JZ0000000000000000000MED"
  },
  "rarity": "rare",
  "supply_cap": 500,
  "publish": true
}
Rejected: no-art
{
  "kind": "network.profile_frame",
  "name": "x",
  "rarity": "rare"
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('inventory.definition-request@1', value);   // { valid, errors: [{ path, message }] }