diff --git a/lib/apis/coingecko.js b/lib/apis/coingecko.js index 25bbf00..1bbeb16 100644 --- a/lib/apis/coingecko.js +++ b/lib/apis/coingecko.js @@ -2,7 +2,7 @@ var request = require('postman-request'); var base_url = 'https://api.coingecko.com/api/v3/'; function get_coin_list(cb) { - request({ uri: base_url + 'coins/list?include_platform=false', json: true, headers: {'User-Agent': 'eiquidus'} }, function (error, response, body) { + request({ uri: base_url + 'coins/list?include_platform=false', json: true}, function (error, response, body) { if (error) return cb(error, []); else @@ -11,7 +11,7 @@ function get_coin_list(cb) { } function get_usd_value(id, cb) { - request({ uri: base_url + 'simple/price?ids=' + id + '&vs_currencies=usd', json: true, headers: {'User-Agent': 'eiquidus'} }, function (error, response, body) { + request({ uri: base_url + 'simple/price?ids=' + id + '&vs_currencies=usd', json: true}, function (error, response, body) { if (error) return cb(error, 0); else diff --git a/lib/explorer.js b/lib/explorer.js index 35e48dd..def5af1 100644 --- a/lib/explorer.js +++ b/lib/explorer.js @@ -168,7 +168,7 @@ module.exports = { // get data via internal web api request var uri = base_url + 'getmininginfo'; - request({uri: uri, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, body) { + request({uri: uri, json: true}, function (error, response, body) { // check if an error msg was received from the web api server if (body == 'There was an error. Check your console.') { // return a blank value @@ -224,7 +224,7 @@ module.exports = { // get data via internal web api request var uri = base_url + 'getnetworkhashps'; - request({uri: uri, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, body) { + request({uri: uri, json: true}, function (error, response, body) { // check if an error msg was received from the web api server if (body == 'There was an error. Check your console.') { // return a blank value @@ -260,7 +260,7 @@ module.exports = { } else { var uri = base_url + 'getdifficulty'; - request({uri: uri, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, body) { + request({uri: uri, json: true}, function (error, response, body) { // check if an error msg was received from the web api server if (body == 'There was an error. Check your console.') return cb(null); @@ -289,7 +289,7 @@ module.exports = { } else { var uri = base_url + 'getconnectioncount'; - request({uri: uri, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, body) { + request({uri: uri, json: true}, function (error, response, body) { // check if an error msg was received from the web api server if (body == 'There was an error. Check your console.') return cb(null); @@ -318,7 +318,7 @@ module.exports = { } else { var uri = base_url + 'getmasternodelist'; - request({uri: uri, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, body) { + request({uri: uri, json: true}, function (error, response, body) { // check if an error msg was received from the web api server if (body == 'There was an error. Check your console.') return cb(null); @@ -347,7 +347,7 @@ module.exports = { } else { var uri = base_url + 'getmasternodecount'; - request({uri: uri, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, body) { + request({uri: uri, json: true}, function (error, response, body) { // check if an error msg was received from the web api server if (body == 'There was an error. Check your console.') return cb(null); @@ -376,7 +376,7 @@ module.exports = { } else { var uri = base_url + 'getblockcount'; - request({uri: uri, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, body) { + request({uri: uri, json: true}, function (error, response, body) { // check if an error msg was received from the web api server if (body == 'There was an error. Check your console.') return cb(null); @@ -405,7 +405,7 @@ module.exports = { } else { var uri = base_url + 'getblockhash?height=' + (height ? height : ''); - request({uri: uri, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, body) { + request({uri: uri, json: true}, function (error, response, body) { // check if an error msg was received from the web api server if (body == 'There was an error. Check your console.') return cb(null); @@ -434,7 +434,7 @@ module.exports = { } else { var uri = base_url + 'getblock?hash=' + hash; - request({uri: uri, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, body) { + request({uri: uri, json: true}, function (error, response, body) { // check if an error msg was received from the web api server if (body == 'There was an error. Check your console.') return cb(null); @@ -463,7 +463,7 @@ module.exports = { } else { var uri = base_url + 'getrawtransaction?txid=' + hash + '&decrypt=1'; - request({uri: uri, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, body) { + request({uri: uri, json: true}, function (error, response, body) { // check if an error msg was received from the web api server if (body == 'There was an error. Check your console.') return cb(null); @@ -492,7 +492,7 @@ module.exports = { } else { var uri = base_url + 'getmaxmoney'; - request({uri: uri, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, body) { + request({uri: uri, json: true}, function (error, response, body) { // check if an error msg was received from the web api server if (body == 'There was an error. Check your console.') return cb(null); @@ -521,7 +521,7 @@ module.exports = { } else { var uri = base_url + 'getmaxvote'; - request({uri: uri, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, body) { + request({uri: uri, json: true}, function (error, response, body) { // check if an error msg was received from the web api server if (body == 'There was an error. Check your console.') return cb(null); @@ -550,7 +550,7 @@ module.exports = { } else { var uri = base_url + 'getvote'; - request({uri: uri, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, body) { + request({uri: uri, json: true}, function (error, response, body) { // check if an error msg was received from the web api server if (body == 'There was an error. Check your console.') return cb(null); @@ -579,7 +579,7 @@ module.exports = { } else { var uri = base_url + 'getphase'; - request({uri: uri, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, body) { + request({uri: uri, json: true}, function (error, response, body) { // check if an error msg was received from the web api server if (body == 'There was an error. Check your console.') return cb(null); @@ -608,7 +608,7 @@ module.exports = { } else { var uri = base_url + 'getreward'; - request({uri: uri, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, body) { + request({uri: uri, json: true}, function (error, response, body) { // check if an error msg was received from the web api server if (body == 'There was an error. Check your console.') return cb(null); @@ -637,7 +637,7 @@ module.exports = { } else { var uri = base_url + 'getnextrewardestimate'; - request({uri: uri, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, body) { + request({uri: uri, json: true}, function (error, response, body) { // check if an error msg was received from the web api server if (body == 'There was an error. Check your console.') return cb(null); @@ -666,7 +666,7 @@ module.exports = { } else { var uri = base_url + 'getnextrewardwhenstr'; - request({uri: uri, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, body) { + request({uri: uri, json: true}, function (error, response, body) { // check if an error msg was received from the web api server if (body == 'There was an error. Check your console.') return cb(null); @@ -698,7 +698,7 @@ module.exports = { } else { var uri = base_url + 'getdescriptorinfo?descriptor=' + encodeURIComponent(descriptor); - request({uri: uri, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, body) { + request({uri: uri, json: true}, function (error, response, body) { // check if an error msg was received from the web api server if (body == 'There was an error. Check your console.') return cb(null); @@ -727,7 +727,7 @@ module.exports = { } else { var uri = base_url + 'deriveaddresses?descriptor=' + encodeURIComponent(descriptor); - request({uri: uri, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, body) { + request({uri: uri, json: true}, function (error, response, body) { // check if an error msg was received from the web api server if (body == 'There was an error. Check your console.') return cb(null); @@ -835,7 +835,7 @@ module.exports = { } else { var uri = base_url + 'getsupply'; - request({uri: uri, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, body) { + request({uri: uri, json: true}, function (error, response, body) { // check if an error msg was received from the web api server if (body == 'There was an error. Check your console.') return cb(null); @@ -863,7 +863,7 @@ module.exports = { } else { var uri = base_url + 'getinfo'; - request({uri: uri, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, body) { + request({uri: uri, json: true}, function (error, response, body) { // check if an error msg was received from the web api server if (!body || !body.moneysupply ||body == 'There was an error. Check your console.') return cb(null); @@ -896,7 +896,7 @@ module.exports = { } else { var uri = base_url + 'gettxoutsetinfo'; - request({uri: uri, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, body) { + request({uri: uri, json: true}, function (error, response, body) { // check if an error msg was received from the web api server if (!body || !body.total_amount ||body == 'There was an error. Check your console.') return cb(null); @@ -931,7 +931,7 @@ module.exports = { } else { var uri = base_url + 'getpeerinfo'; - request({uri: uri, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, body) { + request({uri: uri, json: true}, function (error, response, body) { // check if an error msg was received from the web api server if (body == 'There was an error. Check your console.') return cb(null); @@ -960,7 +960,7 @@ module.exports = { } else { var uri = base_url + 'verifymessage?address=' + address + '&signature=' + signature + '&message=' + message; - request({uri: uri, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, body) { + request({uri: uri, json: true}, function (error, response, body) { // check if an error msg was received from the web api server if (body == 'There was an error. Check your console.') return cb(null); @@ -975,7 +975,7 @@ module.exports = { }, get_geo_location: function(address, cb) { - request({uri: 'https://reallyfreegeoip.org/json/' + address, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, geo) { + request({uri: 'https://reallyfreegeoip.org/json/' + address, json: true}, function (error, response, geo) { return cb(error, geo); }); }, diff --git a/lib/markets/altmarkets.js b/lib/markets/altmarkets.js index 63389de..f6c7180 100644 --- a/lib/markets/altmarkets.js +++ b/lib/markets/altmarkets.js @@ -6,7 +6,7 @@ const market_url_template = 'https://v2.altmarkets.io/trading/{coin}{base}'; function get_summary(coin, exchange, cb) { var req_url = base_url + coin.toLowerCase() + exchange.toLowerCase() + '/tickers'; - request({uri: req_url, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, body) { + request({uri: req_url, json: true}, function (error, response, body) { if (error) return cb(error, null); else { @@ -17,7 +17,7 @@ function get_summary(coin, exchange, cb) { else { req_url = base_url + coin.toLowerCase() + exchange.toLowerCase() + '/order-book?asks_limit=1&bids_limit=1'; - request({uri: req_url, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, order_body) { + request({uri: req_url, json: true}, function (error, response, order_body) { if (error) return cb(error, null); else { @@ -51,7 +51,7 @@ function get_summary(coin, exchange, cb) { function get_trades(coin, exchange, cb) { var req_url = base_url + coin.toLowerCase() + exchange.toLowerCase() + '/trades?limit=50&order_by=desc'; - request({uri: req_url, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, body) { + request({uri: req_url, json: true}, function (error, response, body) { // check for null body as the apis do not work all the time for some reason if (body != null) { if (body.errors != null) @@ -83,7 +83,7 @@ function get_trades(coin, exchange, cb) { function get_orders(coin, exchange, cb) { var req_url = base_url + coin.toLowerCase() + exchange.toLowerCase() + '/depth'; - request({uri: req_url, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, body) { + request({uri: req_url, json: true}, function (error, response, body) { // check for null body as the apis do not work all the time for some reason if (body != null) { if (body.errors) @@ -130,7 +130,7 @@ function get_chartdata(coin, exchange, cb) { var req_url = base_url + coin.toLowerCase() + exchange.toLowerCase() + '/k-line?time_from=' + parseInt(start) + '&time_to=' + parseInt(end) + '&period=15'; - request({uri: req_url, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, chartdata) { + request({uri: req_url, json: true}, function (error, response, chartdata) { if (error) return cb(error, []); else { diff --git a/lib/markets/bittrex.js b/lib/markets/bittrex.js index ac513a1..18d520a 100644 --- a/lib/markets/bittrex.js +++ b/lib/markets/bittrex.js @@ -5,7 +5,7 @@ const market_url_template = 'https://global.bittrex.com/Market/Index?MarketName= function get_summary(coin, exchange, cb) { var req_url = base_url + '/markets/' + coin + '-' + exchange + '/summary'; - request({uri: req_url, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, summary) { + request({uri: req_url, json: true}, function (error, response, summary) { if (error) return cb(error, null); else { @@ -13,7 +13,7 @@ function get_summary(coin, exchange, cb) { return cb(summary.code, null); else { req_url = base_url + '/markets/' + coin + '-' + exchange + '/ticker'; - request({uri: req_url, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, ticker) { + request({uri: req_url, json: true}, function (error, response, ticker) { if (error) return cb(error, null); else { @@ -42,7 +42,7 @@ function get_summary(coin, exchange, cb) { function get_trades(coin, exchange, cb) { var req_url = base_url + '/markets/' + coin + '-' + exchange + '/trades'; - request({uri: req_url, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, body) { + request({uri: req_url, json: true}, function (error, response, body) { if (error) return cb(error, null); else { @@ -69,7 +69,7 @@ function get_trades(coin, exchange, cb) { function get_orders(coin, exchange, cb) { var req_url = base_url + '/markets/' + coin + '-' + exchange + '/orderbook?depth=25'; - request({uri: req_url, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, body) { + request({uri: req_url, json: true}, function (error, response, body) { if (error) return cb(error, [], []); else { @@ -111,7 +111,7 @@ function get_chartdata(coin, exchange, cb) { var req_url = base_url + '/markets/' + coin + '-' + exchange + '/candles/MINUTE_5/recent'; - request({ uri: req_url, json: true, headers: {'User-Agent': 'eiquidus'} }, function (error, response, chartdata) { + request({ uri: req_url, json: true}, function (error, response, chartdata) { if (error) return cb(error, []); else { diff --git a/lib/markets/bleutrade.js b/lib/markets/bleutrade.js index 044c920..47667a8 100644 --- a/lib/markets/bleutrade.js +++ b/lib/markets/bleutrade.js @@ -5,7 +5,7 @@ const market_url_template = 'https://bleutrade.com/en/trade/pro/{coin}/{base}'; function get_summary(coin, exchange, cb) { var req_url = base_url + '/getmarketsummary?market=' + coin + '_' + exchange; - request({uri: req_url, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, body) { + request({uri: req_url, json: true}, function (error, response, body) { if (error) return cb(error, null); else { @@ -31,7 +31,7 @@ function get_summary(coin, exchange, cb) { function get_trades(coin, exchange, cb) { var req_url = base_url + '/getmarkethistory?market=' + coin + '_' + exchange + '&count=50'; - request({uri: req_url, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, body) { + request({uri: req_url, json: true}, function (error, response, body) { if (body.success) { var trades = []; @@ -58,7 +58,7 @@ function get_trades(coin, exchange, cb) { function get_orders(coin, exchange, cb) { var req_url = base_url + '/getorderbook?market=' + coin + '_' + exchange + '&type=all' + '&depth=50'; - request({uri: req_url, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, body) { + request({uri: req_url, json: true}, function (error, response, body) { if (body.success) { var orders = body.result; var buys = []; @@ -100,7 +100,7 @@ function get_chartdata(coin, exchange, cb) { var req_url = base_url + '/getcandles/?market=' + coin + '_' + exchange + '&period=1h'; - request({ uri: req_url, json: true, headers: {'User-Agent': 'eiquidus'} }, function (error, response, chartdata) { + request({ uri: req_url, json: true}, function (error, response, chartdata) { if (error) return cb(error, []); else { diff --git a/lib/markets/crex.js b/lib/markets/crex.js index d07888f..449b89b 100644 --- a/lib/markets/crex.js +++ b/lib/markets/crex.js @@ -5,7 +5,7 @@ const market_url_template = 'https://crex24.com/exchange/{coin}-{base}'; function get_summary(coin, exchange, cb) { var url=base_url + '/tickers?instrument=' + coin.toUpperCase() + '-' + exchange.toUpperCase(); - request({uri: url, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, body) { + request({uri: url, json: true}, function (error, response, body) { if (error) return cb(error, null); else if (body.error !== true) { @@ -29,7 +29,7 @@ function get_summary(coin, exchange, cb) { function get_trades(coin, exchange, cb) { var req_url = base_url + '/recentTrades?instrument=' + coin.toUpperCase() + '-' + exchange.toUpperCase(); - request({ uri: req_url, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, body) { + request({ uri: req_url, json: true}, function (error, response, body) { if (error) return cb(error, null); else if (body.error !== true) { @@ -55,7 +55,7 @@ function get_trades(coin, exchange, cb) { function get_orders(coin, exchange, cb) { var req_url = base_url + '/orderBook?instrument=' + coin.toUpperCase() + '-' + exchange.toUpperCase(); - request({ uri: req_url, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, body) { + request({ uri: req_url, json: true}, function (error, response, body) { if (error) return cb(error, null); else if (body.error !== true) { @@ -98,7 +98,7 @@ function get_chartdata(coin, exchange, cb) { var req_url = base_url + '/ohlcv?instrument=' + coin.toUpperCase() + '-' + exchange.toUpperCase() + '&granularity=15m&limit=100'; - request({ uri: req_url, json: true, headers: {'User-Agent': 'eiquidus'} }, function (error, response, chartdata) { + request({ uri: req_url, json: true}, function (error, response, chartdata) { if (error) return cb(error, []); else { diff --git a/lib/markets/poloniex.js b/lib/markets/poloniex.js index c6dd301..8977680 100644 --- a/lib/markets/poloniex.js +++ b/lib/markets/poloniex.js @@ -6,7 +6,7 @@ function get_summary(coin, exchange, cb) { var req_url = base_url + 'returnTicker'; var ticker = exchange + '_' + coin; - request({uri: req_url, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, body) { + request({uri: req_url, json: true}, function (error, response, body) { if (body.error) return cb(body.error, null); else { @@ -28,7 +28,7 @@ function get_summary(coin, exchange, cb) { function get_trades(coin, exchange, cb) { var req_url = base_url + 'returnTradeHistory¤cyPair=' + exchange + '_' + coin; - request({uri: req_url, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, body) { + request({uri: req_url, json: true}, function (error, response, body) { if (body.error) return cb(body.error, []); else { @@ -56,7 +56,7 @@ function get_trades(coin, exchange, cb) { function get_orders(coin, exchange, cb) { var req_url = base_url + 'returnOrderBook¤cyPair=' + exchange + '_' + coin + '&depth=50'; - request({uri: req_url, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, body) { + request({uri: req_url, json: true}, function (error, response, body) { if (body.error) return cb(body.error, []); else { @@ -98,7 +98,7 @@ function get_chartdata(coin, exchange, cb) { var req_url = base_url + 'returnChartData¤cyPair=' + exchange + '_' + coin + '&start=' + start + '&end=' + end + '&period=1800'; - request({uri: req_url, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, chartdata) { + request({uri: req_url, json: true}, function (error, response, chartdata) { if (error) return cb(error, []); else { diff --git a/lib/markets/southxchange.js b/lib/markets/southxchange.js index 85fdc44..e56693d 100644 --- a/lib/markets/southxchange.js +++ b/lib/markets/southxchange.js @@ -6,7 +6,7 @@ const market_url_template = 'https://main.southxchange.com/Market/Book/{coin}/{b function get_summary(coin, exchange, cb) { var summary = {}; - request({ uri: base_url + 'price/' + coin + '/' + exchange, json: true, headers: {'User-Agent': 'eiquidus'} }, function (error, response, body) { + request({ uri: base_url + 'price/' + coin + '/' + exchange, json: true}, function (error, response, body) { if (error) return cb(error, null); else if (body != null && body == '') @@ -28,7 +28,7 @@ function get_summary(coin, exchange, cb) { function get_trades(coin, exchange, cb) { var req_url = base_url + 'trades/' + coin + '/' + exchange; - request({ uri: req_url, json: true, headers: {'User-Agent': 'eiquidus'} }, function (error, response, body) { + request({ uri: req_url, json: true}, function (error, response, body) { if (error) return cb(error, null); else { @@ -55,7 +55,7 @@ function get_trades(coin, exchange, cb) { function get_orders(coin, exchange, cb) { var req_url = base_url + 'book/' + coin + '/' + exchange; - request({ uri: req_url, json: true, headers: {'User-Agent': 'eiquidus'} }, function (error, response, body) { + request({ uri: req_url, json: true}, function (error, response, body) { if (error) return cb(error, [], []); else if (body != null && body == '') @@ -99,7 +99,7 @@ function get_chartdata(coin, exchange, cb) { var start = end - 86400000; var req_url = base_url + 'history/' + coin + '/' + exchange + '/' + start + '/' + end + '/90'; - request({ uri: req_url, json: true, headers: {'User-Agent': 'eiquidus'} }, function (error, response, chartdata) { + request({ uri: req_url, json: true}, function (error, response, chartdata) { if (error) return cb(error, []); else if (typeof chartdata == 'string' || chartdata instanceof String) diff --git a/lib/markets/stex.js b/lib/markets/stex.js index 6828c96..e58e2f2 100644 --- a/lib/markets/stex.js +++ b/lib/markets/stex.js @@ -5,7 +5,7 @@ const market_url_template = 'https://app.stex.com/en/trading/pair/{base}/{coin}/ function get_summary(coin, exchange, stex_id, cb) { var summary = {}; - request({ uri: base_url + '/ticker/' + stex_id, json: true, headers: {'User-Agent': 'eiquidus'} }, function (error, response, body) { + request({ uri: base_url + '/ticker/' + stex_id, json: true}, function (error, response, body) { if (error) return cb(error, null); else if (body.success === true) { @@ -29,7 +29,7 @@ function get_summary(coin, exchange, stex_id, cb) { function get_trades(coin, exchange, stex_id, cb) { var req_url = base_url + '/trades/' + stex_id + '?sort=DESC&limit=100'; - request({ uri: req_url, json: true, headers: {'User-Agent': 'eiquidus'} }, function (error, response, body) { + request({ uri: req_url, json: true}, function (error, response, body) { if (body.success == true) { var trades = []; @@ -55,7 +55,7 @@ function get_trades(coin, exchange, stex_id, cb) { function get_orders(coin, exchange, stex_id, cb) { var req_url = base_url + '/orderbook/' + stex_id + '?limit_bids=100&limit_asks=100'; - request({ uri: req_url, json: true, headers: {'User-Agent': 'eiquidus'} }, function (error, response, body) { + request({ uri: req_url, json: true}, function (error, response, body) { if (body.success == true) { var orders = body.data; var buys = []; @@ -99,7 +99,7 @@ function get_chartdata(coin, exchange, stex_id, cb) { var req_url = base_url + '/chart/' + stex_id + '/30?timeStart=' + start + '&timeEnd=' + end + '&limit=1800&candlesType=1D'; - request({ uri: req_url, json: true, headers: {'User-Agent': 'eiquidus'} }, function (error, response, chartdata) { + request({ uri: req_url, json: true}, function (error, response, chartdata) { if (error) return cb(error, []); else { @@ -118,7 +118,7 @@ function get_chartdata(coin, exchange, stex_id, cb) { function get_pair_id(coin, exchange, cb) { // Lookup the currency pair id needed to use the stex api - request({ uri: base_url + '/currency_pairs/list/' + exchange, json: true, headers: {'User-Agent': 'eiquidus'} }, function (error, response, body) { + request({ uri: base_url + '/currency_pairs/list/' + exchange, json: true}, function (error, response, body) { if (error) return cb(error, null); else if (body.success === true) { diff --git a/lib/markets/yobit.js b/lib/markets/yobit.js index ad10cf1..0804949 100644 --- a/lib/markets/yobit.js +++ b/lib/markets/yobit.js @@ -5,7 +5,7 @@ const market_url_template = 'https://yobit.net/en/trade/{coin}/{base}'; function get_summary(coin, exchange, cb) { var req_url = base_url + '/ticker/' + coin + '_' + exchange; - request({uri: req_url, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, body) { + request({uri: req_url, json: true}, function (error, response, body) { if (error) return cb(error, null); else { @@ -30,7 +30,7 @@ function get_summary(coin, exchange, cb) { function get_trades(coin, exchange, cb) { var req_url = base_url + '/trades/' + coin + '_' + exchange; - request({uri: req_url, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, body) { + request({uri: req_url, json: true}, function (error, response, body) { if (error) return cb(error, null); else { @@ -59,7 +59,7 @@ function get_trades(coin, exchange, cb) { function get_orders(coin, exchange, cb) { var req_url = base_url + '/depth/' + coin + '_' + exchange; - request({uri: req_url, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, body) { + request({uri: req_url, json: true}, function (error, response, body) { if (body.success == 0) return cb(body.error, null, null); else {