hdnode: expose getScriptData

This commit is contained in:
Thomas Kerin 2018-03-04 21:08:23 +01:00
parent f44e662dbe
commit 84e330df3d

View file

@ -148,9 +148,13 @@ HDNode.fromBase58 = function (string, networks, prefixes) {
return hd return hd
} }
HDNode.prototype.getScriptData = function () {
return this.prefix.scriptFactory.convert(this.keyPair)
}
HDNode.prototype.getAddress = function () { HDNode.prototype.getAddress = function () {
var data = this.prefix.scriptFactory.convert(this.keyPair) var scriptData = this.getScriptData()
return baddress.fromOutputScript(data.scriptPubKey, this.keyPair.network) return baddress.fromOutputScript(scriptData.scriptPubKey, this.keyPair.network)
} }
HDNode.prototype.getIdentifier = function () { HDNode.prototype.getIdentifier = function () {