diff options
author | iancoleman <1281387+iancoleman@users.noreply.github.com> | 2019-08-01 10:02:07 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-01 10:02:07 +1000 |
commit | e440d504fbc80fe11366e24dccf945c43aaf52df (patch) | |
tree | 1bdd8b74a0ab6cb5c99365cd08d0a79c96f22003 /src/js | |
parent | 786cd442cdb9f185b8b3fdcb8c54a9cb8fed9290 (diff) | |
parent | 45e40c288fe0d6cfba2c57a68f421eeb34d41385 (diff) | |
download | BIP39-e440d504fbc80fe11366e24dccf945c43aaf52df.tar.gz BIP39-e440d504fbc80fe11366e24dccf945c43aaf52df.tar.zst BIP39-e440d504fbc80fe11366e24dccf945c43aaf52df.zip |
Merge pull request #345 from flyfoxuk/master
Added CSC (CasinoCoin) with test
Diffstat (limited to 'src/js')
-rw-r--r-- | src/js/casinocoin-util.js | 10 | ||||
-rw-r--r-- | src/js/index.js | 12 |
2 files changed, 22 insertions, 0 deletions
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 @@ | |||
1 | function convertCasinoCoinAdrr(address) { | ||
2 | return window.basex('cpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2brdeCg65jkm8oFqi1tuvAxyz').encode( | ||
3 | window.basex('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz').decode(address) | ||
4 | ) | ||
5 | } | ||
6 | |||
7 | function convertCasinoCoinPriv(priv) { | ||
8 | return window.basex('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz').decode(priv).toString("hex").slice(2,66) | ||
9 | } | ||
10 | |||
diff --git a/src/js/index.js b/src/js/index.js index 3afa598..4fac6f1 100644 --- a/src/js/index.js +++ b/src/js/index.js | |||
@@ -959,6 +959,11 @@ | |||
959 | privkey = convertRipplePriv(privkey); | 959 | privkey = convertRipplePriv(privkey); |
960 | address = convertRippleAdrr(address); | 960 | address = convertRippleAdrr(address); |
961 | } | 961 | } |
962 | // CasinoCoin values are different | ||
963 | if (networks[DOM.network.val()].name == "CSC - CasinoCoin") { | ||
964 | privkey = convertCasinoCoinPriv(privkey); | ||
965 | address = convertCasinoCoinAdrr(address); | ||
966 | } | ||
962 | // Bitcoin Cash address format may vary | 967 | // Bitcoin Cash address format may vary |
963 | if (networks[DOM.network.val()].name == "BCH - Bitcoin Cash") { | 968 | if (networks[DOM.network.val()].name == "BCH - Bitcoin Cash") { |
964 | var bchAddrType = DOM.bitcoinCashAddressType.filter(":checked").val(); | 969 | var bchAddrType = DOM.bitcoinCashAddressType.filter(":checked").val(); |
@@ -1931,6 +1936,13 @@ | |||
1931 | }, | 1936 | }, |
1932 | }, | 1937 | }, |
1933 | { | 1938 | { |
1939 | name: "CSC - CasinoCoin", | ||
1940 | onSelect: function() { | ||
1941 | network = bitcoinjs.bitcoin.networks.bitcoin; | ||
1942 | setHdCoin(359); | ||
1943 | }, | ||
1944 | }, | ||
1945 | { | ||
1934 | name: "DASH - Dash", | 1946 | name: "DASH - Dash", |
1935 | onSelect: function() { | 1947 | onSelect: function() { |
1936 | network = bitcoinjs.bitcoin.networks.dash; | 1948 | network = bitcoinjs.bitcoin.networks.dash; |