LogEntry.fromJson constructor

LogEntry.fromJson(
  1. Map<String, dynamic> json
)

Creates a LogEntry instance from a JSON map.

Implementation

factory LogEntry.fromJson(Map<String, dynamic> json) {
  return LogEntry(
    address: json.valueAs("address"),
    blockHash: json.valueAs("blockHash"),
    blockNumber: PluginIntUtils.hexToInt(json['blockNumber']),
    data: json.valueAs("data"),
    logIndex: PluginIntUtils.hexToInt(json['logIndex']),
    removed: json.valueAs("removed"),
    topics: json.valueAsList<List<String>?>("topics") ?? [],
    transactionHash: json.valueAs("transactionHash"),
    transactionIndex: PluginIntUtils.hexToInt(json['transactionIndex']),
  );
}