Options
All
  • Public
  • Public/Protected
  • All
Menu

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 IndexingCycleHandler.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.

Hierarchy

  • ContractIndexer

Index

Properties

name?: string

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

Methods

  • Indexes a difference in a big map of of the selected (see shouldIndex) contract.

    Parameters

    Returns void | PromiseLike<void>

  • shouldIndex(lazyContract: LazyContract): false | TContractData | PromiseLike<false | TContractData>
  • Dynamically selects a contract for indexing (remaining index*() methods) by this indexer. Firstly, the selective indexing is evaluated based on the 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.

    Parameters

    • 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>

    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.

Generated using TypeDoc