From 299862d93e2ac0b271a7804cfd64991596d3930a Mon Sep 17 00:00:00 2001 From: ALPAC-4 <81249838+ALPAC-4@users.noreply.github.com> Date: Tue, 12 Nov 2024 18:21:27 +0900 Subject: [PATCH] update type package to v0.0.22 (#223) * update type package to v0.0.22 * update version --- _packages/types/package.json | 2 +- _packages/types/src/types/Chain.ts | 10 +++++++++- _packages/types/src/zods/Chain.ts | 18 +++++++++++++++++- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/_packages/types/package.json b/_packages/types/package.json index 5cb1e8b..2922ec5 100644 --- a/_packages/types/package.json +++ b/_packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@initia/initia-registry-types", - "version": "0.0.21", + "version": "0.0.22", "description": "The package provides TypeScript type definitions and Zod integration for initia-registry.", "types": "./dist/types/index.d.ts", "exports": { diff --git a/_packages/types/src/types/Chain.ts b/_packages/types/src/types/Chain.ts index e23efcd..eb974da 100644 --- a/_packages/types/src/types/Chain.ts +++ b/_packages/types/src/types/Chain.ts @@ -15,6 +15,7 @@ export interface Chain { $schema?: string; chain_name: string; chain_id: string; + evm_chain_id?: number; pre_fork_chain_name?: string; pretty_name?: string; website?: string; @@ -193,7 +194,14 @@ export interface Chain { grpc?: Endpoint[]; wss?: Endpoint[]; "grpc-web"?: Endpoint[]; - "evm-http-jsonrpc"?: Endpoint[]; + /** + * Evm json rpc uri + */ + "json-rpc"?: SecureEndpoint[]; + /** + * Evm json rpc websocket uri + */ + "json-rpc-websocket"?: Endpoint[]; }; explorers?: Explorer[]; faucets?: Faucet[]; diff --git a/_packages/types/src/zods/Chain.ts b/_packages/types/src/zods/Chain.ts index 9f47e14..670dd20 100644 --- a/_packages/types/src/zods/Chain.ts +++ b/_packages/types/src/zods/Chain.ts @@ -8,6 +8,7 @@ export const ChainSchema = z .optional(), chain_name: z.string().regex(new RegExp("[a-z0-9]+")), chain_id: z.string().regex(new RegExp("[a-z0-9]+")), + evm_chain_id: z.number().optional(), pre_fork_chain_name: z.string().regex(new RegExp("[a-z0-9]+")).optional(), pretty_name: z.string().optional(), website: z.string().url().optional(), @@ -402,7 +403,21 @@ export const ChainSchema = z .strict() ) .optional(), - "evm-http-jsonrpc": z + "json-rpc": z + .array( + z + .object({ + address: z.string().url().regex(new RegExp("^https://.")), + provider: z.string().optional(), + archive: z.boolean().default(false), + authorizedUser: z.string().optional(), + indexForSkip: z.number().optional(), + }) + .strict() + ) + .describe("Evm json rpc uri") + .optional(), + "json-rpc-websocket": z .array( z .object({ @@ -414,6 +429,7 @@ export const ChainSchema = z }) .strict() ) + .describe("Evm json rpc websocket uri") .optional(), }) .strict(),