|
|
@ -6,11 +6,20 @@ var Hash = require('../hash'); |
|
|
|
var KDF = require('../kdf'); |
|
|
|
var base58check = require('../base58check'); |
|
|
|
|
|
|
|
var Stealthkey = function Stealthkey(obj) { |
|
|
|
var Stealthkey = function Stealthkey(payloadKeypair, scanKeypair) { |
|
|
|
if (!(this instanceof Stealthkey)) |
|
|
|
return new Stealthkey(obj); |
|
|
|
if (obj) |
|
|
|
return new Stealthkey(payloadKeypair, scanKeypair); |
|
|
|
|
|
|
|
if (payloadKeypair instanceof Keypair) { |
|
|
|
this.set({ |
|
|
|
payloadKeypair: payloadKeypair, |
|
|
|
scanKeypair: scanKeypair |
|
|
|
}); |
|
|
|
} |
|
|
|
else if (payloadKeypair) { |
|
|
|
var obj = payloadKeypair; |
|
|
|
this.set(obj); |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
Stealthkey.prototype.set = function(obj) { |
|
|
|