Skip to content

Commit

Permalink
kucoinfutures fetchBalance minor fix ccxt#12320
Browse files Browse the repository at this point in the history
  • Loading branch information
kroitor authored Mar 16, 2022
1 parent 68dcbe0 commit 4a6b3de
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions js/kucoinfutures.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,6 @@ module.exports = class kucoinfutures extends kucoin {
'version': 'v1',
'symbolSeparator': '-',
'defaultType': 'swap',
'defaultCode': 'USDT',
'marginTypes': {},
// endpoint versions
'versions': {
Expand All @@ -288,6 +287,10 @@ module.exports = class kucoinfutures extends kucoin {
'ERC20': 'eth',
'TRC20': 'trx',
},
// 'code': 'BTC',
// 'fetchBalance': {
// 'code': 'BTC',
// },
},
});
}
Expand Down Expand Up @@ -1253,9 +1256,14 @@ module.exports = class kucoinfutures extends kucoin {
await this.loadMarkets ();
// only fetches one balance at a time
const request = {};
const defaultCode = this.safeString (this.options, 'defaultCode');
const code = this.safeString2 (params, 'code', 'currency', defaultCode);
if (code !== undefined) {
const currencyId = this.safeString (params, 'currency');
let defaultCode = this.safeString (this.options, 'code');
const fetchBalanceOptions = this.safeValue (this.options, 'fetchBalance', {});
defaultCode = this.safeString (fetchBalanceOptions, 'code', defaultCode);
const code = this.safeString (params, 'code', defaultCode);
if (currencyId !== undefined) {
request['currency'] = currencyId;
} else if (code !== undefined) {
const currency = this.currency (code);
request['currency'] = currency['id'];
}
Expand Down

0 comments on commit 4a6b3de

Please sign in to comment.