|
|
@ -2,12 +2,21 @@ var Stealthkey = require('./stealthkey'); |
|
|
|
var Base58check = require('../base58check'); |
|
|
|
var Pubkey = require('../pubkey'); |
|
|
|
|
|
|
|
var StealthAddress = function StealthAddress(obj) { |
|
|
|
var StealthAddress = function StealthAddress(addrstr) { |
|
|
|
if (!(this instanceof StealthAddress)) |
|
|
|
return new StealthAddress(obj); |
|
|
|
|
|
|
|
if (obj) |
|
|
|
return new StealthAddress(addrstr); |
|
|
|
|
|
|
|
if (typeof addrstr === 'string') { |
|
|
|
this.fromString(addrstr) |
|
|
|
} |
|
|
|
else if (Buffer.isBuffer(addrstr)) { |
|
|
|
var buf = addrstr; |
|
|
|
this.fromBuffer(buf); |
|
|
|
} |
|
|
|
else if (addrstr) { |
|
|
|
var obj = addrstr; |
|
|
|
this.set(obj); |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
StealthAddress.prototype.set = function(obj) { |
|
|
|