|
|
@ -10,15 +10,6 @@ function Address(obj) { |
|
|
|
this.set(obj); |
|
|
|
}; |
|
|
|
|
|
|
|
Address.isValid = function(addrstr) { |
|
|
|
try { |
|
|
|
var address = new Address().fromString(addrstr); |
|
|
|
} catch (e) { |
|
|
|
return false; |
|
|
|
} |
|
|
|
return address.isValid(); |
|
|
|
}; |
|
|
|
|
|
|
|
Address.prototype.set = function(obj) { |
|
|
|
this.hashbuf = obj.hashbuf || this.hashbuf || null; |
|
|
|
this.networkstr = obj.networkstr || this.networkstr || 'mainnet'; |
|
|
@ -60,6 +51,15 @@ Address.prototype.fromString = function(str) { |
|
|
|
return this; |
|
|
|
} |
|
|
|
|
|
|
|
Address.isValid = function(addrstr) { |
|
|
|
try { |
|
|
|
var address = new Address().fromString(addrstr); |
|
|
|
} catch (e) { |
|
|
|
return false; |
|
|
|
} |
|
|
|
return address.isValid(); |
|
|
|
}; |
|
|
|
|
|
|
|
Address.prototype.isValid = function() { |
|
|
|
try { |
|
|
|
this.validate(); |
|
|
|