mirror of
https://github.com/OneKeyHQ/bip39.git
synced 2026-04-20 09:22:16 +00:00
File diff suppressed because it is too large
Load Diff
@@ -674,6 +674,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</script>
|
</script>
|
||||||
<script src="js/polyfill.es6.js"></script>
|
<script src="js/polyfill.es6.js"></script>
|
||||||
|
<script src="js/basex.js"></script>
|
||||||
<script src="js/unorm.js"></script>
|
<script src="js/unorm.js"></script>
|
||||||
<script src="js/jquery.min.js"></script>
|
<script src="js/jquery.min.js"></script>
|
||||||
<script src="js/bootstrap.min.js"></script>
|
<script src="js/bootstrap.min.js"></script>
|
||||||
@@ -682,6 +683,7 @@
|
|||||||
<script src="js/bitcoinjs-1-5-7.js"></script>
|
<script src="js/bitcoinjs-1-5-7.js"></script>
|
||||||
<script src="js/bitcoinjs-extensions.js"></script>
|
<script src="js/bitcoinjs-extensions.js"></script>
|
||||||
<script src="js/ethereumjs-util.js"></script>
|
<script src="js/ethereumjs-util.js"></script>
|
||||||
|
<script src="js/ripple-util.js"></script>
|
||||||
<script src="js/sjcl-bip39.js"></script>
|
<script src="js/sjcl-bip39.js"></script>
|
||||||
<script src="js/translate.js"></script>
|
<script src="js/translate.js"></script>
|
||||||
<script src="js/phrases_en.js"></script>
|
<script src="js/phrases_en.js"></script>
|
||||||
|
|||||||
2010
src/js/basex.js
Normal file
2010
src/js/basex.js
Normal file
File diff suppressed because it is too large
Load Diff
@@ -593,6 +593,11 @@
|
|||||||
var checksumAddress = ethUtil.toChecksumAddress(hexAddress);
|
var checksumAddress = ethUtil.toChecksumAddress(hexAddress);
|
||||||
address = ethUtil.addHexPrefix(checksumAddress);
|
address = ethUtil.addHexPrefix(checksumAddress);
|
||||||
}
|
}
|
||||||
|
// Ripple values are different
|
||||||
|
if (networks[DOM.network.val()].name == "Ripple") {
|
||||||
|
privkey = convertRipplePriv(privkey);
|
||||||
|
address = convertRippleAdrr(address);
|
||||||
|
}
|
||||||
addAddressToList(indexText, address, pubkey, privkey);
|
addAddressToList(indexText, address, pubkey, privkey);
|
||||||
}, 50)
|
}, 50)
|
||||||
}
|
}
|
||||||
@@ -1148,6 +1153,13 @@
|
|||||||
DOM.bip44coin.val(6);
|
DOM.bip44coin.val(6);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "Ripple",
|
||||||
|
onSelect: function() {
|
||||||
|
network = bitcoin.networks.bitcoin;
|
||||||
|
DOM.bip44coin.val(144);
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "ShadowCash",
|
name: "ShadowCash",
|
||||||
onSelect: function() {
|
onSelect: function() {
|
||||||
|
|||||||
10
src/js/ripple-util.js
Normal file
10
src/js/ripple-util.js
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
function convertRippleAdrr(address) {
|
||||||
|
return window.basex('rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz').encode(
|
||||||
|
window.basex('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz').decode(address)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
function convertRipplePriv(priv) {
|
||||||
|
return window.basex('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz').decode(priv).toString("hex").slice(2)
|
||||||
|
}
|
||||||
|
|
||||||
30
tests.js
30
tests.js
@@ -331,6 +331,36 @@ page.open(url, function(status) {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Network can be set to ripple
|
||||||
|
function() {
|
||||||
|
page.open(url, function(status) {
|
||||||
|
// set the phrase and coin
|
||||||
|
var expected = "rLTFnqbmCVPGx6VfaygdtuKWJgcN4v1zRS";
|
||||||
|
page.evaluate(function() {
|
||||||
|
$(".phrase").val("ill clump only blind unit burden thing track silver cloth review awake useful craft whale all satisfy else trophy sunset walk vanish hope valve");
|
||||||
|
$(".phrase").trigger("input");
|
||||||
|
$(".network option[selected]").removeAttr("selected");
|
||||||
|
$(".network option").filter(function() {
|
||||||
|
return $(this).html() == "Ripple";
|
||||||
|
}).prop("selected", true);
|
||||||
|
$(".network").trigger("change");
|
||||||
|
});
|
||||||
|
// check the address is generated correctly
|
||||||
|
waitForGenerate(function() {
|
||||||
|
var actual = page.evaluate(function() {
|
||||||
|
return $(".address:first").text();
|
||||||
|
});
|
||||||
|
if (actual != expected) {
|
||||||
|
console.log("Litecoin address is incorrect");
|
||||||
|
console.log("Expected: " + expected);
|
||||||
|
console.log("Actual: " + actual);
|
||||||
|
fail();
|
||||||
|
}
|
||||||
|
next();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
// Network can be set to dogecoin
|
// Network can be set to dogecoin
|
||||||
function() {
|
function() {
|
||||||
page.open(url, function(status) {
|
page.open(url, function(status) {
|
||||||
|
|||||||
Reference in New Issue
Block a user