fix moving total balance case in advance
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendViewModel.cs
@@ -112,12 +112,14 @@ public partial class SendViewModel : RoutableViewModel
return;
}
+ var amount = new Money(AmountBtc, MoneyUnit.BTC);
var transactionInfo = new TransactionInfo(BitcoinAddress.Create(To, _wallet.Network), _wallet.AnonScoreTarget)
{
- Amount = new Money(AmountBtc, MoneyUnit.BTC),
+ Amount = amount,
Recipient = label,
- PayJoinClient = PayJoinEndPoint is { } ? GetPayjoinClient(PayJoinEndPoint) : null,
- IsFixedAmount = _isFixedAmount
+ PayJoinClient = GetPayjoinClient(PayJoinEndPoint),
+ IsFixedAmount = IsFixedAmount,
+ SubtractFee = amount == _wallet.Coins.TotalAmount() && !(IsFixedAmount || IsPayJoin)
};
Navigate().To(new TransactionPreviewViewModel(_wallet, transactionInfo));
@@ -166,7 +168,7 @@ public partial class SendViewModel : RoutableViewModel
}
}
- private IPayjoinClient? GetPayjoinClient(string endPoint)
+ private IPayjoinClient? GetPayjoinClient(string? endPoint)
{
if (!string.IsNullOrWhiteSpace(endPoint) &&
Uri.IsWellFormedUriString(endPoint, UriKind.Absolute))

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionInfo.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionInfo.cs
@@ -47,7 +47,7 @@ public partial class TransactionInfo
public bool IsCustomFeeUsed { get; set; }
- public bool SubtractFee { get; set; }
+ public bool SubtractFee { get; init; }
public bool IsOtherPocketSelectionPossible { get; set; }

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionPreviewViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionPreviewViewModel.cs
@@ -351,15 +351,6 @@ public partial class TransactionPreviewViewModel : RoutableViewModel
return true;
}
- // The total balance is being sent, the user intention is to move the total balance,
- // so subtract the transaction fee from the amount.
- // Except: in the case of amount is fixed or PayJoin, the amount cannot be change.
- if (allCoinsAreSelected && isTotalBalanceUsed && !(_info.IsFixedAmount || _info.IsPayJoin))
- {
- _info.SubtractFee = true;
- return true;
- }
-
var errorMessage = !foundMaximumPossibleFeeRate
? "There are not enough funds to cover the transaction fee."
: "The transaction cannot be sent at the moment.";

fix moving total balance case in advance