Royalty
Functionality available for contracts that inherit the Royalty
contract.
get_default_royalty_info
Gets the royalty recipient and BPS (basis points) of the smart contract.
royalty_info = contract.royalties.get_default_royalty_info()
print(royalty_info)
Configuration
Return Value
Returns an object containing the royalty recipient address and BPS (basis points) of the smart contract.
class ContractRoyaltySchema:
seller_fee_basis_points: int = 0
fee_recipient: str = ZERO_ADDRESS
get_token_royalty_info
Gets the royalty recipient and BPS (basis points) of a particular token in the contract.
royalty_info = contract.royalties.get_token_royalty_info(
"{{token_id}}",
);
Configuration
set_default_royalty_info
Set the royalty recipient and fee for the smart contract.
from thirdweb.types import ContractRoyaltySchema
royalty_data = ContractRoyaltySchema(
seller_fee_basis_points=100,
fee_recipient="0x7fDae677aA6f94Edff9872C4b91D26407709c790"
)
receipt = contract.royalties.set_default_royalty_info()
Configuration
set_token_royalty_info
Set the royalty recipient and fee for a particular token in the contract.
from thirdweb.types import ContractRoyaltySchema
token_id = 0
royalty_data = ContractRoyaltySchema(
seller_fee_basis_points = 100,
fee_recipient = "0x7fDae677aA6f94Edff9872C4b91D26407709c790"
)
receipt = contract.royalties.set_token_royalty_info(token_id, royalty_data)