TipsSimulationRequest tips.simulation-request@1
Generated at from
openvibe-contracts v0.53.0 and
openvibe-sdk v0.11.0.
- Version
- 1.0.0
- Owner
- tips
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/tips/simulation-request.v1.json
tips.simulation-request@1: the body of tips.simulation.run on OpenVibe.Tips. POST /api/v1/simulate: { creator?, kind?, amount?, message?, tts?, media?, goal_id?, supporter_name?, privacy? } runs the full effect path (overlay alert, goal widget, delivery) flagged test, with no Billing call, never counted in any total and never emitted as a durable event. A service names the creator; a person simulates on their own page. The creator's rules apply as for a real request, except that a creator who is not accepting tips can still simulate. kind defaults to tip, amount to the creator's minimum or 100 bits, supporter_name to "Test supporter". Needs an Idempotency-Key header (8-200 of A-Z a-z 0-9 . _ : -; 400 idempotency.key_required): a replay with the same key and body returns the first answer, the same key with another body is 422 idempotency.key_reused. Refusals are problem+json (422 tips.invalid_input, tips.amount_too_small, tips.invalid_media, …; 409 tips.tts_disabled or tips.media_disabled; 404 tips.creator_not_found). Unknown fields are ignored.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
creator | one of | The creator whose overlays show it (default: the signed-in person). | ||
kind | enum |
| ||
amount | integer | string | Vibes bits. |
| |
message | string | null | |||
tts | object | Text-to-speech (kind tts): the text to read (default: message) and the voice. | ||
tts.text | string | |||
tts.voice | enum | Default: the creator's voice. |
| |
media | object | A media request (kind media_request). | ||
media.url | string | yes | An https link on an allowed host (TIPS_MEDIA_HOSTS; YouTube by default). |
|
goal_id | string | |||
supporter_name | string | null | |||
privacy | object | The supporter's choices; any other field is refused (422 tips.invalid_input). true, 1, "1", "true" and "on" count as yes. |
| |
privacy.anonymous | boolean | integer | string | The name reads "Anonymous" to everyone but the supporter. | ||
privacy.hide_amount | boolean | integer | string | The amount is left out of overlays, chat lines and public pages. | ||
privacy.private_message | boolean | integer | string | A tip's message is for the creator only (tips only; 422 for the other kinds). |
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: default
{}Valid: tts
{
"kind": "tts",
"amount": 200,
"tts": {
"text": "Testing one two",
"voice": "brian"
}
}Rejected: bad-kind
{
"kind": "raid"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('tips.simulation-request@1', value); // { valid, errors: [{ path, message }] }