mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-04-05 20:48:12 +03:00
fix info schema
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
import { z } from 'zod';
|
||||
import { hexStringSchema } from './util-schemas.js';
|
||||
import { ethers } from 'ethers';
|
||||
|
||||
const infoSchema = z.object({
|
||||
blockNumber: z.number().int().nonnegative(),
|
||||
blockHash: hexStringSchema,
|
||||
blockHash: z.string().refine((v) => v.length === 0 || ethers.utils.isHexString(v), {
|
||||
message: 'blockHash must be a valid hex string or empty',
|
||||
}),
|
||||
timeRequest: z.number().int().nonnegative(),
|
||||
timeAnswer: z.number().int().nonnegative(),
|
||||
changes: z.number().int().nonnegative(),
|
||||
|
||||
Reference in New Issue
Block a user