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
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
kind | string | yes |
| |
name | string | yes |
| |
description | string |
| ||
art | object | yes |
| |
art.media_id | string | An OpenVibe.Media object (an image, an animation). |
| |
art.token | string | A token the kind's renderers know (a CSS class, a speech preset). |
| |
art.emoji | string |
| ||
rarity | enum | yes |
| |
attributes | object | |||
supply_cap | integer | null |
| ||
aliases | array of string |
| ||
publish | boolean | Ask for publication (a creator's definition goes to review). | ||
grantors | array of string | Other 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. |
|
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 }] }