diff options
author | iancoleman <1281387+iancoleman@users.noreply.github.com> | 2020-04-29 08:26:37 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-29 08:26:37 +1000 |
commit | 0d78c2a120823fef7aa67d02401087533b3fd4c8 (patch) | |
tree | 576ec68fbe688ab4758f189a7009999542026248 /src/js | |
parent | d359fe64b2f43f59714815d7ec5e1c82de50afd0 (diff) | |
parent | 7594405011b91075725790ab480d5fded0b689c9 (diff) | |
download | BIP39-0d78c2a120823fef7aa67d02401087533b3fd4c8.tar.gz BIP39-0d78c2a120823fef7aa67d02401087533b3fd4c8.tar.zst BIP39-0d78c2a120823fef7aa67d02401087533b3fd4c8.zip |
Merge pull request #418 from jangchongchan20/master
Add Sugarchain testnet support
Diffstat (limited to 'src/js')
-rw-r--r-- | src/js/bitcoinjs-extensions.js | 11 | ||||
-rw-r--r-- | src/js/index.js | 7 | ||||
-rw-r--r-- | src/js/segwit-parameters.js | 26 |
3 files changed, 44 insertions, 0 deletions
diff --git a/src/js/bitcoinjs-extensions.js b/src/js/bitcoinjs-extensions.js index e331c24..2792e13 100644 --- a/src/js/bitcoinjs-extensions.js +++ b/src/js/bitcoinjs-extensions.js | |||
@@ -1750,6 +1750,17 @@ libs.bitcoin.networks.sugarchain = { | |||
1750 | wif: 0x80 | 1750 | wif: 0x80 |
1751 | }; | 1751 | }; |
1752 | 1752 | ||
1753 | libs.bitcoin.networks.sugarchaintestnet = { | ||
1754 | messagePrefix: '\x18Sugarchain Signed Message:\n', | ||
1755 | bip32: { | ||
1756 | public: 0x045f1cf6, | ||
1757 | private: 0x045f18bc, | ||
1758 | }, | ||
1759 | pubKeyHash: 0x42, | ||
1760 | scriptHash: 0x80, | ||
1761 | wif: 0xef | ||
1762 | }; | ||
1763 | |||
1753 | // https://github.com/libs.bitcoinjs-lib/blob/3f6f5ef97a1ee1b8337865209282c0095e22b2e7/src/networks.js | 1764 | // https://github.com/libs.bitcoinjs-lib/blob/3f6f5ef97a1ee1b8337865209282c0095e22b2e7/src/networks.js |
1754 | libs.bitcoin.networks.regtest = { | 1765 | libs.bitcoin.networks.regtest = { |
1755 | messagePrefix: '\x18Bitcoin Signed Message:\n', | 1766 | messagePrefix: '\x18Bitcoin Signed Message:\n', |
diff --git a/src/js/index.js b/src/js/index.js index 0471e86..f00d90b 100644 --- a/src/js/index.js +++ b/src/js/index.js | |||
@@ -3106,6 +3106,13 @@ | |||
3106 | }, | 3106 | }, |
3107 | }, | 3107 | }, |
3108 | { | 3108 | { |
3109 | name: "TUGAR - Sugarchain Testnet", | ||
3110 | onSelect: function() { | ||
3111 | network = libs.bitcoin.networks.sugarchaintestnet; | ||
3112 | setHdCoin(408); | ||
3113 | }, | ||
3114 | }, | ||
3115 | { | ||
3109 | name: "SWTC - Jingtum", | 3116 | name: "SWTC - Jingtum", |
3110 | onSelect: function() { | 3117 | onSelect: function() { |
3111 | network = libs.bitcoin.networks.bitcoin; | 3118 | network = libs.bitcoin.networks.bitcoin; |
diff --git a/src/js/segwit-parameters.js b/src/js/segwit-parameters.js index 0c41bf7..ea6f86e 100644 --- a/src/js/segwit-parameters.js +++ b/src/js/segwit-parameters.js | |||
@@ -709,4 +709,30 @@ libs.bitcoin.networks.sugarchain.p2wpkhInP2sh = { | |||
709 | wif: 0x80 | 709 | wif: 0x80 |
710 | }; | 710 | }; |
711 | 711 | ||
712 | libs.bitcoin.networks.sugarchaintestnet.p2wpkh = { | ||
713 | baseNetwork: "sugarchaintestnet", | ||
714 | messagePrefix: '\x18Sugarchain Signed Message:\n', | ||
715 | bech32: 'tugar', | ||
716 | bip32: { | ||
717 | public: 0x045f1cf6, | ||
718 | private: 0x045f18bc | ||
719 | }, | ||
720 | pubKeyHash: 0x42, | ||
721 | scriptHash: 0x80, | ||
722 | wif: 0xef | ||
723 | }; | ||
724 | |||
725 | libs.bitcoin.networks.sugarchaintestnet.p2wpkhInP2sh = { | ||
726 | baseNetwork: "sugarchaintestnet", | ||
727 | messagePrefix: '\x18Sugarchain Signed Message:\n', | ||
728 | bech32: 'tugar', | ||
729 | bip32: { | ||
730 | public: 0x044a5262, | ||
731 | private: 0x044a4e28 | ||
732 | }, | ||
733 | pubKeyHash: 0x42, | ||
734 | scriptHash: 0x80, | ||
735 | wif: 0xef | ||
736 | }; | ||
737 | |||
712 | })(); | 738 | })(); |