|
|
@ -231,9 +231,9 @@ HDPublicKey.prototype._buildFromObject = function (arg) { |
|
|
|
// TODO: Type validation
|
|
|
|
var buffers = { |
|
|
|
version: arg.network ? BufferUtil.integerAsBuffer(Network.get(arg.network).xpubkey) : arg.version, |
|
|
|
depth: BufferUtil.integerAsSingleByteBuffer(arg.depth), |
|
|
|
depth: _.isNumber(arg.depth) ? BufferUtil.integerAsSingleByteBuffer(arg.depth) : arg.depth, |
|
|
|
parentFingerPrint: _.isNumber(arg.parentFingerPrint) ? BufferUtil.integerAsBuffer(arg.parentFingerPrint) : arg.parentFingerPrint, |
|
|
|
childIndex: BufferUtil.integerAsBuffer(arg.childIndex), |
|
|
|
childIndex: _.isNumber(arg.childIndex) ? BufferUtil.integerAsBuffer(arg.childIndex) : arg.childIndex, |
|
|
|
chainCode: _.isString(arg.chainCode) ? BufferUtil.hexToBuffer(arg.chainCode) : arg.chainCode, |
|
|
|
publicKey: _.isString(arg.publicKey) ? BufferUtil.hexToBuffer(arg.publicKey) : |
|
|
|
BufferUtil.isBuffer(arg.publicKey) ? arg.publicKey : arg.publicKey.toBuffer(), |
|
|
|