File tree Expand file tree Collapse file tree 1 file changed +16
-6
lines changed
packages/ethereum-viewer/src/explorer Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -42,12 +42,22 @@ export async function fetchFiles(
4242 } : FetchFilesOptions = { }
4343) : Promise < FetchFilesResult > {
4444 const apiUrl = explorerApiUrls [ apiName ] ;
45- const url =
46- apiUrl +
47- "?module=contract" +
48- "&action=getsourcecode" +
49- `&address=${ contractAddress } ` +
50- `&apikey=${ explorerApiKeys [ apiName ] } ` ;
45+ let url ;
46+ if ( apiUrl . includes ( "chainid=" ) ) {
47+ url =
48+ apiUrl +
49+ "&module=contract" +
50+ "&action=getsourcecode" +
51+ `&address=${ contractAddress } ` +
52+ `&apikey=${ explorerApiKeys [ apiName ] } ` ;
53+ } else {
54+ url =
55+ apiUrl +
56+ "?module=contract" +
57+ "&action=getsourcecode" +
58+ `&address=${ contractAddress } ` +
59+ `&apikey=${ explorerApiKeys [ apiName ] } ` ;
60+ }
5161
5262 const response = ( await fetch ( url ) ) as types . ContractSourceResponse ;
5363
You can’t perform that action at this time.
0 commit comments