|
1 | | -import { Static, Type } from "@sinclair/typebox"; |
2 | | -import { FastifyInstance } from "fastify"; |
| 1 | +import { Type, type Static } from "@sinclair/typebox"; |
| 2 | +import type { FastifyInstance } from "fastify"; |
3 | 3 | import { StatusCodes } from "http-status-codes"; |
4 | 4 | import { updateConfiguration } from "../../../../db/configuration/updateConfiguration"; |
5 | 5 | import { getConfig } from "../../../../utils/cache/getConfig"; |
6 | 6 | import { standardResponseSchema } from "../../../schemas/sharedApiSchemas"; |
7 | 7 |
|
8 | 8 | const requestBodySchema = Type.Partial( |
9 | 9 | Type.Object({ |
10 | | - minTxsToProcess: Type.Number(), |
11 | | - maxTxsToProcess: Type.Number(), |
| 10 | + maxTxsToProcess: Type.Integer({ minimum: 1, maximum: 10_000 }), |
| 11 | + maxTxsToUpdate: Type.Integer({ minimum: 1, maximum: 10_000 }), |
12 | 12 | minedTxListenerCronSchedule: Type.Union([Type.String(), Type.Null()]), |
13 | | - maxTxsToUpdate: Type.Number(), |
14 | 13 | retryTxListenerCronSchedule: Type.Union([Type.String(), Type.Null()]), |
15 | | - minEllapsedBlocksBeforeRetry: Type.Number(), |
| 14 | + minEllapsedBlocksBeforeRetry: Type.Integer({ minimum: 1, maximum: 10_000 }), |
16 | 15 | maxFeePerGasForRetries: Type.String(), |
17 | | - maxPriorityFeePerGasForRetries: Type.String(), |
18 | | - maxRetriesPerTx: Type.Number(), |
| 16 | + maxRetriesPerTx: Type.Integer({ minimum: 0, maximum: 10_000 }), |
19 | 17 | }), |
20 | 18 | ); |
21 | 19 |
|
22 | 20 | const responseBodySchema = Type.Object({ |
23 | 21 | result: Type.Object({ |
24 | | - minTxsToProcess: Type.Number(), |
25 | | - maxTxsToProcess: Type.Number(), |
| 22 | + minTxsToProcess: Type.Integer(), |
| 23 | + maxTxsToProcess: Type.Integer(), |
26 | 24 | minedTxListenerCronSchedule: Type.Union([Type.String(), Type.Null()]), |
27 | | - maxTxsToUpdate: Type.Number(), |
| 25 | + maxTxsToUpdate: Type.Integer(), |
28 | 26 | retryTxListenerCronSchedule: Type.Union([Type.String(), Type.Null()]), |
29 | | - minEllapsedBlocksBeforeRetry: Type.Number(), |
| 27 | + minEllapsedBlocksBeforeRetry: Type.Integer(), |
30 | 28 | maxFeePerGasForRetries: Type.String(), |
31 | 29 | maxPriorityFeePerGasForRetries: Type.String(), |
32 | | - maxRetriesPerTx: Type.Number(), |
| 30 | + maxRetriesPerTx: Type.Integer(), |
33 | 31 | }), |
34 | 32 | }); |
35 | 33 |
|
|
0 commit comments