From cf83f126f729794c45be3544bc940d2438e328d4 Mon Sep 17 00:00:00 2001 From: Harsh Pandey Date: Mon, 20 Jan 2025 17:54:22 +0530 Subject: [PATCH] chore: add linea client (#51) --- src/rpc/chainIds.ts | 6 ++++-- src/rpc/clients.ts | 7 +++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/rpc/chainIds.ts b/src/rpc/chainIds.ts index e8576d4..d02f52e 100644 --- a/src/rpc/chainIds.ts +++ b/src/rpc/chainIds.ts @@ -24,7 +24,8 @@ import { base, gnosis, celo, - zkSync + zkSync, + linea } from 'viem/chains'; export const ChainId = { @@ -53,5 +54,6 @@ export const ChainId = { gnosis: gnosis.id, zkEVM: polygonZkEvm.id, celo: celo.id, - zkSync: zkSync.id + zkSync: zkSync.id, + linea: linea.id } as const; diff --git a/src/rpc/clients.ts b/src/rpc/clients.ts index 6619ebc..d019fe8 100644 --- a/src/rpc/clients.ts +++ b/src/rpc/clients.ts @@ -17,6 +17,7 @@ import { scroll, celo, zkSync, + linea, avalancheFuji, polygonMumbai, harmonyOne, @@ -102,6 +103,11 @@ export const zkSyncClient = createClient({ transport: http(process.env.RPC_ZKSYNC, commonConfig), }); +export const lineaClient = createClient({ + chain: linea, + transport: http(process.env.RPC_LINEA, commonConfig), +}); + export const harmonyClient = createClient({ chain: harmonyOne, transport: http(process.env.RPC_HARMONY, commonConfig), @@ -187,6 +193,7 @@ export const CHAIN_ID_CLIENT_MAP: Record = { [ChainId.zkEVM]: zkEVMClient, [ChainId.celo]: celoClient, [ChainId.zkSync]: zkSyncClient, + [ChainId.linea]: lineaClient, [ChainId.fuji]: fujiClient, [ChainId.mumbai]: mumbaiClient, [ChainId.harmony]: harmonyClient,