mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-09-24 06:54:46 -04:00
support Dogecoin (DOGE)
This commit is contained in:
parent
878cbb86ce
commit
7bf9475585
6 changed files with 85 additions and 0 deletions
36
assets/src/main/java/haveno/asset/coins/Dogecoin.java
Normal file
36
assets/src/main/java/haveno/asset/coins/Dogecoin.java
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* This file is part of Bisq.
|
||||
*
|
||||
* Bisq 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.
|
||||
*
|
||||
* Bisq 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 Bisq. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package haveno.asset.coins;
|
||||
|
||||
import haveno.asset.Base58AddressValidator;
|
||||
import haveno.asset.Coin;
|
||||
import haveno.asset.NetworkParametersAdapter;
|
||||
|
||||
public class Dogecoin extends Coin {
|
||||
|
||||
public Dogecoin() {
|
||||
super("Dogecoin", "DOGE", new Base58AddressValidator(new DogecoinMainNetParams()), Network.MAINNET);
|
||||
}
|
||||
|
||||
public static class DogecoinMainNetParams extends NetworkParametersAdapter {
|
||||
public DogecoinMainNetParams() {
|
||||
this.addressHeader = 30;
|
||||
this.p2shHeader = 22;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -5,6 +5,7 @@
|
|||
haveno.asset.coins.Bitcoin$Mainnet
|
||||
haveno.asset.coins.BitcoinCash
|
||||
haveno.asset.coins.Cardano
|
||||
haveno.asset.coins.Dogecoin
|
||||
haveno.asset.coins.Ether
|
||||
haveno.asset.coins.Litecoin
|
||||
haveno.asset.coins.Monero
|
||||
|
|
43
assets/src/test/java/haveno/asset/coins/DogecoinTest.java
Normal file
43
assets/src/test/java/haveno/asset/coins/DogecoinTest.java
Normal file
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* This file is part of Bisq.
|
||||
*
|
||||
* Bisq 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.
|
||||
*
|
||||
* Bisq 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 Bisq. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package haveno.asset.coins;
|
||||
|
||||
import haveno.asset.AbstractAssetTest;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
public class DogecoinTest extends AbstractAssetTest {
|
||||
|
||||
public DogecoinTest() {
|
||||
super(new Dogecoin());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testValidAddresses() {
|
||||
assertValidAddress("DEa7damK8MsbdCJztidBasZKVsDLJifWfE");
|
||||
assertValidAddress("DNkkfdUvkCDiywYE98MTVp9nQJTgeZAiFr");
|
||||
assertValidAddress("DDWUYQ3GfMDj8hkx8cbnAMYkTzzAunAQxg");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInvalidAddresses() {
|
||||
assertInvalidAddress("1DDWUYQ3GfMDj8hkx8cbnAMYkTzzAunAQxg");
|
||||
assertInvalidAddress("DDWUYQ3GfMDj8hkx8cbnAMYkTzzAunAQxgs");
|
||||
assertInvalidAddress("DDWUYQ3GfMDj8hkx8cbnAMYkTzzAunAQxg#");
|
||||
}
|
||||
}
|
|
@ -198,6 +198,7 @@ public class CurrencyUtil {
|
|||
final List<CryptoCurrency> result = new ArrayList<>();
|
||||
result.add(new CryptoCurrency("BTC", "Bitcoin"));
|
||||
result.add(new CryptoCurrency("BCH", "Bitcoin Cash"));
|
||||
result.add(new CryptoCurrency("DOGE", "Dogecoin"));
|
||||
result.add(new CryptoCurrency("ETH", "Ether"));
|
||||
result.add(new CryptoCurrency("LTC", "Litecoin"));
|
||||
result.add(new CryptoCurrency("XRP", "Ripple"));
|
||||
|
|
|
@ -369,6 +369,10 @@
|
|||
-fx-image: url("../../images/trx_logo.png");
|
||||
}
|
||||
|
||||
#image-doge-logo {
|
||||
-fx-image: url("../../images/doge_logo.png");
|
||||
}
|
||||
|
||||
#image-dark-mode-toggle {
|
||||
-fx-image: url("../../images/dark_mode_toggle.png");
|
||||
}
|
||||
|
|
BIN
desktop/src/main/resources/images/doge_logo.png
Normal file
BIN
desktop/src/main/resources/images/doge_logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 40 KiB |
Loading…
Add table
Add a link
Reference in a new issue