aptos-labs / aptos-wallet-adapter

A monorepo modular wallet adapter for Aptos applications
https://aptos-labs.github.io/aptos-wallet-adapter/
Apache License 2.0
88 stars 97 forks source link

Is there a way to get another account that's been added to user own wallet, and connect it? like `useSwitchAccount()` #390

Closed findmytrueself closed 1 month ago

findmytrueself commented 2 months ago

I am connecting to Petra wallet at web front. (I am managing personal wallet connection using wallet-adapter-react useWallet())

Is there a way to get another account that's been added to users own wallet, and connect it? like useSwitchAccount() (How to get and connect newAccount from methods such as onAccountChange in wallet-adapter-react)

0xmaayan commented 2 months ago

Currently, the only way is to switch accounts on the web Wallet UI and then reconnect with the dapp.

To have a switchAccount request coming from the dapp, a wallet would need to support an API for that - and I dont think there is a wallet in the ecosystem that supports that