Tezos Dappetizer
  • Quick Start
  • How-to Guides
    • Using PostgreSQL
    • Exposing API with Hasura
  • Reference
    • Decorator-based Indexing
      • Indexing Entrypoint Call
      • Indexing Storage Change
      • Indexing Bigmap Update
      • Indexing Incoming Transaction
    • Interface-based Indexing
    • Configuration
    • Command Line
    • Usage Statistics
  • Technical Concepts
    • Indexing Cycle
    • Indexer Modules
  • Token Indexer
    • Introduction
    • Running Standalone in Docker
  • API Docs
  • dappetizer GitLab
Powered by GitBook
On this page
  • Parameters
  • Example

Was this helpful?

  1. Reference
  2. Decorator-based Indexing

Indexing Storage Change

PreviousIndexing Entrypoint CallNextIndexing Bigmap Update

Last updated 3 years ago

Was this helpful?

The decorator can be used to mark an indexer method that will be listening for storage changes on a contract.

When a storage change is detected on an indexed contract, the method will be invoked with detailed information about the change.

Parameters

The following parameters will be passed to the indexing method:

Name
Description

newStorage

The new storage value. The exact type will depend on the code of the contract.

dbContext

indexingContext

Example

The following code will print the value of the property foo every time the contract has new storage:

interface MyContractChangedStorage {
    foo: string;
}

export class MyContractIndexer {
    @indexStorageChange()
    async indexStorageChange(
        newStorage: MyContractChangedStorage,
        dbContext: DbContext,
        indexingContext: StorageChangeIndexingContext,
    ): Promise<void> {
        console.log(newStorage.foo);
    }
}

The to store data to.

The with additional information about the change.

@indexStorageChange
DbContext
StorageChangeIndexingContext