diff --git a/lib/src/stores/address_book/address_book_store.dart b/lib/src/stores/address_book/address_book_store.dart index 324b60a2c..8cb1b9ca6 100644 --- a/lib/src/stores/address_book/address_book_store.dart +++ b/lib/src/stores/address_book/address_book_store.dart @@ -45,7 +45,7 @@ abstract class AddressBookStoreBase with Store { } void validateAddress(String value, {CryptoCurrency cryptoCurrency}) { - // XMR (95), BTC (34), ETH (42), LTC (34), BCH (42), DASH (34) + // XMR (95), BTC (34, 42), ETH (42), LTC (34), BCH (42), DASH (34) const pattern = '^[0-9a-zA-Z]{95}\$|^[0-9a-zA-Z]{34}\$|^[0-9a-zA-Z]{42}\$'; final regExp = RegExp(pattern); isValid = regExp.hasMatch(value); @@ -56,7 +56,7 @@ abstract class AddressBookStoreBase with Store { isValid = (value.length == 95); break; case 'BTC': - isValid = (value.length == 34); + isValid = (value.length == 34)||(value.length == 42); break; case 'ETH': isValid = (value.length == 42); diff --git a/lib/src/stores/exchange/exchange_store.dart b/lib/src/stores/exchange/exchange_store.dart index dad09bcd6..5f625fbb9 100644 --- a/lib/src/stores/exchange/exchange_store.dart +++ b/lib/src/stores/exchange/exchange_store.dart @@ -226,7 +226,7 @@ abstract class ExchangeStoreBase with Store { } void validateAddress(String value, {CryptoCurrency cryptoCurrency}) { - // XMR (95), BTC (34), ETH (42), LTC (34), BCH (42), DASH (34) + // XMR (95), BTC (34, 42), ETH (42), LTC (34), BCH (42), DASH (34) const pattern = '^[0-9a-zA-Z]{95}\$|^[0-9a-zA-Z]{34}\$|^[0-9a-zA-Z]{42}\$'; final regExp = RegExp(pattern); isValid = regExp.hasMatch(value); @@ -237,7 +237,7 @@ abstract class ExchangeStoreBase with Store { isValid = (value.length == 95); break; case 'BTC': - isValid = (value.length == 34); + isValid = (value.length == 34)||(value.length == 42); break; case 'ETH': isValid = (value.length == 42); diff --git a/lib/src/stores/send/send_store.dart b/lib/src/stores/send/send_store.dart index 130efa8c4..f5d3229ba 100644 --- a/lib/src/stores/send/send_store.dart +++ b/lib/src/stores/send/send_store.dart @@ -159,7 +159,7 @@ abstract class SendStoreBase with Store { } void validateAddress(String value, {CryptoCurrency cryptoCurrency}) { - // XMR (95), BTC (34), ETH (42), LTC (34), BCH (42), DASH (34) + // XMR (95), BTC (34, 42), ETH (42), LTC (34), BCH (42), DASH (34) const pattern = '^[0-9a-zA-Z]{95}\$|^[0-9a-zA-Z]{34}\$|^[0-9a-zA-Z]{42}\$'; final regExp = RegExp(pattern); isValid = value == null ? false : regExp.hasMatch(value); @@ -170,7 +170,7 @@ abstract class SendStoreBase with Store { isValid = (value.length == 95); break; case 'BTC': - isValid = (value.length == 34); + isValid = (value.length == 34)||(value.length == 42); break; case 'ETH': isValid = (value.length == 42); diff --git a/lib/src/stores/wallet_restoration/wallet_restoration_store.dart b/lib/src/stores/wallet_restoration/wallet_restoration_store.dart index aa98ffc36..ac2e986a0 100644 --- a/lib/src/stores/wallet_restoration/wallet_restoration_store.dart +++ b/lib/src/stores/wallet_restoration/wallet_restoration_store.dart @@ -116,7 +116,7 @@ abstract class WalleRestorationStoreBase with Store { } void validateAddress(String value, {CryptoCurrency cryptoCurrency}) { - // XMR (95), BTC (34), ETH (42), LTC (34), BCH (42), DASH (34) + // XMR (95), BTC (34, 42), ETH (42), LTC (34), BCH (42), DASH (34) const pattern = '^[0-9a-zA-Z]{95}\$|^[0-9a-zA-Z]{34}\$|^[0-9a-zA-Z]{42}\$'; final regExp = RegExp(pattern); isValid = regExp.hasMatch(value); @@ -127,7 +127,7 @@ abstract class WalleRestorationStoreBase with Store { isValid = (value.length == 95); break; case 'BTC': - isValid = (value.length == 34); + isValid = (value.length == 34)||(value.length == 42); break; case 'ETH': isValid = (value.length == 42);