X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2Fjs%2Findex.js;h=057d7093402b8f7d47359608a0903add76f06f22;hb=d0889ab9dee263494bcf50dc6c5a25a249c8ffe1;hp=bc155590622f9392d19637ce4db283c01c0787f9;hpb=dba22db54d6adc81660f4cca45edb30db3899ad9;p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FBIP39.git diff --git a/src/js/index.js b/src/js/index.js index bc15559..057d709 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -928,6 +928,15 @@ 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); @@ -943,6 +952,13 @@ address = bchaddr.toBitpayAddress(address); } } + // Bitcoin Cash address format may vary + if (networks[DOM.network.val()].name == "SLP - Simple Ledger Protocol") { + var bchAddrType = DOM.bitcoinCashAddressType.filter(":checked").val(); + if (bchAddrType == "cashaddr") { + address = bchaddr.toSlpAddress(address); + } + } // Segwit addresses are different if (isSegwit) { if (!segwitAvailable) { @@ -1709,7 +1725,7 @@ network = bitcoinjs.bitcoin.networks.blocknode; setHdCoin(2941); }, - }, + }, { name: "tBND - Blocknode Testnet", onSelect: function() { @@ -2223,6 +2239,13 @@ setHdCoin(130); }, }, + { + name: "NAS - Nebulas", + onSelect: function() { + network = bitcoinjs.bitcoin.networks.bitcoin; + setHdCoin(2718); + }, + }, { name: "NEBL - Neblio", onSelect: function() { @@ -2470,6 +2493,13 @@ setHdCoin(111); }, }, + { + name: "SLP - Simple Ledger Protocol", + onSelect: function() { + DOM.bitcoinCashAddressTypeContainer.removeClass("hidden"); + setHdCoin(245); + }, + }, { name: "SLR - Solarcoin", onSelect: function() {