update branch

This commit is contained in:
julian 2023-05-17 12:16:38 -06:00
parent 0d7a0a8fb9
commit 23a6236b4c
4 changed files with 60 additions and 44 deletions

View file

@ -30,11 +30,9 @@ import 'package:stackwallet/services/mixins/wallet_cache.dart';
import 'package:stackwallet/services/mixins/wallet_db.dart';
import 'package:stackwallet/services/mixins/xpubable.dart';
import 'package:stackwallet/services/node_service.dart';
import 'package:stackwallet/services/notifications_api.dart';
import 'package:stackwallet/services/transaction_notification_tracker.dart';
import 'package:stackwallet/utilities/address_utils.dart';
import 'package:stackwallet/utilities/amount/amount.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/bip32_utils.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/default_nodes.dart';
@ -44,6 +42,7 @@ import 'package:stackwallet/utilities/enums/fee_rate_type_enum.dart';
import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart';
import 'package:stackwallet/utilities/logger.dart';
import 'package:stackwallet/utilities/prefs.dart';
import 'package:stackwallet/widgets/crypto_notifications.dart';
import 'package:tuple/tuple.dart';
import 'package:uuid/uuid.dart';
@ -2798,32 +2797,34 @@ class ECashWallet extends CoinServiceAPI
final confirmations = tx.getConfirmations(currentChainHeight);
if (tx.type == isar_models.TransactionType.incoming) {
unawaited(NotificationApi.showNotification(
CryptoNotificationsEventBus.instance.fire(
CryptoNotificationEvent(
title: "Incoming transaction",
body: walletName,
walletId: walletId,
iconAssetName: Assets.svg.iconFor(coin: coin),
walletName: walletName,
date: DateTime.fromMillisecondsSinceEpoch(tx.timestamp * 1000),
shouldWatchForUpdates: confirmations < MINIMUM_CONFIRMATIONS,
coinName: coin.name,
coin: coin,
txid: tx.txid,
confirmations: confirmations,
requiredConfirmations: MINIMUM_CONFIRMATIONS,
));
),
);
await txTracker.addNotifiedPending(tx.txid);
} else if (tx.type == isar_models.TransactionType.outgoing) {
unawaited(NotificationApi.showNotification(
CryptoNotificationsEventBus.instance.fire(
CryptoNotificationEvent(
title: "Sending transaction",
body: walletName,
walletId: walletId,
iconAssetName: Assets.svg.iconFor(coin: coin),
date: DateTime.fromMillisecondsSinceEpoch(tx.timestamp * 1000),
shouldWatchForUpdates: confirmations < MINIMUM_CONFIRMATIONS,
coinName: coin.name,
txid: tx.txid,
confirmations: confirmations,
requiredConfirmations: MINIMUM_CONFIRMATIONS,
));
walletName: walletName,
coin: coin,
),
);
await txTracker.addNotifiedPending(tx.txid);
}
}
@ -2831,26 +2832,32 @@ class ECashWallet extends CoinServiceAPI
// notify on confirmed
for (final tx in unconfirmedTxnsToNotifyConfirmed) {
if (tx.type == isar_models.TransactionType.incoming) {
unawaited(NotificationApi.showNotification(
CryptoNotificationsEventBus.instance.fire(
CryptoNotificationEvent(
title: "Incoming transaction confirmed",
body: walletName,
walletId: walletId,
iconAssetName: Assets.svg.iconFor(coin: coin),
date: DateTime.fromMillisecondsSinceEpoch(tx.timestamp * 1000),
shouldWatchForUpdates: false,
coinName: coin.name,
));
txid: tx.txid,
requiredConfirmations: MINIMUM_CONFIRMATIONS,
walletName: walletName,
coin: coin,
),
);
await txTracker.addNotifiedConfirmed(tx.txid);
} else if (tx.type == isar_models.TransactionType.outgoing) {
unawaited(NotificationApi.showNotification(
CryptoNotificationsEventBus.instance.fire(
CryptoNotificationEvent(
title: "Outgoing transaction confirmed",
body: walletName,
walletId: walletId,
iconAssetName: Assets.svg.iconFor(coin: coin),
date: DateTime.fromMillisecondsSinceEpoch(tx.timestamp * 1000),
shouldWatchForUpdates: false,
coinName: coin.name,
));
txid: tx.txid,
requiredConfirmations: MINIMUM_CONFIRMATIONS,
walletName: walletName,
coin: coin,
),
);
await txTracker.addNotifiedConfirmed(tx.txid);
}
}

View file

@ -17,6 +17,8 @@ final coinIconProvider = Provider.family<String, Coin>((ref, coin) {
case Coin.dogecoin:
case Coin.dogecoinTestNet:
return assets.dogecoin;
case Coin.eCash:
return assets.epicCash;
case Coin.epicCash:
return assets.epicCash;
case Coin.firo:

View file

@ -14,6 +14,8 @@ final coinImageProvider = Provider.family<String, Coin>((ref, coin) {
return assets.bitcoincashImage;
case Coin.dogecoin:
return assets.dogecoinImage;
case Coin.eCash:
return assets.epicCashImage;
case Coin.epicCash:
return assets.epicCashImage;
case Coin.firo:
@ -51,6 +53,8 @@ final coinImageSecondaryProvider = Provider.family<String, Coin>((ref, coin) {
return assets.bitcoincashImageSecondary;
case Coin.dogecoin:
return assets.dogecoinImageSecondary;
case Coin.eCash:
return assets.epicCashImageSecondary;
case Coin.epicCash:
return assets.epicCashImageSecondary;
case Coin.firo:

View file

@ -12,6 +12,7 @@ class CoinThemeColorDefault {
Color get firo => const Color(0xFFFF897A);
Color get dogecoin => const Color(0xFFFFE079);
Color get epicCash => const Color(0xFFC5C7CB);
Color get eCash => const Color(0xFFC5C7CB);
Color get ethereum => const Color(0xFFA7ADE9);
Color get monero => const Color(0xFFFF9E6B);
Color get namecoin => const Color(0xFF91B1E1);
@ -32,6 +33,8 @@ class CoinThemeColorDefault {
case Coin.dogecoin:
case Coin.dogecoinTestNet:
return dogecoin;
case Coin.eCash:
return epicCash;
case Coin.epicCash:
return epicCash;
case Coin.ethereum: