View Source Icon.Schema.Types.EventLog (ICON 2.0 SDK v0.2.3)

This module defines an ICON 2.0 event log entry.

Events are emitted by SCORE contracts and are useful for tracking changes in the contract e.g. an event entry for transfering a token from one EOA address to another:

{
  "scoreAddress": "cxb0776ee37f5b45bfaea8cff1d8232fbb6122ec32",
  "indexed": [
    "Transfer(Address,Address,int)",
    "hxfd7e4560ba363f5aabd32caac7317feeee70ea57",
    "hx2e243ad926ac48d15156756fce28314357d49d83"
  ],
  "data": [
    "0x2a"
  ]
}

where:

  • Transfer(Address,Address,int) indicates the name of the event and the types of the parameters it received.
  • indexed is a list of indexed parameters we can use for searching the event we want faster.
  • data is a list of the non-indexed parameters.

The type defined in this module, can load events using the Elixir types instead of the ICON types e.g. for the previous example, we would have the following:

%Icon.Schema.Types.EventLog{
  header: "Transfer(Address,Address,int)",
  name: "Transfer",
  score_address: "cxb0776ee37f5b45bfaea8cff1d8232fbb6122ec32",
  indexed: [
    "hxfd7e4560ba363f5aabd32caac7317feeee70ea57",
    "hx2e243ad926ac48d15156756fce28314357d49d83"
  ],
  data: [
    42
  ]
}

Link to this section Summary

Types

t()

An event log.

Link to this section Types

@type t() :: %Icon.Schema.Types.EventLog{
  data: [any()],
  header: binary(),
  height: term(),
  indexed: [any()],
  name: binary(),
  score_address: Icon.Schema.Types.SCORE.t()
}

An event log.

Link to this section Functions

Link to this function

%Icon.Schema.Types.EventLog{}

View Source (struct)

An event log.