InventoryInstance inventory.instance@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/instance.v1.json
One item a person owns (ADR-054 §2): a definition, its origin and state. bought and traded are reserved for the later money ADR (ADR-054 §5) and are refused until it is accepted.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
id | string | yes |
| |
definition_id | string | yes |
| |
owner | string | yes |
| |
origin | enum | yes |
| |
state | enum | yes |
| |
attributes | object | Per-instance values (a serial number, a wear value), valid against the kind. | ||
serial | integer | The instance's number within a capped supply. |
| |
acquired_at | string | yes |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: migrated
{
"id": "inv_01JZ00000000000000000001NV",
"definition_id": "itd_01JZ00000000000000000001TD",
"owner": "usr_01JZ0000000000000000000AAA",
"origin": "migrated",
"state": "owned",
"acquired_at": "2026-10-09T03:00:00Z"
}Valid: serial
{
"id": "inv_01JZ00000000000000000001N2",
"definition_id": "itd_01JZ00000000000000000001T2",
"owner": "usr_01JZ0000000000000000000AAA",
"origin": "earned",
"state": "owned",
"acquired_at": "2026-10-09T03:00:00Z",
"serial": 12,
"attributes": {
"wear": 0.1
}
}Rejected: bad-owner
{
"id": "inv_01JZ00000000000000000001NV",
"definition_id": "itd_01JZ00000000000000000001TD",
"owner": "gst_01JZ0000000000000000000AAA",
"origin": "migrated",
"state": "owned",
"acquired_at": "2026-10-09T03:00:00Z"
}Rejected: bad-state
{
"id": "inv_01JZ00000000000000000001NV",
"definition_id": "itd_01JZ00000000000000000001TD",
"owner": "usr_01JZ0000000000000000000AAA",
"origin": "migrated",
"state": "sold",
"acquired_at": "2026-10-09T03:00:00Z"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('inventory.instance@1', value); // { valid, errors: [{ path, message }] }