Docs

useSwitchAccount

Hook to switch the account of the active wallet

Example

const { switchAccount, isLoading } = useSwitchAccount();
const handleSwitchAccount = async (address: string) => {
await switchAccount(address);
};

Returns

A function to invoke to switch account and a boolean to indicate if it is in progress