DOCS

useUpdatePrimarySaleRecipient

Set the primary sale recipient

Example

const Component = () => {
  const { contract } = useContract("{{contract_address}}");
  const {
    mutate: updatePrimarySalesRecipient,
    isLoading,
    error,
  } = useUpdatePrimarySaleRecipient(contract);

  if (error) {
    console.error("failed to update recipient", error);
  }

  return (
    <button
      disabled={isLoading}
      onClick={() =>
        updatePrimarySalesRecipient({
          newRecipient: "{{wallet_address}}",
        })
      }
    >
      Update Recipient
    </button>
  );
};

Parameters

Returns

a mutation object that can be used to update the primary sales recipient