Rename FeeUtil to OfferViewModelUtil

This commit is contained in:
chimp1984 2021-10-19 23:43:36 +02:00
parent 9777005ec7
commit 4a9db79068
No known key found for this signature in database
GPG Key ID: 9801B4EC591F90E3
3 changed files with 22 additions and 22 deletions

View File

@ -32,7 +32,7 @@ import org.bitcoinj.core.Coin;
import java.util.Optional;
public class FeeUtil {
public class OfferViewModelUtil {
public static String getTradeFeeWithFiatEquivalent(OfferUtil offerUtil,
Coin tradeFee,
boolean isCurrencyForMakerFeeBtc,
@ -74,7 +74,7 @@ public class FeeUtil {
} else {
// For BSQ we use the fiat equivalent only. Calculating the % value would be more effort.
// We could calculate the BTC value if the BSQ fee and use that...
return FeeUtil.getTradeFeeWithFiatEquivalent(offerUtil,
return OfferViewModelUtil.getTradeFeeWithFiatEquivalent(offerUtil,
tradeFee,
false,
formatter);

View File

@ -23,7 +23,7 @@ import bisq.desktop.main.MainView;
import bisq.desktop.main.PriceUtil;
import bisq.desktop.main.funds.FundsView;
import bisq.desktop.main.funds.deposit.DepositView;
import bisq.desktop.main.offer.FeeUtil;
import bisq.desktop.main.offer.OfferViewModelUtil;
import bisq.desktop.main.overlays.popups.Popup;
import bisq.desktop.main.settings.SettingsView;
import bisq.desktop.main.settings.preferences.PreferencesView;
@ -513,11 +513,11 @@ public abstract class MutableOfferViewModel<M extends MutableOfferDataModel> ext
isTradeFeeVisible.setValue(true);
tradeFee.set(getFormatterForMakerFee().formatCoin(makerFeeAsCoin));
tradeFeeInBtcWithFiat.set(FeeUtil.getTradeFeeWithFiatEquivalent(offerUtil,
tradeFeeInBtcWithFiat.set(OfferViewModelUtil.getTradeFeeWithFiatEquivalent(offerUtil,
dataModel.getMakerFeeInBtc(),
true,
btcFormatter));
tradeFeeInBsqWithFiat.set(FeeUtil.getTradeFeeWithFiatEquivalent(offerUtil,
tradeFeeInBsqWithFiat.set(OfferViewModelUtil.getTradeFeeWithFiatEquivalent(offerUtil,
dataModel.getMakerFeeInBsq(),
false,
bsqFormatter));
@ -992,7 +992,7 @@ public abstract class MutableOfferViewModel<M extends MutableOfferDataModel> ext
}
public String getTradeAmount() {
return FeeUtil.getTradeFeeWithFiatEquivalent(offerUtil,
return OfferViewModelUtil.getTradeFeeWithFiatEquivalent(offerUtil,
dataModel.getAmount().get(),
true,
btcFormatter);
@ -1009,7 +1009,7 @@ public abstract class MutableOfferViewModel<M extends MutableOfferDataModel> ext
}
public String getSecurityDepositInfo() {
return FeeUtil.getTradeFeeWithFiatEquivalentAndPercentage(offerUtil,
return OfferViewModelUtil.getTradeFeeWithFiatEquivalentAndPercentage(offerUtil,
dataModel.getSecurityDeposit(),
dataModel.getAmount().get(),
true,
@ -1025,7 +1025,7 @@ public abstract class MutableOfferViewModel<M extends MutableOfferDataModel> ext
public String getTradeFee() {
if (dataModel.isCurrencyForMakerFeeBtc()) {
return FeeUtil.getTradeFeeWithFiatEquivalentAndPercentage(offerUtil,
return OfferViewModelUtil.getTradeFeeWithFiatEquivalentAndPercentage(offerUtil,
dataModel.getMakerFeeInBtc(),
dataModel.getAmount().get(),
true,
@ -1034,7 +1034,7 @@ public abstract class MutableOfferViewModel<M extends MutableOfferDataModel> ext
} else {
// For BSQ we use the fiat equivalent only. Calculating the % value would require to
// calculate the BTC value of the BSQ fee and use that...
return FeeUtil.getTradeFeeWithFiatEquivalent(offerUtil,
return OfferViewModelUtil.getTradeFeeWithFiatEquivalent(offerUtil,
dataModel.getMakerFeeInBsq(),
false,
bsqFormatter);
@ -1051,12 +1051,12 @@ public abstract class MutableOfferViewModel<M extends MutableOfferDataModel> ext
public String getTotalToPayInfo() {
if (dataModel.isCurrencyForMakerFeeBtc()) {
return FeeUtil.getTradeFeeWithFiatEquivalent(offerUtil,
return OfferViewModelUtil.getTradeFeeWithFiatEquivalent(offerUtil,
dataModel.totalToPayAsCoin.get(),
true,
btcFormatter);
} else {
return FeeUtil.getTradeFeeWithFiatEquivalent(offerUtil,
return OfferViewModelUtil.getTradeFeeWithFiatEquivalent(offerUtil,
dataModel.totalToPayAsCoin.get(),
true,
btcFormatter) + " + " + getTradeFee();
@ -1076,7 +1076,7 @@ public abstract class MutableOfferViewModel<M extends MutableOfferDataModel> ext
}
public String getTxFee() {
return FeeUtil.getTradeFeeWithFiatEquivalentAndPercentage(offerUtil,
return OfferViewModelUtil.getTradeFeeWithFiatEquivalentAndPercentage(offerUtil,
dataModel.getTxFee(),
dataModel.getAmount().get(),
true,

View File

@ -23,7 +23,7 @@ import bisq.desktop.common.model.ViewModel;
import bisq.desktop.main.MainView;
import bisq.desktop.main.funds.FundsView;
import bisq.desktop.main.funds.deposit.DepositView;
import bisq.desktop.main.offer.FeeUtil;
import bisq.desktop.main.offer.OfferViewModelUtil;
import bisq.desktop.main.overlays.popups.Popup;
import bisq.desktop.util.DisplayUtils;
import bisq.desktop.util.GUIUtil;
@ -288,11 +288,11 @@ class TakeOfferViewModel extends ActivatableWithDataModel<TakeOfferDataModel> im
isTradeFeeVisible.setValue(true);
tradeFee.set(getFormatterForTakerFee().formatCoin(takerFeeAsCoin));
tradeFeeInBtcWithFiat.set(FeeUtil.getTradeFeeWithFiatEquivalent(offerUtil,
tradeFeeInBtcWithFiat.set(OfferViewModelUtil.getTradeFeeWithFiatEquivalent(offerUtil,
dataModel.getTakerFeeInBtc(),
true,
btcFormatter));
tradeFeeInBsqWithFiat.set(FeeUtil.getTradeFeeWithFiatEquivalent(offerUtil,
tradeFeeInBsqWithFiat.set(OfferViewModelUtil.getTradeFeeWithFiatEquivalent(offerUtil,
dataModel.getTakerFeeInBsq(),
false,
bsqFormatter));
@ -685,14 +685,14 @@ class TakeOfferViewModel extends ActivatableWithDataModel<TakeOfferDataModel> im
}
String getTradeAmount() {
return FeeUtil.getTradeFeeWithFiatEquivalent(offerUtil,
return OfferViewModelUtil.getTradeFeeWithFiatEquivalent(offerUtil,
dataModel.getAmount().get(),
true,
btcFormatter);
}
public String getSecurityDepositInfo() {
return FeeUtil.getTradeFeeWithFiatEquivalentAndPercentage(offerUtil,
return OfferViewModelUtil.getTradeFeeWithFiatEquivalentAndPercentage(offerUtil,
dataModel.getSecurityDeposit(),
dataModel.getAmount().get(),
true,
@ -707,7 +707,7 @@ class TakeOfferViewModel extends ActivatableWithDataModel<TakeOfferDataModel> im
public String getTradeFee() {
if (dataModel.isCurrencyForTakerFeeBtc()) {
return FeeUtil.getTradeFeeWithFiatEquivalentAndPercentage(offerUtil,
return OfferViewModelUtil.getTradeFeeWithFiatEquivalentAndPercentage(offerUtil,
dataModel.getTakerFeeInBtc(),
dataModel.getAmount().get(),
true,
@ -716,7 +716,7 @@ class TakeOfferViewModel extends ActivatableWithDataModel<TakeOfferDataModel> im
} else {
// For BSQ we use the fiat equivalent only. Calculating the % value would require to
// calculate the BTC value of the BSQ fee and use that...
return FeeUtil.getTradeFeeWithFiatEquivalent(offerUtil,
return OfferViewModelUtil.getTradeFeeWithFiatEquivalent(offerUtil,
dataModel.getTakerFeeInBsq(),
false,
bsqFormatter);
@ -733,12 +733,12 @@ class TakeOfferViewModel extends ActivatableWithDataModel<TakeOfferDataModel> im
public String getTotalToPayInfo() {
if (dataModel.isCurrencyForTakerFeeBtc()) {
return FeeUtil.getTradeFeeWithFiatEquivalent(offerUtil,
return OfferViewModelUtil.getTradeFeeWithFiatEquivalent(offerUtil,
dataModel.totalToPayAsCoin.get(),
true,
btcFormatter);
} else {
return FeeUtil.getTradeFeeWithFiatEquivalent(offerUtil,
return OfferViewModelUtil.getTradeFeeWithFiatEquivalent(offerUtil,
dataModel.totalToPayAsCoin.get(),
true,
btcFormatter) + " + " + getTradeFee();
@ -746,7 +746,7 @@ class TakeOfferViewModel extends ActivatableWithDataModel<TakeOfferDataModel> im
}
public String getTxFee() {
return FeeUtil.getTradeFeeWithFiatEquivalentAndPercentage(offerUtil,
return OfferViewModelUtil.getTradeFeeWithFiatEquivalentAndPercentage(offerUtil,
dataModel.getTotalTxFee(),
dataModel.getAmount().get(),
true,