Event Param

export class EventParam {
    constructor(
        public name: string,
        public value: Value,
    ) {}
}

Fields and Use Cases

name

  • Description: The name of the event parameter as defined in the contract’s event signature.
  • Use Case: Used in mapping functions to identify and access specific parameters from events, enabling selective entity updates based on parameter names.

value

  • Description: The decoded value of the parameter, which can be of various types (address, BigInt, string, etc.).
  • Use Case: Used to extract and transform event data into entity properties in your subgraph mappings. The value can be cast to the appropriate type using AssemblyScript type conversion methods.

Important Notes

  • Event parameters can be either indexed (searchable) or non-indexed, affecting how they are accessed in your subgraph mappings.
  • The value field’s type should match the event parameter’s type as defined in the smart contract.