Skip to main content

useRemoveAdmin

Remove an admin on the smart wallet account. This action has to be performed by an admin on the account.

const Component = () => {
const { mutate: removeAdmin, isLoading, error } = useRemoveAdmin();

if (error) {
console.error("failed to remove admin", error);
}

return (
<button disabled={isLoading} onClick={() => removeAdmin(adminAddress)}>
Remove admin
</button>
);
};

Usage

Provide the smart wallet account contract address as the argument.

import { useAccountAdminsAndSigners } from "@thirdweb-dev/react";

const adminAddress = "{{admin_address}}";

const Component = () => {
const { mutate: removeAdmin, isLoading, error } = useRemoveAdmin();

if (error) {
console.error("failed to remove admin", error);
}

return (
<button disabled={isLoading} onClick={() => removeAdmin(adminAddress)}>
Remove admin
</button>
);
};

Configuration

adminAddress

adminAddress

The address to remove as an admin.