persistSession method

Future<void> persistSession()

Implementation

Future<void> persistSession() async {
  try {
    final currentData =
        _core.secureStorage.has(StorageConstants.phantomSession)
            ? _core.secureStorage.get(StorageConstants.phantomSession)!
            : {};
    await _core.secureStorage.set(StorageConstants.phantomSession, {
      ...currentData,
      'session_token': _sessionToken,
      'phantom_encryption_public_key': _phantomPublicKey,
    });
  } catch (e) {
    _core.logger.d('[$runtimeType] persistSession $e');
  }
}