Error trying to connect to metamask using no-modal SDK and web3auth-wagmi-connector

  • SDK Version: 7.3.2
  • Platform: web - no-modal

By passing the loginParams using web3auth-wagmi-connector:

// @ts-ignore
web3AuthConnector.loginParams = loginParams;
web3AuthConnector.options.loginParams = loginParams;

connect({
  connector: web3AuthConnector,
});

By calling web3Auth directly, the metamask window opens and it seems to work but the connector state is not updated.

await web3Auth.init();
await web3Auth.connectTo(WALLET_ADAPTERS.METAMASK);

By following the source code on this line, connecting to adapters other than OpenLogin using web3auth-wagmi-connector is not allowed using the no-modal SDK.

@afarley Thanks for your recent post.

Your request has been forwarded to our Dev team and we will get back with further updates.

Hi @afarley,
I understand. Can you please tell me if you see the logged in view upon refreshing the page?

@afarley Can you respond to the previous message?

Are we talking about the same thread here? The “Something went wrong” popup appears before the Metamask plugin can open, so there is no way to login using that method, and refreshing the page has no incidence on that.

Sorry, I was on leave.

hi @afarley,

Have you checked out our example pnp no-modal wagmi example?

Also we updated, 5 days ago, our library @web3auth/web3auth-wagmi-connector

Please check the package.json. It would be great if you could update the libraries as well.
(if not, please contact me with more information about which web3auth-wagmi-connector are you usign)

"@web3auth/base": "^8.0.0",
"@web3auth/ethereum-provider": "^8.0.1",
"@web3auth/no-modal": "^8.0.1",
"@web3auth/openlogin-adapter": "^8.0.1",
"@web3auth/wallet-services-plugin": "^8.0.1",
"@web3auth/web3auth-wagmi-connector": "^6.0.0",

I’ve checked the examples.

Updating would be last resort because we are still on wagmi 1.x and web3auth-wagmi-connector 6.0.0 requires 2.x

We are currently using version 5.0.1 of the connector.

I’ve updated to wagmi 2.x and web3auth v8, still getting an error trying to connect to Metamask using the NoModal SDK.

If we follow the logic on this line, only openlogin connectors are allowed.

Basically our use case is the following:

  • We were using the Modal SDK and switching to the NoModal SDK.
  • We are using web3Auth.authenticateUser();
  • We are verifying the signature on our backend.

All of this was possible to do with Metamask using the Modal SDK.

Is it possible to do using the NoModal SDK?

Yes, It’s possible as the userInfo you get on authenticateUser is a similar type of object in both modal and no modal.

Please contact me if you have any other question.

The topic will be continued in this thread: