Use ethutil.bufferToHex
This commit is contained in:
parent
603419ad64
commit
60c9ebaaf7
6
index.js
6
index.js
|
@ -35,7 +35,7 @@ Wallet.prototype.getPrivateKey = function () {
|
|||
}
|
||||
|
||||
Wallet.prototype.getPrivateKeyString = function () {
|
||||
return '0x' + this.getPrivateKey().toString('hex')
|
||||
return ethUtil.bufferToHex(this.getPrivateKey())
|
||||
}
|
||||
|
||||
Wallet.prototype.getPublicKey = function () {
|
||||
|
@ -43,7 +43,7 @@ Wallet.prototype.getPublicKey = function () {
|
|||
}
|
||||
|
||||
Wallet.prototype.getPublicKeyString = function () {
|
||||
return '0x' + this.getPublicKey().toString('hex')
|
||||
return ethUtil.bufferToHex(this.getPublicKey())
|
||||
}
|
||||
|
||||
Wallet.prototype.getAddress = function () {
|
||||
|
@ -51,7 +51,7 @@ Wallet.prototype.getAddress = function () {
|
|||
}
|
||||
|
||||
Wallet.prototype.getAddressString = function () {
|
||||
return '0x' + this.getAddress().toString('hex')
|
||||
return ethUtil.bufferToHex(this.getAddress())
|
||||
}
|
||||
|
||||
Wallet.prototype.getChecksumAddressString = function () {
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
"homepage": "https://github.com/axic/ethereumjs-wallet",
|
||||
"dependencies": {
|
||||
"aes-js": "^0.2.3",
|
||||
"ethereumjs-util": "^4.1.0",
|
||||
"ethereumjs-util": "^4.2.0",
|
||||
"scrypt.js": "^0.1.0",
|
||||
"uuid": "^2.0.1",
|
||||
"utf8": "^2.1.1"
|
||||
|
|
Loading…
Reference in New Issue