diff options
Diffstat (limited to 'src/schemas/subscription_opts_schema.ts')
-rw-r--r-- | src/schemas/subscription_opts_schema.ts | 21 |
1 files changed, 21 insertions, 0 deletions
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', +}; |