Is it possible to send switch account request from dapp

I’m working with React dapp and I have MetaMask connection logic in there.
If user want to switch connected account, they should open MetaMask from the browser by clicking his icon and switch account and connect to dapp.

Is it possible to open Metamask to switch account something like network switching request wallet_switchEthereumChain?

19 Likes

Hi @BlackHorse ,

Welcome to the MetaMask community!

See this previous post, let us know if this helps at all -

13 Likes

Thank you, For your tip, But actually I have switch network feature in my app, and it worked perfectly. My expectation is not switching network, Just want to have switch account feature.

I am aware that MetaMask has an eth_requestAccounts method to connect accounts, it is only used to link accounts when none are connencted.
But if you already have one account linked, then when you call this method to switch another account and connect nothing happens and no popup opens.

so actually I hope to get the idea how to open Metamask popup to switch accounts.

7 Likes

Hi @BlackHorse ,

The RPC API section of the the MetaMask docs should get you what you need:

6 Likes

Hi, @KBee ,
Already I checked docs, But nothing helped to open popup to switch accounts

5 Likes

Did you go through this section of docs too? Much more than this, but it’s the start from the link sent?

5 Likes

Omg!, I dont mean, switching network.

4 Likes

Sorry, @BlackHorse . I’m reaching out to some :brain: 's and will try to get you a helpful answer. Was trying to see if I could help get you on a path but I know I’m still off in regards to where you want to go. I’ll be back :slight_smile: .

6 Likes

Want to put this post on here jjuuuust in case (I’m running in case you’re going to throw tomatoes :smile: )

9 Likes

Wow, That is really I want have, Please give me your address to send tomatoes :slight_smile:
Thank you @KBee

5 Likes

Woohoo!!! Glad we could get you there :smiley:

3 Likes

Project development is inseparable from infrastructure construction. I firmly believe that metamask is infrastructure!

i dont know whats the real problem ?but i think the metamask can connect the dapp smoothly?can you install the othe wallet

A post was split to a new topic: I had an incident where my meta mask wallet went clean all of my assets

wonderful wait dapp use

A post was split to a new topic: How to submit a help desk ticket

A post was split to a new topic: Lost Secret Recovery Phrase 12 Words - Help