aboutsummaryrefslogtreecommitdiffstats
path: root/packages/json-schemas/schemas
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-12-17 08:52:37 +0800
committerFabio Berger <me@fabioberger.com>2018-12-17 08:52:37 +0800
commitee4185ab465c76b64b65efefb92e11b0ca4ecad4 (patch)
treeafbe107fe1de101ad8e804df35f3886b0fbc7276 /packages/json-schemas/schemas
parent7661cfc85ef9e267d15bd4d7bd06c3b6cc3f7931 (diff)
downloaddexon-sol-tools-ee4185ab465c76b64b65efefb92e11b0ca4ecad4.tar
dexon-sol-tools-ee4185ab465c76b64b65efefb92e11b0ca4ecad4.tar.gz
dexon-sol-tools-ee4185ab465c76b64b65efefb92e11b0ca4ecad4.tar.bz2
dexon-sol-tools-ee4185ab465c76b64b65efefb92e11b0ca4ecad4.tar.lz
dexon-sol-tools-ee4185ab465c76b64b65efefb92e11b0ca4ecad4.tar.xz
dexon-sol-tools-ee4185ab465c76b64b65efefb92e11b0ca4ecad4.tar.zst
dexon-sol-tools-ee4185ab465c76b64b65efefb92e11b0ca4ecad4.zip
Move OrderWatcher Websocket schemas to json-schemas and convert to JSON so that they are language agnostic
Diffstat (limited to 'packages/json-schemas/schemas')
-rw-r--r--packages/json-schemas/schemas/order_watcher_web_socket_request_schema.json52
-rw-r--r--packages/json-schemas/schemas/order_watcher_web_socket_utf8_message_schema.json10
2 files changed, 62 insertions, 0 deletions
diff --git a/packages/json-schemas/schemas/order_watcher_web_socket_request_schema.json b/packages/json-schemas/schemas/order_watcher_web_socket_request_schema.json
new file mode 100644
index 000000000..4666c6291
--- /dev/null
+++ b/packages/json-schemas/schemas/order_watcher_web_socket_request_schema.json
@@ -0,0 +1,52 @@
+{
+ "id": "/orderWatcherWebSocketRequestSchema",
+ "type": "object",
+ "definitions": {
+ "signedOrderParam": {
+ "type": "object",
+ "properties": {
+ "signedOrder": { "$ref": "/signedOrderSchema" }
+ },
+ "required": ["signedOrder"]
+ },
+ "orderHashParam": {
+ "type": "object",
+ "properties": {
+ "orderHash": { "$ref": "/hexSchema" }
+ },
+ "required": ["orderHash"]
+ }
+ },
+ "oneOf": [
+ {
+ "type": "object",
+ "properties": {
+ "id": { "type": "string" },
+ "jsonrpc": { "type": "string" },
+ "method": { "enum": ["ADD_ORDER"] },
+ "params": { "$ref": "#/definitions/signedOrderParam" }
+ },
+ "required": ["id", "jsonrpc", "method", "params"]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": { "type": "string" },
+ "jsonrpc": { "type": "string" },
+ "method": { "enum": ["REMOVE_ORDER"] },
+ "params": { "$ref": "#/definitions/orderHashParam" }
+ },
+ "required": ["id", "jsonrpc", "method", "params"]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": { "type": "string" },
+ "jsonrpc": { "type": "string" },
+ "method": { "enum": ["GET_STATS"] },
+ "params": {}
+ },
+ "required": ["id", "jsonrpc", "method"]
+ }
+ ]
+} \ No newline at end of file
diff --git a/packages/json-schemas/schemas/order_watcher_web_socket_utf8_message_schema.json b/packages/json-schemas/schemas/order_watcher_web_socket_utf8_message_schema.json
new file mode 100644
index 000000000..154d6d754
--- /dev/null
+++ b/packages/json-schemas/schemas/order_watcher_web_socket_utf8_message_schema.json
@@ -0,0 +1,10 @@
+{
+ "id": "/orderWatcherWebSocketUtf8MessageSchema",
+ "properties": {
+ "utf8Data": { "type": "string" }
+ },
+ "required": [
+ "utf8Data"
+ ],
+ "type": "object"
+}