diff options
author | iancoleman <1281387+iancoleman@users.noreply.github.com> | 2020-10-19 09:12:43 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-19 09:12:43 +1100 |
commit | 4669c88c672b0ec2ac636cae96a3fe2db94e2791 (patch) | |
tree | 109e4173462e7f9f9d7afc4cb1fbaa803bcd35eb /src/js | |
parent | 9e865b8e757b6ee643027536da9a18b3c0469aa7 (diff) | |
parent | 47dbf58b6d499230eb07f7ea126af6b367e9039b (diff) | |
download | BIP39-4669c88c672b0ec2ac636cae96a3fe2db94e2791.tar.gz BIP39-4669c88c672b0ec2ac636cae96a3fe2db94e2791.tar.zst BIP39-4669c88c672b0ec2ac636cae96a3fe2db94e2791.zip |
Merge pull request #441 from bytefly/master
Add TRX coin support
Diffstat (limited to 'src/js')
-rw-r--r-- | src/js/index.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/js/index.js b/src/js/index.js index dc24963..114f74a 100644 --- a/src/js/index.js +++ b/src/js/index.js | |||
@@ -1139,6 +1139,17 @@ | |||
1139 | privkey = libs.ethUtil.bufferToHex(keyPair.d.toBuffer()); | 1139 | privkey = libs.ethUtil.bufferToHex(keyPair.d.toBuffer()); |
1140 | } | 1140 | } |
1141 | } | 1141 | } |
1142 | //TRX is different | ||
1143 | if (networks[DOM.network.val()].name == "TRX - Tron") { | ||
1144 | keyPair = new libs.bitcoin.ECPair(keyPair.d, null, { network: network, compressed: false }); | ||
1145 | var pubkeyBuffer = keyPair.getPublicKeyBuffer(); | ||
1146 | var ethPubkey = libs.ethUtil.importPublic(pubkeyBuffer); | ||
1147 | var addressBuffer = libs.ethUtil.publicToAddress(ethPubkey); | ||
1148 | address = libs.bitcoin.address.toBase58Check(addressBuffer, 0x41); | ||
1149 | if (hasPrivkey) { | ||
1150 | privkey = keyPair.d.toBuffer().toString('hex'); | ||
1151 | } | ||
1152 | } | ||
1142 | 1153 | ||
1143 | // RSK values are different | 1154 | // RSK values are different |
1144 | if (networkIsRsk()) { | 1155 | if (networkIsRsk()) { |
@@ -3237,6 +3248,12 @@ | |||
3237 | }, | 3248 | }, |
3238 | }, | 3249 | }, |
3239 | { | 3250 | { |
3251 | name: "TRX - Tron", | ||
3252 | onSelect: function() { | ||
3253 | setHdCoin(195); | ||
3254 | }, | ||
3255 | }, | ||
3256 | { | ||
3240 | name: "TWINS - TWINS", | 3257 | name: "TWINS - TWINS", |
3241 | onSelect: function() { | 3258 | onSelect: function() { |
3242 | network = libs.bitcoin.networks.twins; | 3259 | network = libs.bitcoin.networks.twins; |