Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to switch between accounts #309

Open
yasserzubair opened this issue Aug 5, 2024 · 4 comments
Open

How to switch between accounts #309

yasserzubair opened this issue Aug 5, 2024 · 4 comments
Labels
feature-request question Further information is requested

Comments

@yasserzubair
Copy link

when connecting the sui wallet, I can select multiple accounts. I can also get the list of all connected accounts like this

const suiWallet = useWallet();
let accountsWalletsList = (suiWallet.connected && suiWallet.getAccounts())

But how do I switch between these accounts? Is the any method that can change my default wallet?
something like this

const suiWallet = useWallet();
suiWallet.account.address //old address

let accountsWalletsList = (suiWallet.connected && suiWallet.getAccounts())
setDefaultAccount(accountsWalletsList[1]);
suiWallet.account.address //new address
@maige-app maige-app bot added the question Further information is requested label Aug 5, 2024
@bruceeewong
Copy link
Contributor

Hi, technically as a Dapp you are not supposed to select account, it would be the selection of what the user chooses on the connected wallet

@yasserzubair
Copy link
Author

@bruceeewong but user gets to select multiple wallets while connecting and I can get all the connected accounts via the getAccounts method. What I want to do is show users a list of all the wallets he has connected and he can select any of those wallets.

@yasserzubair
Copy link
Author

If we already have the wallet addresses it makes sense to make any of these a default address.

@bruceeewong
Copy link
Contributor

I see your point here. We would think of a way for you guys to specify one of the multiple accounts advertised by a wallet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants