Skip to content

Commit

Permalink
JSON Schema Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Github Workflow committed Nov 8, 2024
1 parent 616070b commit 26bde89
Show file tree
Hide file tree
Showing 4 changed files with 143 additions and 0 deletions.
2 changes: 2 additions & 0 deletions _data/v3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions config/v3/ticks_batch/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"ticks_batch": 1,
"market": "forex",
"subscribe": 1
}
88 changes: 88 additions & 0 deletions config/v3/ticks_batch/receive.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
48 changes: 48 additions & 0 deletions config/v3/ticks_batch/send.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}

0 comments on commit 26bde89

Please sign in to comment.