From 031e51490c7eef4cbc78db704645d30a65fbd042 Mon Sep 17 00:00:00 2001 From: "James Morris, MS" <96435344+james-a-morris@users.noreply.github.com> Date: Thu, 7 Mar 2024 13:38:07 -0700 Subject: [PATCH] feat(network-utils): add check if ChainId is Linea (#580) --- package.json | 2 +- src/utils/NetworkUtils.ts | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 75b9a31d5..726664cd3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@across-protocol/sdk-v2", "author": "UMA Team", - "version": "0.22.8", + "version": "0.22.9", "license": "AGPL-3.0", "homepage": "https://docs.across.to/v/developer-docs/developers/across-sdk", "files": [ diff --git a/src/utils/NetworkUtils.ts b/src/utils/NetworkUtils.ts index 184fa6d9f..9a2eca41f 100644 --- a/src/utils/NetworkUtils.ts +++ b/src/utils/NetworkUtils.ts @@ -89,3 +89,12 @@ export function chainIsOPStack(chainId: number): boolean { export function chainIsArbitrum(chainId: number): boolean { return [CHAIN_IDs.ARBITRUM, CHAIN_IDs.ARBITRUM_GOERLI, CHAIN_IDs.ARBITRUM_SEPOLIA].includes(chainId); } + +/** + * Determines whether a chain ID is a Linea implementation. + * @param chainId Chain ID to evaluate. + * @returns True if chainId is a Linea chain, otherwise false. + */ +export function chainIsLinea(chainId: number): boolean { + return [CHAIN_IDs.LINEA, CHAIN_IDs.LINEA_GOERLI].includes(chainId); +}