diff --git a/assets/src/main/java/bisq/asset/coins/Pinkcoin.java b/assets/src/main/java/bisq/asset/coins/Pinkcoin.java new file mode 100644 index 00000000000..b27bece164a --- /dev/null +++ b/assets/src/main/java/bisq/asset/coins/Pinkcoin.java @@ -0,0 +1,39 @@ +/* + * 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 . + */ + +package bisq.asset.coins; + +import bisq.asset.Base58BitcoinAddressValidator; +import bisq.asset.Coin; +import bisq.asset.NetworkParametersAdapter; + +public class Pinkcoin extends Coin { + + public Pinkcoin() { + super("Pinkcoin", "PINK", new Base58BitcoinAddressValidator(new PinkcoinParams())); + } + + + public static class PinkcoinParams extends NetworkParametersAdapter { + + public PinkcoinParams() { + addressHeader = 3; + p2shHeader = 28; + acceptableAddressCodes = new int[]{addressHeader, p2shHeader}; + } + } +} diff --git a/assets/src/main/resources/META-INF/services/bisq.asset.Asset b/assets/src/main/resources/META-INF/services/bisq.asset.Asset index 49af60cb4d3..b403c4aad48 100644 --- a/assets/src/main/resources/META-INF/services/bisq.asset.Asset +++ b/assets/src/main/resources/META-INF/services/bisq.asset.Asset @@ -37,6 +37,7 @@ bisq.asset.coins.MonetaryUnit bisq.asset.coins.MoX bisq.asset.coins.Namecoin bisq.asset.coins.Neos +bisq.asset.coins.Pinkcoin bisq.asset.coins.PIVX bisq.asset.coins.PZDC bisq.asset.coins.QMCoin diff --git a/assets/src/test/java/bisq/asset/coins/PinkcoinTest.java b/assets/src/test/java/bisq/asset/coins/PinkcoinTest.java new file mode 100644 index 00000000000..3d6ec9be670 --- /dev/null +++ b/assets/src/test/java/bisq/asset/coins/PinkcoinTest.java @@ -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 . + */ + +package bisq.asset.coins; + +import bisq.asset.AbstractAssetTest; + +import org.junit.Test; + +public class PinkcoinTest extends AbstractAssetTest { + + public PinkcoinTest() { + super(new Pinkcoin()); + } + + @Test + public void testValidAddresses() { + assertValidAddress("2KZEgvipDn5EkDAFB8UR8nVXuKuKt8rmgH"); + assertValidAddress("2KVgwafcbw9LcJngqAzxu8UKpQSRwNhtTH"); + assertValidAddress("2TPDcXRRmvTxJQ4V8xNhP1KmrTmH9KKCkg"); + } + + @Test + public void testInvalidAddresses() { + assertInvalidAddress("PPo1gCi4xoC87gZZsnU2Uj6vSgZAAD9com"); + assertInvalidAddress("z4Vg3S5pJEJY45tHX7u6X1r9tv2DEvCShi2"); + assertInvalidAddress("1dQT9U73rNmomYkkxQwcNYhfQr9yy4Ani"); + } +}