Skip to content

Commit

Permalink
kucoinfutures fetchBalance simplifications
Browse files Browse the repository at this point in the history
  • Loading branch information
kroitor authored Mar 16, 2022
1 parent 4a6b3de commit fc476ec
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions js/kucoinfutures.js
Original file line number Diff line number Diff line change
Expand Up @@ -1255,15 +1255,14 @@ module.exports = class kucoinfutures extends kucoin {
async fetchBalance (params = {}) {
await this.loadMarkets ();
// only fetches one balance at a time
const request = {};
const currencyId = this.safeString (params, 'currency');
const request = {
// 'currency': currency['id'], // optional, propagated via params
};
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) {
if (code !== undefined) {
const currency = this.currency (code);
request['currency'] = currency['id'];
}
Expand Down

0 comments on commit fc476ec

Please sign in to comment.