Skip to content

Commit

Permalink
Merge pull request #57 from SocketDotTech/add-chains
Browse files Browse the repository at this point in the history
feat: latest dl chains
  • Loading branch information
arthcp authored Dec 21, 2023
2 parents 8a6047a + c883ac2 commit e4f05ba
Show file tree
Hide file tree
Showing 8 changed files with 1,714 additions and 160 deletions.
19 changes: 9 additions & 10 deletions src/components/Contracts/ChainConfig.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { config } from "./config";
import { chainDetails } from "./chainDetails";
import deployments from "./deployments.json";
import { shortenAddress } from "../../utils/shortenAddress";

Expand All @@ -11,29 +11,28 @@ function ChainConfig() {
<div className="info-card w-80 m-2">
<div className="flex align-center font-bold text-lg p-1">
<img
src={config[Object.keys(deployments)[index]].logoURI}
className="h-6 w-6 rounded-full"
alt="chain logo"
src={chainDetails[Object.keys(deployments)[index]].logoURI}
className="h-6 w-6 rounded-full my-auto"
alt="C"
/>
<span className="mx-1">
{config[Object.keys(deployments)[index]].chainName}{" "}
<span className="mx-1 my-auto">
{chainDetails[Object.keys(deployments)[index]].chainName}{" "}
</span>
</div>

<div className="pl-1 mt-2">
{" "}
<div className="">
<span className="font-semibold"> Chain Slug : </span>{" "}
{config[Object.keys(deployments)[index]].chainId}{" "}
{chainDetails[Object.keys(deployments)[index]].chainId}{" "}
</div>
<div>
<div>
{" "}
<span className="font-semibold"> Socket : </span>
<a
href={`${
config[Object.keys(deployments)[index]].blockExplorerUrl
}/address/${item["Socket"]}`}
href={`${chainDetails[Object.keys(deployments)[index]].blockExplorerUrl
}/address/${item["Socket"]}`}
target="_blank"
>
{" "}
Expand Down
4 changes: 2 additions & 2 deletions src/components/Contracts/Dropdown.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from "react";
import { config } from "./config";
import { chainDetails } from "./chainDetails";

function DropdownComponent({
selectedChainId,
Expand All @@ -12,7 +12,7 @@ function DropdownComponent({
className="h-10 px-2 rounded text-sm border-gray-300"
onChange={(e) => onChangeAction(e.target.value)}
>
{Object.values(config).map((item) => {
{Object.values(chainDetails).map((item) => {
if (item.chainId.toString() != excludeChainId) {
return item.chainId == selectedChainId ? (
<option selected value={item.chainId}>
Expand Down
4 changes: 2 additions & 2 deletions src/components/Contracts/SwitchboardAddresses.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useEffect, useState } from "react";
import Dropdown from "./Dropdown";
import deployments from "./deployments.json";
import { config } from "./config";
import { chainDetails } from "./chainDetails";
import { PathDropdown } from "./Dropdown";

enum PATH {
Expand All @@ -18,7 +18,7 @@ function SwitchboardAddresses() {
const [selectedPath, setSelectedPath] = useState(PATH.FAST);

useEffect(() => {
const k = Object.keys(config).filter(
const k = Object.keys(chainDetails).filter(
(id) => id !== selectedChainId.toString()
);

Expand Down
116 changes: 116 additions & 0 deletions src/components/Contracts/chainDetails.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
export const chainDetails = {
1: {
chainId: 1,
chainName: "Ethereum",
blockExplorerUrl: "https://etherscan.io",
logoURI: "https://movricons.s3.ap-south-1.amazonaws.com/Ether.svg",
},
5: {
chainId: 5,
chainName: "Goerli",
blockExplorerUrl: "https://goerli.etherscan.io",
logoURI: "https://movricons.s3.ap-south-1.amazonaws.com/Ether.svg",
},
10: {
chainId: 10,
chainName: "Optimism",
blockExplorerUrl: "https://optimistic.etherscan.io",
logoURI: "https://movricons.s3.ap-south-1.amazonaws.com/Optimism.svg",
},
56: {
chainId: 56,
chainName: "BNB Chain",
blockExplorerUrl: "https://bscscan.com",
logoURI: "https://movricons.s3.ap-south-1.amazonaws.com/BSC.svg",
},
137: {
chainId: 137,
chainName: "Polygon",
blockExplorerUrl: "https://polygonscan.com",
logoURI: "https://movricons.s3.ap-south-1.amazonaws.com/Matic.svg",
},
420: {
chainId: 420,
chainName: "Optimism Goerli",
blockExplorerUrl: "https://goerli-optimism.etherscan.io",
logoURI: "https://movricons.s3.ap-south-1.amazonaws.com/Optimism.svg",
},
647: {
chainId: 647,
chainName: "Stavanger testnet",
blockExplorerUrl: "https://sn2-stavanger-blockscout.eu-north-2.gateway.fm",
logoURI: "https://movricons.s3.ap-south-1.amazonaws.com/Matic.svg",
},
901: {
chainId: 901,
chainName: "Lyra testnet",
blockExplorerUrl: "https://explorerl2new-prod-testnet-0eakp60405.t.conduit.xyz",
logoURI: "/img/lyra-logo.png",
},
957: {
chainId: 957,
chainName: "Lyra",
blockExplorerUrl: "https://explorer.lyra.finance",
logoURI: "/img/lyra-logo.png",
},
2999: {
chainId: 2999,
chainName: "Aevo",
blockExplorerUrl: "https://explorer.aevo.xyz",
logoURI: "/img/aevo-logo.png",
},
42161: {
chainId: 42161,
chainName: "Arbitrum",
blockExplorerUrl: "https://arbiscan.io",
logoURI: "https://movricons.s3.ap-south-1.amazonaws.com/Arbitrum.svg",
},
80001: {
chainId: 80001,
chainName: "Polygon Mumbai testnet",
blockExplorerUrl: "https://mumbai.polygonscan.com",
logoURI: "https://movricons.s3.ap-south-1.amazonaws.com/Matic.svg",
},
421613: {
chainId: 421613,
chainName: "Arbitrum Goerli",
blockExplorerUrl: "https://goerli.arbiscan.io",
logoURI: "https://movricons.s3.ap-south-1.amazonaws.com/Arbitrum.svg",
},
421614: {
chainId: 421614,
chainName: "Arbitrum Sepolia",
blockExplorerUrl: "https://sepolia.arbiscan.io",
logoURI: "https://movricons.s3.ap-south-1.amazonaws.com/Arbitrum.svg",
},
11155111: {
chainId: 11155111,
chainName: "Sepolia",
blockExplorerUrl: "https://sepolia.etherscan.io",
logoURI: "https://movricons.s3.ap-south-1.amazonaws.com/Ether.svg",
},
11155112: {
chainId: 11155112,
chainName: "Aevo testnet",
blockExplorerUrl: "https://explorer-testnet.aevo.xyz",
logoURI: "/img/aevo-logo.png",
},
11155420: {
chainId: 11155420,
chainName: "Optimism Sepolia",
blockExplorerUrl: "https://sepolia-optimism.etherscan.io",
logoURI: "https://movricons.s3.ap-south-1.amazonaws.com/Optimism.svg",
},
686669576: {
chainId: 686669576,
chainName: "SX Network Testnet",
blockExplorerUrl: "https://explorer.toronto.sx.technology",
logoURI: "/img/sx-logo.png",
},
1399904803: {
chainId: 1399904803,
chainName: "XAI Testnet",
blockExplorerUrl: "https://testnet-explorer.xai-chain.net",
logoURI: "/img/xai-logo.png",
},
};
50 changes: 0 additions & 50 deletions src/components/Contracts/config.ts

This file was deleted.

Loading

0 comments on commit e4f05ba

Please sign in to comment.