File tree Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @graphprotocol/graph-cli ' : patch
3+ ---
4+
5+ handle non-standard Etherscan API responses, i.e. kaia
Original file line number Diff line number Diff line change @@ -164,10 +164,10 @@ export class ContractService {
164164 this . fetchFromEtherscan (
165165 `${ url } ?module=contract&action=getsourcecode&address=${ address } ` ,
166166 ) . then ( json => {
167- if ( ! json ?. result ?. length ) {
167+ if ( ! json ?. result ) {
168168 throw new Error ( `No result: ${ JSON . stringify ( json ) } ` ) ;
169169 }
170- const { ContractName } = json . result [ 0 ] ;
170+ const { ContractName } = json . result ?. [ 0 ] ?? json . result ?? { } ;
171171 if ( ! ContractName ) {
172172 throw new Error ( 'Contract name is empty' ) ;
173173 }
Original file line number Diff line number Diff line change @@ -859,7 +859,7 @@ async function processInitForm(
859859 type : 'input' ,
860860 name : 'startBlock' ,
861861 message : 'Start block' ,
862- initial : ( ) => initStartBlock || startBlock || '0' ,
862+ initial : ( ) => String ( initStartBlock || startBlock || 0 ) ,
863863 skip : ( ) => initFromExample !== undefined || isSubstreams ,
864864 validate : value =>
865865 initFromExample !== undefined ||
You can’t perform that action at this time.
0 commit comments