From 90a0b7272e972d119bb48d39632932aed1416c80 Mon Sep 17 00:00:00 2001 From: AlexeyAdoniev Date: Thu, 3 Aug 2023 16:56:08 +0300 Subject: [PATCH] add collectionExplorer --- src/components/Details/DetailsList.tsx | 7 ++++--- src/constants.ts | 23 +++++++++++++++++++---- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/src/components/Details/DetailsList.tsx b/src/components/Details/DetailsList.tsx index 05a4bbe2..c76b4347 100644 --- a/src/components/Details/DetailsList.tsx +++ b/src/components/Details/DetailsList.tsx @@ -12,15 +12,16 @@ import { currency, chains, chainNoncetoName, + collectionExplorers, } from "../../constants"; -import { ethers } from "ethers"; + import ClockIcon from "../../assets/icons/clock.svg"; import { getExchangeRates } from "../../getExchangeRate"; import { formatFees, extractHash } from "./helpers"; const DetailsList = ({ data, copyProps }: DetailsCard) => { const { loading: dataLoad, event } = data; - const { setTooltipCopy, tooltipCopy, tooltips } = copyProps; + const { tooltipCopy } = copyProps; const [exchangeRates, setExchangeRates] = useState<{ [key: string]: { usd: number }; }>({}); @@ -300,7 +301,7 @@ const DetailsList = ({ data, copyProps }: DetailsCard) => { rel="noreferrer" href={`${ event?.toChain && - addressExplorers[event.toChain] + collectionExplorers[event.toChain] }${encodeURIComponent(event.destContract)}`} > diff --git a/src/constants.ts b/src/constants.ts index d7f78c4e..0eb0528a 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -67,7 +67,7 @@ export const txExplorers: any = { "18": "https://tezblock.io/transaction/", "23": "https://gatescan.org/tx/", "9": "https://tronscan.org/#/transaction/", - "25": "https://explore.vechain.org/transactions/", + "25": "https://vechainstats.com/transaction/", "15": "https://algoexplorer.io/tx/", "22": "https://v1.gwscan.com/tx/", "24": "https://www.mintscan.io/secret/transactions/", @@ -86,7 +86,7 @@ export const txExplorers: any = { }; export const addressExplorers: any = { - "4": "https://bscscan.com//address/", + "4": "https://bscscan.com/address/", "19": "https://explorer.velas.com/address/", "14": "https://blockscout.com/xdai/mainnet/address/", "2": "https://explorer.elrond.com/accounts/", @@ -101,9 +101,9 @@ export const addressExplorers: any = { "18": "https://tezblock.io/account/", "23": "https://gatescan.org/address/", "9": "https://tronscan.org/#/address/", - "25": "https://explore.vechain.org/accounts/", + "25": "https://vechainstats.com/account/", "15": "https://algoexplorer.io/address/", - "22": "https://v1.gwscan.com/tx/", + "22": "https://v1.gwscan.com/address/", "24": `https://www.mintscan.io/secret/accounts/`, "32": "https://moonscan.io/address/", "27": "https://tonscan.org/address/", @@ -119,6 +119,21 @@ export const addressExplorers: any = { "34": "https://explorer.aptoslabs.com/account/", }; +export const collectionExplorers: any = { + ...Object.entries(addressExplorers).reduce( + (acc: Object, [k, v]) => ({ + ...acc, + [k]: (v as string).replace(/(address|accounts?)\/$/, "token/"), + }), + {} + ), + "25": "https://vechainstats.com/account/", + "22": "https://v1.gwscan.com/nft-collection/", + "14": "https://gnosis.blockscout.com/address/", + "20": "https://iotexscan.io/address/", + "9": "https://tronscan.org/#/contract/", +}; + export const chainNoncetoName: any = { "0": "Unknown", "4": "BSC",