From 45e40c288fe0d6cfba2c57a68f421eeb34d41385 Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 18 Jul 2019 11:50:14 +0100 Subject: Added CSC (CasinoCoin) with test --- src/index.html | 1 + src/js/casinocoin-util.js | 10 ++++++++++ src/js/index.js | 12 ++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 src/js/casinocoin-util.js (limited to 'src') diff --git a/src/index.html b/src/index.html index 8cd4518..7dd3e9e 100644 --- a/src/index.html +++ b/src/index.html @@ -926,6 +926,7 @@ + diff --git a/src/js/casinocoin-util.js b/src/js/casinocoin-util.js new file mode 100644 index 0000000..f76e989 --- /dev/null +++ b/src/js/casinocoin-util.js @@ -0,0 +1,10 @@ +function convertCasinoCoinAdrr(address) { + return window.basex('cpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2brdeCg65jkm8oFqi1tuvAxyz').encode( + window.basex('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz').decode(address) + ) + } + +function convertCasinoCoinPriv(priv) { + return window.basex('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz').decode(priv).toString("hex").slice(2,66) +} + diff --git a/src/js/index.js b/src/js/index.js index 52b0db5..bda124c 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -959,6 +959,11 @@ privkey = convertRipplePriv(privkey); address = convertRippleAdrr(address); } + // CasinoCoin values are different + if (networks[DOM.network.val()].name == "CSC - CasinoCoin") { + privkey = convertCasinoCoinPriv(privkey); + address = convertCasinoCoinAdrr(address); + } // Bitcoin Cash address format may vary if (networks[DOM.network.val()].name == "BCH - Bitcoin Cash") { var bchAddrType = DOM.bitcoinCashAddressType.filter(":checked").val(); @@ -1923,6 +1928,13 @@ setHdCoin(72); }, }, + { + name: "CSC - CasinoCoin", + onSelect: function() { + network = bitcoinjs.bitcoin.networks.bitcoin; + setHdCoin(359); + }, + }, { name: "DASH - Dash", onSelect: function() { -- cgit v1.2.3