NetworkLevel network.level@1

Generated at from openvibe-contracts v0.419.0 and openvibe-sdk v0.161.0.

Version
1.0.0
Owner
network
Visibility
public
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/network/level.v1.json

NetworkLevel: one earned platform level owned by Network; experience is never bought or spent.

Fields

FieldTypeRequiredDescriptionConstraints
levelintegeryes
  • minimum 0
  • maximum 1000000000000
xpintegeryes
  • minimum 0
  • maximum 1000000000000
intointegeryes
  • minimum 0
  • maximum 1000000000000
spanintegeryes
  • minimum 0
  • maximum 1000000000000
next_atintegeryes
  • minimum 0
  • maximum 1000000000000
rankinteger | nullyes
  • minimum 1
recentarray of objectyes
  • maxItems 5
  • items: no other fields
recent[].namestringyes
recent[].atstringyes
  • format date-time
recent[].amountintegeryes
  • minimum 0
  • maximum 1000000000000

Examples

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

Valid: example
{
  "level": 1,
  "xp": 0,
  "into": 0,
  "span": 100,
  "next_at": 100,
  "rank": null,
  "recent": []
}
Rejected: example
{}

Validate

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