Skip to content

feat: change etherscan to explorer #521

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 25, 2025
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: 5 additions & 0 deletions .changeset/tall-queens-share.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@roll-network/web3': patch
---

Added Form to etherscan data
5 changes: 5 additions & 0 deletions .changeset/tough-yaks-draw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@roll-network/design-system': patch
---

Updated Etherscan keyword to Explorer
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const AccountDropdown = ({ onSwitchAccounts }: Props) => {
/>
<SwitchAccountLink
icon={<LinkIcon />}
title="View on Etherscan"
title="View on Explorer"
href={etherscanAccountUrl(address || '')}
/>
</View>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const AccountDropdownWagmi = ({ onSwitchAccounts }: Props) => {
/>
<SwitchAccountLink
icon={<LinkIcon />}
title="View on Etherscan"
title="View on Explorer"
href={etherscanAccountUrl(address || '')}
/>
</View>
Expand Down
2 changes: 1 addition & 1 deletion packages/design-system/src/molecules/tokenCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const TokenCard: React.FC<TokenCardProps> = ({
}) => {
const theme = useThemeV2()
const hasAddress = !!address
const linkText = hasAddress ? 'Etherscan' : 'Draft'
const linkText = hasAddress ? 'Explorer' : 'Draft'
const clipboardWithToast = useClipboardWithToast()

const onPressEtherscanLink = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe('TokenCard', () => {
expect(symbol).toBeDefined()
})
it('renders etherscan link if there is an address', async () => {
const etherscanLink = await screen.findByText('Etherscan')
const etherscanLink = await screen.findByText('Explorer')
expect(etherscanLink).toBeDefined()
})
it('renders draft link if there is no address', async () => {
Expand All @@ -69,7 +69,7 @@ describe('TokenCard', () => {
})
it('opens etherscan link if there is an address', async () => {
const openLink = jest.spyOn(utils, 'openLink')
const etherscanLink = await screen.findByText('Etherscan')
const etherscanLink = await screen.findByText('Explorer')
fireEvent.press(etherscanLink)
expect(openLink).toHaveBeenCalled()
})
Expand Down
5 changes: 5 additions & 0 deletions packages/web3/src/utils/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { getAddress } from 'viem'
import {
CHAIN_ID_FORM,
CHAIN_ID_FORM_TESTNET,
CHAIN_ID_GOERLI,
CHAIN_ID_MAIN_NET,
Expand Down Expand Up @@ -54,6 +55,10 @@ const ETHERSCAN_DATA: Record<number, { domain: string; prefix?: string }> = {
domain: 'form.network',
prefix: 'testnet-explorer.',
},
[CHAIN_ID_FORM]: {
domain: 'form.network',
prefix: 'explorer.',
},
}

export const getEtherscanLink = ({
Expand Down