Skip to content

Commit f2c1a87

Browse files
authored
consistency explorer url directory (#3053)
1 parent 238274c commit f2c1a87

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/components/CCIP/Tables/TokenChainsTable.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,18 @@ function TokenChainsTable({ networks, token, lanes, environment }: TableProps) {
123123
<td>{network.tokenDecimals}</td>
124124
<td data-clipboard-type="token">
125125
<Address
126-
contractUrl={getExplorerAddressUrl(network.explorer)(network.tokenAddress)}
126+
contractUrl={getExplorerAddressUrl(network.explorer, network.chainType)(network.tokenAddress)}
127127
address={network.tokenAddress}
128128
endLength={6}
129129
/>
130130
</td>
131131
<td>{tokenPoolDisplay(network.tokenPoolType)}</td>
132132
<td data-clipboard-type="token-pool">
133133
<Address
134-
contractUrl={getExplorerAddressUrl(network.explorer)(network.tokenPoolAddress)}
134+
contractUrl={getExplorerAddressUrl(
135+
network.explorer,
136+
network.chainType
137+
)(network.tokenPoolAddress)}
135138
address={network.tokenPoolAddress}
136139
endLength={6}
137140
/>

src/config/data/ccip/data.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -423,13 +423,14 @@ export const getAllNetworks = ({ filter }: { filter: Environment }): Network[] =
423423
const explorer = getExplorer(supportedChain)
424424
const router = chains[chain].router
425425
if (!explorer) throw Error(`Explorer not found for ${supportedChain}`)
426-
const routerExplorerUrl = getExplorerAddressUrl(explorer)(router.address)
427-
const nativeToken = getNativeCurrency(supportedChain)
428-
if (!nativeToken) throw Error(`Native token not found for ${supportedChain}`)
429426

430427
// Determine chain type based on chain name
431428
const { chainType } = getChainTypeAndFamily(supportedChain)
432429

430+
const routerExplorerUrl = getExplorerAddressUrl(explorer, chainType)(router.address)
431+
const nativeToken = getNativeCurrency(supportedChain)
432+
if (!nativeToken) throw Error(`Native token not found for ${supportedChain}`)
433+
433434
allChains.push({
434435
name: title,
435436
logo,

0 commit comments

Comments
 (0)