Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions web/src/components/WrongChainBoundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import styled from "styled-components";
import { ErrorBoundary } from "react-error-boundary";
import { Button } from "@kleros/ui-components-library";
import { switchChain } from "utils/switchChain";
import { DEFAULT_CHAIN, SUPPORTED_CHAINS } from "consts/supportedChains";

const WrongChainRecovery: React.FC<{ resetErrorBoundary: () => void }> = ({
resetErrorBoundary,
Expand All @@ -13,10 +14,10 @@ const WrongChainRecovery: React.FC<{ resetErrorBoundary: () => void }> = ({
<Button
isLoading={loading}
disabled={loading}
text="Switch to Arbitrum"
text={`Switch to ${SUPPORTED_CHAINS[DEFAULT_CHAIN].chainName}`}
onClick={() => {
setLoading(true);
switchChain(421611)
switchChain(DEFAULT_CHAIN)
.then(resetErrorBoundary)
.finally(() => setLoading(false));
}}
Expand Down
10 changes: 6 additions & 4 deletions web/src/consts/supportedChains.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
export const SUPPORTED_CHAINS = {
421611: {
chainName: "Arbitrum Rinkeby",
421613: {
chainName: "Arbitrum Goerli",
nativeCurrency: { name: "ETH", symbol: "ETH", decimals: 18 },
rpcUrls: ["https://rinkeby.arbitrum.io/rpc"],
blockExplorerUrls: ["https://testnet.arbiscan.io/"],
rpcUrls: ["https://goerli-rollup.arbitrum.io/rpc"],
blockExplorerUrls: ["https://goerli.arbiscan.io/"],
},
};

export const DEFAULT_CHAIN = 421613;

export const SUPPORTED_CHAINIDS = Object.keys(SUPPORTED_CHAINS).map((x) =>
parseInt(x)
);