mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 01:41:11 +01:00
Merge branch 'master' into release-candidate-0.9.0
# Conflicts: # desktop/src/main/java/bisq/desktop/util/GUIUtil.java # desktop/src/test/java/bisq/desktop/util/GUIUtilTest.java # gradle/witness/gradle-witness.gradle
This commit is contained in:
commit
6861e76d61
@ -31,6 +31,8 @@
|
||||
<emptyLine />
|
||||
<package name="bisq.common" withSubpackages="true" static="false" />
|
||||
<emptyLine />
|
||||
<package name="bisq.asset" withSubpackages="true" static="false" />
|
||||
<emptyLine />
|
||||
<package name="io.bisq.generated" withSubpackages="true" static="false" />
|
||||
<emptyLine />
|
||||
<package name="com.google.protobuf" withSubpackages="true" static="false" />
|
||||
|
@ -60,7 +60,7 @@ public class CryptonoteAddressValidator implements AddressValidator {
|
||||
return AddressValidationResult.validAddress();
|
||||
}
|
||||
else if (subAddressPrefix.length() == 2 && address.length() == 95 + subAddressPrefix.length()) {
|
||||
// Aeon & Blur-type subaddress
|
||||
// Aeon, Mask & Blur-type subaddress
|
||||
return AddressValidationResult.validAddress();
|
||||
}
|
||||
else {
|
||||
|
@ -1,54 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Base58BitcoinAddressValidator;
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.NetworkParametersAdapter;
|
||||
|
||||
import org.bitcoinj.core.Utils;
|
||||
|
||||
public class Achievecoin extends Coin {
|
||||
|
||||
public Achievecoin() {
|
||||
super("AchieveCoin", "ACH", new Base58BitcoinAddressValidator(new AchievecoinParams()));
|
||||
}
|
||||
|
||||
|
||||
public static class AchievecoinParams extends NetworkParametersAdapter {
|
||||
|
||||
public AchievecoinParams() {
|
||||
interval = INTERVAL;
|
||||
targetTimespan = TARGET_TIMESPAN;
|
||||
maxTarget = Utils.decodeCompactBits(0x1d00ffffL);
|
||||
dumpedPrivateKeyHeader = 128;
|
||||
|
||||
// Address format is different to BTC, rest is the same
|
||||
addressHeader = 23; //BTG 38;
|
||||
p2shHeader = 34; //BTG 23;
|
||||
|
||||
acceptableAddressCodes = new int[]{addressHeader, p2shHeader};
|
||||
port = 7337; //BTC and BTG 8333
|
||||
packetMagic = 0x1461de3cL; //BTG 0xe1476d44L, BTC 0xf9beb4d9L;
|
||||
bip32HeaderPub = 0x02651F71; //BTG and BTC 0x0488B21E; //The 4 byte header that serializes in base58 to "xpub".
|
||||
bip32HeaderPriv = 0x02355E56; //BTG and BTC 0x0488ADE4; //The 4 byte header that serializes in base58 to "xprv"
|
||||
|
||||
id = ID_MAINNET;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,56 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.AddressValidationResult;
|
||||
import bisq.asset.Base58BitcoinAddressValidator;
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.NetworkParametersAdapter;
|
||||
|
||||
public class Angelcoin extends Coin {
|
||||
|
||||
public Angelcoin() {
|
||||
super("Angelcoin", "ALC", new AngelcoinAddressValidator());
|
||||
}
|
||||
|
||||
|
||||
public static class AngelcoinAddressValidator extends Base58BitcoinAddressValidator {
|
||||
|
||||
public AngelcoinAddressValidator() {
|
||||
super(new AngelcoinParams());
|
||||
}
|
||||
|
||||
@Override
|
||||
public AddressValidationResult validate(String address) {
|
||||
if (!address.matches("^[A][a-km-zA-HJ-NP-Z1-9]{25,34}$"))
|
||||
return AddressValidationResult.invalidStructure();
|
||||
|
||||
return super.validate(address);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class AngelcoinParams extends NetworkParametersAdapter {
|
||||
|
||||
public AngelcoinParams() {
|
||||
addressHeader = 23;
|
||||
p2shHeader = 5;
|
||||
acceptableAddressCodes = new int[]{addressHeader, p2shHeader};
|
||||
}
|
||||
}
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.RegexAddressValidator;
|
||||
|
||||
public class Arto extends Coin {
|
||||
|
||||
public Arto() {
|
||||
super("Arto", "RTO", new RegexAddressValidator("^[A][0-9A-Za-z]{94}$"));
|
||||
}
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.RegexAddressValidator;
|
||||
|
||||
public class BitDaric extends Coin {
|
||||
|
||||
public BitDaric() {
|
||||
super("BitDaric", "DARX", new RegexAddressValidator("^[R][a-km-zA-HJ-NP-Z1-9]{25,34}$"));
|
||||
}
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Base58BitcoinAddressValidator;
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.NetworkParametersAdapter;
|
||||
|
||||
public class BitZeny extends Coin {
|
||||
|
||||
public BitZeny() {
|
||||
super("BitZeny", "ZNY", new Base58BitcoinAddressValidator(new BitZenyParams()));
|
||||
}
|
||||
|
||||
|
||||
public static class BitZenyParams extends NetworkParametersAdapter {
|
||||
|
||||
public BitZenyParams() {
|
||||
addressHeader = 81;
|
||||
p2shHeader = 5;
|
||||
acceptableAddressCodes = new int[]{addressHeader, p2shHeader};
|
||||
}
|
||||
}
|
||||
}
|
@ -1,54 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Base58BitcoinAddressValidator;
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.NetworkParametersAdapter;
|
||||
|
||||
import org.bitcoinj.core.Utils;
|
||||
|
||||
public class BitcoinGold extends Coin {
|
||||
|
||||
public BitcoinGold() {
|
||||
super("Bitcoin Gold", "BTG", new Base58BitcoinAddressValidator(new BitcoinGoldParams()));
|
||||
}
|
||||
|
||||
|
||||
private static class BitcoinGoldParams extends NetworkParametersAdapter {
|
||||
|
||||
public BitcoinGoldParams() {
|
||||
interval = INTERVAL;
|
||||
targetTimespan = TARGET_TIMESPAN;
|
||||
maxTarget = Utils.decodeCompactBits(0x1d00ffffL);
|
||||
dumpedPrivateKeyHeader = 128;
|
||||
|
||||
// Address format is different to BTC, rest is the same
|
||||
addressHeader = 38;
|
||||
p2shHeader = 23;
|
||||
|
||||
acceptableAddressCodes = new int[]{addressHeader, p2shHeader};
|
||||
port = 8333;
|
||||
packetMagic = 0xf9beb4d9L;
|
||||
bip32HeaderPub = 0x0488B21E; //The 4 byte header that serializes in base58 to "xpub".
|
||||
bip32HeaderPriv = 0x0488ADE4; //The 4 byte header that serializes in base58 to "xprv"
|
||||
|
||||
id = ID_MAINNET;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Base58BitcoinAddressValidator;
|
||||
import bisq.asset.Coin;
|
||||
|
||||
public class Bitcore extends Coin {
|
||||
|
||||
public Bitcore() {
|
||||
super("Bitcore", "BTX", new Base58BitcoinAddressValidator());
|
||||
}
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.DefaultAddressValidator;
|
||||
|
||||
public class Burstcoin extends Coin {
|
||||
|
||||
public Burstcoin() {
|
||||
super("Burstcoin", "BURST", new DefaultAddressValidator());
|
||||
}
|
||||
}
|
@ -1,55 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.AddressValidationResult;
|
||||
import bisq.asset.Base58BitcoinAddressValidator;
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.NetworkParametersAdapter;
|
||||
|
||||
public class Cagecoin extends Coin {
|
||||
|
||||
public Cagecoin() {
|
||||
super("Cagecoin", "CAGE", new CagecoinAddressValidator());
|
||||
}
|
||||
|
||||
|
||||
public static class CagecoinAddressValidator extends Base58BitcoinAddressValidator {
|
||||
|
||||
public CagecoinAddressValidator() {
|
||||
super(new CagecoinParams());
|
||||
}
|
||||
|
||||
@Override
|
||||
public AddressValidationResult validate(String address) {
|
||||
if (!address.matches("^[D][a-zA-Z0-9]{26,34}$"))
|
||||
return AddressValidationResult.invalidStructure();
|
||||
return super.validate(address);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class CagecoinParams extends NetworkParametersAdapter {
|
||||
|
||||
public CagecoinParams() {
|
||||
addressHeader = 31;
|
||||
p2shHeader = 13;
|
||||
acceptableAddressCodes = new int[]{addressHeader, p2shHeader};
|
||||
}
|
||||
}
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.RegexAddressValidator;
|
||||
|
||||
public class CassubianDetk extends Coin {
|
||||
|
||||
public CassubianDetk() {
|
||||
super("Cassubian Detk", "CDT", new RegexAddressValidator("^D.*"));
|
||||
}
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.RegexAddressValidator;
|
||||
|
||||
public class Conceal extends Coin {
|
||||
|
||||
public Conceal() {
|
||||
super("Conceal", "CCX", new RegexAddressValidator("^ccx7[1-9A-HJ-NP-Za-km-z]{94}$"));
|
||||
}
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Base58BitcoinAddressValidator;
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.NetworkParametersAdapter;
|
||||
|
||||
public class Creativecoin extends Coin {
|
||||
|
||||
public Creativecoin() {
|
||||
super("Creativecoin", "CREA", new Base58BitcoinAddressValidator(new CreativecoinParams()));
|
||||
}
|
||||
|
||||
|
||||
public static class CreativecoinParams extends NetworkParametersAdapter {
|
||||
|
||||
public CreativecoinParams() {
|
||||
int segwitHeader = 35;
|
||||
addressHeader = 28;
|
||||
p2shHeader = 5;
|
||||
acceptableAddressCodes = new int[]{addressHeader, p2shHeader, segwitHeader};
|
||||
}
|
||||
}
|
||||
}
|
@ -1,92 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.AddressValidationResult;
|
||||
import bisq.asset.AddressValidator;
|
||||
import bisq.asset.Coin;
|
||||
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public class Cryptonite extends Coin {
|
||||
|
||||
public Cryptonite() {
|
||||
super("Cryptonite", "XCN", new CryptoniteAddressValidator());
|
||||
}
|
||||
|
||||
|
||||
public static class CryptoniteAddressValidator implements AddressValidator {
|
||||
|
||||
private final static String ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
|
||||
|
||||
@Override
|
||||
public AddressValidationResult validate(String address) {
|
||||
// https://bitcointalk.org/index.php?topic=1801595
|
||||
if (address.length() != 34)
|
||||
return AddressValidationResult.invalidAddress("XCN_Addr_Invalid: Length must be 34!");
|
||||
|
||||
if (!address.startsWith("C"))
|
||||
return AddressValidationResult.invalidAddress("XCN_Addr_Invalid: must start with 'C'!");
|
||||
|
||||
byte[] decoded = decodeBase58(address);
|
||||
if (decoded == null)
|
||||
return AddressValidationResult.invalidAddress("XCN_Addr_Invalid: Base58 decoder error!");
|
||||
|
||||
byte[] hash = getSha256(decoded, 21, 2);
|
||||
if (hash == null || !Arrays.equals(Arrays.copyOfRange(hash, 0, 4), Arrays.copyOfRange(decoded, 21, 25)))
|
||||
return AddressValidationResult.invalidAddress("XCN_Addr_Invalid: Checksum error!");
|
||||
|
||||
return AddressValidationResult.validAddress();
|
||||
}
|
||||
|
||||
private static byte[] decodeBase58(String input) {
|
||||
byte[] output = new byte[25];
|
||||
for (int i = 0; i < input.length(); i++) {
|
||||
char t = input.charAt(i);
|
||||
|
||||
int p = ALPHABET.indexOf(t);
|
||||
if (p == -1)
|
||||
return null;
|
||||
for (int j = 25 - 1; j >= 0; j--, p /= 256) {
|
||||
p += 58 * (output[j] & 0xFF);
|
||||
output[j] = (byte) (p % 256);
|
||||
}
|
||||
if (p != 0)
|
||||
return null;
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
private static byte[] getSha256(byte[] data, int len, int recursion) {
|
||||
if (recursion == 0)
|
||||
return data;
|
||||
|
||||
try {
|
||||
MessageDigest md = MessageDigest.getInstance("SHA-256");
|
||||
md.update(Arrays.copyOfRange(data, 0, len));
|
||||
return getSha256(md.digest(), 32, recursion - 1);
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Base58BitcoinAddressValidator;
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.NetworkParametersAdapter;
|
||||
|
||||
public class DSTRA extends Coin {
|
||||
|
||||
public DSTRA() {
|
||||
super("DSTRA", "DST", new Base58BitcoinAddressValidator(new DSTRAParams()));
|
||||
}
|
||||
|
||||
|
||||
public static class DSTRAParams extends NetworkParametersAdapter {
|
||||
|
||||
public DSTRAParams() {
|
||||
addressHeader = 35;
|
||||
p2shHeader = 95;
|
||||
acceptableAddressCodes = new int[]{addressHeader, p2shHeader};
|
||||
}
|
||||
}
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.DefaultAddressValidator;
|
||||
|
||||
public class DarkNet extends Coin {
|
||||
|
||||
public DarkNet() {
|
||||
super("DarkNet", "DNET", new DefaultAddressValidator());
|
||||
}
|
||||
}
|
@ -1,36 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.RegexAddressValidator;
|
||||
|
||||
public class Decent extends Coin {
|
||||
|
||||
public Decent() {
|
||||
super("Decent", "DCT", new DecentAddressValidator());
|
||||
}
|
||||
|
||||
|
||||
public static class DecentAddressValidator extends RegexAddressValidator {
|
||||
|
||||
public DecentAddressValidator() {
|
||||
super("^(?=.{5,63}$)([a-z][a-z0-9-]+[a-z0-9])(\\.[a-z][a-z0-9-]+[a-z0-9])*$");
|
||||
}
|
||||
}
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Base58BitcoinAddressValidator;
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.NetworkParametersAdapter;
|
||||
|
||||
public class DeepOnion extends Coin {
|
||||
|
||||
public DeepOnion() {
|
||||
super("DeepOnion", "ONION", new Base58BitcoinAddressValidator(new DeepOnionParams()));
|
||||
}
|
||||
|
||||
|
||||
public static class DeepOnionParams extends NetworkParametersAdapter {
|
||||
|
||||
public DeepOnionParams() {
|
||||
addressHeader = 31;
|
||||
p2shHeader = 78;
|
||||
acceptableAddressCodes = new int[]{addressHeader, p2shHeader};
|
||||
}
|
||||
}
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Base58BitcoinAddressValidator;
|
||||
import bisq.asset.Coin;
|
||||
|
||||
public class Devcoin extends Coin {
|
||||
|
||||
public Devcoin() {
|
||||
super("Devcoin", "DVC", new Base58BitcoinAddressValidator());
|
||||
}
|
||||
}
|
@ -1,56 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.AddressValidationResult;
|
||||
import bisq.asset.Base58BitcoinAddressValidator;
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.NetworkParametersAdapter;
|
||||
|
||||
public class Diamond extends Coin {
|
||||
|
||||
public Diamond() {
|
||||
super("Diamond", "DMD", new DiamondAddressValidator());
|
||||
}
|
||||
|
||||
|
||||
public static class DiamondAddressValidator extends Base58BitcoinAddressValidator {
|
||||
|
||||
public DiamondAddressValidator() {
|
||||
super(new DiamondParams());
|
||||
}
|
||||
|
||||
@Override
|
||||
public AddressValidationResult validate(String address) {
|
||||
if (!address.matches("^[d][a-km-zA-HJ-NP-Z1-9]{25,34}$"))
|
||||
return AddressValidationResult.invalidStructure();
|
||||
|
||||
return super.validate(address);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class DiamondParams extends NetworkParametersAdapter {
|
||||
|
||||
public DiamondParams() {
|
||||
addressHeader = 90;
|
||||
p2shHeader = 8;
|
||||
acceptableAddressCodes = new int[]{addressHeader, p2shHeader};
|
||||
}
|
||||
}
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.RegexAddressValidator;
|
||||
|
||||
public class DigiMoney extends Coin {
|
||||
|
||||
public DigiMoney() {
|
||||
super("DigiMoney", "DGM", new RegexAddressValidator("^[D-E][a-zA-Z0-9]{33}$"));
|
||||
}
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.RegexAddressValidator;
|
||||
|
||||
public class Dinero extends Coin {
|
||||
|
||||
public Dinero() {
|
||||
super("Dinero", "DIN", new RegexAddressValidator("^[D][0-9a-zA-Z]{33}$"));
|
||||
}
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.DefaultAddressValidator;
|
||||
|
||||
public class DynamicCoin extends Coin {
|
||||
|
||||
public DynamicCoin() {
|
||||
super("DynamicCoin", "DMC", new DefaultAddressValidator());
|
||||
}
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.DefaultAddressValidator;
|
||||
|
||||
public class Espers extends Coin {
|
||||
|
||||
public Espers() {
|
||||
super("Espers", "ESP", new DefaultAddressValidator());
|
||||
}
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.RegexAddressValidator;
|
||||
|
||||
public class InfinityEconomics extends Coin {
|
||||
|
||||
public InfinityEconomics() {
|
||||
super("Infinity Economics", "XIN",
|
||||
new RegexAddressValidator("^XIN-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{5}$"));
|
||||
}
|
||||
}
|
@ -1,61 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.AddressValidationResult;
|
||||
import bisq.asset.AddressValidator;
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.NetworkParametersAdapter;
|
||||
|
||||
import org.bitcoinj.core.Address;
|
||||
import org.bitcoinj.core.AddressFormatException;
|
||||
|
||||
public class Instacash extends Coin {
|
||||
|
||||
public Instacash() {
|
||||
super("Instacash", "ICH", new InstacashAddressValidator());
|
||||
}
|
||||
|
||||
|
||||
public static class InstacashAddressValidator implements AddressValidator {
|
||||
|
||||
@Override
|
||||
public AddressValidationResult validate(String address) {
|
||||
if (!address.matches("^[A][a-km-zA-HJ-NP-Z1-9]{25,34}$"))
|
||||
return AddressValidationResult.invalidStructure();
|
||||
|
||||
try {
|
||||
Address.fromBase58(new InstacashParams(), address);
|
||||
} catch (AddressFormatException ex) {
|
||||
return AddressValidationResult.invalidAddress(ex);
|
||||
}
|
||||
|
||||
return AddressValidationResult.validAddress();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class InstacashParams extends NetworkParametersAdapter {
|
||||
|
||||
public InstacashParams() {
|
||||
addressHeader = 23;
|
||||
p2shHeader = 13;
|
||||
acceptableAddressCodes = new int[]{addressHeader, p2shHeader};
|
||||
}
|
||||
}
|
||||
}
|
@ -1,57 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.AddressValidationResult;
|
||||
import bisq.asset.Base58BitcoinAddressValidator;
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.NetworkParametersAdapter;
|
||||
|
||||
public class InternetOfPeople extends Coin {
|
||||
|
||||
public InternetOfPeople() {
|
||||
super("Internet of People", "IOP", new InternetOfPeopleAddressValidator());
|
||||
}
|
||||
|
||||
|
||||
public static class InternetOfPeopleAddressValidator extends Base58BitcoinAddressValidator {
|
||||
|
||||
public InternetOfPeopleAddressValidator() {
|
||||
super(new InternetOfPeopleParams());
|
||||
}
|
||||
|
||||
@Override
|
||||
public AddressValidationResult validate(String address) {
|
||||
if (!address.matches("^[p][a-km-zA-HJ-NP-Z1-9]{25,34}$"))
|
||||
return AddressValidationResult.invalidStructure();
|
||||
|
||||
return super.validate(address);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class InternetOfPeopleParams extends NetworkParametersAdapter {
|
||||
|
||||
public InternetOfPeopleParams() {
|
||||
super();
|
||||
addressHeader = 117;
|
||||
p2shHeader = 174;
|
||||
acceptableAddressCodes = new int[]{addressHeader, p2shHeader};
|
||||
}
|
||||
}
|
||||
}
|
@ -26,6 +26,10 @@ import java.security.NoSuchAlgorithmException;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @deprecated for insufficent trading
|
||||
*/
|
||||
@Deprecated(since = "0.9.0")
|
||||
public class Koto extends Coin {
|
||||
|
||||
public Koto() {
|
||||
|
@ -1,39 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Base58BitcoinAddressValidator;
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.NetworkParametersAdapter;
|
||||
|
||||
public class Kumacoin extends Coin {
|
||||
|
||||
public Kumacoin() {
|
||||
super("Kumacoin", "KUMA", new Base58BitcoinAddressValidator(new KumacoinParams()));
|
||||
}
|
||||
|
||||
|
||||
public static class KumacoinParams extends NetworkParametersAdapter {
|
||||
|
||||
public KumacoinParams() {
|
||||
addressHeader = 45;
|
||||
p2shHeader = 8;
|
||||
acceptableAddressCodes = new int[]{addressHeader, p2shHeader};
|
||||
}
|
||||
}
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.DefaultAddressValidator;
|
||||
|
||||
public class LBRY extends Coin {
|
||||
|
||||
public LBRY() {
|
||||
super("LBRY Credits", "LBC", new DefaultAddressValidator());
|
||||
}
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.RegexAddressValidator;
|
||||
|
||||
public class LitecoinExtreme extends Coin {
|
||||
|
||||
public LitecoinExtreme(){
|
||||
super("LitecoinExtreme", "LCE", new RegexAddressValidator("^[E][a-km-zA-HJ-NP-Z1-9]{33}$"));
|
||||
}
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.RegexAddressValidator;
|
||||
|
||||
public class MFCoin extends Coin {
|
||||
|
||||
public MFCoin(){
|
||||
super("MFCoin", "MFC", new RegexAddressValidator("^[M][a-km-zA-HJ-NP-Z1-9]{33}$"));
|
||||
}
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.RegexAddressValidator;
|
||||
|
||||
public class Madbyte extends Coin {
|
||||
|
||||
public Madbyte() {
|
||||
super("Madbyte", "MBYT", new RegexAddressValidator("^[M][a-zA-Z0-9]{33}$"));
|
||||
}
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.RegexAddressValidator;
|
||||
|
||||
public class Madcoin extends Coin {
|
||||
|
||||
public Madcoin() {
|
||||
super("Madcoin", "MDC", new RegexAddressValidator("^m[a-zA-Z0-9]{26,33}$"));
|
||||
}
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.DefaultAddressValidator;
|
||||
|
||||
public class MaidSafeCoin extends Coin {
|
||||
|
||||
public MaidSafeCoin() {
|
||||
super("MaidSafeCoin", "MAID", new DefaultAddressValidator());
|
||||
}
|
||||
}
|
@ -18,11 +18,10 @@
|
||||
package bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.DefaultAddressValidator;
|
||||
import bisq.asset.CryptonoteAddressValidator;
|
||||
|
||||
public class Lisk extends Coin {
|
||||
|
||||
public Lisk() {
|
||||
super("Lisk", "LSK", new DefaultAddressValidator());
|
||||
public class Mask extends Coin {
|
||||
public Mask() {
|
||||
super("Mask", "MASK", new CryptonoteAddressValidator("M", "bT"));
|
||||
}
|
||||
}
|
@ -1,56 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.AddressValidationResult;
|
||||
import bisq.asset.Base58BitcoinAddressValidator;
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.NetworkParametersAdapter;
|
||||
|
||||
public class Mazacoin extends Coin {
|
||||
|
||||
public Mazacoin() {
|
||||
super("Mazacoin", "MAZA", new MazacoinAddressValidator());
|
||||
}
|
||||
|
||||
|
||||
public static class MazacoinAddressValidator extends Base58BitcoinAddressValidator {
|
||||
|
||||
public MazacoinAddressValidator() {
|
||||
super(new MazacoinParams());
|
||||
}
|
||||
|
||||
@Override
|
||||
public AddressValidationResult validate(String address) {
|
||||
if (!address.matches("^[M][a-km-zA-HJ-NP-Z1-9]{25,34}$"))
|
||||
return AddressValidationResult.invalidStructure();
|
||||
|
||||
return super.validate(address);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class MazacoinParams extends NetworkParametersAdapter {
|
||||
|
||||
public MazacoinParams() {
|
||||
addressHeader = 50;
|
||||
p2shHeader = 9;
|
||||
acceptableAddressCodes = new int[]{addressHeader, p2shHeader};
|
||||
}
|
||||
}
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Base58BitcoinAddressValidator;
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.NetworkParametersAdapter;
|
||||
|
||||
public class NEETCOIN extends Coin {
|
||||
|
||||
public NEETCOIN() {
|
||||
super("NEETCOIN", "NEET", new Base58BitcoinAddressValidator(new NEETCOINParams()));
|
||||
}
|
||||
|
||||
|
||||
public static class NEETCOINParams extends NetworkParametersAdapter {
|
||||
|
||||
public NEETCOINParams() {
|
||||
addressHeader = 53;
|
||||
p2shHeader = 112;
|
||||
acceptableAddressCodes = new int[]{addressHeader, p2shHeader};
|
||||
}
|
||||
}
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.DefaultAddressValidator;
|
||||
|
||||
public class NavCoin extends Coin {
|
||||
|
||||
public NavCoin() {
|
||||
super("Nav Coin", "NAV", new DefaultAddressValidator());
|
||||
}
|
||||
}
|
@ -1,87 +0,0 @@
|
||||
package bisq.asset.coins;
|
||||
|
||||
import bisq.asset.AddressValidationResult;
|
||||
import bisq.asset.AddressValidator;
|
||||
import bisq.asset.Coin;
|
||||
|
||||
import org.bouncycastle.jcajce.provider.digest.Keccak;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
public class Nilu extends Coin {
|
||||
|
||||
public Nilu() {
|
||||
super("Nilu", "NILU", new NiluAddressValidator());
|
||||
}
|
||||
|
||||
|
||||
private static class NiluAddressValidator implements AddressValidator {
|
||||
|
||||
private static final String upperOrLowerPattern = "(0x)?([0-9a-f]{40}|[0-9A-F]{40})";
|
||||
private static final String mixPattern = "(0x)?([0-9a-fA-F]{40})";
|
||||
|
||||
@Override
|
||||
public AddressValidationResult validate(String address) {
|
||||
if (!isValidAddress(address))
|
||||
return AddressValidationResult.invalidStructure();
|
||||
|
||||
return AddressValidationResult.validAddress();
|
||||
}
|
||||
|
||||
private boolean isValidAddress(String eip55) {
|
||||
if (eip55 == null || eip55.isEmpty())
|
||||
return false;
|
||||
|
||||
if (eip55.matches(upperOrLowerPattern))
|
||||
return true;
|
||||
|
||||
if (!eip55.matches(mixPattern))
|
||||
return false;
|
||||
|
||||
String addr = convertToEip55Address(eip55);
|
||||
return addr.replaceFirst("0x", "").equals(eip55.replaceFirst("0x", ""));
|
||||
}
|
||||
|
||||
private String convertToEip55Address(String input) {
|
||||
String addr = input.replaceFirst("0x", "").toLowerCase();
|
||||
StringBuilder ret = new StringBuilder("0x");
|
||||
String hash = sha3String(addr).substring(2);
|
||||
for (int i = 0; i < addr.length(); i++) {
|
||||
String a = addr.charAt(i) + "";
|
||||
ret.append(Integer.parseInt(hash.charAt(i) + "", 16) > 7 ? a.toUpperCase() : a);
|
||||
}
|
||||
return ret.toString();
|
||||
}
|
||||
|
||||
private static byte[] sha3(byte[] input, int offset, int length) {
|
||||
Keccak.DigestKeccak kecc = new Keccak.Digest256();
|
||||
kecc.update(input, offset, length);
|
||||
return kecc.digest();
|
||||
}
|
||||
|
||||
private static byte[] sha3(byte[] input) {
|
||||
return sha3(input, 0, input.length);
|
||||
}
|
||||
|
||||
private static String toHexString(byte[] input, int offset, int length, boolean withPrefix) {
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
if (withPrefix) {
|
||||
stringBuilder.append("0x");
|
||||
}
|
||||
|
||||
for (int i = offset; i < offset + length; ++i) {
|
||||
stringBuilder.append(String.format("%02x", input[i] & 255));
|
||||
}
|
||||
|
||||
return stringBuilder.toString();
|
||||
}
|
||||
|
||||
private static String toHexString(byte[] input) {
|
||||
return toHexString(input, 0, input.length, true);
|
||||
}
|
||||
|
||||
private static String sha3String(String utf8String) {
|
||||
return toHexString(sha3(utf8String.getBytes(StandardCharsets.UTF_8)));
|
||||
}
|
||||
}
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.DefaultAddressValidator;
|
||||
|
||||
public class NuBits extends Coin {
|
||||
|
||||
public NuBits() {
|
||||
super("NuBits", "NBT", new DefaultAddressValidator());
|
||||
}
|
||||
}
|
@ -1,227 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.AddressValidationResult;
|
||||
import bisq.asset.AddressValidator;
|
||||
import bisq.asset.Coin;
|
||||
|
||||
public class Nxt extends Coin {
|
||||
|
||||
public Nxt() {
|
||||
super("Nxt", "NXT", new NxtAddressValidator());
|
||||
}
|
||||
|
||||
|
||||
public static class NxtAddressValidator implements AddressValidator {
|
||||
|
||||
@Override
|
||||
public AddressValidationResult validate(String address) {
|
||||
if (!address.startsWith("NXT-") || !address.equals(address.toUpperCase()))
|
||||
return AddressValidationResult.invalidStructure();
|
||||
|
||||
try {
|
||||
long accountId = NxtReedSolomonValidator.decode(address.substring(4));
|
||||
if (accountId == 0)
|
||||
return AddressValidationResult.invalidStructure();
|
||||
} catch (NxtReedSolomonValidator.DecodeException e) {
|
||||
return AddressValidationResult.invalidAddress(e);
|
||||
}
|
||||
|
||||
return AddressValidationResult.validAddress();
|
||||
}
|
||||
}
|
||||
|
||||
public static final class NxtReedSolomonValidator {
|
||||
|
||||
private static final int[] initial_codeword = {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
|
||||
private static final int[] gexp = {
|
||||
1, 2, 4, 8, 16, 5, 10, 20, 13, 26, 17, 7, 14, 28, 29, 31,
|
||||
27, 19, 3, 6, 12, 24, 21, 15, 30, 25, 23, 11, 22, 9, 18, 1};
|
||||
private static final int[] glog = {
|
||||
0, 0, 1, 18, 2, 5, 19, 11, 3, 29, 6, 27, 20, 8, 12, 23, 4,
|
||||
10, 30, 17, 7, 22, 28, 26, 21, 25, 9, 16, 13, 14, 24, 15};
|
||||
private static final int[] codeword_map = {3, 2, 1, 0, 7, 6, 5, 4, 13, 14, 15, 16, 12, 8, 9, 10, 11};
|
||||
private static final String alphabet = "23456789ABCDEFGHJKLMNPQRSTUVWXYZ";
|
||||
|
||||
private static final int base_32_length = 13;
|
||||
private static final int base_10_length = 20;
|
||||
|
||||
public static String encode(long plain) {
|
||||
|
||||
String plain_string = Long.toUnsignedString(plain);
|
||||
int length = plain_string.length();
|
||||
int[] plain_string_10 = new int[NxtReedSolomonValidator.base_10_length];
|
||||
for (int i = 0; i < length; i++) {
|
||||
plain_string_10[i] = (int) plain_string.charAt(i) - (int) '0';
|
||||
}
|
||||
|
||||
int codeword_length = 0;
|
||||
int[] codeword = new int[NxtReedSolomonValidator.initial_codeword.length];
|
||||
|
||||
do { // base 10 to base 32 conversion
|
||||
int new_length = 0;
|
||||
int digit_32 = 0;
|
||||
for (int i = 0; i < length; i++) {
|
||||
digit_32 = digit_32 * 10 + plain_string_10[i];
|
||||
if (digit_32 >= 32) {
|
||||
plain_string_10[new_length] = digit_32 >> 5;
|
||||
digit_32 &= 31;
|
||||
new_length += 1;
|
||||
} else if (new_length > 0) {
|
||||
plain_string_10[new_length] = 0;
|
||||
new_length += 1;
|
||||
}
|
||||
}
|
||||
length = new_length;
|
||||
codeword[codeword_length] = digit_32;
|
||||
codeword_length += 1;
|
||||
} while (length > 0);
|
||||
|
||||
int[] p = {0, 0, 0, 0};
|
||||
for (int i = NxtReedSolomonValidator.base_32_length - 1; i >= 0; i--) {
|
||||
final int fb = codeword[i] ^ p[3];
|
||||
p[3] = p[2] ^ NxtReedSolomonValidator.gmult(30, fb);
|
||||
p[2] = p[1] ^ NxtReedSolomonValidator.gmult(6, fb);
|
||||
p[1] = p[0] ^ NxtReedSolomonValidator.gmult(9, fb);
|
||||
p[0] = NxtReedSolomonValidator.gmult(17, fb);
|
||||
}
|
||||
|
||||
System.arraycopy(
|
||||
p, 0, codeword, NxtReedSolomonValidator.base_32_length,
|
||||
NxtReedSolomonValidator.initial_codeword.length - NxtReedSolomonValidator.base_32_length);
|
||||
|
||||
StringBuilder cypher_string_builder = new StringBuilder();
|
||||
for (int i = 0; i < 17; i++) {
|
||||
final int codework_index = NxtReedSolomonValidator.codeword_map[i];
|
||||
final int alphabet_index = codeword[codework_index];
|
||||
cypher_string_builder.append(NxtReedSolomonValidator.alphabet.charAt(alphabet_index));
|
||||
|
||||
if ((i & 3) == 3 && i < 13) {
|
||||
cypher_string_builder.append('-');
|
||||
}
|
||||
}
|
||||
return cypher_string_builder.toString();
|
||||
}
|
||||
|
||||
public static long decode(String cypher_string) throws DecodeException {
|
||||
|
||||
int[] codeword = new int[NxtReedSolomonValidator.initial_codeword.length];
|
||||
System.arraycopy(
|
||||
NxtReedSolomonValidator.initial_codeword, 0, codeword, 0,
|
||||
NxtReedSolomonValidator.initial_codeword.length);
|
||||
|
||||
int codeword_length = 0;
|
||||
for (int i = 0; i < cypher_string.length(); i++) {
|
||||
int position_in_alphabet = NxtReedSolomonValidator.alphabet.indexOf(cypher_string.charAt(i));
|
||||
|
||||
if (position_in_alphabet <= -1 || position_in_alphabet > NxtReedSolomonValidator.alphabet.length()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (codeword_length > 16) {
|
||||
throw new CodewordTooLongException();
|
||||
}
|
||||
|
||||
int codework_index = NxtReedSolomonValidator.codeword_map[codeword_length];
|
||||
codeword[codework_index] = position_in_alphabet;
|
||||
codeword_length += 1;
|
||||
}
|
||||
|
||||
if (codeword_length == 17 && !NxtReedSolomonValidator.is_codeword_valid(codeword) || codeword_length != 17) {
|
||||
throw new CodewordInvalidException();
|
||||
}
|
||||
|
||||
int length = NxtReedSolomonValidator.base_32_length;
|
||||
int[] cypher_string_32 = new int[length];
|
||||
for (int i = 0; i < length; i++) {
|
||||
cypher_string_32[i] = codeword[length - i - 1];
|
||||
}
|
||||
|
||||
StringBuilder plain_string_builder = new StringBuilder();
|
||||
do { // base 32 to base 10 conversion
|
||||
int new_length = 0;
|
||||
int digit_10 = 0;
|
||||
|
||||
for (int i = 0; i < length; i++) {
|
||||
digit_10 = digit_10 * 32 + cypher_string_32[i];
|
||||
|
||||
if (digit_10 >= 10) {
|
||||
cypher_string_32[new_length] = digit_10 / 10;
|
||||
digit_10 %= 10;
|
||||
new_length += 1;
|
||||
} else if (new_length > 0) {
|
||||
cypher_string_32[new_length] = 0;
|
||||
new_length += 1;
|
||||
}
|
||||
}
|
||||
length = new_length;
|
||||
plain_string_builder.append((char) (digit_10 + (int) '0'));
|
||||
} while (length > 0);
|
||||
|
||||
return Long.parseUnsignedLong(plain_string_builder.reverse().toString());
|
||||
}
|
||||
|
||||
private static int gmult(int a, int b) {
|
||||
if (a == 0 || b == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int idx = (NxtReedSolomonValidator.glog[a] + NxtReedSolomonValidator.glog[b]) % 31;
|
||||
|
||||
return NxtReedSolomonValidator.gexp[idx];
|
||||
}
|
||||
|
||||
private static boolean is_codeword_valid(int[] codeword) {
|
||||
int sum = 0;
|
||||
|
||||
for (int i = 1; i < 5; i++) {
|
||||
int t = 0;
|
||||
|
||||
for (int j = 0; j < 31; j++) {
|
||||
if (j > 12 && j < 27) {
|
||||
continue;
|
||||
}
|
||||
|
||||
int pos = j;
|
||||
if (j > 26) {
|
||||
pos -= 14;
|
||||
}
|
||||
|
||||
t ^= NxtReedSolomonValidator.gmult(codeword[pos], NxtReedSolomonValidator.gexp[(i * j) % 31]);
|
||||
}
|
||||
|
||||
sum |= t;
|
||||
}
|
||||
|
||||
return sum == 0;
|
||||
}
|
||||
|
||||
public abstract static class DecodeException extends Exception {
|
||||
}
|
||||
|
||||
static final class CodewordTooLongException extends DecodeException {
|
||||
}
|
||||
|
||||
static final class CodewordInvalidException extends DecodeException {
|
||||
}
|
||||
|
||||
private NxtReedSolomonValidator() {
|
||||
} // never
|
||||
}
|
||||
}
|
@ -21,6 +21,10 @@ import bisq.asset.Base58BitcoinAddressValidator;
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.NetworkParametersAdapter;
|
||||
|
||||
/**
|
||||
* @deprecated for insufficent trading
|
||||
*/
|
||||
@Deprecated(since = "0.9.0")
|
||||
public class Obsidian extends Coin {
|
||||
|
||||
public Obsidian() {
|
||||
|
@ -1,56 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.AddressValidationResult;
|
||||
import bisq.asset.Base58BitcoinAddressValidator;
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.NetworkParametersAdapter;
|
||||
|
||||
public class Octocoin extends Coin {
|
||||
|
||||
public Octocoin() {
|
||||
super("Octocoin", "888", new OctocoinAddressValidator());
|
||||
}
|
||||
|
||||
|
||||
public static class OctocoinAddressValidator extends Base58BitcoinAddressValidator {
|
||||
|
||||
public OctocoinAddressValidator() {
|
||||
super(new OctocoinParams());
|
||||
}
|
||||
|
||||
@Override
|
||||
public AddressValidationResult validate(String address) {
|
||||
if (!address.matches("^[83][a-km-zA-HJ-NP-Z1-9]{25,34}$"))
|
||||
return AddressValidationResult.invalidStructure();
|
||||
|
||||
return super.validate(address);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class OctocoinParams extends NetworkParametersAdapter {
|
||||
|
||||
public OctocoinParams() {
|
||||
addressHeader = 18;
|
||||
p2shHeader = 5;
|
||||
acceptableAddressCodes = new int[]{addressHeader, p2shHeader};
|
||||
}
|
||||
}
|
||||
}
|
@ -1,56 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.AddressValidationResult;
|
||||
import bisq.asset.Base58BitcoinAddressValidator;
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.NetworkParametersAdapter;
|
||||
|
||||
public class Particl extends Coin {
|
||||
|
||||
public Particl() {
|
||||
super("Particl", "PART", new ParticlAddressValidator());
|
||||
}
|
||||
|
||||
|
||||
public static class ParticlAddressValidator extends Base58BitcoinAddressValidator {
|
||||
|
||||
public ParticlAddressValidator() {
|
||||
super(new ParticlParams());
|
||||
}
|
||||
|
||||
@Override
|
||||
public AddressValidationResult validate(String address) {
|
||||
if (!address.matches("^[RP][a-km-zA-HJ-NP-Z1-9]{25,34}$"))
|
||||
return AddressValidationResult.invalidStructure();
|
||||
|
||||
return super.validate(address);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class ParticlParams extends NetworkParametersAdapter {
|
||||
|
||||
public ParticlParams() {
|
||||
addressHeader = 56;
|
||||
p2shHeader = 60;
|
||||
acceptableAddressCodes = new int[]{addressHeader, p2shHeader};
|
||||
}
|
||||
}
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.DefaultAddressValidator;
|
||||
|
||||
public class PepeCash extends Coin {
|
||||
|
||||
public PepeCash() {
|
||||
super("Pepe Cash", "PEPECASH", new DefaultAddressValidator());
|
||||
}
|
||||
}
|
@ -1,56 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.AddressValidationResult;
|
||||
import bisq.asset.Base58BitcoinAddressValidator;
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.NetworkParametersAdapter;
|
||||
|
||||
public class Phore extends Coin {
|
||||
|
||||
public Phore() {
|
||||
super("Phore", "PHR", new PhoreAddressValidator());
|
||||
}
|
||||
|
||||
|
||||
public static class PhoreAddressValidator extends Base58BitcoinAddressValidator {
|
||||
|
||||
public PhoreAddressValidator() {
|
||||
super(new PhoreParams());
|
||||
}
|
||||
|
||||
@Override
|
||||
public AddressValidationResult validate(String address) {
|
||||
if (!address.matches("^[P][a-km-zA-HJ-NP-Z1-9]{25,34}$"))
|
||||
return AddressValidationResult.invalidStructure();
|
||||
|
||||
return super.validate(address);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class PhoreParams extends NetworkParametersAdapter {
|
||||
|
||||
public PhoreParams() {
|
||||
addressHeader = 55;
|
||||
p2shHeader = 13;
|
||||
acceptableAddressCodes = new int[]{addressHeader, p2shHeader};
|
||||
}
|
||||
}
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.DefaultAddressValidator;
|
||||
|
||||
public class PostCoin extends Coin {
|
||||
|
||||
public PostCoin() {
|
||||
super("PostCoin", "POST", new DefaultAddressValidator());
|
||||
}
|
||||
}
|
@ -1,102 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.AddressValidationResult;
|
||||
import bisq.asset.Base58BitcoinAddressValidator;
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.NetworkParametersAdapter;
|
||||
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public class Pranacoin extends Coin {
|
||||
|
||||
public Pranacoin() {
|
||||
super("Pranacoin", "PNC", new PranacoinAddressValidator());
|
||||
}
|
||||
|
||||
|
||||
public static class PranacoinAddressValidator extends Base58BitcoinAddressValidator {
|
||||
|
||||
private final static String ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
|
||||
|
||||
public PranacoinAddressValidator() {
|
||||
super(new Pranacoin.PranacoinParams());
|
||||
}
|
||||
|
||||
@Override
|
||||
public AddressValidationResult validate(String address) {
|
||||
if (!address.matches("^[P3][a-km-zA-HJ-NP-Z1-9]{25,34}$"))
|
||||
return AddressValidationResult.invalidStructure();
|
||||
if (!validateAddress(address))
|
||||
return AddressValidationResult.invalidStructure();
|
||||
return super.validate(address);
|
||||
}
|
||||
|
||||
public static boolean validateAddress(String addr) {
|
||||
if (addr.length() < 26 || addr.length() > 35) return false;
|
||||
byte[] decoded = decodeBase58(addr, 58, 25);
|
||||
if (decoded == null) return false;
|
||||
|
||||
byte[] hash = getSha256(decoded, 0, 21, 2);
|
||||
return hash != null && Arrays.equals(Arrays.copyOfRange(hash, 0, 4), Arrays.copyOfRange(decoded, 21, 25));
|
||||
}
|
||||
|
||||
private static byte[] decodeBase58(String input, int base, int len) {
|
||||
byte[] output = new byte[len];
|
||||
for (int i = 0; i < input.length(); i++) {
|
||||
char t = input.charAt(i);
|
||||
|
||||
int p = ALPHABET.indexOf(t);
|
||||
if (p == -1) return null;
|
||||
for (int j = len - 1; j >= 0; j--, p /= 256) {
|
||||
p += base * (output[j] & 0xFF);
|
||||
output[j] = (byte) (p % 256);
|
||||
}
|
||||
if (p != 0) return null;
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
private static byte[] getSha256(byte[] data, int start, int len, int recursion) {
|
||||
if (recursion == 0) return data;
|
||||
|
||||
try {
|
||||
MessageDigest md = MessageDigest.getInstance("SHA-256");
|
||||
md.update(Arrays.copyOfRange(data, start, start + len));
|
||||
return getSha256(md.digest(), 0, 32, recursion - 1);
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class PranacoinParams extends NetworkParametersAdapter {
|
||||
|
||||
public PranacoinParams() {
|
||||
addressHeader = 55;
|
||||
p2shHeader = 5;
|
||||
acceptableAddressCodes = new int[]{addressHeader, p2shHeader};
|
||||
}
|
||||
}
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.DefaultAddressValidator;
|
||||
|
||||
public class ReddCoin extends Coin {
|
||||
|
||||
public ReddCoin() {
|
||||
super("ReddCoin", "RDD", new DefaultAddressValidator());
|
||||
}
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Base58BitcoinAddressValidator;
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.NetworkParametersAdapter;
|
||||
|
||||
public class Ringo extends Coin {
|
||||
|
||||
public Ringo() {
|
||||
super("Ringo", "RIN", new Base58BitcoinAddressValidator(new RingoParams()));
|
||||
}
|
||||
|
||||
|
||||
public static class RingoParams extends NetworkParametersAdapter {
|
||||
|
||||
public RingoParams() {
|
||||
addressHeader = 60;
|
||||
p2shHeader = 85;
|
||||
acceptableAddressCodes = new int[]{addressHeader, p2shHeader};
|
||||
}
|
||||
}
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.RegexAddressValidator;
|
||||
|
||||
public class Roicoin extends Coin {
|
||||
|
||||
public Roicoin() {
|
||||
super("ROIcoin", "ROI", new RegexAddressValidator("^[R][0-9a-zA-Z]{33}$"));
|
||||
}
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.DefaultAddressValidator;
|
||||
|
||||
public class STEEM extends Coin {
|
||||
|
||||
public STEEM() {
|
||||
super("STEEM", "STEEM", new DefaultAddressValidator());
|
||||
}
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.DefaultAddressValidator;
|
||||
|
||||
public class SafeFileSystemCoin extends Coin {
|
||||
|
||||
public SafeFileSystemCoin() {
|
||||
super("Safe FileSystem Coin", "SFSC", new DefaultAddressValidator());
|
||||
}
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.RegexAddressValidator;
|
||||
|
||||
public class Semux extends Coin {
|
||||
|
||||
public Semux() {
|
||||
super("Semux", "SEM", new RegexAddressValidator("^0x[a-f0-9]{40}$"));
|
||||
}
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.DefaultAddressValidator;
|
||||
|
||||
public class Siacoin extends Coin {
|
||||
|
||||
public Siacoin() {
|
||||
super("Siacoin", "SC", new DefaultAddressValidator());
|
||||
}
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.DefaultAddressValidator;
|
||||
|
||||
public class Sibcoin extends Coin {
|
||||
|
||||
public Sibcoin() {
|
||||
super("Sibcoin", "SIB", new DefaultAddressValidator());
|
||||
}
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Base58BitcoinAddressValidator;
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.NetworkParametersAdapter;
|
||||
|
||||
public class SpeedCash extends Coin {
|
||||
|
||||
public SpeedCash() {
|
||||
super("SpeedCash", "SCS", new Base58BitcoinAddressValidator(new SpeedCashParams()));
|
||||
}
|
||||
|
||||
|
||||
public static class SpeedCashParams extends NetworkParametersAdapter {
|
||||
|
||||
public SpeedCashParams() {
|
||||
addressHeader = 63;
|
||||
p2shHeader = 85;
|
||||
acceptableAddressCodes = new int[]{addressHeader, p2shHeader};
|
||||
}
|
||||
}
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.RegexAddressValidator;
|
||||
|
||||
public class Stellite extends Coin {
|
||||
|
||||
public Stellite() {
|
||||
super("Stellite", "STL", new RegexAddressValidator("^(Se)\\d[0-9A-Za-z]{94}$"));
|
||||
}
|
||||
}
|
@ -1,56 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.AddressValidationResult;
|
||||
import bisq.asset.Base58BitcoinAddressValidator;
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.NetworkParametersAdapter;
|
||||
|
||||
public class Strayacoin extends Coin {
|
||||
|
||||
public Strayacoin() {
|
||||
super("Strayacoin", "NAH", new StrayacoinAddressValidator());
|
||||
}
|
||||
|
||||
|
||||
public static class StrayacoinAddressValidator extends Base58BitcoinAddressValidator {
|
||||
|
||||
public StrayacoinAddressValidator() {
|
||||
super(new StrayacoinParams());
|
||||
}
|
||||
|
||||
@Override
|
||||
public AddressValidationResult validate(String address) {
|
||||
if (!address.matches("^[S][a-zA-Z0-9]{26,34}$"))
|
||||
return AddressValidationResult.invalidStructure();
|
||||
|
||||
return super.validate(address);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class StrayacoinParams extends NetworkParametersAdapter {
|
||||
|
||||
public StrayacoinParams() {
|
||||
addressHeader = 63;
|
||||
p2shHeader = 50;
|
||||
acceptableAddressCodes = new int[]{addressHeader, p2shHeader};
|
||||
}
|
||||
}
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.RegexAddressValidator;
|
||||
|
||||
public class Tamadcoin extends Coin {
|
||||
|
||||
public Tamadcoin() {
|
||||
super("Tamadcoin", "TMC", new RegexAddressValidator("^ax[A-Z][0-9ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{1,97}$"));
|
||||
}
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Base58BitcoinAddressValidator;
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.NetworkParametersAdapter;
|
||||
|
||||
public class Terracoin extends Coin {
|
||||
|
||||
public Terracoin() {
|
||||
super("Terracoin", "TRC", new Base58BitcoinAddressValidator(new TerracoinParams()));
|
||||
}
|
||||
|
||||
|
||||
public static class TerracoinParams extends NetworkParametersAdapter {
|
||||
|
||||
public TerracoinParams() {
|
||||
super();
|
||||
addressHeader = 0;
|
||||
p2shHeader = 5;
|
||||
acceptableAddressCodes = new int[]{addressHeader, p2shHeader};
|
||||
}
|
||||
}
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.RegexAddressValidator;
|
||||
|
||||
public class Ubiq extends Coin {
|
||||
|
||||
public Ubiq() {
|
||||
super("Ubiq", "UBQ", new RegexAddressValidator("^(0x)?[0-9a-fA-F]{40}$"));
|
||||
}
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.RegexAddressValidator;
|
||||
|
||||
public class VDinar extends Coin {
|
||||
|
||||
public VDinar() {
|
||||
super("vDinar", "VDN", new RegexAddressValidator("^[D][0-9a-zA-Z]{33}$"));
|
||||
}
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Base58BitcoinAddressValidator;
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.NetworkParametersAdapter;
|
||||
|
||||
public class Wacoin extends Coin {
|
||||
|
||||
public Wacoin() {
|
||||
super("WACoins", "WAC", new Base58BitcoinAddressValidator(new WacoinParams()));
|
||||
}
|
||||
|
||||
|
||||
public static class WacoinParams extends NetworkParametersAdapter {
|
||||
|
||||
public WacoinParams() {
|
||||
super();
|
||||
addressHeader = 73;
|
||||
p2shHeader = 3;
|
||||
acceptableAddressCodes = new int[]{addressHeader, p2shHeader};
|
||||
}
|
||||
}
|
||||
}
|
@ -1,269 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.AddressValidationResult;
|
||||
import bisq.asset.AddressValidator;
|
||||
import bisq.asset.Base58BitcoinAddressValidator;
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.NetworkParametersAdapter;
|
||||
|
||||
import org.bitcoinj.core.AddressFormatException;
|
||||
import org.bitcoinj.core.NetworkParameters;
|
||||
import org.bitcoinj.core.VersionedChecksummedBytes;
|
||||
import org.bitcoinj.params.Networks;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Locale;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class WorldMobileCoin extends Coin {
|
||||
|
||||
public WorldMobileCoin() {
|
||||
super("WorldMobileCoin", "WMCC", new WorldMobileCoinAddressValidator());
|
||||
}
|
||||
|
||||
|
||||
public static class WorldMobileCoinAddressValidator implements AddressValidator {
|
||||
|
||||
private final Base58BitcoinAddressValidator base58BitcoinAddressValidator;
|
||||
private final NetworkParameters networkParameters;
|
||||
|
||||
public WorldMobileCoinAddressValidator() {
|
||||
networkParameters = new WorldMobileCoinParams();
|
||||
base58BitcoinAddressValidator = new Base58BitcoinAddressValidator(networkParameters);
|
||||
}
|
||||
|
||||
public AddressValidationResult validate(String address) {
|
||||
if (!isLowerCase(address)) {
|
||||
return base58BitcoinAddressValidator.validate(address);
|
||||
}
|
||||
|
||||
try {
|
||||
WitnessAddress.fromBech32(networkParameters, address);
|
||||
} catch (AddressFormatException ex) {
|
||||
return AddressValidationResult.invalidAddress(ex);
|
||||
}
|
||||
|
||||
return AddressValidationResult.validAddress();
|
||||
}
|
||||
|
||||
private static boolean isLowerCase(String str) {
|
||||
char ch;
|
||||
for (int i = 0; i < str.length(); i++) {
|
||||
ch = str.charAt(i);
|
||||
if (Character.isDigit(ch))
|
||||
continue;
|
||||
if (!Character.isLowerCase(ch))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static class WorldMobileCoinParams extends NetworkParametersAdapter {
|
||||
|
||||
public WorldMobileCoinParams() {
|
||||
addressHeader = 0x49;
|
||||
p2shHeader = 0x4b;
|
||||
acceptableAddressCodes = new int[]{addressHeader, p2shHeader};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static class WitnessAddress extends VersionedChecksummedBytes {
|
||||
static final int PROGRAM_LENGTH_PKH = 20;
|
||||
static final int PROGRAM_LENGTH_SH = 32;
|
||||
static final int PROGRAM_MIN_LENGTH = 2;
|
||||
static final int PROGRAM_MAX_LENGTH = 40;
|
||||
static final String WITNESS_ADDRESS_HRP = "wc";
|
||||
|
||||
private WitnessAddress(NetworkParameters params, byte[] data) throws AddressFormatException {
|
||||
super(params.getAddressHeader(), data);
|
||||
if (data.length < 1)
|
||||
throw new AddressFormatException("Zero data found");
|
||||
final int version = getWitnessVersion();
|
||||
if (version < 0 || version > 16)
|
||||
throw new AddressFormatException("Invalid script version: " + version);
|
||||
byte[] program = getWitnessProgram();
|
||||
if (program.length < PROGRAM_MIN_LENGTH || program.length > PROGRAM_MAX_LENGTH)
|
||||
throw new AddressFormatException("Invalid length: " + program.length);
|
||||
if (version == 0 && program.length != PROGRAM_LENGTH_PKH
|
||||
&& program.length != PROGRAM_LENGTH_SH)
|
||||
throw new AddressFormatException(
|
||||
"Invalid length for address version 0: " + program.length);
|
||||
}
|
||||
|
||||
int getWitnessVersion() {
|
||||
return bytes[0] & 0xff;
|
||||
}
|
||||
|
||||
byte[] getWitnessProgram() {
|
||||
return convertBits(bytes, 1, bytes.length - 1, 5, 8, false);
|
||||
}
|
||||
|
||||
static WitnessAddress fromBech32(@Nullable NetworkParameters params, String bech32)
|
||||
throws AddressFormatException {
|
||||
Bech32.Bech32Data bechData = Bech32.decode(bech32);
|
||||
if (params == null) {
|
||||
for (NetworkParameters p : Networks.get()) {
|
||||
if (bechData.hrp.equals(WITNESS_ADDRESS_HRP))
|
||||
return new WitnessAddress(p, bechData.data);
|
||||
}
|
||||
throw new AddressFormatException("Invalid Prefix: No network found for " + bech32);
|
||||
} else {
|
||||
if (bechData.hrp.equals(WITNESS_ADDRESS_HRP))
|
||||
return new WitnessAddress(params, bechData.data);
|
||||
throw new AddressFormatException("Wrong Network: " + bechData.hrp);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper
|
||||
*/
|
||||
private static byte[] convertBits(final byte[] in, final int inStart, final int inLen, final int fromBits,
|
||||
final int toBits, final boolean pad) throws AddressFormatException {
|
||||
int acc = 0;
|
||||
int bits = 0;
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream(64);
|
||||
final int maxv = (1 << toBits) - 1;
|
||||
final int max_acc = (1 << (fromBits + toBits - 1)) - 1;
|
||||
for (int i = 0; i < inLen; i++) {
|
||||
int value = in[i + inStart] & 0xff;
|
||||
if ((value >>> fromBits) != 0) {
|
||||
throw new AddressFormatException(
|
||||
String.format("Input value '%X' exceeds '%d' bit size", value, fromBits));
|
||||
}
|
||||
acc = ((acc << fromBits) | value) & max_acc;
|
||||
bits += fromBits;
|
||||
while (bits >= toBits) {
|
||||
bits -= toBits;
|
||||
out.write((acc >>> bits) & maxv);
|
||||
}
|
||||
}
|
||||
if (pad) {
|
||||
if (bits > 0)
|
||||
out.write((acc << (toBits - bits)) & maxv);
|
||||
} else if (bits >= fromBits || ((acc << (toBits - bits)) & maxv) != 0) {
|
||||
throw new AddressFormatException("Could not convert bits, invalid padding");
|
||||
}
|
||||
return out.toByteArray();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static class Bech32 {
|
||||
private static final byte[] CHARSET_REV = {
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 15, -1, 10, 17,
|
||||
21, 20, 26, 30, 7, 5, -1, -1, -1, -1, -1, -1, -1, 29, -1, 24, 13, 25, 9, 8, 23, -1, 18, 22, 31, 27, 19,
|
||||
-1, 1, 0, 3, 16, 11, 28, 12, 14, 6, 4, 2, -1, -1, -1, -1, -1, -1, 29, -1, 24, 13, 25, 9, 8, 23, -1, 18,
|
||||
22, 31, 27, 19, -1, 1, 0, 3, 16, 11, 28, 12, 14, 6, 4, 2, -1, -1, -1, -1, -1
|
||||
};
|
||||
|
||||
static class Bech32Data {
|
||||
final String hrp;
|
||||
final byte[] data;
|
||||
|
||||
private Bech32Data(final String hrp, final byte[] data) {
|
||||
this.hrp = hrp;
|
||||
this.data = data;
|
||||
}
|
||||
}
|
||||
|
||||
private static int polymod(final byte[] values) {
|
||||
int c = 1;
|
||||
for (byte v_i : values) {
|
||||
int c0 = (c >>> 25) & 0xff;
|
||||
c = ((c & 0x1ffffff) << 5) ^ (v_i & 0xff);
|
||||
if ((c0 & 1) != 0) c ^= 0x3b6a57b2;
|
||||
if ((c0 & 2) != 0) c ^= 0x26508e6d;
|
||||
if ((c0 & 4) != 0) c ^= 0x1ea119fa;
|
||||
if ((c0 & 8) != 0) c ^= 0x3d4233dd;
|
||||
if ((c0 & 16) != 0) c ^= 0x2a1462b3;
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
private static byte[] expandHrp(final String hrp) {
|
||||
int len = hrp.length();
|
||||
byte ret[] = new byte[len * 2 + 1];
|
||||
for (int i = 0; i < len; ++i) {
|
||||
int c = hrp.charAt(i) & 0x7f;
|
||||
ret[i] = (byte) ((c >>> 5) & 0x07);
|
||||
ret[i + len + 1] = (byte) (c & 0x1f);
|
||||
}
|
||||
ret[len] = 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
private static boolean verifyChecksum(final String hrp, final byte[] values) {
|
||||
byte[] exp = expandHrp(hrp);
|
||||
byte[] combined = new byte[exp.length + values.length];
|
||||
System.arraycopy(exp, 0, combined, 0, exp.length);
|
||||
System.arraycopy(values, 0, combined, exp.length, values.length);
|
||||
return polymod(combined) == 1;
|
||||
}
|
||||
|
||||
public static Bech32Data decode(final String str) throws AddressFormatException {
|
||||
boolean lower = false, upper = false;
|
||||
int len = str.length();
|
||||
if (len < 8)
|
||||
throw new AddressFormatException("Input too short: " + len);
|
||||
if (len > 90)
|
||||
throw new AddressFormatException("Input too long: " + len);
|
||||
for (int i = 0; i < len; ++i) {
|
||||
char c = str.charAt(i);
|
||||
if (c < 33 || c > 126) throw new AddressFormatException(invalidChar(c, i));
|
||||
if (c >= 'a' && c <= 'z') {
|
||||
if (upper)
|
||||
throw new AddressFormatException(invalidChar(c, i));
|
||||
lower = true;
|
||||
}
|
||||
if (c >= 'A' && c <= 'Z') {
|
||||
if (lower)
|
||||
throw new AddressFormatException(invalidChar(c, i));
|
||||
upper = true;
|
||||
}
|
||||
}
|
||||
final int pos = str.lastIndexOf('1');
|
||||
if (pos < 1) throw new AddressFormatException("Invalid Prefix: Missing human-readable part");
|
||||
final int dataLen = len - 1 - pos;
|
||||
if (dataLen < 6) throw new AddressFormatException("Data part too short: " + dataLen);
|
||||
byte[] values = new byte[dataLen];
|
||||
for (int i = 0; i < dataLen; ++i) {
|
||||
char c = str.charAt(i + pos + 1);
|
||||
if (CHARSET_REV[c] == -1) throw new AddressFormatException(invalidChar(c, i + pos + 1));
|
||||
values[i] = CHARSET_REV[c];
|
||||
}
|
||||
String hrp = str.substring(0, pos).toLowerCase(Locale.ROOT);
|
||||
if (!verifyChecksum(hrp, values)) throw new AddressFormatException("Invalid Checksum");
|
||||
return new Bech32Data(hrp, Arrays.copyOfRange(values, 0, values.length - 6));
|
||||
}
|
||||
|
||||
private static String invalidChar(char c, int i) {
|
||||
return "Invalid character '" + Character.toString(c) + "' at position " + i;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.RegexAddressValidator;
|
||||
|
||||
public class Wownero extends Coin {
|
||||
|
||||
public Wownero() {
|
||||
super("Wownero", "WOW", new RegexAddressValidator("^(Wo)\\d[0-9A-Za-z]{94}$"));
|
||||
}
|
||||
}
|
@ -1,57 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.AddressValidationResult;
|
||||
import bisq.asset.Base58BitcoinAddressValidator;
|
||||
import bisq.asset.Coin;
|
||||
import bisq.asset.NetworkParametersAdapter;
|
||||
|
||||
public class Xuez extends Coin {
|
||||
|
||||
public Xuez() {
|
||||
super("Xuez", "XUEZ", new XuezAddressValidator());
|
||||
}
|
||||
|
||||
|
||||
public static class XuezAddressValidator extends Base58BitcoinAddressValidator {
|
||||
|
||||
public XuezAddressValidator() {
|
||||
super(new XuezParams());
|
||||
}
|
||||
|
||||
@Override
|
||||
public AddressValidationResult validate(String address) {
|
||||
|
||||
if (!address.matches("^[X][a-km-zA-HJ-NP-Z1-9]{25,34}$"))
|
||||
return AddressValidationResult.invalidStructure();
|
||||
|
||||
return AddressValidationResult.validAddress();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class XuezParams extends NetworkParametersAdapter {
|
||||
|
||||
public XuezParams() {
|
||||
addressHeader = 48;
|
||||
p2shHeader = 12;
|
||||
acceptableAddressCodes = new int[]{addressHeader, p2shHeader};
|
||||
}
|
||||
}
|
||||
}
|
@ -1,87 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.AddressValidationResult;
|
||||
import bisq.asset.AddressValidator;
|
||||
import bisq.asset.Coin;
|
||||
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public class Yenten extends Coin {
|
||||
|
||||
public Yenten() {
|
||||
super("Yenten", "YTN", new YentenAddressValidator());
|
||||
}
|
||||
|
||||
|
||||
public static class YentenAddressValidator implements AddressValidator {
|
||||
|
||||
private final static String ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
|
||||
|
||||
public AddressValidationResult validate(String addr) {
|
||||
if (addr.length() != 34)
|
||||
return AddressValidationResult.invalidAddress("YTN_Addr_Invalid: Length must be 34!");
|
||||
if (!addr.startsWith("Y"))
|
||||
return AddressValidationResult.invalidAddress("YTN_Addr_Invalid: must start with 'Y'!");
|
||||
byte[] decoded = decodeBase58(addr);
|
||||
if (decoded == null)
|
||||
return AddressValidationResult.invalidAddress("YTN_Addr_Invalid: Base58 decoder error!");
|
||||
|
||||
byte[] hash = getSha256(decoded, 21, 2);
|
||||
if (hash == null || !Arrays.equals(Arrays.copyOfRange(hash, 0, 4), Arrays.copyOfRange(decoded, 21, 25)))
|
||||
return AddressValidationResult.invalidAddress("YTN_Addr_Invalid: Checksum error!");
|
||||
return AddressValidationResult.validAddress();
|
||||
}
|
||||
|
||||
private static byte[] decodeBase58(String input) {
|
||||
byte[] output = new byte[25];
|
||||
for (int i = 0; i < input.length(); i++) {
|
||||
char t = input.charAt(i);
|
||||
|
||||
int p = ALPHABET.indexOf(t);
|
||||
if (p == -1)
|
||||
return null;
|
||||
for (int j = 25 - 1; j >= 0; j--, p /= 256) {
|
||||
p += 58 * (output[j] & 0xFF);
|
||||
output[j] = (byte) (p % 256);
|
||||
}
|
||||
if (p != 0)
|
||||
return null;
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
private static byte[] getSha256(byte[] data, int len, int recursion) {
|
||||
if (recursion == 0)
|
||||
return data;
|
||||
|
||||
try {
|
||||
MessageDigest md = MessageDigest.getInstance("SHA-256");
|
||||
md.update(Arrays.copyOfRange(data, 0, len));
|
||||
return getSha256(md.digest(), 32, recursion - 1);
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.tokens;
|
||||
|
||||
import bisq.asset.Erc20Token;
|
||||
|
||||
public class BetterBetting extends Erc20Token {
|
||||
|
||||
public BetterBetting() {
|
||||
super("Better Betting", "BETR");
|
||||
}
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.tokens;
|
||||
|
||||
import bisq.asset.Erc20Token;
|
||||
|
||||
public class DaiStablecoin extends Erc20Token {
|
||||
|
||||
public DaiStablecoin() {
|
||||
super("Dai Stablecoin", "DAI");
|
||||
}
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.tokens;
|
||||
|
||||
import bisq.asset.Erc20Token;
|
||||
|
||||
public class Ellaism extends Erc20Token {
|
||||
|
||||
public Ellaism() {
|
||||
super("Ellaism", "ELLA");
|
||||
}
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.tokens;
|
||||
|
||||
import bisq.asset.Erc20Token;
|
||||
|
||||
public class Exceed extends Erc20Token {
|
||||
|
||||
public Exceed() {
|
||||
super("Exceed", "EXC");
|
||||
}
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.tokens;
|
||||
|
||||
import bisq.asset.Erc20Token;
|
||||
|
||||
public class GeoCoin extends Erc20Token {
|
||||
|
||||
public GeoCoin() {
|
||||
super("GeoCoin", "GEO");
|
||||
}
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.tokens;
|
||||
|
||||
import bisq.asset.Erc20Token;
|
||||
|
||||
public class Grans extends Erc20Token {
|
||||
|
||||
public Grans() {
|
||||
super("10grans", "GRANS");
|
||||
}
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.tokens;
|
||||
|
||||
import bisq.asset.Erc20Token;
|
||||
|
||||
public class Internext extends Erc20Token {
|
||||
|
||||
public Internext() {
|
||||
super("Internext", "INXT");
|
||||
}
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.tokens;
|
||||
|
||||
import bisq.asset.Erc20Token;
|
||||
|
||||
public class Movement extends Erc20Token {
|
||||
|
||||
public Movement() {
|
||||
super("The Movement", "MVT");
|
||||
}
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.tokens;
|
||||
|
||||
import bisq.asset.Erc20Token;
|
||||
|
||||
public class MyceliumToken extends Erc20Token {
|
||||
|
||||
public MyceliumToken() {
|
||||
super("Mycelium Token", "MT");
|
||||
}
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.tokens;
|
||||
|
||||
import bisq.asset.Erc20Token;
|
||||
|
||||
public class PascalCoin extends Erc20Token {
|
||||
|
||||
public PascalCoin() {
|
||||
super("Pascal Coin", "PASC");
|
||||
}
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.tokens;
|
||||
|
||||
import bisq.asset.Erc20Token;
|
||||
|
||||
public class PiedPiperCoin extends Erc20Token {
|
||||
|
||||
public PiedPiperCoin() {
|
||||
super("Pied Piper Coin", "PPI");
|
||||
}
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.tokens;
|
||||
|
||||
import bisq.asset.Erc20Token;
|
||||
|
||||
public class Qwark extends Erc20Token {
|
||||
|
||||
public Qwark() {
|
||||
super("Qwark", "QWARK");
|
||||
}
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.tokens;
|
||||
|
||||
import bisq.asset.Erc20Token;
|
||||
|
||||
public class RefToken extends Erc20Token {
|
||||
|
||||
public RefToken() {
|
||||
super("RefToken", "REF");
|
||||
}
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.tokens;
|
||||
|
||||
import bisq.asset.Erc20Token;
|
||||
|
||||
public class SosCoin extends Erc20Token {
|
||||
|
||||
public SosCoin() {
|
||||
super("SOS Coin", "SOS");
|
||||
}
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.tokens;
|
||||
|
||||
import bisq.asset.Erc20Token;
|
||||
|
||||
public class Verify extends Erc20Token {
|
||||
|
||||
public Verify() {
|
||||
super("Verify", "CRED");
|
||||
}
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.tokens;
|
||||
|
||||
import bisq.asset.Erc20Token;
|
||||
|
||||
public class WildToken extends Erc20Token {
|
||||
|
||||
public WildToken() {
|
||||
super("WILD Token", "WILD");
|
||||
}
|
||||
}
|
@ -2,84 +2,49 @@
|
||||
# Contents are sorted according to the output of `sort --ignore-case --dictionary-order`.
|
||||
# See bisq.asset.Asset and bisq.asset.AssetRegistry for further details.
|
||||
# See https://bisq.network/list-asset for complete instructions.
|
||||
bisq.asset.coins.Achievecoin
|
||||
bisq.asset.coins.Actinium
|
||||
bisq.asset.coins.Angelcoin
|
||||
bisq.asset.coins.Aquachain
|
||||
bisq.asset.coins.Arto
|
||||
bisq.asset.coins.BitCloud
|
||||
bisq.asset.coins.Bitcoin2
|
||||
bisq.asset.coins.BitcoinCash
|
||||
bisq.asset.coins.BitcoinClashic
|
||||
bisq.asset.coins.BitcoinCore
|
||||
bisq.asset.coins.BitcoinGold
|
||||
bisq.asset.coins.BitcoinInstant
|
||||
bisq.asset.coins.Bitcoin$Mainnet
|
||||
bisq.asset.coins.Bitcoin$Regtest
|
||||
bisq.asset.coins.Bitcoin$Testnet
|
||||
bisq.asset.coins.Bitcore
|
||||
bisq.asset.coins.BitDaric
|
||||
bisq.asset.coins.BitZeny
|
||||
bisq.asset.coins.Blur
|
||||
bisq.asset.coins.BSQ$Mainnet
|
||||
bisq.asset.coins.BSQ$Regtest
|
||||
bisq.asset.coins.BSQ$Testnet
|
||||
bisq.asset.coins.Burstcoin
|
||||
bisq.asset.coins.Byteball
|
||||
bisq.asset.coins.Cagecoin
|
||||
bisq.asset.coins.CassubianDetk
|
||||
bisq.asset.coins.Chaucha
|
||||
bisq.asset.coins.Conceal
|
||||
bisq.asset.coins.Counterparty
|
||||
bisq.asset.coins.Creativecoin
|
||||
bisq.asset.coins.Credits
|
||||
bisq.asset.coins.Croat
|
||||
bisq.asset.coins.Cryptonite
|
||||
bisq.asset.coins.Cryptonodes
|
||||
bisq.asset.coins.DACash
|
||||
bisq.asset.coins.DarkNet
|
||||
bisq.asset.coins.Dash$Mainnet
|
||||
bisq.asset.coins.Dash$Regtest
|
||||
bisq.asset.coins.Dash$Testnet
|
||||
bisq.asset.coins.Decent
|
||||
bisq.asset.coins.Decred
|
||||
bisq.asset.coins.DeepOnion
|
||||
bisq.asset.coins.Devcoin
|
||||
bisq.asset.coins.Diamond
|
||||
bisq.asset.coins.DigiMoney
|
||||
bisq.asset.coins.Dinero
|
||||
bisq.asset.coins.Dogecoin
|
||||
bisq.asset.coins.Dragonglass
|
||||
bisq.asset.coins.DRIP
|
||||
bisq.asset.coins.DSTRA
|
||||
bisq.asset.coins.DynamicCoin
|
||||
bisq.asset.coins.Espers
|
||||
bisq.asset.coins.Ether
|
||||
bisq.asset.coins.EtherClassic
|
||||
bisq.asset.coins.FuturoCoin
|
||||
bisq.asset.coins.Graft
|
||||
bisq.asset.coins.Gridcoin
|
||||
bisq.asset.coins.InfinityEconomics
|
||||
bisq.asset.coins.Instacash
|
||||
bisq.asset.coins.InternetOfPeople
|
||||
bisq.asset.coins.Kekcoin
|
||||
bisq.asset.coins.Koto
|
||||
bisq.asset.coins.Kumacoin
|
||||
bisq.asset.coins.LBRY
|
||||
bisq.asset.coins.Lisk
|
||||
bisq.asset.coins.LitecoinExtreme
|
||||
bisq.asset.coins.Litecoin$Mainnet
|
||||
bisq.asset.coins.Litecoin$Regtest
|
||||
bisq.asset.coins.Litecoin$Testnet
|
||||
bisq.asset.coins.Lobstex
|
||||
bisq.asset.coins.Loki
|
||||
bisq.asset.coins.Madbyte
|
||||
bisq.asset.coins.Madcoin
|
||||
bisq.asset.coins.MaidSafeCoin
|
||||
bisq.asset.coins.Mask
|
||||
bisq.asset.coins.MaxCoin
|
||||
bisq.asset.coins.Mazacoin
|
||||
bisq.asset.coins.MegaCoin
|
||||
bisq.asset.coins.MFCoin
|
||||
bisq.asset.coins.MicroCoin
|
||||
bisq.asset.coins.MobitGlobal
|
||||
bisq.asset.coins.Monero
|
||||
@ -87,80 +52,32 @@ bisq.asset.coins.Motion
|
||||
bisq.asset.coins.Myriadcoin
|
||||
bisq.asset.coins.Namecoin
|
||||
bisq.asset.coins.Nano
|
||||
bisq.asset.coins.NavCoin
|
||||
bisq.asset.coins.NEETCOIN
|
||||
bisq.asset.coins.Neos
|
||||
bisq.asset.coins.NewPowerCoin
|
||||
bisq.asset.coins.Nilu
|
||||
bisq.asset.coins.Nimiq
|
||||
bisq.asset.coins.NuBits
|
||||
bisq.asset.coins.Nxt
|
||||
bisq.asset.coins.Obsidian
|
||||
bisq.asset.coins.Octocoin
|
||||
bisq.asset.coins.Particl
|
||||
bisq.asset.coins.PepeCash
|
||||
bisq.asset.coins.Phore
|
||||
bisq.asset.coins.PIVX
|
||||
bisq.asset.coins.PostCoin
|
||||
bisq.asset.coins.Pranacoin
|
||||
bisq.asset.coins.PRiVCY
|
||||
bisq.asset.coins.PZDC
|
||||
bisq.asset.coins.QMCoin
|
||||
bisq.asset.coins.QRL
|
||||
bisq.asset.coins.Radium
|
||||
bisq.asset.coins.ReddCoin
|
||||
bisq.asset.coins.Ringo
|
||||
bisq.asset.coins.Roicoin
|
||||
bisq.asset.coins.Ryo
|
||||
bisq.asset.coins.SafeFileSystemCoin
|
||||
bisq.asset.coins.Semux
|
||||
bisq.asset.coins.Siacoin
|
||||
bisq.asset.coins.Siafund
|
||||
bisq.asset.coins.Sibcoin
|
||||
bisq.asset.coins.Spectrecoin
|
||||
bisq.asset.coins.SpeedCash
|
||||
bisq.asset.coins.Starwels
|
||||
bisq.asset.coins.STEEM
|
||||
bisq.asset.coins.Stellite
|
||||
bisq.asset.coins.Strayacoin
|
||||
bisq.asset.coins.SUB1X
|
||||
bisq.asset.coins.Tamadcoin
|
||||
bisq.asset.coins.Terracoin
|
||||
bisq.asset.coins.Triton
|
||||
bisq.asset.coins.TurtleCoin
|
||||
bisq.asset.coins.Ubiq
|
||||
bisq.asset.coins.Unobtanium
|
||||
bisq.asset.coins.VDinar
|
||||
bisq.asset.coins.Wacoin
|
||||
bisq.asset.coins.Wavi
|
||||
bisq.asset.coins.WorldMobileCoin
|
||||
bisq.asset.coins.Wownero
|
||||
bisq.asset.coins.Xuez
|
||||
bisq.asset.coins.Yenten
|
||||
bisq.asset.coins.Zcash
|
||||
bisq.asset.coins.Zcoin
|
||||
bisq.asset.coins.ZenCash
|
||||
bisq.asset.coins.Zero
|
||||
bisq.asset.coins.ZeroOneCoin
|
||||
bisq.asset.tokens.BetterBetting
|
||||
bisq.asset.tokens.DaiStablecoin
|
||||
bisq.asset.tokens.Ellaism
|
||||
bisq.asset.tokens.EtherStone
|
||||
bisq.asset.tokens.Exceed
|
||||
bisq.asset.tokens.GeoCoin
|
||||
bisq.asset.tokens.Grans
|
||||
bisq.asset.tokens.GreenBlockCoin
|
||||
bisq.asset.tokens.Internext
|
||||
bisq.asset.tokens.LikeCoin
|
||||
bisq.asset.tokens.Movement
|
||||
bisq.asset.tokens.MyceliumToken
|
||||
bisq.asset.tokens.PascalCoin
|
||||
bisq.asset.tokens.PiedPiperCoin
|
||||
bisq.asset.tokens.Pix
|
||||
bisq.asset.tokens.PixelPropertyToken
|
||||
bisq.asset.tokens.Qwark
|
||||
bisq.asset.tokens.RefToken
|
||||
bisq.asset.tokens.SosCoin
|
||||
bisq.asset.tokens.Tari
|
||||
bisq.asset.tokens.Verify
|
||||
bisq.asset.tokens.WildToken
|
||||
|
@ -1,43 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.AbstractAssetTest;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class AchievecoinTest extends AbstractAssetTest {
|
||||
|
||||
public AchievecoinTest() {
|
||||
super(new Achievecoin());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testValidAddresses() {
|
||||
assertValidAddress("AciV7ZyJDpCg7kGGmbo97VjgjpVZkXRTMD");
|
||||
assertValidAddress("ARhW8anWaZtExdK2cQkBwsvsQZ9TkC9bwH");
|
||||
assertValidAddress("AcxpGTWX4zFiD8p8hfYw99RXV7MY2y8hs9");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInvalidAddresses() {
|
||||
assertInvalidAddress("GWaSW6PHfQKBv8EXV3xiqGG2zxKZh4XYNu");
|
||||
assertInvalidAddress("AcxpGTWX4zFiD8p8hfY099RXV7MY2y8hs9");
|
||||
assertInvalidAddress("17VZNX1SN5NtKa8UQFxwQbFeFc3iqRYhem");
|
||||
}
|
||||
}
|
@ -1,44 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.AbstractAssetTest;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class AngelcoinTest extends AbstractAssetTest {
|
||||
|
||||
public AngelcoinTest() {
|
||||
super(new Angelcoin());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testValidAddresses() {
|
||||
assertValidAddress("AQJTNtWcP7opxuR52Lf5vmoQTC8EHQ6GxV");
|
||||
assertValidAddress("ALEK7jttmqtx2ZhXHg69Zr426qKBnzYA9E");
|
||||
assertValidAddress("AP1egWUthPoYvZL57aBk4RPqUgjG1fJGn6");
|
||||
assertValidAddress("AST3zfvPdZ35npxAVC8ABgVCxxDLwTmAHU");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInvalidAddresses() {
|
||||
assertInvalidAddress("1AQJTNtWcP7opxuR52Lf5vmoQTC8EHQ6GxV");
|
||||
assertInvalidAddress("1ALEK7jttmqtx2ZhXHg69Zr426qKBnzYA9E");
|
||||
assertInvalidAddress("1AP1egWUthPoYvZL57aBk4RPqUgjG1fJGn6");
|
||||
}
|
||||
}
|
@ -1,42 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.AbstractAssetTest;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class ArtoTest extends AbstractAssetTest {
|
||||
|
||||
public ArtoTest() {
|
||||
super(new Arto());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testValidAddresses() {
|
||||
assertValidAddress("AHT1tiauD1GKvLnSL2RVuug1arn3cvFYw7PX5cUmCkM9MHuBn8yrGoHGHXP8ZV9FUR5Y5ntvhanwCMp8FK5bmLrqKxq7BRj");
|
||||
assertValidAddress("AKQqctWaaX3gdtQ54kUZAFhGimquK83i2VEKPituFyZiJnwB5RqRrvtSK24yN8AizhhDvHX8CvkJkRrZtUAYScgRJsDE1jH");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInvalidAddresses() {
|
||||
assertInvalidAddress("AHT1tiauD1GKvLnSL2RVuug1arn3cvFYw7PX5cUmCkM9MHuBn8yrGoHGHXP8ZV9FUR5Y5ntvhanwCMp8FK5bmLrqKxq7BR");
|
||||
assertInvalidAddress("BKQqctWaaX3gdtQ54kUZAFhGimquK83i2VEKPituFyZiJnwB5RqRrvtSK24yN8AizhhDvHX8CvkJkRrZtUAYScgRJsDE1jH");
|
||||
assertInvalidAddress("AHT1tiauD1GKvLnSL2RVuug1arn3cvFYw7PX5cUmCkM9MHuBn8yrGoHGHXP8ZV9FUR5Y5ntvhanwCMp8FK5bmLrqKxq7BRjy");
|
||||
}
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.AbstractAssetTest;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class BitDaricTest extends AbstractAssetTest {
|
||||
|
||||
public BitDaricTest() {
|
||||
super(new BitDaric());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testValidAddresses() {
|
||||
assertValidAddress("RN8spHmkV6ZtRsquaTJMRZJujRQkkDNh2G");
|
||||
assertValidAddress("RTD9jtKybd7TeM597t5MkNof84GPka34R7");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInvalidAddresses() {
|
||||
assertInvalidAddress("LAPc1FumbYifKpfBpGbRLuPcLAJwHUxeyu");
|
||||
assertInvalidAddress("ROPc1FumbYifKpfBpGbRLuPcLAJwHUxeyu");
|
||||
assertInvalidAddress("rN8spHmkV6ZtROquaTJMRZJujRQkkDNh2G");
|
||||
assertInvalidAddress("1NxrMzHCjG8X9kqTEZBXUNB5PC58DSXAht");
|
||||
}
|
||||
}
|
@ -1,42 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.AbstractAssetTest;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class BitZenyTest extends AbstractAssetTest {
|
||||
|
||||
public BitZenyTest() {
|
||||
super(new BitZeny());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testValidAddresses() {
|
||||
assertValidAddress("ZryVTPGwpWMrWiqBhcje9NJJku3RgUmVrH");
|
||||
assertValidAddress("3CB2kwzn245gaCSfkc7wbe2Myq2kDuQmpu");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInvalidAddresses() {
|
||||
assertInvalidAddress("ZryVTPGwpWMrWiqBhcje9NJJku3RgUmVrHH");
|
||||
assertInvalidAddress("ZryVTPGwpWMrWiqBhcje9NJJku3RgUmVr");
|
||||
assertInvalidAddress("3CB2kwzn245gaCSfkc7wbe2Myq2kDuQmpu#");
|
||||
}
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.AbstractAssetTest;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class BitcoinGoldTest extends AbstractAssetTest {
|
||||
|
||||
public BitcoinGoldTest() {
|
||||
super(new BitcoinGold());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testValidAddresses() {
|
||||
assertValidAddress("AehvQ57Fp168uY592LCUYBbyNEpiRAPufb");
|
||||
assertValidAddress("GWaSW6PHfQKBv8EXV3xiqGG2zxKZh4XYNu");
|
||||
assertValidAddress("GLpT8yG2kwPMdMfgwekG6tEAa91PSmN4ZC");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInvalidAddresses() {
|
||||
assertInvalidAddress("GVTPWDVJgLxo5ZYSPXPDxE4s7LE5cLRwCc1");
|
||||
assertInvalidAddress("1GVTPWDVJgLxo5ZYSPXPDxE4s7LE5cLRwCc");
|
||||
assertInvalidAddress("1HQQgsvLTgN9xD9hNmAgAreakzVzQUSLSH");
|
||||
}
|
||||
}
|
@ -1,44 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.AbstractAssetTest;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class BitcoreTest extends AbstractAssetTest {
|
||||
|
||||
public BitcoreTest() {
|
||||
super(new Bitcore());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testValidAddresses() {
|
||||
assertValidAddress("17VZNX1SN5NtKa8UQFxwQbFeFc3iqRYhem");
|
||||
assertValidAddress("3EktnHQD7RiAE6uzMj2ZifT9YgRrkSgzQX");
|
||||
assertValidAddress("1111111111111111111114oLvT2");
|
||||
assertValidAddress("1BitcoinEaterAddressDontSendf59kuE");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInvalidAddresses() {
|
||||
assertInvalidAddress("17VZNX1SN5NtKa8UQFxwQbFeFc3iqRYhemqq");
|
||||
assertInvalidAddress("17VZNX1SN5NtKa8UQFxwQbFeFc3iqRYheO");
|
||||
assertInvalidAddress("17VZNX1SN5NtKa8UQFxwQbFeFc3iqRYhek#");
|
||||
}
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.AbstractAssetWithDefaultValidatorTest;
|
||||
|
||||
public class BurstcoinTest extends AbstractAssetWithDefaultValidatorTest {
|
||||
|
||||
public BurstcoinTest() {
|
||||
super(new Burstcoin());
|
||||
}
|
||||
}
|
@ -1,44 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.AbstractAssetTest;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class CagecoinTest extends AbstractAssetTest {
|
||||
|
||||
public CagecoinTest() {
|
||||
super(new Cagecoin());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testValidAddresses() {
|
||||
assertValidAddress("Db97PgfdBDhXk8DmrDhrUPyydTCELn8YSb");
|
||||
assertValidAddress("DYV4h7MTsQ91jqzbg94GFAAUbgdK7RZmpG");
|
||||
assertValidAddress("Db5y8iKtZ24DqgYpP2G8685vTWEvk3WACC");
|
||||
assertValidAddress("DjiQbPuBLJcVYUtzYMuFuzDwDYwb9mVhaK");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInvalidAddresses() {
|
||||
assertInvalidAddress("17VZNX1SN5NtKa8UQFxwQbFeFc3iqRYhemqq");
|
||||
assertInvalidAddress("0x2a65Aca4D5fC5B5C859090a6c34d1641353982266");
|
||||
assertInvalidAddress("DNkkfdUvkCDiywYE98MTVp9nQJTgeZAiFr");
|
||||
}
|
||||
}
|
@ -1,46 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.AbstractAssetTest;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class CassubianDetkTest extends AbstractAssetTest {
|
||||
|
||||
public CassubianDetkTest() {
|
||||
super(new CassubianDetk());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testValidAddresses() {
|
||||
assertValidAddress("DM7BjopQ3bGYxSPZ4yhfttxqnDrEkyc3sw");
|
||||
assertValidAddress("DB4CaJ81SiT3VtpGC8K1RMirPJZjsmKiZd");
|
||||
assertValidAddress("DE7uB1mws1RwYNDPpfEnQ7a4i9tdqqV1Lf");
|
||||
assertValidAddress("DJ8FnzVCa8AXEBt5aqPcJubKRzanQKvxkY");
|
||||
assertValidAddress("D5QmzfBjwrUyAKtvectJL7kBawfWtwdJqz");
|
||||
assertValidAddress("DDRJemKbVtTVV8r2jSG9wevv3JeUj2edAr");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInvalidAddresses() {
|
||||
assertInvalidAddress("17VZNX1SN5NtKa8UQFxwQbFeFc3iqRYhemqq");
|
||||
assertInvalidAddress("0x2a65Aca4D5fC5B5C859090a6c34d1641353982266");
|
||||
assertInvalidAddress("SSnwqFBiyqK1n4BV7kPX86iesev2NobhEo");
|
||||
}
|
||||
}
|
@ -1,48 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.AbstractAssetTest;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class ConcealTest extends AbstractAssetTest {
|
||||
|
||||
public ConcealTest() {
|
||||
super(new Conceal());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testValidAddresses() {
|
||||
assertValidAddress("ccx7EmJzRoQ1CaQKxrJZSL87pT2MEcj2BTVAoznrnaLmUEnvBGSh5RrBngsJS4qa1N8daS7fy6gVgYwj8Ao5H6YQ8vqwDAq8P5");
|
||||
assertValidAddress("ccx7Xd3NBbBiQNvv7vMLXmGMHyS8AVB6EhWoHo5EbGfR2Ki9pQnRTfEBt3YxYEVqpUCyJgvPjBYHp8N2yZwA7dqb4PjaGWuvs4");
|
||||
assertValidAddress("ccx7XzWDecUfTRKbkXwENTGr53Q9tWNdwGF7C7Nj9ZFybHxEw2DxPeuKgJrzscFKi917SG5wL5AYHGFUrMDqSPnC5Apr8KwbD6");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInvalidAddresses() {
|
||||
assertInvalidAddress("CCX7EmJzRoQ1CaQKxrJZSL87pT2MEcj2BTVAoznrnaLmUEnvBGSh5RrBngsJS4qa1N8daS7fy6gVgYwj8Ao5H6YQ8vqwDAq8P5");
|
||||
assertInvalidAddress("ccx6EmJzRoQ1CaQKxrJZSL87pT2MEcj2BTVAoznrnaLmUEnvBGSh5RrBngsJS4qa1N8daS7fy6gVgYwj8Ao5H6YQ8vqwDAq8P5");
|
||||
assertInvalidAddress("ccx7EmJzRoQ1CaQKxrJZSL87pT2MEcj2BTVAoznrnaLmUEnvBGSh5RrBngsJS4qa1N8daS7fy6gVgYwj8Ao5H6YQ8vqwDAq8P5x");
|
||||
assertInvalidAddress("ccx7EmJzRoQ1CaQKxrJZSL87pT2MEcj2BTVAoznrnaLmUEnvBGSh5RrBngsJS4qa1N8daS7fy6gVgYwj8Ao5H6YQ8vqwDAq8P");
|
||||
assertInvalidAddress("ccx7EmJzRoQ1CaQKxrJZSL87pT2MEcj2BTVAoznrnaLmUEnvBGSh5RrBngsJS4qa1N8daS7fy6gVgYwj8Ao5H6YQ8vqwDAq8P0");
|
||||
assertInvalidAddress("ccx7EmJzRoQ1CaQKxrJZSL87pT2MEcj2BTVAoznrnaLmUEnvBGSh5RrBngsJS4qa1N8daS7fy6gVgYwj8Ao5H6YQ8vqwDAq8PO");
|
||||
assertInvalidAddress("ccx7EmJzRoQ1CaQKxrJZSL87pT2MEcj2BTVAoznrnaLmUEnvBGSh5RrBngsJS4qa1N8daS7fy6gVgYwj8Ao5H6YQ8vqwDAq8PI");
|
||||
assertInvalidAddress("ccx7EmJzRoQ1CaQKxrJZSL87pT2MEcj2BTVAoznrnaLmUEnvBGSh5RrBngsJS4qa1N8daS7fy6gVgYwj8Ao5H6YQ8vqwDAq8Pl");
|
||||
}
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.AbstractAssetTest;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class CreativecoinTest extends AbstractAssetTest {
|
||||
|
||||
public CreativecoinTest() {
|
||||
super(new Creativecoin());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testValidAddresses() {
|
||||
assertValidAddress("CGjh99QdHxCE6g9pGUucCJNeUyQPRJr4fE");
|
||||
assertValidAddress("FTDYi4GoD3vFYFhEGbuifSZjs6udXVin7B");
|
||||
assertValidAddress("361uBxJvmg6f62dMYVM9b7GeR38phkkTyA");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInvalidAddresses() {
|
||||
assertInvalidAddress("C7VZNX1SN5NtKa8UQFxwQbFeFc3iqRYhemqq");
|
||||
assertInvalidAddress("F7VZNX1SN5NtKa8UQFxwQbFeFc3iqRYheO");
|
||||
assertInvalidAddress("17VZNX1SN5NtKa8UQFxwQbFeFc3iqRYhek#");
|
||||
}
|
||||
}
|
@ -1,49 +0,0 @@
|
||||
/*
|
||||
* 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 bisq.asset.coins;
|
||||
|
||||
import bisq.asset.AbstractAssetTest;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class CryptoniteTest extends AbstractAssetTest {
|
||||
|
||||
public CryptoniteTest() {
|
||||
super(new Cryptonite());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testValidAddresses() {
|
||||
assertValidAddress("CT49DTNo5itqYoAD6XTGyTKbe8z5nGY2D5");
|
||||
assertValidAddress("CGTta3M4t3yXu8uRgkKvaWd2d8DQvDPnpL");
|
||||
assertValidAddress("Cco3zGiEJMyz3wrndEr6wg5cm1oUAbBoR2");
|
||||
assertValidAddress("CPzmjGCDEdQuRffmbpkrYQtSiUAm4oZJgt");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInvalidAddresses() {
|
||||
assertInvalidAddress("CT49DTNo5itqYoAD6XTGyTKbe8z5nGY2D4");
|
||||
assertInvalidAddress("CGTta3M4t3yXu8uRgkKvaWd2d8DQvDPnpl");
|
||||
assertInvalidAddress("Cco3zGiEJMyz3wrndEr6wg5cm1oUAbBoR1");
|
||||
assertInvalidAddress("CPzmjGCDEdQuRffmbpkrYQtSiUAm4oZJgT");
|
||||
assertInvalidAddress("CT49DTNo5itqYoAD6XTGyTKbe8z5nGY2Da");
|
||||
assertInvalidAddress("asdasd");
|
||||
assertInvalidAddress("cT49DTNo5itqYoAD6XTGyTKbe8z5nGY2Da");
|
||||
assertInvalidAddress("No5itqYoAD6XTGyTKbe8z5nGY2Da");
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user