ContractRoyalty class
Handle contract royalties
Example
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
});
Constructors
| Constructor | Modifiers | Description |
|---|---|---|
| (constructor)(contractWrapper, metadata) | Constructs a new instance of the ContractRoyalty class |
Properties
| Property | Modifiers | Type | Description |
|---|---|---|---|
| featureName | "Royalty" |
Methods
| Method | Modifiers | Description |
|---|---|---|
| getDefaultRoyaltyInfo() | Gets the royalty recipient and BPS (basis points) of the contract | |
| getTokenRoyaltyInfo(tokenId) | Gets the royalty recipient and BPS (basis points) of a particular token | |
| setDefaultRoyaltyInfo(royaltyData) | Set the royalty recipient and fee for a contract | |
| setTokenRoyaltyInfo(tokenId, royaltyData) | Set the royalty recipient and fee for a particular token |
Signature:
export declare class ContractRoyalty<TContract extends IRoyalty, TSchema extends IGenericSchemaType> implements DetectableFeature
Implements: DetectableFeature
Remarks
Configure royalties for an entire contract or a particular token.