Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/farukuzun/ccxt into faruk…
Browse files Browse the repository at this point in the history
…uzun-master
  • Loading branch information
kroitor committed May 31, 2018
2 parents 2402eaa + dd9a21d commit 864e12c
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions js/btcturk.js
Expand Up @@ -61,20 +61,19 @@ module.exports = class btcturk extends Exchange {
async fetchBalance (params = {}) {
let response = await this.privateGetBalance ();
let result = { 'info': response };
let base = {
'free': response['bitcoin_available'],
'used': response['bitcoin_reserved'],
'total': response['bitcoin_balance'],
};
let quote = {
'free': response['money_available'],
'used': response['money_reserved'],
'total': response['money_balance'],
};
let symbol = this.symbols[0];
let market = this.markets[symbol];
result[market['base']] = base;
result[market['quote']] = quote;
let currencies = Object.keys (this.currencies);
for (let i = 0; i < currencies.length; i++) {
let currency = currencies[i];
let currency_lowercase = currency.toLowerCase ();
let account = this.account ();
let available = currency_lowercase + '_available';
if (available in response) {
account['free'] = response[available];
account['total'] = response[currency_lowercase + '_balance'];
account['used'] = response[currency_lowercase + '_reserved'];
}
result[currency] = account;
}
return this.parseBalance (result);
}

Expand Down

0 comments on commit 864e12c

Please sign in to comment.