Socket
Socket
Sign inDemoInstall

crypto-news-api

Package Overview
Dependencies
27
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.14 to 1.0.17

test/node_modules/crypto-news-api/test/bower_components/bluebird/changelog.md

2

package.json
{
"name": "crypto-news-api",
"version": "1.0.14",
"version": "1.0.17",
"description": "API to get a crypto newsfeed in your app",

@@ -5,0 +5,0 @@ "main": "dist/node/index.node.js",

@@ -68,2 +68,6 @@ CryptoControl Crypto News API

- **getTopNewsByCoinCategory(coinSlug: String)** Get news articles grouped by category for a specific coin from the CryptoControl News API.
- **getTopRedditPostsByCoin(coin: String)** Get top reddit posts for a particular coin
- **getLatestRedditPostsByCoin(coin: String)** Get latest reddit posts for a particular coin
- **getTopTweetsByCoin(coin: String)** Get top tweets for a particular coin
- **getLatestTweetsByCoin(coin: String)** Get latest tweets for a particular coin

@@ -70,0 +74,0 @@ The coin slugs are the coin id's used from the CoinMarketCap api. You can see the full list of coins here: [https://api.coinmarketcap.com/v1/ticker/?limit=2000](https://api.coinmarketcap.com/v1/ticker/?limit=2000)

@@ -29,13 +29,12 @@ {

},
"version": "1.0.13",
"_release": "1.0.13",
"version": "1.0.15",
"_release": "1.0.15",
"_resolution": {
"type": "version",
"tag": "1.0.13",
"commit": "ca4f4373f9d35f01410d828e0af1dde222a46804"
"tag": "1.0.15",
"commit": "60cd42e93607fb5f6afd4ed7894230cf48b37d31"
},
"_source": "https://github.com/cryptocontrol/nodejs-api.git",
"_target": "^1.0.13",
"_originalSource": "crypto-news-api",
"_direct": true
"_target": "^1.0.14",
"_originalSource": "crypto-news-api"
}

@@ -1,1 +0,1 @@

!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=11)}([function(e,t,r){"use strict";var n=String.prototype.replace,o=/%20/g;e.exports={default:"RFC3986",formatters:{RFC1738:function(e){return n.call(e,o,"+")},RFC3986:function(e){return e}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},function(e,t,r){"use strict";var n=Object.prototype.hasOwnProperty,o=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),i=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},n=0;n<e.length;++n)void 0!==e[n]&&(r[n]=e[n]);return r};e.exports={arrayToObject:i,assign:function(e,t){return Object.keys(t).reduce(function(e,r){return e[r]=t[r],e},e)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],r=[],n=0;n<t.length;++n)for(var o=t[n],i=o.obj[o.prop],a=Object.keys(i),c=0;c<a.length;++c){var s=a[c],u=i[s];"object"==typeof u&&null!==u&&-1===r.indexOf(u)&&(t.push({obj:i,prop:s}),r.push(u))}return function(e){for(var t;e.length;){var r=e.pop();if(t=r.obj[r.prop],Array.isArray(t)){for(var n=[],o=0;o<t.length;++o)void 0!==t[o]&&n.push(t[o]);r.obj[r.prop]=n}}return t}(t)},decode:function(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}},encode:function(e){if(0===e.length)return e;for(var t="string"==typeof e?e:String(e),r="",n=0;n<t.length;++n){var i=t.charCodeAt(n);45===i||46===i||95===i||126===i||i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122?r+=t.charAt(n):i<128?r+=o[i]:i<2048?r+=o[192|i>>6]+o[128|63&i]:i<55296||i>=57344?r+=o[224|i>>12]+o[128|i>>6&63]+o[128|63&i]:(n+=1,i=65536+((1023&i)<<10|1023&t.charCodeAt(n)),r+=o[240|i>>18]+o[128|i>>12&63]+o[128|i>>6&63]+o[128|63&i])}return r},isBuffer:function(e){return null!==e&&void 0!==e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},merge:function e(t,r,o){if(!r)return t;if("object"!=typeof r){if(Array.isArray(t))t.push(r);else{if("object"!=typeof t)return[t,r];(o.plainObjects||o.allowPrototypes||!n.call(Object.prototype,r))&&(t[r]=!0)}return t}if("object"!=typeof t)return[t].concat(r);var a=t;return Array.isArray(t)&&!Array.isArray(r)&&(a=i(t,o)),Array.isArray(t)&&Array.isArray(r)?(r.forEach(function(r,i){n.call(t,i)?t[i]&&"object"==typeof t[i]?t[i]=e(t[i],r,o):t.push(r):t[i]=r}),t):Object.keys(r).reduce(function(t,i){var a=r[i];return n.call(t,i)?t[i]=e(t[i],a,o):t[i]=a,t},a)}}},function(e,t,r){"use strict";var n=this&&this.__assign||Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function a(e){try{s(n.next(e))}catch(e){i(e)}}function c(e){try{s(n.throw(e))}catch(e){i(e)}}function s(e){e.done?o(e.value):new r(function(t){t(e.value)}).then(a,c)}s((n=n.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=n[2&i[0]?"return":i[0]?"throw":"next"])&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[0,o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}};Object.defineProperty(t,"__esModule",{value:!0});var a=r(9),c=r(5),s=a("crypto-news-api");t.generateAPI=function(e){return function(){function t(e){if(!e)throw new Error("No API key found. Register for an API key at https://cryptocontrol.io/apis");this.apikey=e,s("using cryptocontrol.io api v1")}return t.prototype._fetch=function(t,r){void 0===r&&(r={});var o=c.stringify(n({},r,{key:this.apikey}));return e("https://cryptocontrol.io/api/public"+t+"?"+o).then(function(e){if(401===e.status)throw new Error("Invalid API Key");if(200!==e.status)throw new Error("Bad response from the CryptoControl server");return e.json()})},t.prototype.getTopNews=function(){return o(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this._fetch("/news")];case 1:return[2,e.sent()]}})})},t.prototype.getLatestNews=function(){return o(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this._fetch("/news",{latest:!0})];case 1:return[2,e.sent()]}})})},t.prototype.getTopNewsByCategory=function(){return o(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this._fetch("/news/category")];case 1:return[2,e.sent()]}})})},t.prototype.getTopNewsByCoin=function(e){return o(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,this._fetch("/news/coin/"+e)];case 1:return[2,t.sent()]}})})},t.prototype.getLatestNewsByCoin=function(e){return o(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,this._fetch("/news/coin/"+e,{latest:!0})];case 1:return[2,t.sent()]}})})},t.prototype.getTopNewsByCoinCategory=function(e){return o(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,this._fetch("/news/coin/"+e+"/category")];case 1:return[2,t.sent()]}})})},t}()}},function(e,t,r){"use strict";var n=r(1),o=Object.prototype.hasOwnProperty,i={allowDots:!1,allowPrototypes:!1,arrayLimit:20,decoder:n.decode,delimiter:"&",depth:5,parameterLimit:1e3,plainObjects:!1,strictNullHandling:!1},a=function(e,t,r){if(e){var n=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,i=/(\[[^[\]]*])/g,a=/(\[[^[\]]*])/.exec(n),c=a?n.slice(0,a.index):n,s=[];if(c){if(!r.plainObjects&&o.call(Object.prototype,c)&&!r.allowPrototypes)return;s.push(c)}for(var u=0;null!==(a=i.exec(n))&&u<r.depth;){if(u+=1,!r.plainObjects&&o.call(Object.prototype,a[1].slice(1,-1))&&!r.allowPrototypes)return;s.push(a[1])}return a&&s.push("["+n.slice(a.index)+"]"),function(e,t,r){for(var n=t,o=e.length-1;o>=0;--o){var i,a=e[o];if("[]"===a)i=(i=[]).concat(n);else{i=r.plainObjects?Object.create(null):{};var c="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,s=parseInt(c,10);!isNaN(s)&&a!==c&&String(s)===c&&s>=0&&r.parseArrays&&s<=r.arrayLimit?(i=[])[s]=n:i[c]=n}n=i}return n}(s,t,r)}};e.exports=function(e,t){var r=t?n.assign({},t):{};if(null!==r.decoder&&void 0!==r.decoder&&"function"!=typeof r.decoder)throw new TypeError("Decoder has to be a function.");if(r.ignoreQueryPrefix=!0===r.ignoreQueryPrefix,r.delimiter="string"==typeof r.delimiter||n.isRegExp(r.delimiter)?r.delimiter:i.delimiter,r.depth="number"==typeof r.depth?r.depth:i.depth,r.arrayLimit="number"==typeof r.arrayLimit?r.arrayLimit:i.arrayLimit,r.parseArrays=!1!==r.parseArrays,r.decoder="function"==typeof r.decoder?r.decoder:i.decoder,r.allowDots="boolean"==typeof r.allowDots?r.allowDots:i.allowDots,r.plainObjects="boolean"==typeof r.plainObjects?r.plainObjects:i.plainObjects,r.allowPrototypes="boolean"==typeof r.allowPrototypes?r.allowPrototypes:i.allowPrototypes,r.parameterLimit="number"==typeof r.parameterLimit?r.parameterLimit:i.parameterLimit,r.strictNullHandling="boolean"==typeof r.strictNullHandling?r.strictNullHandling:i.strictNullHandling,""===e||null===e||void 0===e)return r.plainObjects?Object.create(null):{};for(var c="string"==typeof e?function(e,t){for(var r={},n=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,a=t.parameterLimit===1/0?void 0:t.parameterLimit,c=n.split(t.delimiter,a),s=0;s<c.length;++s){var u,l,f=c[s],p=f.indexOf("]="),d=-1===p?f.indexOf("="):p+1;-1===d?(u=t.decoder(f,i.decoder),l=t.strictNullHandling?null:""):(u=t.decoder(f.slice(0,d),i.decoder),l=t.decoder(f.slice(d+1),i.decoder)),o.call(r,u)?r[u]=[].concat(r[u]).concat(l):r[u]=l}return r}(e,r):e,s=r.plainObjects?Object.create(null):{},u=Object.keys(c),l=0;l<u.length;++l){var f=u[l],p=a(f,c[f],r);s=n.merge(s,p,r)}return n.compact(s)}},function(e,t,r){"use strict";var n=r(1),o=r(0),i={brackets:function(e){return e+"[]"},indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},a=Date.prototype.toISOString,c={delimiter:"&",encode:!0,encoder:n.encode,encodeValuesOnly:!1,serializeDate:function(e){return a.call(e)},skipNulls:!1,strictNullHandling:!1},s=function e(t,r,o,i,a,s,u,l,f,p,d,y){var h=t;if("function"==typeof u)h=u(r,h);else if(h instanceof Date)h=p(h);else if(null===h){if(i)return s&&!y?s(r,c.encoder):r;h=""}if("string"==typeof h||"number"==typeof h||"boolean"==typeof h||n.isBuffer(h))return s?[d(y?r:s(r,c.encoder))+"="+d(s(h,c.encoder))]:[d(r)+"="+d(String(h))];var g,C=[];if(void 0===h)return C;if(Array.isArray(u))g=u;else{var v=Object.keys(h);g=l?v.sort(l):v}for(var m=0;m<g.length;++m){var b=g[m];a&&null===h[b]||(C=Array.isArray(h)?C.concat(e(h[b],o(r,b),o,i,a,s,u,l,f,p,d,y)):C.concat(e(h[b],r+(f?"."+b:"["+b+"]"),o,i,a,s,u,l,f,p,d,y)))}return C};e.exports=function(e,t){var r=e,a=t?n.assign({},t):{};if(null!==a.encoder&&void 0!==a.encoder&&"function"!=typeof a.encoder)throw new TypeError("Encoder has to be a function.");var u=void 0===a.delimiter?c.delimiter:a.delimiter,l="boolean"==typeof a.strictNullHandling?a.strictNullHandling:c.strictNullHandling,f="boolean"==typeof a.skipNulls?a.skipNulls:c.skipNulls,p="boolean"==typeof a.encode?a.encode:c.encode,d="function"==typeof a.encoder?a.encoder:c.encoder,y="function"==typeof a.sort?a.sort:null,h=void 0!==a.allowDots&&a.allowDots,g="function"==typeof a.serializeDate?a.serializeDate:c.serializeDate,C="boolean"==typeof a.encodeValuesOnly?a.encodeValuesOnly:c.encodeValuesOnly;if(void 0===a.format)a.format=o.default;else if(!Object.prototype.hasOwnProperty.call(o.formatters,a.format))throw new TypeError("Unknown format option provided.");var v,m,b=o.formatters[a.format];"function"==typeof a.filter?r=(m=a.filter)("",r):Array.isArray(a.filter)&&(v=m=a.filter);var w,F=[];if("object"!=typeof r||null===r)return"";w=a.arrayFormat in i?a.arrayFormat:"indices"in a?a.indices?"indices":"repeat":"indices";var O=i[w];v||(v=Object.keys(r)),y&&v.sort(y);for(var j=0;j<v.length;++j){var A=v[j];f&&null===r[A]||(F=F.concat(s(r[A],A,O,l,f,p?d:null,m,y,h,g,b,C)))}var x=F.join(u),k=!0===a.addQueryPrefix?"?":"";return x.length>0?k+x:""}},function(e,t,r){"use strict";var n=r(4),o=r(3),i=r(0);e.exports={formats:i,parse:o,stringify:n}},function(e,t){var r=1e3,n=60*r,o=60*n,i=24*o,a=365.25*i;function c(e,t,r){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+r:Math.ceil(e/t)+" "+r+"s"}e.exports=function(e,t){t=t||{};var s,u=typeof e;if("string"===u&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var c=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*a;case"days":case"day":case"d":return c*i;case"hours":case"hour":case"hrs":case"hr":case"h":return c*o;case"minutes":case"minute":case"mins":case"min":case"m":return c*n;case"seconds":case"second":case"secs":case"sec":case"s":return c*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(e);if("number"===u&&!1===isNaN(e))return t.long?c(s=e,i,"day")||c(s,o,"hour")||c(s,n,"minute")||c(s,r,"second")||s+" ms":function(e){if(e>=i)return Math.round(e/i)+"d";if(e>=o)return Math.round(e/o)+"h";if(e>=n)return Math.round(e/n)+"m";if(e>=r)return Math.round(e/r)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t,r){function n(e){var r;function n(){if(n.enabled){var e=n,o=+new Date,i=o-(r||o);e.diff=i,e.prev=r,e.curr=o,r=o;for(var a=new Array(arguments.length),c=0;c<a.length;c++)a[c]=arguments[c];a[0]=t.coerce(a[0]),"string"!=typeof a[0]&&a.unshift("%O");var s=0;a[0]=a[0].replace(/%([a-zA-Z%])/g,function(r,n){if("%%"===r)return r;s++;var o=t.formatters[n];if("function"==typeof o){var i=a[s];r=o.call(e,i),a.splice(s,1),s--}return r}),t.formatArgs.call(e,a),(n.log||t.log||console.log.bind(console)).apply(e,a)}}return n.namespace=e,n.enabled=t.enabled(e),n.useColors=t.useColors(),n.color=function(e){var r,n=0;for(r in e)n=(n<<5)-n+e.charCodeAt(r),n|=0;return t.colors[Math.abs(n)%t.colors.length]}(e),n.destroy=o,"function"==typeof t.init&&t.init(n),t.instances.push(n),n}function o(){var e=t.instances.indexOf(this);return-1!==e&&(t.instances.splice(e,1),!0)}(t=e.exports=n.debug=n.default=n).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){var r;t.save(e),t.names=[],t.skips=[];var n=("string"==typeof e?e:"").split(/[\s,]+/),o=n.length;for(r=0;r<o;r++)n[r]&&("-"===(e=n[r].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")));for(r=0;r<t.instances.length;r++){var i=t.instances[r];i.enabled=t.enabled(i.namespace)}},t.enabled=function(e){if("*"===e[e.length-1])return!0;var r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=r(6),t.instances=[],t.names=[],t.skips=[],t.formatters={}},function(e,t){var r,n,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function c(e){if(r===setTimeout)return setTimeout(e,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(e){r=i}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(e){n=a}}();var s,u=[],l=!1,f=-1;function p(){l&&s&&(l=!1,s.length?u=s.concat(u):f=-1,u.length&&d())}function d(){if(!l){var e=c(p);l=!0;for(var t=u.length;t;){for(s=u,u=[];++f<t;)s&&s[f].run();f=-1,t=u.length}s=null,l=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function y(e,t){this.fun=e,this.array=t}function h(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new y(e,t)),1!==u.length||l||c(d)},y.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=h,o.addListener=h,o.once=h,o.off=h,o.removeListener=h,o.removeAllListeners=h,o.emit=h,o.prependListener=h,o.prependOnceListener=h,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,r){(function(n){function o(){var e;try{e=t.storage.debug}catch(e){}return!e&&void 0!==n&&"env"in n&&(e=n.env.DEBUG),e}(t=e.exports=r(7)).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var r=this.useColors;if(e[0]=(r?"%c":"")+this.namespace+(r?" %c":" ")+e[0]+(r?"%c ":" ")+"+"+t.humanize(this.diff),!r)return;var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var o=0,i=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&"%c"===e&&(i=++o)}),e.splice(i,0,n)},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}},t.load=o,t.useColors=function(){if("undefined"!=typeof window&&window.process&&"renderer"===window.process.type)return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(o())}).call(this,r(8))},function(e,t){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r(2).generateAPI(fetch);window.CryptoControlApi=n,window.CryptoNewsApi=n,e.CryptoControlApi=n,e.CryptoNewsApi=n,t.default=n,function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(2))}).call(this,r(10))}]);
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=11)}([function(e,t,r){"use strict";var n=String.prototype.replace,o=/%20/g;e.exports={default:"RFC3986",formatters:{RFC1738:function(e){return n.call(e,o,"+")},RFC3986:function(e){return e}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},function(e,t,r){"use strict";var n=Object.prototype.hasOwnProperty,o=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),i=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},n=0;n<e.length;++n)void 0!==e[n]&&(r[n]=e[n]);return r};e.exports={arrayToObject:i,assign:function(e,t){return Object.keys(t).reduce(function(e,r){return e[r]=t[r],e},e)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],r=[],n=0;n<t.length;++n)for(var o=t[n],i=o.obj[o.prop],c=Object.keys(i),s=0;s<c.length;++s){var a=c[s],u=i[a];"object"==typeof u&&null!==u&&-1===r.indexOf(u)&&(t.push({obj:i,prop:a}),r.push(u))}return function(e){for(var t;e.length;){var r=e.pop();if(t=r.obj[r.prop],Array.isArray(t)){for(var n=[],o=0;o<t.length;++o)void 0!==t[o]&&n.push(t[o]);r.obj[r.prop]=n}}return t}(t)},decode:function(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}},encode:function(e){if(0===e.length)return e;for(var t="string"==typeof e?e:String(e),r="",n=0;n<t.length;++n){var i=t.charCodeAt(n);45===i||46===i||95===i||126===i||i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122?r+=t.charAt(n):i<128?r+=o[i]:i<2048?r+=o[192|i>>6]+o[128|63&i]:i<55296||i>=57344?r+=o[224|i>>12]+o[128|i>>6&63]+o[128|63&i]:(n+=1,i=65536+((1023&i)<<10|1023&t.charCodeAt(n)),r+=o[240|i>>18]+o[128|i>>12&63]+o[128|i>>6&63]+o[128|63&i])}return r},isBuffer:function(e){return null!==e&&void 0!==e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},merge:function e(t,r,o){if(!r)return t;if("object"!=typeof r){if(Array.isArray(t))t.push(r);else{if("object"!=typeof t)return[t,r];(o.plainObjects||o.allowPrototypes||!n.call(Object.prototype,r))&&(t[r]=!0)}return t}if("object"!=typeof t)return[t].concat(r);var c=t;return Array.isArray(t)&&!Array.isArray(r)&&(c=i(t,o)),Array.isArray(t)&&Array.isArray(r)?(r.forEach(function(r,i){n.call(t,i)?t[i]&&"object"==typeof t[i]?t[i]=e(t[i],r,o):t.push(r):t[i]=r}),t):Object.keys(r).reduce(function(t,i){var c=r[i];return n.call(t,i)?t[i]=e(t[i],c,o):t[i]=c,t},c)}}},function(e,t,r){"use strict";var n=this&&this.__assign||Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function c(e){try{a(n.next(e))}catch(e){i(e)}}function s(e){try{a(n.throw(e))}catch(e){i(e)}}function a(e){e.done?o(e.value):new r(function(t){t(e.value)}).then(c,s)}a((n=n.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var r,n,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;c;)try{if(r=1,n&&(o=n[2&i[0]?"return":i[0]?"throw":"next"])&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[0,o.value]),i[0]){case 0:case 1:o=i;break;case 4:return c.label++,{value:i[1],done:!1};case 5:c.label++,n=i[1],i=[0];continue;case 7:i=c.ops.pop(),c.trys.pop();continue;default:if(!(o=(o=c.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){c=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){c.label=i[1];break}if(6===i[0]&&c.label<o[1]){c.label=o[1],o=i;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(i);break}o[2]&&c.ops.pop(),c.trys.pop();continue}i=t.call(e,c)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var c=r(9),s=r(5),a=c("crypto-news-api");t.generateAPI=function(e){return function(){function t(e){if(!e)throw new Error("No API key found. Register for an API key at https://cryptocontrol.io/apis");this.apikey=e,a("using cryptocontrol.io api v1")}return t.prototype._fetch=function(t,r){void 0===r&&(r={});var o=s.stringify(n({},r,{key:this.apikey}));return e("https://cryptocontrol.io/api/public"+t+"?"+o).then(function(e){if(401===e.status)throw new Error("Invalid API Key");if(200!==e.status)throw new Error("Bad response from the CryptoControl server");return e.json()})},t.prototype.getTopNews=function(){return o(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this._fetch("/news")];case 1:return[2,e.sent()]}})})},t.prototype.getLatestNews=function(){return o(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this._fetch("/news",{latest:!0})];case 1:return[2,e.sent()]}})})},t.prototype.getTopNewsByCategory=function(){return o(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this._fetch("/news/category")];case 1:return[2,e.sent()]}})})},t.prototype.getTopNewsByCoin=function(e){return o(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,this._fetch("/news/coin/"+e)];case 1:return[2,t.sent()]}})})},t.prototype.getLatestNewsByCoin=function(e){return o(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,this._fetch("/news/coin/"+e,{latest:!0})];case 1:return[2,t.sent()]}})})},t.prototype.getTopNewsByCoinCategory=function(e){return o(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,this._fetch("/news/coin/"+e+"/category")];case 1:return[2,t.sent()]}})})},t.prototype.getTopTweeetsByCoin=function(e){return o(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,this._fetch("/tweets/coin/"+e)];case 1:return[2,t.sent()]}})})},t.prototype.getLatestTweetsByCoin=function(e){return o(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,this._fetch("/tweets/coin/"+e,{latest:!0})];case 1:return[2,t.sent()]}})})},t.prototype.getTopRedditPostsByCoin=function(e){return o(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,this._fetch("/reddit/coin/"+e)];case 1:return[2,t.sent()]}})})},t.prototype.getLatestRedditPostsByCoin=function(e){return o(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,this._fetch("/reddit/coin/"+e,{latest:!0})];case 1:return[2,t.sent()]}})})},t}()}},function(e,t,r){"use strict";var n=r(1),o=Object.prototype.hasOwnProperty,i={allowDots:!1,allowPrototypes:!1,arrayLimit:20,decoder:n.decode,delimiter:"&",depth:5,parameterLimit:1e3,plainObjects:!1,strictNullHandling:!1},c=function(e,t,r){if(e){var n=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,i=/(\[[^[\]]*])/g,c=/(\[[^[\]]*])/.exec(n),s=c?n.slice(0,c.index):n,a=[];if(s){if(!r.plainObjects&&o.call(Object.prototype,s)&&!r.allowPrototypes)return;a.push(s)}for(var u=0;null!==(c=i.exec(n))&&u<r.depth;){if(u+=1,!r.plainObjects&&o.call(Object.prototype,c[1].slice(1,-1))&&!r.allowPrototypes)return;a.push(c[1])}return c&&a.push("["+n.slice(c.index)+"]"),function(e,t,r){for(var n=t,o=e.length-1;o>=0;--o){var i,c=e[o];if("[]"===c)i=(i=[]).concat(n);else{i=r.plainObjects?Object.create(null):{};var s="["===c.charAt(0)&&"]"===c.charAt(c.length-1)?c.slice(1,-1):c,a=parseInt(s,10);!isNaN(a)&&c!==s&&String(a)===s&&a>=0&&r.parseArrays&&a<=r.arrayLimit?(i=[])[a]=n:i[s]=n}n=i}return n}(a,t,r)}};e.exports=function(e,t){var r=t?n.assign({},t):{};if(null!==r.decoder&&void 0!==r.decoder&&"function"!=typeof r.decoder)throw new TypeError("Decoder has to be a function.");if(r.ignoreQueryPrefix=!0===r.ignoreQueryPrefix,r.delimiter="string"==typeof r.delimiter||n.isRegExp(r.delimiter)?r.delimiter:i.delimiter,r.depth="number"==typeof r.depth?r.depth:i.depth,r.arrayLimit="number"==typeof r.arrayLimit?r.arrayLimit:i.arrayLimit,r.parseArrays=!1!==r.parseArrays,r.decoder="function"==typeof r.decoder?r.decoder:i.decoder,r.allowDots="boolean"==typeof r.allowDots?r.allowDots:i.allowDots,r.plainObjects="boolean"==typeof r.plainObjects?r.plainObjects:i.plainObjects,r.allowPrototypes="boolean"==typeof r.allowPrototypes?r.allowPrototypes:i.allowPrototypes,r.parameterLimit="number"==typeof r.parameterLimit?r.parameterLimit:i.parameterLimit,r.strictNullHandling="boolean"==typeof r.strictNullHandling?r.strictNullHandling:i.strictNullHandling,""===e||null===e||void 0===e)return r.plainObjects?Object.create(null):{};for(var s="string"==typeof e?function(e,t){for(var r={},n=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,c=t.parameterLimit===1/0?void 0:t.parameterLimit,s=n.split(t.delimiter,c),a=0;a<s.length;++a){var u,l,f=s[a],p=f.indexOf("]="),d=-1===p?f.indexOf("="):p+1;-1===d?(u=t.decoder(f,i.decoder),l=t.strictNullHandling?null:""):(u=t.decoder(f.slice(0,d),i.decoder),l=t.decoder(f.slice(d+1),i.decoder)),o.call(r,u)?r[u]=[].concat(r[u]).concat(l):r[u]=l}return r}(e,r):e,a=r.plainObjects?Object.create(null):{},u=Object.keys(s),l=0;l<u.length;++l){var f=u[l],p=c(f,s[f],r);a=n.merge(a,p,r)}return n.compact(a)}},function(e,t,r){"use strict";var n=r(1),o=r(0),i={brackets:function(e){return e+"[]"},indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},c=Date.prototype.toISOString,s={delimiter:"&",encode:!0,encoder:n.encode,encodeValuesOnly:!1,serializeDate:function(e){return c.call(e)},skipNulls:!1,strictNullHandling:!1},a=function e(t,r,o,i,c,a,u,l,f,p,d,h){var y=t;if("function"==typeof u)y=u(r,y);else if(y instanceof Date)y=p(y);else if(null===y){if(i)return a&&!h?a(r,s.encoder):r;y=""}if("string"==typeof y||"number"==typeof y||"boolean"==typeof y||n.isBuffer(y))return a?[d(h?r:a(r,s.encoder))+"="+d(a(y,s.encoder))]:[d(r)+"="+d(String(y))];var g,v=[];if(void 0===y)return v;if(Array.isArray(u))g=u;else{var C=Object.keys(y);g=l?C.sort(l):C}for(var m=0;m<g.length;++m){var w=g[m];c&&null===y[w]||(v=Array.isArray(y)?v.concat(e(y[w],o(r,w),o,i,c,a,u,l,f,p,d,h)):v.concat(e(y[w],r+(f?"."+w:"["+w+"]"),o,i,c,a,u,l,f,p,d,h)))}return v};e.exports=function(e,t){var r=e,c=t?n.assign({},t):{};if(null!==c.encoder&&void 0!==c.encoder&&"function"!=typeof c.encoder)throw new TypeError("Encoder has to be a function.");var u=void 0===c.delimiter?s.delimiter:c.delimiter,l="boolean"==typeof c.strictNullHandling?c.strictNullHandling:s.strictNullHandling,f="boolean"==typeof c.skipNulls?c.skipNulls:s.skipNulls,p="boolean"==typeof c.encode?c.encode:s.encode,d="function"==typeof c.encoder?c.encoder:s.encoder,h="function"==typeof c.sort?c.sort:null,y=void 0!==c.allowDots&&c.allowDots,g="function"==typeof c.serializeDate?c.serializeDate:s.serializeDate,v="boolean"==typeof c.encodeValuesOnly?c.encodeValuesOnly:s.encodeValuesOnly;if(void 0===c.format)c.format=o.default;else if(!Object.prototype.hasOwnProperty.call(o.formatters,c.format))throw new TypeError("Unknown format option provided.");var C,m,w=o.formatters[c.format];"function"==typeof c.filter?r=(m=c.filter)("",r):Array.isArray(c.filter)&&(C=m=c.filter);var b,F=[];if("object"!=typeof r||null===r)return"";b=c.arrayFormat in i?c.arrayFormat:"indices"in c?c.indices?"indices":"repeat":"indices";var O=i[b];C||(C=Object.keys(r)),h&&C.sort(h);for(var j=0;j<C.length;++j){var A=C[j];f&&null===r[A]||(F=F.concat(a(r[A],A,O,l,f,p?d:null,m,h,y,g,w,v)))}var x=F.join(u),k=!0===c.addQueryPrefix?"?":"";return x.length>0?k+x:""}},function(e,t,r){"use strict";var n=r(4),o=r(3),i=r(0);e.exports={formats:i,parse:o,stringify:n}},function(e,t){var r=1e3,n=60*r,o=60*n,i=24*o,c=365.25*i;function s(e,t,r){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+r:Math.ceil(e/t)+" "+r+"s"}e.exports=function(e,t){t=t||{};var a,u=typeof e;if("string"===u&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var s=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return s*c;case"days":case"day":case"d":return s*i;case"hours":case"hour":case"hrs":case"hr":case"h":return s*o;case"minutes":case"minute":case"mins":case"min":case"m":return s*n;case"seconds":case"second":case"secs":case"sec":case"s":return s*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}(e);if("number"===u&&!1===isNaN(e))return t.long?s(a=e,i,"day")||s(a,o,"hour")||s(a,n,"minute")||s(a,r,"second")||a+" ms":function(e){if(e>=i)return Math.round(e/i)+"d";if(e>=o)return Math.round(e/o)+"h";if(e>=n)return Math.round(e/n)+"m";if(e>=r)return Math.round(e/r)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t,r){function n(e){var r;function n(){if(n.enabled){var e=n,o=+new Date,i=o-(r||o);e.diff=i,e.prev=r,e.curr=o,r=o;for(var c=new Array(arguments.length),s=0;s<c.length;s++)c[s]=arguments[s];c[0]=t.coerce(c[0]),"string"!=typeof c[0]&&c.unshift("%O");var a=0;c[0]=c[0].replace(/%([a-zA-Z%])/g,function(r,n){if("%%"===r)return r;a++;var o=t.formatters[n];if("function"==typeof o){var i=c[a];r=o.call(e,i),c.splice(a,1),a--}return r}),t.formatArgs.call(e,c),(n.log||t.log||console.log.bind(console)).apply(e,c)}}return n.namespace=e,n.enabled=t.enabled(e),n.useColors=t.useColors(),n.color=function(e){var r,n=0;for(r in e)n=(n<<5)-n+e.charCodeAt(r),n|=0;return t.colors[Math.abs(n)%t.colors.length]}(e),n.destroy=o,"function"==typeof t.init&&t.init(n),t.instances.push(n),n}function o(){var e=t.instances.indexOf(this);return-1!==e&&(t.instances.splice(e,1),!0)}(t=e.exports=n.debug=n.default=n).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){var r;t.save(e),t.names=[],t.skips=[];var n=("string"==typeof e?e:"").split(/[\s,]+/),o=n.length;for(r=0;r<o;r++)n[r]&&("-"===(e=n[r].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")));for(r=0;r<t.instances.length;r++){var i=t.instances[r];i.enabled=t.enabled(i.namespace)}},t.enabled=function(e){if("*"===e[e.length-1])return!0;var r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=r(6),t.instances=[],t.names=[],t.skips=[],t.formatters={}},function(e,t){var r,n,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(e){r=i}try{n="function"==typeof clearTimeout?clearTimeout:c}catch(e){n=c}}();var a,u=[],l=!1,f=-1;function p(){l&&a&&(l=!1,a.length?u=a.concat(u):f=-1,u.length&&d())}function d(){if(!l){var e=s(p);l=!0;for(var t=u.length;t;){for(a=u,u=[];++f<t;)a&&a[f].run();f=-1,t=u.length}a=null,l=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===c||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function y(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new h(e,t)),1!==u.length||l||s(d)},h.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=y,o.addListener=y,o.once=y,o.off=y,o.removeListener=y,o.removeAllListeners=y,o.emit=y,o.prependListener=y,o.prependOnceListener=y,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,r){(function(n){function o(){var e;try{e=t.storage.debug}catch(e){}return!e&&void 0!==n&&"env"in n&&(e=n.env.DEBUG),e}(t=e.exports=r(7)).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var r=this.useColors;if(e[0]=(r?"%c":"")+this.namespace+(r?" %c":" ")+e[0]+(r?"%c ":" ")+"+"+t.humanize(this.diff),!r)return;var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var o=0,i=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&"%c"===e&&(i=++o)}),e.splice(i,0,n)},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}},t.load=o,t.useColors=function(){if("undefined"!=typeof window&&window.process&&"renderer"===window.process.type)return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(o())}).call(this,r(8))},function(e,t){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r(2).generateAPI(fetch);window.CryptoControlApi=n,window.CryptoNewsApi=n,e.CryptoControlApi=n,e.CryptoNewsApi=n,t.default=n,function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(2))}).call(this,r(10))}]);

@@ -12,2 +12,6 @@ import * as API from './src/CryptoControlApi';

getTopNewsByCoinCategory(coinSlug: string): Promise<API.ICategoryResponse>;
getTopTweeetsByCoin(coinSlug: string): Promise<API.ITweet[]>;
getLatestTweetsByCoin(coinSlug: string): Promise<API.ITweet[]>;
getTopRedditPostsByCoin(coinSlug: string): Promise<API.IRedditItem[]>;
getLatestRedditPostsByCoin(coinSlug: string): Promise<API.IRedditItem[]>;
};

@@ -14,0 +18,0 @@ };

@@ -13,4 +13,8 @@ import * as API from './src/CryptoControlApi';

getTopNewsByCoinCategory(coinSlug: string): Promise<API.ICategoryResponse>;
getTopTweeetsByCoin(coinSlug: string): Promise<API.ITweet[]>;
getLatestTweetsByCoin(coinSlug: string): Promise<API.ITweet[]>;
getTopRedditPostsByCoin(coinSlug: string): Promise<API.IRedditItem[]>;
getLatestRedditPostsByCoin(coinSlug: string): Promise<API.IRedditItem[]>;
};
};
export default _default;

@@ -1,2 +0,2 @@

import { IArticle, ICategoryResponse } from './interfaces';
import { IArticle, ICategoryResponse, ITweet, IRedditItem } from './interfaces';
declare const generateAPI: (fetch: any) => {

@@ -12,4 +12,8 @@ new (apikey: string): {

getTopNewsByCoinCategory(coinSlug: string): Promise<ICategoryResponse>;
getTopTweeetsByCoin(coinSlug: string): Promise<ITweet[]>;
getLatestTweetsByCoin(coinSlug: string): Promise<ITweet[]>;
getTopRedditPostsByCoin(coinSlug: string): Promise<IRedditItem[]>;
getLatestRedditPostsByCoin(coinSlug: string): Promise<IRedditItem[]>;
};
};
export { IArticle, ICategoryResponse, generateAPI };
export { generateAPI, IArticle, ICategoryResponse, IRedditItem, ITweet };

@@ -130,2 +130,42 @@ "use strict";

};
CryptoControlApi.prototype.getTopTweeetsByCoin = function (coinSlug) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4, this._fetch("/tweets/coin/" + coinSlug)];
case 1: return [2, _a.sent()];
}
});
});
};
CryptoControlApi.prototype.getLatestTweetsByCoin = function (coinSlug) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4, this._fetch("/tweets/coin/" + coinSlug, { latest: true })];
case 1: return [2, _a.sent()];
}
});
});
};
CryptoControlApi.prototype.getTopRedditPostsByCoin = function (coinSlug) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4, this._fetch("/reddit/coin/" + coinSlug)];
case 1: return [2, _a.sent()];
}
});
});
};
CryptoControlApi.prototype.getLatestRedditPostsByCoin = function (coinSlug) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4, this._fetch("/reddit/coin/" + coinSlug, { latest: true })];
case 1: return [2, _a.sent()];
}
});
});
};
return CryptoControlApi;

@@ -132,0 +172,0 @@ }());

@@ -35,1 +35,35 @@ export interface IArticle {

}
export interface IRedditItem {
activityHotness?: number;
comments: number;
description: string;
downvotes: number;
hotness: number;
_id: string;
id: any;
isSelf: boolean;
publishedAt: Date;
score: number;
subreddit: string;
title: string;
upvotes: number;
url: string;
}
export interface ITweet {
_id: string;
activityHotness?: number;
favoriteCount: number;
hashtags: string[];
hotness?: number;
id: any;
isRetweeted: boolean;
language: string;
links: string[];
mentions: string[];
publishedAt: Date;
retweetCount: number;
symbols: string[];
text: string;
twitteratiScore?: number;
username: string;
}
{
"name": "crypto-news-api",
"version": "1.0.13",
"version": "1.0.14",
"description": "API to get a crypto newsfeed in your app",

@@ -5,0 +5,0 @@ "main": "dist/node/index.node.js",

@@ -23,3 +23,3 @@ CryptoControl Crypto News API

**NOTE**: API access is rate-limited to 5 req/sec and 10,000 req/hour. If you're interacting with large number of clients, it'll be a good idea to cache your API calls.
**NOTE**: API access is rate-limited to 5 req/sec and 10,000 req/hour. It'll be a good idea to cache your API calls.

@@ -26,0 +26,0 @@

import * as debug from 'debug'
import * as qs from 'qs'
import { IArticle, ICategoryResponse } from './interfaces'
import fetch from 'node-fetch';
import { IArticle, ICategoryResponse, ITweet, IRedditItem } from './interfaces'
const logger = debug('crypto-news-api')
const API_HOST = 'https://cryptocontrol.io/api/public'
const API_HOST = 'https://cryptocontrol.io/api/v1/public'

@@ -67,2 +66,22 @@

}
public async getTopTweeetsByCoin(coinSlug: string): Promise<ITweet[]> {
return await this._fetch(`/tweets/coin/${coinSlug}`)
}
public async getLatestTweetsByCoin(coinSlug: string): Promise<ITweet[]> {
return await this._fetch(`/tweets/coin/${coinSlug}`, { latest: true })
}
public async getTopRedditPostsByCoin(coinSlug: string): Promise<IRedditItem[]> {
return await this._fetch(`/reddit/coin/${coinSlug}`)
}
public async getLatestRedditPostsByCoin(coinSlug: string): Promise<IRedditItem[]> {
return await this._fetch(`/reddit/coin/${coinSlug}`, { latest: true })
}
}

@@ -76,5 +95,7 @@

export {
generateAPI,
IArticle,
ICategoryResponse,
generateAPI
IRedditItem,
ITweet
}

@@ -37,1 +37,39 @@ export interface IArticle {

}
export interface IRedditItem {
activityHotness?: number
comments: number
description: string
downvotes: number
hotness: number
_id: string
id: any
isSelf: boolean
publishedAt: Date
score: number
subreddit: string
title: string
upvotes: number
url: string
}
export interface ITweet {
_id: string
activityHotness?: number
favoriteCount: number
hashtags: string[]
hotness?: number
id: any
isRetweeted: boolean
language: string
links: string[]
mentions: string[]
publishedAt: Date
retweetCount: number
symbols: string[]
text: string
twitteratiScore?: number
username: string
}

@@ -22,4 +22,4 @@ {

"_source": "https://github.com/github/fetch.git",
"_target": "^2.0.4",
"_originalSource": "whatwg-fetch"
"_target": ">=0.10.0",
"_originalSource": "github/fetch"
}

@@ -18,4 +18,4 @@ {

"dependencies": {
"crypto-news-api": "^1.0.13"
"crypto-news-api": "^1.0.14"
}
}

@@ -1,1 +0,1 @@

!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=11)}([function(e,t,r){"use strict";var n=String.prototype.replace,o=/%20/g;e.exports={default:"RFC3986",formatters:{RFC1738:function(e){return n.call(e,o,"+")},RFC3986:function(e){return e}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},function(e,t,r){"use strict";var n=Object.prototype.hasOwnProperty,o=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),i=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},n=0;n<e.length;++n)void 0!==e[n]&&(r[n]=e[n]);return r};e.exports={arrayToObject:i,assign:function(e,t){return Object.keys(t).reduce(function(e,r){return e[r]=t[r],e},e)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],r=[],n=0;n<t.length;++n)for(var o=t[n],i=o.obj[o.prop],a=Object.keys(i),c=0;c<a.length;++c){var s=a[c],u=i[s];"object"==typeof u&&null!==u&&-1===r.indexOf(u)&&(t.push({obj:i,prop:s}),r.push(u))}return function(e){for(var t;e.length;){var r=e.pop();if(t=r.obj[r.prop],Array.isArray(t)){for(var n=[],o=0;o<t.length;++o)void 0!==t[o]&&n.push(t[o]);r.obj[r.prop]=n}}return t}(t)},decode:function(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}},encode:function(e){if(0===e.length)return e;for(var t="string"==typeof e?e:String(e),r="",n=0;n<t.length;++n){var i=t.charCodeAt(n);45===i||46===i||95===i||126===i||i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122?r+=t.charAt(n):i<128?r+=o[i]:i<2048?r+=o[192|i>>6]+o[128|63&i]:i<55296||i>=57344?r+=o[224|i>>12]+o[128|i>>6&63]+o[128|63&i]:(n+=1,i=65536+((1023&i)<<10|1023&t.charCodeAt(n)),r+=o[240|i>>18]+o[128|i>>12&63]+o[128|i>>6&63]+o[128|63&i])}return r},isBuffer:function(e){return null!==e&&void 0!==e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},merge:function e(t,r,o){if(!r)return t;if("object"!=typeof r){if(Array.isArray(t))t.push(r);else{if("object"!=typeof t)return[t,r];(o.plainObjects||o.allowPrototypes||!n.call(Object.prototype,r))&&(t[r]=!0)}return t}if("object"!=typeof t)return[t].concat(r);var a=t;return Array.isArray(t)&&!Array.isArray(r)&&(a=i(t,o)),Array.isArray(t)&&Array.isArray(r)?(r.forEach(function(r,i){n.call(t,i)?t[i]&&"object"==typeof t[i]?t[i]=e(t[i],r,o):t.push(r):t[i]=r}),t):Object.keys(r).reduce(function(t,i){var a=r[i];return n.call(t,i)?t[i]=e(t[i],a,o):t[i]=a,t},a)}}},function(e,t,r){"use strict";var n=this&&this.__assign||Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function a(e){try{s(n.next(e))}catch(e){i(e)}}function c(e){try{s(n.throw(e))}catch(e){i(e)}}function s(e){e.done?o(e.value):new r(function(t){t(e.value)}).then(a,c)}s((n=n.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=n[2&i[0]?"return":i[0]?"throw":"next"])&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[0,o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}};Object.defineProperty(t,"__esModule",{value:!0});var a=r(9),c=r(5),s=a("crypto-news-api");t.generateAPI=function(e){return function(){function t(e){if(!e)throw new Error("No API key found. Register for an API key at https://cryptocontrol.io/apis");this.apikey=e,s("using cryptocontrol.io api v1")}return t.prototype._fetch=function(t,r){void 0===r&&(r={});var o=c.stringify(n({},r,{key:this.apikey}));return e("https://cryptocontrol.io/api/public"+t+"?"+o).then(function(e){if(401===e.status)throw new Error("Invalid API Key");if(200!==e.status)throw new Error("Bad response from the CryptoControl server");return e.json()})},t.prototype.getTopNews=function(){return o(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this._fetch("/news")];case 1:return[2,e.sent()]}})})},t.prototype.getLatestNews=function(){return o(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this._fetch("/news",{latest:!0})];case 1:return[2,e.sent()]}})})},t.prototype.getTopNewsByCategory=function(){return o(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this._fetch("/news/category")];case 1:return[2,e.sent()]}})})},t.prototype.getTopNewsByCoin=function(e){return o(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,this._fetch("/news/coin/"+e)];case 1:return[2,t.sent()]}})})},t.prototype.getLatestNewsByCoin=function(e){return o(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,this._fetch("/news/coin/"+e,{latest:!0})];case 1:return[2,t.sent()]}})})},t.prototype.getTopNewsByCoinCategory=function(e){return o(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,this._fetch("/news/coin/"+e+"/category")];case 1:return[2,t.sent()]}})})},t}()}},function(e,t,r){"use strict";var n=r(1),o=Object.prototype.hasOwnProperty,i={allowDots:!1,allowPrototypes:!1,arrayLimit:20,decoder:n.decode,delimiter:"&",depth:5,parameterLimit:1e3,plainObjects:!1,strictNullHandling:!1},a=function(e,t,r){if(e){var n=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,i=/(\[[^[\]]*])/g,a=/(\[[^[\]]*])/.exec(n),c=a?n.slice(0,a.index):n,s=[];if(c){if(!r.plainObjects&&o.call(Object.prototype,c)&&!r.allowPrototypes)return;s.push(c)}for(var u=0;null!==(a=i.exec(n))&&u<r.depth;){if(u+=1,!r.plainObjects&&o.call(Object.prototype,a[1].slice(1,-1))&&!r.allowPrototypes)return;s.push(a[1])}return a&&s.push("["+n.slice(a.index)+"]"),function(e,t,r){for(var n=t,o=e.length-1;o>=0;--o){var i,a=e[o];if("[]"===a)i=(i=[]).concat(n);else{i=r.plainObjects?Object.create(null):{};var c="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,s=parseInt(c,10);!isNaN(s)&&a!==c&&String(s)===c&&s>=0&&r.parseArrays&&s<=r.arrayLimit?(i=[])[s]=n:i[c]=n}n=i}return n}(s,t,r)}};e.exports=function(e,t){var r=t?n.assign({},t):{};if(null!==r.decoder&&void 0!==r.decoder&&"function"!=typeof r.decoder)throw new TypeError("Decoder has to be a function.");if(r.ignoreQueryPrefix=!0===r.ignoreQueryPrefix,r.delimiter="string"==typeof r.delimiter||n.isRegExp(r.delimiter)?r.delimiter:i.delimiter,r.depth="number"==typeof r.depth?r.depth:i.depth,r.arrayLimit="number"==typeof r.arrayLimit?r.arrayLimit:i.arrayLimit,r.parseArrays=!1!==r.parseArrays,r.decoder="function"==typeof r.decoder?r.decoder:i.decoder,r.allowDots="boolean"==typeof r.allowDots?r.allowDots:i.allowDots,r.plainObjects="boolean"==typeof r.plainObjects?r.plainObjects:i.plainObjects,r.allowPrototypes="boolean"==typeof r.allowPrototypes?r.allowPrototypes:i.allowPrototypes,r.parameterLimit="number"==typeof r.parameterLimit?r.parameterLimit:i.parameterLimit,r.strictNullHandling="boolean"==typeof r.strictNullHandling?r.strictNullHandling:i.strictNullHandling,""===e||null===e||void 0===e)return r.plainObjects?Object.create(null):{};for(var c="string"==typeof e?function(e,t){for(var r={},n=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,a=t.parameterLimit===1/0?void 0:t.parameterLimit,c=n.split(t.delimiter,a),s=0;s<c.length;++s){var u,l,f=c[s],p=f.indexOf("]="),d=-1===p?f.indexOf("="):p+1;-1===d?(u=t.decoder(f,i.decoder),l=t.strictNullHandling?null:""):(u=t.decoder(f.slice(0,d),i.decoder),l=t.decoder(f.slice(d+1),i.decoder)),o.call(r,u)?r[u]=[].concat(r[u]).concat(l):r[u]=l}return r}(e,r):e,s=r.plainObjects?Object.create(null):{},u=Object.keys(c),l=0;l<u.length;++l){var f=u[l],p=a(f,c[f],r);s=n.merge(s,p,r)}return n.compact(s)}},function(e,t,r){"use strict";var n=r(1),o=r(0),i={brackets:function(e){return e+"[]"},indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},a=Date.prototype.toISOString,c={delimiter:"&",encode:!0,encoder:n.encode,encodeValuesOnly:!1,serializeDate:function(e){return a.call(e)},skipNulls:!1,strictNullHandling:!1},s=function e(t,r,o,i,a,s,u,l,f,p,d,y){var h=t;if("function"==typeof u)h=u(r,h);else if(h instanceof Date)h=p(h);else if(null===h){if(i)return s&&!y?s(r,c.encoder):r;h=""}if("string"==typeof h||"number"==typeof h||"boolean"==typeof h||n.isBuffer(h))return s?[d(y?r:s(r,c.encoder))+"="+d(s(h,c.encoder))]:[d(r)+"="+d(String(h))];var g,C=[];if(void 0===h)return C;if(Array.isArray(u))g=u;else{var v=Object.keys(h);g=l?v.sort(l):v}for(var m=0;m<g.length;++m){var b=g[m];a&&null===h[b]||(C=Array.isArray(h)?C.concat(e(h[b],o(r,b),o,i,a,s,u,l,f,p,d,y)):C.concat(e(h[b],r+(f?"."+b:"["+b+"]"),o,i,a,s,u,l,f,p,d,y)))}return C};e.exports=function(e,t){var r=e,a=t?n.assign({},t):{};if(null!==a.encoder&&void 0!==a.encoder&&"function"!=typeof a.encoder)throw new TypeError("Encoder has to be a function.");var u=void 0===a.delimiter?c.delimiter:a.delimiter,l="boolean"==typeof a.strictNullHandling?a.strictNullHandling:c.strictNullHandling,f="boolean"==typeof a.skipNulls?a.skipNulls:c.skipNulls,p="boolean"==typeof a.encode?a.encode:c.encode,d="function"==typeof a.encoder?a.encoder:c.encoder,y="function"==typeof a.sort?a.sort:null,h=void 0!==a.allowDots&&a.allowDots,g="function"==typeof a.serializeDate?a.serializeDate:c.serializeDate,C="boolean"==typeof a.encodeValuesOnly?a.encodeValuesOnly:c.encodeValuesOnly;if(void 0===a.format)a.format=o.default;else if(!Object.prototype.hasOwnProperty.call(o.formatters,a.format))throw new TypeError("Unknown format option provided.");var v,m,b=o.formatters[a.format];"function"==typeof a.filter?r=(m=a.filter)("",r):Array.isArray(a.filter)&&(v=m=a.filter);var w,F=[];if("object"!=typeof r||null===r)return"";w=a.arrayFormat in i?a.arrayFormat:"indices"in a?a.indices?"indices":"repeat":"indices";var O=i[w];v||(v=Object.keys(r)),y&&v.sort(y);for(var j=0;j<v.length;++j){var A=v[j];f&&null===r[A]||(F=F.concat(s(r[A],A,O,l,f,p?d:null,m,y,h,g,b,C)))}var x=F.join(u),k=!0===a.addQueryPrefix?"?":"";return x.length>0?k+x:""}},function(e,t,r){"use strict";var n=r(4),o=r(3),i=r(0);e.exports={formats:i,parse:o,stringify:n}},function(e,t){var r=1e3,n=60*r,o=60*n,i=24*o,a=365.25*i;function c(e,t,r){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+r:Math.ceil(e/t)+" "+r+"s"}e.exports=function(e,t){t=t||{};var s,u=typeof e;if("string"===u&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var c=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*a;case"days":case"day":case"d":return c*i;case"hours":case"hour":case"hrs":case"hr":case"h":return c*o;case"minutes":case"minute":case"mins":case"min":case"m":return c*n;case"seconds":case"second":case"secs":case"sec":case"s":return c*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(e);if("number"===u&&!1===isNaN(e))return t.long?c(s=e,i,"day")||c(s,o,"hour")||c(s,n,"minute")||c(s,r,"second")||s+" ms":function(e){if(e>=i)return Math.round(e/i)+"d";if(e>=o)return Math.round(e/o)+"h";if(e>=n)return Math.round(e/n)+"m";if(e>=r)return Math.round(e/r)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t,r){function n(e){var r;function n(){if(n.enabled){var e=n,o=+new Date,i=o-(r||o);e.diff=i,e.prev=r,e.curr=o,r=o;for(var a=new Array(arguments.length),c=0;c<a.length;c++)a[c]=arguments[c];a[0]=t.coerce(a[0]),"string"!=typeof a[0]&&a.unshift("%O");var s=0;a[0]=a[0].replace(/%([a-zA-Z%])/g,function(r,n){if("%%"===r)return r;s++;var o=t.formatters[n];if("function"==typeof o){var i=a[s];r=o.call(e,i),a.splice(s,1),s--}return r}),t.formatArgs.call(e,a),(n.log||t.log||console.log.bind(console)).apply(e,a)}}return n.namespace=e,n.enabled=t.enabled(e),n.useColors=t.useColors(),n.color=function(e){var r,n=0;for(r in e)n=(n<<5)-n+e.charCodeAt(r),n|=0;return t.colors[Math.abs(n)%t.colors.length]}(e),n.destroy=o,"function"==typeof t.init&&t.init(n),t.instances.push(n),n}function o(){var e=t.instances.indexOf(this);return-1!==e&&(t.instances.splice(e,1),!0)}(t=e.exports=n.debug=n.default=n).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){var r;t.save(e),t.names=[],t.skips=[];var n=("string"==typeof e?e:"").split(/[\s,]+/),o=n.length;for(r=0;r<o;r++)n[r]&&("-"===(e=n[r].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")));for(r=0;r<t.instances.length;r++){var i=t.instances[r];i.enabled=t.enabled(i.namespace)}},t.enabled=function(e){if("*"===e[e.length-1])return!0;var r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=r(6),t.instances=[],t.names=[],t.skips=[],t.formatters={}},function(e,t){var r,n,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function c(e){if(r===setTimeout)return setTimeout(e,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(e){r=i}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(e){n=a}}();var s,u=[],l=!1,f=-1;function p(){l&&s&&(l=!1,s.length?u=s.concat(u):f=-1,u.length&&d())}function d(){if(!l){var e=c(p);l=!0;for(var t=u.length;t;){for(s=u,u=[];++f<t;)s&&s[f].run();f=-1,t=u.length}s=null,l=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function y(e,t){this.fun=e,this.array=t}function h(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new y(e,t)),1!==u.length||l||c(d)},y.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=h,o.addListener=h,o.once=h,o.off=h,o.removeListener=h,o.removeAllListeners=h,o.emit=h,o.prependListener=h,o.prependOnceListener=h,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,r){(function(n){function o(){var e;try{e=t.storage.debug}catch(e){}return!e&&void 0!==n&&"env"in n&&(e=n.env.DEBUG),e}(t=e.exports=r(7)).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var r=this.useColors;if(e[0]=(r?"%c":"")+this.namespace+(r?" %c":" ")+e[0]+(r?"%c ":" ")+"+"+t.humanize(this.diff),!r)return;var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var o=0,i=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&"%c"===e&&(i=++o)}),e.splice(i,0,n)},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}},t.load=o,t.useColors=function(){if("undefined"!=typeof window&&window.process&&"renderer"===window.process.type)return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(o())}).call(this,r(8))},function(e,t){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r(2).generateAPI(fetch);window.CryptoControlApi=n,window.CryptoNewsApi=n,e.CryptoControlApi=n,e.CryptoNewsApi=n,t.default=n,function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(2))}).call(this,r(10))}]);
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=11)}([function(e,t,r){"use strict";var n=String.prototype.replace,o=/%20/g;e.exports={default:"RFC3986",formatters:{RFC1738:function(e){return n.call(e,o,"+")},RFC3986:function(e){return e}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},function(e,t,r){"use strict";var n=Object.prototype.hasOwnProperty,o=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),i=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},n=0;n<e.length;++n)void 0!==e[n]&&(r[n]=e[n]);return r};e.exports={arrayToObject:i,assign:function(e,t){return Object.keys(t).reduce(function(e,r){return e[r]=t[r],e},e)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],r=[],n=0;n<t.length;++n)for(var o=t[n],i=o.obj[o.prop],c=Object.keys(i),s=0;s<c.length;++s){var a=c[s],u=i[a];"object"==typeof u&&null!==u&&-1===r.indexOf(u)&&(t.push({obj:i,prop:a}),r.push(u))}return function(e){for(var t;e.length;){var r=e.pop();if(t=r.obj[r.prop],Array.isArray(t)){for(var n=[],o=0;o<t.length;++o)void 0!==t[o]&&n.push(t[o]);r.obj[r.prop]=n}}return t}(t)},decode:function(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}},encode:function(e){if(0===e.length)return e;for(var t="string"==typeof e?e:String(e),r="",n=0;n<t.length;++n){var i=t.charCodeAt(n);45===i||46===i||95===i||126===i||i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122?r+=t.charAt(n):i<128?r+=o[i]:i<2048?r+=o[192|i>>6]+o[128|63&i]:i<55296||i>=57344?r+=o[224|i>>12]+o[128|i>>6&63]+o[128|63&i]:(n+=1,i=65536+((1023&i)<<10|1023&t.charCodeAt(n)),r+=o[240|i>>18]+o[128|i>>12&63]+o[128|i>>6&63]+o[128|63&i])}return r},isBuffer:function(e){return null!==e&&void 0!==e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},merge:function e(t,r,o){if(!r)return t;if("object"!=typeof r){if(Array.isArray(t))t.push(r);else{if("object"!=typeof t)return[t,r];(o.plainObjects||o.allowPrototypes||!n.call(Object.prototype,r))&&(t[r]=!0)}return t}if("object"!=typeof t)return[t].concat(r);var c=t;return Array.isArray(t)&&!Array.isArray(r)&&(c=i(t,o)),Array.isArray(t)&&Array.isArray(r)?(r.forEach(function(r,i){n.call(t,i)?t[i]&&"object"==typeof t[i]?t[i]=e(t[i],r,o):t.push(r):t[i]=r}),t):Object.keys(r).reduce(function(t,i){var c=r[i];return n.call(t,i)?t[i]=e(t[i],c,o):t[i]=c,t},c)}}},function(e,t,r){"use strict";var n=this&&this.__assign||Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function c(e){try{a(n.next(e))}catch(e){i(e)}}function s(e){try{a(n.throw(e))}catch(e){i(e)}}function a(e){e.done?o(e.value):new r(function(t){t(e.value)}).then(c,s)}a((n=n.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var r,n,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;c;)try{if(r=1,n&&(o=n[2&i[0]?"return":i[0]?"throw":"next"])&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[0,o.value]),i[0]){case 0:case 1:o=i;break;case 4:return c.label++,{value:i[1],done:!1};case 5:c.label++,n=i[1],i=[0];continue;case 7:i=c.ops.pop(),c.trys.pop();continue;default:if(!(o=(o=c.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){c=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){c.label=i[1];break}if(6===i[0]&&c.label<o[1]){c.label=o[1],o=i;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(i);break}o[2]&&c.ops.pop(),c.trys.pop();continue}i=t.call(e,c)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var c=r(9),s=r(5),a=c("crypto-news-api");t.generateAPI=function(e){return function(){function t(e){if(!e)throw new Error("No API key found. Register for an API key at https://cryptocontrol.io/apis");this.apikey=e,a("using cryptocontrol.io api v1")}return t.prototype._fetch=function(t,r){void 0===r&&(r={});var o=s.stringify(n({},r,{key:this.apikey}));return e("https://cryptocontrol.io/api/public"+t+"?"+o).then(function(e){if(401===e.status)throw new Error("Invalid API Key");if(200!==e.status)throw new Error("Bad response from the CryptoControl server");return e.json()})},t.prototype.getTopNews=function(){return o(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this._fetch("/news")];case 1:return[2,e.sent()]}})})},t.prototype.getLatestNews=function(){return o(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this._fetch("/news",{latest:!0})];case 1:return[2,e.sent()]}})})},t.prototype.getTopNewsByCategory=function(){return o(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this._fetch("/news/category")];case 1:return[2,e.sent()]}})})},t.prototype.getTopNewsByCoin=function(e){return o(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,this._fetch("/news/coin/"+e)];case 1:return[2,t.sent()]}})})},t.prototype.getLatestNewsByCoin=function(e){return o(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,this._fetch("/news/coin/"+e,{latest:!0})];case 1:return[2,t.sent()]}})})},t.prototype.getTopNewsByCoinCategory=function(e){return o(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,this._fetch("/news/coin/"+e+"/category")];case 1:return[2,t.sent()]}})})},t.prototype.getTopTweeetsByCoin=function(e){return o(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,this._fetch("/tweets/coin/"+e)];case 1:return[2,t.sent()]}})})},t.prototype.getLatestTweetsByCoin=function(e){return o(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,this._fetch("/tweets/coin/"+e,{latest:!0})];case 1:return[2,t.sent()]}})})},t.prototype.getTopRedditPostsByCoin=function(e){return o(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,this._fetch("/reddit/coin/"+e)];case 1:return[2,t.sent()]}})})},t.prototype.getLatestRedditPostsByCoin=function(e){return o(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,this._fetch("/reddit/coin/"+e,{latest:!0})];case 1:return[2,t.sent()]}})})},t}()}},function(e,t,r){"use strict";var n=r(1),o=Object.prototype.hasOwnProperty,i={allowDots:!1,allowPrototypes:!1,arrayLimit:20,decoder:n.decode,delimiter:"&",depth:5,parameterLimit:1e3,plainObjects:!1,strictNullHandling:!1},c=function(e,t,r){if(e){var n=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,i=/(\[[^[\]]*])/g,c=/(\[[^[\]]*])/.exec(n),s=c?n.slice(0,c.index):n,a=[];if(s){if(!r.plainObjects&&o.call(Object.prototype,s)&&!r.allowPrototypes)return;a.push(s)}for(var u=0;null!==(c=i.exec(n))&&u<r.depth;){if(u+=1,!r.plainObjects&&o.call(Object.prototype,c[1].slice(1,-1))&&!r.allowPrototypes)return;a.push(c[1])}return c&&a.push("["+n.slice(c.index)+"]"),function(e,t,r){for(var n=t,o=e.length-1;o>=0;--o){var i,c=e[o];if("[]"===c)i=(i=[]).concat(n);else{i=r.plainObjects?Object.create(null):{};var s="["===c.charAt(0)&&"]"===c.charAt(c.length-1)?c.slice(1,-1):c,a=parseInt(s,10);!isNaN(a)&&c!==s&&String(a)===s&&a>=0&&r.parseArrays&&a<=r.arrayLimit?(i=[])[a]=n:i[s]=n}n=i}return n}(a,t,r)}};e.exports=function(e,t){var r=t?n.assign({},t):{};if(null!==r.decoder&&void 0!==r.decoder&&"function"!=typeof r.decoder)throw new TypeError("Decoder has to be a function.");if(r.ignoreQueryPrefix=!0===r.ignoreQueryPrefix,r.delimiter="string"==typeof r.delimiter||n.isRegExp(r.delimiter)?r.delimiter:i.delimiter,r.depth="number"==typeof r.depth?r.depth:i.depth,r.arrayLimit="number"==typeof r.arrayLimit?r.arrayLimit:i.arrayLimit,r.parseArrays=!1!==r.parseArrays,r.decoder="function"==typeof r.decoder?r.decoder:i.decoder,r.allowDots="boolean"==typeof r.allowDots?r.allowDots:i.allowDots,r.plainObjects="boolean"==typeof r.plainObjects?r.plainObjects:i.plainObjects,r.allowPrototypes="boolean"==typeof r.allowPrototypes?r.allowPrototypes:i.allowPrototypes,r.parameterLimit="number"==typeof r.parameterLimit?r.parameterLimit:i.parameterLimit,r.strictNullHandling="boolean"==typeof r.strictNullHandling?r.strictNullHandling:i.strictNullHandling,""===e||null===e||void 0===e)return r.plainObjects?Object.create(null):{};for(var s="string"==typeof e?function(e,t){for(var r={},n=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,c=t.parameterLimit===1/0?void 0:t.parameterLimit,s=n.split(t.delimiter,c),a=0;a<s.length;++a){var u,l,f=s[a],p=f.indexOf("]="),d=-1===p?f.indexOf("="):p+1;-1===d?(u=t.decoder(f,i.decoder),l=t.strictNullHandling?null:""):(u=t.decoder(f.slice(0,d),i.decoder),l=t.decoder(f.slice(d+1),i.decoder)),o.call(r,u)?r[u]=[].concat(r[u]).concat(l):r[u]=l}return r}(e,r):e,a=r.plainObjects?Object.create(null):{},u=Object.keys(s),l=0;l<u.length;++l){var f=u[l],p=c(f,s[f],r);a=n.merge(a,p,r)}return n.compact(a)}},function(e,t,r){"use strict";var n=r(1),o=r(0),i={brackets:function(e){return e+"[]"},indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},c=Date.prototype.toISOString,s={delimiter:"&",encode:!0,encoder:n.encode,encodeValuesOnly:!1,serializeDate:function(e){return c.call(e)},skipNulls:!1,strictNullHandling:!1},a=function e(t,r,o,i,c,a,u,l,f,p,d,h){var y=t;if("function"==typeof u)y=u(r,y);else if(y instanceof Date)y=p(y);else if(null===y){if(i)return a&&!h?a(r,s.encoder):r;y=""}if("string"==typeof y||"number"==typeof y||"boolean"==typeof y||n.isBuffer(y))return a?[d(h?r:a(r,s.encoder))+"="+d(a(y,s.encoder))]:[d(r)+"="+d(String(y))];var g,v=[];if(void 0===y)return v;if(Array.isArray(u))g=u;else{var C=Object.keys(y);g=l?C.sort(l):C}for(var m=0;m<g.length;++m){var w=g[m];c&&null===y[w]||(v=Array.isArray(y)?v.concat(e(y[w],o(r,w),o,i,c,a,u,l,f,p,d,h)):v.concat(e(y[w],r+(f?"."+w:"["+w+"]"),o,i,c,a,u,l,f,p,d,h)))}return v};e.exports=function(e,t){var r=e,c=t?n.assign({},t):{};if(null!==c.encoder&&void 0!==c.encoder&&"function"!=typeof c.encoder)throw new TypeError("Encoder has to be a function.");var u=void 0===c.delimiter?s.delimiter:c.delimiter,l="boolean"==typeof c.strictNullHandling?c.strictNullHandling:s.strictNullHandling,f="boolean"==typeof c.skipNulls?c.skipNulls:s.skipNulls,p="boolean"==typeof c.encode?c.encode:s.encode,d="function"==typeof c.encoder?c.encoder:s.encoder,h="function"==typeof c.sort?c.sort:null,y=void 0!==c.allowDots&&c.allowDots,g="function"==typeof c.serializeDate?c.serializeDate:s.serializeDate,v="boolean"==typeof c.encodeValuesOnly?c.encodeValuesOnly:s.encodeValuesOnly;if(void 0===c.format)c.format=o.default;else if(!Object.prototype.hasOwnProperty.call(o.formatters,c.format))throw new TypeError("Unknown format option provided.");var C,m,w=o.formatters[c.format];"function"==typeof c.filter?r=(m=c.filter)("",r):Array.isArray(c.filter)&&(C=m=c.filter);var b,F=[];if("object"!=typeof r||null===r)return"";b=c.arrayFormat in i?c.arrayFormat:"indices"in c?c.indices?"indices":"repeat":"indices";var O=i[b];C||(C=Object.keys(r)),h&&C.sort(h);for(var j=0;j<C.length;++j){var A=C[j];f&&null===r[A]||(F=F.concat(a(r[A],A,O,l,f,p?d:null,m,h,y,g,w,v)))}var x=F.join(u),k=!0===c.addQueryPrefix?"?":"";return x.length>0?k+x:""}},function(e,t,r){"use strict";var n=r(4),o=r(3),i=r(0);e.exports={formats:i,parse:o,stringify:n}},function(e,t){var r=1e3,n=60*r,o=60*n,i=24*o,c=365.25*i;function s(e,t,r){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+r:Math.ceil(e/t)+" "+r+"s"}e.exports=function(e,t){t=t||{};var a,u=typeof e;if("string"===u&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var s=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return s*c;case"days":case"day":case"d":return s*i;case"hours":case"hour":case"hrs":case"hr":case"h":return s*o;case"minutes":case"minute":case"mins":case"min":case"m":return s*n;case"seconds":case"second":case"secs":case"sec":case"s":return s*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}(e);if("number"===u&&!1===isNaN(e))return t.long?s(a=e,i,"day")||s(a,o,"hour")||s(a,n,"minute")||s(a,r,"second")||a+" ms":function(e){if(e>=i)return Math.round(e/i)+"d";if(e>=o)return Math.round(e/o)+"h";if(e>=n)return Math.round(e/n)+"m";if(e>=r)return Math.round(e/r)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t,r){function n(e){var r;function n(){if(n.enabled){var e=n,o=+new Date,i=o-(r||o);e.diff=i,e.prev=r,e.curr=o,r=o;for(var c=new Array(arguments.length),s=0;s<c.length;s++)c[s]=arguments[s];c[0]=t.coerce(c[0]),"string"!=typeof c[0]&&c.unshift("%O");var a=0;c[0]=c[0].replace(/%([a-zA-Z%])/g,function(r,n){if("%%"===r)return r;a++;var o=t.formatters[n];if("function"==typeof o){var i=c[a];r=o.call(e,i),c.splice(a,1),a--}return r}),t.formatArgs.call(e,c),(n.log||t.log||console.log.bind(console)).apply(e,c)}}return n.namespace=e,n.enabled=t.enabled(e),n.useColors=t.useColors(),n.color=function(e){var r,n=0;for(r in e)n=(n<<5)-n+e.charCodeAt(r),n|=0;return t.colors[Math.abs(n)%t.colors.length]}(e),n.destroy=o,"function"==typeof t.init&&t.init(n),t.instances.push(n),n}function o(){var e=t.instances.indexOf(this);return-1!==e&&(t.instances.splice(e,1),!0)}(t=e.exports=n.debug=n.default=n).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){var r;t.save(e),t.names=[],t.skips=[];var n=("string"==typeof e?e:"").split(/[\s,]+/),o=n.length;for(r=0;r<o;r++)n[r]&&("-"===(e=n[r].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")));for(r=0;r<t.instances.length;r++){var i=t.instances[r];i.enabled=t.enabled(i.namespace)}},t.enabled=function(e){if("*"===e[e.length-1])return!0;var r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=r(6),t.instances=[],t.names=[],t.skips=[],t.formatters={}},function(e,t){var r,n,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(e){r=i}try{n="function"==typeof clearTimeout?clearTimeout:c}catch(e){n=c}}();var a,u=[],l=!1,f=-1;function p(){l&&a&&(l=!1,a.length?u=a.concat(u):f=-1,u.length&&d())}function d(){if(!l){var e=s(p);l=!0;for(var t=u.length;t;){for(a=u,u=[];++f<t;)a&&a[f].run();f=-1,t=u.length}a=null,l=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===c||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function y(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new h(e,t)),1!==u.length||l||s(d)},h.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=y,o.addListener=y,o.once=y,o.off=y,o.removeListener=y,o.removeAllListeners=y,o.emit=y,o.prependListener=y,o.prependOnceListener=y,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,r){(function(n){function o(){var e;try{e=t.storage.debug}catch(e){}return!e&&void 0!==n&&"env"in n&&(e=n.env.DEBUG),e}(t=e.exports=r(7)).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var r=this.useColors;if(e[0]=(r?"%c":"")+this.namespace+(r?" %c":" ")+e[0]+(r?"%c ":" ")+"+"+t.humanize(this.diff),!r)return;var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var o=0,i=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&"%c"===e&&(i=++o)}),e.splice(i,0,n)},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}},t.load=o,t.useColors=function(){if("undefined"!=typeof window&&window.process&&"renderer"===window.process.type)return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(o())}).call(this,r(8))},function(e,t){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r(2).generateAPI(fetch);window.CryptoControlApi=n,window.CryptoNewsApi=n,e.CryptoControlApi=n,e.CryptoNewsApi=n,t.default=n,function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(2))}).call(this,r(10))}]);

@@ -12,2 +12,6 @@ import * as API from './src/CryptoControlApi';

getTopNewsByCoinCategory(coinSlug: string): Promise<API.ICategoryResponse>;
getTopTweeetsByCoin(coinSlug: string): Promise<API.ITweet[]>;
getLatestTweetsByCoin(coinSlug: string): Promise<API.ITweet[]>;
getTopRedditPostsByCoin(coinSlug: string): Promise<API.IRedditItem[]>;
getLatestRedditPostsByCoin(coinSlug: string): Promise<API.IRedditItem[]>;
};

@@ -14,0 +18,0 @@ };

@@ -13,4 +13,8 @@ import * as API from './src/CryptoControlApi';

getTopNewsByCoinCategory(coinSlug: string): Promise<API.ICategoryResponse>;
getTopTweeetsByCoin(coinSlug: string): Promise<API.ITweet[]>;
getLatestTweetsByCoin(coinSlug: string): Promise<API.ITweet[]>;
getTopRedditPostsByCoin(coinSlug: string): Promise<API.IRedditItem[]>;
getLatestRedditPostsByCoin(coinSlug: string): Promise<API.IRedditItem[]>;
};
};
export default _default;

@@ -1,2 +0,2 @@

import { IArticle, ICategoryResponse } from './interfaces';
import { IArticle, ICategoryResponse, ITweet, IRedditItem } from './interfaces';
declare const generateAPI: (fetch: any) => {

@@ -12,4 +12,8 @@ new (apikey: string): {

getTopNewsByCoinCategory(coinSlug: string): Promise<ICategoryResponse>;
getTopTweeetsByCoin(coinSlug: string): Promise<ITweet[]>;
getLatestTweetsByCoin(coinSlug: string): Promise<ITweet[]>;
getTopRedditPostsByCoin(coinSlug: string): Promise<IRedditItem[]>;
getLatestRedditPostsByCoin(coinSlug: string): Promise<IRedditItem[]>;
};
};
export { IArticle, ICategoryResponse, generateAPI };
export { generateAPI, IArticle, ICategoryResponse, IRedditItem, ITweet };

@@ -130,2 +130,42 @@ "use strict";

};
CryptoControlApi.prototype.getTopTweeetsByCoin = function (coinSlug) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4, this._fetch("/tweets/coin/" + coinSlug)];
case 1: return [2, _a.sent()];
}
});
});
};
CryptoControlApi.prototype.getLatestTweetsByCoin = function (coinSlug) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4, this._fetch("/tweets/coin/" + coinSlug, { latest: true })];
case 1: return [2, _a.sent()];
}
});
});
};
CryptoControlApi.prototype.getTopRedditPostsByCoin = function (coinSlug) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4, this._fetch("/reddit/coin/" + coinSlug)];
case 1: return [2, _a.sent()];
}
});
});
};
CryptoControlApi.prototype.getLatestRedditPostsByCoin = function (coinSlug) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4, this._fetch("/reddit/coin/" + coinSlug, { latest: true })];
case 1: return [2, _a.sent()];
}
});
});
};
return CryptoControlApi;

@@ -132,0 +172,0 @@ }());

@@ -35,1 +35,35 @@ export interface IArticle {

}
export interface IRedditItem {
activityHotness?: number;
comments: number;
description: string;
downvotes: number;
hotness: number;
_id: string;
id: any;
isSelf: boolean;
publishedAt: Date;
score: number;
subreddit: string;
title: string;
upvotes: number;
url: string;
}
export interface ITweet {
_id: string;
activityHotness?: number;
favoriteCount: number;
hashtags: string[];
hotness?: number;
id: any;
isRetweeted: boolean;
language: string;
links: string[];
mentions: string[];
publishedAt: Date;
retweetCount: number;
symbols: string[];
text: string;
twitteratiScore?: number;
username: string;
}
{
"_from": "crypto-news-api",
"_id": "crypto-news-api@1.0.13",
"_from": "crypto-news-api@^1.0.13",
"_id": "crypto-news-api@1.0.14",
"_inBundle": false,
"_integrity": "sha512-bDD5rAtkiP6nb9OseMrUsSLlt0oHvBrzGQTATKND9Kvg7zhJO4AXkRtTbK3FuX11CpzCkoqx6B1U3um55hJE3Q==",
"_integrity": "sha512-k7c5mdyEad9QLRY5IQGQj6tGrlbKVl5aYo1cPKLHTEIZssWmpJWLdnT0Kqm9SpH5+HC7iKcRADxzPijq481+2g==",
"_location": "/crypto-news-api",
"_phantomChildren": {},
"_requested": {
"type": "tag",
"type": "range",
"registry": true,
"raw": "crypto-news-api",
"raw": "crypto-news-api@^1.0.13",
"name": "crypto-news-api",
"escapedName": "crypto-news-api",
"rawSpec": "",
"rawSpec": "^1.0.13",
"saveSpec": null,
"fetchSpec": "latest"
"fetchSpec": "^1.0.13"
},
"_requiredBy": [
"#USER",
"/"
],
"_resolved": "https://registry.npmjs.org/crypto-news-api/-/crypto-news-api-1.0.13.tgz",
"_shasum": "7eb11b913bb0408d525fba80be7a2c280915d8a0",
"_spec": "crypto-news-api",
"_resolved": "https://registry.npmjs.org/crypto-news-api/-/crypto-news-api-1.0.14.tgz",
"_shasum": "e7b7db77823c2ce09043b2cf44825545b6e395cf",
"_spec": "crypto-news-api@^1.0.13",
"_where": "/Users/enamakel/Work/cryptocontrol/node-api/test",

@@ -74,3 +73,3 @@ "author": {

"types": "dist/node/index.node.d.ts",
"version": "1.0.13"
"version": "1.0.14"
}

@@ -23,3 +23,3 @@ CryptoControl Crypto News API

**NOTE**: API access is rate-limited to 5 req/sec and 10,000 req/hour. If you're interacting with large number of clients, it'll be a good idea to cache your API calls.
**NOTE**: API access is rate-limited to 5 req/sec and 10,000 req/hour. It'll be a good idea to cache your API calls.

@@ -26,0 +26,0 @@

import * as debug from 'debug'
import * as qs from 'qs'
import { IArticle, ICategoryResponse } from './interfaces'
import fetch from 'node-fetch';
import { IArticle, ICategoryResponse, ITweet, IRedditItem } from './interfaces'
const logger = debug('crypto-news-api')
const API_HOST = 'https://cryptocontrol.io/api/public'
const API_HOST = 'https://cryptocontrol.io/api/v1/public'

@@ -67,2 +66,22 @@

}
public async getTopTweeetsByCoin(coinSlug: string): Promise<ITweet[]> {
return await this._fetch(`/tweets/coin/${coinSlug}`)
}
public async getLatestTweetsByCoin(coinSlug: string): Promise<ITweet[]> {
return await this._fetch(`/tweets/coin/${coinSlug}`, { latest: true })
}
public async getTopRedditPostsByCoin(coinSlug: string): Promise<IRedditItem[]> {
return await this._fetch(`/reddit/coin/${coinSlug}`)
}
public async getLatestRedditPostsByCoin(coinSlug: string): Promise<IRedditItem[]> {
return await this._fetch(`/reddit/coin/${coinSlug}`, { latest: true })
}
}

@@ -76,5 +95,7 @@

export {
generateAPI,
IArticle,
ICategoryResponse,
generateAPI
IRedditItem,
ITweet
}

@@ -37,1 +37,39 @@ export interface IArticle {

}
export interface IRedditItem {
activityHotness?: number
comments: number
description: string
downvotes: number
hotness: number
_id: string
id: any
isSelf: boolean
publishedAt: Date
score: number
subreddit: string
title: string
upvotes: number
url: string
}
export interface ITweet {
_id: string
activityHotness?: number
favoriteCount: number
hashtags: string[]
hotness?: number
id: any
isRetweeted: boolean
language: string
links: string[]
mentions: string[]
publishedAt: Date
retweetCount: number
symbols: string[]
text: string
twitteratiScore?: number
username: string
}

@@ -1,7 +0,13 @@

var CryptoNewsAPI = require('crypto-news-api')
var CryptoNewsAPI = require('crypto-news-api').default
const Api = new CryptoNewsAPI(process.env.NEWS_API_KEY)
Api.getTopNews()
.then(articles => console.log(articles))
.catch(error => console.error(error))
.catch(error => console.error(error))
// Api.getTopRedditPostsByCoin("bitcoin")
// .then(articles => console.log(articles))
// .catch(error => console.error(error))

@@ -1,2 +0,2 @@

import CryptoControlApi, { IArticle, ICategoryResponse } from '../dist/node/index.node'
import CryptoControlApi, { IArticle, ICategoryResponse, ITweet, IRedditItem } from 'crypto-news-api'

@@ -17,2 +17,14 @@

console.log(categories)
})
api.getLatestTweetsByCoin("bitcoin")
.then((tweets: ITweet[]) => {
console.log(tweets)
})
api.getLatestRedditPostsByCoin("bitcoin")
.then((tweets: IRedditItem[]) => {
console.log(tweets)
})

@@ -5,2 +5,3 @@ {

"description": "",
"private": true,
"main": "index.js",

@@ -13,4 +14,4 @@ "scripts": {

"dependencies": {
"crypto-news-api": "^1.0.13"
"crypto-news-api": "^1.0.14"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc