mirror of
https://github.com/OneKeyHQ/bip39.git
synced 2026-04-05 18:43:47 +00:00
ADD support MONK, LTCt, DOGEt
This commit is contained in:
committed by
Panagiotis David
parent
22bb112ead
commit
b85da0745a
@@ -47,14 +47,14 @@ bitcoinjs.bitcoin.networks.crown = {
|
||||
|
||||
var addrBytes = b58.decode(oldAddress);
|
||||
|
||||
var hash160 = new Uint16Array(23);
|
||||
var hash160 = new Uint16Array(23);
|
||||
hash160[0]= 0x01; //C
|
||||
hash160[1]= 0x75; //R
|
||||
hash160[2]= 0x07; //W
|
||||
addrBytes.copy(hash160, 3, 1, 21);
|
||||
|
||||
var checksum = bitcoinjs.bitcoin.crypto.hash256(hash160).subarray(0, 4);
|
||||
var binaryAddr = new Uint16Array(27);
|
||||
var binaryAddr = new Uint16Array(27);
|
||||
binaryAddr.set(hash160,0);
|
||||
checksum.copy(binaryAddr, 23, 0, 4);
|
||||
var newAddress = b58.encode(binaryAddr);
|
||||
@@ -172,6 +172,17 @@ bitcoinjs.bitcoin.networks.dogecoin = {
|
||||
wif: 0x9e
|
||||
};
|
||||
|
||||
bitcoinjs.bitcoin.networks.dogecointestnet = {
|
||||
messagePrefix: '\x19Dogecoin Signed Message:\n',
|
||||
bip32: {
|
||||
public: 0x043587cf,
|
||||
private: 0x04358394
|
||||
},
|
||||
pubKeyHash: 0x71,
|
||||
scriptHash: 0xc4,
|
||||
wif: 0xf1
|
||||
};
|
||||
|
||||
bitcoinjs.bitcoin.networks.denarius = {
|
||||
messagePrefix: '\x19Denarius Signed Message:\n',
|
||||
bip32: {
|
||||
@@ -878,6 +889,17 @@ bitcoinjs.bitcoin.networks.linx = {
|
||||
wif: 0xcb,
|
||||
};
|
||||
|
||||
|
||||
bitcoinjs.bitcoin.networks.litecointestnet = {
|
||||
messagePrefix: '\x18Litecoin Signed Message:\n',
|
||||
bip32: {
|
||||
public: 0x043587cf,
|
||||
private: 0x04358394,
|
||||
},
|
||||
pubKeyHash: 0x6f,
|
||||
scriptHash: 0xc4,
|
||||
wif: 0xef,
|
||||
};
|
||||
bitcoinjs.bitcoin.networks.litecoincash = {
|
||||
messagePrefix: '\x18Litecoin Signed Message:\n',
|
||||
bip32: {
|
||||
@@ -1549,3 +1571,14 @@ bitcoinjs.bitcoin.networks.deeponion = {
|
||||
scriptHash: 0x4E,
|
||||
wif: 0x9F,
|
||||
};
|
||||
|
||||
bitcoinjs.bitcoin.networks.monkey = {
|
||||
messagePrefix: 'x18DarkNet Signed Message:\n',
|
||||
bip32: {
|
||||
public: 0x0488B21E,
|
||||
private: 0x0488ADE4,
|
||||
},
|
||||
pubKeyHash: 0x7F,
|
||||
scriptHash: 0xC4,
|
||||
wif: 0x3F,
|
||||
};
|
||||
|
||||
@@ -980,11 +980,11 @@
|
||||
address = bitcoinjs.bitcoin.address.fromOutputScript(scriptpubkey, network)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ((networks[DOM.network.val()].name == "CRW - Crown")) {
|
||||
address = bitcoinjs.bitcoin.networks.crown.toNewAddress(address);
|
||||
}
|
||||
|
||||
|
||||
addAddressToList(indexText, address, pubkey, privkey);
|
||||
if (isLast) {
|
||||
hidePending();
|
||||
@@ -1959,6 +1959,13 @@
|
||||
setHdCoin(3);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "DOGEt - Dogecoin Testnet",
|
||||
onSelect: function() {
|
||||
network = bitcoinjs.bitcoin.networks.dogecointestnet;
|
||||
setHdCoin(1);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "DXN - DEXON",
|
||||
onSelect: function() {
|
||||
@@ -2212,6 +2219,14 @@
|
||||
DOM.litecoinLtubContainer.removeClass("hidden");
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "LTCt - Litecoin Testnet",
|
||||
onSelect: function() {
|
||||
network = bitcoinjs.bitcoin.networks.litecointestnet;
|
||||
setHdCoin(1);
|
||||
DOM.litecoinLtubContainer.removeClass("hidden");
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "LTZ - LitecoinZ",
|
||||
onSelect: function() {
|
||||
@@ -2756,6 +2771,13 @@
|
||||
setHdCoin(121);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "MONK - Monkey Project",
|
||||
` onSelect: function() {
|
||||
network = bitcoinjs.bitcoin.networks.monkey;
|
||||
setHdCoin(214);
|
||||
},
|
||||
}
|
||||
]
|
||||
|
||||
var clients = [
|
||||
|
||||
@@ -408,6 +408,13 @@ it('Allows selection of litecoin', function(done) {
|
||||
};
|
||||
testNetwork(done, params);
|
||||
});
|
||||
it('Allows selection of litecoin testnet', function(done) {
|
||||
var params = {
|
||||
selectText: "LTCt - Litecoin Testnet",
|
||||
firstAddress: "mucaU5iiDaJDb69BHLeDv8JFfGiyg2nJKi",
|
||||
};
|
||||
testNetwork(done, params);
|
||||
});
|
||||
it('Allows selection of ripple', function(done) {
|
||||
var params = {
|
||||
selectText: "XRP - Ripple",
|
||||
@@ -423,6 +430,13 @@ it('Allows selection of dogecoin', function(done) {
|
||||
};
|
||||
testNetwork(done, params);
|
||||
});
|
||||
it('Allows selection of dogecoin testnet', function(done) {
|
||||
var params = {
|
||||
selectText: "DOGEt - Dogecoin testnet",
|
||||
firstAddress: "niHnSJKHdwDyDxRMLBJrtNqpvHEsAFWe6B",
|
||||
};
|
||||
testNetwork(done, params);
|
||||
});
|
||||
it('Allows selection of denarius', function(done) {
|
||||
var params = {
|
||||
selectText: "DNR - Denarius",
|
||||
@@ -475,7 +489,7 @@ it('Allows selection of clam', function(done) {
|
||||
it('Allows selection of crown', function(done) {
|
||||
var params = {
|
||||
selectText: "CRW - Crown (Legacy)",
|
||||
firstAddress: "18pWSwSUAQdiwMHUfFZB1fM2xue9X1FqE5",
|
||||
firstAddress: "18pWSwSUAQdiwMHUfFZB1fM2xue9X1FqE5",
|
||||
};
|
||||
testNetwork(done, params);
|
||||
});
|
||||
@@ -1462,6 +1476,13 @@ it('Allows selection of Ethersocial Network', function(done) {
|
||||
};
|
||||
testNetwork(done, params);
|
||||
});
|
||||
it('Allows selection of Monkey Project', function(done) {
|
||||
var params = {
|
||||
selectText: "MONK - Monkey Project",
|
||||
firstAddress: "MnLrcnnUzKnf7TzufjRe5DLZqQJz18oYyu",
|
||||
};
|
||||
testNetwork(done, params);
|
||||
});
|
||||
|
||||
// BIP39 seed is set from phrase
|
||||
it('Sets the bip39 seed from the prhase', function(done) {
|
||||
|
||||
Reference in New Issue
Block a user