|
|
@ -184,14 +184,12 @@ HDPrivateKey.prototype.derive = function(arg, hardened) { |
|
|
|
* |
|
|
|
* @param {string|number} arg |
|
|
|
* @param {boolean?} hardened |
|
|
|
* @param {boolean?} nonCompliant - This should not be used and only for backwards compatibility |
|
|
|
* |
|
|
|
*/ |
|
|
|
HDPrivateKey.prototype.deriveChild = function(arg, hardened, nonCompliant) { |
|
|
|
HDPrivateKey.prototype.deriveChild = function(arg, hardened) { |
|
|
|
if (_.isNumber(arg)) { |
|
|
|
return this._deriveWithNumber(arg, hardened, nonCompliant); |
|
|
|
return this._deriveWithNumber(arg, hardened); |
|
|
|
} else if (_.isString(arg)) { |
|
|
|
return this._deriveFromString(arg, nonCompliant); |
|
|
|
return this._deriveFromString(arg); |
|
|
|
} else { |
|
|
|
throw new hdErrors.InvalidDerivationArgument(arg); |
|
|
|
} |
|
|
@ -214,8 +212,13 @@ HDPrivateKey.prototype.deriveChild = function(arg, hardened, nonCompliant) { |
|
|
|
* @param {boolean?} hardened |
|
|
|
*/ |
|
|
|
HDPrivateKey.prototype.deriveNonCompliantChild = function(arg, hardened) { |
|
|
|
var derived = this.deriveChild(arg, hardened, true); |
|
|
|
return derived; |
|
|
|
if (_.isNumber(arg)) { |
|
|
|
return this._deriveWithNumber(arg, hardened, true); |
|
|
|
} else if (_.isString(arg)) { |
|
|
|
return this._deriveFromString(arg, true); |
|
|
|
} else { |
|
|
|
throw new hdErrors.InvalidDerivationArgument(arg); |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
HDPrivateKey.prototype._deriveWithNumber = function(index, hardened, nonCompliant) { |
|
|
|