From 7594405011b91075725790ab480d5fded0b689c9 Mon Sep 17 00:00:00 2001 From: Jang Chongchan Date: Tue, 28 Apr 2020 23:32:24 +0900 Subject: Add Sugarchain testnet support --- src/js/bitcoinjs-extensions.js | 11 +++++++++++ src/js/index.js | 7 +++++++ src/js/segwit-parameters.js | 26 ++++++++++++++++++++++++++ 3 files changed, 44 insertions(+) (limited to 'src') 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 = { wif: 0x80 }; +libs.bitcoin.networks.sugarchaintestnet = { + messagePrefix: '\x18Sugarchain Signed Message:\n', + bip32: { + public: 0x045f1cf6, + private: 0x045f18bc, + }, + pubKeyHash: 0x42, + scriptHash: 0x80, + wif: 0xef +}; + // https://github.com/libs.bitcoinjs-lib/blob/3f6f5ef97a1ee1b8337865209282c0095e22b2e7/src/networks.js libs.bitcoin.networks.regtest = { 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 @@ -3105,6 +3105,13 @@ setHdCoin(408); }, }, + { + name: "TUGAR - Sugarchain Testnet", + onSelect: function() { + network = libs.bitcoin.networks.sugarchaintestnet; + setHdCoin(408); + }, + }, { name: "SWTC - Jingtum", onSelect: function() { 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 = { wif: 0x80 }; +libs.bitcoin.networks.sugarchaintestnet.p2wpkh = { + baseNetwork: "sugarchaintestnet", + messagePrefix: '\x18Sugarchain Signed Message:\n', + bech32: 'tugar', + bip32: { + public: 0x045f1cf6, + private: 0x045f18bc + }, + pubKeyHash: 0x42, + scriptHash: 0x80, + wif: 0xef +}; + +libs.bitcoin.networks.sugarchaintestnet.p2wpkhInP2sh = { + baseNetwork: "sugarchaintestnet", + messagePrefix: '\x18Sugarchain Signed Message:\n', + bech32: 'tugar', + bip32: { + public: 0x044a5262, + private: 0x044a4e28 + }, + pubKeyHash: 0x42, + scriptHash: 0x80, + wif: 0xef +}; + })(); -- cgit v1.2.3