Royalty
Functionality available for contracts that inherit the Royalty
contract.
getDefaultRoyaltyInfo
Gets the royalty recipient and BPS (basis points) of the smart contract.
const royaltyInfo = await contract.royalties.getDefaultRoyaltyInfo();
Configuration
Return Value
Returns an object containing the royalty recipient address and BPS (basis points) of the smart contract.
{
seller_fee_basis_points: number;
fee_recipient: string;
}
getTokenRoyaltyInfo
Gets the royalty recipient and BPS (basis points) of a particular token in the contract.
const royaltyInfo = await contract.royalties.getTokenRoyaltyInfo(
"{{token_id}}",
);
Configuration
setDefaultRoyaltyInfo
Set the royalty recipient and fee for the smart contract.
await contract.royalties.setDefaultRoyaltyInfo({
seller_fee_basis_points: 100, // 1% royalty fee
fee_recipient: "0x...", // the fee recipient
});
Configuration
setTokenRoyaltyInfo
Set the royalty recipient and fee for a particular token in the contract.
await contract.royalties.setTokenRoyaltyInfo("{{token_id}}", {
seller_fee_basis_points: 100, // 1% royalty fee
fee_recipient: "0x...", // the fee recipient
});