aboutsummaryrefslogtreecommitdiffstats
path: root/packages/json-schemas/schemas/block_range_schema.ts
blob: 9eb242fc6c741a1153f542acc0c30c25bc7e9868 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
export const blockParamSchema = {
    id: '/blockParamSchema',
    oneOf: [
        {
            type: 'number',
        },
        {
            enum: ['latest', 'earliest', 'pending'],
        },
    ],
};

export const blockRangeSchema = {
    id: '/blockRangeSchema',
    properties: {
        fromBlock: { $ref: '/blockParamSchema' },
        toBlock: { $ref: '/blockParamSchema' },
    },
    type: 'object',
};