|
|
@ -6,12 +6,17 @@ var Hash = require('../hash'); |
|
|
|
var KDF = require('../kdf'); |
|
|
|
var base58check = require('../base58check'); |
|
|
|
|
|
|
|
var Stealth = function Stealth(payloadKey, scanKey) { |
|
|
|
var Stealth = function Stealth(obj) { |
|
|
|
if (!(this instanceof Stealth)) |
|
|
|
return new Stealth(payloadKey, scanKey); |
|
|
|
return new Stealth(obj); |
|
|
|
if (obj) |
|
|
|
this.set(obj); |
|
|
|
}; |
|
|
|
|
|
|
|
this.payloadKey = payloadKey; |
|
|
|
this.scanKey = scanKey; |
|
|
|
Stealth.prototype.set = function(obj) { |
|
|
|
this.payloadKey = obj.payloadKey || this.payloadKey; |
|
|
|
this.scanKey = obj.scanKey || this.scanKey; |
|
|
|
return this; |
|
|
|
}; |
|
|
|
|
|
|
|
Stealth.prototype.fromAddressBuffer = function(buf) { |
|
|
|