use of io.bitsquare.locale.CryptoCurrency in project bitsquare by bitsquare.
the class AltCoinAccountsView method onSaveNewAccount.
///////////////////////////////////////////////////////////////////////////////////////////
// UI actions
///////////////////////////////////////////////////////////////////////////////////////////
private void onSaveNewAccount(PaymentAccount paymentAccount) {
TradeCurrency selectedTradeCurrency = paymentAccount.getSelectedTradeCurrency();
String code = selectedTradeCurrency.getCode();
if (selectedTradeCurrency instanceof CryptoCurrency && ((CryptoCurrency) selectedTradeCurrency).isAsset()) {
new Popup().information("Please be sure that you follow the requirements for the usage of " + selectedTradeCurrency.getCodeAndName() + " wallets as described on the " + selectedTradeCurrency.getName() + " web page.\n" + "Using wallets from centralized exchanges where you don't have your keys under your control or " + "using a not compatible wallet software can lead to loss of the traded funds!\n" + "The arbitrator is not a " + selectedTradeCurrency.getName() + " specialist and cannot help in such cases.").closeButtonText("I understand and confirm that I know which wallet I need to use.").show();
}
if (code.equals("XMR")) {
new Popup().information("If you want to trade XMR on Bitsquare please be sure you understand and fulfill " + "the following requirements:\n\n" + "For sending XMR you need to use the Monero simple wallet with the " + "store-tx-info flag enabled (default in new versions).\n" + "Please be sure that you can access the tx key (use the get_tx_key command in simplewallet) as that " + "would be required in case of a dispute to enable the arbitrator to verify the XMR transfer with " + "the XMR checktx tool (http://xmr.llcoins.net/checktx.html).\n" + "At normal block explorers the transfer is not verifiable.\n\n" + "You need to provide the arbitrator the following data in case of a dispute:\n" + "- The tx private key\n" + "- The transaction hash\n" + "- The recipient's public address\n\n" + "If you cannot provide the above data or if you used an incompatible wallet it would result in losing the " + "dispute case. The XMR sender is responsible to be able to verify the XMR transfer to the " + "arbitrator in case of a dispute.\n\n" + "There is no payment ID required, just the normal public address.\n\n" + "If you are not sure about that process visit the Monero forum (https://forum.getmonero.org) to find more information.").closeButtonText("I understand").show();
} else if (code.equals("ZEC")) {
new Popup().information("When using ZEC you can only use the transparent addresses (starting with t) not " + "the z-addresses, because the arbitrator would not be able to verify the transaction with z-addresses.").closeButtonText("I understand").show();
} else if (code.equals("XZC")) {
new Popup().information("When using XZC you can only use the transparent transactions not " + "the private transactions, because the arbitrator would not be able to verify the private transactions.").closeButtonText("I understand").show();
}
if (!model.getPaymentAccounts().stream().filter(e -> {
if (e.getAccountName() != null)
return e.getAccountName().equals(paymentAccount.getAccountName());
else
return false;
}).findAny().isPresent()) {
model.onSaveNewAccount(paymentAccount);
removeNewAccountForm();
} else {
new Popup().warning("That account name is already used in a saved account.\n" + "Please use another name.").show();
}
}
use of io.bitsquare.locale.CryptoCurrency in project bitsquare by bitsquare.
the class FiatAccountsDataModel method onSaveNewAccount.
///////////////////////////////////////////////////////////////////////////////////////////
// UI actions
///////////////////////////////////////////////////////////////////////////////////////////
public void onSaveNewAccount(PaymentAccount paymentAccount) {
user.addPaymentAccount(paymentAccount);
TradeCurrency singleTradeCurrency = paymentAccount.getSingleTradeCurrency();
List<TradeCurrency> tradeCurrencies = paymentAccount.getTradeCurrencies();
if (singleTradeCurrency != null) {
if (singleTradeCurrency instanceof FiatCurrency)
preferences.addFiatCurrency((FiatCurrency) singleTradeCurrency);
else
preferences.addCryptoCurrency((CryptoCurrency) singleTradeCurrency);
} else if (tradeCurrencies != null && !tradeCurrencies.isEmpty()) {
tradeCurrencies.stream().forEach(tradeCurrency -> {
if (tradeCurrency instanceof FiatCurrency)
preferences.addFiatCurrency((FiatCurrency) tradeCurrency);
else
preferences.addCryptoCurrency((CryptoCurrency) tradeCurrency);
});
}
}
use of io.bitsquare.locale.CryptoCurrency in project bitsquare by bitsquare.
the class AltCoinAccountsDataModel method onSaveNewAccount.
///////////////////////////////////////////////////////////////////////////////////////////
// UI actions
///////////////////////////////////////////////////////////////////////////////////////////
public void onSaveNewAccount(PaymentAccount paymentAccount) {
user.addPaymentAccount(paymentAccount);
TradeCurrency singleTradeCurrency = paymentAccount.getSingleTradeCurrency();
List<TradeCurrency> tradeCurrencies = paymentAccount.getTradeCurrencies();
if (singleTradeCurrency != null) {
if (singleTradeCurrency instanceof FiatCurrency)
preferences.addFiatCurrency((FiatCurrency) singleTradeCurrency);
else
preferences.addCryptoCurrency((CryptoCurrency) singleTradeCurrency);
} else if (tradeCurrencies != null && !tradeCurrencies.isEmpty()) {
tradeCurrencies.stream().forEach(tradeCurrency -> {
if (tradeCurrency instanceof FiatCurrency)
preferences.addFiatCurrency((FiatCurrency) tradeCurrency);
else
preferences.addCryptoCurrency((CryptoCurrency) tradeCurrency);
});
}
}
use of io.bitsquare.locale.CryptoCurrency in project bitsquare by bitsquare.
the class OfferBookViewModelTest method getCryptoAccount.
private PaymentAccount getCryptoAccount(String currencyCode) {
PaymentAccount paymentAccount = new CryptoCurrencyAccount();
paymentAccount.addCurrency(new CryptoCurrency(currencyCode, null));
return paymentAccount;
}
Aggregations