Skip to content

Commit

Permalink
chore: add linea client (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
brotherlymite authored Jan 20, 2025
1 parent 360627b commit cf83f12
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/rpc/chainIds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ import {
base,
gnosis,
celo,
zkSync
zkSync,
linea
} from 'viem/chains';

export const ChainId = {
Expand Down Expand Up @@ -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;
7 changes: 7 additions & 0 deletions src/rpc/clients.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
scroll,
celo,
zkSync,
linea,
avalancheFuji,
polygonMumbai,
harmonyOne,
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -187,6 +193,7 @@ export const CHAIN_ID_CLIENT_MAP: Record<number, Client> = {
[ChainId.zkEVM]: zkEVMClient,
[ChainId.celo]: celoClient,
[ChainId.zkSync]: zkSyncClient,
[ChainId.linea]: lineaClient,
[ChainId.fuji]: fujiClient,
[ChainId.mumbai]: mumbaiClient,
[ChainId.harmony]: harmonyClient,
Expand Down

0 comments on commit cf83f12

Please sign in to comment.