Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
wip: don't look, really... don't do it
Browse files Browse the repository at this point in the history
  • Loading branch information
cds-amal committed May 25, 2022
1 parent ecc31a7 commit d952e60
Showing 1 changed file with 23 additions and 20 deletions.
43 changes: 23 additions & 20 deletions packages/source-fetcher/lib/etherscan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,38 +51,38 @@ const EtherscanFetcher: FetcherConstructor = class EtherscanFetcher

private static readonly apiDomainsByNetworkName: { [name: string]: string } =
{
"mainnet": "api.etherscan.io",
"ropsten": "api-ropsten.etherscan.io",
"kovan": "api-kovan.etherscan.io",
"rinkeby": "api-rinkeby.etherscan.io",
"goerli": "api-goerli.etherscan.io",
"optimistic": "api-optimistic.etherscan.io",
mainnet: "api.etherscan.io",
ropsten: "api-ropsten.etherscan.io",
kovan: "api-kovan.etherscan.io",
rinkeby: "api-rinkeby.etherscan.io",
goerli: "api-goerli.etherscan.io",
optimistic: "api-optimistic.etherscan.io",
"kovan-optimistic": "api-kovan-optimistic.etherscan.io",
"arbitrum": "api.arbiscan.io",
arbitrum: "api.arbiscan.io",
"rinkeby-arbitrum": "api-testnet.arbiscan.io",
"polygon": "api.polygonscan.com",
polygon: "api.polygonscan.com",
"mumbai-polygon": "api-mumbai.polygonscan.com",
"binance": "api.bscscan.com",
binance: "api.bscscan.com",
"testnet-binance": "api-testnet.bscscan.com",
"fantom": "api.ftmscan.com",
fantom: "api.ftmscan.com",
"testnet-fantom": "api-testnet.ftmscan.com",
"avalanche": "api.snowtrace.io",
avalanche: "api.snowtrace.io",
"fuji-avalanche": "api-testnet.snowtrace.io",
"heco": "api.hecoinfo.com",
heco: "api.hecoinfo.com",
"testnet-heco": "api-testnet.hecoinfo.com",
"moonbeam": "api-moonbeam.moonscan.io",
"moonriver": "api-moonriver.moonscan.io",
moonbeam: "api-moonbeam.moonscan.io",
moonriver: "api-moonriver.moonscan.io",
"moonbase-alpha": "api-moonbase.moonscan.io",
"hoo": "api.hooscan.com",
"cronos": "api.cronoscan.com",
hoo: "api.hooscan.com",
cronos: "api.cronoscan.com",
"testnet-cronos": "api-testnet.cronoscan.com",
"bttc": "api.bttcscan.com",
bttc: "api.bttcscan.com",
"donau-bttc": "api-testnet.bttcscan.com",
"aurora": "api.aurorascan.dev",
aurora: "api.aurorascan.dev",
"testnet-aurora": "api-testnet.aurorascan.dev",
"celo": "api.celoscan.xyz",
celo: "api.celoscan.xyz",
"alfajores-celo": "api-alfajores.celoscan.xyz",
"clover": "api.clvscan.com"
clover: "api.clvscan.com"
};

constructor(networkId: number, apiKey: string = "") {
Expand Down Expand Up @@ -114,6 +114,9 @@ const EtherscanFetcher: FetcherConstructor = class EtherscanFetcher
address: string
): Promise<Types.SourceInfo | null> {
const response = await this.getSuccessfulResponse(address);
if (!response.result) {
console.log("response:\n\t%o", response);
}
return EtherscanFetcher.processResult(response.result[0]);
}

Expand Down

0 comments on commit d952e60

Please sign in to comment.