diff --git a/assets/src/main/java/bisq/asset/coins/Traid.java b/assets/src/main/java/bisq/asset/coins/Traid.java new file mode 100644 index 00000000000..0f4ed030509 --- /dev/null +++ b/assets/src/main/java/bisq/asset/coins/Traid.java @@ -0,0 +1,28 @@ +/* + * 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.Coin; +import bisq.asset.RegexAddressValidator; + +public class Traid extends Coin { + + public Traid() { + super("Traid", "TRAID", new RegexAddressValidator("^[T][a-zA-Z0-9]{33}$")); + } +} \ No newline at end of file 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..7ede6560433 100644 --- a/assets/src/main/resources/META-INF/services/bisq.asset.Asset +++ b/assets/src/main/resources/META-INF/services/bisq.asset.Asset @@ -46,6 +46,7 @@ bisq.asset.coins.Siafund bisq.asset.coins.Spectrecoin bisq.asset.coins.Starwels bisq.asset.coins.SUB1X +bisq.asset.coins.Traid bisq.asset.coins.TurtleCoin bisq.asset.coins.Unobtanium bisq.asset.coins.Zcash diff --git a/assets/src/test/java/bisq/asset/coins/TraidTest.java b/assets/src/test/java/bisq/asset/coins/TraidTest.java new file mode 100644 index 00000000000..b9857aac880 --- /dev/null +++ b/assets/src/test/java/bisq/asset/coins/TraidTest.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 TraidTest extends AbstractAssetTest { + + public TraidTest() { + super(new Traid()); + } + + @Test + public void testValidAddresses() { + assertValidAddress("TfvddKQHdd975N5XQgmpVGTuK9mumvDBQo"); + assertValidAddress("Tby9wLm2K4iJddiVBoNUYKo8T7b4bM6gTP"); + } + + @Test + public void testInvalidAddresses() { + assertInvalidAddress("0xmnuL9poRmnuLd55bzKe7t48xtYv2bRES"); + assertInvalidAddress("tvaAgcLKrno2AC7kYhHVDC"); + assertInvalidAddress("19p49poRmnuLdnu55bzKe7t48xtYv2bRES"); + assertInvalidAddress("tsabbfjqwr12fbdf2gvffbdb12vdssdcaa"); + } +} \ No newline at end of file