diff --git a/bip39-standalone.html b/bip39-standalone.html index d3a8d339..a00cb688 100644 --- a/bip39-standalone.html +++ b/bip39-standalone.html @@ -19902,6 +19902,16 @@

Libraries

wif: 0x85, }; +bitcoin.networks.crown = { + bip32: { + public: 0x0488b21e, + private: 0x0488ade4 + }, + pubKeyHash: 0x00, + scriptHash: 0x05, + wif: 0x80, +}; + bitcoin.networks.dash = { bip32: { public: 0x0488b21e, @@ -44319,7 +44329,7 @@

Libraries

indexText = indexText + "'"; } // Ethereum values are different - if (networks[DOM.network.val()].name == "Ethereum") { + if (networks[DOM.network.val()].name == "ETH - Ethereum") { var privKeyBuffer = key.privKey.d.toBuffer(); privkey = privKeyBuffer.toString('hex'); var addressBuffer = ethUtil.privateToAddress(privKeyBuffer); @@ -44330,7 +44340,7 @@

Libraries

pubkey = ethUtil.addHexPrefix(pubkey); } // Ripple values are different - if (networks[DOM.network.val()].name == "Ripple") { + if (networks[DOM.network.val()].name == "XRP - Ripple") { privkey = convertRipplePriv(privkey); address = convertRippleAdrr(address); } @@ -44791,138 +44801,145 @@

Libraries

var networks = [ { - name: "Bitcoin", + name: "BTC - Bitcoin", onSelect: function() { network = bitcoin.networks.bitcoin; DOM.bip44coin.val(0); }, }, { - name: "Bitcoin Testnet", + name: "BTC - Bitcoin Testnet", onSelect: function() { network = bitcoin.networks.testnet; DOM.bip44coin.val(1); }, }, { - name: "CLAM", + name: "CLAM - Clams", onSelect: function() { network = bitcoin.networks.clam; DOM.bip44coin.val(23); }, }, { - name: "Dogecoin", + name: "CRW - Crown", onSelect: function() { - network = bitcoin.networks.dogecoin; - DOM.bip44coin.val(3); + network = bitcoin.networks.crown; + DOM.bip44coin.val(72); }, }, { - name: "DASH", + name: "DASH - Dash", onSelect: function() { network = bitcoin.networks.dash; DOM.bip44coin.val(5); }, }, { - name: "DASH Testnet", + name: "DASH - Dash Testnet", onSelect: function() { network = bitcoin.networks.dashtn; DOM.bip44coin.val(1); }, }, { - name: "Ethereum", + name: "DOGE - Dogecoin", + onSelect: function() { + network = bitcoin.networks.dogecoin; + DOM.bip44coin.val(3); + }, + }, + { + name: "ETH - Ethereum", onSelect: function() { network = bitcoin.networks.bitcoin; DOM.bip44coin.val(60); }, }, { - name: "GAME", + name: "GAME - GameCredits", onSelect: function() { network = bitcoin.networks.game; DOM.bip44coin.val(101); }, }, { - name: "Jumbucks", + name: "JBS - Jumbucks", onSelect: function() { network = bitcoin.networks.jumbucks; DOM.bip44coin.val(26); }, }, { - name: "Litecoin", + name: "LTC - Litecoin", onSelect: function() { network = bitcoin.networks.litecoin; DOM.bip44coin.val(2); }, }, { - name: "Namecoin", + name: "NMC - Namecoin", onSelect: function() { network = bitcoin.networks.namecoin; DOM.bip44coin.val(7); }, }, { - name: "Peercoin", + name: "PPC - Peercoin", onSelect: function() { network = bitcoin.networks.peercoin; DOM.bip44coin.val(6); }, }, { - name: "Ripple", - onSelect: function() { - network = bitcoin.networks.bitcoin; - DOM.bip44coin.val(144); - }, - }, - { - name: "ShadowCash", + name: "SDC - ShadowCash", onSelect: function() { network = bitcoin.networks.shadow; DOM.bip44coin.val(35); }, }, { - name: "ShadowCash Testnet", + name: "SDC - ShadowCash Testnet", onSelect: function() { network = bitcoin.networks.shadowtn; DOM.bip44coin.val(1); }, }, { - name: "Slimcoin", + name: "SLM - Slimcoin", onSelect: function() { network = bitcoin.networks.slimcoin; DOM.bip44coin.val(63); }, }, { - name: "Slimcoin Testnet", + name: "SLM - Slimcoin Testnet", onSelect: function() { network = bitcoin.networks.slimcointn; DOM.bip44coin.val(111); }, }, { - name: "Viacoin", + name: "VIA - Viacoin", onSelect: function() { network = bitcoin.networks.viacoin; DOM.bip44coin.val(14); }, }, { - name: "Viacoin Testnet", + name: "VIA - Viacoin Testnet", onSelect: function() { network = bitcoin.networks.viacointestnet; DOM.bip44coin.val(1); }, }, + { + name: "XRP - Ripple", + onSelect: function() { + network = bitcoin.networks.bitcoin; + DOM.bip44coin.val(144); + }, + } ] var clients = [ diff --git a/src/js/bitcoinjs-extensions.js b/src/js/bitcoinjs-extensions.js index 7747d25b..631af7e0 100644 --- a/src/js/bitcoinjs-extensions.js +++ b/src/js/bitcoinjs-extensions.js @@ -35,6 +35,16 @@ bitcoin.networks.clam = { wif: 0x85, }; +bitcoin.networks.crown = { + bip32: { + public: 0x0488b21e, + private: 0x0488ade4 + }, + pubKeyHash: 0x00, + scriptHash: 0x05, + wif: 0x80, +}; + bitcoin.networks.dash = { bip32: { public: 0x0488b21e, diff --git a/src/js/index.js b/src/js/index.js index 2bb766de..1e88b701 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -585,7 +585,7 @@ indexText = indexText + "'"; } // Ethereum values are different - if (networks[DOM.network.val()].name == "Ethereum") { + if (networks[DOM.network.val()].name == "ETH - Ethereum") { var privKeyBuffer = key.privKey.d.toBuffer(); privkey = privKeyBuffer.toString('hex'); var addressBuffer = ethUtil.privateToAddress(privKeyBuffer); @@ -596,7 +596,7 @@ pubkey = ethUtil.addHexPrefix(pubkey); } // Ripple values are different - if (networks[DOM.network.val()].name == "Ripple") { + if (networks[DOM.network.val()].name == "XRP - Ripple") { privkey = convertRipplePriv(privkey); address = convertRippleAdrr(address); } @@ -1057,138 +1057,145 @@ var networks = [ { - name: "Bitcoin", + name: "BTC - Bitcoin", onSelect: function() { network = bitcoin.networks.bitcoin; DOM.bip44coin.val(0); }, }, { - name: "Bitcoin Testnet", + name: "BTC - Bitcoin Testnet", onSelect: function() { network = bitcoin.networks.testnet; DOM.bip44coin.val(1); }, }, { - name: "CLAM", + name: "CLAM - Clams", onSelect: function() { network = bitcoin.networks.clam; DOM.bip44coin.val(23); }, }, { - name: "Dogecoin", + name: "CRW - Crown", onSelect: function() { - network = bitcoin.networks.dogecoin; - DOM.bip44coin.val(3); + network = bitcoin.networks.crown; + DOM.bip44coin.val(72); }, }, { - name: "DASH", + name: "DASH - Dash", onSelect: function() { network = bitcoin.networks.dash; DOM.bip44coin.val(5); }, }, { - name: "DASH Testnet", + name: "DASH - Dash Testnet", onSelect: function() { network = bitcoin.networks.dashtn; DOM.bip44coin.val(1); }, }, { - name: "Ethereum", + name: "DOGE - Dogecoin", + onSelect: function() { + network = bitcoin.networks.dogecoin; + DOM.bip44coin.val(3); + }, + }, + { + name: "ETH - Ethereum", onSelect: function() { network = bitcoin.networks.bitcoin; DOM.bip44coin.val(60); }, }, { - name: "GAME", + name: "GAME - GameCredits", onSelect: function() { network = bitcoin.networks.game; DOM.bip44coin.val(101); }, }, { - name: "Jumbucks", + name: "JBS - Jumbucks", onSelect: function() { network = bitcoin.networks.jumbucks; DOM.bip44coin.val(26); }, }, { - name: "Litecoin", + name: "LTC - Litecoin", onSelect: function() { network = bitcoin.networks.litecoin; DOM.bip44coin.val(2); }, }, { - name: "Namecoin", + name: "NMC - Namecoin", onSelect: function() { network = bitcoin.networks.namecoin; DOM.bip44coin.val(7); }, }, { - name: "Peercoin", + name: "PPC - Peercoin", onSelect: function() { network = bitcoin.networks.peercoin; DOM.bip44coin.val(6); }, }, { - name: "Ripple", - onSelect: function() { - network = bitcoin.networks.bitcoin; - DOM.bip44coin.val(144); - }, - }, - { - name: "ShadowCash", + name: "SDC - ShadowCash", onSelect: function() { network = bitcoin.networks.shadow; DOM.bip44coin.val(35); }, }, { - name: "ShadowCash Testnet", + name: "SDC - ShadowCash Testnet", onSelect: function() { network = bitcoin.networks.shadowtn; DOM.bip44coin.val(1); }, }, { - name: "Slimcoin", + name: "SLM - Slimcoin", onSelect: function() { network = bitcoin.networks.slimcoin; DOM.bip44coin.val(63); }, }, { - name: "Slimcoin Testnet", + name: "SLM - Slimcoin Testnet", onSelect: function() { network = bitcoin.networks.slimcointn; DOM.bip44coin.val(111); }, }, { - name: "Viacoin", + name: "VIA - Viacoin", onSelect: function() { network = bitcoin.networks.viacoin; DOM.bip44coin.val(14); }, }, { - name: "Viacoin Testnet", + name: "VIA - Viacoin Testnet", onSelect: function() { network = bitcoin.networks.viacointestnet; DOM.bip44coin.val(1); }, }, + { + name: "XRP - Ripple", + onSelect: function() { + network = bitcoin.networks.bitcoin; + DOM.bip44coin.val(144); + }, + } ] var clients = [ diff --git a/tests.js b/tests.js index c2f2cb5b..4f922ce1 100644 --- a/tests.js +++ b/tests.js @@ -281,7 +281,7 @@ page.open(url, function(status) { $(".phrase").trigger("input"); $(".network option[selected]").removeAttr("selected"); $(".network option").filter(function() { - return $(this).html() == "Bitcoin Testnet"; + return $(this).html() == "BTC - Bitcoin Testnet"; }).prop("selected", true); $(".network").trigger("change"); }); @@ -311,7 +311,7 @@ page.open(url, function(status) { $(".phrase").trigger("input"); $(".network option[selected]").removeAttr("selected"); $(".network option").filter(function() { - return $(this).html() == "Litecoin"; + return $(this).html() == "LTC - Litecoin"; }).prop("selected", true); $(".network").trigger("change"); }); @@ -341,7 +341,7 @@ page.open(url, function(status) { $(".phrase").trigger("input"); $(".network option[selected]").removeAttr("selected"); $(".network option").filter(function() { - return $(this).html() == "Ripple"; + return $(this).html() == "XRP - Ripple"; }).prop("selected", true); $(".network").trigger("change"); }); @@ -371,7 +371,7 @@ page.open(url, function(status) { $(".phrase").trigger("input"); $(".network option[selected]").removeAttr("selected"); $(".network option").filter(function() { - return $(this).html() == "Dogecoin"; + return $(this).html() == "DOGE - Dogecoin"; }).prop("selected", true); $(".network").trigger("change"); }); @@ -401,7 +401,7 @@ page.open(url, function(status) { $(".phrase").trigger("input"); $(".network option[selected]").removeAttr("selected"); $(".network option").filter(function() { - return $(this).html() == "ShadowCash"; + return $(this).html() == "SDC - ShadowCash"; }).prop("selected", true); $(".network").trigger("change"); }); @@ -431,7 +431,7 @@ page.open(url, function(status) { $(".phrase").trigger("input"); $(".network option[selected]").removeAttr("selected"); $(".network option").filter(function() { - return $(this).html() == "ShadowCash Testnet"; + return $(this).html() == "SDC - ShadowCash Testnet"; }).prop("selected", true); $(".network").trigger("change"); }); @@ -461,7 +461,7 @@ page.open(url, function(status) { $(".phrase").trigger("input"); $(".network option[selected]").removeAttr("selected"); $(".network option").filter(function() { - return $(this).html() == "Viacoin"; + return $(this).html() == "VIA - Viacoin"; }).prop("selected", true); $(".network").trigger("change"); }); @@ -491,7 +491,7 @@ page.open(url, function(status) { $(".phrase").trigger("input"); $(".network option[selected]").removeAttr("selected"); $(".network option").filter(function() { - return $(this).html() == "Viacoin Testnet"; + return $(this).html() == "VIA - Viacoin Testnet"; }).prop("selected", true); $(".network").trigger("change"); }); @@ -521,7 +521,7 @@ page.open(url, function(status) { $(".phrase").trigger("input"); $(".network option[selected]").removeAttr("selected"); $(".network option").filter(function() { - return $(this).html() == "Jumbucks"; + return $(this).html() == "JBS - Jumbucks"; }).prop("selected", true); $(".network").trigger("change"); }); @@ -551,7 +551,7 @@ page.open(url, function(status) { $(".phrase").trigger("input"); $(".network option[selected]").removeAttr("selected"); $(".network option").filter(function() { - return $(this).html() == "CLAM"; + return $(this).html() == "CLAM - Clams"; }).prop("selected", true); $(".network").trigger("change"); }); @@ -571,6 +571,36 @@ page.open(url, function(status) { }); }, +// Network can be set to crown +function() { +page.open(url, function(status) { + // set the phrase and coin + var expected = "18pWSwSUAQdiwMHUfFZB1fM2xue9X1FqE5"; + page.evaluate(function() { + $(".phrase").val("abandon abandon ability"); + $(".phrase").trigger("input"); + $(".network option[selected]").removeAttr("selected"); + $(".network option").filter(function() { + return $(this).html() == "CRW - Crown"; + }).prop("selected", true); + $(".network").trigger("change"); + }); + // check the address is generated correctly + waitForGenerate(function() { + var actual = page.evaluate(function() { + return $(".address:first").text(); + }); + if (actual != expected) { + console.log("CRW address is incorrect"); + console.log("Expected: " + expected); + console.log("Actual: " + actual); + fail(); + } + next(); + }); +}); +}, + // Network can be set to dash function() { page.open(url, function(status) { @@ -581,7 +611,7 @@ page.open(url, function(status) { $(".phrase").trigger("input"); $(".network option[selected]").removeAttr("selected"); $(".network option").filter(function() { - return $(this).html() == "DASH"; + return $(this).html() == "DASH - Dash"; }).prop("selected", true); $(".network").trigger("change"); }); @@ -610,7 +640,7 @@ page.open(url, function(status) { $(".phrase").trigger("input"); $(".network option[selected]").removeAttr("selected"); $(".network option").filter(function() { - return $(this).html() == "DASH Testnet"; + return $(this).html() == "DASH - Dash Testnet"; }).prop("selected", true); $(".network").trigger("change"); }); @@ -640,7 +670,7 @@ page.open(url, function(status) { $(".phrase").trigger("input"); $(".network option[selected]").removeAttr("selected"); $(".network option").filter(function() { - return $(this).html() == "GAME"; + return $(this).html() == "GAME - GameCredits"; }).prop("selected", true); $(".network").trigger("change"); }); @@ -670,7 +700,7 @@ page.open(url, function(status) { $(".phrase").trigger("input"); $(".network option[selected]").removeAttr("selected"); $(".network option").filter(function() { - return $(this).html() == "Namecoin"; + return $(this).html() == "NMC - Namecoin"; }).prop("selected", true); $(".network").trigger("change"); }); @@ -700,7 +730,7 @@ page.open(url, function(status) { $(".phrase").trigger("input"); $(".network option[selected]").removeAttr("selected"); $(".network option").filter(function() { - return $(this).html() == "Peercoin"; + return $(this).html() == "PPC - Peercoin"; }).prop("selected", true); $(".network").trigger("change"); }); @@ -731,7 +761,7 @@ page.open(url, function(status) { $(".phrase").trigger("input"); $(".network option[selected]").removeAttr("selected"); $(".network option").filter(function() { - return $(this).html() == "Ethereum"; + return $(this).html() == "ETH - Ethereum"; }).prop("selected", true); $(".network").trigger("change"); }); @@ -792,7 +822,7 @@ page.open(url, function(status) { $(".phrase").trigger("input"); $(".network option[selected]").removeAttr("selected"); $(".network option").filter(function() { - return $(this).html() == "Slimcoin"; + return $(this).html() == "SLM - Slimcoin"; }).prop("selected", true); $(".network").trigger("change"); }); @@ -822,7 +852,7 @@ page.open(url, function(status) { $(".phrase").trigger("input"); $(".network option[selected]").removeAttr("selected"); $(".network option").filter(function() { - return $(this).html() == "Slimcoin Testnet"; + return $(this).html() == "SLM - Slimcoin Testnet"; }).prop("selected", true); $(".network").trigger("change"); }); @@ -2014,7 +2044,7 @@ page.open(url, function(status) { // 4) switch from bitcoin to litecoin page.evaluate(function() { $(".network option").filter(function() { - return $(this).html() == "Litecoin"; + return $(this).html() == "LTC - Litecoin"; }).prop("selected", true); $(".network").trigger("change"); }); @@ -2060,7 +2090,7 @@ page.open(url, function(status) { // switch from bitcoin to clam page.evaluate(function() { $(".network option").filter(function() { - return $(this).html() == "CLAM"; + return $(this).html() == "CLAM - Clams"; }).prop("selected", true); $(".network").trigger("change"); }); @@ -2094,7 +2124,7 @@ page.open(url, function(status) { // 4) switch from bitcoin to viacoin page.evaluate(function() { $(".network option").filter(function() { - return $(this).html() == "Viacoin"; + return $(this).html() == "VIA - Viacoin"; }).prop("selected", true); $(".network").trigger("change"); });