bittrex-node
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -8,2 +8,7 @@ Change Log | ||
## [1.0.3](https://github.com/AndrewBarba/bittrex-node/releases/tag/1.0.3) | ||
1. Fix withdraw endpoint typo | ||
2. Fix withdraw failing to sign when omitting paymentid | ||
## [1.0.2](https://github.com/AndrewBarba/bittrex-node/releases/tag/1.0.2) | ||
@@ -10,0 +15,0 @@ |
{ | ||
"name": "bittrex-node", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Bittrex API client for Node.js", | ||
@@ -27,5 +27,5 @@ "author": "Andrew Barba <abarba.77@gmail.com>", | ||
"devDependencies": { | ||
"eslint": "5.2.0", | ||
"eslint": "5.6.1", | ||
"mocha": "5.2.0", | ||
"should": "13.2.1" | ||
"should": "13.2.3" | ||
}, | ||
@@ -32,0 +32,0 @@ "scripts": { |
# bittrex-node | ||
[![wercker status](https://app.wercker.com/status/feb7e7d87d5a4a29ea9c04b4a1350a44/s/master "wercker status")](https://app.wercker.com/project/byKey/feb7e7d87d5a4a29ea9c04b4a1350a44) | ||
[![Twitter](https://img.shields.io/badge/twitter-@andrew_barba-blue.svg?style=flat)](http://twitter.com/andrew_barba) | ||
@@ -5,0 +6,0 @@ A full-featured Bittrex API client for Node.js |
@@ -214,3 +214,3 @@ const axios = require('axios') | ||
let params = { currency, quantity, address, paymentid } | ||
return this.request('get', '/account/getdepositaddress', { params }) | ||
return this.request('get', '/account/withdraw', { params }) | ||
} | ||
@@ -265,2 +265,4 @@ | ||
async request(method, url, { headers = {}, params = {} } = {}) { | ||
params = this.sanitizeParams(params) | ||
if (this._apiKey) { | ||
@@ -271,6 +273,9 @@ params.nonce = ++this._nonce | ||
} | ||
let { data } = await this._client.request({ method, url, headers, params }) | ||
if (!data.success) { | ||
throw new Error(data.message) | ||
} | ||
return data.result | ||
@@ -294,2 +299,17 @@ } | ||
* @private | ||
* @method sanitizeParams | ||
* @param {Object} params | ||
* @return {Object} | ||
*/ | ||
sanitizeParams(params = {}) { | ||
let obj = {} | ||
for (let key of Object.keys(params)) { | ||
if (params[key] === undefined) continue | ||
obj[key] = params[key] | ||
} | ||
return obj | ||
} | ||
/** | ||
* @private | ||
* @method parseDates | ||
@@ -296,0 +316,0 @@ * @param {Array<Object>} results |
Sorry, the diff of this file is not supported yet
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
56853
420
65