Skip to content

Commit

Permalink
Merge pull request #11327 from Dan-krm/mexcFetchTickersHandleMarketTy…
Browse files Browse the repository at this point in the history
…peAndParams

Mexc fetchTickers : handleMarketTypeAndParams
  • Loading branch information
kroitor committed Jan 14, 2022
2 parents 82b07c7 + 76995e2 commit bc32146
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions js/mexc.js
Expand Up @@ -653,14 +653,13 @@ module.exports = class mexc extends Exchange {

async fetchTickers (symbols = undefined, params = {}) {
await this.loadMarkets ();
const defaultType = this.safeString2 (this.options, 'fetchTickers', 'defaultType', 'spot');
const type = this.safeString (params, 'type', defaultType);
const query = this.omit (params, 'type');
let method = 'spotPublicGetMarketTicker';
if (type === 'swap') {
method = 'contractPublicGetTicker';
}
const response = await this[method] (this.extend (query));
let marketType = undefined;
[ marketType, params ] = this.handleMarketTypeAndParams ('fetchTickers', undefined, params);
const method = this.getSupportedMapping (marketType, {
'spot': 'spotPublicGetMarketTicker',
'swap': 'contractPublicGetTicker',
});
const response = await this[method] (this.extend (params));
//
// {
// "success":true,
Expand Down

0 comments on commit bc32146

Please sign in to comment.