Blockflow Docs
AppBlog
CLI
CLI
  • Getting Started
    • Installation
    • Quickstart Guide
    • Project Structure
  • Building Blocks
    • Configuring YAML
    • Setting up Database Schema
    • Setting up Handlers
  • Writing handlers
    • Database Operations
      • Instance
      • API
      • Native
    • Indexing Factory Contracts
  • Production
    • Testing
    • Deployment
    • Query The Database
    • Building REST API
    • Building GraphQL APIs
  • Advanced
    • Migrate Subgraph
    • CLI Cheatsheet
    • Console Account
    • Logging
  • Hands-on Project
    • CCTP Protocol
    • ERC-4626
    • Credit-Debit
    • Avocado
    • ENS
    • SolverScan
    • xERC20
    • Snapshot
  • Glossary
    • IEventContext
    • IFunctionContext
    • ILog
    • ITransaction
    • IBlock
Powered by GitBook
On this page
  1. Glossary

IEventContext

For event handlers, the context typically includes details such as:

  • ILog: The transaction log containing the event data.

  • ITransaction: The associated transaction details (e.g., sender, recipient, value).

  • IBlock: The block information (e.g., block number, timestamp).

  • The raw event parameters emitted by the smart contract.

import {
  IEventContext,
  IBind,
  Instance,
  ISecrets,
} from "@blockflow-labs/utils";

/**
 * @dev Event::Transfer(address from, address to, uint256 value)
 * @param context trigger object with contains {event: {from ,to ,value }, transaction, block, log}
 * @param bind init function for database wrapper methods
 */
export const TransferHandler = async (
  context: IEventContext,
  bind: IBind,
  secrets: ISecrets,
) => {
  // Implement your event handler logic for Transfer here

  const { event, transaction, block, log } = context;
  const { from, to, value } = event;
};
PreviousGlossaryNextIFunctionContext