Skip to content

Commit cbbbf51

Browse files
committed
support Dogecoin (DOGE)
1 parent 1430862 commit cbbbf51

File tree

6 files changed

+85
-0
lines changed

6 files changed

+85
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* This file is part of Bisq.
3+
*
4+
* Bisq is free software: you can redistribute it and/or modify it
5+
* under the terms of the GNU Affero General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or (at
7+
* your option) any later version.
8+
*
9+
* Bisq is distributed in the hope that it will be useful, but WITHOUT
10+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
12+
* License for more details.
13+
*
14+
* You should have received a copy of the GNU Affero General Public License
15+
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
package haveno.asset.coins;
19+
20+
import haveno.asset.Base58AddressValidator;
21+
import haveno.asset.Coin;
22+
import haveno.asset.NetworkParametersAdapter;
23+
24+
public class Dogecoin extends Coin {
25+
26+
public Dogecoin() {
27+
super("Dogecoin", "DOGE", new Base58AddressValidator(new DogecoinMainNetParams()), Network.MAINNET);
28+
}
29+
30+
public static class DogecoinMainNetParams extends NetworkParametersAdapter {
31+
public DogecoinMainNetParams() {
32+
this.addressHeader = 30;
33+
this.p2shHeader = 22;
34+
}
35+
}
36+
}

assets/src/main/resources/META-INF/services/haveno.asset.Asset

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
haveno.asset.coins.Bitcoin$Mainnet
66
haveno.asset.coins.BitcoinCash
77
haveno.asset.coins.Cardano
8+
haveno.asset.coins.Dogecoin
89
haveno.asset.coins.Ether
910
haveno.asset.coins.Litecoin
1011
haveno.asset.coins.Monero
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* This file is part of Bisq.
3+
*
4+
* Bisq is free software: you can redistribute it and/or modify it
5+
* under the terms of the GNU Affero General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or (at
7+
* your option) any later version.
8+
*
9+
* Bisq is distributed in the hope that it will be useful, but WITHOUT
10+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
12+
* License for more details.
13+
*
14+
* You should have received a copy of the GNU Affero General Public License
15+
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
package haveno.asset.coins;
19+
20+
import haveno.asset.AbstractAssetTest;
21+
22+
import org.junit.jupiter.api.Test;
23+
24+
public class DogecoinTest extends AbstractAssetTest {
25+
26+
public DogecoinTest() {
27+
super(new Dogecoin());
28+
}
29+
30+
@Test
31+
public void testValidAddresses() {
32+
assertValidAddress("DEa7damK8MsbdCJztidBasZKVsDLJifWfE");
33+
assertValidAddress("DNkkfdUvkCDiywYE98MTVp9nQJTgeZAiFr");
34+
assertValidAddress("DDWUYQ3GfMDj8hkx8cbnAMYkTzzAunAQxg");
35+
}
36+
37+
@Test
38+
public void testInvalidAddresses() {
39+
assertInvalidAddress("1DDWUYQ3GfMDj8hkx8cbnAMYkTzzAunAQxg");
40+
assertInvalidAddress("DDWUYQ3GfMDj8hkx8cbnAMYkTzzAunAQxgs");
41+
assertInvalidAddress("DDWUYQ3GfMDj8hkx8cbnAMYkTzzAunAQxg#");
42+
}
43+
}

core/src/main/java/haveno/core/locale/CurrencyUtil.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ public static List<CryptoCurrency> getMainCryptoCurrencies() {
198198
final List<CryptoCurrency> result = new ArrayList<>();
199199
result.add(new CryptoCurrency("BTC", "Bitcoin"));
200200
result.add(new CryptoCurrency("BCH", "Bitcoin Cash"));
201+
result.add(new CryptoCurrency("DOGE", "Dogecoin"));
201202
result.add(new CryptoCurrency("ETH", "Ether"));
202203
result.add(new CryptoCurrency("LTC", "Litecoin"));
203204
result.add(new CryptoCurrency("XRP", "Ripple"));

desktop/src/main/java/haveno/desktop/images.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,10 @@
369369
-fx-image: url("../../images/trx_logo.png");
370370
}
371371

372+
#image-doge-logo {
373+
-fx-image: url("../../images/doge_logo.png");
374+
}
375+
372376
#image-dark-mode-toggle {
373377
-fx-image: url("../../images/dark_mode_toggle.png");
374378
}
40.3 KB
Loading

0 commit comments

Comments
 (0)