Comparing version 1.0.0 to 1.0.1
17
index.js
@@ -21,2 +21,19 @@ const req = require('requestify') | ||
exports.roi = async function () { | ||
try { | ||
var result = await req.get(basePublicUrl + 'estimatedroi') | ||
result = Number(result.body) | ||
if (result <= 0 || result === NaN || result === null || result === undefined) { | ||
throw 'API Result doesn\'t seem right, TangoAlpha may be having problems' | ||
} | ||
return result | ||
} catch (err) { | ||
if (err.body) { | ||
console.warn('TangoAlphaAPI Error caught: (' + err.body + ')') | ||
} else { | ||
console.warn('TangoAlphaAPI Error caught: (' + err + ')') | ||
} | ||
} | ||
} | ||
exports.blockdrift = async function () { | ||
@@ -23,0 +40,0 @@ try { |
{ | ||
"name": "tangoalpha", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "The TangoAlpha Node.js API", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -30,2 +30,10 @@ # TangoAlpha Node.js API | ||
## Estimated ROI | ||
```js | ||
tango.roi().then(result => { //Result is a float | ||
console.log(result) // Logs the estimated yearly ROI in Percentage | ||
}) | ||
``` | ||
## Blockdrift | ||
@@ -32,0 +40,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8010
108
79