diff --git a/packages/apps/public/images/network/gnosis.png b/packages/apps/public/images/network/gnosis.png new file mode 100644 index 000000000..1e3b7e33d Binary files /dev/null and b/packages/apps/public/images/network/gnosis.png differ diff --git a/packages/apps/public/images/token/xdai.png b/packages/apps/public/images/token/xdai.png new file mode 100644 index 000000000..10b2efaa0 Binary files /dev/null and b/packages/apps/public/images/token/xdai.png differ diff --git a/packages/apps/src/config/chains/bsc.ts b/packages/apps/src/config/chains/bsc.ts index b2343cb41..c7f26a68a 100644 --- a/packages/apps/src/config/chains/bsc.ts +++ b/packages/apps/src/config/chains/bsc.ts @@ -54,6 +54,7 @@ export const bscChain: ChainConfig = { { target: { network: "arbitrum", symbol: "USDT" }, bridge: { category: "lnbridgev20-default" } }, { target: { network: "op", symbol: "USDT" }, bridge: { category: "lnbridgev20-default" } }, { target: { network: "linea", symbol: "USDT" }, bridge: { category: "lnbridgev20-default" } }, + { target: { network: "polygon-zkEvm", symbol: "USDT" }, bridge: { category: "lnbridgev20-default" } }, ], }, { diff --git a/packages/apps/src/config/chains/gnosis.ts b/packages/apps/src/config/chains/gnosis.ts new file mode 100644 index 000000000..8dd2b466e --- /dev/null +++ b/packages/apps/src/config/chains/gnosis.ts @@ -0,0 +1,56 @@ +import { ChainConfig, ChainID } from "@/types"; + +export const gnosisChain: ChainConfig = { + /** + * Chain + */ + id: ChainID.GNOSIS, + network: "gnosis", + name: "Gnosis Chain", + nativeCurrency: { + name: "xDai", + symbol: "xDai", + decimals: 18, + }, + rpcUrls: { + default: { + http: ["https://rpc.gnosischain.com/"], + webSocket: [], + }, + public: { + http: ["https://rpc.gnosischain.com/"], + webSocket: [], + }, + }, + blockExplorers: { + default: { + name: "GnosisScan", + url: "https://gnosisscan.io/", + }, + }, + + /** + * Custom + */ + logo: "gnosis.png", + tokens: [ + { + decimals: 18, + symbol: "xDai", + name: "xDai", + type: "native", + address: "0x0000000000000000000000000000000000000000", + logo: "xdai.svg", + cross: [], + }, + { + decimals: 18, + symbol: "USDT", + name: "USDT", + type: "erc20", + address: "0x4ECaBa5870353805a9F068101A40E0f32ed605C6", + logo: "usdt.png", + cross: [{ target: { network: "bsc", symbol: "USDT" }, bridge: { category: "lnbridgev20-default" } }], + }, + ], +}; diff --git a/packages/apps/src/config/chains/index.ts b/packages/apps/src/config/chains/index.ts index 25ad60548..ef568171b 100644 --- a/packages/apps/src/config/chains/index.ts +++ b/packages/apps/src/config/chains/index.ts @@ -16,6 +16,8 @@ export * from "./optimism"; export * from "./pangolin"; export * from "./pangoro"; export * from "./polygon"; +export * from "./polygon-zkevm"; export * from "./scroll"; export * from "./zksync"; export * from "./zksync-goerli"; +export * from "./gnosis"; diff --git a/packages/apps/src/config/chains/polygon-zkevm.ts b/packages/apps/src/config/chains/polygon-zkevm.ts new file mode 100644 index 000000000..87c79f4df --- /dev/null +++ b/packages/apps/src/config/chains/polygon-zkevm.ts @@ -0,0 +1,59 @@ +import { ChainConfig, ChainID } from "@/types"; + +export const polygonZkEvmChain: ChainConfig = { + /** + * Chain + */ + id: ChainID.POLYGON_ZKEVM, + network: "polygon-zkEvm", + name: "Polygon zkEVM", + nativeCurrency: { + name: "ETH", + symbol: "ETH", + decimals: 18, + }, + rpcUrls: { + default: { + http: ["https://zkevm-rpc.com"], + webSocket: [], + }, + public: { + http: ["https://zkevm-rpc.com"], + webSocket: [], + }, + }, + blockExplorers: { + default: { + name: "Polygonscan", + url: "https://zkevm.polygonscan.com/", + }, + }, + + /** + * Custom + */ + logo: "polygon.png", + tokens: [ + { + decimals: 18, + symbol: "ETH", + name: "ETH", + type: "native", + address: "0x0000000000000000000000000000000000000000", + logo: "eth.svg", + cross: [], + }, + { + decimals: 18, + symbol: "USDT", + name: "USDT", + type: "erc20", + address: "0x1E4a5963aBFD975d8c9021ce480b42188849D41d", + logo: "usdt.png", + cross: [ + { target: { network: "polygon", symbol: "USDT" }, bridge: { category: "lnbridgev20-default" } }, + { target: { network: "bsc", symbol: "USDT" }, bridge: { category: "lnbridgev20-default" } }, + ], + }, + ], +}; diff --git a/packages/apps/src/config/chains/polygon.ts b/packages/apps/src/config/chains/polygon.ts index 1ac64fbb2..cd8f1f22b 100644 --- a/packages/apps/src/config/chains/polygon.ts +++ b/packages/apps/src/config/chains/polygon.ts @@ -52,5 +52,14 @@ export const polygonChain: ChainConfig = { logo: "ring.svg", cross: [{ target: { network: "arbitrum", symbol: "RING" }, bridge: { category: "lnbridgev20-default" } }], }, + { + decimals: 18, + symbol: "USDT", + name: "USDT", + type: "erc20", + address: "0xc2132D05D31c914a87C6611C10748AEb04B58e8F", + logo: "usdt.png", + cross: [{ target: { network: "polygon-zkEvm", symbol: "USDT" }, bridge: { category: "lnbridgev20-default" } }], + }, ], }; diff --git a/packages/apps/src/types/chain.ts b/packages/apps/src/types/chain.ts index 11f0ea62b..b96f44861 100644 --- a/packages/apps/src/types/chain.ts +++ b/packages/apps/src/types/chain.ts @@ -24,6 +24,7 @@ export enum ChainID { MUMBAI = 80001, POLYGON = 137, + POLYGON_ZKEVM = 1101, BASE = 8453, BASE_GOERLI = 84531, @@ -31,6 +32,7 @@ export enum ChainID { SCROLL = 534352, BSC = 56, OPTIMISM = 10, + GNOSIS = 100, } // According to graphql indexer @@ -50,6 +52,8 @@ export type Network = | "mantle" | "mantle-goerli" | "polygon" + | "polygon-zkEvm" + | "gnosis" | "mumbai" | "scroll" | "base-goerli" diff --git a/packages/apps/src/types/token.ts b/packages/apps/src/types/token.ts index 2ff822e85..bd19d8508 100644 --- a/packages/apps/src/types/token.ts +++ b/packages/apps/src/types/token.ts @@ -15,7 +15,8 @@ export type TokenSymbol = | "xWCRAB" | "MNT" | "MATIC" - | "BNB"; + | "BNB" + | "xDai"; export type TokenType = "native" | "erc20" | "mapping"; diff --git a/packages/apps/src/utils/chain.ts b/packages/apps/src/utils/chain.ts index df6753178..7b9799179 100644 --- a/packages/apps/src/utils/chain.ts +++ b/packages/apps/src/utils/chain.ts @@ -6,6 +6,7 @@ import { crabChain, darwiniaChain, ethereumChain, + gnosisChain, goerliChain, lineaChain, lineaGoerliChain, @@ -15,6 +16,7 @@ import { pangolinChain, pangoroChain, polygonChain, + polygonZkEvmChain, scrollChain, zksyncChain, zksyncGoerliChain, @@ -71,6 +73,9 @@ export function getChainConfig(chainIdOrNetwork?: ChainID | Network | null): Cha case ChainID.POLYGON: case "polygon": return polygonChain; + case ChainID.POLYGON_ZKEVM: + case "polygon-zkEvm": + return polygonZkEvmChain; case ChainID.MUMBAI: case "mumbai": return mumbaiChain; @@ -89,6 +94,9 @@ export function getChainConfig(chainIdOrNetwork?: ChainID | Network | null): Cha case ChainID.OPTIMISM: case "op": return optimismChain; + case ChainID.GNOSIS: + case "gnosis": + return gnosisChain; default: return; } @@ -112,11 +120,13 @@ export function getChainConfigs(askAll?: boolean) { zksyncGoerliChain, mumbaiChain, polygonChain, + polygonZkEvmChain, scrollChain, baseChain, baseGoerliChain, bscChain, optimismChain, + gnosisChain, ].sort((a, b) => a.name.localeCompare(b.name)); if (askAll) {