useAddAdmin

Add an additional admin on the smart wallet account

Example

import { useAddAdmin } from "@thirdweb-dev/react";
const adminAddress = "{{admin_address}}";
const Component = () => {
const { mutate: addAdmin, isLoading, error } = useAddAdmin();
if (error) {
console.error("failed to add admin", error);
}
return (
<button
disabled={isLoading}
onClick={() => addAdmin(adminAddress)}
>
Add admin
</button>
);
};
function useAddAdmin(): UseMutationResult<
unknown,
string
>;

Returns

let returnType: UseMutationResult<TransactionResult, unknown, string>;

mutation object to add given address as an admin