2023-11-07 16:25:04 +00:00
|
|
|
import 'package:isar/isar.dart';
|
2023-11-03 19:46:55 +00:00
|
|
|
import 'package:stackwallet/models/paymint/fee_object_model.dart';
|
2023-10-30 22:58:15 +00:00
|
|
|
import 'package:stackwallet/pages/settings_views/global_settings_view/manage_nodes_views/add_edit_node_view.dart';
|
2023-11-03 19:46:55 +00:00
|
|
|
import 'package:stackwallet/utilities/amount/amount.dart';
|
2023-10-30 22:58:15 +00:00
|
|
|
import 'package:stackwallet/utilities/logger.dart';
|
|
|
|
import 'package:stackwallet/utilities/test_epic_box_connection.dart';
|
2023-11-06 18:26:33 +00:00
|
|
|
import 'package:stackwallet/wallets/crypto_currency/coins/epiccash.dart';
|
2023-11-15 17:40:43 +00:00
|
|
|
import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart';
|
2023-09-18 21:28:31 +00:00
|
|
|
import 'package:stackwallet/wallets/models/tx_data.dart';
|
2023-11-04 01:18:22 +00:00
|
|
|
import 'package:stackwallet/wallets/wallet/intermediate/bip39_wallet.dart';
|
2023-09-18 21:28:31 +00:00
|
|
|
|
|
|
|
class EpiccashWallet extends Bip39Wallet {
|
2023-11-15 17:40:43 +00:00
|
|
|
EpiccashWallet(CryptoCurrencyNetwork network) : super(Epiccash(network));
|
2023-09-18 21:28:31 +00:00
|
|
|
|
|
|
|
@override
|
2023-11-07 16:25:04 +00:00
|
|
|
FilterOperation? get changeAddressFilterOperation =>
|
|
|
|
FilterGroup.and(standardChangeAddressFilters);
|
|
|
|
|
|
|
|
@override
|
|
|
|
FilterOperation? get receivingAddressFilterOperation =>
|
|
|
|
FilterGroup.and(standardReceivingAddressFilters);
|
|
|
|
|
|
|
|
@override
|
2023-09-18 21:28:31 +00:00
|
|
|
Future<TxData> confirmSend({required TxData txData}) {
|
|
|
|
// TODO: implement confirmSend
|
|
|
|
throw UnimplementedError();
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<TxData> prepareSend({required TxData txData}) {
|
|
|
|
// TODO: implement prepareSend
|
|
|
|
throw UnimplementedError();
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<void> recover({required bool isRescan}) {
|
|
|
|
// TODO: implement recover
|
|
|
|
throw UnimplementedError();
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<void> refresh() {
|
|
|
|
// TODO: implement refresh
|
|
|
|
throw UnimplementedError();
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<void> updateBalance() {
|
|
|
|
// TODO: implement updateBalance
|
|
|
|
throw UnimplementedError();
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<void> updateTransactions() {
|
|
|
|
// TODO: implement updateTransactions
|
|
|
|
throw UnimplementedError();
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
2024-01-05 00:37:46 +00:00
|
|
|
Future<bool> updateUTXOs() {
|
2023-09-18 21:28:31 +00:00
|
|
|
// TODO: implement updateUTXOs
|
|
|
|
throw UnimplementedError();
|
|
|
|
}
|
2023-10-30 22:58:15 +00:00
|
|
|
|
|
|
|
@override
|
2024-01-05 00:37:46 +00:00
|
|
|
Future<bool> updateNode() {
|
2023-10-30 22:58:15 +00:00
|
|
|
// TODO: implement updateNode
|
|
|
|
throw UnimplementedError();
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<bool> pingCheck() async {
|
|
|
|
try {
|
|
|
|
final node = nodeService.getPrimaryNodeFor(coin: cryptoCurrency.coin);
|
|
|
|
|
|
|
|
// force unwrap optional as we want connection test to fail if wallet
|
|
|
|
// wasn't initialized or epicbox node was set to null
|
|
|
|
return await testEpicNodeConnection(
|
|
|
|
NodeFormData()
|
|
|
|
..host = node!.host
|
|
|
|
..useSSL = node.useSSL
|
|
|
|
..port = node.port,
|
|
|
|
) !=
|
|
|
|
null;
|
|
|
|
} catch (e, s) {
|
|
|
|
Logging.instance.log("$e\n$s", level: LogLevel.Info);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2023-10-31 16:06:35 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
Future<void> updateChainHeight() async {
|
|
|
|
// final height = await fetchChainHeight();
|
|
|
|
// await walletInfo.updateCachedChainHeight(
|
|
|
|
// newHeight: height,
|
|
|
|
// isar: mainDB.isar,
|
|
|
|
// );
|
|
|
|
}
|
2023-11-03 19:46:55 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
Future<Amount> estimateFeeFor(Amount amount, int feeRate) {
|
|
|
|
// TODO: implement estimateFeeFor
|
|
|
|
throw UnimplementedError();
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
// TODO: implement fees
|
|
|
|
Future<FeeObject> get fees => throw UnimplementedError();
|
2023-09-18 21:28:31 +00:00
|
|
|
}
|