Open ray372922 opened 1 year ago
Etherscan returns next (if dont pass apiKey).
{"status":"1","message":"OK-Missing/Invalid API Key, rate limit of 1/5sec applied","result":[{"address"...
Code checks that message is strongly "OK".
if (result.status != 1 || result.message != "OK") { const error: any = new Error("invalid response"); error.result = JSON.stringify(result); if ((result.result || "").toLowerCase().indexOf("rate limit") >= 0) { error.throttleRetry = true; } throw error; }
After it, i have exception with TypeError: (result.result || "").toLowerCase is not a function because result in my request is logs array, not string.
TypeError: (result.result || "").toLowerCase is not a function
result
Originally posted by @timaiv in https://github.com/ethers-io/ethers.js/discussions/2983
What version are you using? Is it the same case as this in v6 or is there another case that needs to handle it as a regex (I should probably change that to a startsWith, since v6 uses modern ES features ;)).
Etherscan returns next (if dont pass apiKey).
Code checks that message is strongly "OK".
After it, i have exception with
TypeError: (result.result || "").toLowerCase is not a function
becauseresult
in my request is logs array, not string.Originally posted by @timaiv in https://github.com/ethers-io/ethers.js/discussions/2983