From dd496c82c10ddd9612c80c70b4a21e05f2720624 Mon Sep 17 00:00:00 2001 From: Ian Coleman Date: Fri, 7 Feb 2020 21:25:57 +1100 Subject: Fix ethereum private key format --- src/js/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/js/index.js b/src/js/index.js index 102c7c5..3981e81 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -1134,8 +1134,10 @@ var hexAddress = addressBuffer.toString('hex'); var checksumAddress = libs.ethUtil.toChecksumAddress(hexAddress); address = libs.ethUtil.addHexPrefix(checksumAddress); - privkey = libs.ethUtil.addHexPrefix(privkey); pubkey = libs.ethUtil.addHexPrefix(pubkey); + if (hasPrivkey) { + privkey = libs.ethUtil.bufferToHex(keyPair.d.toBuffer()); + } } // Stellar is different -- cgit v1.2.3