Open m00nbeans opened 2 years ago
Hey! I tested this out with Moonriver to see if I could reproduce the issue, but I wasn't able to reproduce it. It seems to work as it should.
Your config matches what I used. The only difference I can see from what you shared would be that I didn't use Apollo. I console logged the results from calling both the useTokenBalance and useContractCalls hooks and I do see that undefined
(or [undefined]
for useContractCalls) is returned while the data is fetching, and then once the data has been retrieved it returns the results I was expecting.
For useContractCalls, I grabbed the WMOVR
contract on Moonriver and used the following code snippet to get the result:
const abi = new ethers.utils.Interface(wmovrAbi)
const contractCalls = useContractCalls([{ abi, address: "0x98878B06940aE243284CA214f92Bb71a2b032B8A", method: "symbol", args: []}])
console.log(contractCalls)
The response returned was ['WMOVR']
as expected.
If you want some help debugging the issue you can feel free to respond here, or reach out to me on the Moonbeam discord if it's easier - my username there is also @eshaben
After testing this out further, I was able to reproduce the issue whenever my wallet is not connected. I see the same errors:
"Error: could not detect network (event="noNetwork", code=NETWORK_ERROR, version=providers/5.5.0)
at Logger.makeError (http://localhost:3000/static/js/bundle.js:8274:19)
at Logger.throwError (http://localhost:3000/static/js/bundle.js:8284:16)
at Web3Provider.<anonymous> (http://localhost:3000/static/js/bundle.js:18971:21)
at Generator.throw (<anonymous>)
at rejected (http://localhost:3000/static/js/bundle.js:18534:32)"
I traced the error back to an Ethers issue and opened the following PR: https://github.com/ethers-io/ethers.js/pull/2464
I've managed to build a version of @ethersproject/networks with the change from @eshaben. As I was experiencing the same issue with another chain.
However, it didn't seem to resolve the issue with the read-only mode.
This now seems to be working for me as of 0.10.0 :)
Hi there!
I'm not able to get useDapp's read-only mode working on MoonRiver. The same code works fine on other networks, and the RPC I'm using works fine as well. Would appreciate any input.
Tested on Polygon and had no issues, and the dapp works fine with a wallet connected. When connected to MoonRiver, I get the active state coming back as
true
, but the useContractCalls and useTokenBalance hooks just return undefined.EDIT: Error Details. Tried both the purestake RPC (shown) and the OnFinality RPC.