useUpdateRoyaltySettings

Hook for updating royalty settings on a smart contract.

Available to use on smart contracts that implement the Royalty interface.

Example

import {
useUpdateRoyaltySettings,
useContract,
Web3Button,
} from "@thirdweb-dev/react";
function App() {
const { contract } = useContract(contractAddress);
const {
mutateAsync: updateRoyaltySettings,
isLoading,
error,
} = useUpdateRoyaltySettings(contract);
return (
<Web3Button
contractAddress={contractAddress}
action={() =>
updateRoyaltySettings({
seller_fee_basis_points: 0,
fee_recipient: "{{wallet_address}}",
})
}
>
Update Royalty Settings
</Web3Button>
);
}

Parameters

Returns

A mutation object to update the royalty settings

const { mutateAsync, isLoading, error } =
useUpdateRoyaltySettings(contract);

options

The mutation function takes an object with below properties:

seller_fee_basis_points

The seller_fee_basis_points property is a number between 0 - 10000 that defines the fee rate.

This number is in percentage points. i.e. 100 is a 1% fee and 10000 is a 100% fee.

fee_recipient

The fee_recipient property is the address of the wallet that will receive the fees.