Skip to content
This repository was archived by the owner on Oct 11, 2024. It is now read-only.

Commit 7b76187

Browse files
committed
Loki changes
Update package json Linting. Fixed websocket not working. Move to lokid and rpc. Re-branding Fixed rpc call for wallet restoration. Force ring size of 10 Other fix. Added service node ui. Added different daemons Added remote preset loading. Fixed priority options. Fixed links.
1 parent 9ce31d6 commit 7b76187

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+8065
-6750
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
/dist
2+
/src/validators/address_tools.js

.eslintrc.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,18 @@ module.exports = {
2525
},
2626
// add your custom rules here
2727
"rules": {
28+
"indent": ["error", 4],
29+
"quotes": ["error", "double"],
30+
2831
// allow async-await
2932
"generator-star-spacing": "off",
3033

3134
// allow paren-less arrow functions
3235
"arrow-parens": 0,
3336
"one-var": 0,
3437

38+
"camelcase": 0,
39+
3540
"import/first": 0,
3641
"import/named": 2,
3742
"import/namespace": 2,

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
11.9.0

package-lock.json

Lines changed: 6769 additions & 5626 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
{
2-
"name": "ryo-wallet-atom",
2+
"name": "loki-wallet-atom",
33
"version": "1.1.0",
44
"daemonVersion": "0.3.2.0",
5-
"description": "Modern GUI interface for Ryo Currency",
6-
"productName": "Ryo Wallet Atom",
5+
"description": "Modern GUI interface for Loki Currency",
6+
"productName": "Loki Wallet Atom",
77
"cordovaId": "com.ryo-currency.ryo-gui-wallet",
8-
"author": "Ryo-currency <[email protected]>",
8+
"author": "Loki",
99
"private": true,
1010
"scripts": {
11+
"dev": "quasar dev -m electron -t mat",
12+
"build": "quasar build -m electron -t mat",
1113
"lint": "eslint --ext .js,.vue src",
14+
"lint-fix": "eslint --fix .",
1215
"test": "echo \"No test specified\" && exit 0"
1316
},
1417
"dependencies": {
@@ -42,8 +45,9 @@
4245
"eslint-plugin-standard": "^3.0.1",
4346
"eslint-plugin-vue": "^4.3.0",
4447
"node-sass": "^4.9.3",
45-
"quasar-cli": "^0.16.0",
46-
"sass-loader": "^7.1.0"
48+
"quasar-cli": "^0.17.23",
49+
"sass-loader": "^7.1.0",
50+
"strip-ansi": "^3.0.1"
4751
},
4852
"engines": {
4953
"node": ">= 8.9.0",

quasar.conf.js

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module.exports = function (ctx) {
66
plugins: [
77
"i18n",
88
"axios",
9-
"vuelidate",
9+
"vuelidate",
1010
"gateway",
1111
"timeago"
1212
],
@@ -28,7 +28,7 @@ module.exports = function (ctx) {
2828
// gzip: true,
2929
// analyze: true,
3030
// extractCSS: false,
31-
extendWebpack(cfg) {
31+
extendWebpack (cfg) {
3232
/*
3333
cfg.module.rules.push({
3434
enforce: "pre",
@@ -59,6 +59,7 @@ module.exports = function (ctx) {
5959
"QField",
6060
"QInput",
6161
"QRadio",
62+
"QOptionGroup",
6263
"QBtn",
6364
"QBtnToggle",
6465
"QIcon",
@@ -118,30 +119,30 @@ module.exports = function (ctx) {
118119
background_color: "#ffffff",
119120
theme_color: "#027be3",
120121
icons: [{
121-
"src": "statics/icons/icon-128x128.png",
122-
"sizes": "128x128",
123-
"type": "image/png"
124-
},
125-
{
126-
"src": "statics/icons/icon-192x192.png",
127-
"sizes": "192x192",
128-
"type": "image/png"
129-
},
130-
{
131-
"src": "statics/icons/icon-256x256.png",
132-
"sizes": "256x256",
133-
"type": "image/png"
134-
},
135-
{
136-
"src": "statics/icons/icon-384x384.png",
137-
"sizes": "384x384",
138-
"type": "image/png"
139-
},
140-
{
141-
"src": "statics/icons/icon-512x512.png",
142-
"sizes": "512x512",
143-
"type": "image/png"
144-
}
122+
"src": "statics/icons/icon-128x128.png",
123+
"sizes": "128x128",
124+
"type": "image/png"
125+
},
126+
{
127+
"src": "statics/icons/icon-192x192.png",
128+
"sizes": "192x192",
129+
"type": "image/png"
130+
},
131+
{
132+
"src": "statics/icons/icon-256x256.png",
133+
"sizes": "256x256",
134+
"type": "image/png"
135+
},
136+
{
137+
"src": "statics/icons/icon-384x384.png",
138+
"sizes": "384x384",
139+
"type": "image/png"
140+
},
141+
{
142+
"src": "statics/icons/icon-512x512.png",
143+
"sizes": "512x512",
144+
"type": "image/png"
145+
}
145146
]
146147
}
147148
},
@@ -150,7 +151,7 @@ module.exports = function (ctx) {
150151
},
151152
electron: {
152153
bundler: "builder", // or "packager"
153-
extendWebpack(cfg) {
154+
extendWebpack (cfg) {
154155
// do something with Electron process Webpack cfg
155156
},
156157
packager: {
@@ -166,14 +167,14 @@ module.exports = function (ctx) {
166167
// win32metadata: { ... }
167168

168169
extraResource: [
169-
"bin",
170+
"bin"
170171
]
171172
},
172173
builder: {
173174
// https://www.electron.build/configuration/configuration
174175

175-
appId: "com.ryo-currency.wallet",
176-
productName: "Ryo Wallet Atom",
176+
appId: "com.lokinetwork.wallet",
177+
productName: "Loki Wallet Atom",
177178
copyright: "Copyright © 2018 Ryo Currency Project",
178179

179180
// directories: {

src-electron/main-process/electron-main.js

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,23 @@ let mainWindow, backend
1919
let showConfirmClose = true
2020
let forceQuit = false
2121

22-
const portInUse = function(port, callback) {
23-
var server = net.createServer(function(socket) {
24-
socket.write("Echo server\r\n");
25-
socket.pipe(socket);
26-
});
22+
const portInUse = function (port, callback) {
23+
var server = net.createServer(function (socket) {
24+
socket.write("Echo server\r\n")
25+
socket.pipe(socket)
26+
})
2727

28-
server.listen(port, "127.0.0.1");
28+
server.listen(port, "127.0.0.1")
2929
server.on("error", function (e) {
30-
callback(true);
31-
});
30+
callback(true)
31+
})
3232
server.on("listening", function (e) {
33-
server.close();
34-
callback(false);
35-
});
36-
};
33+
server.close()
34+
callback(false)
35+
})
36+
}
3737

38-
function createWindow() {
38+
function createWindow () {
3939
/**
4040
* Initial window options
4141
*/
@@ -93,11 +93,9 @@ function createWindow() {
9393
})
9494

9595
mainWindow.webContents.on("did-finish-load", () => {
96-
9796
require("crypto").randomBytes(64, (err, buffer) => {
98-
9997
// if err, then we may have to use insecure token generation perhaps
100-
if (err) throw err;
98+
if (err) throw err
10199

102100
let config = {
103101
port: 12213,
@@ -112,20 +110,16 @@ function createWindow() {
112110
} else {
113111
dialog.showMessageBox(mainWindow, {
114112
title: "Startup error",
115-
message: `Ryo Wallet is already open, or port ${config.port} is in use`,
113+
message: `Loki Wallet is already open, or port ${config.port} is in use`,
116114
type: "error",
117115
buttons: ["ok"]
118116
}, () => {
119117
showConfirmClose = false
120118
app.quit()
121119
})
122-
123120
}
124-
125121
})
126-
127122
})
128-
129123
})
130124

131125
mainWindow.loadURL(process.env.APP_URL)

src-electron/main-process/menu.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ let template = [
3535
submenu: [
3636
{
3737
label: "Learn More",
38-
click () { require("electron").shell.openExternal("https://ryo-currency.com/") }
38+
click () { require("electron").shell.openExternal("https://loki.network/") }
3939
}
4040
]
4141
}
4242
]
4343

4444
if (process.platform === "darwin") {
4545
template.unshift({
46-
label: "Ryo Wallet Atom",
46+
label: "Loki Wallet Atom",
4747
submenu: [
4848
{role: "about"},
4949
{type: "separator"},

src-electron/main-process/modules/SCEE-Node.js

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -22,70 +22,70 @@
2222
SOFTWARE.
2323
*/
2424

25-
const crypto = require("crypto");
25+
const crypto = require("crypto")
2626

27-
const ALGORITHM_NAME = "aes-128-gcm";
28-
const ALGORITHM_NONCE_SIZE = 12;
29-
const ALGORITHM_TAG_SIZE = 16;
30-
const ALGORITHM_KEY_SIZE = 16;
31-
const PBKDF2_NAME = "sha256";
32-
const PBKDF2_SALT_SIZE = 16;
33-
const PBKDF2_ITERATIONS = 32767;
27+
const ALGORITHM_NAME = "aes-128-gcm"
28+
const ALGORITHM_NONCE_SIZE = 12
29+
const ALGORITHM_TAG_SIZE = 16
30+
const ALGORITHM_KEY_SIZE = 16
31+
const PBKDF2_NAME = "sha256"
32+
const PBKDF2_SALT_SIZE = 16
33+
const PBKDF2_ITERATIONS = 32767
3434

3535
export class SCEE {
36-
encryptString(plaintext, password) {
36+
encryptString (plaintext, password) {
3737
// Generate a 128-bit salt using a CSPRNG.
38-
let salt = crypto.randomBytes(PBKDF2_SALT_SIZE);
38+
let salt = crypto.randomBytes(PBKDF2_SALT_SIZE)
3939

4040
// Derive a key using PBKDF2.
41-
let key = crypto.pbkdf2Sync(new Buffer(password, "utf8"), salt, PBKDF2_ITERATIONS, ALGORITHM_KEY_SIZE, PBKDF2_NAME);
41+
let key = crypto.pbkdf2Sync(new Buffer(password, "utf8"), salt, PBKDF2_ITERATIONS, ALGORITHM_KEY_SIZE, PBKDF2_NAME)
4242

4343
// Encrypt and prepend salt.
44-
let ciphertextAndNonceAndSalt = Buffer.concat([ salt, this.encrypt(new Buffer(plaintext, "utf8"), key) ]);
44+
let ciphertextAndNonceAndSalt = Buffer.concat([ salt, this.encrypt(new Buffer(plaintext, "utf8"), key) ])
4545

4646
// Return as base64 string.
47-
return ciphertextAndNonceAndSalt.toString("base64");
47+
return ciphertextAndNonceAndSalt.toString("base64")
4848
}
4949

50-
decryptString(base64CiphertextAndNonceAndSalt, password) {
50+
decryptString (base64CiphertextAndNonceAndSalt, password) {
5151
// Decode the base64.
52-
let ciphertextAndNonceAndSalt = new Buffer(base64CiphertextAndNonceAndSalt, "base64");
52+
let ciphertextAndNonceAndSalt = new Buffer(base64CiphertextAndNonceAndSalt, "base64")
5353

5454
// Create buffers of salt and ciphertextAndNonce.
55-
let salt = ciphertextAndNonceAndSalt.slice(0, PBKDF2_SALT_SIZE);
56-
let ciphertextAndNonce = ciphertextAndNonceAndSalt.slice(PBKDF2_SALT_SIZE);
55+
let salt = ciphertextAndNonceAndSalt.slice(0, PBKDF2_SALT_SIZE)
56+
let ciphertextAndNonce = ciphertextAndNonceAndSalt.slice(PBKDF2_SALT_SIZE)
5757

5858
// Derive the key using PBKDF2.
59-
let key = crypto.pbkdf2Sync(new Buffer(password, "utf8"), salt, PBKDF2_ITERATIONS, ALGORITHM_KEY_SIZE, PBKDF2_NAME);
59+
let key = crypto.pbkdf2Sync(new Buffer(password, "utf8"), salt, PBKDF2_ITERATIONS, ALGORITHM_KEY_SIZE, PBKDF2_NAME)
6060

6161
// Decrypt and return result.
62-
return this.decrypt(ciphertextAndNonce, key).toString("utf8");
62+
return this.decrypt(ciphertextAndNonce, key).toString("utf8")
6363
}
6464

65-
encrypt(plaintext, key) {
65+
encrypt (plaintext, key) {
6666
// Generate a 96-bit nonce using a CSPRNG.
67-
let nonce = crypto.randomBytes(ALGORITHM_NONCE_SIZE);
67+
let nonce = crypto.randomBytes(ALGORITHM_NONCE_SIZE)
6868

6969
// Create the cipher instance.
70-
let cipher = crypto.createCipheriv(ALGORITHM_NAME, key, nonce);
70+
let cipher = crypto.createCipheriv(ALGORITHM_NAME, key, nonce)
7171

7272
// Encrypt and prepend nonce.
73-
let ciphertext = Buffer.concat([ cipher.update(plaintext), cipher.final() ]);
73+
let ciphertext = Buffer.concat([ cipher.update(plaintext), cipher.final() ])
7474

75-
return Buffer.concat([ nonce, ciphertext, cipher.getAuthTag() ]);
75+
return Buffer.concat([ nonce, ciphertext, cipher.getAuthTag() ])
7676
}
7777

78-
decrypt(ciphertextAndNonce, key) {
78+
decrypt (ciphertextAndNonce, key) {
7979
// Create buffers of nonce, ciphertext and tag.
80-
let nonce = ciphertextAndNonce.slice(0, ALGORITHM_NONCE_SIZE);
81-
let ciphertext = ciphertextAndNonce.slice(ALGORITHM_NONCE_SIZE, ciphertextAndNonce.length - ALGORITHM_TAG_SIZE);
82-
let tag = ciphertextAndNonce.slice(ciphertext.length + ALGORITHM_NONCE_SIZE);
80+
let nonce = ciphertextAndNonce.slice(0, ALGORITHM_NONCE_SIZE)
81+
let ciphertext = ciphertextAndNonce.slice(ALGORITHM_NONCE_SIZE, ciphertextAndNonce.length - ALGORITHM_TAG_SIZE)
82+
let tag = ciphertextAndNonce.slice(ciphertext.length + ALGORITHM_NONCE_SIZE)
8383

8484
// Create the cipher instance.
85-
let cipher = crypto.createDecipheriv(ALGORITHM_NAME, key, nonce);
85+
let cipher = crypto.createDecipheriv(ALGORITHM_NAME, key, nonce)
8686

8787
// Decrypt and return result.
88-
cipher.setAuthTag(tag);
89-
return Buffer.concat([ cipher.update(ciphertext), cipher.final() ]);
88+
cipher.setAuthTag(tag)
89+
return Buffer.concat([ cipher.update(ciphertext), cipher.final() ])
9090
}
9191
}

0 commit comments

Comments
 (0)