fromJson static method

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

Implementation

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

  return TonConnectRequest(
    sessionId: (json['session_id'] is int
            ? json['session_id'] as int
            : int.tryParse(json['session_id']?.toString() ?? '')) ??
        0,
    messageId: (json['message_id'] as int?) ?? 0,
    body: (json['body'] as String?) ?? '',
    expirationDate: (json['expiration_date'] as int?) ?? 0,
    topic: (json['topic'] as String?) ?? '',
    traceId: (json['trace_id'] as String?) ?? '',
  );
}