Fix gastracker url path (#1429)

This commit is contained in:
Daniel Ternyak 2018-04-05 10:58:32 -05:00 committed by GitHub
parent a5b7ae7b2c
commit 2c226ff02c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 3 deletions

View File

@ -23,12 +23,16 @@ export type State = { [key in StaticNetworkIds]: StaticNetworkConfig };
// Must be a website that follows the ethplorer convention of /tx/[hash] and
// address/[address] to generate the correct functions.
// TODO: put this in utils / libs
export function makeExplorer(name: string, origin: string): BlockExplorerConfig {
export function makeExplorer(
name: string,
origin: string,
addressPath: string = 'address'
): BlockExplorerConfig {
return {
name,
origin,
txUrl: hash => `${origin}/tx/${hash}`,
addressUrl: address => `${origin}/address/${address}`,
addressUrl: address => `${origin}/${addressPath}/${address}`,
blockUrl: blockNum => `${origin}/block/${blockNum}`
};
}
@ -118,7 +122,7 @@ export const INITIAL_STATE: State = {
chainId: 61,
isCustom: false,
color: '#669073',
blockExplorer: makeExplorer('GasTracker', 'https://gastracker.io'),
blockExplorer: makeExplorer('GasTracker', 'https://gastracker.io', 'addr'),
tokens: require('config/tokens/etc.json'),
contracts: require('config/contracts/etc.json'),
dPathFormats: {