mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-02-23 08:18:17 +00:00
Create Validator class and add deps to package.json
This commit is contained in:
parent
bc9765d99b
commit
c77f8430c5
16
common/libs/validator.js
Normal file
16
common/libs/validator.js
Normal file
@ -0,0 +1,16 @@
|
||||
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');
|
||||
};
|
||||
}
|
@ -5,6 +5,7 @@
|
||||
"description": "MyEtherWallet v4",
|
||||
"dependencies": {
|
||||
"axios": "^0.16.2",
|
||||
"ethereumjs-util": "^5.1.2",
|
||||
"lodash": "^4.17.4",
|
||||
"prop-types": "^15.5.8",
|
||||
"react": "^15.4.2",
|
||||
@ -17,6 +18,7 @@
|
||||
"redux-logger": "^3.0.1",
|
||||
"redux-saga": "^0.15.3",
|
||||
"store2": "^2.5.0",
|
||||
"wallet-address-validator": "^0.1.0",
|
||||
"whatwg-fetch": "^2.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
Loading…
x
Reference in New Issue
Block a user