3

How do i detect that my user has switched their wallet to a different one in browser. When a user connects their wallet to my web app, we store their wallet address temporarily for use in the future.Let's say they are currently interacting with my web app using Nami wallet. Nami wallet allows user to switch multiple different wallets. How do i detect that a user has switched to a different wallet.

In Solana and Ethereum they have something like this.

connector.on(...)

Is there an equivilant of that for Cardano.

2 Answers 2

1
     var handle: any = await window.cardano.nami.enable() handle.experimental.on('accountChange',(addresses: any ) => { 
    console.log(addresses) 
  }
0

As far as I know, there isn't.

You probably need to check the cardano.wallet.name periodically.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.