Fixup for ethers new version

This commit is contained in:
Dmitry Leleko
2023-10-04 11:40:46 +02:00
parent 37c1110c02
commit 2f1dfc2531
3 changed files with 4 additions and 4 deletions

View File

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

View File

@@ -3,7 +3,7 @@ import { ethers } from 'ethers';
const infoSchema = z.object({
blockNumber: z.number().int().nonnegative(),
blockHash: z.string().refine((v) => v.length === 0 || ethers.utils.isHexString(v), {
blockHash: z.string().refine((v) => v.length === 0 || ethers.isHexString(v), {
message: 'blockHash must be a valid hex string or empty',
}),
timeRequest: z.number().int().nonnegative(),

View File

@@ -3,12 +3,12 @@ import { z } from 'zod';
export const evmAddressSchema = z
.string()
.refine(ethers.utils.isAddress, (v) => ({
.refine(ethers.isAddress, (v) => ({
message: `${v} is not a valid address`,
}));
export const hexStringSchema = z
.string()
.refine(ethers.utils.isHexString, (v) => ({
.refine(ethers.isHexString, (v) => ({
message: `${v} is not a valid hex string`,
}));