GamesScriptCallResult games.script-call-result@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-call-result.v1.json

games.script-call-result@1: what a hook call produced: the number of intents it queued, or the error that made it fail (a mod that keeps throwing or overruns its budget is disabled).

Fields

FieldTypeRequiredDescriptionConstraints
okbooleanyes
intentsinteger
  • minimum 0
errorstring
  • maxLength 500

Examples

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

Valid: failed
{
  "ok": false,
  "error": "budget: cpu 50 ms exceeded"
}
Valid: ok
{
  "ok": true,
  "intents": 2
}
Rejected: negative
{
  "ok": true,
  "intents": -1
}
Rejected: no-ok
{
  "intents": 1
}

Validate

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