-
-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from Adamant-im/dev
v4.3.4
- Loading branch information
Showing
56 changed files
with
8,678 additions
and
7,898 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,36 @@ | ||
module.exports = { | ||
"parserOptions": { | ||
"ecmaVersion": 8, | ||
"sourceType": "module" | ||
}, | ||
"rules": { | ||
quotes: ["error", "single"], | ||
"semi": "warn", // обязательно ; | ||
"semi-spacing": ["error", {"before": false, "after": true}], | ||
"indent": ["error", "tab"], | ||
"space-infix-ops": "error",// отступы вокруг + - * / = и тд | ||
"eqeqeq": "error", // обязательно === и !== (нельзя == и !=) | ||
// "no-eq-null": "error", // обязательно === и !== (нельзя == и !=) но тоько в отношении null | ||
"curly": "error", // проверка шаблонов `${name}` | ||
// "space-before-function-paren": [ // отступ до и после function | ||
// "error", { | ||
// "anonymous": "always", | ||
// "named": "always", | ||
// "asyncArrow": "ignore" | ||
// } | ||
// ], | ||
"key-spacing": ["error", { "mode": "strict" }], // оформление обЪекта | ||
"space-in-parens": ["error", "never"], // запрет отступов ( a,b) | ||
"computed-property-spacing": ["error", "never"], // запрет лишних отступов в выражениях a[ i] | ||
"array-bracket-spacing": ["error", "never"], | ||
"no-multi-spaces": "error", // запрет лишних пробелов var a = 2 | ||
"no-sparse-arrays": "warn", // предупреждение при дырке в массиве | ||
"no-mixed-spaces-and-tabs": "error", // нельзя миксовать табы и пробелы | ||
"keyword-spacing": ["error", { "after": true }], | ||
"comma-spacing": ["error", { "before": false, "after": true }], // отступ после запятой, а перед нельзя | ||
"no-undef":"error", | ||
"array-callback-return": "error" // коллбек методов массива типа arr.map arr.filter должны иметь return в коллбеке | ||
}, | ||
"env": { | ||
"browser": true, | ||
"node": true | ||
}, | ||
"globals": { | ||
"Vue":true, | ||
"Symbol":true, | ||
"Promise":true, | ||
}, | ||
"plugins": [] | ||
} | ||
env: { | ||
commonjs: true, | ||
es2021: true, | ||
node: true, | ||
}, | ||
extends: [ | ||
'google', | ||
], | ||
parser: '@babel/eslint-parser', | ||
parserOptions: { | ||
ecmaVersion: 12, | ||
}, | ||
rules: { | ||
'object-curly-spacing': ['error', 'always'], | ||
'max-len': ['error', | ||
{ 'code': 131, | ||
'ignoreTrailingComments': true, | ||
'ignoreUrls': true, | ||
'ignoreStrings': true, | ||
'ignoreTemplateLiterals': true, | ||
'ignoreRegExpLiterals': true, | ||
}], | ||
'require-jsdoc': ['off'], | ||
'valid-jsdoc': ['off'], | ||
'no-array-constructor': ['off'], | ||
'no-caller': ['off'], | ||
'prefer-promise-reject-errors': ['off'], | ||
'guard-for-in': ['off'], | ||
'no-unused-vars': ['off'], | ||
'padded-blocks': ['off'], | ||
'new-cap': ['off'], | ||
'camelcase': ['off'], | ||
'eqeqeq': ['error', 'always'], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ logs/ | |
package-lock.json | ||
tests.js | ||
config.test | ||
.DS_Store | ||
.DS_Store | ||
trade/settings/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,36 @@ | ||
const notify = require('./helpers/notify'); | ||
const db = require('./modules/DB'); | ||
const Store = require('./modules/Store'); | ||
const checker = require('./modules/checkerTransactions'); | ||
const doClearDB = process.argv.includes('clear_db'); | ||
const config = require('./modules/configReader'); | ||
const txParser = require('./modules/incomingTxsParser'); | ||
const log = require('./helpers/log'); | ||
|
||
// Socket connection | ||
const api = require('./modules/api'); | ||
api.socket.initSocket({socket: config.socket, wsType: config.ws_type, onNewMessage: txParser, admAddress: Store.user.ADM.address}); | ||
api.socket.initSocket({ socket: config.socket, wsType: config.ws_type, onNewMessage: txParser, admAddress: config.address }); | ||
|
||
setTimeout(init, 5000); | ||
|
||
function init() { | ||
require('./server'); | ||
try { | ||
if (doClearDB) { | ||
console.log('Clearing database..'); | ||
db.systemDb.db.drop(); | ||
db.incomingTxsDb.db.drop(); | ||
notify(`*${config.notifyName}: database cleared*. Manually stop the Bot now.`, 'info'); | ||
} else { | ||
|
||
db.systemDb.findOne().then(system => { | ||
if (system) { | ||
Store.lastBlock = system.lastBlock; | ||
} else { // if 1st start | ||
Store.updateLastBlock(); | ||
} | ||
checker(); | ||
require('./trade/mm_trader').run(); | ||
require('./trade/mm_orderbook_builder').run(); | ||
require('./trade/mm_liquidity_provider').run(); | ||
require('./trade/mm_price_watcher').run(); | ||
// require('./trade/mm_orderbook_builder').test(); | ||
notify(`*${config.notifyName} started* for address _${Store.user.ADM.address}_ (ver. ${Store.version}).`, 'info'); | ||
}); | ||
} | ||
|
||
} catch (e) { | ||
notify(`${config.notifyName} is not started. Error: ${e}`, 'error'); | ||
process.exit(1); | ||
} | ||
require('./server'); | ||
try { | ||
if (doClearDB) { | ||
console.log('Clearing database…'); | ||
db.systemDb.db.drop(); | ||
db.incomingTxsDb.db.drop(); | ||
db.ordersDb.db.drop(); | ||
notify(`*${config.notifyName}: database cleared*. Manually stop the Bot now.`, 'info'); | ||
} else { | ||
checker(); | ||
require('./trade/mm_trader').run(); | ||
require('./trade/mm_orderbook_builder').run(); | ||
require('./trade/mm_liquidity_provider').run(); | ||
require('./trade/mm_price_watcher').run(); | ||
// require('./trade/mm_orderbook_builder').test(); | ||
notify(`*${config.notifyName} started* for address _${config.address}_ (ver. ${config.version}).`, 'info'); | ||
} | ||
} catch (e) { | ||
notify(`${config.notifyName} is not started. Error: ${e}`, 'error'); | ||
process.exit(1); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"presets": ["@babel/preset-env"], | ||
"plugins": [ | ||
["@babel/transform-runtime"] | ||
] | ||
} |
Oops, something went wrong.