]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/blobdiff - src/js/index.js
Pad eth private keys correctly
[perso/Immae/Projets/Cryptomonnaies/BIP39.git] / src / js / index.js
index 1f4cc1fe12ab203ff39474804ac1e63c44c1463b..c502208d3b468737c3cc1f86d059434e5ba9de1d 100644 (file)
                     address = libs.ethUtil.addHexPrefix(checksumAddress);
                     pubkey = libs.ethUtil.addHexPrefix(pubkey);
                     if (hasPrivkey) {
-                        privkey = libs.ethUtil.bufferToHex(keyPair.d.toBuffer());
+                        privkey = libs.ethUtil.bufferToHex(keyPair.d.toBuffer(32));
                     }
                 }
                 //TRX is different
                     privkey = FIObufferToPrivate(keyPair.d.toBuffer(32));
                 }
 
+                if (networks[DOM.network.val()].name == "ATOM - Cosmos Hub") {
+                    address = CosmosBufferToAddress(keyPair.getPublicKeyBuffer());
+                    pubkey = CosmosBufferToPublic(keyPair.getPublicKeyBuffer());
+                    privkey = keyPair.d.toBuffer().toString("base64");
+                }
+
                 //Groestlcoin Addresses are different
                 if(isGRS()) {
 
                 setHdCoin(357);
             },
         },
+        {
+            name: "ATOM - Cosmos Hub",
+            onSelect: function() {
+                network = libs.bitcoin.networks.bitcoin;
+                setHdCoin(118);
+            },
+        },
         {
             name: "AUR - Auroracoin",
             onSelect: function() {
                 setHdCoin(4);
             },
         },
+        {
+            name: "RITO - Ritocoin",
+            onSelect: function() {
+                network = libs.bitcoin.networks.ritocoin;
+                setHdCoin(19169);
+            },
+        },
         {
             name: "RVR - RevolutionVR",
             onSelect: function() {