@sentio/sdk
    Preparing search index...

    Class GlobalContext

    Hierarchy (View Summary)

    Index

    Constructors

    • Parameters

      • chainId: EthChainId
      • address: string
      • Optionaltimestamp: Date
      • Optionalblock: BlockParams
      • Optionallog: LogParams
      • Optionaltrace: Trace
      • Optionaltransaction: TransactionResponseParams
      • OptionaltransactionReceipt: TransactionReceiptParams
      • OptionalbaseLabels: Labels
      • OptionalpreparedData: PreparedData

      Returns GlobalContext

    Properties

    address: string
    baseLabels: Labels
    block?: BlockParams
    blockNumber: number
    chainId: EthChainId
    eventLogger: EventLoggerBinding
    meter: Meter
    preparedData?: PreparedData
    timestamp: Date
    trace?: Trace
    transaction?: TransactionResponseParams
    transactionHash?: string
    transactionReceipt?: TransactionReceiptParams

    Accessors

    • get cache(): MemoryCache

      Access the in-memory key-value cache.

      The cache allows storing and retrieving JSON-serializable values that persist across handler invocations. Useful for caching computed results, tracking cumulative state, or storing intermediate processing data.

      Returns MemoryCache

      The MemoryCache instance, or undefined if cache is not available

      // Store and retrieve values
      await ctx.cache.set('totalVolume', volume)
      const cached = await ctx.cache.get<number>('totalVolume')

      // Block-scoped values (isolated per block)
      await ctx.cache.setInBlock('blockCount', count)

      MemoryCache for full API documentation

    Methods