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
}
HDNode.prototype.getScriptData = function () {
return this.prefix.scriptFactory.convert(this.keyPair)
}
HDNode.prototype.getAddress = function () {
var data = this.prefix.scriptFactory.convert(this.keyPair)
return baddress.fromOutputScript(data.scriptPubKey, this.keyPair.network)
var scriptData = this.getScriptData()
return baddress.fromOutputScript(scriptData.scriptPubKey, this.keyPair.network)
}
HDNode.prototype.getIdentifier = function () {