* 4.22.1 RC

* minor cleanup [skip ci]

* Fix frozen balance not displaying at startup issue

* Monero balance tx display issue (#1934)

* minor cleanup [skip ci]

* Fix frozen balance not displaying at startup issue

* fix transactions not updating (stupid mobx reactions :3)

* [skip ci]
This commit is contained in:
Omar Hatem 2025-01-05 03:11:44 +02:00 committed by GitHub
parent cee3abcb72
commit d1c45a5326
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 32 additions and 54 deletions

View file

@ -1,3 +1,2 @@
Support Monero Ledger UI enhancements
Bug fixes Bug fixes
New designs and better user experience

View file

@ -1,5 +1,4 @@
Support Monero Ledger Bitcoin and Litecoin enhancements
Prepare for Haven removal Solana and Nano fixes/improvements
Improve Ethereum and Polygon sending process UI enhancements
Bug fixes Bug fixes
New designs and better user experience

View file

@ -7,7 +7,6 @@ import 'package:cw_core/pathForWallet.dart';
import 'package:cw_core/transaction_priority.dart'; import 'package:cw_core/transaction_priority.dart';
import 'package:cw_core/account.dart'; import 'package:cw_core/account.dart';
import 'package:cw_core/crypto_currency.dart'; import 'package:cw_core/crypto_currency.dart';
import 'package:cw_core/monero_amount_format.dart';
import 'package:cw_core/monero_balance.dart'; import 'package:cw_core/monero_balance.dart';
import 'package:cw_core/monero_transaction_priority.dart'; import 'package:cw_core/monero_transaction_priority.dart';
import 'package:cw_core/monero_wallet_keys.dart'; import 'package:cw_core/monero_wallet_keys.dart';
@ -28,7 +27,6 @@ import 'package:cw_monero/api/transaction_history.dart' as transaction_history;
import 'package:cw_monero/api/wallet.dart' as monero_wallet; import 'package:cw_monero/api/wallet.dart' as monero_wallet;
import 'package:cw_monero/api/wallet_manager.dart'; import 'package:cw_monero/api/wallet_manager.dart';
import 'package:cw_monero/exceptions/monero_transaction_creation_exception.dart'; import 'package:cw_monero/exceptions/monero_transaction_creation_exception.dart';
import 'package:cw_monero/exceptions/monero_transaction_no_inputs_exception.dart';
import 'package:cw_monero/ledger.dart'; import 'package:cw_monero/ledger.dart';
import 'package:cw_monero/monero_transaction_creation_credentials.dart'; import 'package:cw_monero/monero_transaction_creation_credentials.dart';
import 'package:cw_monero/monero_transaction_history.dart'; import 'package:cw_monero/monero_transaction_history.dart';
@ -58,8 +56,9 @@ abstract class MoneroWalletBase extends WalletBase<MoneroBalance,
required String password}) required String password})
: balance = ObservableMap<CryptoCurrency, MoneroBalance>.of({ : balance = ObservableMap<CryptoCurrency, MoneroBalance>.of({
CryptoCurrency.xmr: MoneroBalance( CryptoCurrency.xmr: MoneroBalance(
fullBalance: monero_wallet.getFullBalance(accountIndex: 0), fullBalance: monero_wallet.getFullBalance(accountIndex: 0),
unlockedBalance: monero_wallet.getFullBalance(accountIndex: 0)) unlockedBalance: monero_wallet.getUnlockedBalance(accountIndex: 0),
)
}), }),
_isTransactionUpdating = false, _isTransactionUpdating = false,
_hasSyncAfterStartup = false, _hasSyncAfterStartup = false,
@ -281,7 +280,6 @@ abstract class MoneroWalletBase extends WalletBase<MoneroBalance,
final hasMultiDestination = outputs.length > 1; final hasMultiDestination = outputs.length > 1;
final unlockedBalance = monero_wallet.getUnlockedBalance( final unlockedBalance = monero_wallet.getUnlockedBalance(
accountIndex: walletAddresses.account!.id); accountIndex: walletAddresses.account!.id);
var allInputsAmount = 0;
PendingTransactionDescription pendingTransactionDescription; PendingTransactionDescription pendingTransactionDescription;
@ -295,11 +293,9 @@ abstract class MoneroWalletBase extends WalletBase<MoneroBalance,
for (final utx in unspentCoins) { for (final utx in unspentCoins) {
if (utx.isSending) { if (utx.isSending) {
allInputsAmount += utx.value;
inputs.add(utx.keyImage!); inputs.add(utx.keyImage!);
} }
} }
final spendAllCoins = inputs.length == unspentCoins.length;
if (hasMultiDestination) { if (hasMultiDestination) {
if (outputs.any( if (outputs.any(
@ -311,8 +307,6 @@ abstract class MoneroWalletBase extends WalletBase<MoneroBalance,
final int totalAmount = outputs.fold( final int totalAmount = outputs.fold(
0, (acc, value) => acc + (value.formattedCryptoAmount ?? 0)); 0, (acc, value) => acc + (value.formattedCryptoAmount ?? 0));
final estimatedFee =
calculateEstimatedFee(_credentials.priority, totalAmount);
if (unlockedBalance < totalAmount) { if (unlockedBalance < totalAmount) {
throw MoneroTransactionCreationException( throw MoneroTransactionCreationException(
'You do not have enough XMR to send this amount.'); 'You do not have enough XMR to send this amount.');
@ -342,8 +336,6 @@ abstract class MoneroWalletBase extends WalletBase<MoneroBalance,
output.isParsedAddress ? output.extractedAddress : output.address; output.isParsedAddress ? output.extractedAddress : output.address;
final amount = final amount =
output.sendAll ? null : output.cryptoAmount!.replaceAll(',', '.'); output.sendAll ? null : output.cryptoAmount!.replaceAll(',', '.');
final formattedAmount =
output.sendAll ? null : output.formattedCryptoAmount;
// if ((formattedAmount != null && unlockedBalance < formattedAmount) || // if ((formattedAmount != null && unlockedBalance < formattedAmount) ||
// (formattedAmount == null && unlockedBalance <= 0)) { // (formattedAmount == null && unlockedBalance <= 0)) {
@ -353,8 +345,6 @@ abstract class MoneroWalletBase extends WalletBase<MoneroBalance,
// 'You do not have enough unlocked balance. Unlocked: $formattedBalance. Transaction amount: ${output.cryptoAmount}.'); // 'You do not have enough unlocked balance. Unlocked: $formattedBalance. Transaction amount: ${output.cryptoAmount}.');
// } // }
final estimatedFee =
calculateEstimatedFee(_credentials.priority, formattedAmount);
if (inputs.isEmpty) MoneroTransactionCreationException( if (inputs.isEmpty) MoneroTransactionCreationException(
'No inputs selected'); 'No inputs selected');
pendingTransactionDescription = pendingTransactionDescription =
@ -750,26 +740,16 @@ abstract class MoneroWalletBase extends WalletBase<MoneroBalance,
Future<void> _askForUpdateTransactionHistory() async => Future<void> _askForUpdateTransactionHistory() async =>
await updateTransactions(); await updateTransactions();
int _getFullBalance() =>
monero_wallet.getFullBalance(accountIndex: walletAddresses.account!.id);
int _getUnlockedBalance() => monero_wallet.getUnlockedBalance( int _getUnlockedBalance() => monero_wallet.getUnlockedBalance(
accountIndex: walletAddresses.account!.id); accountIndex: walletAddresses.account!.id);
int _getFrozenBalance() { int _getFrozenBalance() {
var frozenBalance = 0; var frozenBalance = 0;
unspentCoinsInfo.values.forEach((info) { for (var coin in unspentCoinsInfo.values.where((element) =>
unspentCoins.forEach((element) { element.walletId == id && element.accountIndex == walletAddresses.account!.id)) {
if (element.hash == info.hash && if (coin.isFrozen && !coin.isSending) frozenBalance += coin.value;
element.vout == info.vout && }
info.isFrozen &&
element.value == info.value && info.walletId == id &&
info.accountIndex == walletAddresses.account!.id) {
if (element.isFrozen && !element.isSending) frozenBalance+= element.value;
}
});
});
return frozenBalance; return frozenBalance;
} }

View file

@ -272,7 +272,7 @@ SPEC CHECKSUMS:
uni_links: d97da20c7701486ba192624d99bffaaffcfc298a uni_links: d97da20c7701486ba192624d99bffaaffcfc298a
universal_ble: cf52a7b3fd2e7c14d6d7262e9fdadb72ab6b88a6 universal_ble: cf52a7b3fd2e7c14d6d7262e9fdadb72ab6b88a6
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
wakelock_plus: 78ec7c5b202cab7761af8e2b2b3d0671be6c4ae1 wakelock_plus: 373cfe59b235a6dd5837d0fb88791d2f13a90d56
workmanager: 0afdcf5628bbde6924c21af7836fed07b42e30e6 workmanager: 0afdcf5628bbde6924c21af7836fed07b42e30e6
PODFILE CHECKSUM: e448f662d4c41f0c0b1ccbb78afd57dbf895a597 PODFILE CHECKSUM: e448f662d4c41f0c0b1ccbb78afd57dbf895a597

View file

@ -641,7 +641,7 @@ abstract class DashboardViewModelBase with Store {
transactions.clear(); transactions.clear();
transactions = ObservableList.of( transactions.addAll(
wallet.transactionHistory.transactions.values.map( wallet.transactionHistory.transactions.values.map(
(transaction) => TransactionListItem( (transaction) => TransactionListItem(
transaction: transaction, transaction: transaction,
@ -703,7 +703,7 @@ abstract class DashboardViewModelBase with Store {
monero!.getTransactionInfoAccountId(tx) == monero!.getCurrentAccount(wallet).id) monero!.getTransactionInfoAccountId(tx) == monero!.getCurrentAccount(wallet).id)
.toList(); .toList();
transactions = ObservableList.of( transactions.addAll(
_accountTransactions.map( _accountTransactions.map(
(transaction) => TransactionListItem( (transaction) => TransactionListItem(
transaction: transaction, transaction: transaction,
@ -723,7 +723,7 @@ abstract class DashboardViewModelBase with Store {
wow.wownero!.getCurrentAccount(wallet).id) wow.wownero!.getCurrentAccount(wallet).id)
.toList(); .toList();
transactions = ObservableList.of( transactions.addAll(
_accountTransactions.map( _accountTransactions.map(
(transaction) => TransactionListItem( (transaction) => TransactionListItem(
transaction: transaction, transaction: transaction,

View file

@ -15,15 +15,15 @@ TYPES=($MONERO_COM $CAKEWALLET $HAVEN)
APP_ANDROID_TYPE=$1 APP_ANDROID_TYPE=$1
MONERO_COM_NAME="Monero.com" MONERO_COM_NAME="Monero.com"
MONERO_COM_VERSION="1.19.0" MONERO_COM_VERSION="1.19.1"
MONERO_COM_BUILD_NUMBER=109 MONERO_COM_BUILD_NUMBER=110
MONERO_COM_BUNDLE_ID="com.monero.app" MONERO_COM_BUNDLE_ID="com.monero.app"
MONERO_COM_PACKAGE="com.monero.app" MONERO_COM_PACKAGE="com.monero.app"
MONERO_COM_SCHEME="monero.com" MONERO_COM_SCHEME="monero.com"
CAKEWALLET_NAME="Cake Wallet" CAKEWALLET_NAME="Cake Wallet"
CAKEWALLET_VERSION="4.22.0" CAKEWALLET_VERSION="4.22.1"
CAKEWALLET_BUILD_NUMBER=240 CAKEWALLET_BUILD_NUMBER=241
CAKEWALLET_BUNDLE_ID="com.cakewallet.cake_wallet" CAKEWALLET_BUNDLE_ID="com.cakewallet.cake_wallet"
CAKEWALLET_PACKAGE="com.cakewallet.cake_wallet" CAKEWALLET_PACKAGE="com.cakewallet.cake_wallet"
CAKEWALLET_SCHEME="cakewallet" CAKEWALLET_SCHEME="cakewallet"

View file

@ -13,13 +13,13 @@ TYPES=($MONERO_COM $CAKEWALLET $HAVEN)
APP_IOS_TYPE=$1 APP_IOS_TYPE=$1
MONERO_COM_NAME="Monero.com" MONERO_COM_NAME="Monero.com"
MONERO_COM_VERSION="1.19.0" MONERO_COM_VERSION="1.19.1"
MONERO_COM_BUILD_NUMBER=106 MONERO_COM_BUILD_NUMBER=107
MONERO_COM_BUNDLE_ID="com.cakewallet.monero" MONERO_COM_BUNDLE_ID="com.cakewallet.monero"
CAKEWALLET_NAME="Cake Wallet" CAKEWALLET_NAME="Cake Wallet"
CAKEWALLET_VERSION="4.22.0" CAKEWALLET_VERSION="4.22.1"
CAKEWALLET_BUILD_NUMBER=287 CAKEWALLET_BUILD_NUMBER=288
CAKEWALLET_BUNDLE_ID="com.fotolockr.cakewallet" CAKEWALLET_BUNDLE_ID="com.fotolockr.cakewallet"
HAVEN_NAME="Haven" HAVEN_NAME="Haven"

View file

@ -14,8 +14,8 @@ if [ -n "$1" ]; then
fi fi
CAKEWALLET_NAME="Cake Wallet" CAKEWALLET_NAME="Cake Wallet"
CAKEWALLET_VERSION="1.12.0" CAKEWALLET_VERSION="1.12.1"
CAKEWALLET_BUILD_NUMBER=41 CAKEWALLET_BUILD_NUMBER=42
if ! [[ " ${TYPES[*]} " =~ " ${APP_LINUX_TYPE} " ]]; then if ! [[ " ${TYPES[*]} " =~ " ${APP_LINUX_TYPE} " ]]; then
echo "Wrong app type." echo "Wrong app type."

View file

@ -16,13 +16,13 @@ if [ -n "$1" ]; then
fi fi
MONERO_COM_NAME="Monero.com" MONERO_COM_NAME="Monero.com"
MONERO_COM_VERSION="1.9.0" MONERO_COM_VERSION="1.9.1"
MONERO_COM_BUILD_NUMBER=39 MONERO_COM_BUILD_NUMBER=40
MONERO_COM_BUNDLE_ID="com.cakewallet.monero" MONERO_COM_BUNDLE_ID="com.cakewallet.monero"
CAKEWALLET_NAME="Cake Wallet" CAKEWALLET_NAME="Cake Wallet"
CAKEWALLET_VERSION="1.15.0" CAKEWALLET_VERSION="1.15.1"
CAKEWALLET_BUILD_NUMBER=99 CAKEWALLET_BUILD_NUMBER=100
CAKEWALLET_BUNDLE_ID="com.fotolockr.cakewallet" CAKEWALLET_BUNDLE_ID="com.fotolockr.cakewallet"
if ! [[ " ${TYPES[*]} " =~ " ${APP_MACOS_TYPE} " ]]; then if ! [[ " ${TYPES[*]} " =~ " ${APP_MACOS_TYPE} " ]]; then

View file

@ -1,5 +1,5 @@
#define MyAppName "Cake Wallet" #define MyAppName "Cake Wallet"
#define MyAppVersion "0.3.0" #define MyAppVersion "0.3.1"
#define MyAppPublisher "Cake Labs LLC" #define MyAppPublisher "Cake Labs LLC"
#define MyAppURL "https://cakewallet.com/" #define MyAppURL "https://cakewallet.com/"
#define MyAppExeName "CakeWallet.exe" #define MyAppExeName "CakeWallet.exe"