@@ -12,7 +12,7 @@ export class ContractService {
1212
1313 private async fetchFromEtherscan ( url : string ) : Promise < any | null > {
1414 const result = await fetch ( url ) . catch ( _error => {
15- throw new Error ( `Etherscan API is unreachable` ) ;
15+ throw new Error ( `Contract API is unreachable` ) ;
1616 } ) ;
1717 let json : any = { } ;
1818
@@ -25,7 +25,7 @@ export class ContractService {
2525 }
2626
2727 logger (
28- 'Failed to fetch from etherscan : [%s] %s (%s)\n%O' ,
28+ 'Failed to fetch from contract API : [%s] %s (%s)\n%O' ,
2929 result . status ,
3030 result . statusText ,
3131 result . url ,
@@ -75,12 +75,12 @@ export class ContractService {
7575
7676 let errors : string [ ] = [ ] ;
7777 return await withSpinner (
78- `Fetching ABI from Etherscan ` ,
79- `Failed to fetch ABI from Etherscan ` ,
80- `Warnings while fetching ABI from Etherscan ` ,
78+ `Fetching ABI from contract API ` ,
79+ `Failed to fetch ABI from contract API ` ,
80+ `Warnings while fetching ABI from contract API ` ,
8181 async ( ) => {
8282 if ( ! urls . length ) {
83- throw new Error ( `No Etherscan API available` ) ;
83+ throw new Error ( `No contract API available for ${ networkId } in the registry ` ) ;
8484 }
8585 for ( const url of urls ) {
8686 try {
@@ -107,12 +107,12 @@ export class ContractService {
107107 const urls = this . getEtherscanUrls ( networkId ) ;
108108
109109 return await withSpinner (
110- `Fetching Start Block ` ,
111- `Failed to fetch Start Block ` ,
112- `Warnings while fetching deploy contract transaction from Etherscan ` ,
110+ `Fetching start block ` ,
111+ `Failed to fetch start block ` ,
112+ `Warnings while fetching deploy contract transaction from contract API ` ,
113113 async ( ) => {
114114 if ( ! urls . length ) {
115- throw new Error ( `No Etherscan API available` ) ;
115+ throw new Error ( `No contract API available for ${ networkId } in the registry ` ) ;
116116 }
117117 for ( const url of urls ) {
118118 try {
@@ -146,12 +146,12 @@ export class ContractService {
146146 const urls = this . getEtherscanUrls ( networkId ) ;
147147
148148 return await withSpinner (
149- `Fetching Contract Name ` ,
150- `Failed to fetch Contract Name ` ,
151- `Warnings while fetching contract name from Etherscan ` ,
149+ `Fetching contract name ` ,
150+ `Failed to fetch contract name ` ,
151+ `Warnings while fetching contract name from contract API ` ,
152152 async ( ) => {
153153 if ( ! urls . length ) {
154- throw new Error ( `No Etherscan API available` ) ;
154+ throw new Error ( `No contract API available for ${ networkId } in the registry ` ) ;
155155 }
156156 for ( const url of urls ) {
157157 try {
@@ -179,7 +179,7 @@ export class ContractService {
179179 private async fetchTransactionByHash ( networkId : string , txHash : string ) {
180180 const urls = this . getRpcUrls ( networkId ) ;
181181 if ( ! urls . length ) {
182- throw new Error ( `No JSON-RPC available` ) ;
182+ throw new Error ( `No JSON-RPC available for ${ networkId } in the registry ` ) ;
183183 }
184184 for ( const url of urls ) {
185185 try {
0 commit comments