From cdc702ea09679d10c6a6ff21a0959f9aaf5a664a Mon Sep 17 00:00:00 2001 From: Ares-Solidity-Finance Date: Fri, 12 Apr 2024 16:14:08 -0400 Subject: [PATCH] fixed explorer links --- src/utils/getExplorerLink.ts | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/src/utils/getExplorerLink.ts b/src/utils/getExplorerLink.ts index 671e20ff8f9..5f97334bbed 100644 --- a/src/utils/getExplorerLink.ts +++ b/src/utils/getExplorerLink.ts @@ -2,6 +2,12 @@ import { SupportedChainId } from '../constants/chains' const ETHERSCAN_PREFIXES: { [chainId: number]: string } = { [SupportedChainId.MAINNET]: '', + [SupportedChainId.SEPOLIA]: 'sepolia.', + [SupportedChainId.BASE_SEPOLIA]: 'sepolia.', +} + +const ETHERSCAN_DOMAINS: { [chainId: number]: string } = { + [SupportedChainId.BASE_SEPOLIA]: 'basescan.org', } export enum ExplorerDataType { @@ -18,20 +24,8 @@ export enum ExplorerDataType { * @param type the type of the data */ export function getExplorerLink(chainId: number, data: string, type: ExplorerDataType): string { - if (chainId === SupportedChainId.SEPOLIA) { - switch (type) { - case ExplorerDataType.TRANSACTION: - return `https://mainnet-arb-explorer.netlify.app/tx/${data}` - case ExplorerDataType.ADDRESS: - return `https://mainnet-arb-explorer.netlify.app/address/${data}` - case ExplorerDataType.BLOCK: - return `https://mainnet-arb-explorer.netlify.app/block/${data}` - default: - return `https://mainnet-arb-explorer.netlify.app` - } - } - const prefix = `https://${ETHERSCAN_PREFIXES[chainId] ?? ''}etherscan.io` + const prefix = `https://${ETHERSCAN_PREFIXES[chainId] ?? ''}${ETHERSCAN_DOMAINS[chainId] ?? 'etherscan.io'}` switch (type) { case ExplorerDataType.TRANSACTION: