Skip to content

Commit

Permalink
Show BSQ trading fee next to BTC total amount that needs to be used t…
Browse files Browse the repository at this point in the history
…o fund the trade
  • Loading branch information
ripcurlx committed Feb 6, 2019
1 parent b9ff455 commit f43032d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
2 changes: 2 additions & 0 deletions core/src/main/resources/i18n/displayStrings.properties
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ createOffer.fundsBox.networkFee=Mining fee
createOffer.fundsBox.placeOfferSpinnerInfo=Offer publishing is in progress ...
createOffer.fundsBox.paymentLabel=Bisq trade with ID {0}
createOffer.fundsBox.fundsStructure=({0} security deposit, {1} trade fee, {2} mining fee)
createOffer.fundsBox.fundsStructure.BSQ=({0} security deposit, {1} mining fee) + {2} trade fee
createOffer.success.headline=Your offer has been published
createOffer.success.info=You can manage your open offers at \"Portfolio/My open offers\".
createOffer.info.sellAtMarketPrice=You will always sell at market price as the price of your offer will be continuously updated.
Expand All @@ -391,6 +392,7 @@ createOffer.alreadyFunded=You had already funded that offer.\nYour funds have be
createOffer.createOfferFundWalletInfo.headline=Fund your offer
# suppress inspection "TrailingSpacesInProperty"
createOffer.createOfferFundWalletInfo.tradeAmount=- Trade amount: {0} \n
createOffer.createOfferFundWalletInfo.feesWithBSQ={0} and {1}
createOffer.createOfferFundWalletInfo.msg=You need to deposit {0} to this offer.\n\nThose funds are reserved in your local wallet and will get locked into the multisig deposit address once someone takes your offer.\n\nThe amount is the sum of:\n{1}- Your security deposit: {2}\n- Trading fee: {3}\n- Mining fee: {4}\n\nYou can choose between two options when funding your trade:\n- Use your Bisq wallet (convenient, but transactions may be linkable) OR\n- Transfer from an external wallet (potentially more private)\n\nYou will see all funding options and details after closing this popup.

# only first part "An error occurred when placing the offer:" has been used before. We added now the rest (need update in existing translations!)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,9 @@ private void onShowPayFundsScreen() {
String key = "createOfferFundWalletInfo";
String tradeAmountText = model.isSellOffer() ?
Res.get("createOffer.createOfferFundWalletInfo.tradeAmount", model.getTradeAmount()) : "";

String message = Res.get("createOffer.createOfferFundWalletInfo.msg",
model.totalToPay.get(),
model.getTotalToPayInfo(),
tradeAmountText,
model.getSecurityDepositInfo(),
model.getTradeFee(),
Expand All @@ -427,8 +428,7 @@ private void onShowPayFundsScreen() {
.show();
}

totalToPayTextField.setFundsStructure(Res.get("createOffer.fundsBox.fundsStructure",
model.getSecurityDepositWithCode(), model.getMakerFeePercentage(), model.getTxFeePercentage()));
totalToPayTextField.setFundsStructure(model.getFundsStructure());
totalToPayTextField.setContentForInfoPopOver(createInfoPopover());
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -948,6 +948,18 @@ public String getTotalToPayInfo() {
return totalToPay + " + " + bsqFormatter.formatCoinWithCode(dataModel.getMakerFee());
}

public String getFundsStructure() {
String fundsStructure;
if (dataModel.isCurrencyForMakerFeeBtc()) {
fundsStructure = Res.get("createOffer.fundsBox.fundsStructure",
getSecurityDepositWithCode(), getMakerFeePercentage(), getTxFeePercentage());
} else {
fundsStructure = Res.get("createOffer.fundsBox.fundsStructure.BSQ",
getSecurityDepositWithCode(), getTxFeePercentage(), bsqFormatter.formatCoinWithCode(dataModel.getMakerFee()));
}
return fundsStructure;
}

public String getTxFee() {
Coin txFeeAsCoin = dataModel.getTxFee();
return btcFormatter.formatCoinWithCode(txFeeAsCoin) +
Expand Down

0 comments on commit f43032d

Please sign in to comment.