mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-12-17 08:44:10 -05:00
Add check for DAO (presale date)
This commit is contained in:
parent
30c568af8b
commit
7b2f90cfd6
3 changed files with 22 additions and 15 deletions
|
|
@ -73,11 +73,7 @@ public class CurrencyUtil {
|
||||||
public static List<CryptoCurrency> createAllSortedCryptoCurrenciesList() {
|
public static List<CryptoCurrency> createAllSortedCryptoCurrenciesList() {
|
||||||
final List<CryptoCurrency> result = new ArrayList<>();
|
final List<CryptoCurrency> result = new ArrayList<>();
|
||||||
result.add(new CryptoCurrency("ETH", "Ether"));
|
result.add(new CryptoCurrency("ETH", "Ether"));
|
||||||
|
result.add(new CryptoCurrency("DAO", "DAO"));
|
||||||
// TODO DAO will be open for sale on 28.5. Check can be removed at next release.
|
|
||||||
if (new GregorianCalendar().after(new GregorianCalendar(2016, Calendar.MAY, 28)))
|
|
||||||
result.add(new CryptoCurrency("DAO", "DAO"));
|
|
||||||
|
|
||||||
result.add(new CryptoCurrency("LTC", "Litecoin"));
|
result.add(new CryptoCurrency("LTC", "Litecoin"));
|
||||||
result.add(new CryptoCurrency("NMC", "Namecoin"));
|
result.add(new CryptoCurrency("NMC", "Namecoin"));
|
||||||
result.add(new CryptoCurrency("DASH", "Dash"));
|
result.add(new CryptoCurrency("DASH", "Dash"));
|
||||||
|
|
@ -127,10 +123,6 @@ public class CurrencyUtil {
|
||||||
result.add(new CryptoCurrency("ERC", "Europecoin"));
|
result.add(new CryptoCurrency("ERC", "Europecoin"));
|
||||||
result.add(new CryptoCurrency("POST", "PostCoin"));
|
result.add(new CryptoCurrency("POST", "PostCoin"));
|
||||||
|
|
||||||
// For MKR we need a extra info box:
|
|
||||||
// It's very important that users only use EIP-20 compliant contract wallets.
|
|
||||||
// Modern mist wallets should be able to do it but there are some older mist versions that can't.
|
|
||||||
|
|
||||||
// result.add(new CryptoCurrency("XMR", "Monero"));
|
// result.add(new CryptoCurrency("XMR", "Monero"));
|
||||||
// result.add(new CryptoCurrency("BCN", "Bytecoin"));
|
// result.add(new CryptoCurrency("BCN", "Bytecoin"));
|
||||||
return result;
|
return result;
|
||||||
|
|
@ -139,11 +131,7 @@ public class CurrencyUtil {
|
||||||
public static List<CryptoCurrency> getMainCryptoCurrencies() {
|
public static List<CryptoCurrency> getMainCryptoCurrencies() {
|
||||||
final List<CryptoCurrency> result = new ArrayList<>();
|
final List<CryptoCurrency> result = new ArrayList<>();
|
||||||
result.add(new CryptoCurrency("ETH", "Ether"));
|
result.add(new CryptoCurrency("ETH", "Ether"));
|
||||||
|
result.add(new CryptoCurrency("DAO", "DAO"));
|
||||||
// TODO DAO will be open for sale on 28.5. Check can be removed at next release.
|
|
||||||
if (new GregorianCalendar().after(new GregorianCalendar(2016, Calendar.MAY, 28)))
|
|
||||||
result.add(new CryptoCurrency("DAO", "DAO"));
|
|
||||||
|
|
||||||
result.add(new CryptoCurrency("LTC", "Litecoin"));
|
result.add(new CryptoCurrency("LTC", "Litecoin"));
|
||||||
result.add(new CryptoCurrency("DASH", "Dash"));
|
result.add(new CryptoCurrency("DASH", "Dash"));
|
||||||
result.add(new CryptoCurrency("SDC", "ShadowCash"));
|
result.add(new CryptoCurrency("SDC", "ShadowCash"));
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ package io.bitsquare.gui.components.paymentmethods;
|
||||||
|
|
||||||
import io.bitsquare.common.util.Tuple2;
|
import io.bitsquare.common.util.Tuple2;
|
||||||
import io.bitsquare.gui.components.InputTextField;
|
import io.bitsquare.gui.components.InputTextField;
|
||||||
|
import io.bitsquare.gui.main.overlays.popups.Popup;
|
||||||
import io.bitsquare.gui.util.BSFormatter;
|
import io.bitsquare.gui.util.BSFormatter;
|
||||||
import io.bitsquare.gui.util.Layout;
|
import io.bitsquare.gui.util.Layout;
|
||||||
import io.bitsquare.gui.util.validation.AltCoinAddressValidator;
|
import io.bitsquare.gui.util.validation.AltCoinAddressValidator;
|
||||||
|
|
@ -40,6 +41,8 @@ import org.apache.commons.lang3.StringUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
import static io.bitsquare.gui.util.FormBuilder.*;
|
import static io.bitsquare.gui.util.FormBuilder.*;
|
||||||
|
|
@ -151,7 +154,22 @@ public class CryptoCurrencyForm extends PaymentMethodForm {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
currencyComboBox.setOnAction(e -> {
|
currencyComboBox.setOnAction(e -> {
|
||||||
paymentAccount.setSingleTradeCurrency(currencyComboBox.getSelectionModel().getSelectedItem());
|
TradeCurrency selectedItem = currencyComboBox.getSelectionModel().getSelectedItem();
|
||||||
|
if (selectedItem != null) {
|
||||||
|
String code = selectedItem.getCode();
|
||||||
|
// TODO DAO will be open for sale on 28.5. Check can be removed at next release.
|
||||||
|
if (code.equals("DAO") && new GregorianCalendar().before(new GregorianCalendar(2016, Calendar.MAY, 28))) {
|
||||||
|
new Popup().information("The DAO tokens are not tradable before the pre-sale is over (28th of May).\n" +
|
||||||
|
"From the 28th of May on you can setup a DAO account and trade DAO tokens in Bitsquare.")
|
||||||
|
.closeButtonText("I understand")
|
||||||
|
.onClose(() -> currencyComboBox.getSelectionModel().clearSelection())
|
||||||
|
.show();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
paymentAccount.setSingleTradeCurrency(selectedItem);
|
||||||
updateFromInputs();
|
updateFromInputs();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -136,6 +136,7 @@ public class AltCoinAccountsView extends ActivatableViewAndModel<GridPane, AltCo
|
||||||
.closeButtonText("I understand and confirm that I know which wallet I need to use.")
|
.closeButtonText("I understand and confirm that I know which wallet I need to use.")
|
||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!model.getPaymentAccounts().stream().filter(e -> {
|
if (!model.getPaymentAccounts().stream().filter(e -> {
|
||||||
if (e.getAccountName() != null)
|
if (e.getAccountName() != null)
|
||||||
return e.getAccountName().equals(paymentAccount.getAccountName());
|
return e.getAccountName().equals(paymentAccount.getAccountName());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue