fromJson static method

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

Implementation

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

  return TonConnectSession(
    id: (json['id'] is int
            ? json['id'] as int
            : int.tryParse(json['id']?.toString() ?? '')) ??
        0,
    dappClientId: (json['dapp_client_id'] as String?) ?? '',
    walletClientId: (json['wallet_client_id'] as String?) ?? '',
    creationDate: (json['creation_date'] as int?) ?? 0,
    manifest: TonConnectManifest.fromJson(
        json['manifest'] as Map<String, dynamic>?)!,
    nonce: (json['nonce'] as String?) ?? '',
    state: TonConnectSessionState.fromJson(
        json['state'] as Map<String, dynamic>?)!,
  );
}