Merge pull request #287 from sui77/master

XLM Stellar Lumens
This commit is contained in:
iancoleman
2019-07-04 11:39:06 +10:00
committed by GitHub
7 changed files with 43962 additions and 0 deletions
+1389
View File
File diff suppressed because it is too large Load Diff
+15
View File
@@ -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"
}
}
+5
View File
@@ -0,0 +1,5 @@
Build (will create a bundle and copy it to ../../src/stellar-util.js):
npm install
npm run build
+16
View File
@@ -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,
},
}
+1
View File
@@ -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>
+20
View File
@@ -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
View File
File diff suppressed because one or more lines are too long