fromJson static method

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

Implementation

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

  return TonWalletTransaction(
    id: (json['id'] as String?) ?? '',
    peerAddress: (json['peer_address'] as String?) ?? '',
    peerUserId: (json['peer_user_id'] as int?) ?? 0,
    peerDomain: (json['peer_domain'] as String?) ?? '',
    date: (json['date'] as int?) ?? 0,
    feeAmount: (json['fee_amount'] is int
            ? json['fee_amount'] as int
            : int.tryParse(json['fee_amount']?.toString() ?? '')) ??
        0,
    state: TonWalletTransactionState.fromJson(
        json['state'] as Map<String, dynamic>?)!,
    type: TonWalletTransactionType.fromJson(
        json['type'] as Map<String, dynamic>?)!,
  );
}