import { BLOCKCHAIN_EXPLORE_URL } from '../configs/index' import { BLOCKCHAIN_EXPLORE_LINK_TYPES } from '../constants/index' export function getBlockchainExploreLink(data: string | number, type: BLOCKCHAIN_EXPLORE_LINK_TYPES): string { switch (type) { case BLOCKCHAIN_EXPLORE_LINK_TYPES.TRANSACTION: { return `${BLOCKCHAIN_EXPLORE_URL}/tx/${data}` } case BLOCKCHAIN_EXPLORE_LINK_TYPES.TOKEN: { return `${BLOCKCHAIN_EXPLORE_URL}/token/${data}` } case BLOCKCHAIN_EXPLORE_LINK_TYPES.BLOCK: { return `${BLOCKCHAIN_EXPLORE_URL}/block/${data}` } case BLOCKCHAIN_EXPLORE_LINK_TYPES.COUNTDOWN: { return `${BLOCKCHAIN_EXPLORE_URL}/block/countdown/${data}` } default: { return `${BLOCKCHAIN_EXPLORE_URL}/address/${data}` } } }