Skip to content

Commit

Permalink
Merge pull request #81 from mikeyb/naming
Browse files Browse the repository at this point in the history
Add CRW / Change bip44 dropdown naming convention
  • Loading branch information
iancoleman authored Jul 3, 2017
2 parents f1e5d48 + 534481b commit 9dab7e5
Show file tree
Hide file tree
Showing 4 changed files with 143 additions and 79 deletions.
75 changes: 46 additions & 29 deletions bip39-standalone.html
Original file line number Diff line number Diff line change
Expand Up @@ -19902,6 +19902,16 @@ <h3 data-translate>Libraries</h3>
wif: 0x85,
};

bitcoin.networks.crown = {
bip32: {
public: 0x0488b21e,
private: 0x0488ade4
},
pubKeyHash: 0x00,
scriptHash: 0x05,
wif: 0x80,
};

bitcoin.networks.dash = {
bip32: {
public: 0x0488b21e,
Expand Down Expand Up @@ -44319,7 +44329,7 @@ <h3 data-translate>Libraries</h3>
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);
Expand All @@ -44330,7 +44340,7 @@ <h3 data-translate>Libraries</h3>
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);
}
Expand Down Expand Up @@ -44791,138 +44801,145 @@ <h3 data-translate>Libraries</h3>

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 = [
Expand Down
10 changes: 10 additions & 0 deletions src/js/bitcoinjs-extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading

0 comments on commit 9dab7e5

Please sign in to comment.