ContractABI.fromJson constructor

ContractABI.fromJson(
  1. List<Map<String, dynamic>> abi, {
  2. bool isTron = false,
})

Factory method to create a ContractABI instance from JSON.

Implementation

factory ContractABI.fromJson(List<Map<String, dynamic>> abi,
    {bool isTron = false}) {
  try {
    final fragments = abi.map((e) {
      return AbiBaseFragment.fromJson(e, isTron);
    }).toList();
    return ContractABI._(fragments);
  } catch (e) {
    throw MessageException("invalid contract abi", details: {"input": abi});
  }
}