Updates network.js constant names

This commit is contained in:
Daniel Cousens 2014-04-17 05:43:34 +10:00
parent ed28c6adcf
commit f047afef2d
12 changed files with 68 additions and 58 deletions

View file

@ -74,7 +74,7 @@ ECKey.version_bytes = {
}
ECKey.prototype.toWif = function(version) {
version = version || Network.mainnet.addressVersion
version = version || Network.bitcoin.pubKeyHash
return base58check.encode(this.toBytes(), ECKey.version_bytes[version])
}
@ -169,7 +169,7 @@ ECPubKey.prototype.toBin = function(compressed) {
}
ECPubKey.prototype.toWif = function(version) {
version = version || Network.mainnet.addressVersion
version = version || Network.bitcoin.pubKeyHash
return base58check.encode(this.toBytes(), version)
}
@ -177,7 +177,7 @@ ECPubKey.prototype.toWif = function(version) {
ECPubKey.prototype.toString = ECPubKey.prototype.toHex
ECPubKey.prototype.getAddress = function(version) {
version = version || Network.mainnet.addressVersion
version = version || Network.bitcoin.pubKeyHash
return new Address(crypto.hash160(this.toBytes()), version)
}