2023-05-26 21:21:16 +00:00
|
|
|
/*
|
|
|
|
* This file is part of Stack Wallet.
|
|
|
|
*
|
|
|
|
* Copyright (c) 2023 Cypher Stack
|
|
|
|
* All Rights Reserved.
|
|
|
|
* The code is distributed under GPLv3 license, see LICENSE file for details.
|
|
|
|
* Generated by Cypher Stack on 2023-05-26
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2023-03-01 21:52:13 +00:00
|
|
|
import 'package:stackwallet/db/hive/db.dart';
|
2022-10-11 20:45:11 +00:00
|
|
|
import 'package:stackwallet/utilities/logger.dart';
|
|
|
|
|
|
|
|
Future<bool> deleteEverything() async {
|
|
|
|
try {
|
|
|
|
await DB.instance.deleteBoxFromDisk(boxName: DB.boxNameAddressBook);
|
|
|
|
await DB.instance.deleteBoxFromDisk(boxName: DB.boxNameDebugInfo);
|
|
|
|
await DB.instance.deleteBoxFromDisk(boxName: DB.boxNameNodeModels);
|
|
|
|
await DB.instance.deleteBoxFromDisk(boxName: DB.boxNamePrimaryNodes);
|
|
|
|
await DB.instance.deleteBoxFromDisk(boxName: DB.boxNameAllWalletsData);
|
|
|
|
await DB.instance.deleteBoxFromDisk(boxName: DB.boxNameNotifications);
|
|
|
|
await DB.instance.deleteBoxFromDisk(boxName: DB.boxNameWatchedTransactions);
|
|
|
|
await DB.instance.deleteBoxFromDisk(boxName: DB.boxNameWatchedTrades);
|
|
|
|
await DB.instance.deleteBoxFromDisk(boxName: DB.boxNameTrades);
|
|
|
|
await DB.instance.deleteBoxFromDisk(boxName: DB.boxNameTradesV2);
|
|
|
|
await DB.instance.deleteBoxFromDisk(boxName: DB.boxNameTradeNotes);
|
|
|
|
await DB.instance.deleteBoxFromDisk(boxName: DB.boxNameTradeLookup);
|
|
|
|
await DB.instance.deleteBoxFromDisk(boxName: DB.boxNameFavoriteWallets);
|
|
|
|
await DB.instance.deleteBoxFromDisk(boxName: DB.boxNamePrefs);
|
|
|
|
await DB.instance
|
|
|
|
.deleteBoxFromDisk(boxName: DB.boxNameWalletsToDeleteOnStart);
|
|
|
|
await DB.instance.deleteBoxFromDisk(boxName: DB.boxNamePriceCache);
|
|
|
|
await DB.instance.deleteBoxFromDisk(boxName: DB.boxNameDBInfo);
|
2023-03-21 00:04:05 +00:00
|
|
|
await DB.instance.deleteBoxFromDisk(boxName: "theme");
|
2022-10-11 20:45:11 +00:00
|
|
|
return true;
|
|
|
|
} catch (e, s) {
|
|
|
|
Logging.instance.log("$e $s", level: LogLevel.Error);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|