From b674c5710b70c9dac9f11758cac222d45575dec2 Mon Sep 17 00:00:00 2001 From: zr Date: Thu, 10 Sep 2020 17:40:56 +0800 Subject: Add TRX coin support --- src/js/index.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src') diff --git a/src/js/index.js b/src/js/index.js index 252eec1..2c02721 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -1139,6 +1139,16 @@ privkey = libs.ethUtil.bufferToHex(keyPair.d.toBuffer()); } } + //TRX is different + if (networks[DOM.network.val()].name == "TRX - Tron") { + var pubkeyBuffer = keyPair.getPublicKeyBuffer(); + var ethPubkey = libs.ethUtil.importPublic(pubkeyBuffer); + var addressBuffer = libs.ethUtil.publicToAddress(ethPubkey); + address = libs.bitcoin.address.toBase58Check(addressBuffer, 0x41); + if (hasPrivkey) { + privkey = keyPair.d.toBuffer().toString('hex'); + } + } // RSK values are different if (networkIsRsk()) { @@ -3228,6 +3238,12 @@ setHdCoin(159); }, }, + { + name: "TRX - Tron", + onSelect: function() { + setHdCoin(195); + }, + }, { name: "TWINS - TWINS", onSelect: function() { -- cgit v1.2.3