mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-14 06:02:36 +03:00
Fixup for ethers new version
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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(),
|
||||
|
||||
@@ -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`,
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user