fix info schema

This commit is contained in:
Alex Kraiz
2023-10-02 10:57:52 +04:00
parent cf33e8b841
commit e734e5e7e9
2 changed files with 5 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@orionprotocol/sdk",
"version": "0.19.89-rc19",
"version": "0.19.89-rc20",
"description": "Orion Protocol SDK",
"main": "./lib/index.cjs",
"module": "./lib/index.js",

View File

@@ -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(),