mirror of
https://github.com/OneKeyHQ/bip39.git
synced 2026-05-13 12:15:04 +00:00
Generated
+1389
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "stellar-util",
|
||||
"version": "0.0.1",
|
||||
"scripts": {
|
||||
"build": "browserify stellar-util.js > ../../src/js/stellar-util.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"ed25519-hd-key": "^1.0.0",
|
||||
"stellar-base": "^0.10.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"browserify": "^16.2.3",
|
||||
"uglify-es": "^3.3.9"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
Build (will create a bundle and copy it to ../../src/stellar-util.js):
|
||||
|
||||
npm install
|
||||
npm run build
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
const StellarBase = require('stellar-base');
|
||||
const edHd = require('ed25519-hd-key');
|
||||
|
||||
window.stellarUtil = {
|
||||
getKeypair: function (path, seed) {
|
||||
const result = edHd.derivePath(path, seed);
|
||||
return StellarBase.Keypair.fromRawEd25519Seed(result.key);
|
||||
},
|
||||
dummyNetwork: {
|
||||
bip32: {public: 0, private: 0},
|
||||
messagePrefix: '',
|
||||
pubKeyHash: 0,
|
||||
scriptHash: 0,
|
||||
wif: 0,
|
||||
},
|
||||
}
|
||||
@@ -942,6 +942,7 @@
|
||||
<script src="js/biginteger.js"></script>
|
||||
<script src="js/zxcvbn.js"></script>
|
||||
<script src="js/entropy.js"></script>
|
||||
<script src="js/stellar-util.js"></script>
|
||||
<script src="js/index.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -931,6 +931,19 @@
|
||||
privkey = ethUtil.addHexPrefix(privkey);
|
||||
pubkey = ethUtil.addHexPrefix(pubkey);
|
||||
}
|
||||
|
||||
// Stellar is different
|
||||
if (networks[DOM.network.val()].name == "XLM - Stellar") {
|
||||
var purpose = parseIntNoNaN(DOM.bip44purpose.val(), 44);
|
||||
var coin = parseIntNoNaN(DOM.bip44coin.val(), 0);
|
||||
var path = "m/";
|
||||
path += purpose + "'/";
|
||||
path += coin + "'/" + index + "'";
|
||||
var keypair = stellarUtil.getKeypair(path, seed);
|
||||
indexText = path;
|
||||
privkey = keypair.secret();
|
||||
pubkey = address = keypair.publicKey();
|
||||
}
|
||||
if ((networks[DOM.network.val()].name == "NAS - Nebulas")) {
|
||||
var NasAccount = require("nebulas-account");
|
||||
var privKeyBuffer = keyPair.d.toBuffer(32);
|
||||
@@ -2713,6 +2726,13 @@
|
||||
setHdCoin(65);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "XLM - Stellar",
|
||||
onSelect: function() {
|
||||
network = stellarUtil.dummyNetwork;
|
||||
setHdCoin(148);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "XMY - Myriadcoin",
|
||||
onSelect: function() {
|
||||
|
||||
+42516
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user