Event

export class Event {
constructor(
    public address: Address,
    public logIndex: BigInt,
    public transactionLogIndex: BigInt,
    public logType: string | null,
    public block: Block,
    public transaction: Transaction,
    public parameters: Array<EventParam>,
    public receipt: TransactionReceipt | null,
) {}
}

Fields and Use Cases

address

  • Description: The address of the smart contract that emitted the event(same as dataSource.address).
  • Use Case: Identify the source of the event(smart contract address).

logIndex

  • Description: The integer identifying the index of the event within the block’s list of events.
  • Use Case: Track the order of events within a specific block.

transactionLogIndex

  • Description: The integer identifying the index of the event within the transaction.
  • Use Case: Track the order of events within a specific transaction.

logType

  • Description: The type of the log (if available), or null if unspecified.
  • Use Case: To differentiate between different types of logs.

block

  • Description: The block in which the event was included.
  • Use Case: Allows access to block-level data such as timestamp, miner, and block height.
    Learn more about blocks.

transaction

  • Description: The transaction that triggered the event.
  • Use Case: Provides transaction-level details (e.g., gas price, transaction hash). Learn more about transactions.

parameters Array<EventParam>

  • Description: The indexed data that was emitted along with the event and has been decoded with the event signature in ABI provided in the datasource as an array of (name, value) pairs.
  • Use Case: Provides the data emitted by the event, such as addresses, balances, or other values. Learn more about event params.

receipt TransactionReceipt

  • Description: The generated receipt that contains information about the transaction.
  • Use Case: Provides additional execution details for the transaction, such as status and cumulative gas used. Learn more about transaction receipts.