import { ETHPLORER_URL } from '@config' ; import { ExplorerConfig , ITxHash , TAddress } from '@types' ; /**
 * Create config object for each network.
 * Allow overrides when necessary.
 */ export function makeExplorer ( config ) { return { origin : ETHPLORER_URL , txPath : 'tx' , tokenPath : 'token' , addressPath : 'address' , blockPath : 'block' , ... config } ; } export const buildTxUrl = ( config , hash ) => `${ config . origin }/${ config . txPath }/${ hash }` ; export const buildAddressUrl = ( config , address ) => `${ config . origin }/${ config . addressPath }/${ address }` ; export const buildBlockUrl = ( config , blockNum ) => `${ config . origin }/${ config . blockPath }/${ blockNum }` ; export const buildTokenUrl = ( config , contractAddress ) => `${ config . origin }/${ config . tokenPath }/${ contractAddress }` ;