amm-arbitrageur icon indicating copy to clipboard operation
amm-arbitrageur copied to clipboard

Keep showing "Object is of type 'unknown'" error when running bot on mainnet

Open KatsuragiCSL opened this issue 3 years ago • 1 comments

bot/index.ts:63:13 - error TS2571: Object is of type 'unknown'.

63         if (err.message === 'Too much pending tasks' || err.message === 'async-lock timed out') {
               ~~~
bot/index.ts:63:57 - error TS2571: Object is of type 'unknown'.

63         if (err.message === 'Too much pending tasks' || err.message === 'async-lock timed out') {

Seems it got some unexpected error? Do anyone have any idea how to deal with it?

Edit: by viewing debug logs, it seems to be the problem of cannot estimate gas; transaction may fail or may require manual gas limit, which due to "deprecated token pairs". I wonder is there a good way to know which token pairs are not deprecated?...

KatsuragiCSL avatar Jan 29 '22 18:01 KatsuragiCSL

AS a workaround, you need to put it like this under compilerOptions:

"compilerOptions": { "useUnknownInCatchVariables": false }

OR , install typescriptversion 4.2.4: npm install [email protected]

voltaxvoltax avatar Jun 08 '22 14:06 voltaxvoltax