aboutsummaryrefslogtreecommitdiff
path: root/src/js
diff options
context:
space:
mode:
authoriancoleman <1281387+iancoleman@users.noreply.github.com>2020-02-17 10:33:08 +1100
committerGitHub <noreply@github.com>2020-02-17 10:33:08 +1100
commitff2940e81e79658434ee851729f1f4eb8405b756 (patch)
tree965ec8664fe00d01c034bf4ce21b6a1bec64d9de /src/js
parent90f7a5ec9309c755dd06a534190067fa6f1f97fe (diff)
parentf3101bd3f1a808ba2baa6969df2f0158b4b86b15 (diff)
downloadBIP39-ff2940e81e79658434ee851729f1f4eb8405b756.tar.gz
BIP39-ff2940e81e79658434ee851729f1f4eb8405b756.tar.zst
BIP39-ff2940e81e79658434ee851729f1f4eb8405b756.zip
Merge pull request #403 from swtcca/master
add two networks: Jingtum and MOAC
Diffstat (limited to 'src/js')
-rw-r--r--src/js/index.js21
-rw-r--r--src/js/jingtum-util.js10
2 files changed, 31 insertions, 0 deletions
diff --git a/src/js/index.js b/src/js/index.js
index 3981e81..c2d34a7 100644
--- a/src/js/index.js
+++ b/src/js/index.js
@@ -1165,6 +1165,11 @@
1165 privkey = convertRipplePriv(privkey); 1165 privkey = convertRipplePriv(privkey);
1166 address = convertRippleAdrr(address); 1166 address = convertRippleAdrr(address);
1167 } 1167 }
1168 // Jingtum values are different
1169 if (networks[DOM.network.val()].name == "SWTC - Jingtum") {
1170 privkey = convertJingtumPriv(privkey);
1171 address = convertJingtumAdrr(address);
1172 }
1168 // CasinoCoin values are different 1173 // CasinoCoin values are different
1169 if (networks[DOM.network.val()].name == "CSC - CasinoCoin") { 1174 if (networks[DOM.network.val()].name == "CSC - CasinoCoin") {
1170 privkey = convertCasinoCoinPriv(privkey); 1175 privkey = convertCasinoCoinPriv(privkey);
@@ -1832,6 +1837,7 @@
1832 || (name == "EWT - EnergyWeb") 1837 || (name == "EWT - EnergyWeb")
1833 || (name == "PIRL - Pirl") 1838 || (name == "PIRL - Pirl")
1834 || (name == "MIX - MIX") 1839 || (name == "MIX - MIX")
1840 || (name == "MOAC - MOAC")
1835 || (name == "MUSIC - Musicoin") 1841 || (name == "MUSIC - Musicoin")
1836 || (name == "POA - Poa") 1842 || (name == "POA - Poa")
1837 || (name == "EXP - Expanse") 1843 || (name == "EXP - Expanse")
@@ -2739,6 +2745,14 @@
2739 }, 2745 },
2740 }, 2746 },
2741 { 2747 {
2748 name: "MOAC - MOAC",
2749 segwitAvailable: false,
2750 onSelect: function() {
2751 network = libs.bitcoin.networks.bitcoin;
2752 setHdCoin(314);
2753 },
2754 },
2755 {
2742 name: "MUSIC - Musicoin", 2756 name: "MUSIC - Musicoin",
2743 segwitAvailable: false, 2757 segwitAvailable: false,
2744 onSelect: function() { 2758 onSelect: function() {
@@ -3078,6 +3092,13 @@
3078 }, 3092 },
3079 }, 3093 },
3080 { 3094 {
3095 name: "SWTC - Jingtum",
3096 onSelect: function() {
3097 network = libs.bitcoin.networks.bitcoin;
3098 setHdCoin(315);
3099 },
3100 },
3101 {
3081 name: "TSTRAT - Stratis Testnet", 3102 name: "TSTRAT - Stratis Testnet",
3082 onSelect: function() { 3103 onSelect: function() {
3083 network = libs.bitcoin.networks.stratistest; 3104 network = libs.bitcoin.networks.stratistest;
diff --git a/src/js/jingtum-util.js b/src/js/jingtum-util.js
new file mode 100644
index 0000000..56dbec6
--- /dev/null
+++ b/src/js/jingtum-util.js
@@ -0,0 +1,10 @@
1function convertJingtumAdrr(address) {
2 return libs.basex('jpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65rkm8oFqi1tuvAxyz').encode(
3 libs.basex('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz').decode(address)
4 )
5 }
6
7function convertJingtumPriv(priv) {
8 return libs.basex('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz').decode(priv).toString("hex").slice(2,66)
9}
10