Skip to content

Commit

Permalink
bitso private API fix #1437
Browse files Browse the repository at this point in the history
  • Loading branch information
kroitor committed Jan 27, 2018
1 parent 293cd4c commit c7be1f9
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions js/bitso.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,17 +232,18 @@ module.exports = class bitso extends Exchange {
}

sign (path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
let query = '/' + this.version + '/' + this.implodeParams (path, params);
let url = this.urls['api'] + query;
let endpoint = '/' + this.version + '/' + this.implodeParams (path, params);
let query = this.omit (params, this.extractParams (path));
let url = this.urls['api'] + endpoint;
if (api === 'public') {
if (Object.keys (params).length)
url += '?' + this.urlencode (params);
if (Object.keys (query).length)
url += '?' + this.urlencode (query);
} else {
this.checkRequiredCredentials ();
let nonce = this.nonce ().toString ();
let request = [ nonce, method, query ].join ('');
if (Object.keys (params).length) {
body = this.json (params);
let request = [ nonce, method, endpoint ].join ('');
if (Object.keys (query).length) {
body = this.json (query);
request += body;
}
let signature = this.hmac (this.encode (request), this.encode (this.secret));
Expand Down

0 comments on commit c7be1f9

Please sign in to comment.