ccxt 4.4.39 → 4.4.41

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 (190) hide show
  1. package/README.md +3 -3
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +1 -1
  4. package/dist/cjs/src/ascendex.js +9 -9
  5. package/dist/cjs/src/base/Exchange.js +32 -21
  6. package/dist/cjs/src/binance.js +37 -43
  7. package/dist/cjs/src/bingx.js +4 -3
  8. package/dist/cjs/src/bit2c.js +0 -1
  9. package/dist/cjs/src/bitbank.js +0 -1
  10. package/dist/cjs/src/bitbns.js +0 -1
  11. package/dist/cjs/src/bitfinex.js +18 -19
  12. package/dist/cjs/src/bitfinex1.js +0 -1
  13. package/dist/cjs/src/bitflyer.js +0 -1
  14. package/dist/cjs/src/bitget.js +2 -2
  15. package/dist/cjs/src/bithumb.js +0 -1
  16. package/dist/cjs/src/bitmart.js +257 -5
  17. package/dist/cjs/src/bitmex.js +5 -6
  18. package/dist/cjs/src/bitopro.js +4 -5
  19. package/dist/cjs/src/bitrue.js +5 -7
  20. package/dist/cjs/src/bitso.js +1 -2
  21. package/dist/cjs/src/bitstamp.js +1 -2
  22. package/dist/cjs/src/bitteam.js +1 -3
  23. package/dist/cjs/src/bitvavo.js +2 -4
  24. package/dist/cjs/src/blockchaincom.js +5 -5
  25. package/dist/cjs/src/blofin.js +10 -10
  26. package/dist/cjs/src/btcalpha.js +0 -1
  27. package/dist/cjs/src/btcbox.js +0 -1
  28. package/dist/cjs/src/btcmarkets.js +1 -3
  29. package/dist/cjs/src/bybit.js +10 -11
  30. package/dist/cjs/src/cex.js +1 -1
  31. package/dist/cjs/src/coinbase.js +77 -1
  32. package/dist/cjs/src/coinbaseexchange.js +1 -1
  33. package/dist/cjs/src/coinbaseinternational.js +62 -0
  34. package/dist/cjs/src/coincatch.js +1 -1
  35. package/dist/cjs/src/coinex.js +9 -9
  36. package/dist/cjs/src/coinlist.js +1 -1
  37. package/dist/cjs/src/coinmetro.js +1 -1
  38. package/dist/cjs/src/cryptocom.js +91 -2
  39. package/dist/cjs/src/currencycom.js +1 -1
  40. package/dist/cjs/src/defx.js +1 -2
  41. package/dist/cjs/src/delta.js +1 -1
  42. package/dist/cjs/src/digifinex.js +1 -1
  43. package/dist/cjs/src/exmo.js +64 -6
  44. package/dist/cjs/src/gate.js +2 -2
  45. package/dist/cjs/src/hashkey.js +3 -5
  46. package/dist/cjs/src/htx.js +2 -2
  47. package/dist/cjs/src/hyperliquid.js +66 -2
  48. package/dist/cjs/src/kraken.js +130 -27
  49. package/dist/cjs/src/kucoin.js +30 -25
  50. package/dist/cjs/src/luno.js +1 -1
  51. package/dist/cjs/src/mexc.js +138 -2
  52. package/dist/cjs/src/ndax.js +1 -1
  53. package/dist/cjs/src/okcoin.js +18 -18
  54. package/dist/cjs/src/okx.js +27 -22
  55. package/dist/cjs/src/phemex.js +12 -8
  56. package/dist/cjs/src/poloniex.js +1 -1
  57. package/dist/cjs/src/poloniexfutures.js +6 -6
  58. package/dist/cjs/src/pro/bitget.js +1 -1
  59. package/dist/cjs/src/pro/bybit.js +13 -1
  60. package/dist/cjs/src/pro/coinex.js +2 -2
  61. package/dist/cjs/src/pro/gate.js +6 -6
  62. package/dist/cjs/src/pro/kucoin.js +3 -3
  63. package/dist/cjs/src/pro/okx.js +11 -11
  64. package/dist/cjs/src/pro/upbit.js +3 -3
  65. package/dist/cjs/src/vertex.js +11 -11
  66. package/dist/cjs/src/woo.js +33 -33
  67. package/dist/cjs/src/woofipro.js +24 -24
  68. package/dist/cjs/src/xt.js +31 -28
  69. package/dist/cjs/src/zonda.js +1 -1
  70. package/js/ccxt.d.ts +3 -3
  71. package/js/ccxt.js +1 -1
  72. package/js/src/abstract/bitmart.d.ts +2 -0
  73. package/js/src/abstract/okx.d.ts +5 -0
  74. package/js/src/ascendex.d.ts +2 -2
  75. package/js/src/ascendex.js +9 -9
  76. package/js/src/base/Exchange.d.ts +6 -3
  77. package/js/src/base/Exchange.js +32 -21
  78. package/js/src/base/types.d.ts +2 -0
  79. package/js/src/binance.d.ts +9 -9
  80. package/js/src/binance.js +37 -43
  81. package/js/src/bingx.d.ts +1 -1
  82. package/js/src/bingx.js +4 -3
  83. package/js/src/bit2c.js +0 -1
  84. package/js/src/bitbank.js +0 -1
  85. package/js/src/bitbns.js +0 -1
  86. package/js/src/bitfinex.d.ts +3 -3
  87. package/js/src/bitfinex.js +18 -19
  88. package/js/src/bitfinex1.js +0 -1
  89. package/js/src/bitflyer.js +0 -1
  90. package/js/src/bitget.d.ts +1 -1
  91. package/js/src/bitget.js +2 -2
  92. package/js/src/bithumb.js +0 -1
  93. package/js/src/bitmart.d.ts +53 -2
  94. package/js/src/bitmart.js +257 -5
  95. package/js/src/bitmex.d.ts +1 -1
  96. package/js/src/bitmex.js +5 -6
  97. package/js/src/bitopro.js +4 -5
  98. package/js/src/bitrue.js +5 -7
  99. package/js/src/bitso.d.ts +1 -1
  100. package/js/src/bitso.js +1 -2
  101. package/js/src/bitstamp.d.ts +1 -1
  102. package/js/src/bitstamp.js +1 -2
  103. package/js/src/bitteam.js +1 -3
  104. package/js/src/bitvavo.d.ts +1 -1
  105. package/js/src/bitvavo.js +2 -4
  106. package/js/src/blockchaincom.js +5 -5
  107. package/js/src/blofin.d.ts +3 -3
  108. package/js/src/blofin.js +10 -10
  109. package/js/src/btcalpha.js +0 -1
  110. package/js/src/btcbox.js +0 -1
  111. package/js/src/btcmarkets.js +1 -3
  112. package/js/src/bybit.d.ts +1 -1
  113. package/js/src/bybit.js +10 -11
  114. package/js/src/cex.d.ts +1 -1
  115. package/js/src/cex.js +1 -1
  116. package/js/src/coinbase.d.ts +1 -1
  117. package/js/src/coinbase.js +77 -1
  118. package/js/src/coinbaseexchange.d.ts +1 -1
  119. package/js/src/coinbaseexchange.js +1 -1
  120. package/js/src/coinbaseinternational.js +62 -0
  121. package/js/src/coincatch.d.ts +1 -1
  122. package/js/src/coincatch.js +1 -1
  123. package/js/src/coinex.js +9 -9
  124. package/js/src/coinlist.d.ts +1 -1
  125. package/js/src/coinlist.js +1 -1
  126. package/js/src/coinmetro.d.ts +1 -1
  127. package/js/src/coinmetro.js +1 -1
  128. package/js/src/cryptocom.d.ts +2 -2
  129. package/js/src/cryptocom.js +91 -2
  130. package/js/src/currencycom.d.ts +1 -1
  131. package/js/src/currencycom.js +1 -1
  132. package/js/src/defx.d.ts +1 -2
  133. package/js/src/defx.js +1 -2
  134. package/js/src/delta.d.ts +1 -1
  135. package/js/src/delta.js +1 -1
  136. package/js/src/digifinex.d.ts +1 -1
  137. package/js/src/digifinex.js +1 -1
  138. package/js/src/exmo.d.ts +35 -0
  139. package/js/src/exmo.js +64 -6
  140. package/js/src/gate.d.ts +1 -1
  141. package/js/src/gate.js +2 -2
  142. package/js/src/hashkey.d.ts +1 -1
  143. package/js/src/hashkey.js +3 -5
  144. package/js/src/htx.d.ts +1 -1
  145. package/js/src/htx.js +2 -2
  146. package/js/src/hyperliquid.d.ts +21 -2
  147. package/js/src/hyperliquid.js +66 -2
  148. package/js/src/kraken.d.ts +14 -8
  149. package/js/src/kraken.js +130 -27
  150. package/js/src/kucoin.d.ts +13 -13
  151. package/js/src/kucoin.js +30 -25
  152. package/js/src/luno.d.ts +1 -1
  153. package/js/src/luno.js +1 -1
  154. package/js/src/mexc.d.ts +1 -2
  155. package/js/src/mexc.js +138 -2
  156. package/js/src/ndax.d.ts +1 -1
  157. package/js/src/ndax.js +1 -1
  158. package/js/src/okcoin.d.ts +4 -4
  159. package/js/src/okcoin.js +18 -18
  160. package/js/src/okx.d.ts +3 -3
  161. package/js/src/okx.js +27 -22
  162. package/js/src/phemex.js +12 -8
  163. package/js/src/poloniex.d.ts +1 -1
  164. package/js/src/poloniex.js +1 -1
  165. package/js/src/poloniexfutures.d.ts +1 -1
  166. package/js/src/poloniexfutures.js +6 -6
  167. package/js/src/pro/bitget.d.ts +1 -1
  168. package/js/src/pro/bitget.js +1 -1
  169. package/js/src/pro/bybit.d.ts +1 -1
  170. package/js/src/pro/bybit.js +13 -1
  171. package/js/src/pro/coinex.js +2 -2
  172. package/js/src/pro/gate.d.ts +2 -2
  173. package/js/src/pro/gate.js +6 -6
  174. package/js/src/pro/kucoin.d.ts +1 -1
  175. package/js/src/pro/kucoin.js +3 -3
  176. package/js/src/pro/okx.d.ts +2 -2
  177. package/js/src/pro/okx.js +11 -11
  178. package/js/src/pro/upbit.d.ts +3 -3
  179. package/js/src/pro/upbit.js +3 -3
  180. package/js/src/vertex.d.ts +3 -3
  181. package/js/src/vertex.js +11 -11
  182. package/js/src/woo.d.ts +7 -7
  183. package/js/src/woo.js +33 -33
  184. package/js/src/woofipro.d.ts +1 -1
  185. package/js/src/woofipro.js +24 -24
  186. package/js/src/xt.d.ts +7 -7
  187. package/js/src/xt.js +31 -28
  188. package/js/src/zonda.d.ts +1 -1
  189. package/js/src/zonda.js +1 -1
  190. package/package.json +2 -2
@@ -571,14 +571,14 @@ export default class blockchaincom extends Exchange {
571
571
  'orderQty': this.amountToPrecision(symbol, amount),
572
572
  'clOrdId': clientOrderId,
573
573
  };
574
- const stopPrice = this.safeValue2(params, 'stopPx', 'stopPrice');
574
+ const triggerPrice = this.safeValue2(params, 'stopPx', 'stopPrice');
575
575
  params = this.omit(params, ['stopPx', 'stopPrice']);
576
576
  if (uppercaseOrderType === 'STOP' || uppercaseOrderType === 'STOPLIMIT') {
577
- if (stopPrice === undefined) {
578
- throw new ArgumentsRequired(this.id + ' createOrder() requires a stopPx or stopPrice param for a ' + uppercaseOrderType + ' order');
577
+ if (triggerPrice === undefined) {
578
+ throw new ArgumentsRequired(this.id + ' createOrder() requires a stopPx or triggerPrice param for a ' + uppercaseOrderType + ' order');
579
579
  }
580
580
  }
581
- if (stopPrice !== undefined) {
581
+ if (triggerPrice !== undefined) {
582
582
  if (uppercaseOrderType === 'MARKET') {
583
583
  request['ordType'] = 'STOP';
584
584
  }
@@ -598,7 +598,7 @@ export default class blockchaincom extends Exchange {
598
598
  request['price'] = this.priceToPrecision(symbol, price);
599
599
  }
600
600
  if (stopPriceRequired) {
601
- request['stopPx'] = this.priceToPrecision(symbol, stopPrice);
601
+ request['stopPx'] = this.priceToPrecision(symbol, triggerPrice);
602
602
  }
603
603
  const response = await this.privatePostOrders(this.extend(request, params));
604
604
  return this.parseOrder(response, market);
@@ -193,7 +193,7 @@ export default class blofin extends Exchange {
193
193
  * @param {int} [since] the earliest time in ms to fetch open orders for
194
194
  * @param {int} [limit] the maximum number of open orders structures to retrieve
195
195
  * @param {object} [params] extra parameters specific to the exchange API endpoint
196
- * @param {bool} [params.stop] True if fetching trigger or conditional orders
196
+ * @param {bool} [params.trigger] True if fetching trigger or conditional orders
197
197
  * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
198
198
  * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
199
199
  */
@@ -252,7 +252,7 @@ export default class blofin extends Exchange {
252
252
  * @param {string} [params.marginMode] 'cross' or 'isolated'
253
253
  * @param {int} [params.until] the latest time in ms to fetch entries for
254
254
  * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
255
- * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
255
+ * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
256
256
  */
257
257
  fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<LedgerEntry[]>;
258
258
  parseTransaction(transaction: Dict, currency?: Currency): Transaction;
@@ -372,7 +372,7 @@ export default class blofin extends Exchange {
372
372
  * @param {int} [since] the earliest time in ms to fetch orders for
373
373
  * @param {int} [limit] the maximum number of orde structures to retrieve
374
374
  * @param {object} [params] extra parameters specific to the exchange API endpoint
375
- * @param {bool} [params.stop] True if fetching trigger or conditional orders
375
+ * @param {bool} [params.trigger] True if fetching trigger or conditional orders
376
376
  * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
377
377
  * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
378
378
  */
package/js/src/blofin.js CHANGED
@@ -1375,7 +1375,7 @@ export default class blofin extends Exchange {
1375
1375
  * @param {int} [since] the earliest time in ms to fetch open orders for
1376
1376
  * @param {int} [limit] the maximum number of open orders structures to retrieve
1377
1377
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1378
- * @param {bool} [params.stop] True if fetching trigger or conditional orders
1378
+ * @param {bool} [params.trigger] True if fetching trigger or conditional orders
1379
1379
  * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
1380
1380
  * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
1381
1381
  */
@@ -1395,12 +1395,12 @@ export default class blofin extends Exchange {
1395
1395
  if (limit !== undefined) {
1396
1396
  request['limit'] = limit; // default 100, max 100
1397
1397
  }
1398
- const isStop = this.safeBoolN(params, ['stop', 'trigger', 'tpsl', 'TPSL'], false);
1398
+ const isTrigger = this.safeBoolN(params, ['stop', 'trigger', 'tpsl', 'TPSL'], false);
1399
1399
  let method = undefined;
1400
1400
  [method, params] = this.handleOptionAndParams(params, 'fetchOpenOrders', 'method', 'privateGetTradeOrdersPending');
1401
1401
  const query = this.omit(params, ['method', 'stop', 'trigger', 'tpsl', 'TPSL']);
1402
1402
  let response = undefined;
1403
- if (isStop || (method === 'privateGetTradeOrdersTpslPending')) {
1403
+ if (isTrigger || (method === 'privateGetTradeOrdersTpslPending')) {
1404
1404
  response = await this.privateGetTradeOrdersTpslPending(this.extend(request, query));
1405
1405
  }
1406
1406
  else {
@@ -1529,7 +1529,7 @@ export default class blofin extends Exchange {
1529
1529
  * @param {string} [params.marginMode] 'cross' or 'isolated'
1530
1530
  * @param {int} [params.until] the latest time in ms to fetch entries for
1531
1531
  * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
1532
- * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
1532
+ * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
1533
1533
  */
1534
1534
  async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
1535
1535
  await this.loadMarkets();
@@ -1726,8 +1726,8 @@ export default class blofin extends Exchange {
1726
1726
  let method = this.safeString(params, 'method', defaultMethod);
1727
1727
  const clientOrderIds = this.parseIds(this.safeValue(params, 'clientOrderId'));
1728
1728
  const tpslIds = this.parseIds(this.safeValue(params, 'tpslId'));
1729
- const stop = this.safeBoolN(params, ['stop', 'trigger', 'tpsl']);
1730
- if (stop) {
1729
+ const trigger = this.safeBoolN(params, ['stop', 'trigger', 'tpsl']);
1730
+ if (trigger) {
1731
1731
  method = 'privatePostTradeCancelTpsl';
1732
1732
  }
1733
1733
  if (clientOrderIds === undefined) {
@@ -1741,7 +1741,7 @@ export default class blofin extends Exchange {
1741
1741
  }
1742
1742
  }
1743
1743
  for (let i = 0; i < ids.length; i++) {
1744
- if (stop) {
1744
+ if (trigger) {
1745
1745
  request.push({
1746
1746
  'tpslId': ids[i],
1747
1747
  'instId': market['id'],
@@ -2159,7 +2159,7 @@ export default class blofin extends Exchange {
2159
2159
  * @param {int} [since] the earliest time in ms to fetch orders for
2160
2160
  * @param {int} [limit] the maximum number of orde structures to retrieve
2161
2161
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2162
- * @param {bool} [params.stop] True if fetching trigger or conditional orders
2162
+ * @param {bool} [params.trigger] True if fetching trigger or conditional orders
2163
2163
  * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
2164
2164
  * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
2165
2165
  */
@@ -2182,12 +2182,12 @@ export default class blofin extends Exchange {
2182
2182
  if (since !== undefined) {
2183
2183
  request['begin'] = since;
2184
2184
  }
2185
- const isStop = this.safeBoolN(params, ['stop', 'trigger', 'tpsl', 'TPSL'], false);
2185
+ const isTrigger = this.safeBoolN(params, ['stop', 'trigger', 'tpsl', 'TPSL'], false);
2186
2186
  let method = undefined;
2187
2187
  [method, params] = this.handleOptionAndParams(params, 'fetchOpenOrders', 'method', 'privateGetTradeOrdersHistory');
2188
2188
  const query = this.omit(params, ['method', 'stop', 'trigger', 'tpsl', 'TPSL']);
2189
2189
  let response = undefined;
2190
- if ((isStop) || (method === 'privateGetTradeOrdersTpslHistory')) {
2190
+ if ((isTrigger) || (method === 'privateGetTradeOrdersTpslHistory')) {
2191
2191
  response = await this.privateGetTradeOrdersTpslHistory(this.extend(request, query));
2192
2192
  }
2193
2193
  else {
@@ -721,7 +721,6 @@ export default class btcalpha extends Exchange {
721
721
  'postOnly': undefined,
722
722
  'side': side,
723
723
  'price': price,
724
- 'stopPrice': undefined,
725
724
  'triggerPrice': undefined,
726
725
  'cost': undefined,
727
726
  'amount': amount,
package/js/src/btcbox.js CHANGED
@@ -556,7 +556,6 @@ export default class btcbox extends Exchange {
556
556
  'status': status,
557
557
  'symbol': market['symbol'],
558
558
  'price': price,
559
- 'stopPrice': undefined,
560
559
  'triggerPrice': undefined,
561
560
  'cost': undefined,
562
561
  'trades': trades,
@@ -1041,7 +1041,6 @@ export default class btcmarkets extends Exchange {
1041
1041
  const id = this.safeString(order, 'orderId');
1042
1042
  const clientOrderId = this.safeString(order, 'clientOrderId');
1043
1043
  const timeInForce = this.safeString(order, 'timeInForce');
1044
- const stopPrice = this.safeNumber(order, 'triggerPrice');
1045
1044
  const postOnly = this.safeBool(order, 'postOnly');
1046
1045
  return this.safeOrder({
1047
1046
  'info': order,
@@ -1056,8 +1055,7 @@ export default class btcmarkets extends Exchange {
1056
1055
  'postOnly': postOnly,
1057
1056
  'side': side,
1058
1057
  'price': price,
1059
- 'stopPrice': stopPrice,
1060
- 'triggerPrice': stopPrice,
1058
+ 'triggerPrice': this.safeNumber(order, 'triggerPrice'),
1061
1059
  'cost': undefined,
1062
1060
  'amount': amount,
1063
1061
  'filled': undefined,
package/js/src/bybit.d.ts CHANGED
@@ -578,7 +578,7 @@ export default class bybit extends Exchange {
578
578
  * @param {object} [params] extra parameters specific to the exchange API endpoint
579
579
  * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
580
580
  * @param {string} [params.subType] if inverse will use v5/account/contract-transaction-log
581
- * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
581
+ * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
582
582
  */
583
583
  fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<LedgerEntry[]>;
584
584
  parseLedgerEntry(item: Dict, currency?: Currency): LedgerEntry;
package/js/src/bybit.js CHANGED
@@ -3685,33 +3685,33 @@ export default class bybit extends Exchange {
3685
3685
  const avgPrice = this.omitZero(this.safeString(order, 'avgPrice'));
3686
3686
  const rawTimeInForce = this.safeString(order, 'timeInForce');
3687
3687
  const timeInForce = this.parseTimeInForce(rawTimeInForce);
3688
- const stopPrice = this.omitZero(this.safeString(order, 'triggerPrice'));
3688
+ const triggerPrice = this.omitZero(this.safeString(order, 'triggerPrice'));
3689
3689
  const reduceOnly = this.safeBool(order, 'reduceOnly');
3690
3690
  let takeProfitPrice = this.omitZero(this.safeString(order, 'takeProfit'));
3691
3691
  let stopLossPrice = this.omitZero(this.safeString(order, 'stopLoss'));
3692
3692
  const triggerDirection = this.safeString(order, 'triggerDirection');
3693
3693
  const isAscending = (triggerDirection === '1');
3694
- const isStopOrderType2 = (stopPrice !== undefined) && reduceOnly;
3694
+ const isStopOrderType2 = (triggerPrice !== undefined) && reduceOnly;
3695
3695
  if ((stopLossPrice === undefined) && isStopOrderType2) {
3696
3696
  // check if order is stop order type 2 - stopLossPrice
3697
3697
  if (isAscending && (side === 'buy')) {
3698
3698
  // stopLoss order against short position
3699
- stopLossPrice = stopPrice;
3699
+ stopLossPrice = triggerPrice;
3700
3700
  }
3701
3701
  if (!isAscending && (side === 'sell')) {
3702
3702
  // stopLoss order against a long position
3703
- stopLossPrice = stopPrice;
3703
+ stopLossPrice = triggerPrice;
3704
3704
  }
3705
3705
  }
3706
3706
  if ((takeProfitPrice === undefined) && isStopOrderType2) {
3707
3707
  // check if order is stop order type 2 - takeProfitPrice
3708
3708
  if (isAscending && (side === 'sell')) {
3709
3709
  // takeprofit order against a long position
3710
- takeProfitPrice = stopPrice;
3710
+ takeProfitPrice = triggerPrice;
3711
3711
  }
3712
3712
  if (!isAscending && (side === 'buy')) {
3713
3713
  // takeprofit order against a short position
3714
- takeProfitPrice = stopPrice;
3714
+ takeProfitPrice = triggerPrice;
3715
3715
  }
3716
3716
  }
3717
3717
  return this.safeOrder({
@@ -3729,8 +3729,7 @@ export default class bybit extends Exchange {
3729
3729
  'reduceOnly': this.safeBool(order, 'reduceOnly'),
3730
3730
  'side': side,
3731
3731
  'price': price,
3732
- 'stopPrice': stopPrice,
3733
- 'triggerPrice': stopPrice,
3732
+ 'triggerPrice': triggerPrice,
3734
3733
  'takeProfitPrice': takeProfitPrice,
3735
3734
  'stopLossPrice': stopLossPrice,
3736
3735
  'amount': amount,
@@ -5738,7 +5737,7 @@ export default class bybit extends Exchange {
5738
5737
  * @param {object} [params] extra parameters specific to the exchange API endpoint
5739
5738
  * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
5740
5739
  * @param {string} [params.subType] if inverse will use v5/account/contract-transaction-log
5741
- * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
5740
+ * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
5742
5741
  */
5743
5742
  async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
5744
5743
  await this.loadMarkets();
@@ -6758,7 +6757,7 @@ export default class bybit extends Exchange {
6758
6757
  const data = this.addPaginationCursorToResult(response);
6759
6758
  const id = this.safeString(result, 'symbol');
6760
6759
  market = this.safeMarket(id, market, undefined, 'contract');
6761
- return this.parseOpenInterests(data, market, since, limit);
6760
+ return this.parseOpenInterestsHistory(data, market, since, limit);
6762
6761
  }
6763
6762
  /**
6764
6763
  * @method
@@ -8132,7 +8131,7 @@ export default class bybit extends Exchange {
8132
8131
  }
8133
8132
  symbol = market['symbol'];
8134
8133
  }
8135
- const data = await this.getLeverageTiersPaginated(symbol, this.extend({ 'paginate': true, 'paginationCalls': 20 }, params));
8134
+ const data = await this.getLeverageTiersPaginated(symbol, this.extend({ 'paginate': true, 'paginationCalls': 40 }, params));
8136
8135
  symbols = this.marketSymbols(symbols);
8137
8136
  return this.parseLeverageTiers(data, symbols, 'symbol');
8138
8137
  }
package/js/src/cex.d.ts CHANGED
@@ -229,7 +229,7 @@ export default class cex extends Exchange {
229
229
  * @param {int} [limit] max number of ledger entries to return
230
230
  * @param {object} [params] extra parameters specific to the exchange API endpoint
231
231
  * @param {int} [params.until] timestamp in ms of the latest ledger entry
232
- * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
232
+ * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
233
233
  */
234
234
  fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<LedgerEntry[]>;
235
235
  parseLedgerEntry(item: Dict, currency?: Currency): LedgerEntry;
package/js/src/cex.js CHANGED
@@ -1264,7 +1264,7 @@ export default class cex extends Exchange {
1264
1264
  * @param {int} [limit] max number of ledger entries to return
1265
1265
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1266
1266
  * @param {int} [params.until] timestamp in ms of the latest ledger entry
1267
- * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
1267
+ * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
1268
1268
  */
1269
1269
  async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
1270
1270
  await this.loadMarkets();
@@ -210,7 +210,7 @@ export default class coinbase extends Exchange {
210
210
  * @param {int} [limit] max number of ledger entries to return, default is undefined
211
211
  * @param {object} [params] extra parameters specific to the exchange API endpoint
212
212
  * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
213
- * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
213
+ * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
214
214
  */
215
215
  fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<LedgerEntry[]>;
216
216
  parseLedgerEntryStatus(status: any): string;
@@ -377,6 +377,82 @@ export default class coinbase extends Exchange {
377
377
  'fetchTime': 'v2PublicGetTime',
378
378
  'user_native_currency': 'USD', // needed to get fees for v3
379
379
  },
380
+ 'features': {
381
+ 'spot': {
382
+ 'sandbox': false,
383
+ 'createOrder': {
384
+ 'marginMode': true,
385
+ 'triggerPrice': true,
386
+ 'triggerPriceType': undefined,
387
+ 'triggerDirection': true,
388
+ 'stopLossPrice': true,
389
+ 'takeProfitPrice': true,
390
+ 'attachedStopLossTakeProfit': undefined,
391
+ 'timeInForce': {
392
+ 'IOC': true,
393
+ 'FOK': true,
394
+ 'PO': true,
395
+ 'GTD': true,
396
+ },
397
+ 'hedged': false,
398
+ 'trailing': false,
399
+ },
400
+ 'createOrders': undefined,
401
+ 'fetchMyTrades': {
402
+ 'marginMode': false,
403
+ 'limit': 3000,
404
+ 'daysBack': undefined,
405
+ 'untilDays': 10000,
406
+ },
407
+ 'fetchOrder': {
408
+ 'marginMode': false,
409
+ 'trigger': false,
410
+ 'trailing': false,
411
+ },
412
+ 'fetchOpenOrders': {
413
+ 'marginMode': false,
414
+ 'limit': undefined,
415
+ 'trigger': false,
416
+ 'trailing': false,
417
+ },
418
+ 'fetchOrders': {
419
+ 'marginMode': false,
420
+ 'limit': undefined,
421
+ 'daysBack': undefined,
422
+ 'untilDays': 10000,
423
+ 'trigger': false,
424
+ 'trailing': false,
425
+ },
426
+ 'fetchClosedOrders': {
427
+ 'marginMode': false,
428
+ 'limit': undefined,
429
+ 'daysBackClosed': undefined,
430
+ 'daysBackCanceled': undefined,
431
+ 'untilDays': 10000,
432
+ 'trigger': false,
433
+ 'trailing': false,
434
+ },
435
+ 'fetchOHLCV': {
436
+ 'limit': 350,
437
+ },
438
+ },
439
+ 'swap': {
440
+ 'linear': {
441
+ 'extends': 'spot',
442
+ },
443
+ 'inverse': {
444
+ 'extends': 'spot',
445
+ },
446
+ },
447
+ 'future': {
448
+ 'linear': {
449
+ 'extends': 'spot',
450
+ },
451
+ 'inverse': {
452
+ 'extends': 'spot',
453
+ },
454
+ },
455
+ },
380
456
  });
381
457
  }
382
458
  /**
@@ -2353,7 +2429,7 @@ export default class coinbase extends Exchange {
2353
2429
  * @param {int} [limit] max number of ledger entries to return, default is undefined
2354
2430
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2355
2431
  * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
2356
- * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
2432
+ * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
2357
2433
  */
2358
2434
  async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
2359
2435
  await this.loadMarkets();
@@ -268,7 +268,7 @@ export default class coinbaseexchange extends Exchange {
268
268
  * @param {int} [limit] max number of ledger entries to return, default is undefined
269
269
  * @param {object} [params] extra parameters specific to the exchange API endpoint
270
270
  * @param {int} [params.until] the latest time in ms to fetch trades for
271
- * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
271
+ * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
272
272
  */
273
273
  fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<LedgerEntry[]>;
274
274
  /**
@@ -1504,7 +1504,7 @@ export default class coinbaseexchange extends Exchange {
1504
1504
  * @param {int} [limit] max number of ledger entries to return, default is undefined
1505
1505
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1506
1506
  * @param {int} [params.until] the latest time in ms to fetch trades for
1507
- * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
1507
+ * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
1508
1508
  */
1509
1509
  async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
1510
1510
  // https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getaccountledger
@@ -258,6 +258,68 @@ export default class coinbaseinternational extends Exchange {
258
258
  'bitcoin': 'BTC',
259
259
  },
260
260
  },
261
+ 'features': {
262
+ 'spot': {
263
+ 'sandbox': true,
264
+ 'createOrder': {
265
+ 'marginMode': false,
266
+ 'triggerPrice': true,
267
+ 'triggerPriceType': undefined,
268
+ 'triggerDirection': true,
269
+ 'stopLossPrice': false,
270
+ 'takeProfitPrice': false,
271
+ 'attachedStopLossTakeProfit': undefined,
272
+ 'timeInForce': {
273
+ 'IOC': true,
274
+ 'FOK': true,
275
+ 'PO': true,
276
+ 'GTD': true,
277
+ 'GTC': true, // has 30 days max
278
+ },
279
+ 'hedged': false,
280
+ 'trailing': false,
281
+ },
282
+ 'createOrders': undefined,
283
+ 'fetchMyTrades': {
284
+ 'marginMode': false,
285
+ 'limit': 100,
286
+ 'daysBack': undefined,
287
+ 'untilDays': 10000,
288
+ },
289
+ 'fetchOrder': {
290
+ 'marginMode': false,
291
+ 'trigger': false,
292
+ 'trailing': false,
293
+ },
294
+ 'fetchOpenOrders': {
295
+ 'marginMode': false,
296
+ 'limit': 100,
297
+ 'trigger': false,
298
+ 'trailing': false,
299
+ },
300
+ 'fetchOrders': undefined,
301
+ 'fetchClosedOrders': undefined,
302
+ 'fetchOHLCV': {
303
+ 'limit': 300,
304
+ },
305
+ },
306
+ 'swap': {
307
+ 'linear': {
308
+ 'extends': 'spot',
309
+ },
310
+ 'inverse': {
311
+ 'extends': 'spot',
312
+ },
313
+ },
314
+ 'future': {
315
+ 'linear': {
316
+ 'extends': 'spot',
317
+ },
318
+ 'inverse': {
319
+ 'extends': 'spot',
320
+ },
321
+ },
322
+ },
261
323
  });
262
324
  }
263
325
  async handlePortfolioAndParams(methodName, params = {}) {
@@ -761,7 +761,7 @@ export default class coincatch extends Exchange {
761
761
  * @param {string} [params.business] *swap only*
762
762
  * @param {string} [params.lastEndId] *swap only*
763
763
  * @param {bool} [params.next] *swap only*
764
- * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
764
+ * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
765
765
  */
766
766
  fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<LedgerEntry[]>;
767
767
  parseLedgerEntry(item: Dict, currency?: Currency): LedgerEntry;
@@ -5079,7 +5079,7 @@ export default class coincatch extends Exchange {
5079
5079
  * @param {string} [params.business] *swap only*
5080
5080
  * @param {string} [params.lastEndId] *swap only*
5081
5081
  * @param {bool} [params.next] *swap only*
5082
- * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
5082
+ * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
5083
5083
  */
5084
5084
  async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
5085
5085
  const methodName = 'fetchLedger';
package/js/src/coinex.js CHANGED
@@ -2632,21 +2632,21 @@ export default class coinex extends Exchange {
2632
2632
  const request = {
2633
2633
  'market': market['id'],
2634
2634
  };
2635
- const stop = this.safeBool2(params, 'stop', 'trigger');
2635
+ const trigger = this.safeBool2(params, 'stop', 'trigger');
2636
2636
  params = this.omit(params, ['stop', 'trigger']);
2637
2637
  let response = undefined;
2638
2638
  const requestIds = [];
2639
2639
  for (let i = 0; i < ids.length; i++) {
2640
2640
  requestIds.push(parseInt(ids[i]));
2641
2641
  }
2642
- if (stop) {
2642
+ if (trigger) {
2643
2643
  request['stop_ids'] = requestIds;
2644
2644
  }
2645
2645
  else {
2646
2646
  request['order_ids'] = requestIds;
2647
2647
  }
2648
2648
  if (market['spot']) {
2649
- if (stop) {
2649
+ if (trigger) {
2650
2650
  response = await this.v2PrivatePostSpotCancelBatchStopOrder(this.extend(request, params));
2651
2651
  //
2652
2652
  // {
@@ -2718,7 +2718,7 @@ export default class coinex extends Exchange {
2718
2718
  }
2719
2719
  else {
2720
2720
  request['market_type'] = 'FUTURES';
2721
- if (stop) {
2721
+ if (trigger) {
2722
2722
  response = await this.v2PrivatePostFuturesCancelBatchStopOrder(this.extend(request, params));
2723
2723
  //
2724
2724
  // {
@@ -3414,7 +3414,7 @@ export default class coinex extends Exchange {
3414
3414
  if (limit !== undefined) {
3415
3415
  request['limit'] = limit;
3416
3416
  }
3417
- const stop = this.safeBool2(params, 'stop', 'trigger');
3417
+ const trigger = this.safeBool2(params, 'stop', 'trigger');
3418
3418
  params = this.omit(params, ['stop', 'trigger']);
3419
3419
  let marketType = undefined;
3420
3420
  [marketType, params] = this.handleMarketTypeAndParams('fetchOrdersByStatus', market, params);
@@ -3424,7 +3424,7 @@ export default class coinex extends Exchange {
3424
3424
  if (marketType === 'swap') {
3425
3425
  request['market_type'] = 'FUTURES';
3426
3426
  if (isClosed) {
3427
- if (stop) {
3427
+ if (trigger) {
3428
3428
  response = await this.v2PrivateGetFuturesFinishedStopOrder(this.extend(request, params));
3429
3429
  //
3430
3430
  // {
@@ -3488,7 +3488,7 @@ export default class coinex extends Exchange {
3488
3488
  }
3489
3489
  }
3490
3490
  else if (isOpen) {
3491
- if (stop) {
3491
+ if (trigger) {
3492
3492
  response = await this.v2PrivateGetFuturesPendingStopOrder(this.extend(request, params));
3493
3493
  //
3494
3494
  // {
@@ -3567,7 +3567,7 @@ export default class coinex extends Exchange {
3567
3567
  request['market_type'] = 'SPOT';
3568
3568
  }
3569
3569
  if (isClosed) {
3570
- if (stop) {
3570
+ if (trigger) {
3571
3571
  response = await this.v2PrivateGetSpotFinishedStopOrder(this.extend(request, params));
3572
3572
  //
3573
3573
  // {
@@ -3634,7 +3634,7 @@ export default class coinex extends Exchange {
3634
3634
  }
3635
3635
  }
3636
3636
  else if (status === 'pending') {
3637
- if (stop) {
3637
+ if (trigger) {
3638
3638
  response = await this.v2PrivateGetSpotPendingStopOrder(this.extend(request, params));
3639
3639
  //
3640
3640
  // {
@@ -358,7 +358,7 @@ export default class coinlist extends Exchange {
358
358
  * @param {int} [limit] max number of ledger entries to return (default 200, max 500)
359
359
  * @param {object} [params] extra parameters specific to the exchange API endpoint
360
360
  * @param {int} [params.until] the latest time in ms to fetch entries for
361
- * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
361
+ * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
362
362
  */
363
363
  fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<LedgerEntry[]>;
364
364
  parseLedgerEntry(item: Dict, currency?: Currency): LedgerEntry;
@@ -2094,7 +2094,7 @@ export default class coinlist extends Exchange {
2094
2094
  * @param {int} [limit] max number of ledger entries to return (default 200, max 500)
2095
2095
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2096
2096
  * @param {int} [params.until] the latest time in ms to fetch entries for
2097
- * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
2097
+ * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
2098
2098
  */
2099
2099
  async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
2100
2100
  const traderId = this.safeString2(params, 'trader_id', 'traderId');
@@ -120,7 +120,7 @@ export default class coinmetro extends Exchange {
120
120
  * @param {int} [limit] max number of ledger entries to return (default 200, max 500)
121
121
  * @param {object} [params] extra parameters specific to the exchange API endpoint
122
122
  * @param {int} [params.until] the latest time in ms to fetch entries for
123
- * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
123
+ * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
124
124
  */
125
125
  fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<LedgerEntry[]>;
126
126
  parseLedgerEntry(item: Dict, currency?: Currency): LedgerEntry;
@@ -993,7 +993,7 @@ export default class coinmetro extends Exchange {
993
993
  * @param {int} [limit] max number of ledger entries to return (default 200, max 500)
994
994
  * @param {object} [params] extra parameters specific to the exchange API endpoint
995
995
  * @param {int} [params.until] the latest time in ms to fetch entries for
996
- * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
996
+ * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
997
997
  */
998
998
  async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
999
999
  await this.loadMarkets();
@@ -125,7 +125,7 @@ export default class cryptocom extends Exchange {
125
125
  * @param {object} [params] extra parameters specific to the exchange API endpoint
126
126
  * @param {string} [params.timeInForce] 'GTC', 'IOC', 'FOK' or 'PO'
127
127
  * @param {string} [params.ref_price_type] 'MARK_PRICE', 'INDEX_PRICE', 'LAST_PRICE' which trigger price type to use, default is MARK_PRICE
128
- * @param {float} [params.triggerPrice] price to trigger a stop order
128
+ * @param {float} [params.triggerPrice] price to trigger a trigger order
129
129
  * @param {float} [params.stopLossPrice] price to trigger a stop-loss trigger order
130
130
  * @param {float} [params.takeProfitPrice] price to trigger a take-profit trigger order
131
131
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -302,7 +302,7 @@ export default class cryptocom extends Exchange {
302
302
  * @param {int} [limit] max number of ledger entries to return
303
303
  * @param {object} [params] extra parameters specific to the exchange API endpoint
304
304
  * @param {int} [params.until] timestamp in ms for the ending date filter, default is the current time
305
- * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
305
+ * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
306
306
  */
307
307
  fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<LedgerEntry[]>;
308
308
  parseLedgerEntry(item: Dict, currency?: Currency): LedgerEntry;