AbiParameter.fromJson constructor

AbiParameter.fromJson(
  1. Map<String, dynamic> json,
  2. bool tronTypes
)

Factory method to create an AbiParameter instance from a JSON representation.

Implementation

factory AbiParameter.fromJson(Map<String, dynamic> json, bool tronTypes) {
  final List<dynamic> inputs = json["components"] ?? [];
  return AbiParameter(
    name: json["name"] ?? "",
    type: json["type"],
    internalType: json["internalType"],
    indexed: json["indexed"] ?? false,
    tronTypes: tronTypes,
    components:
        inputs.map((e) => AbiParameter.fromJson(e, tronTypes)).toList(),
  );
}