1import { useNetwork } from 'store/network';
2import { NETWORK_TYPES } from './network';
4function useEtherscanDomain() {
5 const { networkType } = useNetwork();
8 case NETWORK_TYPES.ROPSTEN:
9 return 'https://ropsten.etherscan.io';
10 case NETWORK_TYPES.OFFLINE:
11 case NETWORK_TYPES.MAINNET:
12 case NETWORK_TYPES.LOCAL:
14 return 'https://etherscan.io';
18export function useExploreTxUrl(txHash) {
19 const domain = useEtherscanDomain();
21 return `${domain}/tx/${txHash}`;
23export function useExploreTxUrls(txHashes = []) {
24 const domain = useEtherscanDomain();
26 return txHashes.map(txHash => `${domain}/tx/${txHash}`);
29export function useExploreAddressUrl(address) {
30 const domain = useEtherscanDomain();
32 return `${domain}/address/${address}`;
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list