Docs

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>
  );
};

Returns

mutation object to add given address as an admin