Fix gastracker url path (#1429)
This commit is contained in:
parent
a5b7ae7b2c
commit
2c226ff02c
|
@ -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: {
|
||||
|
|
Loading…
Reference in New Issue