Skip to content

Commit

Permalink
common: update explorer URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
panoel committed Jan 26, 2024
1 parent d5fdc85 commit fd1bccf
Showing 1 changed file with 95 additions and 71 deletions.
166 changes: 95 additions & 71 deletions common/src/explorer.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {
CHAIN_ID_OPTIMISM,
CHAIN_ID_SEI,
CHAIN_ID_WORMCHAIN,
isCosmWasmChain,
isEVMChain,
tryHexToNativeString,
} from '@certusone/wormhole-sdk';
import {
ChainId,
CHAIN_ID_ACALA,
CHAIN_ID_ALGORAND,
Expand Down Expand Up @@ -35,8 +35,12 @@ import { CHAIN_INFO_MAP, Environment } from './consts';

export const explorerBlock = (network: Environment, chainId: ChainId, block: string) =>
network === 'mainnet'
? chainId === CHAIN_ID_ETH
? chainId === CHAIN_ID_SOLANA
? `https://solscan.io/block/${block}`
: chainId === CHAIN_ID_ETH
? `https://etherscan.io/block/${block}`
: chainId === CHAIN_ID_TERRA
? `https://finder.terra.money/columbus-5/block/${block}`
: chainId === CHAIN_ID_BSC
? `https://bscscan.com/block/${block}`
: chainId === CHAIN_ID_POLYGON
Expand All @@ -45,85 +49,97 @@ export const explorerBlock = (network: Environment, chainId: ChainId, block: str
? `https://snowtrace.io/block/${block}`
: chainId === CHAIN_ID_OASIS
? `https://explorer.emerald.oasis.dev/block/${block}`
: chainId === CHAIN_ID_AURORA
? `https://aurorascan.dev/block/${block}`
: chainId === CHAIN_ID_ALGORAND
? `https://app.dappflow.org/explorer/block/${block}`
: chainId === CHAIN_ID_FANTOM
? `https://ftmscan.com/block/${block}`
: chainId === CHAIN_ID_KLAYTN
? `https://scope.klaytn.com/block/${block}`
: chainId === CHAIN_ID_CELO
? `https://explorer.celo.org/block/${block}`
: chainId === CHAIN_ID_KARURA
? `https://blockscout.karura.network/block/${block}`
: chainId === CHAIN_ID_ACALA
? `https://blockscout.acala.network/block/${block}`
: chainId === CHAIN_ID_SOLANA
? `https://solscan.io/block/${block}`
: chainId === CHAIN_ID_TERRA
? `https://finder.terra.money/columbus-5/block/${block}`
: chainId === CHAIN_ID_TERRA2
? `https://finder.terra.money/phoenix-1/block/${block}`
: chainId === CHAIN_ID_ALGORAND
? `https://algoexplorer.io/block/${block}`
: chainId === CHAIN_ID_KLAYTN
? `https://scope.klaytn.com/block/${block}`
: chainId === CHAIN_ID_CELO
? `https://explorer.celo.org/block/${block}`
: chainId === CHAIN_ID_NEAR
? `https://explorer.near.org/blocks/${block}`
? `https://nearblocks.io/blocks/${block}`
: chainId === CHAIN_ID_MOONBEAM
? `https://moonscan.io/block/${block}`
: chainId === CHAIN_ID_XPLA
? `https://explorer.xpla.io/mainnet/block/${block}`
: chainId === CHAIN_ID_APTOS
? `https://explorer.aptoslabs.com/block/${block}`
: chainId === CHAIN_ID_ARBITRUM
? `https://arbiscan.io/block/${block}`
: chainId === CHAIN_ID_TERRA2
? `https://finder.terra.money/phoenix-1/block/${block}`
: chainId === CHAIN_ID_INJECTIVE
? `https://explorer.injective.network/block/${block}`
: chainId === CHAIN_ID_SUI
? `https://suiexplorer.com/checkpoint/${block}`
: chainId === CHAIN_ID_APTOS
? `https://explorer.aptoslabs.com/block/${block}`
: chainId === CHAIN_ID_ARBITRUM
? `https://arbiscan.io/block/${block}`
: chainId === CHAIN_ID_OPTIMISM
? `https://optimistic.etherscan.io/block/${block}`
: chainId === CHAIN_ID_XPLA
? `https://explorer.xpla.io/mainnet/block/${block}`
: chainId === CHAIN_ID_BASE
? `https://basescan.org/block/${block}`
: chainId === CHAIN_ID_SEI
? `https://www.seiscan.app/pacific-1/blocks/${block}`
: chainId === CHAIN_ID_WORMCHAIN
? `https://bigdipper.live/wormhole/blocks/${block}`
: ''
: chainId === CHAIN_ID_SOLANA
? `https://explorer.solana.com/${block}?cluster=testnet`
: chainId === CHAIN_ID_ETH
? `https://sepolia.etherscan.io/block/${block}`
: chainId === CHAIN_ID_BSC
: // : chainId === CHAIN_ID_TERRA <-- not supported on testnet dashboard
chainId === CHAIN_ID_BSC
? `https://testnet.bscscan.com/block/${block}`
: chainId === CHAIN_ID_POLYGON
? `https://mumbai.polygonscan.com/block/${block}`
: chainId === CHAIN_ID_AVAX
? `https://testnet.snowtrace.io/block/${block}`
: chainId === CHAIN_ID_OASIS
? `https://testnet.oasisscan.com/block/${block}`
: chainId === CHAIN_ID_ALGORAND
? `https://app.dappflow.org/explorer/block/${block}`
: chainId === CHAIN_ID_FANTOM
? `https://testnet.ftmscan.com/block/${block}`
: // : chainId === CHAIN_ID_KARURA <-- not supported on testnet dashboard
chainId === CHAIN_ID_ACALA
? `https://blockscout.mandala.aca-staging.network/block/${block}`
: chainId === CHAIN_ID_KLAYTN
? `https://baobab.klaytnscope.com/block/${block}`
: chainId === CHAIN_ID_CELO
? `https://alfajores.celoscan.io/block/${block}`
: chainId === CHAIN_ID_ACALA
? `https://blockscout.mandala.aca-staging.network/block/${block}`
: chainId === CHAIN_ID_SOLANA
? `https://explorer.solana.com/${block}?cluster=testnet`
: chainId === CHAIN_ID_ALGORAND
? `https://testnet.algoexplorer.io/block/${block}`
: chainId === CHAIN_ID_MOONBEAM
: // : chainId === CHAIN_ID_NEAR <-- not supported on testnet dashboard
chainId === CHAIN_ID_MOONBEAM
? `https://moonbase.moonscan.io/block/${block}`
: chainId === CHAIN_ID_XPLA
? `https://explorer.xpla.io/testnet/block/${block}`
: // : chainId === CHAIN_ID_TERRA2 <-- not supported on testnet dashboard
// : chainId === CHAIN_ID_INJECTIVE <-- not supported on testnet dashboard
chainId === CHAIN_ID_SUI
? `https://suiexplorer.com/checkpoint/${block}?network=testnet`
: chainId === CHAIN_ID_APTOS
? `https://explorer.aptoslabs.com/block/${block}?network=testnet`
: chainId === CHAIN_ID_ARBITRUM
? `https://sepolia.arbiscan.io/block/${block}`
: chainId === CHAIN_ID_SUI
? `https://suiexplorer.com/checkpoint/${block}?network=testnet`
: chainId === CHAIN_ID_OPTIMISM
? `https://sepolia-optimism.etherscan.io/block/${block}`
: chainId === CHAIN_ID_XPLA
? `https://explorer.xpla.io/testnet/block/${block}`
: chainId === CHAIN_ID_BASE
? `https://goerli.basescan.org/block/${block}`
: '';
: chainId === CHAIN_ID_SEI
? `https://www.seiscan.app/atlantic-2/blocks/${block}`
: // : chainId === CHAIN_ID_WORMCHAIN <-- not supported on testnet dashboard
'';

export const explorerTx = (network: Environment, chainId: ChainId, tx: string) =>
network === 'mainnet'
? chainId === CHAIN_ID_ETH
? chainId === CHAIN_ID_SOLANA
? `https://solscan.io/account/${tx}`
: chainId === CHAIN_ID_ETH
? `https://etherscan.io/tx/${tx}`
: chainId === CHAIN_ID_TERRA
? `https://finder.terra.money/columbus-5/tx/${tx}`
: chainId === CHAIN_ID_BSC
? `https://bscscan.com/tx/${tx}`
: chainId === CHAIN_ID_POLYGON
Expand All @@ -132,80 +148,88 @@ export const explorerTx = (network: Environment, chainId: ChainId, tx: string) =
? `https://snowtrace.io/tx/${tx}`
: chainId === CHAIN_ID_OASIS
? `https://explorer.emerald.oasis.dev/tx/${tx}`
: chainId === CHAIN_ID_AURORA
? `https://aurorascan.dev/tx/${tx}`
: chainId === CHAIN_ID_ALGORAND
? `https://app.dappflow.org/explorer/transaction/${tx}`
: chainId === CHAIN_ID_FANTOM
? `https://ftmscan.com/tx/${tx}`
: chainId === CHAIN_ID_KLAYTN
? `https://scope.klaytn.com/tx/${tx}`
: chainId === CHAIN_ID_CELO
? `https://explorer.celo.org/tx/${tx}`
: chainId === CHAIN_ID_KARURA
? `https://blockscout.karura.network/tx/${tx}`
: chainId === CHAIN_ID_ACALA
? `https://blockscout.acala.network/tx/${tx}`
: chainId === CHAIN_ID_SOLANA
? `https://solscan.io/account/${tx}`
: chainId === CHAIN_ID_TERRA
? `https://finder.terra.money/columbus-5/tx/${tx}`
: chainId === CHAIN_ID_TERRA2
? `https://finder.terra.money/phoenix-1/tx/${tx}`
: chainId === CHAIN_ID_ALGORAND
? `https://algoexplorer.io/tx/${tx}`
: chainId === CHAIN_ID_KLAYTN
? `https://scope.klaytn.com/tx/${tx}`
: chainId === CHAIN_ID_CELO
? `https://explorer.celo.org/tx/${tx}`
: chainId === CHAIN_ID_NEAR
? `https://explorer.near.org/transactions/${tx}`
: chainId === CHAIN_ID_MOONBEAM
? `https://moonscan.io/tx/${tx}`
: chainId === CHAIN_ID_XPLA
? `https://explorer.xpla.io/mainnet/tx/${tx}`
: chainId === CHAIN_ID_APTOS
? `https://explorer.aptoslabs.com/txn/${tx}`
: chainId === CHAIN_ID_ARBITRUM
? `https://arbiscan.io/tx/${tx}`
: chainId === CHAIN_ID_TERRA2
? `https://finder.terra.money/phoenix-1/tx/${tx}`
: chainId === CHAIN_ID_INJECTIVE
? `https://explorer.injective.network/transaction/${tx}`
: chainId === CHAIN_ID_SUI
? `https://suiexplorer.com/txblock/${tx}`
: chainId === CHAIN_ID_APTOS
? `https://explorer.aptoslabs.com/txn/${tx}?network=mainnet`
: chainId === CHAIN_ID_ARBITRUM
? `https://arbiscan.io/tx/${tx}`
: chainId === CHAIN_ID_OPTIMISM
? `https://optimistic.etherscan.io/tx/${tx}`
: chainId === CHAIN_ID_XPLA
? `https://explorer.xpla.io/mainnet/tx/${tx}`
: chainId === CHAIN_ID_BASE
? `https://basescan.org/tx/${tx}`
: chainId === CHAIN_ID_SEI
? `https://www.seiscan.app/pacific-1/txs/${tx}`
: chainId === CHAIN_ID_WORMCHAIN
? `https://bigdipper.live/wormhole/transactions/${tx}`
: ''
: chainId === CHAIN_ID_SOLANA
? `https://solscan.io/txs/${tx}?cluster=testnet`
: chainId === CHAIN_ID_ETH
? `https://sepolia.etherscan.io/tx/${tx}`
: chainId === CHAIN_ID_BSC
: // : chainId === CHAIN_ID_TERRA <-- not supported on testnet dashboard
chainId === CHAIN_ID_BSC
? `https://testnet.bscscan.com/tx/${tx}`
: chainId === CHAIN_ID_POLYGON
? `https://mumbai.polygonscan.com/tx/${tx}`
: chainId === CHAIN_ID_AVAX
? `https://testnet.snowtrace.io/tx/${tx}`
: chainId === CHAIN_ID_OASIS
? `https://testnet.oasisscan.com/tx/${tx}`
: chainId === CHAIN_ID_ALGORAND
? `https://app.dappflow.org/explorer/transaction/${tx}`
: chainId === CHAIN_ID_FANTOM
? `https://testnet.ftmscan.com/tx/${tx}`
: // chainId === CHAIN_ID_KARURA <-- not supported on testnet dashboard
chainId === CHAIN_ID_ACALA
? `https://blockscout.mandala.aca-staging.network/tx/${tx}`
: chainId === CHAIN_ID_KLAYTN
? `https://baobab.klaytnscope.com/tx/${tx}`
: chainId === CHAIN_ID_CELO
? `https://alfajores.celoscan.io/tx/${tx}`
: chainId === CHAIN_ID_ACALA
? `https://blockscout.mandala.aca-staging.network/tx/${tx}`
: chainId === CHAIN_ID_SOLANA
? `https://solscan.io/account/${tx}?cluster=testnet`
: chainId === CHAIN_ID_ALGORAND
? `https://testnet.algoexplorer.io/tx/${tx}`
: chainId === CHAIN_ID_MOONBEAM
: // chainId === CHAIN_ID_NEAR <-- not supported on testnet dashboard
chainId === CHAIN_ID_MOONBEAM
? `https://moonbase.moonscan.io/tx/${tx}`
: chainId === CHAIN_ID_XPLA
? `https://explorer.xpla.io/testnet/tx/${tx}`
: // chainId === CHAIN_ID_TERRA2 <-- not supported on testnet dashboard
// chainId === CHAIN_ID_INJECTIVE <-- not supported on testnet dashboard
chainId === CHAIN_ID_SUI
? `https://suiexplorer.com/txblock/${tx}?network=testnet`
: chainId === CHAIN_ID_APTOS
? `https://explorer.aptoslabs.com/txn/${tx}?network=testnet`
: chainId === CHAIN_ID_ARBITRUM
? `https://sepolia.arbiscan.io/tx/${tx}`
: chainId === CHAIN_ID_SUI
? `https://suiexplorer.com/txblock/${tx}?network=testnet`
: chainId === CHAIN_ID_OPTIMISM
? `https://sepolia-optimism.etherscan.io/tx/${tx}`
: chainId === CHAIN_ID_XPLA
? `https://explorer.xpla.io/testnet/tx/${tx}`
: chainId === CHAIN_ID_BASE
? `https://goerli.basescan.org/tx/${tx}`
: '';
: chainId === CHAIN_ID_SEI
? `https://www.seiscan.app/atlantic-2/txs/${tx}`
: // chainId === CHAIN_ID_WORMCHAIN <-- not supported on testnet dashboard
'';

export const explorerVaa = (network: string, key: string) =>
network === 'mainnet'
Expand Down

0 comments on commit fd1bccf

Please sign in to comment.