diff --git a/js/btcturk.js b/js/btcturk.js index 3cd2b6f8f396..1ac3700bb22a 100644 --- a/js/btcturk.js +++ b/js/btcturk.js @@ -50,10 +50,10 @@ module.exports = class btcturk extends Exchange { }, }, 'markets': { - 'BTC/TRY': { 'id': 'BTCTRY', 'symbol': 'BTC/TRY', 'base': 'BTC', 'quote': 'TRY', 'maker': 0.002 * 1.18, 'taker': 0.0035 * 1.18 }, - 'ETH/TRY': { 'id': 'ETHTRY', 'symbol': 'ETH/TRY', 'base': 'ETH', 'quote': 'TRY', 'maker': 0.002 * 1.18, 'taker': 0.0035 * 1.18 }, - 'XRP/TRY': { 'id': 'XRPTRY', 'symbol': 'XRP/TRY', 'base': 'XRP', 'quote': 'TRY', 'maker': 0.002 * 1.18, 'taker': 0.0035 * 1.18 }, - 'ETH/BTC': { 'id': 'ETHBTC', 'symbol': 'ETH/BTC', 'base': 'ETH', 'quote': 'BTC', 'maker': 0.002 * 1.18, 'taker': 0.0035 * 1.18 }, + 'BTC/TRY': { 'id': 'BTCTRY', 'symbol': 'BTC/TRY', 'base': 'BTC', 'quote': 'TRY', 'baseId': 'btc', 'quoteId': 'try', 'maker': 0.002 * 1.18, 'taker': 0.0035 * 1.18 }, + 'ETH/TRY': { 'id': 'ETHTRY', 'symbol': 'ETH/TRY', 'base': 'ETH', 'quote': 'TRY', 'baseId': 'eth', 'quoteId': 'try', 'maker': 0.002 * 1.18, 'taker': 0.0035 * 1.18 }, + 'XRP/TRY': { 'id': 'XRPTRY', 'symbol': 'XRP/TRY', 'base': 'XRP', 'quote': 'TRY', 'baseId': 'xrp', 'quoteId': 'try', 'maker': 0.002 * 1.18, 'taker': 0.0035 * 1.18 }, + 'ETH/BTC': { 'id': 'ETHBTC', 'symbol': 'ETH/BTC', 'base': 'ETH', 'quote': 'BTC', 'baseId': 'eth', 'quoteId': 'btc', 'maker': 0.002 * 1.18, 'taker': 0.0035 * 1.18 }, }, }); } @@ -61,20 +61,21 @@ 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 codes = Object.keys (this.currencies); + for (let i = 0; i < codes.length; i++) { + let code = codes[i]; + let currency = this.currencies[code]; + let account = this.account (); + let free = currency['id'] + '_available'; + let total = currency['id'] + '_balance'; + let used = currency['id'] + '_reserved'; + if (free in response) { + account['free'] = this.safeFloat (response, free); + account['total'] = this.safeFloat (response, total); + account['used'] = this.safeFloat (response, used); + } + result[code] = account; + } return this.parseBalance (result); }