mirror of
https://github.com/OneKeyHQ/bip39.git
synced 2026-04-05 18:43:47 +00:00
@@ -1139,6 +1139,17 @@
|
|||||||
privkey = libs.ethUtil.bufferToHex(keyPair.d.toBuffer());
|
privkey = libs.ethUtil.bufferToHex(keyPair.d.toBuffer());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//TRX is different
|
||||||
|
if (networks[DOM.network.val()].name == "TRX - Tron") {
|
||||||
|
keyPair = new libs.bitcoin.ECPair(keyPair.d, null, { network: network, compressed: false });
|
||||||
|
var pubkeyBuffer = keyPair.getPublicKeyBuffer();
|
||||||
|
var ethPubkey = libs.ethUtil.importPublic(pubkeyBuffer);
|
||||||
|
var addressBuffer = libs.ethUtil.publicToAddress(ethPubkey);
|
||||||
|
address = libs.bitcoin.address.toBase58Check(addressBuffer, 0x41);
|
||||||
|
if (hasPrivkey) {
|
||||||
|
privkey = keyPair.d.toBuffer().toString('hex');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// RSK values are different
|
// RSK values are different
|
||||||
if (networkIsRsk()) {
|
if (networkIsRsk()) {
|
||||||
@@ -3236,6 +3247,12 @@
|
|||||||
setHdCoin(159);
|
setHdCoin(159);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "TRX - Tron",
|
||||||
|
onSelect: function() {
|
||||||
|
setHdCoin(195);
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "TWINS - TWINS",
|
name: "TWINS - TWINS",
|
||||||
onSelect: function() {
|
onSelect: function() {
|
||||||
|
|||||||
@@ -2286,6 +2286,17 @@ it('Allows selection of Binance Smart Chain', function(done) {
|
|||||||
testNetwork(done, params);
|
testNetwork(done, params);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('Allows selection of TRX on Tron', function(done) {
|
||||||
|
var params = {
|
||||||
|
selectText: "TRX - Tron",
|
||||||
|
phrase: "abandon abandon ability",
|
||||||
|
firstAddress: "TA891Fu7vVz595BGQpNX2MCzr7yBcxuoC7",
|
||||||
|
firstPubKey: "0337bbb060e6166066f7f9e59e52f67bc23a6c9d0cbc815b82b6d89112444842e7",
|
||||||
|
firstPrivKey: "3a8fbd0379a815764979de86a3fcda759cb62d49e784e7b2a9a03206c90cfae2",
|
||||||
|
};
|
||||||
|
testNetwork(done, params);
|
||||||
|
});
|
||||||
|
|
||||||
// BIP39 seed is set from phrase
|
// BIP39 seed is set from phrase
|
||||||
it('Sets the bip39 seed from the prhase', function(done) {
|
it('Sets the bip39 seed from the prhase', function(done) {
|
||||||
driver.findElement(By.css('.phrase'))
|
driver.findElement(By.css('.phrase'))
|
||||||
|
|||||||
Reference in New Issue
Block a user