mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-17 05:41:29 +02:00
CWA-153 | fixed validation for ada and nano
This commit is contained in:
+1
-3
@@ -87,6 +87,4 @@ cw_monero/cw_monero/android/.cxx/
|
||||
android/key.properties
|
||||
|
||||
**/tool/.secrets-prod.json
|
||||
**/lib/.secrets.g.dart
|
||||
|
||||
**/lib/generated/i18n.dart
|
||||
**/lib/.secrets.g.dart
|
||||
@@ -45,9 +45,9 @@ abstract class AddressBookStoreBase with Store {
|
||||
}
|
||||
|
||||
void validateAddress(String value, {CryptoCurrency cryptoCurrency}) {
|
||||
// XMR (95), ADA (105), BCH (42), BNB (42), BTC (34, 42), DASH (34), EOS (42),
|
||||
// XMR (95), ADA (59, 92, 105), BCH (42), BNB (42), BTC (34, 42), DASH (34), EOS (42),
|
||||
// ETH (42), LTC (34), NANO (64, 65), TRX (34), USDT (42), XLM (56), XRP (34)
|
||||
const pattern = '^[0-9a-zA-Z]{95}\$|^[0-9a-zA-Z]{34}\$|^[0-9a-zA-Z]{42}\$|^[0-9a-zA-Z]{56}\$|^[0-9a-zA-Z]{64}\$|^[0-9a-zA-Z]{65}\$|^[0-9a-zA-Z]{105}\$';
|
||||
const pattern = '^[0-9a-zA-Z]{95}\$|^[0-9a-zA-Z]{34}\$|^[0-9a-zA-Z]{42}\$|^[0-9a-zA-Z]{56}\$|^[0-9a-zA-Z]{59}\$|^[0-9a-zA-Z]{64}\$|^[0-9a-zA-Z]{65}\$|^[0-9a-zA-Z]{92}\$|^[0-9a-zA-Z]{105}\$';
|
||||
final regExp = RegExp(pattern);
|
||||
isValid = regExp.hasMatch(value);
|
||||
if (isValid && cryptoCurrency != null) {
|
||||
@@ -56,7 +56,7 @@ abstract class AddressBookStoreBase with Store {
|
||||
isValid = (value.length == 95);
|
||||
break;
|
||||
case CryptoCurrency.ada:
|
||||
isValid = (value.length == 105);
|
||||
isValid = (value.length == 59)||(value.length == 92)||(value.length == 105);
|
||||
break;
|
||||
case CryptoCurrency.bch:
|
||||
isValid = (value.length == 42);
|
||||
|
||||
@@ -226,9 +226,9 @@ abstract class ExchangeStoreBase with Store {
|
||||
}
|
||||
|
||||
void validateAddress(String value, {CryptoCurrency cryptoCurrency}) {
|
||||
// XMR (95), ADA (105), BCH (42), BNB (42), BTC (34, 42), DASH (34), EOS (42),
|
||||
// XMR (95), ADA (59, 92, 105), BCH (42), BNB (42), BTC (34, 42), DASH (34), EOS (42),
|
||||
// ETH (42), LTC (34), NANO (64, 65), TRX (34), USDT (42), XLM (56), XRP (34)
|
||||
const pattern = '^[0-9a-zA-Z]{95}\$|^[0-9a-zA-Z]{34}\$|^[0-9a-zA-Z]{42}\$|^[0-9a-zA-Z]{56}\$|^[0-9a-zA-Z]{64}\$|^[0-9a-zA-Z]{65}\$|^[0-9a-zA-Z]{105}\$';
|
||||
const pattern = '^[0-9a-zA-Z]{95}\$|^[0-9a-zA-Z]{34}\$|^[0-9a-zA-Z]{42}\$|^[0-9a-zA-Z]{56}\$|^[0-9a-zA-Z]{59}\$|^[0-9a-zA-Z]{64}\$|^[0-9a-zA-Z]{65}\$|^[0-9a-zA-Z]{92}\$|^[0-9a-zA-Z]{105}\$';
|
||||
final regExp = RegExp(pattern);
|
||||
isValid = regExp.hasMatch(value);
|
||||
if (isValid && cryptoCurrency != null) {
|
||||
@@ -237,7 +237,7 @@ abstract class ExchangeStoreBase with Store {
|
||||
isValid = (value.length == 95);
|
||||
break;
|
||||
case CryptoCurrency.ada:
|
||||
isValid = (value.length == 105);
|
||||
isValid = (value.length == 59)||(value.length == 92)||(value.length == 105);
|
||||
break;
|
||||
case CryptoCurrency.bch:
|
||||
isValid = (value.length == 42);
|
||||
|
||||
@@ -159,9 +159,9 @@ abstract class SendStoreBase with Store {
|
||||
}
|
||||
|
||||
void validateAddress(String value, {CryptoCurrency cryptoCurrency}) {
|
||||
// XMR (95), ADA (105), BCH (42), BNB (42), BTC (34, 42), DASH (34), EOS (42),
|
||||
// XMR (95), ADA (59, 92, 105), BCH (42), BNB (42), BTC (34, 42), DASH (34), EOS (42),
|
||||
// ETH (42), LTC (34), NANO (64, 65), TRX (34), USDT (42), XLM (56), XRP (34)
|
||||
const pattern = '^[0-9a-zA-Z]{95}\$|^[0-9a-zA-Z]{34}\$|^[0-9a-zA-Z]{42}\$|^[0-9a-zA-Z]{56}\$|^[0-9a-zA-Z]{64}\$|^[0-9a-zA-Z]{65}\$|^[0-9a-zA-Z]{105}\$';
|
||||
const pattern = '^[0-9a-zA-Z]{95}\$|^[0-9a-zA-Z]{34}\$|^[0-9a-zA-Z]{42}\$|^[0-9a-zA-Z]{56}\$|^[0-9a-zA-Z]{59}\$|^[0-9a-zA-Z]{64}\$|^[0-9a-zA-Z]{65}\$|^[0-9a-zA-Z]{92}\$|^[0-9a-zA-Z]{105}\$';
|
||||
final regExp = RegExp(pattern);
|
||||
isValid = regExp.hasMatch(value);
|
||||
if (isValid && cryptoCurrency != null) {
|
||||
@@ -170,7 +170,7 @@ abstract class SendStoreBase with Store {
|
||||
isValid = (value.length == 95);
|
||||
break;
|
||||
case CryptoCurrency.ada:
|
||||
isValid = (value.length == 105);
|
||||
isValid = (value.length == 59)||(value.length == 92)||(value.length == 105);
|
||||
break;
|
||||
case CryptoCurrency.bch:
|
||||
isValid = (value.length == 42);
|
||||
|
||||
@@ -116,9 +116,9 @@ abstract class WalleRestorationStoreBase with Store {
|
||||
}
|
||||
|
||||
void validateAddress(String value, {CryptoCurrency cryptoCurrency}) {
|
||||
// XMR (95), ADA (105), BCH (42), BNB (42), BTC (34, 42), DASH (34), EOS (42),
|
||||
// XMR (95), ADA (59, 92, 105), BCH (42), BNB (42), BTC (34, 42), DASH (34), EOS (42),
|
||||
// ETH (42), LTC (34), NANO (64, 65), TRX (34), USDT (42), XLM (56), XRP (34)
|
||||
const pattern = '^[0-9a-zA-Z]{95}\$|^[0-9a-zA-Z]{34}\$|^[0-9a-zA-Z]{42}\$|^[0-9a-zA-Z]{56}\$|^[0-9a-zA-Z]{64}\$|^[0-9a-zA-Z]{65}\$|^[0-9a-zA-Z]{105}\$';
|
||||
const pattern = '^[0-9a-zA-Z]{95}\$|^[0-9a-zA-Z]{34}\$|^[0-9a-zA-Z]{42}\$|^[0-9a-zA-Z]{56}\$|^[0-9a-zA-Z]{59}\$|^[0-9a-zA-Z]{64}\$|^[0-9a-zA-Z]{65}\$|^[0-9a-zA-Z]{92}\$|^[0-9a-zA-Z]{105}\$';
|
||||
final regExp = RegExp(pattern);
|
||||
isValid = regExp.hasMatch(value);
|
||||
if (isValid && cryptoCurrency != null) {
|
||||
@@ -127,7 +127,7 @@ abstract class WalleRestorationStoreBase with Store {
|
||||
isValid = (value.length == 95);
|
||||
break;
|
||||
case CryptoCurrency.ada:
|
||||
isValid = (value.length == 105);
|
||||
isValid = (value.length == 59)||(value.length == 92)||(value.length == 105);
|
||||
break;
|
||||
case CryptoCurrency.bch:
|
||||
isValid = (value.length == 42);
|
||||
|
||||
Reference in New Issue
Block a user