useUpdateRoyaltySettings() function
This feature is currently in beta and may change based on feedback that we receive.
Use this to update the royalty settings of your
Example
const Component = () => {
const {
mutate: updateRoyaltySettings,
isLoading,
error,
} = useUpdateRoyaltySettings(SmartContract);
if (error) {
console.error("failed to update royalty settings", error);
}
return (
<button
disabled={isLoading}
onClick={() =>
updateRoyaltySettings({
updatePayload: {
fee_recipient: "0x123",
seller_fee_basis_points: 5_00,
},
})
}
>
Update Royalty Settings
</button>
);
};
Signature:
export declare function useUpdateRoyaltySettings(
contract: RequiredParam<SmartContract | ValidContractInstance>,
): import("@tanstack/react-query").UseMutationResult<
{
receipt: import("@ethersproject/abstract-provider").TransactionReceipt;
data: () => Promise<{
seller_fee_basis_points: number;
fee_recipient: string;
}>;
},
unknown,
{
seller_fee_basis_points?: number | undefined;
fee_recipient?: string | undefined;
},
unknown
>;
Parameters
Parameter | Type | Description |
---|---|---|
contract | RequiredParam<SmartContract | ValidContractInstance> | an instance of a |
Returns:
import("@tanstack/react-query").UseMutationResult<{ receipt: import("@ethersproject/abstract-provider").TransactionReceipt; data: () => Promise<{ seller_fee_basis_points: number; fee_recipient: string; }>; }, unknown, { seller_fee_basis_points?: number | undefined; fee_recipient?: string | undefined; }, unknown>
a mutation object that can be used to update the royalty settings