From 26bde89ab6fc682b067e5b1e8145eae066a5b9a6 Mon Sep 17 00:00:00 2001 From: Github Workflow Date: Fri, 8 Nov 2024 10:31:13 +0000 Subject: [PATCH] JSON Schema Update --- _data/v3.yml | 2 + config/v3/ticks_batch/example.json | 5 ++ config/v3/ticks_batch/receive.json | 88 ++++++++++++++++++++++++++++++ config/v3/ticks_batch/send.json | 48 ++++++++++++++++ 4 files changed, 143 insertions(+) create mode 100644 config/v3/ticks_batch/example.json create mode 100644 config/v3/ticks_batch/receive.json create mode 100644 config/v3/ticks_batch/send.json diff --git a/_data/v3.yml b/_data/v3.yml index ef3ccc0e..a0fe9654 100644 --- a/_data/v3.yml +++ b/_data/v3.yml @@ -217,6 +217,8 @@ groups: title: States List - name: ticks title: Ticks Stream + - name: ticks_batch + title: Ticks Batch Stream - name: ticks_history title: Ticks History - name: time diff --git a/config/v3/ticks_batch/example.json b/config/v3/ticks_batch/example.json new file mode 100644 index 00000000..a02334a1 --- /dev/null +++ b/config/v3/ticks_batch/example.json @@ -0,0 +1,5 @@ +{ + "ticks_batch": 1, + "market": "forex", + "subscribe": 1 +} diff --git a/config/v3/ticks_batch/receive.json b/config/v3/ticks_batch/receive.json new file mode 100644 index 00000000..d6f9e1ed --- /dev/null +++ b/config/v3/ticks_batch/receive.json @@ -0,0 +1,88 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Ticks Batch Stream (response)", + "description": "Latest spot price for a group symbols. Continuous responses with a frequency of up to one second.", + "type": "object", + "required": [ + "echo_req", + "msg_type" + ], + "properties": { + "ticks_batch": { + "title": "ticks_batch", + "description": "Tick by tick list of streamed data for a group of symbols", + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "ask", + "bid", + "change", + "epoch", + "quote", + "symbol" + ], + "properties": { + "ask": { + "description": "Market ask at the epoch", + "type": "string" + }, + "bid": { + "description": "Market bid at the epoch", + "type": "string" + }, + "change": { + "description": "Daily percentage change", + "type": "string" + }, + "epoch": { + "description": "Epoch time of the tick", + "type": "integer" + }, + "quote": { + "description": "Market value at the epoch", + "type": "string" + }, + "symbol": { + "description": "Symbol", + "type": "string" + } + } + } + }, + "subscription": { + "title": "Subscription information", + "description": "For subscription requests only.", + "type": "object", + "additionalProperties": false, + "required": [ + "id" + ], + "properties": { + "id": { + "description": "A per-connection unique identifier. Can be passed to the `forget` API call to unsubscribe.", + "type": "string", + "examples": [ + "c84a793b-8a87-7999-ce10-9b22f7ceead3" + ] + } + } + }, + "echo_req": { + "description": "Echo of the request made.", + "type": "object" + }, + "msg_type": { + "description": "Action name of the request made.", + "type": "string", + "enum": [ + "ticks_batch" + ] + }, + "req_id": { + "description": "Optional field sent in request to map to response, present only when request contains `req_id`.", + "type": "integer" + } + } +} diff --git a/config/v3/ticks_batch/send.json b/config/v3/ticks_batch/send.json new file mode 100644 index 00000000..4b459c0e --- /dev/null +++ b/config/v3/ticks_batch/send.json @@ -0,0 +1,48 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Ticks Batch Stream (request)", + "description": "Initiate a continuous stream of spot price updates for a group symbols.", + "type": "object", + "auth_required": 0, + "additionalProperties": false, + "required": [ + "ticks_batch", + "market" + ], + "properties": { + "ticks_batch": { + "description": "Must be `1`", + "type": "integer", + "enum": [ + 1 + ] + }, + "market": { + "description": "The short market name.", + "type": "string", + "enum": [ + "forex", + "indices", + "commodities", + "stocks", + "cryptocurrency", + "synthetic_index" + ] + }, + "subscribe": { + "description": "[Optional] If set to 1, will send updates in batches by market.", + "type": "integer", + "enum": [ + 1 + ] + }, + "passthrough": { + "description": "[Optional] Used to pass data through the websocket, which may be retrieved via the `echo_req` output field.", + "type": "object" + }, + "req_id": { + "description": "[Optional] Used to map request to response.", + "type": "integer" + } + } +}