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

IFunctionContext

For function handlers, the input object may contain:

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

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

  • The function parameters passed during the contract call

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

/**
 * @dev Function::approve(address _spender, uint256 _value)
 * @param context trigger object with contains {functionParams: {_spender ,_value }, transaction, block}
 * @param bind init function for database wrapper methods
 */
export const approveHandler = async (
  context: IFunctionContext,
  bind: IBind,
  secrets: ISecrets,
) => {
  // Implement your function handler logic for approve here

  const { functionParams, transaction, block } = context;
  const { _spender, _value } = functionParams;
};

PreviousIEventContextNextILog