Skip to content

Commit

Permalink
Merge pull request #119 from jediswaplabs/fix/explorer-link-issue
Browse files Browse the repository at this point in the history
Change the explorer link from etherscan to starkscan in transaction modal
  • Loading branch information
Ishagoyal authored Jan 16, 2024
2 parents 7598e4c + c754ffa commit 2fb4641
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/components/Tokens/TokenDetails/About.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function AboutSection({ address, chainId, description, homepageUrl, twitt
</ThemedText.SubHeaderSmall>
<ResourcesContainer data-cy="resources-container">
<Resource
name={chainId === ChainId.MAINNET ? 'Etherscan' : 'Block Explorer'}
name={chainId === ChainId.MAINNET ? 'Starkscan' : 'Block Explorer'}
link={`${explorer}${address === 'NATIVE' ? '' : 'address/' + address}`}
/>
<Resource name="More analytics" link={`${infoLink}tokens/${address}`} />
Expand Down
2 changes: 1 addition & 1 deletion src/components/TransactionConfirmationModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function TransactionSubmittedContent({ onDismiss,
.catch(() => setSuccess(false));
}, [connector, logoURL, token]);

const explorerText = chainId === ChainId.MAINNET ? t`View on Etherscan` : t`View on Block Explorer`;
const explorerText = chainId === ChainId.MAINNET ? t`View on Starkscan` : t`View on Block Explorer`;

return (
<Wrapper>
Expand Down
4 changes: 2 additions & 2 deletions src/nft/components/collection/TransactionCompleteModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ const TxCompleteModal = () => {
</Row>
<a href={txHashUrl} target="_blank" rel="noreferrer" style={{ textDecoration: 'none' }}>
<Box color="neutral2" fontWeight="book">
<Trans>View on Etherscan</Trans>
<Trans>View on Starkscan</Trans>
</Box>
</a>
</Box>
Expand Down Expand Up @@ -344,7 +344,7 @@ const TxCompleteModal = () => {
<p className={styles.totalUsdRefund}>{formatUSDPriceWithCommas(totalUSDRefund)}</p>
<Box className={styles.walletAddress} marginLeft="auto" marginRight="0">
<a href={txHashUrl} target="_blank" rel="noreferrer">
<Box className={styles.addressHash}>View on Etherscan</Box>
<Box className={styles.addressHash}>View on Starkscan</Box>
</a>
</Box>
<p className={styles.totalEthCost}>
Expand Down
8 changes: 4 additions & 4 deletions src/utils/getExplorerLink.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { ChainId } from '@uniswap/sdk-core'

const BLOCK_EXPLORER_PREFIXES: { [chainId: number]: string } = {
[ChainId.MAINNET]: 'https://etherscan.io',
[ChainId.GOERLI]: 'https://goerli.etherscan.io',
[ChainId.SEPOLIA]: 'https://sepolia.etherscan.io',
[ChainId.MAINNET]: 'https://starkscan.co',
[ChainId.GOERLI]: 'https://testnet.starkscan.co',
[ChainId.SEPOLIA]: 'https://sepolia.starkscan.co',
[ChainId.OPTIMISM]: 'https://optimistic.etherscan.io',
[ChainId.OPTIMISM_GOERLI]: 'https://goerli-optimism.etherscan.io',
[ChainId.POLYGON]: 'https://polygonscan.com',
Expand Down Expand Up @@ -57,7 +57,7 @@ export function getExplorerLink(chainId: number, data: string, type: ExplorerDat
}
}

const prefix = BLOCK_EXPLORER_PREFIXES[chainId] ?? 'https://etherscan.io'
const prefix = BLOCK_EXPLORER_PREFIXES[chainId] ?? 'https://starkscan.co/'

switch (type) {
case ExplorerDataType.TRANSACTION:
Expand Down

0 comments on commit 2fb4641

Please sign in to comment.