fromJson static method

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

Implementation

static TonTransaction? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  return TonTransaction(
    id: (json['id'] as String?) ?? '',
    gramAmount: (json['gram_amount'] as int?) ?? 0,
    isRefund: (json['is_refund'] as bool?) ?? false,
    date: (json['date'] as int?) ?? 0,
    type: TonTransactionType.fromJson(tdMapFromJson(json['type'])),
  );
}