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"] ?? [];
  final String name = json["name"] ?? "";
  return AbiParameter(
    name: name.isEmpty ? null : name,
    type: json["type"],
    internalType: json["internalType"],
    indexed: json["indexed"] ?? false,
    tronTypes: tronTypes,
    components: List<AbiParameter>.unmodifiable(
        inputs.map((e) => AbiParameter.fromJson(e, tronTypes)).toList()),
  );
}