mirror of
https://github.com/OneKeyHQ/bip39.git
synced 2026-05-24 09:34:44 +00:00
add bitcoin private testnet support
This commit is contained in:
@@ -1531,6 +1531,17 @@ libs.bitcoin.networks.bitcoinprivate = {
|
|||||||
wif: 0x80,
|
wif: 0x80,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
libs.bitcoin.networks.bitcoinprivatetestnet = {
|
||||||
|
messagePrefix: '\x18BitcoinPrivate Signed Message:\n',
|
||||||
|
bip32: {
|
||||||
|
public: 0x043587CF,
|
||||||
|
private: 0x04358394,
|
||||||
|
},
|
||||||
|
pubKeyHash: 0x1957,
|
||||||
|
scriptHash: 0x19E0,
|
||||||
|
wif: 0xEF,
|
||||||
|
};
|
||||||
|
|
||||||
libs.bitcoin.networks.bitcoinz = {
|
libs.bitcoin.networks.bitcoinz = {
|
||||||
messagePrefix: '\x18BitcoinZ Signed Message:\n',
|
messagePrefix: '\x18BitcoinZ Signed Message:\n',
|
||||||
bip32: {
|
bip32: {
|
||||||
|
|||||||
+12
-5
@@ -1350,21 +1350,21 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ZooBC address format may vary
|
// ZooBC address format may vary
|
||||||
if (networks[DOM.network.val()].name == "ZBC - ZooBlockchain") {
|
if (networks[DOM.network.val()].name == "ZBC - ZooBlockchain") {
|
||||||
|
|
||||||
var purpose = parseIntNoNaN(DOM.bip44purpose.val(), 44);
|
var purpose = parseIntNoNaN(DOM.bip44purpose.val(), 44);
|
||||||
var coin = parseIntNoNaN(DOM.bip44coin.val(), 0);
|
var coin = parseIntNoNaN(DOM.bip44coin.val(), 0);
|
||||||
var path = "m/";
|
var path = "m/";
|
||||||
path += purpose + "'/";
|
path += purpose + "'/";
|
||||||
path += coin + "'/" + index + "'";
|
path += coin + "'/" + index + "'";
|
||||||
var result = libs.zoobcUtil.getKeypair(path, seed);
|
var result = libs.zoobcUtil.getKeypair(path, seed);
|
||||||
|
|
||||||
let publicKey = result.pubKey.slice(1, 33);
|
let publicKey = result.pubKey.slice(1, 33);
|
||||||
let privateKey = result.key;
|
let privateKey = result.key;
|
||||||
|
|
||||||
privkey = privateKey.toString('hex');
|
privkey = privateKey.toString('hex');
|
||||||
pubkey = publicKey.toString('hex');
|
pubkey = publicKey.toString('hex');
|
||||||
|
|
||||||
indexText = path;
|
indexText = path;
|
||||||
address = libs.zoobcUtil.getZBCAddress(publicKey, 'ZBC');
|
address = libs.zoobcUtil.getZBCAddress(publicKey, 'ZBC');
|
||||||
}
|
}
|
||||||
@@ -2389,6 +2389,13 @@
|
|||||||
setHdCoin(183);
|
setHdCoin(183);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "BTCPt - Bitcoin Private Testnet",
|
||||||
|
onSelect: function() {
|
||||||
|
network = libs.bitcoin.networks.bitcoinprivatetestnet;
|
||||||
|
setHdCoin(1);
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "BSC - Binance Smart Chain",
|
name: "BSC - Binance Smart Chain",
|
||||||
onSelect: function() {
|
onSelect: function() {
|
||||||
|
|||||||
@@ -987,6 +987,16 @@ it('Allows selection of Bitcoin Private', function(done) {
|
|||||||
};
|
};
|
||||||
testNetwork(done, params);
|
testNetwork(done, params);
|
||||||
});
|
});
|
||||||
|
it('Allows selection of Bitcoin Private testnet', function(done) {
|
||||||
|
var params = {
|
||||||
|
selectText: "BTCPt - Bitcoin Private Testnet",
|
||||||
|
phrase: "abandon abandon ability",
|
||||||
|
firstAddress: "n1UcUUSDfDppfzh7XLJNHmZkLdbTQg3VAZL",
|
||||||
|
firstPubKey: "0382a5450765e2025bdb5f7d109c9254a11ef97a566228bf171d80ecb348763bb0",
|
||||||
|
firstPrivKey: "cV3coiYD2NhHKfhC6Gb8DzpvPzcGYYExYxuNxpUtKq3VUJrkFLZx",
|
||||||
|
};
|
||||||
|
testNetwork(done, params);
|
||||||
|
});
|
||||||
it('Allows selection of Bitcoin SV', function(done) {
|
it('Allows selection of Bitcoin SV', function(done) {
|
||||||
var params = {
|
var params = {
|
||||||
selectText: "BSV - BitcoinSV",
|
selectText: "BSV - BitcoinSV",
|
||||||
|
|||||||
Reference in New Issue
Block a user