Compare commits

...

4 Commits
0.1.1 ... 0.1.2

Author SHA1 Message Date
Ian Coleman
039a98ba5a Release v0.1.2 2017-07-03 11:00:41 +10:00
iancoleman
9dab7e5d0c Merge pull request #81 from mikeyb/naming
Add CRW / Change bip44 dropdown naming convention
2017-07-03 10:42:20 +10:00
mikeyb
534481b628 standardize dropdown naming scheme 2017-07-02 09:44:54 -07:00
mikeyb
0921f37077 Add CRW - Crown 2017-07-01 15:38:46 -07:00
6 changed files with 150 additions and 81 deletions

View File

@@ -118,7 +118,7 @@
<div class="container">
<h1 class="text-center">Mnemonic Code Converter</h1>
<p class="version">v0.1.1</p>
<p class="version">v0.1.2</p>
<hr>
<div class="row">
<div class="col-md-12">
@@ -19902,6 +19902,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,
@@ -44319,7 +44329,7 @@ window.Entropy = new (function() {
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 @@ window.Entropy = new (function() {
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 @@ window.Entropy = new (function() {
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 = [

View File

@@ -1,3 +1,8 @@
# 0.1.2
* Add Crown network
* Network names are displayed with currency code
# 0.1.1
* Add DASH Testnet

View File

@@ -114,7 +114,7 @@
<div class="container">
<h1 class="text-center">Mnemonic Code Converter</h1>
<p class="version">v0.1.1</p>
<p class="version">v0.1.2</p>
<hr>
<div class="row">
<div class="col-md-12">

View File

@@ -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,

View File

@@ -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 = [

View File

@@ -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");
});