My URL with my API key in it says “404 page not found”.
I hear that the URL has to be used in my code. It has been used in a code, and yet it still says “404 page not found”.
And it says in my log in aircode.io: “TypeError: Cannot read properties of undefined (reading ‘JsonRpcProvider’)” Clearly, this has to do with the provider, namely Infura I assume.
You are probably using JavaScript and ethers. When ethers says “provider” it’s referring to it’s family of classes that implement provider functionality, JsonRpcProvider is one of these. So you have problems in your code and maybe you should ask this question in a forum related to the tutorial you are following.
Without seeing your code I’m guessing a bit, but it is common for beginners to leave the API Key off the URL when they try to access the Infura endpoint.
If you can provide a small example we can read or better yet run then we can help a lot more!
It’s supposed to indicate whether or not the transferring of a token is profitable.
It was actually copied from someone else’s video, admittedly. Specifically, it’s Uniswap and Sushiswap Arbitrage Code by Blockman Codes, and I tried to get his help resolving errors by commenting in his video but he did not respond.
I was like, “I don’t understand how it works for him but not for me!”
Hi,
I think the essence of the problem is the changes from ethers@5 to ethers@6, there will be an upgrade guide on their site. There will be a lot of examples out there that break in this spot because of the changes to ethers.
you can get your example to run as is by installing ethers@5: npm install ethers@5
this will replace the latest version (6) with 5 and it just works. Otherwise check out the ethers upgrade docs to understand how to get past each error one by one.
However, I get this error:
{“error”:“arb.js is not callable”}
Still not getting how it works for him, not for me.
Edit: I’ve been able to get it to work on replit, but not aircode. I’ve been trying to use these two websites to run code that can also be run in node.js.