From ca92502d34a28c6e9a638d299b0dccce40dc9675 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 3 Jul 2017 18:23:35 -0700 Subject: Add index_filter_values_schema.ts and subscription_opts_schema.ts --- src/schemas/index_filter_values_schema.ts | 11 +++++++++++ src/schemas/subscription_opts_schema.ts | 21 +++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 src/schemas/index_filter_values_schema.ts create mode 100644 src/schemas/subscription_opts_schema.ts (limited to 'src/schemas') diff --git a/src/schemas/index_filter_values_schema.ts b/src/schemas/index_filter_values_schema.ts new file mode 100644 index 000000000..7c8d3f943 --- /dev/null +++ b/src/schemas/index_filter_values_schema.ts @@ -0,0 +1,11 @@ +export const indexFilterValuesSchema = { + id: '/indexFilterValues', + additionalProperties: { + oneOf: [ + {$ref: '/numberSchema'}, + {$ref: '/addressSchema'}, + {$ref: '/orderHashSchema'}, + ], + }, + type: 'object', +}; diff --git a/src/schemas/subscription_opts_schema.ts b/src/schemas/subscription_opts_schema.ts new file mode 100644 index 000000000..a32ba8fae --- /dev/null +++ b/src/schemas/subscription_opts_schema.ts @@ -0,0 +1,21 @@ +export const blockParamSchema = { + id: '/blockParam', + oneOf: [ + { + type: 'number', + }, + { + enum: ['latest', 'earliest', 'pending'], + }, + ], +}; + +export const subscriptionOptsSchema = { + id: '/subscriptionOpts', + properties: { + fromBlock: {$ref: '/blockParam'}, + toBlock: {$ref: '/blockParam'}, + }, + required: ['fromBlock', 'toBlock'], + type: 'object', +}; -- cgit