use of bisq.core.locale.TradeCurrency in project bisq-desktop by bisq-network.
the class CryptoCurrencyForm method addFormForDisplayAccount.
@Override
public void addFormForDisplayAccount() {
gridRowFrom = gridRow;
addLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), cryptoCurrencyAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
addLabelTextField(gridPane, ++gridRow, Res.getWithCol("shared.paymentMethod"), Res.get(cryptoCurrencyAccount.getPaymentMethod().getId()));
Tuple2<Label, TextField> tuple2 = addLabelTextField(gridPane, ++gridRow, Res.get("payment.altcoin.address"), cryptoCurrencyAccount.getAddress());
addressLabel = tuple2.first;
TextField field = tuple2.second;
field.setMouseTransparent(false);
final TradeCurrency singleTradeCurrency = cryptoCurrencyAccount.getSingleTradeCurrency();
final String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "";
addLabelTextField(gridPane, ++gridRow, Res.get("payment.altcoin"), nameAndCode);
addLimitations();
}
use of bisq.core.locale.TradeCurrency in project bisq-desktop by bisq-network.
the class FasterPaymentsForm method addFormForDisplayAccount.
@Override
public void addFormForDisplayAccount() {
gridRowFrom = gridRow;
addLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), fasterPaymentsAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
addLabelTextField(gridPane, ++gridRow, Res.getWithCol("shared.paymentMethod"), Res.get(fasterPaymentsAccount.getPaymentMethod().getId()));
// do not translate as it is used in english only
addLabelTextField(gridPane, ++gridRow, "UK sort code:", fasterPaymentsAccount.getSortCode());
TextField field = addLabelTextField(gridPane, ++gridRow, Res.get("payment.accountNr"), fasterPaymentsAccount.getAccountNr()).second;
field.setMouseTransparent(false);
TradeCurrency singleTradeCurrency = fasterPaymentsAccount.getSingleTradeCurrency();
String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "";
addLabelTextField(gridPane, ++gridRow, Res.getWithCol("shared.currency"), nameAndCode);
addLimitations();
}
use of bisq.core.locale.TradeCurrency in project bisq-desktop by bisq-network.
the class InteracETransferForm method addFormForDisplayAccount.
@Override
public void addFormForDisplayAccount() {
gridRowFrom = gridRow;
FormBuilder.addLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), interacETransferAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.getWithCol("shared.paymentMethod"), Res.get(interacETransferAccount.getPaymentMethod().getId()));
FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.getWithCol("payment.account.owner"), interacETransferAccount.getHolderName());
FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.get("payment.email"), interacETransferAccount.getEmail()).second.setMouseTransparent(false);
FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.get("payment.secret"), interacETransferAccount.getQuestion()).second.setMouseTransparent(false);
FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.get("payment.answer"), interacETransferAccount.getAnswer()).second.setMouseTransparent(false);
TradeCurrency singleTradeCurrency = interacETransferAccount.getSingleTradeCurrency();
String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null";
FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.getWithCol("shared.currency"), nameAndCode);
addLimitations();
}
use of bisq.core.locale.TradeCurrency in project bisq-desktop by bisq-network.
the class PaymentMethodForm method addLimitations.
protected void addLimitations() {
long hours = paymentAccount.getPaymentMethod().getMaxTradePeriod() / 3600_000;
final TradeCurrency tradeCurrency;
if (paymentAccount.getSingleTradeCurrency() != null)
tradeCurrency = paymentAccount.getSingleTradeCurrency();
else if (paymentAccount.getSelectedTradeCurrency() != null)
tradeCurrency = paymentAccount.getSelectedTradeCurrency();
else if (!paymentAccount.getTradeCurrencies().isEmpty())
tradeCurrency = paymentAccount.getTradeCurrencies().get(0);
else
tradeCurrency = paymentAccount instanceof CryptoCurrencyAccount ? CurrencyUtil.getAllSortedCryptoCurrencies().get(0) : CurrencyUtil.getDefaultTradeCurrency();
final boolean isAddAccountScreen = paymentAccount.getAccountName() == null;
final long accountAge = !isAddAccountScreen ? accountAgeWitnessService.getMyAccountAge(paymentAccount.getPaymentAccountPayload()) : 0L;
addLabelTextField(gridPane, ++gridRow, Res.get("payment.limitations"), Res.get("payment.maxPeriodAndLimit", getTimeText(hours), formatter.formatCoinWithCode(Coin.valueOf(accountAgeWitnessService.getMyTradeLimit(paymentAccount, tradeCurrency.getCode()))), formatter.formatAccountAge(accountAge)));
if (isAddAccountScreen) {
InputTextField inputTextField = addLabelInputTextField(gridPane, ++gridRow, Res.get("payment.salt"), 0).second;
inputTextField.setText(Utilities.bytesAsHexString(paymentAccount.getPaymentAccountPayload().getSalt()));
inputTextField.textProperty().addListener((observable, oldValue, newValue) -> {
if (!newValue.isEmpty()) {
try {
// test if input is hex
Utilities.decodeFromHex(newValue);
paymentAccount.setSaltAsHex(newValue);
} catch (Throwable t) {
new Popup().warning(Res.get("payment.error.noHexSalt")).show();
inputTextField.setText(Utilities.bytesAsHexString(paymentAccount.getPaymentAccountPayload().getSalt()));
log.warn(t.toString());
}
}
});
} else {
addLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.salt", Utilities.bytesAsHexString(paymentAccount.getPaymentAccountPayload().getSalt())), Utilities.bytesAsHexString(paymentAccount.getPaymentAccountPayload().getSalt()));
}
}
use of bisq.core.locale.TradeCurrency in project bisq-desktop by bisq-network.
the class PerfectMoneyForm method addFormForDisplayAccount.
@Override
public void addFormForDisplayAccount() {
gridRowFrom = gridRow;
addLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), perfectMoneyAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
addLabelTextField(gridPane, ++gridRow, Res.getWithCol("shared.paymentMethod"), Res.get(perfectMoneyAccount.getPaymentMethod().getId()));
TextField field = addLabelTextField(gridPane, ++gridRow, Res.get("payment.account.no"), perfectMoneyAccount.getAccountNr()).second;
field.setMouseTransparent(false);
final TradeCurrency singleTradeCurrency = perfectMoneyAccount.getSingleTradeCurrency();
final String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "";
addLabelTextField(gridPane, ++gridRow, Res.getWithCol("shared.currency"), nameAndCode);
addLimitations();
}
Aggregations