toJson method

Map<String, dynamic> toJson()

Returns the JSON representation of the transaction.

Implementation

Map<String, dynamic> toJson() {
  final json = <String, dynamic>{};
  if (operations.isNotEmpty) {
    json['operations'] = operations.map((o) => o.toJson()).toList();
  }
  if (afterSelection != null) {
    json['after_selection'] = afterSelection!.toJson();
  }
  if (beforeSelection != null) {
    json['before_selection'] = beforeSelection!.toJson();
  }
  return json;
}