Strange issues with web3auth

Hi,
we have been using web3auth for a while and we have some strange issues.
For example, we use Alchemy as our RPC provider and we see these errors on Alchemy from time to time

eth_requestAccounts
{“jsonrpc”:“2.0”,“id”:7239266411887734,“error”:{“code”:-32600,“message”:“Unsupported method: eth_requestAccounts. See available methods at https://docs.alchemy.com/alchemy/documentation/apis”}}

eth_subscribe
{“jsonrpc”:“2.0”,“id”:1162590935369748,“error”:{“code”:-32000,“message”:“notifications not supported”}}

It seems like web3auth and torus libraries have a lot of calls to the JSON-RPC API and we cannot understand why. The calls are coming from the web3auth library itself.

These are the packages we use:
@walletconnect/client”: “^1.8.0”,
@walletconnect/sign-client”: “^2.8.4”,
@walletconnect/utils”: “^2.8.5”,
@web3auth/base”: “^5.2.0”,
@web3auth/modal”: “^5.2.0”,
@web3auth/torus-wallet-connector-plugin”: “^6.1.7”,
@web3auth/wallet-connect-v2-adapter”: “^6.1.1”,

Also ,some users see a blank screen when trying to connect with Google:

We are working with cyan network on Polygon.

Please assist.

@yaro.hakimi Welcome Aboard!

Can you please upgrade to v4 Openlogin/Web3auth v6 version?

It will solve the issue?

It should resolve as there are major fixes in the latest version.

I still see this error:
Unsupported method: eth_requestAccounts. See available methods at https://docs.alchemy.com/alchemy/documentation/apis

This appears to be related to Alchemy. I have already forwarded your issue to our team and I will get back once there is an update.

Hi, Thanks for the answers.
I was able to pinpoint the issue.
Alchemy/Quicknode and other providers does not support eth_subscribe through JSON-RPC. It’s supported only through Websocket connection.
So the question is how can I set web3auth to work with Websocket and not RPC?
This is the only way to fix the too much calls issue.

1 Like

@yaro.hakimi Have you tried using ws endpoint in rpcURl?

Sure. It doesn’t work at all. Cannot even connect with my wallet.

I see that the library supports websocket

but it doesn’t work with rpcTarget or wsTarget.

any updates on this? I’m not sure how to enable a web socket connection if the npc target is mandatory. in couldn’t find a reference to wsTarget in your code

@maharshi ,@shahbaz an answer will be much appreciated.

@omryo @yaro.hakimi It is very unlikely that Alchemy and other providers do not support the methods through JSON-RPC, please inquire about it. The reason that I am urging you to use JSON-RPC is that a webSocket connection is highly insecure.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.