Add an explorer link to the not found page

This commit is contained in:
Alexis Sellier
2021-05-18 16:32:04 +02:00
parent 8cd5911449
commit 73b00be0af
3 changed files with 16 additions and 1 deletions
+8
View File
@@ -51,3 +51,11 @@ export function getSearchParam(key: string, location: RouteLocation): string | n
let params = new URLSearchParams(location.search);
return params.get(key);
}
// Get the explorer link of an address, eg. Etherscan.
export function explorerLink(addr: string, config: Config): string {
if (config.network.name == "ropsten") {
return `https://ropsten.etherscan.io/address/${addr}`;
}
return `https://etherscan.io/address/${addr}`;
}