gleeth/ethereum/abi/events

Types

pub type DecodedLog {
  DecodedLog(
    event_name: String,
    params: List(#(String, types.AbiValue)),
  )
}

Constructors

  • DecodedLog(
      event_name: String,
      params: List(#(String, types.AbiValue)),
    )

Values

pub fn decode_log(
  log: types.Log,
  events: List(json.AbiEntry),
) -> Result(DecodedLog, types.AbiError)

Decode an event log using known ABI event definitions. Matches topics[0] against event signatures, then decodes indexed and non-indexed parameters.

pub fn event_topic(
  name: String,
  param_types: List(types.AbiType),
) -> BitArray

Compute the event topic hash: keccak256(“EventName(type1,type2,…)”)

pub fn event_topic_hex(
  name: String,
  param_types: List(types.AbiType),
) -> String

Compute the event topic hash as a hex string with 0x prefix.

Search Document