restoreSession method
Implementation
Future<bool> restoreSession() async {
try {
if (_core.secureStorage.has(StorageConstants.phantomSession)) {
final session =
_core.secureStorage.get(StorageConstants.phantomSession)!;
_currentKeyPair = CryptoKeyPair(
hex.encode(_getKeyBytes('${session['self_private_key']}')),
hex.encode(_getKeyBytes('${session['self_public_key']}')),
);
_phantomPublicKey = session['phantom_encryption_public_key']!;
_sessionToken = session['session_token']!;
await _createSharedSecret();
return true;
}
return false;
} catch (e) {
rethrow;
}
}