diff --git a/Poloniex-Historic-Trades/Interval.js b/Poloniex-Historic-Trades/User.Bot.js similarity index 98% rename from Poloniex-Historic-Trades/Interval.js rename to Poloniex-Historic-Trades/User.Bot.js index 60b32edc6..d6e45549c 100644 --- a/Poloniex-Historic-Trades/Interval.js +++ b/Poloniex-Historic-Trades/User.Bot.js @@ -29,7 +29,7 @@ let charlyStorage = FILE_STORAGE.newFileStorage(bot); - let utilities = UTILITIES.newUtilities(bot); + let utilities = UTILITIES.newCloudUtilities(bot); let year; let month; @@ -51,7 +51,7 @@ console.log(logText); logger.write(logText); - charlyStorage.initialize(); + charlyStorage.initialize(bot.devTeam); markets = MARKETS_MODULE.newMarkets(bot); markets.initialize(callBackFunction); @@ -417,9 +417,9 @@ This process complements the Live Trades process and write historical trades fil exchangeCallTime = new Date(); - let poloniexApiClient = new POLONIEX_CLIENT_MODULE(); + let poloniexApiClient = POLONIEX_CLIENT_MODULE.newPoloniexAPIClient(global.EXCHANGE_KEYS[global.EXCHANGE_NAME].Key, global.EXCHANGE_KEYS[global.EXCHANGE_NAME].Secret); - poloniexApiClient.returnPublicTradeHistory(market.assetA, market.assetB, startTime, endTime, onExchangeCallReturned); + poloniexApiClient.API.returnPublicTradeHistory(market.assetA, market.assetB, startTime, endTime, onExchangeCallReturned); } catch (err) { diff --git a/Poloniex-Hole-Fixing/User.bot.js b/Poloniex-Hole-Fixing/User.bot.js index dc1651234..7fc4ea55f 100644 --- a/Poloniex-Hole-Fixing/User.bot.js +++ b/Poloniex-Hole-Fixing/User.bot.js @@ -25,8 +25,9 @@ let charlyStorage = BLOB_STORAGE.newBlobStorage(bot); - let utilities = UTILITIES.newUtilities(bot); - let poloniexApiClient = new POLONIEX_CLIENT_MODULE(); + let utilities = UTILITIES.newCloudUtilities(bot); + let poloniexApiClient = POLONIEX_CLIENT_MODULE.newPoloniexAPIClient(global.EXCHANGE_KEYS[global.EXCHANGE_NAME].Key, global.EXCHANGE_KEYS[global.EXCHANGE_NAME].Secret); + let statusReportModule = STATUS_REPORT.newStatusReport(BOT, DEBUG_MODULE, BLOB_STORAGE, UTILITIES); let year; @@ -51,7 +52,7 @@ if (FULL_LOG === true) { logger.write("[INFO] initialize -> pYear = " + year); } if (FULL_LOG === true) { logger.write("[INFO] initialize -> pMonth = " + month); } - charlyStorage.initialize({ bot: "AACharly", devTeam: "AAMasters" }, onCharlyInizialized); + charlyStorage.initialize(bot.devTeam, onCharlyInizialized); function onCharlyInizialized(err) { @@ -824,9 +825,9 @@ What is the lastFile pointer? exchangeCallTime = new Date(); - let poloniexApiClient = new POLONIEX_CLIENT_MODULE(); + let poloniexApiClient = POLONIEX_CLIENT_MODULE.newPoloniexAPIClient(global.EXCHANGE_KEYS[global.EXCHANGE_NAME].Key, global.EXCHANGE_KEYS[global.EXCHANGE_NAME].Secret); - poloniexApiClient.returnPublicTradeHistory(market.assetA, market.assetB, startTime, endTime, onExchangeCallReturned); + poloniexApiClient.API.returnPublicTradeHistory(market.assetA, market.assetB, startTime, endTime, onExchangeCallReturned); } catch (err) { logger.write("[ERROR] start -> getTheTrades -> err = " + err.message); @@ -848,7 +849,7 @@ What is the lastFile pointer? logger.write("[INFO] start -> onExchangeCallReturned -> Call time recorded = " + timeDifference + " seconds."); } - poloniexApiClient.analizeResponse(logger, err, exchangeResponse, callBackFunction, onResponseOk); + poloniexApiClient.API.analizeResponse(logger, err, exchangeResponse, callBackFunction, onResponseOk); function onResponseOk() { diff --git a/Poloniex-Live-Trades/User.bot.js b/Poloniex-Live-Trades/User.bot.js index 919ca38d2..49a1a7b39 100644 --- a/Poloniex-Live-Trades/User.bot.js +++ b/Poloniex-Live-Trades/User.bot.js @@ -25,8 +25,8 @@ let charlyStorage = BLOB_STORAGE.newBlobStorage(bot); - let utilities = UTILITIES.newUtilities(bot); - let poloniexApiClient = new POLONIEX_CLIENT_MODULE(); + let utilities = UTILITIES.newCloudUtilities(bot); + let poloniexApiClient = POLONIEX_CLIENT_MODULE.newPoloniexAPIClient(global.EXCHANGE_KEYS[global.EXCHANGE_NAME].Key, global.EXCHANGE_KEYS[global.EXCHANGE_NAME].Secret); let statusDependencies; @@ -42,7 +42,7 @@ statusDependencies = pStatusDependencies; - charlyStorage.initialize({ bot: "AACharly", devTeam: "AAMasters" }, onCharlyInizialized); + charlyStorage.initialize(bot.devTeam, onCharlyInizialized); function onCharlyInizialized(err) { @@ -192,7 +192,7 @@ Array of records with this information: exchangeCallTime = new Date(); - poloniexApiClient.returnPublicTradeHistory(market.assetA, market.assetB, startTime, endTime, onExchangeCallReturned); + poloniexApiClient.API.returnPublicTradeHistory(market.assetA, market.assetB, startTime, endTime, onExchangeCallReturned); } catch (err) { logger.write("[ERROR] start -> getTheTrades -> err = " + err.message); @@ -213,7 +213,7 @@ Array of records with this information: logger.write("[INFO] start -> onExchangeCallReturned -> Call time recorded = " + timeDifference + " seconds."); } - poloniexApiClient.analizeResponse(logger, err, exchangeResponse, callBackFunction, onResponseOk); + poloniexApiClient.API.analizeResponse(logger, err, exchangeResponse, callBackFunction, onResponseOk); function onResponseOk() { diff --git a/Project.njsproj b/Project.njsproj index 85586f376..22a9ed7a5 100644 --- a/Project.njsproj +++ b/Project.njsproj @@ -18,9 +18,9 @@ - - - + + +