mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-03-01 11:10:28 +00:00
17 lines
478 B
JavaScript
17 lines
478 B
JavaScript
import WalletAddressValidator from 'wallet-address-validator';
|
|
import ethUtil from 'ethereumjs-util';
|
|
|
|
export default class Validator {
|
|
isValidETHAddress = function(address) {
|
|
if (address && address === '0x0000000000000000000000000000000000000000')
|
|
return false;
|
|
if (address) {
|
|
return ethUtil.isValidAddress(address);
|
|
}
|
|
return false;
|
|
};
|
|
isValidBTCAddress = function(address) {
|
|
return WalletAddressValidator.validate(address, 'BTC');
|
|
};
|
|
}
|