classYourContractIndexer { @shouldIndex() shouldIndexMyContracts( lazyContract: LazyContract, dbContext: DbContext, ): TContractData | false | PromiseLike<TContractData | false> { // Your code to return false or create your context data for the contract. returntrue; // Just return true, if you do not need context data. } }
classYourSmartRollupIndexer { @shouldIndex() shouldIndexMySmartRollups( rollup: SmartRollup, dbContext: DbContext, ): TRolupData | false | PromiseLike<TRolupData | false> { // Your code to return false or create your context data for the smart rollup. returntrue; // Just return true, if you do not need context data. } }
The decorator for a method of a contract indexer or smart rollup indexer to dynamically select a contract or a smart rollup for indexing.
Example
Demonstrates the method signature:
Remark
This is based on ContractIndexer.shouldIndex(...).