// @flow

export const getUrlForAddress = (
  address: string,
  { network = 'main' }: { network: string } = {}
): string => {
  if (network === 'main') {
    return `https://etherscan.io/address/${address}`
  }
  return `https://${network}.etherscan.io/address/${address}`
}

export const getUrlForTx = (
  tx: string,
  { network = 'main' }: { network: string } = {}
): string => {
  if (network === 'main') {
    return `https://etherscan.io/tx/${tx}`
  }
  return `https://${network}.etherscan.io/tx/${tx}`
}

export default {
  getUrlForAddress,
  getUrlForTx
}
