fromJson static method

Input fromJson(
  1. Map<String, dynamic> jsonInput
)

Implementation

static Input fromJson(Map<String, dynamic> jsonInput) {
  int inputType = jsonInput['type'];
  switch (inputType) {
    case 0:
      return InputCoin.fromJson(jsonInput);
    case 1:
      return InputContract.fromJson(jsonInput);
    case 2:
      return InputMessage.fromJson(jsonInput);
    default:
      throw Exception('Cannot parse transaction input');
  }
}