diff options
author | Lospring Liu <lospringliu@gmail.com> | 2020-02-14 20:51:52 -0500 |
---|---|---|
committer | Lospring Liu <lospringliu@gmail.com> | 2020-02-14 20:51:52 -0500 |
commit | 46a5338e4238e140615307fd5df86e78b976cbc2 (patch) | |
tree | 0a46e365db4c3d942792e750958f3f87f34d0525 /src | |
parent | 90f7a5ec9309c755dd06a534190067fa6f1f97fe (diff) | |
download | BIP39-46a5338e4238e140615307fd5df86e78b976cbc2.tar.gz BIP39-46a5338e4238e140615307fd5df86e78b976cbc2.tar.zst BIP39-46a5338e4238e140615307fd5df86e78b976cbc2.zip |
add two networks: Jingtum and MOAC
Diffstat (limited to 'src')
-rw-r--r-- | src/index.html | 1 | ||||
-rw-r--r-- | src/js/index.js | 21 | ||||
-rw-r--r-- | src/js/jingtum-util.js | 10 |
3 files changed, 32 insertions, 0 deletions
diff --git a/src/index.html b/src/index.html index d486fa2..1184a0c 100644 --- a/src/index.html +++ b/src/index.html | |||
@@ -963,6 +963,7 @@ | |||
963 | <script src="js/bitcoinjs-extensions.js"></script> | 963 | <script src="js/bitcoinjs-extensions.js"></script> |
964 | <script src="js/segwit-parameters.js"></script> | 964 | <script src="js/segwit-parameters.js"></script> |
965 | <script src="js/ripple-util.js"></script> | 965 | <script src="js/ripple-util.js"></script> |
966 | <script src="js/jingtum-util.js"></script> | ||
966 | <script src="js/casinocoin-util.js"></script> | 967 | <script src="js/casinocoin-util.js"></script> |
967 | <script src="js/eos-util.js"></script> | 968 | <script src="js/eos-util.js"></script> |
968 | <script src="js/sjcl-bip39.js"></script> | 969 | <script src="js/sjcl-bip39.js"></script> |
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 @@ | |||
1 | function convertJingtumAdrr(address) { | ||
2 | return libs.basex('jpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65rkm8oFqi1tuvAxyz').encode( | ||
3 | libs.basex('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz').decode(address) | ||
4 | ) | ||
5 | } | ||
6 | |||
7 | function convertJingtumPriv(priv) { | ||
8 | return libs.basex('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz').decode(priv).toString("hex").slice(2,66) | ||
9 | } | ||
10 | |||