Skip to content

How to switch between accounts #309

@yasserzubair

Description

@yasserzubair

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions