Operation.fromJson constructor

Operation.fromJson(
  1. Map<String, dynamic> map
)

Implementation

factory Operation.fromJson(Map<String, dynamic> map) {
  return Operation(
    map['type'],
    OperationIdentifier.fromJson(map['operation_identifier']),
    map['related_operations'] != null
        ? (map['related_operations'] as List)
            .map((e) => OperationIdentifier.fromJson(e))
            .toList()
        : null,
    map['status'],
    map['account'] != null
        ? AccountIdentifier.fromJson(map['account'])
        : null,
    map['amount'] != null ? Amount.fromJson(map['amount']) : null,
    map['coin_change'] != null
        ? CoinChange.fromJson(map['coin_change'])
        : null,
    map['metadata'],
  );
}