diff --git a/.gitignore b/.gitignore
index 304ffe1c7..666b21729 100644
--- a/.gitignore
+++ b/.gitignore
@@ -142,9 +142,28 @@ lib/wownero/wownero.dart
lib/zano/zano.dart
lib/decred/decred.dart
-ios/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_180.png
-ios/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_120.png
-ios/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png
+ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon@2x.png
+ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon@2x~ipad.png
+ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon@3x.png
+ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-20@2x.png
+ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-20@2x~ipad.png
+ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-20@3x.png
+ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-20~ipad.png
+ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-29.png
+ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-29@2x.png
+ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-29@2x~ipad.png
+ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-29@3x.png
+ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-29~ipad.png
+ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-40@2x.png
+ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-40@2x~ipad.png
+ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-40@3x.png
+ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-40~ipad.png
+ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-60@2x~car.png
+ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-60@3x~car.png
+ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-83.5@2x~ipad.png
+ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon~ios-marketing.png
+ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon~ipad.png
+
ios/Runner/Info.plist
android/app/src/main/res/mipmap-*
android/app/src/main/res/drawable/ic_launcher.png
diff --git a/README.md b/README.md
index ea8f34624..ea796dbf2 100644
--- a/README.md
+++ b/README.md
@@ -26,10 +26,13 @@ Cake Wallet includes support for several cryptocurrencies, including:
* Ethereum (ETH)
* Litecoin (LTC)
* Bitcoin Cash (BCH)
-* Polygon (Pol)
+* Polygon (POL)
* Solana (SOL)
+* Tron (TRX)
* Nano (XNO)
-* Haven (XHV)
+* Zano (ZANO)
+* Decred (DCR)
+* Wownero (WOW)
## Features
@@ -81,10 +84,6 @@ Cake Wallet includes support for several cryptocurrencies, including:
* Automatically generate new addresses
* Specify multiple recipients for batch sending
-### Haven Specific Features
-
-* Send, receive, and store XHV and all xAssets like xUSD, xEUR, xAG, etc.
-
# Monero.com by Cake Wallet for Android and iOS
## Open Source Monero-Only Wallet
diff --git a/android/app/src/main/AndroidManifestBase.xml b/android/app/src/main/AndroidManifestBase.xml
index 9a324edf3..4f15370c3 100644
--- a/android/app/src/main/AndroidManifestBase.xml
+++ b/android/app/src/main/AndroidManifestBase.xml
@@ -107,6 +107,9 @@
+
_enabled;
diff --git a/cw_core/lib/unspent_transaction_output.dart b/cw_core/lib/unspent_transaction_output.dart
index 4765ac9ab..fa074d5b2 100644
--- a/cw_core/lib/unspent_transaction_output.dart
+++ b/cw_core/lib/unspent_transaction_output.dart
@@ -28,4 +28,9 @@ class Unspent with UnspentComparable {
bool get isP2wpkh =>
address.startsWith('bc') || address.startsWith('tb') || address.startsWith('ltc');
+
+ @override
+ String toString() {
+ return 'Unspent(address: $address, hash: $hash, value: $value, vout: $vout, keyImage: $keyImage, isSending: $isSending, isFrozen: $isFrozen, isChange: $isChange, note: $note)';
+ }
}
diff --git a/cw_core/lib/wallet_type.dart b/cw_core/lib/wallet_type.dart
index 5ae1c1290..fed998ed0 100644
--- a/cw_core/lib/wallet_type.dart
+++ b/cw_core/lib/wallet_type.dart
@@ -193,7 +193,7 @@ String walletTypeToDisplayName(WalletType type) {
case WalletType.banano:
return 'Banano (BAN)';
case WalletType.polygon:
- return 'Polygon (MATIC)';
+ return 'Polygon (POL)';
case WalletType.solana:
return 'Solana (SOL)';
case WalletType.tron:
diff --git a/cw_decred/lib/wallet.dart b/cw_decred/lib/wallet.dart
index c94f5425d..7493d8a4d 100644
--- a/cw_decred/lib/wallet.dart
+++ b/cw_decred/lib/wallet.dart
@@ -4,6 +4,7 @@ import 'dart:io';
import 'package:cw_core/exceptions.dart';
import 'package:cw_core/transaction_direction.dart';
import 'package:cw_core/utils/print_verbose.dart';
+import 'package:cw_decred/amount_format.dart';
import 'package:cw_decred/pending_transaction.dart';
import 'package:cw_decred/transaction_credentials.dart';
import 'package:flutter/foundation.dart';
@@ -122,6 +123,9 @@ abstract class DecredWalletBase extends WalletBase decredAmountToString(amount: int.parse(amount));
+
Future init() async {
final getSeed = () async {
if (!watchingOnly) {
diff --git a/cw_ethereum/lib/ethereum_wallet.dart b/cw_ethereum/lib/ethereum_wallet.dart
index ae6158557..7cc140c5a 100644
--- a/cw_ethereum/lib/ethereum_wallet.dart
+++ b/cw_ethereum/lib/ethereum_wallet.dart
@@ -76,9 +76,13 @@ class EthereumWallet extends EVMChainWallet {
await erc20TokensBox.deleteFromDisk();
// Add all the previous tokens with configs to the new box
- evmChainErc20TokensBox.addAll(allValues);
+ await evmChainErc20TokensBox.addAll(allValues);
}
+ @override
+ List get getDefaultTokenContractAddresses =>
+ DefaultEthereumErc20Tokens().initialErc20Tokens.map((e) => e.contractAddress).toList();
+
@override
EVMChainTransactionInfo getTransactionInfo(
EVMChainTransactionModel transactionModel, String address) {
diff --git a/cw_evm/lib/evm_chain_wallet.dart b/cw_evm/lib/evm_chain_wallet.dart
index 800bf745b..306688f13 100644
--- a/cw_evm/lib/evm_chain_wallet.dart
+++ b/cw_evm/lib/evm_chain_wallet.dart
@@ -146,6 +146,8 @@ abstract class EVMChainWalletBase extends WalletBase<
// required WalletInfo walletInfo,
// });
+ List get getDefaultTokenContractAddresses;
+
Future initErc20TokensBox();
String getTransactionHistoryFileName();
@@ -173,6 +175,9 @@ abstract class EVMChainWalletBase extends WalletBase<
await walletAddresses.init();
await transactionHistory.init();
+ // check for Already existing scam tokens, cuz users can get scammed twice ¯\_(ツ)_/¯
+ await _checkForExistingScamTokens();
+
if (walletInfo.isHardwareWallet) {
_evmChainPrivateKey = EvmLedgerCredentials(walletInfo.address);
walletAddresses.address = walletInfo.address;
@@ -188,6 +193,31 @@ abstract class EVMChainWalletBase extends WalletBase<
await save();
}
+ Future _checkForExistingScamTokens() async {
+ final baseCurrencySymbols = CryptoCurrency.all.map((e) => e.title.toUpperCase()).toList();
+
+ for (var token in erc20Currencies) {
+ bool isPotentialScam = false;
+
+ bool isWhitelisted =
+ getDefaultTokenContractAddresses.any((element) => element == token.contractAddress);
+
+ final tokenSymbol = token.title.toUpperCase();
+
+ // check if the token symbol is the same as any of the base currencies symbols (ETH, SOL, POL, TRX, etc):
+ // if it is, then it's probably a scam unless it's in the whitelist
+ if (baseCurrencySymbols.contains(tokenSymbol.trim().toUpperCase()) && !isWhitelisted) {
+ isPotentialScam = true;
+ }
+
+ if (isPotentialScam) {
+ token.isPotentialScam = true;
+ token.iconPath = null;
+ await token.save();
+ }
+ }
+ }
+
@override
Future calculateEstimatedFee(TransactionPriority priority) async {
{
diff --git a/cw_monero/lib/monero_unspent.dart b/cw_monero/lib/monero_unspent.dart
index 292c76dbe..224e33b2a 100644
--- a/cw_monero/lib/monero_unspent.dart
+++ b/cw_monero/lib/monero_unspent.dart
@@ -4,21 +4,32 @@ import 'package:cw_monero/api/coins_info.dart';
import 'package:monero/monero.dart' as monero;
class MoneroUnspent extends Unspent {
+ static Future fromUnspent(String address, String hash, String keyImage, int value, bool isFrozen, bool isUnlocked) async {
+ return MoneroUnspent(
+ address: address,
+ hash: hash,
+ keyImage: keyImage,
+ value: value,
+ isFrozen: isFrozen,
+ isUnlocked: isUnlocked);
+ }
+
MoneroUnspent(
- String address, String hash, String keyImage, int value, bool isFrozen, this.isUnlocked)
+ {required String address,
+ required String hash,
+ required String keyImage,
+ required int value,
+ required bool isFrozen,
+ required this.isUnlocked})
: super(address, hash, value, 0, keyImage) {
- getCoinByKeyImage(keyImage).then((coinId) {
- if (coinId == null) return;
- getCoin(coinId).then((coin) {
- _frozen = monero.CoinsInfo_frozen(coin);
- });
- });
+ _frozen = isFrozen;
}
bool _frozen = false;
@override
set isFrozen(bool freeze) {
+ _frozen = freeze;
printV("set isFrozen: $freeze ($keyImage): $freeze");
getCoinByKeyImage(keyImage!).then((coinId) async {
if (coinId == null) return;
diff --git a/cw_monero/lib/monero_wallet.dart b/cw_monero/lib/monero_wallet.dart
index 8d5bb154f..ac8e01279 100644
--- a/cw_monero/lib/monero_wallet.dart
+++ b/cw_monero/lib/monero_wallet.dart
@@ -592,7 +592,7 @@ abstract class MoneroWalletBase extends WalletBase get getDefaultTokenContractAddresses =>
+ DefaultPolygonErc20Tokens().initialPolygonErc20Tokens.map((e) => e.contractAddress).toList();
+
@override
Future checkIfScanProviderIsEnabled() async {
bool isPolygonScanEnabled = (await sharedPrefs.future).getBool("use_polygonscan") ?? true;
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
index df5cf1cc5..bd04914ae 100644
--- a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
+++ b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
@@ -1,114 +1,134 @@
{
- "images" : [
+ "images": [
{
- "filename" : "Icon-App-40x40@1x.png",
- "idiom" : "iphone",
- "scale" : "2x",
- "size" : "20x20"
+ "filename": "AppIcon@2x.png",
+ "idiom": "iphone",
+ "scale": "2x",
+ "size": "60x60"
},
{
- "filename" : "Icon-App-20x20@3x.png",
- "idiom" : "iphone",
- "scale" : "3x",
- "size" : "20x20"
+ "filename": "AppIcon@3x.png",
+ "idiom": "iphone",
+ "scale": "3x",
+ "size": "60x60"
},
{
- "filename" : "Icon-App-29x29@2x 1.png",
- "idiom" : "iphone",
- "scale" : "2x",
- "size" : "29x29"
+ "filename": "AppIcon~ipad.png",
+ "idiom": "ipad",
+ "scale": "1x",
+ "size": "76x76"
},
{
- "filename" : "Icon-App-29x29@3x.png",
- "idiom" : "iphone",
- "scale" : "3x",
- "size" : "29x29"
+ "filename": "AppIcon@2x~ipad.png",
+ "idiom": "ipad",
+ "scale": "2x",
+ "size": "76x76"
},
{
- "idiom" : "iphone",
- "scale" : "2x",
- "size" : "40x40"
+ "filename": "AppIcon-83.5@2x~ipad.png",
+ "idiom": "ipad",
+ "scale": "2x",
+ "size": "83.5x83.5"
},
{
- "filename" : "Icon-App-40x40@3x.png",
- "idiom" : "iphone",
- "scale" : "3x",
- "size" : "40x40"
+ "filename": "AppIcon-40@2x.png",
+ "idiom": "iphone",
+ "scale": "2x",
+ "size": "40x40"
},
{
- "filename" : "app_icon_120.png",
- "idiom" : "iphone",
- "scale" : "2x",
- "size" : "60x60"
+ "filename": "AppIcon-40@3x.png",
+ "idiom": "iphone",
+ "scale": "3x",
+ "size": "40x40"
},
{
- "filename" : "app_icon_180.png",
- "idiom" : "iphone",
- "scale" : "3x",
- "size" : "60x60"
+ "filename": "AppIcon-40~ipad.png",
+ "idiom": "ipad",
+ "scale": "1x",
+ "size": "40x40"
},
{
- "filename" : "Icon-App-20x20@1x.png",
- "idiom" : "ipad",
- "scale" : "1x",
- "size" : "20x20"
+ "filename": "AppIcon-40@2x~ipad.png",
+ "idiom": "ipad",
+ "scale": "2x",
+ "size": "40x40"
},
{
- "filename" : "Icon-App-20x20@2x.png",
- "idiom" : "ipad",
- "scale" : "2x",
- "size" : "20x20"
+ "filename": "AppIcon-20@2x.png",
+ "idiom": "iphone",
+ "scale": "2x",
+ "size": "20x20"
},
{
- "filename" : "Icon-App-29x29@1x.png",
- "idiom" : "ipad",
- "scale" : "1x",
- "size" : "29x29"
+ "filename": "AppIcon-20@3x.png",
+ "idiom": "iphone",
+ "scale": "3x",
+ "size": "20x20"
},
{
- "filename" : "Icon-App-29x29@2x.png",
- "idiom" : "ipad",
- "scale" : "2x",
- "size" : "29x29"
+ "filename": "AppIcon-20~ipad.png",
+ "idiom": "ipad",
+ "scale": "1x",
+ "size": "20x20"
},
{
- "filename" : "Icon-App-40x40@1x 1.png",
- "idiom" : "ipad",
- "scale" : "1x",
- "size" : "40x40"
+ "filename": "AppIcon-20@2x~ipad.png",
+ "idiom": "ipad",
+ "scale": "2x",
+ "size": "20x20"
},
{
- "idiom" : "ipad",
- "scale" : "2x",
- "size" : "40x40"
+ "filename": "AppIcon-29.png",
+ "idiom": "iphone",
+ "scale": "1x",
+ "size": "29x29"
},
{
- "filename" : "Icon-App-76x76@1x.png",
- "idiom" : "ipad",
- "scale" : "1x",
- "size" : "76x76"
+ "filename": "AppIcon-29@2x.png",
+ "idiom": "iphone",
+ "scale": "2x",
+ "size": "29x29"
},
{
- "filename" : "Icon-App-76x76@2x.png",
- "idiom" : "ipad",
- "scale" : "2x",
- "size" : "76x76"
+ "filename": "AppIcon-29@3x.png",
+ "idiom": "iphone",
+ "scale": "3x",
+ "size": "29x29"
},
{
- "filename" : "Icon-App-83.5x83.5@2x.png",
- "idiom" : "ipad",
- "scale" : "2x",
- "size" : "83.5x83.5"
+ "filename": "AppIcon-29~ipad.png",
+ "idiom": "ipad",
+ "scale": "1x",
+ "size": "29x29"
},
{
- "filename" : "app_icon_1024.png",
- "idiom" : "ios-marketing",
- "scale" : "1x",
- "size" : "1024x1024"
+ "filename": "AppIcon-29@2x~ipad.png",
+ "idiom": "ipad",
+ "scale": "2x",
+ "size": "29x29"
+ },
+ {
+ "filename": "AppIcon-60@2x~car.png",
+ "idiom": "car",
+ "scale": "2x",
+ "size": "60x60"
+ },
+ {
+ "filename": "AppIcon-60@3x~car.png",
+ "idiom": "car",
+ "scale": "3x",
+ "size": "60x60"
+ },
+ {
+ "filename": "AppIcon~ios-marketing.png",
+ "idiom": "ios-marketing",
+ "scale": "1x",
+ "size": "1024x1024"
}
],
- "info" : {
- "author" : "xcode",
- "version" : 1
+ "info": {
+ "author": "iconkitchen",
+ "version": 1
}
-}
+}
\ No newline at end of file
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
deleted file mode 100644
index 369d8d9a4..000000000
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and /dev/null differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
deleted file mode 100644
index 65ed7f3db..000000000
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and /dev/null differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
deleted file mode 100644
index fb14bfc55..000000000
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and /dev/null differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
deleted file mode 100644
index d24d594a3..000000000
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and /dev/null differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x 1.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x 1.png
deleted file mode 100644
index 07acd0a82..000000000
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x 1.png and /dev/null differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
deleted file mode 100644
index 07acd0a82..000000000
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and /dev/null differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
deleted file mode 100644
index bdc20091d..000000000
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and /dev/null differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x 1.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x 1.png
deleted file mode 100644
index 65ed7f3db..000000000
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x 1.png and /dev/null differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
deleted file mode 100644
index 65ed7f3db..000000000
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and /dev/null differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
deleted file mode 100644
index 80e78be41..000000000
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and /dev/null differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
deleted file mode 100644
index e06998b67..000000000
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and /dev/null differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
deleted file mode 100644
index 78a2ccfb1..000000000
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and /dev/null differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
deleted file mode 100644
index 0ba8d647c..000000000
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and /dev/null differ
diff --git a/lib/entities/provider_types.dart b/lib/entities/provider_types.dart
index 63918aa8b..400b5b9d4 100644
--- a/lib/entities/provider_types.dart
+++ b/lib/entities/provider_types.dart
@@ -6,7 +6,6 @@ import 'package:cake_wallet/buy/moonpay/moonpay_provider.dart';
import 'package:cake_wallet/buy/onramper/onramper_buy_provider.dart';
import 'package:cake_wallet/buy/robinhood/robinhood_buy_provider.dart';
import 'package:cake_wallet/di.dart';
-import 'package:cw_core/wallet_type.dart';
enum ProviderType { robinhood, dfx, onramper, moonpay, meld, kriptonim }
@@ -47,7 +46,7 @@ extension ProviderTypeName on ProviderType {
}
class ProvidersHelper {
- static List getAvailableBuyProviderTypes(WalletType walletType) => [
+ static List getAvailableBuyProviderTypes() => [
ProviderType.robinhood,
ProviderType.dfx,
ProviderType.onramper,
@@ -55,7 +54,7 @@ class ProvidersHelper {
ProviderType.kriptonim
];
- static List getAvailableSellProviderTypes(WalletType walletType) => [
+ static List getAvailableSellProviderTypes() => [
ProviderType.robinhood,
ProviderType.dfx,
ProviderType.onramper,
@@ -63,7 +62,7 @@ class ProvidersHelper {
ProviderType.kriptonim
];
- static BuyProvider? getProviderByType(ProviderType type) {
+ static BuyProvider getProviderByType(ProviderType type) {
switch (type) {
case ProviderType.robinhood:
return getIt.get();
@@ -77,8 +76,6 @@ class ProvidersHelper {
return getIt.get();
case ProviderType.kriptonim:
return getIt.get();
- default:
- return null;
- }
+ }
}
}
diff --git a/lib/src/screens/backup/backup_page.dart b/lib/src/screens/backup/backup_page.dart
index 8f520b15f..408fad2d3 100644
--- a/lib/src/screens/backup/backup_page.dart
+++ b/lib/src/screens/backup/backup_page.dart
@@ -139,6 +139,7 @@ class BackupPage extends BasePage {
await backupViewModelBase.saveToDownload(
backup.name, backup.file);
Navigator.of(dialogContext).pop();
+ await showBar(context, S.of(context).file_saved);
},
actionLeftButton: () async {
Navigator.of(dialogContext).pop();
diff --git a/lib/src/screens/backup/edit_backup_password_page.dart b/lib/src/screens/backup/edit_backup_password_page.dart
index 93207c191..1c80f1bb3 100644
--- a/lib/src/screens/backup/edit_backup_password_page.dart
+++ b/lib/src/screens/backup/edit_backup_password_page.dart
@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
-import 'package:flutter/cupertino.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/utils/show_pop_up.dart';
@@ -68,7 +67,9 @@ class EditBackupPasswordPage extends BasePage {
actionRightButton: () async {
await editBackupPasswordViewModel.save();
Navigator.of(dialogContext).pop();
- Navigator.of(context).pop();
+ if (context.mounted) {
+ Navigator.of(context).pop();
+ }
},
actionLeftButton: () => Navigator.of(dialogContext).pop());
});
diff --git a/lib/src/screens/dashboard/pages/address_page.dart b/lib/src/screens/dashboard/pages/address_page.dart
index a0de67100..ab51b97e6 100644
--- a/lib/src/screens/dashboard/pages/address_page.dart
+++ b/lib/src/screens/dashboard/pages/address_page.dart
@@ -162,7 +162,7 @@ class AddressPage extends BasePage {
}
reaction((_) => receiveOptionViewModel.selectedReceiveOption, (ReceivePageOption option) {
- if (bitcoin!.isBitcoinReceivePageOption(option)) {
+ if (dashboardViewModel.type == WalletType.bitcoin && bitcoin!.isBitcoinReceivePageOption(option)) {
addressListViewModel.setAddressType(bitcoin!.getOptionToType(option));
return;
}
diff --git a/lib/src/screens/dashboard/pages/navigation_dock.dart b/lib/src/screens/dashboard/pages/navigation_dock.dart
index 4eda169d3..e2a2362ee 100644
--- a/lib/src/screens/dashboard/pages/navigation_dock.dart
+++ b/lib/src/screens/dashboard/pages/navigation_dock.dart
@@ -32,7 +32,7 @@ class NavigationDock extends StatelessWidget {
),
),
child: Container(
- margin: const EdgeInsets.only(left: 16, right: 16, bottom: 16),
+ margin: const EdgeInsets.only(left: 8, right: 8, bottom: 16),
child: ClipRRect(
borderRadius: BorderRadius.circular(50),
child: BackdropFilter(
@@ -48,7 +48,7 @@ class NavigationDock extends StatelessWidget {
Theme.of(context).extension()!.syncedBackgroundColor,
),
child: Container(
- padding: EdgeInsets.symmetric(horizontal: 10),
+ padding: EdgeInsets.symmetric(horizontal: 8),
child: IntrinsicHeight(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
diff --git a/lib/src/screens/dashboard/pages/transactions_page.dart b/lib/src/screens/dashboard/pages/transactions_page.dart
index 654663f92..be353677b 100644
--- a/lib/src/screens/dashboard/pages/transactions_page.dart
+++ b/lib/src/screens/dashboard/pages/transactions_page.dart
@@ -45,20 +45,17 @@ class TransactionsPage extends StatelessWidget {
Observer(builder: (_) {
final status = dashboardViewModel.status;
if (status is SyncingSyncStatus) {
- return Padding(
- padding: const EdgeInsets.fromLTRB(24, 0, 24, 8),
- child: DashBoardRoundedCardWidget(
- key: ValueKey('transactions_page_syncing_alert_card_key'),
- onTap: () {
- try {
- final uri = Uri.parse(
- "https://docs.cakewallet.com/faq/funds-not-appearing");
- launchUrl(uri, mode: LaunchMode.externalApplication);
- } catch (_) {}
- },
- title: S.of(context).syncing_wallet_alert_title,
- subTitle: S.of(context).syncing_wallet_alert_content,
- ),
+ return DashBoardRoundedCardWidget(
+ key: ValueKey('transactions_page_syncing_alert_card_key'),
+ onTap: () {
+ try {
+ final uri = Uri.parse(
+ "https://docs.cakewallet.com/faq/funds-not-appearing");
+ launchUrl(uri, mode: LaunchMode.externalApplication);
+ } catch (_) {}
+ },
+ title: S.of(context).syncing_wallet_alert_title,
+ subTitle: S.of(context).syncing_wallet_alert_content,
);
} else {
return Container();
@@ -72,7 +69,6 @@ class TransactionsPage extends StatelessWidget {
child: Observer(
builder: (_) {
final items = dashboardViewModel.items;
- final amount = items.length + 1;
return items.isNotEmpty
? ListView.builder(
key: ValueKey('transactions_page_list_view_builder_key'),
diff --git a/lib/src/screens/dashboard/widgets/action_button.dart b/lib/src/screens/dashboard/widgets/action_button.dart
index 786c56658..b26dadb67 100644
--- a/lib/src/screens/dashboard/widgets/action_button.dart
+++ b/lib/src/screens/dashboard/widgets/action_button.dart
@@ -47,6 +47,8 @@ class ActionButton extends StatelessWidget {
SizedBox(height: 4),
Text(
title,
+ maxLines: 1,
+ overflow: TextOverflow.visible,
style: TextStyle(
fontSize: 9,
color: textColor ??
diff --git a/lib/src/screens/nodes/node_create_or_edit_page.dart b/lib/src/screens/nodes/node_create_or_edit_page.dart
index fc6ac07e0..e62b6cb01 100644
--- a/lib/src/screens/nodes/node_create_or_edit_page.dart
+++ b/lib/src/screens/nodes/node_create_or_edit_page.dart
@@ -182,7 +182,9 @@ class NodeCreateOrEditPage extends BasePage {
await nodeCreateOrEditViewModel.save(
editingNode: editingNode, saveAsCurrent: isSelected ?? false);
- Navigator.of(context).pop();
+ if (context.mounted) {
+ Navigator.of(context).pop();
+ }
},
text: S.of(context).save,
color: Theme.of(context).primaryColor,
diff --git a/lib/src/screens/send/send_page.dart b/lib/src/screens/send/send_page.dart
index 499bdb200..91f94e060 100644
--- a/lib/src/screens/send/send_page.dart
+++ b/lib/src/screens/send/send_page.dart
@@ -98,7 +98,7 @@ class SendPage extends BasePage {
return MergeSemantics(
child: SizedBox(
height: isMobileView ? 37 : 45,
- width: isMobileView ? 47: 45,
+ width: isMobileView ? 47 : 45,
child: ButtonTheme(
minWidth: double.minPositive,
child: Semantics(
@@ -397,7 +397,6 @@ class SendPage extends BasePage {
return LoadingPrimaryButton(
key: ValueKey('send_page_send_button_key'),
onPressed: () async {
-
//Request dummy node to get the focus out of the text fields
FocusScope.of(context).requestFocus(FocusNode());
@@ -507,7 +506,6 @@ class SendPage extends BasePage {
Navigator.of(loadingBottomSheetContext!).pop();
}
-
if (state is FailureState) {
WidgetsBinding.instance.addPostFrameCallback((_) {
showPopUp(
@@ -525,7 +523,6 @@ class SendPage extends BasePage {
}
if (state is IsExecutingState) {
-
// wait a bit to avoid showing the loading dialog if transaction is failed
await Future.delayed(const Duration(milliseconds: 300));
final currentState = sendViewModel.state;
@@ -584,8 +581,6 @@ class SendPage extends BasePage {
});
}
-
-
if (state is TransactionCommitted) {
WidgetsBinding.instance.addPostFrameCallback((_) async {
if (!context.mounted) {
@@ -594,7 +589,8 @@ class SendPage extends BasePage {
newContactAddress = newContactAddress ?? sendViewModel.newContactAddress();
- if (newContactAddress?.address != null && isRegularElectrumAddress(newContactAddress!.address)) {
+ if (newContactAddress?.address != null &&
+ isRegularElectrumAddress(newContactAddress!.address)) {
newContactAddress = null;
}
@@ -606,47 +602,53 @@ class SendPage extends BasePage {
builder: (BuildContext bottomSheetContext) {
return showContactSheet
? InfoBottomSheet(
- currentTheme: currentTheme,
- showDontAskMeCheckbox: true,
- onCheckboxChanged: (value) => sendViewModel.setShowAddressBookPopup(!value),
- titleText: S.of(bottomSheetContext).transaction_sent,
- contentImage: 'assets/images/contact_icon.svg',
- contentImageColor: Theme.of(context)
- .extension()!
- .titleColor,
- content: S.of(bottomSheetContext).add_contact_to_address_book,
- isTwoAction: true,
- leftButtonText: 'No',
- rightButtonText: 'Yes',
- actionLeftButton: () {
- Navigator.of(bottomSheetContext).pop();
- Navigator.of(context)
- .pushNamedAndRemoveUntil(Routes.dashboard, (route) => false);
- RequestReviewHandler.requestReview();
- newContactAddress = null;
- },
- actionRightButton: () {
- Navigator.of(bottomSheetContext).pop();
- RequestReviewHandler.requestReview();
- Navigator.of(context)
- .pushNamed(Routes.addressBookAddContact, arguments: newContactAddress);
- newContactAddress = null;
- },
- )
+ currentTheme: currentTheme,
+ showDontAskMeCheckbox: true,
+ onCheckboxChanged: (value) => sendViewModel.setShowAddressBookPopup(!value),
+ titleText: S.of(bottomSheetContext).transaction_sent,
+ contentImage: 'assets/images/contact_icon.svg',
+ contentImageColor: Theme.of(context).extension()!.titleColor,
+ content: S.of(bottomSheetContext).add_contact_to_address_book,
+ isTwoAction: true,
+ leftButtonText: 'No',
+ rightButtonText: 'Yes',
+ actionLeftButton: () {
+ Navigator.of(bottomSheetContext).pop();
+ if (context.mounted) {
+ Navigator.of(context)
+ .pushNamedAndRemoveUntil(Routes.dashboard, (route) => false);
+ }
+ RequestReviewHandler.requestReview();
+ newContactAddress = null;
+ },
+ actionRightButton: () {
+ Navigator.of(bottomSheetContext).pop();
+ RequestReviewHandler.requestReview();
+ if (context.mounted) {
+ Navigator.of(context).pushNamed(Routes.addressBookAddContact,
+ arguments: newContactAddress);
+ }
+ newContactAddress = null;
+ },
+ )
: InfoBottomSheet(
- currentTheme: currentTheme,
- titleText: S.of(bottomSheetContext).transaction_sent,
- contentImage: 'assets/images/birthday_cake.svg',
- actionButtonText: S.of(bottomSheetContext).close,
- actionButtonKey: ValueKey('send_page_sent_dialog_ok_button_key'),
- actionButton: () {
- Navigator.of(bottomSheetContext).pop();
- Navigator.of(context)
- .pushNamedAndRemoveUntil(Routes.dashboard, (route) => false);
- RequestReviewHandler.requestReview();
- newContactAddress = null;
- },
- );
+ currentTheme: currentTheme,
+ titleText: S.of(bottomSheetContext).transaction_sent,
+ contentImage: 'assets/images/birthday_cake.svg',
+ actionButtonText: S.of(bottomSheetContext).close,
+ actionButtonKey: ValueKey('send_page_sent_dialog_ok_button_key'),
+ actionButton: () {
+ Navigator.of(bottomSheetContext).pop();
+ Future.delayed(Duration.zero, () {
+ if (context.mounted) {
+ Navigator.of(context)
+ .pushNamedAndRemoveUntil(Routes.dashboard, (route) => false);
+ }
+ RequestReviewHandler.requestReview();
+ newContactAddress = null;
+ });
+ },
+ );
},
);
@@ -678,8 +680,7 @@ class SendPage extends BasePage {
currentTheme: currentTheme,
titleText: S.of(bottomSheetContext).proceed_on_device,
contentImage: 'assets/images/hardware_wallet/ledger_nano_x.png',
- contentImageColor:
- Theme.of(context).extension()!.titleColor,
+ contentImageColor: Theme.of(context).extension()!.titleColor,
content: S.of(bottomSheetContext).proceed_on_device_description,
isTwoAction: false,
actionButtonText: S.of(context).cancel,
@@ -778,5 +779,4 @@ class SendPage extends BasePage {
return isValid;
}
-
}
diff --git a/lib/src/screens/send/widgets/send_card.dart b/lib/src/screens/send/widgets/send_card.dart
index a8a9e6b61..5240867c9 100644
--- a/lib/src/screens/send/widgets/send_card.dart
+++ b/lib/src/screens/send/widgets/send_card.dart
@@ -90,6 +90,9 @@ class SendCardState extends State with AutomaticKeepAliveClientMixin with AutomaticKeepAliveClientMixin output.setSendAll(sendViewModel.sendingBalance)),
+ allAmountCallback: () async => output.setSendAll(await sendViewModel.sendingBalance)),
Divider(
height: 1,
color: Theme.of(context).extension()!.textFieldHintColor),
Observer(
- builder: (_) => Padding(
- padding: EdgeInsets.only(top: 10),
- child: Row(
- mainAxisSize: MainAxisSize.max,
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Expanded(
- child: Text(
- S.of(context).available_balance + ':',
- style: TextStyle(
+ builder: (_) {
+ // force rebuild on mobx
+ final _ = sendViewModel.coinTypeToSpendFrom;
+ return Padding(
+ padding: EdgeInsets.only(top: 10),
+ child: Row(
+ mainAxisSize: MainAxisSize.max,
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Expanded(
+ child: Text(
+ S.of(context).available_balance + ':',
+ style: TextStyle(
+ fontSize: 12,
+ fontWeight: FontWeight.w600,
+ color:
+ Theme.of(context).extension()!.textFieldHintColor),
+ ),
+ ),
+ FutureBuilder(
+ future: sendViewModel.sendingBalance,
+ builder: (context, snapshot) {
+ return Text(
+ snapshot.data ?? sendViewModel.balance, // default to balance while loading
+ style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color:
Theme.of(context).extension()!.textFieldHintColor),
- ),
- ),
- Text(
- sendViewModel.sendingBalance,
- style: TextStyle(
- fontSize: 12,
- fontWeight: FontWeight.w600,
- color:
- Theme.of(context).extension()!.textFieldHintColor),
- )
- ],
- ),
- ),
+ );
+ },
+ )
+ ],
+ ),
+ );
+ },
),
if (!sendViewModel.isFiatDisabled)
CurrencyAmountTextField(
@@ -523,9 +535,9 @@ class SendCardState extends State with AutomaticKeepAliveClientMixin sendViewModel.selectedCryptoCurrency, (Currency currency) {
+ reaction((_) => sendViewModel.selectedCryptoCurrency, (Currency currency) async {
if (output.sendAll) {
- output.setSendAll(sendViewModel.sendingBalance);
+ output.setSendAll(await sendViewModel.sendingBalance);
}
output.setCryptoAmount(cryptoAmountController.text);
diff --git a/lib/src/screens/wallet_connect/wc_pairing_detail_page.dart b/lib/src/screens/wallet_connect/wc_pairing_detail_page.dart
index f99eb9cdb..321d1354a 100644
--- a/lib/src/screens/wallet_connect/wc_pairing_detail_page.dart
+++ b/lib/src/screens/wallet_connect/wc_pairing_detail_page.dart
@@ -101,7 +101,7 @@ class WCCDetailsWidget extends BasePage {
child: CircleAvatar(
backgroundImage: (pairing.peerMetadata!.icons.isNotEmpty
? NetworkImage(pairing.peerMetadata!.icons[0])
- : const AssetImage('assets/images/default_icon.png'))
+ : const AssetImage('assets/images/app_logo.png'))
as ImageProvider