Action.fromJson constructor

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

Implementation

factory Action.fromJson(Map<String, dynamic> json) {
  if (json['enum'] == NearTransferType.transfer) {
    return Action(
      transfer: Transfer.fromJson(json['transfer']),
      enumValue: json['enum'],
    );
  }
  if (json['enum'] == NearTransferType.functionCall) {
    return Action(
      functionCall: FunctionCall.fromJson(json['functionCall']),
      enumValue: json['enum'],
    );
  }
  return Action(enumValue: 'errorType');
}