GamesScriptStorageRequest games.script-storage-request@1

Generated at from openvibe-contracts v0.143.0 and openvibe-sdk v0.44.0.

Version
1.0.0
Owner
games
Visibility
public
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/games/script-storage-request.v1.json

games.script-storage-request@1: game.storage.get(key), set(key, value), delete(key) and keys(prefix?) on the mod's key/value storage for its place (games.storage.kv): keys up to 128 bytes, values up to 8 KB of JSON, at most 1000 keys and 1 MB per mod per place.

Fields

FieldTypeRequiredDescriptionConstraints
openumyes
  • one of "get", "set", "delete", "keys"
keystring
  • minLength 1
  • maxLength 128
valueany
prefixstring
  • maxLength 128

Examples

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

Valid: keys
{
  "op": "keys",
  "prefix": "score:"
}
Valid: set
{
  "op": "set",
  "key": "visits",
  "value": 3
}
Rejected: bad-op
{
  "op": "drop"
}
Rejected: long-key
{
  "op": "get",
  "key": "kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk"
}

Validate

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