Skip to main content

useUpdatePrimarySaleRecipient() function

This feature is currently in beta and may change based on feedback that we receive.

Use this to update the primary sales recipient of your

Example

const Component = () => {
const {
mutate: updatePrimarySalesRecipient,
isLoading,
error,
} = useUpdatePrimarySaleRecipient(SmartContract);

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

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

Signature:

export declare function useUpdatePrimarySaleRecipient(
contract: RequiredParam<SmartContract | ValidContractInstance>,
): import("@tanstack/react-query").UseMutationResult<
Omit<
{
receipt: import("@ethersproject/abstract-provider").TransactionReceipt;
data: () => Promise<unknown>;
},
"data"
>,
unknown,
string,
unknown
>;

Parameters

ParameterTypeDescription
contractRequiredParam<SmartContract | ValidContractInstance>an instance of a

Returns:

import("@tanstack/react-query").UseMutationResult<Omit<{ receipt: import("@ethersproject/abstract-provider").TransactionReceipt; data: () => Promise<unknown>; }, "data">, unknown, string, unknown>

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