useSwitchAccount

Hook to switch the account of the active wallet

Example

const { switchAccount, isLoading } = useSwitchAccount();
const handleSwitchAccount = async (address: string) => {
await switchAccount(address);
};
function useSwitchAccount(): {
isLoading: boolean;
switchAccount: UseMutateAsyncFunction<
void,
unknown,
string,
unknown
>;
};

Returns

let returnType: {
isLoading: boolean;
switchAccount: UseMutateAsyncFunction<
void,
unknown,
string,
unknown
>;
};

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