cryptowatch-api
Advanced tools
Comparing version 0.0.1 to 0.0.2
16
index.js
@@ -25,10 +25,16 @@ const http = require('superagent') | ||
return new Promise((resolve, reject) => { | ||
const url = `${this.url}/${endpoint}` | ||
http | ||
.get(`${this.url}/${endpoint}`) | ||
.get(url) | ||
.end((err, res) => { | ||
if (err) { | ||
reject('Request failed') | ||
reject({ | ||
message: 'Request failed', | ||
error: String(err), | ||
url | ||
}) | ||
} else { | ||
resolve(res.body.result) | ||
this.allowanceRemaining = res.body.allowance.remaining | ||
} | ||
this.allowangeRemaining = res.body.allowance.remaining | ||
resolve(res.body.result) | ||
}) | ||
@@ -43,3 +49,3 @@ }) | ||
allowance() { | ||
return this.allowangeRemaining | ||
return this.allowanceRemaining | ||
} | ||
@@ -46,0 +52,0 @@ |
{ | ||
"name": "cryptowatch-api", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Cryptowatch api wrapper", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
11152
6
178