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 2.2.0 to 2.2.1

index.js

2

dist/bundle.js

@@ -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),s=0;s<a.length;++s){var c=a[s],u=i[c];"object"==typeof u&&null!==u&&-1===r.indexOf(u)&&(t.push({obj:i,prop:c}),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.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new r(function(t){t(e.value)}).then(a,s)}c((n=n.apply(e,t||[])).next())})},o=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: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(;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,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(9),a=r(5),s=i("crypto-news-api");t.generateAPI=function(e){return function(){function t(e,t){if(!e)throw new Error("No API key found. Register for an API key at https://cryptocontrol.io/apis");this.apikey=e,this.proxyURL=t,s("using cryptocontrol.io api v1")}return t.prototype._fetch=function(t,r){void 0===r&&(r={});var n=a.stringify(r),o=this.proxyURL||"https://cryptocontrol.io/api/v1/public";return e(""+o+t+"?"+n,{headers:{"user-agent":"CryptoControl Node.js API v2.2.0","x-api-key":this.apikey}}).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(e){return void 0===e&&(e="en"),n(this,void 0,void 0,function(){return o(this,function(t){switch(t.label){case 0:return[4,this._fetch("/news",{language:e})];case 1:return[2,t.sent()]}})})},t.prototype.getLatestNews=function(e){return void 0===e&&(e="en"),n(this,void 0,void 0,function(){return o(this,function(t){switch(t.label){case 0:return[4,this._fetch("/news",{latest:!0,language:e})];case 1:return[2,t.sent()]}})})},t.prototype.getTopNewsByCategory=function(e){return void 0===e&&(e="en"),n(this,void 0,void 0,function(){return o(this,function(t){switch(t.label){case 0:return[4,this._fetch("/news/category",{language:e})];case 1:return[2,t.sent()]}})})},t.prototype.getTopNewsByCoin=function(e,t){return void 0===t&&(t="en"),n(this,void 0,void 0,function(){return o(this,function(r){switch(r.label){case 0:return[4,this._fetch("/news/coin/"+e,{language:t})];case 1:return[2,r.sent()]}})})},t.prototype.getLatestNewsByCoin=function(e,t){return void 0===t&&(t="en"),n(this,void 0,void 0,function(){return o(this,function(r){switch(r.label){case 0:return[4,this._fetch("/news/coin/"+e,{latest:!0,language:t})];case 1:return[2,r.sent()]}})})},t.prototype.getTopNewsByCoinCategory=function(e,t){return void 0===t&&(t="en"),n(this,void 0,void 0,function(){return o(this,function(r){switch(r.label){case 0:return[4,this._fetch("/news/coin/"+e+"/category",{language:t})];case 1:return[2,r.sent()]}})})},t.prototype.getTopTweeetsByCoin=function(e,t){return void 0===t&&(t="en"),n(this,void 0,void 0,function(){return o(this,function(r){switch(r.label){case 0:return[4,this._fetch("/tweets/coin/"+e,{language:t})];case 1:return[2,r.sent()]}})})},t.prototype.getLatestTweetsByCoin=function(e,t){return void 0===t&&(t="en"),n(this,void 0,void 0,function(){return o(this,function(r){switch(r.label){case 0:return[4,this._fetch("/tweets/coin/"+e,{latest:!0,language:t})];case 1:return[2,r.sent()]}})})},t.prototype.getTopRedditPostsByCoin=function(e,t){return void 0===t&&(t="en"),n(this,void 0,void 0,function(){return o(this,function(r){switch(r.label){case 0:return[4,this._fetch("/reddit/coin/"+e,{language:t})];case 1:return[2,r.sent()]}})})},t.prototype.getLatestRedditPostsByCoin=function(e,t){return void 0===t&&(t="en"),n(this,void 0,void 0,function(){return o(this,function(r){switch(r.label){case 0:return[4,this._fetch("/reddit/coin/"+e,{latest:!0,language:t})];case 1:return[2,r.sent()]}})})},t.prototype.getTopFeedByCoin=function(e,t){return void 0===t&&(t="en"),n(this,void 0,void 0,function(){return o(this,function(r){switch(r.label){case 0:return[4,this._fetch("/feed/coin/"+e,{language:t})];case 1:return[2,r.sent()]}})})},t.prototype.getLatestFeedByCoin=function(e,t){return void 0===t&&(t="en"),n(this,void 0,void 0,function(){return o(this,function(r){switch(r.label){case 0:return[4,this._fetch("/feed/coin/"+e,{latest:!0,language:t})];case 1:return[2,r.sent()]}})})},t.prototype.getTopItemsByCoin=function(e,t){return void 0===t&&(t="en"),n(this,void 0,void 0,function(){return o(this,function(r){switch(r.label){case 0:return[4,this._fetch("/all/coin/"+e,{language:t})];case 1:return[2,r.sent()]}})})},t.prototype.getLatestItemsByCoin=function(e,t){return void 0===t&&(t="en"),n(this,void 0,void 0,function(){return o(this,function(r){switch(r.label){case 0:return[4,this._fetch("/all/coin/"+e,{latest:!0,language:t})];case 1:return[2,r.sent()]}})})},t.prototype.getCoinDetails=function(e,t){return void 0===t&&(t="en"),n(this,void 0,void 0,function(){return o(this,function(r){switch(r.label){case 0:return[4,this._fetch("/details/coin/"+e,{language:t})];case 1:return[2,r.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),s=a?n.slice(0,a.index):n,c=[];if(s){if(!r.plainObjects&&o.call(Object.prototype,s)&&!r.allowPrototypes)return;c.push(s)}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;c.push(a[1])}return a&&c.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 s="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,c=parseInt(s,10);!isNaN(c)&&a!==s&&String(c)===s&&c>=0&&r.parseArrays&&c<=r.arrayLimit?(i=[])[c]=n:i[s]=n}n=i}return n}(c,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,a=t.parameterLimit===1/0?void 0:t.parameterLimit,s=n.split(t.delimiter,a),c=0;c<s.length;++c){var u,l,f=s[c],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,c=r.plainObjects?Object.create(null):{},u=Object.keys(s),l=0;l<u.length;++l){var f=u[l],p=a(f,s[f],r);c=n.merge(c,p,r)}return n.compact(c)}},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,s={delimiter:"&",encode:!0,encoder:n.encode,encodeValuesOnly:!1,serializeDate:function(e){return a.call(e)},skipNulls:!1,strictNullHandling:!1},c=function e(t,r,o,i,a,c,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 c&&!h?c(r,s.encoder):r;y=""}if("string"==typeof y||"number"==typeof y||"boolean"==typeof y||n.isBuffer(y))return c?[d(h?r:c(r,s.encoder))+"="+d(c(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];a&&null===y[w]||(v=Array.isArray(y)?v.concat(e(y[w],o(r,w),o,i,a,c,u,l,f,p,d,h)):v.concat(e(y[w],r+(f?"."+w:"["+w+"]"),o,i,a,c,u,l,f,p,d,h)))}return v};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?s.delimiter:a.delimiter,l="boolean"==typeof a.strictNullHandling?a.strictNullHandling:s.strictNullHandling,f="boolean"==typeof a.skipNulls?a.skipNulls:s.skipNulls,p="boolean"==typeof a.encode?a.encode:s.encode,d="function"==typeof a.encoder?a.encoder:s.encoder,h="function"==typeof a.sort?a.sort:null,y=void 0!==a.allowDots&&a.allowDots,g="function"==typeof a.serializeDate?a.serializeDate:s.serializeDate,v="boolean"==typeof a.encodeValuesOnly?a.encodeValuesOnly:s.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 C,m,w=o.formatters[a.format];"function"==typeof a.filter?r=(m=a.filter)("",r):Array.isArray(a.filter)&&(C=m=a.filter);var b,F=[];if("object"!=typeof r||null===r)return"";b=a.arrayFormat in i?a.arrayFormat:"indices"in a?a.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(c(r[A],A,O,l,f,p?d:null,m,h,y,g,w,v)))}var x=F.join(u),T=!0===a.addQueryPrefix?"?":"";return x.length>0?T+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 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 c,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*a;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(c=e,i,"day")||s(c,o,"hour")||s(c,n,"minute")||s(c,r,"second")||c+" 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),s=0;s<a.length;s++)a[s]=arguments[s];a[0]=t.coerce(a[0]),"string"!=typeof a[0]&&a.unshift("%O");var c=0;a[0]=a[0].replace(/%([a-zA-Z%])/g,function(r,n){if("%%"===r)return r;c++;var o=t.formatters[n];if("function"==typeof o){var i=a[c];r=o.call(e,i),a.splice(c,1),c--}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 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:a}catch(e){n=a}}();var c,u=[],l=!1,f=-1;function p(){l&&c&&(l=!1,c.length?u=c.concat(u):f=-1,u.length&&d())}function d(){if(!l){var e=s(p);l=!0;for(var t=u.length;t;){for(c=u,u=[];++f<t;)c&&c[f].run();f=-1,t=u.length}c=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 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))}]);
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=11)}([function(e,t,n){"use strict";var r=String.prototype.replace,o=/%20/g;e.exports={default:"RFC3986",formatters:{RFC1738:function(e){return r.call(e,o,"+")},RFC3986:function(e){return e}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},function(e,t,n){"use strict";var r=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 n=t&&t.plainObjects?Object.create(null):{},r=0;r<e.length;++r)void 0!==e[r]&&(n[r]=e[r]);return n};e.exports={arrayToObject:i,assign:function(e,t){return Object.keys(t).reduce(function(e,n){return e[n]=t[n],e},e)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],r=0;r<t.length;++r)for(var o=t[r],i=o.obj[o.prop],a=Object.keys(i),s=0;s<a.length;++s){var c=a[s],u=i[c];"object"==typeof u&&null!==u&&-1===n.indexOf(u)&&(t.push({obj:i,prop:c}),n.push(u))}return function(e){for(var t;e.length;){var n=e.pop();if(t=n.obj[n.prop],Array.isArray(t)){for(var r=[],o=0;o<t.length;++o)void 0!==t[o]&&r.push(t[o]);n.obj[n.prop]=r}}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),n="",r=0;r<t.length;++r){var i=t.charCodeAt(r);45===i||46===i||95===i||126===i||i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122?n+=t.charAt(r):i<128?n+=o[i]:i<2048?n+=o[192|i>>6]+o[128|63&i]:i<55296||i>=57344?n+=o[224|i>>12]+o[128|i>>6&63]+o[128|63&i]:(r+=1,i=65536+((1023&i)<<10|1023&t.charCodeAt(r)),n+=o[240|i>>18]+o[128|i>>12&63]+o[128|i>>6&63]+o[128|63&i])}return n},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,n,o){if(!n)return t;if("object"!=typeof n){if(Array.isArray(t))t.push(n);else{if("object"!=typeof t)return[t,n];(o.plainObjects||o.allowPrototypes||!r.call(Object.prototype,n))&&(t[n]=!0)}return t}if("object"!=typeof t)return[t].concat(n);var a=t;return Array.isArray(t)&&!Array.isArray(n)&&(a=i(t,o)),Array.isArray(t)&&Array.isArray(n)?(n.forEach(function(n,i){r.call(t,i)?t[i]&&"object"==typeof t[i]?t[i]=e(t[i],n,o):t.push(n):t[i]=n}),t):Object.keys(n).reduce(function(t,i){var a=n[i];return r.call(t,i)?t[i]=e(t[i],a,o):t[i]=a,t},a)}}},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,s)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,i,a={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(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=r[2&i[0]?"return":i[0]?"throw":"next"])&&!(o=o.call(r,i[1])).done)return o;switch(r=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++,r=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],r=0}finally{n=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 i=n(9),a=n(5),s=i("crypto-news-api");t.generateAPI=function(e){return function(){function t(e,t){if(this.sentimentEnabled=!1,!e)throw new Error("No API key found. Register for an API key at https://cryptocontrol.io/apis");this.apikey=e,this.proxyURL=t,s("using cryptocontrol.io api v1")}return t.prototype._fetch=function(t,n){void 0===n&&(n={}),n.enableSentiment=this.sentimentEnabled;var r=a.stringify(n),o=this.proxyURL||"https://cryptocontrol.io/api/v1/public";return e(""+o+t+"?"+r,{headers:{"user-agent":"CryptoControl Node.js API v2.2.0","x-api-key":this.apikey}}).then(function(e){if(401===e.status)throw new Error("Invalid API Key");if(405===e.status)throw new Error("You are not a premium user. Visit https://cryptocontrol.io/about/premium for more info");if(200!==e.status)throw new Error("Bad response from the CryptoControl server");return e.json()})},t.prototype.enableSentiment=function(){return r(this,void 0,void 0,function(){return o(this,function(e){return this.sentimentEnabled=!0,[2]})})},t.prototype.getTopNews=function(e){return void 0===e&&(e="en"),r(this,void 0,void 0,function(){return o(this,function(t){switch(t.label){case 0:return[4,this._fetch("/news",{language:e})];case 1:return[2,t.sent()]}})})},t.prototype.getLatestNews=function(e){return void 0===e&&(e="en"),r(this,void 0,void 0,function(){return o(this,function(t){switch(t.label){case 0:return[4,this._fetch("/news",{latest:!0,language:e})];case 1:return[2,t.sent()]}})})},t.prototype.getTopNewsByCategory=function(e){return void 0===e&&(e="en"),r(this,void 0,void 0,function(){return o(this,function(t){switch(t.label){case 0:return[4,this._fetch("/news/category",{language:e})];case 1:return[2,t.sent()]}})})},t.prototype.getTopNewsByCoin=function(e,t){return void 0===t&&(t="en"),r(this,void 0,void 0,function(){return o(this,function(n){switch(n.label){case 0:return[4,this._fetch("/news/coin/"+e,{language:t})];case 1:return[2,n.sent()]}})})},t.prototype.getLatestNewsByCoin=function(e,t){return void 0===t&&(t="en"),r(this,void 0,void 0,function(){return o(this,function(n){switch(n.label){case 0:return[4,this._fetch("/news/coin/"+e,{latest:!0,language:t})];case 1:return[2,n.sent()]}})})},t.prototype.getTopNewsByCoinCategory=function(e,t){return void 0===t&&(t="en"),r(this,void 0,void 0,function(){return o(this,function(n){switch(n.label){case 0:return[4,this._fetch("/news/coin/"+e+"/category",{language:t})];case 1:return[2,n.sent()]}})})},t.prototype.getTopTweeetsByCoin=function(e,t){return void 0===t&&(t="en"),r(this,void 0,void 0,function(){return o(this,function(n){switch(n.label){case 0:return[4,this._fetch("/tweets/coin/"+e,{language:t})];case 1:return[2,n.sent()]}})})},t.prototype.getLatestTweetsByCoin=function(e,t){return void 0===t&&(t="en"),r(this,void 0,void 0,function(){return o(this,function(n){switch(n.label){case 0:return[4,this._fetch("/tweets/coin/"+e,{latest:!0,language:t})];case 1:return[2,n.sent()]}})})},t.prototype.getTopRedditPostsByCoin=function(e,t){return void 0===t&&(t="en"),r(this,void 0,void 0,function(){return o(this,function(n){switch(n.label){case 0:return[4,this._fetch("/reddit/coin/"+e,{language:t})];case 1:return[2,n.sent()]}})})},t.prototype.getLatestRedditPostsByCoin=function(e,t){return void 0===t&&(t="en"),r(this,void 0,void 0,function(){return o(this,function(n){switch(n.label){case 0:return[4,this._fetch("/reddit/coin/"+e,{latest:!0,language:t})];case 1:return[2,n.sent()]}})})},t.prototype.getTopFeedByCoin=function(e,t){return void 0===t&&(t="en"),r(this,void 0,void 0,function(){return o(this,function(n){switch(n.label){case 0:return[4,this._fetch("/feed/coin/"+e,{language:t})];case 1:return[2,n.sent()]}})})},t.prototype.getLatestFeedByCoin=function(e,t){return void 0===t&&(t="en"),r(this,void 0,void 0,function(){return o(this,function(n){switch(n.label){case 0:return[4,this._fetch("/feed/coin/"+e,{latest:!0,language:t})];case 1:return[2,n.sent()]}})})},t.prototype.getTopItemsByCoin=function(e,t){return void 0===t&&(t="en"),r(this,void 0,void 0,function(){return o(this,function(n){switch(n.label){case 0:return[4,this._fetch("/all/coin/"+e,{language:t})];case 1:return[2,n.sent()]}})})},t.prototype.getLatestItemsByCoin=function(e,t){return void 0===t&&(t="en"),r(this,void 0,void 0,function(){return o(this,function(n){switch(n.label){case 0:return[4,this._fetch("/all/coin/"+e,{latest:!0,language:t})];case 1:return[2,n.sent()]}})})},t.prototype.getCoinDetails=function(e,t){return void 0===t&&(t="en"),r(this,void 0,void 0,function(){return o(this,function(n){switch(n.label){case 0:return[4,this._fetch("/details/coin/"+e,{language:t})];case 1:return[2,n.sent()]}})})},t}()}},function(e,t,n){"use strict";var r=n(1),o=Object.prototype.hasOwnProperty,i={allowDots:!1,allowPrototypes:!1,arrayLimit:20,decoder:r.decode,delimiter:"&",depth:5,parameterLimit:1e3,plainObjects:!1,strictNullHandling:!1},a=function(e,t,n){if(e){var r=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,i=/(\[[^[\]]*])/g,a=/(\[[^[\]]*])/.exec(r),s=a?r.slice(0,a.index):r,c=[];if(s){if(!n.plainObjects&&o.call(Object.prototype,s)&&!n.allowPrototypes)return;c.push(s)}for(var u=0;null!==(a=i.exec(r))&&u<n.depth;){if(u+=1,!n.plainObjects&&o.call(Object.prototype,a[1].slice(1,-1))&&!n.allowPrototypes)return;c.push(a[1])}return a&&c.push("["+r.slice(a.index)+"]"),function(e,t,n){for(var r=t,o=e.length-1;o>=0;--o){var i,a=e[o];if("[]"===a)i=(i=[]).concat(r);else{i=n.plainObjects?Object.create(null):{};var s="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,c=parseInt(s,10);!isNaN(c)&&a!==s&&String(c)===s&&c>=0&&n.parseArrays&&c<=n.arrayLimit?(i=[])[c]=r:i[s]=r}r=i}return r}(c,t,n)}};e.exports=function(e,t){var n=t?r.assign({},t):{};if(null!==n.decoder&&void 0!==n.decoder&&"function"!=typeof n.decoder)throw new TypeError("Decoder has to be a function.");if(n.ignoreQueryPrefix=!0===n.ignoreQueryPrefix,n.delimiter="string"==typeof n.delimiter||r.isRegExp(n.delimiter)?n.delimiter:i.delimiter,n.depth="number"==typeof n.depth?n.depth:i.depth,n.arrayLimit="number"==typeof n.arrayLimit?n.arrayLimit:i.arrayLimit,n.parseArrays=!1!==n.parseArrays,n.decoder="function"==typeof n.decoder?n.decoder:i.decoder,n.allowDots="boolean"==typeof n.allowDots?n.allowDots:i.allowDots,n.plainObjects="boolean"==typeof n.plainObjects?n.plainObjects:i.plainObjects,n.allowPrototypes="boolean"==typeof n.allowPrototypes?n.allowPrototypes:i.allowPrototypes,n.parameterLimit="number"==typeof n.parameterLimit?n.parameterLimit:i.parameterLimit,n.strictNullHandling="boolean"==typeof n.strictNullHandling?n.strictNullHandling:i.strictNullHandling,""===e||null===e||void 0===e)return n.plainObjects?Object.create(null):{};for(var s="string"==typeof e?function(e,t){for(var n={},r=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,a=t.parameterLimit===1/0?void 0:t.parameterLimit,s=r.split(t.delimiter,a),c=0;c<s.length;++c){var u,l,f=s[c],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(n,u)?n[u]=[].concat(n[u]).concat(l):n[u]=l}return n}(e,n):e,c=n.plainObjects?Object.create(null):{},u=Object.keys(s),l=0;l<u.length;++l){var f=u[l],p=a(f,s[f],n);c=r.merge(c,p,n)}return r.compact(c)}},function(e,t,n){"use strict";var r=n(1),o=n(0),i={brackets:function(e){return e+"[]"},indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},a=Date.prototype.toISOString,s={delimiter:"&",encode:!0,encoder:r.encode,encodeValuesOnly:!1,serializeDate:function(e){return a.call(e)},skipNulls:!1,strictNullHandling:!1},c=function e(t,n,o,i,a,c,u,l,f,p,d,h){var y=t;if("function"==typeof u)y=u(n,y);else if(y instanceof Date)y=p(y);else if(null===y){if(i)return c&&!h?c(n,s.encoder):n;y=""}if("string"==typeof y||"number"==typeof y||"boolean"==typeof y||r.isBuffer(y))return c?[d(h?n:c(n,s.encoder))+"="+d(c(y,s.encoder))]:[d(n)+"="+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 b=g[m];a&&null===y[b]||(v=Array.isArray(y)?v.concat(e(y[b],o(n,b),o,i,a,c,u,l,f,p,d,h)):v.concat(e(y[b],n+(f?"."+b:"["+b+"]"),o,i,a,c,u,l,f,p,d,h)))}return v};e.exports=function(e,t){var n=e,a=t?r.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?s.delimiter:a.delimiter,l="boolean"==typeof a.strictNullHandling?a.strictNullHandling:s.strictNullHandling,f="boolean"==typeof a.skipNulls?a.skipNulls:s.skipNulls,p="boolean"==typeof a.encode?a.encode:s.encode,d="function"==typeof a.encoder?a.encoder:s.encoder,h="function"==typeof a.sort?a.sort:null,y=void 0!==a.allowDots&&a.allowDots,g="function"==typeof a.serializeDate?a.serializeDate:s.serializeDate,v="boolean"==typeof a.encodeValuesOnly?a.encodeValuesOnly:s.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 C,m,b=o.formatters[a.format];"function"==typeof a.filter?n=(m=a.filter)("",n):Array.isArray(a.filter)&&(C=m=a.filter);var w,F=[];if("object"!=typeof n||null===n)return"";w=a.arrayFormat in i?a.arrayFormat:"indices"in a?a.indices?"indices":"repeat":"indices";var O=i[w];C||(C=Object.keys(n)),h&&C.sort(h);for(var j=0;j<C.length;++j){var A=C[j];f&&null===n[A]||(F=F.concat(c(n[A],A,O,l,f,p?d:null,m,h,y,g,b,v)))}var x=F.join(u),T=!0===a.addQueryPrefix?"?":"";return x.length>0?T+x:""}},function(e,t,n){"use strict";var r=n(4),o=n(3),i=n(0);e.exports={formats:i,parse:o,stringify:r}},function(e,t){var n=1e3,r=60*n,o=60*r,i=24*o,a=365.25*i;function s(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}e.exports=function(e,t){t=t||{};var c,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*a;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*r;case"seconds":case"second":case"secs":case"sec":case"s":return s*n;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(c=e,i,"day")||s(c,o,"hour")||s(c,r,"minute")||s(c,n,"second")||c+" ms":function(e){if(e>=i)return Math.round(e/i)+"d";if(e>=o)return Math.round(e/o)+"h";if(e>=r)return Math.round(e/r)+"m";if(e>=n)return Math.round(e/n)+"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,n){function r(e){var n;function r(){if(r.enabled){var e=r,o=+new Date,i=o-(n||o);e.diff=i,e.prev=n,e.curr=o,n=o;for(var a=new Array(arguments.length),s=0;s<a.length;s++)a[s]=arguments[s];a[0]=t.coerce(a[0]),"string"!=typeof a[0]&&a.unshift("%O");var c=0;a[0]=a[0].replace(/%([a-zA-Z%])/g,function(n,r){if("%%"===n)return n;c++;var o=t.formatters[r];if("function"==typeof o){var i=a[c];n=o.call(e,i),a.splice(c,1),c--}return n}),t.formatArgs.call(e,a),(r.log||t.log||console.log.bind(console)).apply(e,a)}}return r.namespace=e,r.enabled=t.enabled(e),r.useColors=t.useColors(),r.color=function(e){var n,r=0;for(n in e)r=(r<<5)-r+e.charCodeAt(n),r|=0;return t.colors[Math.abs(r)%t.colors.length]}(e),r.destroy=o,"function"==typeof t.init&&t.init(r),t.instances.push(r),r}function o(){var e=t.instances.indexOf(this);return-1!==e&&(t.instances.splice(e,1),!0)}(t=e.exports=r.debug=r.default=r).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){var n;t.save(e),t.names=[],t.skips=[];var r=("string"==typeof e?e:"").split(/[\s,]+/),o=r.length;for(n=0;n<o;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")));for(n=0;n<t.instances.length;n++){var i=t.instances[n];i.enabled=t.enabled(i.namespace)}},t.enabled=function(e){if("*"===e[e.length-1])return!0;var n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=n(6),t.instances=[],t.names=[],t.skips=[],t.formatters={}},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var c,u=[],l=!1,f=-1;function p(){l&&c&&(l=!1,c.length?u=c.concat(u):f=-1,u.length&&d())}function d(){if(!l){var e=s(p);l=!0;for(var t=u.length;t;){for(c=u,u=[];++f<t;)c&&c[f].run();f=-1,t=u.length}c=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.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 n=1;n<arguments.length;n++)t[n-1]=arguments[n];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,n){(function(r){function o(){var e;try{e=t.storage.debug}catch(e){}return!e&&void 0!==r&&"env"in r&&(e=r.env.DEBUG),e}(t=e.exports=n(7)).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var n=this.useColors;if(e[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+e[0]+(n?"%c ":" ")+"+"+t.humanize(this.diff),!n)return;var r="color: "+this.color;e.splice(1,0,r,"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,r)},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,n(8))},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var r=n(2).generateAPI(fetch);window.CryptoControlApi=r,window.CryptoNewsApi=r,e.CryptoControlApi=r,e.CryptoNewsApi=r,t.default=r,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(2))}).call(this,n(10))}]);

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

proxyURL?: string | undefined;
sentimentEnabled: boolean;
_fetch(url: string, query?: any): Promise<any>;
getTopNews(language?: string): Promise<API.IArticle[]>;
getLatestNews(language?: string): Promise<API.IArticle[]>;
getTopNewsByCategory(language?: string): Promise<API.ICategoryResponse>;
getTopNewsByCoin(coinSlug: string, language?: string): Promise<API.IArticle[]>;
getLatestNewsByCoin(coinSlug: string, language?: string): Promise<API.IArticle[]>;
getTopNewsByCoinCategory(coinSlug: string, language?: string): Promise<API.ICategoryResponse>;
getTopTweeetsByCoin(coinSlug: string, language?: string): Promise<API.ITweet[]>;
getLatestTweetsByCoin(coinSlug: string, language?: string): Promise<API.ITweet[]>;
getTopRedditPostsByCoin(coinSlug: string, language?: string): Promise<API.IRedditItem[]>;
getLatestRedditPostsByCoin(coinSlug: string, language?: string): Promise<API.IRedditItem[]>;
getTopFeedByCoin(coinSlug: string, language?: string): Promise<API.IFeed[]>;
getLatestFeedByCoin(coinSlug: string, language?: string): Promise<API.IFeed[]>;
getTopItemsByCoin(coinSlug: string, language?: string): Promise<API.ICombinedFeed[]>;
getLatestItemsByCoin(coinSlug: string, language?: string): Promise<API.ICombinedFeed[]>;
getCoinDetails(coinSlug: string, language?: string): Promise<API.ICoinDetail[]>;
enableSentiment(): Promise<void>;
getTopNews(language?: API.ILanguage): Promise<API.IArticle[]>;
getLatestNews(language?: API.ILanguage): Promise<API.IArticle[]>;
getTopNewsByCategory(language?: API.ILanguage): Promise<API.ICategoryResponse>;
getTopNewsByCoin(coinSlug: string, language?: API.ILanguage): Promise<API.IArticle[]>;
getLatestNewsByCoin(coinSlug: string, language?: API.ILanguage): Promise<API.IArticle[]>;
getTopNewsByCoinCategory(coinSlug: string, language?: API.ILanguage): Promise<API.ICategoryResponse>;
getTopTweeetsByCoin(coinSlug: string, language?: API.ILanguage): Promise<API.ITweet[]>;
getLatestTweetsByCoin(coinSlug: string, language?: API.ILanguage): Promise<API.ITweet[]>;
getTopRedditPostsByCoin(coinSlug: string, language?: API.ILanguage): Promise<API.IRedditItem[]>;
getLatestRedditPostsByCoin(coinSlug: string, language?: API.ILanguage): Promise<API.IRedditItem[]>;
getTopFeedByCoin(coinSlug: string, language?: API.ILanguage): Promise<API.IFeed[]>;
getLatestFeedByCoin(coinSlug: string, language?: API.ILanguage): Promise<API.IFeed[]>;
getTopItemsByCoin(coinSlug: string, language?: API.ILanguage): Promise<API.ICombinedFeed[]>;
getLatestItemsByCoin(coinSlug: string, language?: API.ILanguage): Promise<API.ICombinedFeed[]>;
getCoinDetails(coinSlug: string, language?: API.ILanguage): Promise<API.ICoinDetail[]>;
};

@@ -24,0 +26,0 @@ };

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

import * as API from './src/CryptoControlApi';
import * as CryptoControlApi from './src/CryptoControlApi';
export * from './src/CryptoControlApi';

@@ -7,20 +7,22 @@ declare const _default: {

proxyURL?: string | undefined;
sentimentEnabled: boolean;
_fetch(url: string, query?: any): Promise<any>;
getTopNews(language?: string): Promise<API.IArticle[]>;
getLatestNews(language?: string): Promise<API.IArticle[]>;
getTopNewsByCategory(language?: string): Promise<API.ICategoryResponse>;
getTopNewsByCoin(coinSlug: string, language?: string): Promise<API.IArticle[]>;
getLatestNewsByCoin(coinSlug: string, language?: string): Promise<API.IArticle[]>;
getTopNewsByCoinCategory(coinSlug: string, language?: string): Promise<API.ICategoryResponse>;
getTopTweeetsByCoin(coinSlug: string, language?: string): Promise<API.ITweet[]>;
getLatestTweetsByCoin(coinSlug: string, language?: string): Promise<API.ITweet[]>;
getTopRedditPostsByCoin(coinSlug: string, language?: string): Promise<API.IRedditItem[]>;
getLatestRedditPostsByCoin(coinSlug: string, language?: string): Promise<API.IRedditItem[]>;
getTopFeedByCoin(coinSlug: string, language?: string): Promise<API.IFeed[]>;
getLatestFeedByCoin(coinSlug: string, language?: string): Promise<API.IFeed[]>;
getTopItemsByCoin(coinSlug: string, language?: string): Promise<API.ICombinedFeed[]>;
getLatestItemsByCoin(coinSlug: string, language?: string): Promise<API.ICombinedFeed[]>;
getCoinDetails(coinSlug: string, language?: string): Promise<API.ICoinDetail[]>;
enableSentiment(): Promise<void>;
getTopNews(language?: CryptoControlApi.ILanguage): Promise<CryptoControlApi.IArticle[]>;
getLatestNews(language?: CryptoControlApi.ILanguage): Promise<CryptoControlApi.IArticle[]>;
getTopNewsByCategory(language?: CryptoControlApi.ILanguage): Promise<CryptoControlApi.ICategoryResponse>;
getTopNewsByCoin(coinSlug: string, language?: CryptoControlApi.ILanguage): Promise<CryptoControlApi.IArticle[]>;
getLatestNewsByCoin(coinSlug: string, language?: CryptoControlApi.ILanguage): Promise<CryptoControlApi.IArticle[]>;
getTopNewsByCoinCategory(coinSlug: string, language?: CryptoControlApi.ILanguage): Promise<CryptoControlApi.ICategoryResponse>;
getTopTweeetsByCoin(coinSlug: string, language?: CryptoControlApi.ILanguage): Promise<CryptoControlApi.ITweet[]>;
getLatestTweetsByCoin(coinSlug: string, language?: CryptoControlApi.ILanguage): Promise<CryptoControlApi.ITweet[]>;
getTopRedditPostsByCoin(coinSlug: string, language?: CryptoControlApi.ILanguage): Promise<CryptoControlApi.IRedditItem[]>;
getLatestRedditPostsByCoin(coinSlug: string, language?: CryptoControlApi.ILanguage): Promise<CryptoControlApi.IRedditItem[]>;
getTopFeedByCoin(coinSlug: string, language?: CryptoControlApi.ILanguage): Promise<CryptoControlApi.IFeed[]>;
getLatestFeedByCoin(coinSlug: string, language?: CryptoControlApi.ILanguage): Promise<CryptoControlApi.IFeed[]>;
getTopItemsByCoin(coinSlug: string, language?: CryptoControlApi.ILanguage): Promise<CryptoControlApi.ICombinedFeed[]>;
getLatestItemsByCoin(coinSlug: string, language?: CryptoControlApi.ILanguage): Promise<CryptoControlApi.ICombinedFeed[]>;
getCoinDetails(coinSlug: string, language?: CryptoControlApi.ILanguage): Promise<CryptoControlApi.ICoinDetail[]>;
};
};
export default _default;

@@ -7,4 +7,4 @@ "use strict";

var fetch = require("node-fetch");
var API = require("./src/CryptoControlApi");
var CryptoControlApi = require("./src/CryptoControlApi");
__export(require("./src/CryptoControlApi"));
exports.default = API.generateAPI(fetch);
exports.default = CryptoControlApi.generateAPI(fetch);

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

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

@@ -6,20 +6,22 @@ new (apikey: string, proxyURL?: string | undefined): {

proxyURL?: string | undefined;
sentimentEnabled: boolean;
_fetch(url: string, query?: any): Promise<any>;
getTopNews(language?: string): Promise<IArticle[]>;
getLatestNews(language?: string): Promise<IArticle[]>;
getTopNewsByCategory(language?: string): Promise<ICategoryResponse>;
getTopNewsByCoin(coinSlug: string, language?: string): Promise<IArticle[]>;
getLatestNewsByCoin(coinSlug: string, language?: string): Promise<IArticle[]>;
getTopNewsByCoinCategory(coinSlug: string, language?: string): Promise<ICategoryResponse>;
getTopTweeetsByCoin(coinSlug: string, language?: string): Promise<ITweet[]>;
getLatestTweetsByCoin(coinSlug: string, language?: string): Promise<ITweet[]>;
getTopRedditPostsByCoin(coinSlug: string, language?: string): Promise<IRedditItem[]>;
getLatestRedditPostsByCoin(coinSlug: string, language?: string): Promise<IRedditItem[]>;
getTopFeedByCoin(coinSlug: string, language?: string): Promise<IFeed[]>;
getLatestFeedByCoin(coinSlug: string, language?: string): Promise<IFeed[]>;
getTopItemsByCoin(coinSlug: string, language?: string): Promise<ICombinedFeed[]>;
getLatestItemsByCoin(coinSlug: string, language?: string): Promise<ICombinedFeed[]>;
getCoinDetails(coinSlug: string, language?: string): Promise<ICoinDetail[]>;
enableSentiment(): Promise<void>;
getTopNews(language?: ILanguage): Promise<IArticle[]>;
getLatestNews(language?: ILanguage): Promise<IArticle[]>;
getTopNewsByCategory(language?: ILanguage): Promise<ICategoryResponse>;
getTopNewsByCoin(coinSlug: string, language?: ILanguage): Promise<IArticle[]>;
getLatestNewsByCoin(coinSlug: string, language?: ILanguage): Promise<IArticle[]>;
getTopNewsByCoinCategory(coinSlug: string, language?: ILanguage): Promise<ICategoryResponse>;
getTopTweeetsByCoin(coinSlug: string, language?: ILanguage): Promise<ITweet[]>;
getLatestTweetsByCoin(coinSlug: string, language?: ILanguage): Promise<ITweet[]>;
getTopRedditPostsByCoin(coinSlug: string, language?: ILanguage): Promise<IRedditItem[]>;
getLatestRedditPostsByCoin(coinSlug: string, language?: ILanguage): Promise<IRedditItem[]>;
getTopFeedByCoin(coinSlug: string, language?: ILanguage): Promise<IFeed[]>;
getLatestFeedByCoin(coinSlug: string, language?: ILanguage): Promise<IFeed[]>;
getTopItemsByCoin(coinSlug: string, language?: ILanguage): Promise<ICombinedFeed[]>;
getLatestItemsByCoin(coinSlug: string, language?: ILanguage): Promise<ICombinedFeed[]>;
getCoinDetails(coinSlug: string, language?: ILanguage): Promise<ICoinDetail[]>;
};
};
export { generateAPI, IArticle, ICategoryResponse, ICoinDetail, ICombinedFeed, IFeed, IRedditItem, ITweet };
export { generateAPI, IArticle, ICategoryResponse, ICoinDetail, ICombinedFeed, IFeed, ILanguage, IRedditItem, ITweet };

@@ -44,2 +44,3 @@ "use strict";

function CryptoControlApi(apikey, proxyURL) {
this.sentimentEnabled = false;
if (!apikey)

@@ -53,2 +54,3 @@ throw new Error('No API key found. Register for an API key at https://cryptocontrol.io/apis');

if (query === void 0) { query = {}; }
query.enableSentiment = this.sentimentEnabled;
var queryString = qs.stringify(query);

@@ -66,2 +68,4 @@ var API_HOST = 'https://cryptocontrol.io/api/v1/public';

throw new Error('Invalid API Key');
if (response.status === 405)
throw new Error('You are not a premium user. Visit https://cryptocontrol.io/about/premium for more info');
if (response.status !== 200)

@@ -72,2 +76,10 @@ throw new Error('Bad response from the CryptoControl server');

};
CryptoControlApi.prototype.enableSentiment = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
this.sentimentEnabled = true;
return [2];
});
});
};
CryptoControlApi.prototype.getTopNews = function (language) {

@@ -74,0 +86,0 @@ if (language === void 0) { language = 'en'; }

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

export declare type ILanguage = 'en' | 'ru' | 'po' | 'cn' | 'ko' | 'es' | 'it' | 'du' | 'jp';
export interface IArticle {

@@ -35,2 +36,4 @@ _id: string;

originalImageUrl?: string;
sentiment?: 'pos' | 'neg' | 'neu';
sentimentScore?: number;
}

@@ -37,0 +40,0 @@ export interface ICategoryResponse {

import * as fetch from 'node-fetch'
import * as API from './src/CryptoControlApi'
import * as CryptoControlApi from './src/CryptoControlApi'
export * from './src/CryptoControlApi'
export default API.generateAPI(fetch)
export default CryptoControlApi.generateAPI(fetch)
{
"name": "crypto-news-api",
"version": "2.2.0",
"version": "2.2.1",
"description": "API to get a crypto newsfeed in your app",

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

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

**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.
### Node.js ES6/Typescript

@@ -69,3 +67,3 @@ ```javascript

// Get all reddit/tweets/articles (sepearted) for NEO
// Get all reddit/tweets/articles (separated) for NEO
Api.getTopItemsByCoin("neo")

@@ -115,4 +113,4 @@ .then(function (feed) { console.log(feed) })

- **getLatestFeedByCoin(coin: String, lang?: enum)** Get a combined feed (reddit/tweets/articles) for a particular coin (sorted by relevance)
- **getTopItemsByCoin(coin: String, lang?: enum)** Get reddit/tweets/articles (seperated) for a particular coin (sorted by time)
- **getLatestItemsByCoin(coin: String, lang?: enum)** Get reddit/tweets/articles (seperated) for a particular coin (sorted by relevance)
- **getTopItemsByCoin(coin: String, lang?: enum)** Get reddit/tweets/articles (separated) for a particular coin (sorted by time)
- **getLatestItemsByCoin(coin: String, lang?: enum)** Get reddit/tweets/articles (separated) for a particular coin (sorted by relevance)
- **getCoinDetails(coin: String)** Get all details about a particular coin (links, description, subreddits, twitter etc..)

@@ -119,0 +117,0 @@

import * as debug from 'debug'
import * as qs from 'qs'
import { IArticle, ICategoryResponse, ITweet, IRedditItem, IFeed, ICoinDetail, ICombinedFeed } from './interfaces'
import { IArticle, ICategoryResponse, ITweet, IRedditItem, ILanguage, IFeed, ICoinDetail, ICombinedFeed } from './interfaces'

@@ -14,3 +14,5 @@

proxyURL?: string
sentimentEnabled: boolean = false
constructor(apikey: string, proxyURL?: string) {

@@ -26,2 +28,3 @@ if (!apikey) throw new Error('No API key found. Register for an API key at https://cryptocontrol.io/apis')

_fetch(url: string, query: any = {}): Promise<any> {
query.enableSentiment = this.sentimentEnabled
const queryString = qs.stringify(query)

@@ -39,2 +42,3 @@ const API_HOST = 'https://cryptocontrol.io/api/v1/public'

if (response.status === 401) throw new Error('Invalid API Key')
if (response.status === 405) throw new Error('You are not a premium user. Visit https://cryptocontrol.io/about/premium for more info')
if (response.status !== 200) throw new Error('Bad response from the CryptoControl server')

@@ -46,3 +50,8 @@ return response.json()

public async getTopNews(language = 'en'): Promise<IArticle[]> {
public async enableSentiment(){
this.sentimentEnabled = true;
}
public async getTopNews(language: ILanguage = 'en'): Promise<IArticle[]> {
return await this._fetch('/news', { language })

@@ -52,3 +61,3 @@ }

public async getLatestNews(language = 'en'): Promise<IArticle[]> {
public async getLatestNews(language: ILanguage = 'en'): Promise<IArticle[]> {
return await this._fetch('/news', { latest: true, language })

@@ -58,3 +67,3 @@ }

public async getTopNewsByCategory(language = 'en'): Promise<ICategoryResponse> {
public async getTopNewsByCategory(language: ILanguage = 'en'): Promise<ICategoryResponse> {
return await this._fetch(`/news/category`, { language })

@@ -64,3 +73,3 @@ }

public async getTopNewsByCoin(coinSlug: string, language = 'en'): Promise<IArticle[]> {
public async getTopNewsByCoin(coinSlug: string, language: ILanguage = 'en'): Promise<IArticle[]> {
return await this._fetch(`/news/coin/${coinSlug}`, { language })

@@ -70,3 +79,3 @@ }

public async getLatestNewsByCoin(coinSlug: string, language = 'en'): Promise<IArticle[]> {
public async getLatestNewsByCoin(coinSlug: string, language: ILanguage = 'en'): Promise<IArticle[]> {
return await this._fetch(`/news/coin/${coinSlug}`, { latest: true, language })

@@ -76,3 +85,3 @@ }

public async getTopNewsByCoinCategory(coinSlug: string, language = 'en'): Promise<ICategoryResponse> {
public async getTopNewsByCoinCategory(coinSlug: string, language:ILanguage = 'en'): Promise<ICategoryResponse> {
return await this._fetch(`/news/coin/${coinSlug}/category`, { language })

@@ -82,3 +91,3 @@ }

public async getTopTweeetsByCoin(coinSlug: string, language = 'en'): Promise<ITweet[]> {
public async getTopTweeetsByCoin(coinSlug: string, language: ILanguage = 'en'): Promise<ITweet[]> {
return await this._fetch(`/tweets/coin/${coinSlug}`, { language })

@@ -88,3 +97,3 @@ }

public async getLatestTweetsByCoin(coinSlug: string, language = 'en'): Promise<ITweet[]> {
public async getLatestTweetsByCoin(coinSlug: string, language:ILanguage = 'en'): Promise<ITweet[]> {
return await this._fetch(`/tweets/coin/${coinSlug}`, { latest: true, language })

@@ -94,3 +103,3 @@ }

public async getTopRedditPostsByCoin(coinSlug: string, language = 'en'): Promise<IRedditItem[]> {
public async getTopRedditPostsByCoin(coinSlug: string, language: ILanguage = 'en'): Promise<IRedditItem[]> {
return await this._fetch(`/reddit/coin/${coinSlug}`, { language })

@@ -100,3 +109,3 @@ }

public async getLatestRedditPostsByCoin(coinSlug: string, language = 'en'): Promise<IRedditItem[]> {
public async getLatestRedditPostsByCoin(coinSlug: string, language: ILanguage = 'en'): Promise<IRedditItem[]> {
return await this._fetch(`/reddit/coin/${coinSlug}`, { latest: true, language })

@@ -106,3 +115,3 @@ }

public async getTopFeedByCoin(coinSlug: string, language = 'en'): Promise<IFeed[]> {
public async getTopFeedByCoin(coinSlug: string, language: ILanguage = 'en'): Promise<IFeed[]> {
return await this._fetch(`/feed/coin/${coinSlug}`, { language })

@@ -112,3 +121,3 @@ }

public async getLatestFeedByCoin(coinSlug: string, language = 'en'): Promise<IFeed[]> {
public async getLatestFeedByCoin(coinSlug: string, language: ILanguage = 'en'): Promise<IFeed[]> {
return await this._fetch(`/feed/coin/${coinSlug}`, { latest: true, language })

@@ -118,3 +127,3 @@ }

public async getTopItemsByCoin(coinSlug: string, language = 'en'): Promise<ICombinedFeed[]> {
public async getTopItemsByCoin(coinSlug: string, language: ILanguage = 'en'): Promise<ICombinedFeed[]> {
return await this._fetch(`/all/coin/${coinSlug}`, { language })

@@ -124,3 +133,3 @@ }

public async getLatestItemsByCoin(coinSlug: string, language = 'en'): Promise<ICombinedFeed[]> {
public async getLatestItemsByCoin(coinSlug: string, language: ILanguage = 'en'): Promise<ICombinedFeed[]> {
return await this._fetch(`/all/coin/${coinSlug}`, { latest: true, language })

@@ -130,3 +139,3 @@ }

public async getCoinDetails(coinSlug: string, language = 'en'): Promise<ICoinDetail[]> {
public async getCoinDetails(coinSlug: string, language: ILanguage = 'en'): Promise<ICoinDetail[]> {
return await this._fetch(`/details/coin/${coinSlug}`, { language })

@@ -148,4 +157,5 @@ }

IFeed,
ILanguage,
IRedditItem,
ITweet
}

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

export type ILanguage = 'en' | 'ru' | 'po' | 'cn' | 'ko' | 'es' | 'it' | 'du' | 'jp'
export interface IArticle {

@@ -35,2 +37,5 @@ _id: string

originalImageUrl?: string
sentiment?: 'pos' | 'neg' | 'neu'
sentimentScore?: number
}

@@ -113,2 +118,2 @@

twitterUsernames: string[]
}
}

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

"dependencies": {
"crypto-news-api": "^1.0.20"
"crypto-news-api": "^2.2.0"
}
}

@@ -30,2 +30,2 @@ import CryptoControlApi, { IFeed } from '../dist/node/index.node'

.then((feed: IFeed[]) => console.log(feed))
.catch((error: Error) => console.error(error))
.catch((error: Error) => console.error(error))

@@ -13,4 +13,4 @@ {

"dependencies": {
"crypto-news-api": "^1.0.20"
"crypto-news-api": "^2.1.0"
}
}
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