StarTransaction.fromJson constructor

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

Creates a new StarTransaction object from json.

Implementation

factory StarTransaction.fromJson(Map<String, dynamic> json) {
  return StarTransaction(
    id: json['id'],
    amount: json['amount'],
    date: json['date'],
    source: json['source'] != null
        ? TransactionPartner.fromJson(json['source'])
        : null,
    receiver: json['receiver'] != null
        ? TransactionPartner.fromJson(json['receiver'])
        : null,
    nanostarAmount: json['nanostar_amount'] as int,
  );
}