Interface ContractIndexer<TDbContext, TContextData, TContractData>

Provides extension points for indexing block parts related to a contract. At least one of methods must be implemented.

Type Parameters

  • TDbContext

    The type of database context. Usually DbContext, if used with standard @tezos-dappetizer/database.

  • TContextData = unknown

    The type of your custom data that flows in indexingContext through all indexers for a block. See createContextData for more details.

  • TContractData = unknown

    The type of your custom data associated with the contract that flows in indexingContext through this indexer. See shouldIndex method for more details.


  • ContractIndexer


name?: string

The explicit name used to easily identify the indexer, for example in error messages.


  • Dynamically selects a contract for indexing (remaining index*() methods) by this indexer. Firstly, the selective indexing is evaluated based on Dappetizer config file. If this method is not implemented, then all contracts are selected. Also, it associates returned value as your custom data with the contract. Then the data flows in indexingContext through this indexer for all blocks being indexed.


    If false, then the contract will not be indexed. Otherwise, your custom data to be associated with the contract if it should be indexed. If you do not care about the data, then just return true. The method can be async, so the returned value can be a Promise.


    • lazyContract: LazyContract

      The contract to be evaluated whether it should be indexed. Its details are resolved lazily as you need them.

    Returns false | TContractData | PromiseLike<false | TContractData>

Generated using TypeDoc