]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/blobdiff - src/js/index.js
Nebulas. Add test spec. Replace nebulas.js by account part of nebulas.js only.
[perso/Immae/Projets/Cryptomonnaies/BIP39.git] / src / js / index.js
index bc155590622f9392d19637ce4db283c01c0787f9..8c23e615c26b484201f12af2abf215fa40975064 100644 (file)
                     privkey = ethUtil.addHexPrefix(privkey);
                     pubkey = ethUtil.addHexPrefix(pubkey);
                 }
+                if ((networks[DOM.network.val()].name == "NAS - Nebulas")) {
+                    var NasAccount = require("nebulas-account");
+                    var privKeyBuffer = keyPair.d.toBuffer(32);
+                    var nebulasAccount = new NasAccount();
+                    nebulasAccount.setPrivateKey(privKeyBuffer);
+                    address = nebulasAccount.getAddressString();
+                    privkey = nebulasAccount.getPrivateKeyString();
+                    pubkey = nebulasAccount.getPublicKeyString();
+                }
                 // Ripple values are different
                 if (networks[DOM.network.val()].name == "XRP - Ripple") {
                     privkey = convertRipplePriv(privkey);
                 setHdCoin(130);
             },
         },
+        {
+            name: "NAS - Nebulas",
+            onSelect: function() {
+                network = bitcoinjs.bitcoin.networks.bitcoin;
+                setHdCoin(2718);
+            },
+        },
         {
             name: "NEBL - Neblio",
             onSelect: function() {