ContractRoyalty
Handle contract royalties
Configure royalties for an entire contract or a particular token.
const contract = await sdk.getContract("{{contract_address}}");const royaltyInfo = await contract.royalties.getDefaultRoyaltyInfo();await contract.roles.setTokenRoyaltyInfo(tokenId, { seller_fee_basis_points: 100, // 1% royalty fee fee_recipient: "0x...", // the fee recipient});
class ContractRoyalty< TContract extends IRoyalty, TSchema extends IGenericSchemaType,> implements DetectableFeature {}
function constructor( contractWrapper: ContractWrapper<IRoyalty>,
Get the royalty recipient and fee
const royaltyInfo = await contract.royalties.getDefaultRoyaltyInfo();console.log(royaltyInfo.fee_recipient);console.log(royaltyInfo.seller_fee_basis_points);
function getDefaultRoyaltyInfo(): Promise<{}>;
Get the royalty recipient and fee of a particular token
const royaltyInfo = await contract.royalties.getDefaultRoyaltyInfo();console.log(royaltyInfo.fee_recipient);console.log(royaltyInfo.seller_fee_basis_points);
function getTokenRoyaltyInfo(tokenId: BigNumberish): Promise<{}>;
function setDefaultRoyaltyInfo(royaltyData: {}): Promise<TResult>;
Preparable
You can also prepare the transaction without executing it by calling setDefaultRoyaltyInfo.prepare()
with same arguments. Learn more
function setTokenRoyaltyInfo( tokenId: BigNumberish, royaltyData: {},): Promise<TResult>;
Preparable
You can also prepare the transaction without executing it by calling setTokenRoyaltyInfo.prepare()
with same arguments. Learn more