ccxt 4.5.55 → 4.5.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. package/README.md +209 -5
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +1 -1
  4. package/dist/cjs/src/aftermath.js +10 -5
  5. package/dist/cjs/src/alpaca.js +2 -2
  6. package/dist/cjs/src/apex.js +25 -16
  7. package/dist/cjs/src/arkham.js +7 -4
  8. package/dist/cjs/src/ascendex.js +6 -3
  9. package/dist/cjs/src/base/Exchange.js +3 -3
  10. package/dist/cjs/src/bigone.js +7 -4
  11. package/dist/cjs/src/binance.js +4 -4
  12. package/dist/cjs/src/bingx.js +4 -4
  13. package/dist/cjs/src/bitflyer.js +2 -1
  14. package/dist/cjs/src/bitget.js +14 -3
  15. package/dist/cjs/src/bitmart.js +5 -4
  16. package/dist/cjs/src/bitmex.js +7 -4
  17. package/dist/cjs/src/bitopro.js +1 -1
  18. package/dist/cjs/src/bitrue.js +2 -1
  19. package/dist/cjs/src/bitso.js +6 -3
  20. package/dist/cjs/src/bitstamp.js +5 -3
  21. package/dist/cjs/src/bittrade.js +2 -1
  22. package/dist/cjs/src/blofin.js +2 -1
  23. package/dist/cjs/src/bybit.js +19 -17
  24. package/dist/cjs/src/bybiteu.js +1 -0
  25. package/dist/cjs/src/coinbaseexchange.js +2 -1
  26. package/dist/cjs/src/coinbaseinternational.js +15 -9
  27. package/dist/cjs/src/coinex.js +5 -3
  28. package/dist/cjs/src/coinsph.js +4 -4
  29. package/dist/cjs/src/cryptocom.js +6 -6
  30. package/dist/cjs/src/deepcoin.js +6 -3
  31. package/dist/cjs/src/delta.js +2 -1
  32. package/dist/cjs/src/deribit.js +4 -2
  33. package/dist/cjs/src/derive.js +5 -3
  34. package/dist/cjs/src/digifinex.js +2 -1
  35. package/dist/cjs/src/exmo.js +12 -39
  36. package/dist/cjs/src/foxbit.js +1 -1
  37. package/dist/cjs/src/gemini.js +4 -2
  38. package/dist/cjs/src/grvt.js +13 -7
  39. package/dist/cjs/src/hashkey.js +4 -4
  40. package/dist/cjs/src/hibachi.js +1 -1
  41. package/dist/cjs/src/hitbtc.js +2 -1
  42. package/dist/cjs/src/htx.js +9 -5
  43. package/dist/cjs/src/hyperliquid.js +19 -13
  44. package/dist/cjs/src/indodax.js +2 -1
  45. package/dist/cjs/src/kraken.js +14 -13
  46. package/dist/cjs/src/krakenfutures.js +2 -1
  47. package/dist/cjs/src/lbank.js +8 -4
  48. package/dist/cjs/src/lighter.js +1 -1
  49. package/dist/cjs/src/luno.js +1 -1
  50. package/dist/cjs/src/mercado.js +2 -1
  51. package/dist/cjs/src/mexc.js +24 -14
  52. package/dist/cjs/src/modetrade.js +1 -1
  53. package/dist/cjs/src/okx.js +6 -3
  54. package/dist/cjs/src/oxfun.js +5 -3
  55. package/dist/cjs/src/p2b.js +8 -4
  56. package/dist/cjs/src/paradex.js +3 -2
  57. package/dist/cjs/src/phemex.js +4 -2
  58. package/dist/cjs/src/poloniex.js +2 -1
  59. package/dist/cjs/src/pro/apex.js +10 -1
  60. package/dist/cjs/src/pro/aster.js +10 -9
  61. package/dist/cjs/src/pro/binance.js +3 -3
  62. package/dist/cjs/src/pro/bingx.js +7 -2
  63. package/dist/cjs/src/pro/bitmart.js +10 -0
  64. package/dist/cjs/src/pro/bitmex.js +1 -1
  65. package/dist/cjs/src/pro/grvt.js +8 -0
  66. package/dist/cjs/src/pro/htx.js +4 -4
  67. package/dist/cjs/src/pro/krakenfutures.js +16 -4
  68. package/dist/cjs/src/pro/modetrade.js +3 -3
  69. package/dist/cjs/src/pro/okx.js +4 -4
  70. package/dist/cjs/src/pro/oxfun.js +4 -4
  71. package/dist/cjs/src/pro/woo.js +4 -4
  72. package/dist/cjs/src/pro/woofipro.js +3 -3
  73. package/dist/cjs/src/pro/xt.js +1 -1
  74. package/dist/cjs/src/toobit.js +1 -1
  75. package/dist/cjs/src/woo.js +1 -1
  76. package/dist/cjs/src/woofipro.js +1 -1
  77. package/dist/cjs/src/xt.js +2 -1
  78. package/dist/cjs/src/yobit.js +4 -2
  79. package/dist/cjs/src/zebpay.js +3 -3
  80. package/js/ccxt.d.ts +1 -1
  81. package/js/ccxt.js +1 -1
  82. package/js/src/abstract/mexc.d.ts +1 -0
  83. package/js/src/aftermath.js +10 -5
  84. package/js/src/alpaca.js +2 -2
  85. package/js/src/apex.d.ts +1 -1
  86. package/js/src/apex.js +25 -16
  87. package/js/src/arkham.js +7 -4
  88. package/js/src/ascendex.js +6 -3
  89. package/js/src/base/Exchange.js +3 -3
  90. package/js/src/bigone.js +7 -4
  91. package/js/src/binance.js +4 -4
  92. package/js/src/bingx.js +4 -4
  93. package/js/src/bitflyer.js +2 -1
  94. package/js/src/bitget.js +14 -3
  95. package/js/src/bitmart.js +5 -4
  96. package/js/src/bitmex.js +7 -4
  97. package/js/src/bitopro.js +1 -1
  98. package/js/src/bitrue.js +2 -1
  99. package/js/src/bitso.js +6 -3
  100. package/js/src/bitstamp.js +5 -3
  101. package/js/src/bittrade.js +2 -1
  102. package/js/src/blofin.js +2 -1
  103. package/js/src/bybit.d.ts +1 -1
  104. package/js/src/bybit.js +19 -17
  105. package/js/src/bybiteu.js +1 -0
  106. package/js/src/coinbaseexchange.js +2 -1
  107. package/js/src/coinbaseinternational.d.ts +1 -1
  108. package/js/src/coinbaseinternational.js +15 -9
  109. package/js/src/coinex.d.ts +1 -1
  110. package/js/src/coinex.js +5 -3
  111. package/js/src/coinsph.js +4 -4
  112. package/js/src/cryptocom.js +6 -6
  113. package/js/src/deepcoin.js +6 -3
  114. package/js/src/delta.js +2 -1
  115. package/js/src/deribit.js +4 -2
  116. package/js/src/derive.js +5 -3
  117. package/js/src/digifinex.js +2 -1
  118. package/js/src/exmo.js +12 -39
  119. package/js/src/foxbit.js +1 -1
  120. package/js/src/gemini.js +4 -2
  121. package/js/src/grvt.d.ts +1 -1
  122. package/js/src/grvt.js +13 -7
  123. package/js/src/hashkey.js +4 -4
  124. package/js/src/hibachi.d.ts +1 -1
  125. package/js/src/hibachi.js +1 -1
  126. package/js/src/hitbtc.js +2 -1
  127. package/js/src/htx.js +9 -5
  128. package/js/src/hyperliquid.d.ts +4 -4
  129. package/js/src/hyperliquid.js +19 -13
  130. package/js/src/indodax.js +2 -1
  131. package/js/src/kraken.js +14 -13
  132. package/js/src/krakenfutures.js +2 -1
  133. package/js/src/lbank.js +8 -4
  134. package/js/src/lighter.d.ts +1 -1
  135. package/js/src/lighter.js +1 -1
  136. package/js/src/luno.js +1 -1
  137. package/js/src/mercado.js +2 -1
  138. package/js/src/mexc.d.ts +2 -2
  139. package/js/src/mexc.js +24 -14
  140. package/js/src/modetrade.js +1 -1
  141. package/js/src/okx.js +6 -3
  142. package/js/src/oxfun.js +5 -3
  143. package/js/src/p2b.js +8 -4
  144. package/js/src/paradex.js +3 -2
  145. package/js/src/phemex.js +4 -2
  146. package/js/src/poloniex.js +2 -1
  147. package/js/src/pro/apex.js +10 -1
  148. package/js/src/pro/aster.js +10 -9
  149. package/js/src/pro/binance.d.ts +1 -1
  150. package/js/src/pro/binance.js +3 -3
  151. package/js/src/pro/bingx.js +7 -2
  152. package/js/src/pro/bitmart.js +10 -0
  153. package/js/src/pro/bitmex.js +1 -1
  154. package/js/src/pro/grvt.js +8 -0
  155. package/js/src/pro/htx.d.ts +4 -4
  156. package/js/src/pro/htx.js +4 -4
  157. package/js/src/pro/krakenfutures.d.ts +4 -4
  158. package/js/src/pro/krakenfutures.js +16 -4
  159. package/js/src/pro/modetrade.d.ts +3 -3
  160. package/js/src/pro/modetrade.js +3 -3
  161. package/js/src/pro/okx.d.ts +4 -4
  162. package/js/src/pro/okx.js +4 -4
  163. package/js/src/pro/oxfun.d.ts +4 -4
  164. package/js/src/pro/oxfun.js +4 -4
  165. package/js/src/pro/woo.d.ts +4 -4
  166. package/js/src/pro/woo.js +4 -4
  167. package/js/src/pro/woofipro.d.ts +3 -3
  168. package/js/src/pro/woofipro.js +3 -3
  169. package/js/src/pro/xt.js +1 -1
  170. package/js/src/toobit.d.ts +1 -1
  171. package/js/src/toobit.js +1 -1
  172. package/js/src/woo.js +1 -1
  173. package/js/src/woofipro.js +1 -1
  174. package/js/src/xt.js +2 -1
  175. package/js/src/yobit.js +4 -2
  176. package/js/src/zebpay.js +3 -3
  177. package/package.json +21 -7
package/js/src/bybit.js CHANGED
@@ -1541,8 +1541,9 @@ export default class bybit extends Exchange {
1541
1541
  amountPrecision = this.parseNumber('1');
1542
1542
  pricePrecision = this.parseNumber('0.01');
1543
1543
  }
1544
+ const convertedExpireDate = this.convertExpireDateToMarketIdDate(expiry);
1544
1545
  return {
1545
- 'id': base + '-' + this.convertExpireDateToMarketIdDate(expiry) + '-' + strike + '-' + optionType,
1546
+ 'id': base + '-' + convertedExpireDate + '-' + strike + '-' + optionType,
1546
1547
  'symbol': base + '/' + quote + ':' + settle + '-' + expiry + '-' + strike + '-' + optionType,
1547
1548
  'base': base,
1548
1549
  'quote': quote,
@@ -1949,8 +1950,8 @@ export default class bybit extends Exchange {
1949
1950
  }
1950
1951
  return result;
1951
1952
  }
1952
- async fetchFutureMarkets(params) {
1953
- params = this.extend(params);
1953
+ async fetchFutureMarkets(params = {}) {
1954
+ params = this.extend(params, {});
1954
1955
  params['limit'] = 1000; // minimize number of requests
1955
1956
  let preLaunchMarkets = [];
1956
1957
  const usePrivateInstrumentsInfo = this.safeBool(this.options, 'usePrivateInstrumentsInfo', false);
@@ -2093,7 +2094,7 @@ export default class bybit extends Exchange {
2093
2094
  symbol = symbol + '-' + this.yymmdd(expiry);
2094
2095
  }
2095
2096
  const contractSize = inverse ? this.safeNumber2(lotSizeFilter, 'minTradingQty', 'minOrderQty') : this.parseNumber('1');
2096
- result.push(this.safeMarketStructure({
2097
+ const parsedMarket = this.safeMarketStructure({
2097
2098
  'id': id,
2098
2099
  'symbol': symbol,
2099
2100
  'base': base,
@@ -2143,7 +2144,8 @@ export default class bybit extends Exchange {
2143
2144
  },
2144
2145
  'created': this.safeInteger(market, 'launchTime'),
2145
2146
  'info': market,
2146
- }));
2147
+ });
2148
+ result.push(parsedMarket);
2147
2149
  }
2148
2150
  return result;
2149
2151
  }
@@ -4949,7 +4951,7 @@ export default class bybit extends Exchange {
4949
4951
  //
4950
4952
  const result = this.safeDict(response, 'result', {});
4951
4953
  const row = this.safeList(result, 'list', []);
4952
- return this.parseOrders(row, undefined);
4954
+ return this.parseOrders(row);
4953
4955
  }
4954
4956
  /**
4955
4957
  * @method
@@ -5786,7 +5788,7 @@ export default class bybit extends Exchange {
5786
5788
  */
5787
5789
  async fetchDepositAddressesByNetwork(code, params = {}) {
5788
5790
  await this.loadMarkets();
5789
- let currency = this.currency(code);
5791
+ const currency = this.currency(code);
5790
5792
  const request = {
5791
5793
  'coin': currency['id'],
5792
5794
  };
@@ -5818,9 +5820,9 @@ export default class bybit extends Exchange {
5818
5820
  const result = this.safeDict(response, 'result', {});
5819
5821
  const chains = this.safeList(result, 'chains', []);
5820
5822
  const coin = this.safeString(result, 'coin');
5821
- currency = this.currency(coin);
5822
- const parsed = this.parseDepositAddresses(chains, [currency['code']], false, {
5823
- 'currency': currency['code'],
5823
+ const currencyFromResponse = this.currency(coin);
5824
+ const parsed = this.parseDepositAddresses(chains, [currencyFromResponse['code']], false, {
5825
+ 'currency': currencyFromResponse['code'],
5824
5826
  });
5825
5827
  return this.indexBy(parsed, 'network');
5826
5828
  }
@@ -7094,7 +7096,7 @@ export default class bybit extends Exchange {
7094
7096
  }
7095
7097
  async fetchDerivativesOpenInterestHistory(symbol, timeframe = '1h', since = undefined, limit = undefined, params = {}) {
7096
7098
  await this.loadMarkets();
7097
- let market = this.market(symbol);
7099
+ const market = this.market(symbol);
7098
7100
  const subType = market['linear'] ? 'linear' : 'inverse';
7099
7101
  const category = this.safeString(params, 'category', subType);
7100
7102
  const intervals = this.safeDict(this.options, 'intervals');
@@ -7145,8 +7147,8 @@ export default class bybit extends Exchange {
7145
7147
  const result = this.safeDict(response, 'result', {});
7146
7148
  const data = this.addPaginationCursorToResult(response);
7147
7149
  const id = this.safeString(result, 'symbol');
7148
- market = this.safeMarket(id, market, undefined, 'contract');
7149
- return this.parseOpenInterestsHistory(data, market, since, limit);
7150
+ const safeMarketObj = this.safeMarket(id, market, undefined, 'contract');
7151
+ return this.parseOpenInterestsHistory(data, safeMarketObj, since, limit);
7150
7152
  }
7151
7153
  /**
7152
7154
  * @method
@@ -7161,7 +7163,7 @@ export default class bybit extends Exchange {
7161
7163
  */
7162
7164
  async fetchOpenInterest(symbol, params = {}) {
7163
7165
  await this.loadMarkets();
7164
- let market = this.market(symbol);
7166
+ const market = this.market(symbol);
7165
7167
  if (!market['contract']) {
7166
7168
  throw new BadRequest(this.id + ' fetchOpenInterest() supports contract markets only');
7167
7169
  }
@@ -7204,9 +7206,9 @@ export default class bybit extends Exchange {
7204
7206
  //
7205
7207
  const result = this.safeDict(response, 'result', {});
7206
7208
  const id = this.safeString(result, 'symbol');
7207
- market = this.safeMarket(id, market, undefined, 'contract');
7209
+ const safeMarketObj = this.safeMarket(id, market, undefined, 'contract');
7208
7210
  const data = this.addPaginationCursorToResult(response);
7209
- return this.parseOpenInterest(data[0], market);
7211
+ return this.parseOpenInterest(data[0], safeMarketObj);
7210
7212
  }
7211
7213
  /**
7212
7214
  * @method
@@ -7374,7 +7376,7 @@ export default class bybit extends Exchange {
7374
7376
  //
7375
7377
  const data = this.safeDict(response, 'result', {});
7376
7378
  const rows = this.safeList(data, 'loanAccountList', []);
7377
- const interest = this.parseBorrowInterests(rows, undefined);
7379
+ const interest = this.parseBorrowInterests(rows);
7378
7380
  return this.filterByCurrencySinceLimit(interest, code, since, limit);
7379
7381
  }
7380
7382
  /**
package/js/src/bybiteu.js CHANGED
@@ -50,6 +50,7 @@ export default class bybiteu extends bybit {
50
50
  'margin': true,
51
51
  'swap': false,
52
52
  'future': false,
53
+ 'option': undefined,
53
54
  },
54
55
  });
55
56
  }
@@ -1029,13 +1029,14 @@ export default class coinbaseexchange extends Exchange {
1029
1029
  }
1030
1030
  const price = this.safeString(trade, 'price');
1031
1031
  const amount = this.safeString(trade, 'size');
1032
+ const symbol = market['symbol'];
1032
1033
  return this.safeTrade({
1033
1034
  'id': id,
1034
1035
  'order': orderId,
1035
1036
  'info': trade,
1036
1037
  'timestamp': timestamp,
1037
1038
  'datetime': this.iso8601(timestamp),
1038
- 'symbol': market['symbol'],
1039
+ 'symbol': symbol,
1039
1040
  'type': undefined,
1040
1041
  'takerOrMaker': takerOrMaker,
1041
1042
  'side': side,
@@ -7,7 +7,7 @@ import type { Int, OrderSide, OrderType, Order, Trade, Ticker, Str, Transaction,
7
7
  export default class coinbaseinternational extends Exchange {
8
8
  describe(): any;
9
9
  handlePortfolioAndParams(methodName: string, params?: {}): Promise<any[]>;
10
- handleNetworkIdAndParams(currencyCode: string, methodName: string, params: any): Promise<any[]>;
10
+ handleNetworkIdAndParams(currencyCode: string, methodName: string, params?: {}): Promise<any[]>;
11
11
  /**
12
12
  * @method
13
13
  * @name coinbaseinternational#fetchAccounts
@@ -346,7 +346,7 @@ export default class coinbaseinternational extends Exchange {
346
346
  }
347
347
  throw new ArgumentsRequired(this.id + ' ' + methodName + '() requires a portfolio parameter or set the default portfolio with this.options["portfolio"]');
348
348
  }
349
- async handleNetworkIdAndParams(currencyCode, methodName, params) {
349
+ async handleNetworkIdAndParams(currencyCode, methodName, params = {}) {
350
350
  let networkId = undefined;
351
351
  [networkId, params] = this.handleOptionAndParams(params, methodName, 'network_arn_id');
352
352
  if (networkId === undefined) {
@@ -522,9 +522,10 @@ export default class coinbaseinternational extends Exchange {
522
522
  }
523
523
  const market = this.market(symbol);
524
524
  const page = this.safeInteger(params, pageKey, 1) - 1;
525
+ const offSet = this.safeInteger2(params, 'offset', 'result_offset', page * maxEntriesPerRequest);
525
526
  const request = {
526
527
  'instrument': market['id'],
527
- 'result_offset': this.safeInteger2(params, 'offset', 'result_offset', page * maxEntriesPerRequest),
528
+ 'result_offset': offSet,
528
529
  };
529
530
  if (limit !== undefined) {
530
531
  request['result_limit'] = limit;
@@ -944,8 +945,9 @@ export default class coinbaseinternational extends Exchange {
944
945
  return await this.fetchPaginatedCallIncremental('fetchDepositsWithdrawals', code, since, limit, params, pageKey, maxEntriesPerRequest);
945
946
  }
946
947
  const page = this.safeInteger(params, pageKey, 1) - 1;
948
+ const offSet = this.safeInteger2(params, 'offset', 'result_offset', page * maxEntriesPerRequest);
947
949
  const request = {
948
- 'result_offset': this.safeInteger2(params, 'offset', 'result_offset', page * maxEntriesPerRequest),
950
+ 'result_offset': offSet,
949
951
  };
950
952
  if (since !== undefined) {
951
953
  request['time_from'] = this.iso8601(since);
@@ -1380,16 +1382,18 @@ export default class coinbaseinternational extends Exchange {
1380
1382
  settleId = quoteId;
1381
1383
  symbol += ':' + quoteId;
1382
1384
  }
1385
+ const isLinear = isSpot ? undefined : (settleId === quoteId);
1386
+ const isInverse = isSpot ? undefined : (settleId !== quoteId);
1383
1387
  return {
1384
1388
  'id': marketId,
1385
1389
  'lowercaseId': marketId.toLowerCase(),
1386
1390
  'symbol': symbol,
1387
1391
  'base': baseId,
1388
1392
  'quote': quoteId,
1389
- 'settle': settleId ? settleId : undefined,
1393
+ 'settle': settleId,
1390
1394
  'baseId': baseId,
1391
1395
  'quoteId': quoteId,
1392
- 'settleId': settleId ? settleId : undefined,
1396
+ 'settleId': settleId,
1393
1397
  'type': isSpot ? 'spot' : 'swap',
1394
1398
  'spot': isSpot,
1395
1399
  'margin': false,
@@ -1398,8 +1402,8 @@ export default class coinbaseinternational extends Exchange {
1398
1402
  'option': false,
1399
1403
  'active': this.safeString(market, 'trading_state') === 'TRADING',
1400
1404
  'contract': !isSpot,
1401
- 'linear': isSpot ? undefined : (settleId === quoteId),
1402
- 'inverse': isSpot ? undefined : (settleId !== quoteId),
1405
+ 'linear': isLinear,
1406
+ 'inverse': isInverse,
1403
1407
  'taker': fees['trading']['taker'],
1404
1408
  'maker': fees['trading']['maker'],
1405
1409
  'contractSize': isSpot ? undefined : 1,
@@ -2048,9 +2052,10 @@ export default class coinbaseinternational extends Exchange {
2048
2052
  return await this.fetchPaginatedCallIncremental('fetchOpenOrders', symbol, since, limit, params, pageKey, maxEntriesPerRequest);
2049
2053
  }
2050
2054
  const page = this.safeInteger(params, pageKey, 1) - 1;
2055
+ const offSet = this.safeInteger2(params, 'offset', 'result_offset', page * maxEntriesPerRequest);
2051
2056
  const request = {
2052
2057
  'portfolio': portfolio,
2053
- 'result_offset': this.safeInteger2(params, 'offset', 'result_offset', page * maxEntriesPerRequest),
2058
+ 'result_offset': offSet,
2054
2059
  };
2055
2060
  let market = undefined;
2056
2061
  if (symbol) {
@@ -2132,8 +2137,9 @@ export default class coinbaseinternational extends Exchange {
2132
2137
  market = this.market(symbol);
2133
2138
  }
2134
2139
  const page = this.safeInteger(params, pageKey, 1) - 1;
2140
+ const offSet = this.safeInteger2(params, 'offset', 'result_offset', page * maxEntriesPerRequest);
2135
2141
  const request = {
2136
- 'result_offset': this.safeInteger2(params, 'offset', 'result_offset', page * maxEntriesPerRequest),
2142
+ 'result_offset': offSet,
2137
2143
  };
2138
2144
  if (limit !== undefined) {
2139
2145
  if (limit > 100) {
@@ -657,7 +657,7 @@ export default class coinex extends Exchange {
657
657
  * @name coinex#fetchDepositWithdrawFees
658
658
  * @description fetch the fees for deposits and withdrawals
659
659
  * @see https://docs.coinex.com/api/v2/assets/deposit-withdrawal/http/list-all-deposit-withdrawal-config
660
- * @param codes
660
+ * @param {string[]} [codes] list of unified currency codes
661
661
  * @param {object} [params] extra parameters specific to the exchange API endpoint
662
662
  * @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/?id=fee-structure}
663
663
  */
package/js/src/coinex.js CHANGED
@@ -4498,11 +4498,13 @@ export default class coinex extends Exchange {
4498
4498
  const marketId = this.safeString(info, 'market');
4499
4499
  market = this.safeMarket(marketId, market, undefined, 'swap');
4500
4500
  const maxNotional = this.safeNumber(tier, 'amount');
4501
+ const curr = market['linear'] ? market['base'] : market['quote'];
4502
+ const notional = minNotional;
4501
4503
  tiers.push({
4502
4504
  'tier': this.sum(i, 1),
4503
4505
  'symbol': this.safeSymbol(marketId, market, undefined, 'swap'),
4504
- 'currency': market['linear'] ? market['base'] : market['quote'],
4505
- 'minNotional': minNotional,
4506
+ 'currency': curr,
4507
+ 'minNotional': notional,
4506
4508
  'maxNotional': maxNotional,
4507
4509
  'maintenanceMarginRate': this.safeNumber(tier, 'maintenance_margin_rate'),
4508
4510
  'maxLeverage': this.safeInteger(tier, 'leverage'),
@@ -5717,7 +5719,7 @@ export default class coinex extends Exchange {
5717
5719
  * @name coinex#fetchDepositWithdrawFees
5718
5720
  * @description fetch the fees for deposits and withdrawals
5719
5721
  * @see https://docs.coinex.com/api/v2/assets/deposit-withdrawal/http/list-all-deposit-withdrawal-config
5720
- * @param codes
5722
+ * @param {string[]} [codes] list of unified currency codes
5721
5723
  * @param {object} [params] extra parameters specific to the exchange API endpoint
5722
5724
  * @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/?id=fee-structure}
5723
5725
  */
package/js/src/coinsph.js CHANGED
@@ -1272,12 +1272,12 @@ export default class coinsph extends Exchange {
1272
1272
  'currency': this.safeCurrencyCode(feeCurrencyId),
1273
1273
  };
1274
1274
  }
1275
- const isBuyer = this.safeBool2(trade, 'isBuyer', 'isBuyerMaker', undefined);
1275
+ const isBuyer = this.safeBool2(trade, 'isBuyer', 'isBuyerMaker');
1276
1276
  let side = undefined;
1277
1277
  if (isBuyer !== undefined) {
1278
1278
  side = (isBuyer === true) ? 'buy' : 'sell';
1279
1279
  }
1280
- const isMaker = this.safeString2(trade, 'isMaker', undefined);
1280
+ const isMaker = this.safeString(trade, 'isMaker');
1281
1281
  let takerOrMaker = undefined;
1282
1282
  if (isMaker !== undefined) {
1283
1283
  takerOrMaker = (isMaker === 'true') ? 'maker' : 'taker';
@@ -1672,7 +1672,7 @@ export default class coinsph extends Exchange {
1672
1672
  const marketId = this.safeString(order, 'symbol');
1673
1673
  market = this.safeMarket(marketId, market);
1674
1674
  const timestamp = this.safeInteger2(order, 'time', 'transactTime');
1675
- const trades = this.safeValue(order, 'fills', undefined);
1675
+ const trades = this.safeValue(order, 'fills');
1676
1676
  let triggerPrice = this.safeString(order, 'stopPrice');
1677
1677
  if (Precise.stringEq(triggerPrice, '0')) {
1678
1678
  triggerPrice = undefined;
@@ -2213,7 +2213,7 @@ export default class coinsph extends Exchange {
2213
2213
  if (response === undefined) {
2214
2214
  return undefined;
2215
2215
  }
2216
- const responseCode = this.safeString(response, 'code', undefined);
2216
+ const responseCode = this.safeString(response, 'code');
2217
2217
  if ((responseCode !== undefined) && (responseCode !== '200') && (responseCode !== '0')) {
2218
2218
  const feedback = this.id + ' ' + body;
2219
2219
  this.throwBroadlyMatchedException(this.exceptions['broad'], body, feedback);
@@ -806,6 +806,8 @@ export default class cryptocom extends Exchange {
806
806
  symbol = symbol + ':' + quote + '-' + this.yymmdd(expiry) + '-' + strike + '-' + symbolOptionType;
807
807
  contract = true;
808
808
  }
809
+ const isLinear = (contract) ? true : undefined;
810
+ const isInverse = (contract) ? false : undefined;
809
811
  result.push({
810
812
  'id': this.safeString(market, 'symbol'),
811
813
  'symbol': symbol,
@@ -823,8 +825,8 @@ export default class cryptocom extends Exchange {
823
825
  'option': option,
824
826
  'active': this.safeBool(market, 'tradable'),
825
827
  'contract': contract,
826
- 'linear': (contract) ? true : undefined,
827
- 'inverse': (contract) ? false : undefined,
828
+ 'linear': isLinear,
829
+ 'inverse': isInverse,
828
830
  'contractSize': this.safeNumber(market, 'contract_size'),
829
831
  'expiry': expiry,
830
832
  'expiryDatetime': this.iso8601(expiry),
@@ -2115,10 +2117,8 @@ export default class cryptocom extends Exchange {
2115
2117
  if (network in depositAddresses) {
2116
2118
  return depositAddresses[network];
2117
2119
  }
2118
- else {
2119
- const keys = Object.keys(depositAddresses);
2120
- return depositAddresses[keys[0]];
2121
- }
2120
+ const keys = Object.keys(depositAddresses);
2121
+ return depositAddresses[keys[0]];
2122
2122
  }
2123
2123
  /**
2124
2124
  * @method
@@ -508,6 +508,8 @@ export default class deepcoin extends Exchange {
508
508
  const maxLimitSize = this.safeString(market, 'maxLmtSz');
509
509
  const maxAmount = this.parseNumber(Precise.stringMax(maxMarketSize, maxLimitSize));
510
510
  const state = this.safeString(market, 'state');
511
+ const isMargin = spot && (Precise.stringGt(maxLeverage, '1'));
512
+ const isInverse = swap ? (!isLinear) : undefined;
511
513
  return this.extend(fees, {
512
514
  'id': id,
513
515
  'symbol': symbol,
@@ -519,14 +521,14 @@ export default class deepcoin extends Exchange {
519
521
  'settleId': settleId,
520
522
  'type': type,
521
523
  'spot': spot,
522
- 'margin': spot && (Precise.stringGt(maxLeverage, '1')),
524
+ 'margin': isMargin,
523
525
  'swap': swap,
524
526
  'future': false,
525
527
  'option': false,
526
528
  'active': state === 'live',
527
529
  'contract': swap,
528
530
  'linear': isLinear,
529
- 'inverse': swap ? (!isLinear) : undefined,
531
+ 'inverse': isInverse,
530
532
  'contractSize': swap ? this.safeNumber(market, 'ctVal') : undefined,
531
533
  'expiry': undefined,
532
534
  'expiryDatetime': undefined,
@@ -2187,11 +2189,12 @@ export default class deepcoin extends Exchange {
2187
2189
  }
2188
2190
  let merged = true;
2189
2191
  [merged, params] = this.handleOptionAndParams(params, 'cancelAllOrders', 'merged', merged);
2192
+ const isMergedMode = merged ? 1 : 0;
2190
2193
  const request = {
2191
2194
  'InstrumentID': market['id'],
2192
2195
  'ProductGroup': productGroup,
2193
2196
  'IsCrossMargin': encodedMarginMode,
2194
- 'IsMergeMode': merged ? 1 : 0,
2197
+ 'IsMergeMode': isMergedMode,
2195
2198
  };
2196
2199
  const response = await this.privatePostDeepcoinTradeSwapCancelAll(this.extend(request, params));
2197
2200
  const data = this.safeList(response, 'data', []);
package/js/src/delta.js CHANGED
@@ -360,6 +360,7 @@ export default class delta extends Exchange {
360
360
  const strike = this.safeString(optionParts, 2);
361
361
  const datetime = this.convertExpireDate(expiry);
362
362
  const timestamp = this.parse8601(datetime);
363
+ const optionTypeUnified = (optionType === 'C') ? 'call' : 'put';
363
364
  return {
364
365
  'id': optionType + '-' + base + '-' + strike + '-' + expiry,
365
366
  'symbol': base + '/' + quote + ':' + settle + '-' + expiry + '-' + strike + '-' + optionType,
@@ -382,7 +383,7 @@ export default class delta extends Exchange {
382
383
  'contractSize': this.parseNumber('1'),
383
384
  'expiry': timestamp,
384
385
  'expiryDatetime': datetime,
385
- 'optionType': (optionType === 'C') ? 'call' : 'put',
386
+ 'optionType': optionTypeUnified,
386
387
  'strike': this.parseNumber(strike),
387
388
  'precision': {
388
389
  'amount': undefined,
package/js/src/deribit.js CHANGED
@@ -526,9 +526,11 @@ export default class deribit extends Exchange {
526
526
  const optionType = this.safeString(optionParts, 3);
527
527
  const datetime = this.convertExpireDate(expiry);
528
528
  const timestamp = this.parse8601(datetime);
529
+ const id = base + '-' + this.convertExpireDateToMarketIdDate(expiry) + '-' + strike + '-' + optionType;
530
+ const symbolExpired = splitBase + '/' + quote + ':' + settle + '-' + expiry + '-' + strike + '-' + optionType;
529
531
  return {
530
- 'id': base + '-' + this.convertExpireDateToMarketIdDate(expiry) + '-' + strike + '-' + optionType,
531
- 'symbol': splitBase + '/' + quote + ':' + settle + '-' + expiry + '-' + strike + '-' + optionType,
532
+ 'id': id,
533
+ 'symbol': symbolExpired,
532
534
  'base': base,
533
535
  'quote': quote,
534
536
  'settle': settle,
package/js/src/derive.js CHANGED
@@ -672,6 +672,8 @@ export default class derive extends Exchange {
672
672
  linear = true;
673
673
  inverse = false;
674
674
  }
675
+ const contractSize = (spot) ? undefined : 1;
676
+ const isContract = (swap || option);
675
677
  return this.safeMarketStructure({
676
678
  'id': marketId,
677
679
  'symbol': symbol,
@@ -688,10 +690,10 @@ export default class derive extends Exchange {
688
690
  'future': false,
689
691
  'option': option,
690
692
  'active': this.safeBool(market, 'is_active'),
691
- 'contract': (swap || option),
693
+ 'contract': isContract,
692
694
  'linear': linear,
693
695
  'inverse': inverse,
694
- 'contractSize': (spot) ? undefined : 1,
696
+ 'contractSize': contractSize,
695
697
  'expiry': expiry,
696
698
  'expiryDatetime': this.iso8601(expiry),
697
699
  'taker': this.safeNumber(market, 'taker_fee_rate'),
@@ -1817,7 +1819,7 @@ export default class derive extends Exchange {
1817
1819
  'gtc': 'GTC',
1818
1820
  'post_only': 'PO',
1819
1821
  };
1820
- return this.safeString(timeInForces, timeInForce, undefined);
1822
+ return this.safeString(timeInForces, timeInForce);
1821
1823
  }
1822
1824
  parseOrderStatus(status) {
1823
1825
  if (status !== undefined) {
@@ -677,6 +677,7 @@ export default class digifinex extends Exchange {
677
677
  isAllowed = 1;
678
678
  }
679
679
  }
680
+ const isActive = isAllowed ? true : false;
680
681
  result.push({
681
682
  'id': id,
682
683
  'symbol': symbol,
@@ -692,7 +693,7 @@ export default class digifinex extends Exchange {
692
693
  'swap': swap,
693
694
  'future': false,
694
695
  'option': false,
695
- 'active': isAllowed ? true : false,
696
+ 'active': isActive,
696
697
  'contract': swap,
697
698
  'linear': isLinear,
698
699
  'inverse': isInverse,
package/js/src/exmo.js CHANGED
@@ -385,9 +385,7 @@ export default class exmo extends Exchange {
385
385
  if (method === 'fetchPrivateTradingFees') {
386
386
  return await this.fetchPrivateTradingFees(params);
387
387
  }
388
- else {
389
- return await this.fetchPublicTradingFees(params);
390
- }
388
+ return await this.fetchPublicTradingFees(params);
391
389
  }
392
390
  async fetchPrivateTradingFees(params = {}) {
393
391
  await this.loadMarkets();
@@ -1140,7 +1138,8 @@ export default class exmo extends Exchange {
1140
1138
  await this.loadMarkets();
1141
1139
  let ids = undefined;
1142
1140
  if (symbols === undefined) {
1143
- ids = this.ids.join(',');
1141
+ const allIds = this.ids;
1142
+ ids = allIds.join(',');
1144
1143
  // max URL length is 2083 symbols, including http schema, hostname, tld, etc...
1145
1144
  if (ids.length > 2048) {
1146
1145
  const numIds = this.ids.length;
@@ -2163,43 +2162,17 @@ export default class exmo extends Exchange {
2163
2162
  });
2164
2163
  return this.parseOrders(response, market, since, limit, params);
2165
2164
  }
2166
- else {
2167
- const responseSwap = await this.privatePostMarginUserOrderHistory(this.extend(request, params));
2168
- //
2169
- // {
2170
- // "items": [
2171
- // {
2172
- // "event_id": "692862104574106858",
2173
- // "event_time": "1694116400173489405",
2174
- // "event_type": "OrderCancelStarted",
2175
- // "order_id": "692862104561289319",
2176
- // "order_type": "stop_limit_sell",
2177
- // "order_status": "cancel_started",
2178
- // "trade_id": "0",
2179
- // "trade_type":"",
2180
- // "trade_quantity": "0",
2181
- // "trade_price": "0",
2182
- // "pair": "ADA_USDT",
2183
- // "quantity": "12",
2184
- // "price": "0.23",
2185
- // "stop_price": "0.22",
2186
- // "distance": "0"
2187
- // }
2188
- // ...
2189
- // ]
2190
- // }
2191
- //
2192
- const items = this.safeValue(responseSwap, 'items');
2193
- const orders = this.parseOrders(items, market, since, limit, params);
2194
- const result = [];
2195
- for (let i = 0; i < orders.length; i++) {
2196
- const order = orders[i];
2197
- if (order['status'] === 'canceled') {
2198
- result.push(order);
2199
- }
2165
+ const responseSwap = await this.privatePostMarginUserOrderHistory(this.extend(request, params));
2166
+ const items = this.safeValue(responseSwap, 'items');
2167
+ const orders = this.parseOrders(items, market, since, limit, params);
2168
+ const result = [];
2169
+ for (let i = 0; i < orders.length; i++) {
2170
+ const order = orders[i];
2171
+ if (order['status'] === 'canceled') {
2172
+ result.push(order);
2200
2173
  }
2201
- return result;
2202
2174
  }
2175
+ return result;
2203
2176
  }
2204
2177
  /**
2205
2178
  * @method
package/js/src/foxbit.js CHANGED
@@ -1139,7 +1139,7 @@ export default class foxbit extends Exchange {
1139
1139
  // "remark": "A remarkable note for the order.",
1140
1140
  // "funds_received": "290.0"
1141
1141
  // }
1142
- return this.parseOrder(response, undefined);
1142
+ return this.parseOrder(response);
1143
1143
  }
1144
1144
  /**
1145
1145
  * @method
package/js/src/gemini.js CHANGED
@@ -820,6 +820,7 @@ export default class gemini extends Exchange {
820
820
  inverse = false;
821
821
  }
822
822
  const type = swap ? 'swap' : 'spot';
823
+ const isSpot = !swap;
823
824
  return {
824
825
  'id': marketId,
825
826
  'symbol': symbol,
@@ -830,7 +831,7 @@ export default class gemini extends Exchange {
830
831
  'quoteId': quoteId,
831
832
  'settleId': settleId,
832
833
  'type': type,
833
- 'spot': !swap,
834
+ 'spot': isSpot,
834
835
  'margin': false,
835
836
  'swap': swap,
836
837
  'future': false,
@@ -1924,8 +1925,9 @@ export default class gemini extends Exchange {
1924
1925
  throw new AuthenticationError(this.id + ' sign() requires an account-key, master-keys are not-supported');
1925
1926
  }
1926
1927
  const nonce = this.nonce().toString();
1928
+ const finalUrl = url;
1927
1929
  const request = this.extend({
1928
- 'request': url,
1930
+ 'request': finalUrl,
1929
1931
  'nonce': nonce,
1930
1932
  }, query);
1931
1933
  let payload = this.json(request);
package/js/src/grvt.d.ts CHANGED
@@ -226,7 +226,7 @@ export default class grvt extends Exchange {
226
226
  */
227
227
  transfer(code: string, amount: number, fromAccount: string, toAccount: string, params?: {}): Promise<TransferEntry>;
228
228
  parseTransfer(transfer: Dict, currency?: Currency): TransferEntry;
229
- loadAccountInfos(): Promise<void>;
229
+ loadAccountInfos(): Promise<boolean>;
230
230
  /**
231
231
  * @method
232
232
  * @name grvt#withdraw