From 0ff4c9a922e796d65fdc62ad5767092ef27411fd Mon Sep 17 00:00:00 2001 From: Esteban Ordano Date: Tue, 27 Jan 2015 13:00:58 -0300 Subject: [PATCH] HDKeys: Add jsdocs to hdprivatekey --- lib/hdprivatekey.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/hdprivatekey.js b/lib/hdprivatekey.js index 27b9e8f..7a2ca00 100644 --- a/lib/hdprivatekey.js +++ b/lib/hdprivatekey.js @@ -480,14 +480,30 @@ HDPrivateKey.prototype.toObject = function toObject() { }; }; +/** + * Returns a JSON representation of the HDPrivateKey + * + * @return {string} + */ HDPrivateKey.prototype.toJSON = function toJSON() { return JSON.stringify(this.toObject()); }; +/** + * Build a HDPrivateKey from a buffer + * + * @param {Buffer} arg + * @return {HDPrivateKey} + */ HDPrivateKey.fromBuffer = function(arg) { return new HDPrivateKey(arg); }; +/** + * Returns a buffer representation of the HDPrivateKey + * + * @return {string} + */ HDPrivateKey.prototype.toBuffer = function() { return this._buffers.xprivkey; };