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 {
164
164
this . fetchFromEtherscan (
165
165
`${ url } ?module=contract&action=getsourcecode&address=${ address } ` ,
166
166
) . then ( json => {
167
- if ( ! json ?. result ?. length ) {
167
+ if ( ! json ?. result ) {
168
168
throw new Error ( `No result: ${ JSON . stringify ( json ) } ` ) ;
169
169
}
170
- const { ContractName } = json . result [ 0 ] ;
170
+ const { ContractName } = json . result ?. [ 0 ] ?? json . result ?? { } ;
171
171
if ( ! ContractName ) {
172
172
throw new Error ( 'Contract name is empty' ) ;
173
173
}
Original file line number Diff line number Diff line change @@ -859,7 +859,7 @@ async function processInitForm(
859
859
type : 'input' ,
860
860
name : 'startBlock' ,
861
861
message : 'Start block' ,
862
- initial : ( ) => initStartBlock || startBlock || '0' ,
862
+ initial : ( ) => String ( initStartBlock || startBlock || 0 ) ,
863
863
skip : ( ) => initFromExample !== undefined || isSubstreams ,
864
864
validate : value =>
865
865
initFromExample !== undefined ||
You can’t perform that action at this time.
0 commit comments