useRoyaltySettings

Hook for retrieving royalty settings of a smart contract.

Available to use on contracts that implement the Royalty interface.

Example

import { useContract, useRoyaltySettings } from "@thirdweb-dev/react";
function App() {
const { contract } = useContract(contractAddress);
const { data, isLoading, error } = useRoyaltySettings(contract);
}
function useRoyaltySettings(
contract: RequiredParam<ValidContractInstance>,
): UseQueryResult<
{ fee_recipient: string; seller_fee_basis_points: number },
unknown
>;

Parameters

Instance of a SmartContract

Type

let contract: RequiredParam<ValidContractInstance>;

Returns

let returnType: UseQueryResult<
{ fee_recipient: string; seller_fee_basis_points: number },
unknown
>;

The hook's data property, once loaded, is an object with two properties:

{
seller_fee_basis_points: number;
fee_recipient: string;
}
  • The seller_fee_basis_points is the royalty amount (in basis points) that the seller will receive for each token sale on secondary markets.

  • The fee_recipient is the wallet address that will receive the royalty payments.