diff --git a/common/src/explorer.ts b/common/src/explorer.ts index f21c9b59..ebddd65e 100644 --- a/common/src/explorer.ts +++ b/common/src/explorer.ts @@ -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, @@ -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 @@ -45,48 +49,49 @@ 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}` @@ -94,36 +99,47 @@ export const explorerBlock = (network: Environment, chainId: ChainId, block: str ? `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 @@ -132,48 +148,49 @@ 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}` @@ -181,31 +198,38 @@ export const explorerTx = (network: Environment, chainId: ChainId, tx: string) = ? `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'