if you check in network tab, it was a timeout or really CORS error?
how would the RPC node know what to return for eth_requestAccounts
?
if you check in network tab, it was a timeout or really CORS error?
how would the RPC node know what to return for eth_requestAccounts
?
itās really a CORS errorā¦ the response is āunauthorizedā
it looks like trying to send a command (eth_requestAccounts) that it is not allowed by the node
" how would the RPC node know what to return for eth_requestAccounts
?"
Not sure what you mean by thisā¦ I am not querying the node directly, the underlying Moralis.js library is doing that. I am just using the ethers.js way of asking for the list of associated accounts, using the provider handle returned by: const web3Provider = await Moralis.enableWeb3()
. This method works fine on desktop with the injected provider, but fails when connecting through WalletConnect.
maybe that eth_requestAccounts
command is specific to metamask
this is still Metamask, just via WalletConnect. Iām open to suggestions for alternatives. The problem I have is I need to know the currently selected wallet address, and that is typically returned at index 0 in the eth_getAccounts call. there is the const account = await Moralis.account
call, however this does not appear to return the currently selected account, only the primary one.
not sure if this helps:
not really as thatās a web3.js call and not an ethers.js call, old post may no longer be applicable to the current state as the moralis.js library is ethers.js based now. But thanks.
you could make another forum thread about this
Iāll poke around a bit to see if I can find an alternate way that works for both wallet-connect and injected providers. but will for sure create a new thread if I canāt find a solution. Thanks again
@cryptokid I have the same problem, canāt find any solutions for this. This issue occurs when using Wallet connect with a QR code:
if you donāt use it with a QR code then it works fine?
did you also try with 127.0.0.1 instead of localhost? or somewhere where https is enabled?
But now Itās ok in both localhost and HTTPS, I donāt change anything. Itās magic! I think this issue is in your server, itās not stable.
Moralis speedy nodes are no longer available.
You can update to code to get data from web3Api to get the data or you can use our partner nodes from here https://moralis.io/largenodes
What is the best solution in your opinion?
Iām confused because I donāt see how I can change it on my end. The node is being called from Moralis SDK.
There are few forum threads with the same issue. One possible solution could be to use latest version for walletconnect. Or to add some code that adds a delay for the requests that walletconnect does.
Same error updating walletconnect to the latest version 1.7.8 and Moralis 1.9.0
Awesome, thanksā¦ Iām gonna try it here