aboutsummaryrefslogtreecommitdiffstats
path: root/src/schemas/subscription_opts_schema.ts
blob: a32ba8faeba09d3a6221707ce4190ff6d16e6577 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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',
};