diff --git a/.env.example b/.env.example index 3cffec9..46209f4 100644 --- a/.env.example +++ b/.env.example @@ -4,6 +4,7 @@ APP_NAME= ################# # Network Used for transaction PREFERRED_NETWORK="matic-mainnet" +NETWORK_RPC_URL="https://polygon-rpc.com" ################## # BROWSER CONFIG # ################## diff --git a/dist/constants.js b/dist/constants.js index 8609c6b..40a7b1c 100644 --- a/dist/constants.js +++ b/dist/constants.js @@ -1,15 +1,13 @@ "use strict"; -var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o; +var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p; const envMigrations = require("./Records/Migrations/env"); const config = (() => { let fs = require('fs'); try { let envFilePath = './.env'; - console.log("Env File: Loading..."); if (!fs.existsSync(envFilePath)) { fs.appendFileSync(envFilePath, envMigrations.default.join("\n")); } - console.log("Env File: Loaded."); let rawData = fs.readFileSync(envFilePath, 'utf8'); let envValues = {}; let data = rawData.split("\n") @@ -47,7 +45,7 @@ module.exports = { "slug": "matic-mainnet", "name": "Matic Mainnet", "new": true, - "rpc_url": "https://poly-rpc.gateway.pokt.network", + "rpc_url": (_e = config.NETWORK_RPC_URL) !== null && _e !== void 0 ? _e : "https://polygon-rpc.com", "chain_id": 137, "currency_symbol": "MATIC", "block_explorer_url": "https://polygonscan.com/" @@ -55,8 +53,8 @@ module.exports = { ], trading: { options: { - sell_cutloss: parseInt((_e = config.SELL_CUTLOSS) !== null && _e !== void 0 ? _e : -10), - sell_profit: parseInt((_f = config.SELL_PROFIT) !== null && _f !== void 0 ? _f : 5) + sell_cutloss: parseInt((_f = config.SELL_CUTLOSS) !== null && _f !== void 0 ? _f : -10), + sell_profit: parseInt((_g = config.SELL_PROFIT) !== null && _g !== void 0 ? _g : 5) } }, elements: { @@ -124,8 +122,8 @@ module.exports = { } }, mailer: { - host: (_g = config.MAIL_HOST) !== null && _g !== void 0 ? _g : null, - port: (_h = config.MAIL_PORT) !== null && _h !== void 0 ? _h : null, + host: (_h = config.MAIL_HOST) !== null && _h !== void 0 ? _h : null, + port: (_j = config.MAIL_PORT) !== null && _j !== void 0 ? _j : null, secure: (function () { var _a; let mailPort = (_a = config.MAIL_PORT) !== null && _a !== void 0 ? _a : null; @@ -135,13 +133,13 @@ module.exports = { return false; })(), auth: { - user: (_j = config.MAIL_USERNAME) !== null && _j !== void 0 ? _j : null, - pass: (_k = config.MAIL_PASSWORD) !== null && _k !== void 0 ? _k : null + user: (_k = config.MAIL_USERNAME) !== null && _k !== void 0 ? _k : null, + pass: (_l = config.MAIL_PASSWORD) !== null && _l !== void 0 ? _l : null }, - to: (_l = config.MAIL_TO) !== null && _l !== void 0 ? _l : null, - from: (_m = config.MAIL_FROM) !== null && _m !== void 0 ? _m : null + to: (_m = config.MAIL_TO) !== null && _m !== void 0 ? _m : null, + from: (_o = config.MAIL_FROM) !== null && _o !== void 0 ? _o : null }, slack: { - webhook_url: (_o = config.WEBHOOK_URL) !== null && _o !== void 0 ? _o : null + webhook_url: (_p = config.WEBHOOK_URL) !== null && _p !== void 0 ? _p : null } }; diff --git a/package.json b/package.json index e1b5b15..53c2734 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "crypto-bot-trader", "description": "swapping of ERC-20 Tokens (buy/sell) based on the market health with bot strategy (condition) - by utilizing metamask & pupeteer", - "version": "2.4.2", + "version": "2.4.3", "main": "./dist/index.js", "repository": { "type": "git", diff --git a/src/constants.js b/src/constants.js index ba52740..a4f0220 100644 --- a/src/constants.js +++ b/src/constants.js @@ -5,14 +5,11 @@ const config = (() => { let fs = require('fs'); try { let envFilePath = './.env'; - console.log("Env File: Loading..."); if (!fs.existsSync(envFilePath)) { fs.appendFileSync(envFilePath, envMigrations.default.join("\n")); } - console.log("Env File: Loaded."); - let rawData = fs.readFileSync(envFilePath, 'utf8'); let envValues = {}; let data = rawData.split("\n") @@ -53,7 +50,7 @@ module.exports = { "slug": "matic-mainnet", "name": "Matic Mainnet", "new": true, - "rpc_url": "https://poly-rpc.gateway.pokt.network", + "rpc_url": config.NETWORK_RPC_URL ?? "https://polygon-rpc.com", "chain_id": 137, "currency_symbol": "MATIC", "block_explorer_url": "https://polygonscan.com/"