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 Bigmap Update

PreviousIndexing Storage ChangeNextIndexing Incoming Transaction

Last updated 3 years ago

Was this helpful?

The decorator can be used to mark an indexer method that will be listening for when a value in a bigmap stored with the contract changes.

When a bigmap 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

key

The changed key in the bigmap. The exact type will depend on the code of the contract.

value

The new value (or null, if the item was removed). The exact type will depend on the code of the contract.

dbContext

indexingContext

Example

The following code will print the value of the property bar every time the contract's bigmap called foo is updated:

interface FooValue {
    bar: string;
}

export class MyContractIndexer {
    @indexBigMapUpdate({ name: 'foo' })
    async indexTokenLambdasUpdate(
        key: string,
        value: FooValue | undefined, // Undefined represents a removal.
        dbContext: DbContext,
        indexingContext: BigMapUpdateIndexingContext,
    ): Promise<void> {
        console.log(value.bar);
    }
}

The to store data to.

The with additional information about the change.

@indexBigMapChange
DbContext
BigMapUpdateIndexingContext