Skip to content

Commit

Permalink
feat: As a user, I want to check attestations from all networks via t…
Browse files Browse the repository at this point in the history
…he Explorer
  • Loading branch information
alainncls committed May 16, 2024
1 parent 9d8c288 commit 961a516
Show file tree
Hide file tree
Showing 13 changed files with 3,438 additions and 2,802 deletions.
2 changes: 1 addition & 1 deletion explorer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"dependencies": {
"@radix-ui/react-dropdown-menu": "^2.0.6",
"@tanstack/react-table": "^8.10.7",
"@verax-attestation-registry/verax-sdk": "1.2.1",
"@verax-attestation-registry/verax-sdk": "1.6.0",
"@wagmi/core": "^1.4.7",
"abitype": "^0.10.3",
"class-variance-authority": "^0.7.0",
Expand Down
36 changes: 36 additions & 0 deletions explorer/src/assets/networks/arbitrum-nova-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions explorer/src/assets/networks/arbitrum-nova.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions explorer/src/assets/networks/arbitrum-sepolia.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions explorer/src/assets/networks/base-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions explorer/src/assets/networks/base-sepolia.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions explorer/src/assets/networks/base.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions explorer/src/assets/networks/linea-sepolia.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 8 additions & 3 deletions explorer/src/components/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,23 @@ export const Header: React.FC<HeaderProps> = ({ isOpened, setIsOpened }) => {
{!screen.sm && !isHomePage && <SearchInput />}
{!isAdaptive && <LightDarkModeSwitcher />}
<DropdownMenu>
<DropdownMenuTrigger className="DropdownMenuTrigger select-none w-[72px] p-2 rounded-md outline-none hover:bg-jumbotronLight dark:hover:bg-jumbotronDark justify-start items-center gap-2 inline-flex transition dark:text-whiteDefault">
<DropdownMenuTrigger
className="DropdownMenuTrigger select-none w-[72px] p-2 rounded-md outline-none hover:bg-jumbotronLight dark:hover:bg-jumbotronDark justify-start items-center gap-2 inline-flex transition dark:text-whiteDefault">
{isDarkMode && network.imgDark ? network.imgDark : network.img}
<ChevronDown className="header-arrow w-6 h-6 relative" />
</DropdownMenuTrigger>
<DropdownMenuContent className="flex flex-col gap-2 bg-surface-primary dark:bg-blackDefault dark:border-border-cardDark">
<DropdownMenuContent
className="flex flex-col gap-2 bg-surface-primary dark:bg-blackDefault dark:border-border-cardDark">
{chains.map((chain) => (
<DropdownMenuItem
key={chain.name}
className="flex gap-2 focus:bg-jumbotronLight dark:focus:bg-jumbotronDark dark:text-whiteDefault cursor-pointer transition"
onClick={() => setNetwork(chain)}
>
{isDarkMode && chain.imgDark ? chain.imgDark : chain.img}
<div style={{
width: "24px",
height: "24px",
}}>{isDarkMode && chain.imgDark ? chain.imgDark : chain.img}</div>
{chain.name}
</DropdownMenuItem>
))}
Expand Down
84 changes: 75 additions & 9 deletions explorer/src/config/index.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,53 @@
import { VeraxSdk } from "@verax-attestation-registry/verax-sdk";
import { getDefaultConfig } from "connectkit";
import { createConfig } from "wagmi";
import { arbitrum, arbitrumGoerli, linea, lineaTestnet } from "wagmi/chains";
import { Chain, createConfig } from "wagmi";
import { arbitrum, arbitrumNova, arbitrumSepolia, base, baseSepolia, linea, lineaTestnet } from "wagmi/chains";

import veraxColoredIcon from "@/assets/logo/verax-colored-icon.svg";
import ArbitrumIconDark from "@/assets/networks/arbitrum-dark.svg?react";
import ArbitrumGoerliIcon from "@/assets/networks/arbitrum-goerli.svg?react";
import ArbitrumNovaIconDark from "@/assets/networks/arbitrum-nova-dark.svg?react";
import ArbitrumNovaIcon from "@/assets/networks/arbitrum-nova.svg?react";
import ArbitrumSepoliaIcon from "@/assets/networks/arbitrum-sepolia.svg?react";
import ArbitrumIcon from "@/assets/networks/arbitrum.svg?react";
import BaseIconDark from "@/assets/networks/base-dark.svg?react";
import BaseSepoliaIcon from "@/assets/networks/base-sepolia.svg?react";
import BaseIcon from "@/assets/networks/base.svg?react";
import LineaMainnetIconDark from "@/assets/networks/linea-mainnet-dark.svg?react";
import LineaMainnetIcon from "@/assets/networks/linea-mainnet.svg?react";
import LineaSepoliaIcon from "@/assets/networks/linea-sepolia.svg?react";
import LineaTestnetIcon from "@/assets/networks/linea-testnet.svg?react";
import { INetwork } from "@/interfaces/config";

const lineaSepolia = {
id: 59_141,
name: "Linea Sepolia Testnet",
network: "linea-sepolia",
nativeCurrency: { name: "Linea Ether", symbol: "ETH", decimals: 18 },
rpcUrls: {
default: {
http: ["https://rpc.sepolia.linea.build"],
webSocket: ["wss://rpc.sepolia.linea.build"],
},
public: {
http: ["https://rpc.sepolia.linea.build"],
webSocket: ["wss://rpc.sepolia.linea.build"],
},
},
blockExplorers: {
default: {
name: "Etherscan",
url: "https://sepolia.lineascan.build",
},
},
contracts: {
multicall3: {
address: "0xca11bde05977b3631167028862be2a173976ca11",
blockCreated: 227427,
},
},
testnet: true,
} as const satisfies Chain;

const chains: INetwork[] = [
{
name: "Linea Mainnet",
Expand All @@ -28,6 +64,13 @@ const chains: INetwork[] = [
img: <LineaTestnetIcon />,
network: "linea-testnet",
},
{
name: "Linea Sepolia",
chain: lineaSepolia,
veraxEnv: VeraxSdk.DEFAULT_LINEA_SEPOLIA_FRONTEND,
img: <LineaSepoliaIcon />,
network: "linea-sepolia",
},
{
name: "Arbitrum",
chain: arbitrum,
Expand All @@ -37,11 +80,34 @@ const chains: INetwork[] = [
network: "arbitrum",
},
{
name: "Arbitrum Goerli",
chain: arbitrumGoerli,
veraxEnv: VeraxSdk.DEFAULT_ARBITRUM_TESTNET_FRONTEND,
img: <ArbitrumGoerliIcon />,
network: "arbitrum-goerli",
name: "Arbitrum Sepolia",
chain: arbitrumSepolia,
veraxEnv: VeraxSdk.DEFAULT_ARBITRUM_SEPOLIA_FRONTEND,
img: <ArbitrumSepoliaIcon />,
network: "arbitrum-sepolia",
},
{
name: "Arbitrum Nova",
chain: arbitrumNova,
veraxEnv: VeraxSdk.DEFAULT_ARBITRUM_NOVA_FRONTEND,
img: <ArbitrumNovaIcon />,
imgDark: <ArbitrumNovaIconDark />,
network: "arbitrum-nova",
},
{
name: "Base Mainnet",
chain: base,
veraxEnv: VeraxSdk.DEFAULT_BASE_FRONTEND,
img: <BaseIcon />,
imgDark: <BaseIconDark />,
network: "base-mainnet",
},
{
name: "Base Sepolia",
chain: baseSepolia,
veraxEnv: VeraxSdk.DEFAULT_BASE_SEPOLIA_FRONTEND,
img: <BaseSepoliaIcon />,
network: "base-sepolia",
},
];

Expand All @@ -58,4 +124,4 @@ const config = createConfig(

const defaultChain = chains[0];

export { chains, config, defaultChain };
export { lineaSepolia, chains, config, defaultChain };
21 changes: 17 additions & 4 deletions explorer/src/constants/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { arbitrum, arbitrumGoerli, linea, lineaTestnet } from "wagmi/chains";
import { arbitrum, arbitrumNova, arbitrumSepolia, base, baseSepolia, linea, lineaTestnet } from "wagmi/chains";

import { lineaSepolia } from "@/config";

export const EMPTY_STRING = "";
export const SPACE_STRING = " ";
Expand All @@ -14,17 +16,28 @@ export const BILLION = 1e9;

export const links: Record<number, { trx?: string; address: string }> = {
[linea.id]: {
trx: "https://lineascan.build/trx",
address: "https://lineascan.build/address",
},
[lineaTestnet.id]: {
address: "https://goerli.lineascan.build/address",
},
[lineaSepolia.id]: {
address: "https://goerli.lineascan.build/address",
},
[arbitrum.id]: {
address: "https://arbiscan.io/address",
},
[arbitrumGoerli.id]: {
address: "https://testnet.arbiscan.io/address",
[arbitrumSepolia.id]: {
address: "https://sepolia.arbiscan.io/address",
},
[arbitrumNova.id]: {
address: "https://nova.arbiscan.io/address",
},
[base.id]: {
address: "https://basescan.org/address",
},
[baseSepolia.id]: {
address: "https://sepolia.basescan.org/address",
},
};

Expand Down
Loading

0 comments on commit 961a516

Please sign in to comment.