diff --git a/README.md b/README.md index 3e88b5468a..551dcb0843 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ ## What is Haveno? -Haveno (pronounced ha‧ve‧no) is a platform for people who want to exchange [Monero](https://getmonero.org) for fiat currencies like EUR, GBP, and USD or other cryptocurrencies like BTC, ETH, and BCH. +Haveno (pronounced ha‧ve‧no) is a platform for people who want to exchange [Monero](https://getmonero.org) for fiat currencies like EUR, GBP, and USD or other cryptocurrencies like BTC, ETH, BCH, and WOW. Main features: diff --git a/assets/src/main/java/haveno/asset/coins/Wownero.java b/assets/src/main/java/haveno/asset/coins/Wownero.java new file mode 100644 index 0000000000..fde24c6da6 --- /dev/null +++ b/assets/src/main/java/haveno/asset/coins/Wownero.java @@ -0,0 +1,28 @@ +/* + * This file is part of Haveno. + * + * Haveno is free software: you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or (at + * your option) any later version. + * + * Haveno is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public + * License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Haveno. If not, see . + */ + +package haveno.asset.coins; + +import haveno.asset.Coin; +import haveno.asset.CryptoNoteAddressValidator; + +public class Wownero extends Coin { + + public Wownero() { + super("Wownero", "WOW", new CryptoNoteAddressValidator(12208)); + } +} diff --git a/assets/src/main/resources/META-INF/services/haveno.asset.Asset b/assets/src/main/resources/META-INF/services/haveno.asset.Asset index 7108c28830..ad71f5a711 100644 --- a/assets/src/main/resources/META-INF/services/haveno.asset.Asset +++ b/assets/src/main/resources/META-INF/services/haveno.asset.Asset @@ -7,3 +7,4 @@ haveno.asset.coins.BitcoinCash haveno.asset.coins.Ether haveno.asset.coins.Litecoin haveno.asset.coins.Monero +haveno.asset.coins.Wownero diff --git a/assets/src/test/java/haveno/asset/coins/WowneroTest.java b/assets/src/test/java/haveno/asset/coins/WowneroTest.java new file mode 100644 index 0000000000..2cf33b1e56 --- /dev/null +++ b/assets/src/test/java/haveno/asset/coins/WowneroTest.java @@ -0,0 +1,44 @@ +/* + * This file is part of Haveno. + * + * Haveno is free software: you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or (at + * your option) any later version. + * + * Haveno is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public + * License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Haveno. If not, see . + */ + +package haveno.asset.coins; + +import haveno.asset.AbstractAssetTest; +import org.junit.jupiter.api.Test; + +public class WowneroTest extends AbstractAssetTest { + + public WowneroTest() { + super(new Wownero()); + } + + @Test + public void testValidAddresses() { + assertValidAddress("WW3euBj4AfuYSVs1T2zDGHiHQbmL9r78JUfrTTuwHkWDSXEoX31Q8viHQaPgk6f9w271YH67UBCfxAZkBccfX6t11VVXSFfdk"); + assertValidAddress("WW3CRUnpWnAQmXyr8rgd5qVneg3tTKbRrZu2qbTzjwMNEtvddodV2inPbRSGjcdRyHKVNsNkwWccjN6iKu1FAGr32hqKzikQP"); + assertValidAddress("WW4NzZ6EXLmeBBAjzPJ1J6jkkmqDsZzrp9TGxtP6E8pTMGtXS3yq8VJF3Rv2cbhkVig4cLEqWZnQpgwxjX5isrWT2FxmeWtWy"); + } + + @Test + public void testInvalidAddresses() { + assertInvalidAddress(""); + assertInvalidAddress("Wo3MWeKwtA918DU4c69hVSNgejdWFCRCuWjShRY66mJkU2Hv58eygJWDJS1MNa2Ge5M1WjUkGHuLqHkweDxwZZU42d16v94mP"); + assertInvalidAddress("693MWeKwtA918DU4c69hVSNgejdWFCRCuWjShRY66mJkU2Hv58eygJWDJS1MNa2Ge5M1WjUkGHuLqHkweDxwZZU42d16v94mP"); + assertInvalidAddress("o3MWeKwtA918DU4c69hVSNgejdWFCRCuWjShRY66mJkU2Hv58eygJWDJS1MNa2Ge5M1WjUkGHuLqHkweDxwZZU42d16v94mP"); + assertInvalidAddress("3MWeKwtA918DU4c69hVSNgejdWFCRCuWjShRY66mJkU2Hv58eygJWDJS1MNa2Ge5M1WjUkGHuLqHkweDxwZZU42d16v94mP"); + } +} diff --git a/core/src/main/java/haveno/core/locale/CurrencyUtil.java b/core/src/main/java/haveno/core/locale/CurrencyUtil.java index 7a0925ebe2..870a17c8c7 100644 --- a/core/src/main/java/haveno/core/locale/CurrencyUtil.java +++ b/core/src/main/java/haveno/core/locale/CurrencyUtil.java @@ -183,6 +183,7 @@ public class CurrencyUtil { result.add(new CryptoCurrency("BCH", "Bitcoin Cash")); result.add(new CryptoCurrency("ETH", "Ether")); result.add(new CryptoCurrency("LTC", "Litecoin")); + result.add(new CryptoCurrency("WOW", "Wownero")); result.sort(TradeCurrency::compareTo); return result; }