From 14ac1b969fb224ce4615585d2f8a0883d49e8ed5 Mon Sep 17 00:00:00 2001 From: yuli-ferna Date: Tue, 10 Dec 2024 15:16:27 -0400 Subject: [PATCH] const file --- src/utils/consts.ts | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/utils/consts.ts b/src/utils/consts.ts index 57fda0ca6..91071ab3c 100644 --- a/src/utils/consts.ts +++ b/src/utils/consts.ts @@ -32,7 +32,6 @@ import { CHAIN_ID_WORMCHAIN, CONTRACTS, coalesceChainName, - isEVMChain, isTerraChain, TerraChainId, hexToNativeString, @@ -46,6 +45,7 @@ import { CHAIN_ID_XLAYER, CHAIN_ID_MANTLE, } from "@certusone/wormhole-sdk"; +//import { chainIdToChain, chainToPlatform } from '@wormhole-foundation/sdk'; import { clusterApiUrl } from "@solana/web3.js"; import { getAddress } from "ethers/lib/utils"; import seiIcon from "../icons/sei.svg"; @@ -110,6 +110,16 @@ export interface ChainInfo { logo: string; } +// TO DO: Deprecate certusone to get the new chains configuration +export const CHAIN_ID_WORLDCHAIN = 45 as ChainId; + +export const isEVMChain = (chainId: ChainId) =>{ + // @ts-ignore + const chain = chainIdToChain(chainId as any); + // @ts-ignore + return chainToPlatform(chain) === "Evm"; +}; + export const DISABLED_CHAINS: Array> = [ CHAIN_ID_BLAST, CHAIN_ID_SCROLL, @@ -260,6 +270,11 @@ export const CHAINS: ChainInfo[] = name: "XPLA", logo: xplaIcon, }, + { + id: CHAIN_ID_WORLDCHAIN, + name: "World Chain", + logo: xplaIcon, // change + }, ] : CLUSTER === "testnet" ? [ @@ -398,6 +413,11 @@ export const CHAINS: ChainInfo[] = name: "XPLA", logo: xplaIcon, }, + { + id: CHAIN_ID_WORLDCHAIN, + name: "World Chain", + logo: xplaIcon, + }, ] : [ { @@ -818,6 +838,8 @@ export const XLAYER_NETWORK_CHAIN_ID = CLUSTER === "mainnet" ? 196 : CLUSTER === "testnet" ? 195 : 1381; export const MANTLE_NETWORK_CHAIN_ID = CLUSTER === "mainnet" ? 5000 : CLUSTER === "testnet" ? 5001 : 1381; +export const WORLDCHAIN_NETWORK_CHAIN_ID = + CLUSTER === "mainnet" ? 480 : CLUSTER === "testnet" ? 4801 : 1381; export const getEvmChainId = (chainId: ChainId) => chainId === CHAIN_ID_ETH @@ -858,6 +880,8 @@ export const getEvmChainId = (chainId: ChainId) => ? XLAYER_NETWORK_CHAIN_ID : chainId === CHAIN_ID_MANTLE ? MANTLE_NETWORK_CHAIN_ID + : chainId === CHAIN_ID_WORLDCHAIN + ? WORLDCHAIN_NETWORK_CHAIN_ID : undefined; export const SOLANA_HOST = process.env.REACT_APP_SOLANA_API_URL ? process.env.REACT_APP_SOLANA_API_URL