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
package/js/src/mexc.js CHANGED
@@ -677,6 +677,143 @@ export default class mexc extends Exchange {
677
677
  'maxTimeTillEnd': 90 * 86400 * 1000 - 1,
678
678
  'broker': 'CCXT',
679
679
  },
680
+ 'features': {
681
+ 'default': {
682
+ 'sandbox': false,
683
+ 'createOrder': {
684
+ 'marginMode': true,
685
+ 'triggerPrice': false,
686
+ 'triggerDirection': false,
687
+ 'triggerPriceType': {
688
+ 'last': false,
689
+ 'mark': false,
690
+ 'index': false,
691
+ },
692
+ 'stopLossPrice': false,
693
+ 'takeProfitPrice': false,
694
+ 'attachedStopLossTakeProfit': undefined,
695
+ 'timeInForce': {
696
+ 'IOC': true,
697
+ 'FOK': true,
698
+ 'PO': true,
699
+ 'GTD': false,
700
+ },
701
+ 'hedged': false,
702
+ // exchange-supported features
703
+ 'selfTradePrevention': false,
704
+ 'trailing': false,
705
+ 'iceberg': false,
706
+ },
707
+ 'createOrders': {
708
+ 'max': 20,
709
+ },
710
+ 'fetchMyTrades': {
711
+ 'marginMode': false,
712
+ 'limit': 100,
713
+ 'daysBack': 30,
714
+ 'untilDays': undefined,
715
+ },
716
+ 'fetchOrder': {
717
+ 'marginMode': false,
718
+ 'trigger': false,
719
+ 'trailing': false,
720
+ },
721
+ 'fetchOpenOrders': {
722
+ 'marginMode': true,
723
+ 'limit': undefined,
724
+ 'trigger': false,
725
+ 'trailing': false,
726
+ },
727
+ 'fetchOrders': {
728
+ 'marginMode': true,
729
+ 'limit': 1000,
730
+ 'daysBack': 7,
731
+ 'untilDays': 7,
732
+ 'trigger': false,
733
+ 'trailing': false,
734
+ },
735
+ 'fetchClosedOrders': {
736
+ 'marginMode': true,
737
+ 'limit': 1000,
738
+ 'daysBackClosed': 7,
739
+ 'daysBackCanceled': 7,
740
+ 'untilDays': 7,
741
+ 'trigger': false,
742
+ 'trailing': false,
743
+ },
744
+ 'fetchOHLCV': {
745
+ 'limit': 1000,
746
+ },
747
+ },
748
+ 'spot': {
749
+ 'extends': 'default',
750
+ },
751
+ 'forDerivs': {
752
+ 'extends': 'default',
753
+ 'createOrder': {
754
+ 'triggerPrice': true,
755
+ 'triggerPriceType': {
756
+ 'last': true,
757
+ 'mark': true,
758
+ 'index': true,
759
+ },
760
+ 'triggerDirection': true,
761
+ 'stopLossPrice': false,
762
+ 'takeProfitPrice': false,
763
+ 'hedged': true,
764
+ },
765
+ 'createOrders': {
766
+ 'max': 50,
767
+ },
768
+ 'fetchMyTrades': {
769
+ 'marginMode': false,
770
+ 'limit': 100,
771
+ 'daysBack': 90,
772
+ 'untilDays': 90,
773
+ },
774
+ 'fetchOrder': {
775
+ 'marginMode': false,
776
+ },
777
+ 'fetchOpenOrders': {
778
+ 'marginMode': false,
779
+ 'limit': 100,
780
+ 'trigger': true,
781
+ 'trailing': false,
782
+ },
783
+ 'fetchOrders': {
784
+ 'marginMode': false,
785
+ 'limit': 100,
786
+ 'daysBack': 90,
787
+ 'untilDays': 90,
788
+ 'trigger': true,
789
+ 'trailing': false,
790
+ },
791
+ 'fetchClosedOrders': {
792
+ 'marginMode': false,
793
+ 'limit': 100,
794
+ 'daysBackClosed': 90,
795
+ 'daysBackCanceled': undefined,
796
+ 'untilDays': 90,
797
+ 'trigger': true,
798
+ 'trailing': false,
799
+ },
800
+ 'fetchOHLCV': {
801
+ 'limit': 2000,
802
+ },
803
+ },
804
+ 'swap': {
805
+ 'linear': {
806
+ 'extends': 'forDerivs',
807
+ },
808
+ 'inverse': {
809
+ 'extends': 'forDerivs',
810
+ },
811
+ },
812
+ 'future': {
813
+ 'linear': undefined,
814
+ 'inverse': undefined,
815
+ },
816
+ },
680
817
  'commonCurrencies': {
681
818
  'BEYONDPROTOCOL': 'BEYOND',
682
819
  'BIFI': 'BIFIF',
@@ -2238,7 +2375,6 @@ export default class mexc extends Exchange {
2238
2375
  * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
2239
2376
  * @param {string} [marginMode] only 'isolated' is supported for spot-margin trading
2240
2377
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2241
- * @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
2242
2378
  * @param {bool} [params.postOnly] if true, the order will only be posted if it will be a maker order
2243
2379
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2244
2380
  */
@@ -2287,7 +2423,7 @@ export default class mexc extends Exchange {
2287
2423
  /**
2288
2424
  * @ignore
2289
2425
  * @method
2290
- * @name mexc#createOrder
2426
+ * @name mexc#createSwapOrder
2291
2427
  * @description create a trade order
2292
2428
  * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#new-order
2293
2429
  * @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#order-under-maintenance
package/js/src/ndax.d.ts CHANGED
@@ -113,7 +113,7 @@ export default class ndax extends Exchange {
113
113
  * @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
114
114
  * @param {int} [limit] max number of ledger entries to return, default is undefined
115
115
  * @param {object} [params] extra parameters specific to the exchange API endpoint
116
- * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
116
+ * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
117
117
  */
118
118
  fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<LedgerEntry[]>;
119
119
  parseOrderStatus(status: Str): string;
package/js/src/ndax.js CHANGED
@@ -1221,7 +1221,7 @@ export default class ndax extends Exchange {
1221
1221
  * @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
1222
1222
  * @param {int} [limit] max number of ledger entries to return, default is undefined
1223
1223
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1224
- * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
1224
+ * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
1225
1225
  */
1226
1226
  async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
1227
1227
  const omsId = this.safeInteger(this.options, 'omsId', 1);
@@ -155,7 +155,7 @@ export default class okcoin extends Exchange {
155
155
  * @param {string} id order id
156
156
  * @param {string} symbol unified symbol of the market the order was made in
157
157
  * @param {object} [params] extra parameters specific to the exchange API endpoint
158
- * @param {bool} [params.stop] True if cancel trigger or conditional orders
158
+ * @param {bool} [params.trigger] True if cancel trigger or conditional orders
159
159
  * @param {bool} [params.advanced] True if canceling advanced orders only
160
160
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
161
161
  */
@@ -198,7 +198,7 @@ export default class okcoin extends Exchange {
198
198
  * @param {int} [since] the earliest time in ms to fetch open orders for
199
199
  * @param {int} [limit] the maximum number of open orders structures to retrieve
200
200
  * @param {object} [params] extra parameters specific to the exchange API endpoint
201
- * @param {bool} [params.stop] True if fetching trigger or conditional orders
201
+ * @param {bool} [params.trigger] True if fetching trigger or conditional orders
202
202
  * @param {string} [params.ordType] "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"
203
203
  * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
204
204
  */
@@ -214,7 +214,7 @@ export default class okcoin extends Exchange {
214
214
  * @param {int} [since] the earliest time in ms to fetch orders for
215
215
  * @param {int} [limit] the maximum number of order structures to retrieve
216
216
  * @param {object} [params] extra parameters specific to the exchange API endpoint
217
- * @param {bool} [params.stop] True if fetching trigger or conditional orders
217
+ * @param {bool} [params.trigger] True if fetching trigger or conditional orders
218
218
  * @param {string} [params.ordType] "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"
219
219
  * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
220
220
  */
@@ -330,7 +330,7 @@ export default class okcoin extends Exchange {
330
330
  * @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
331
331
  * @param {int} [limit] max number of ledger entries to return, default is undefined
332
332
  * @param {object} [params] extra parameters specific to the exchange API endpoint
333
- * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
333
+ * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
334
334
  */
335
335
  fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<LedgerEntry[]>;
336
336
  parseLedgerEntryType(type: any): string;
package/js/src/okcoin.js CHANGED
@@ -1638,7 +1638,7 @@ export default class okcoin extends Exchange {
1638
1638
  * @param {string} id order id
1639
1639
  * @param {string} symbol unified symbol of the market the order was made in
1640
1640
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1641
- * @param {bool} [params.stop] True if cancel trigger or conditional orders
1641
+ * @param {bool} [params.trigger] True if cancel trigger or conditional orders
1642
1642
  * @param {bool} [params.advanced] True if canceling advanced orders only
1643
1643
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
1644
1644
  */
@@ -1647,9 +1647,9 @@ export default class okcoin extends Exchange {
1647
1647
  throw new ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
1648
1648
  }
1649
1649
  await this.loadMarkets();
1650
- const stop = this.safeValue2(params, 'stop', 'trigger');
1650
+ const trigger = this.safeValue2(params, 'stop', 'trigger');
1651
1651
  const advanced = this.safeValue(params, 'advanced');
1652
- if (stop || advanced) {
1652
+ if (trigger || advanced) {
1653
1653
  const orderInner = await this.cancelOrders([id], symbol, params);
1654
1654
  return this.safeValue(orderInner, 0);
1655
1655
  }
@@ -1705,7 +1705,7 @@ export default class okcoin extends Exchange {
1705
1705
  throw new ArgumentsRequired(this.id + ' cancelOrders() requires a symbol argument');
1706
1706
  }
1707
1707
  await this.loadMarkets();
1708
- const stop = this.safeValue2(params, 'stop', 'trigger');
1708
+ const trigger = this.safeValue2(params, 'stop', 'trigger');
1709
1709
  const advanced = this.safeValue(params, 'advanced');
1710
1710
  params = this.omit(params, ['stop', 'trigger', 'advanced']);
1711
1711
  const market = this.market(symbol);
@@ -1723,7 +1723,7 @@ export default class okcoin extends Exchange {
1723
1723
  }
1724
1724
  }
1725
1725
  for (let i = 0; i < ids.length; i++) {
1726
- if (stop || advanced) {
1726
+ if (trigger || advanced) {
1727
1727
  request.push({
1728
1728
  'algoId': ids[i],
1729
1729
  'instId': market['id'],
@@ -1746,7 +1746,7 @@ export default class okcoin extends Exchange {
1746
1746
  }
1747
1747
  }
1748
1748
  let response = undefined;
1749
- if (stop) {
1749
+ if (trigger) {
1750
1750
  response = await this.privatePostTradeCancelAlgos(request);
1751
1751
  }
1752
1752
  else if (advanced) {
@@ -2006,8 +2006,8 @@ export default class okcoin extends Exchange {
2006
2006
  // 'ordId': id,
2007
2007
  };
2008
2008
  const clientOrderId = this.safeString2(params, 'clOrdId', 'clientOrderId');
2009
- const stop = this.safeValue2(params, 'stop', 'trigger');
2010
- if (stop) {
2009
+ const trigger = this.safeValue2(params, 'stop', 'trigger');
2010
+ if (trigger) {
2011
2011
  if (clientOrderId !== undefined) {
2012
2012
  request['algoClOrdId'] = clientOrderId;
2013
2013
  }
@@ -2025,7 +2025,7 @@ export default class okcoin extends Exchange {
2025
2025
  }
2026
2026
  const query = this.omit(params, ['clientOrderId', 'stop', 'trigger']);
2027
2027
  let response = undefined;
2028
- if (stop) {
2028
+ if (trigger) {
2029
2029
  response = await this.privateGetTradeOrderAlgo(this.extend(request, query));
2030
2030
  }
2031
2031
  else {
@@ -2045,7 +2045,7 @@ export default class okcoin extends Exchange {
2045
2045
  * @param {int} [since] the earliest time in ms to fetch open orders for
2046
2046
  * @param {int} [limit] the maximum number of open orders structures to retrieve
2047
2047
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2048
- * @param {bool} [params.stop] True if fetching trigger or conditional orders
2048
+ * @param {bool} [params.trigger] True if fetching trigger or conditional orders
2049
2049
  * @param {string} [params.ordType] "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"
2050
2050
  * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
2051
2051
  */
@@ -2068,13 +2068,13 @@ export default class okcoin extends Exchange {
2068
2068
  request['limit'] = limit; // default 100, max 100
2069
2069
  }
2070
2070
  const ordType = this.safeString(params, 'ordType');
2071
- const stop = this.safeValue(params, 'stop') || (this.safeString(params, 'ordType') !== undefined);
2072
- if (stop && (ordType === undefined)) {
2071
+ const trigger = this.safeValue(params, 'stop') || (this.safeString(params, 'ordType') !== undefined);
2072
+ if (trigger && (ordType === undefined)) {
2073
2073
  request['ordType'] = 'trigger'; // default to trigger
2074
2074
  }
2075
2075
  params = this.omit(params, ['stop']);
2076
2076
  let response = undefined;
2077
- if (stop) {
2077
+ if (trigger) {
2078
2078
  response = await this.privateGetTradeOrdersAlgoPending(this.extend(request, params));
2079
2079
  }
2080
2080
  else {
@@ -2094,7 +2094,7 @@ export default class okcoin extends Exchange {
2094
2094
  * @param {int} [since] the earliest time in ms to fetch orders for
2095
2095
  * @param {int} [limit] the maximum number of order structures to retrieve
2096
2096
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2097
- * @param {bool} [params.stop] True if fetching trigger or conditional orders
2097
+ * @param {bool} [params.trigger] True if fetching trigger or conditional orders
2098
2098
  * @param {string} [params.ordType] "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"
2099
2099
  * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
2100
2100
  */
@@ -2109,13 +2109,13 @@ export default class okcoin extends Exchange {
2109
2109
  request['instId'] = market['id'];
2110
2110
  }
2111
2111
  const ordType = this.safeString(params, 'ordType');
2112
- const stop = this.safeValue(params, 'stop') || (this.safeString(params, 'ordType') !== undefined);
2113
- if (stop && (ordType === undefined)) {
2112
+ const trigger = this.safeValue(params, 'stop') || (this.safeString(params, 'ordType') !== undefined);
2113
+ if (trigger && (ordType === undefined)) {
2114
2114
  request['ordType'] = 'trigger'; // default to trigger
2115
2115
  }
2116
2116
  params = this.omit(params, ['stop']);
2117
2117
  let response = undefined;
2118
- if (stop) {
2118
+ if (trigger) {
2119
2119
  response = await this.privateGetTradeOrdersAlgoHistory(this.extend(request, params));
2120
2120
  }
2121
2121
  else {
@@ -2874,7 +2874,7 @@ export default class okcoin extends Exchange {
2874
2874
  * @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
2875
2875
  * @param {int} [limit] max number of ledger entries to return, default is undefined
2876
2876
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2877
- * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
2877
+ * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
2878
2878
  */
2879
2879
  async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
2880
2880
  await this.loadMarkets();
package/js/src/okx.d.ts CHANGED
@@ -359,7 +359,7 @@ export default class okx extends Exchange {
359
359
  * @param {int} [since] the earliest time in ms to fetch open orders for
360
360
  * @param {int} [limit] the maximum number of open orders structures to retrieve
361
361
  * @param {object} [params] extra parameters specific to the exchange API endpoint
362
- * @param {bool} [params.stop] True if fetching trigger or conditional orders
362
+ * @param {bool} [params.trigger] True if fetching trigger or conditional orders
363
363
  * @param {string} [params.ordType] "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"
364
364
  * @param {string} [params.algoId] Algo ID "'433845797218942976'"
365
365
  * @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,7 +377,7 @@ export default class okx extends Exchange {
377
377
  * @param {int} [since] timestamp in ms of the earliest order, default is undefined
378
378
  * @param {int} [limit] max number of orders to return, default is undefined
379
379
  * @param {object} [params] extra parameters specific to the exchange API endpoint
380
- * @param {bool} [params.stop] True if fetching trigger or conditional orders
380
+ * @param {bool} [params.trigger] True if fetching trigger or conditional orders
381
381
  * @param {string} [params.ordType] "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"
382
382
  * @param {string} [params.algoId] Algo ID "'433845797218942976'"
383
383
  * @param {int} [params.until] timestamp in ms to fetch orders for
@@ -447,7 +447,7 @@ export default class okx extends Exchange {
447
447
  * @param {string} [params.marginMode] 'cross' or 'isolated'
448
448
  * @param {int} [params.until] the latest time in ms to fetch entries for
449
449
  * @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)
450
- * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
450
+ * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
451
451
  */
452
452
  fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<LedgerEntry[]>;
453
453
  parseLedgerEntryType(type: any): string;
package/js/src/okx.js CHANGED
@@ -262,6 +262,7 @@ export default class okx extends Exchange {
262
262
  'tradingBot/public/rsi-back-testing': 1,
263
263
  'asset/exchange-list': 5 / 3,
264
264
  'finance/staking-defi/eth/apy-history': 5 / 3,
265
+ 'finance/staking-defi/sol/apy-history': 5 / 3,
265
266
  'finance/savings/lending-rate-summary': 5 / 3,
266
267
  'finance/savings/lending-rate-history': 5 / 3,
267
268
  'finance/fixed-loan/lending-offers': 10 / 3,
@@ -400,6 +401,8 @@ export default class okx extends Exchange {
400
401
  'finance/staking-defi/eth/balance': 5 / 3,
401
402
  'finance/staking-defi/eth/purchase-redeem-history': 5 / 3,
402
403
  'finance/staking-defi/eth/product-info': 3,
404
+ 'finance/staking-defi/sol/balance': 5 / 3,
405
+ 'finance/staking-defi/sol/purchase-redeem-history': 5 / 3,
403
406
  // copytrading
404
407
  'copytrading/current-subpositions': 1,
405
408
  'copytrading/subpositions-history': 1,
@@ -534,6 +537,8 @@ export default class okx extends Exchange {
534
537
  // eth staking
535
538
  'finance/staking-defi/eth/purchase': 5,
536
539
  'finance/staking-defi/eth/redeem': 5,
540
+ 'finance/staking-defi/sol/purchase': 5,
541
+ 'finance/staking-defi/sol/redeem': 5,
537
542
  // copytrading
538
543
  'copytrading/algo-order': 1,
539
544
  'copytrading/close-subposition': 1,
@@ -3402,9 +3407,9 @@ export default class okx extends Exchange {
3402
3407
  if (symbol === undefined) {
3403
3408
  throw new ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
3404
3409
  }
3405
- const stop = this.safeValue2(params, 'stop', 'trigger');
3410
+ const trigger = this.safeValue2(params, 'stop', 'trigger');
3406
3411
  const trailing = this.safeBool(params, 'trailing', false);
3407
- if (stop || trailing) {
3412
+ if (trigger || trailing) {
3408
3413
  const orderInner = await this.cancelOrders([id], symbol, params);
3409
3414
  return this.safeValue(orderInner, 0);
3410
3415
  }
@@ -3470,9 +3475,9 @@ export default class okx extends Exchange {
3470
3475
  let method = this.safeString(params, 'method', defaultMethod);
3471
3476
  const clientOrderIds = this.parseIds(this.safeValue2(params, 'clOrdId', 'clientOrderId'));
3472
3477
  const algoIds = this.parseIds(this.safeValue(params, 'algoId'));
3473
- const stop = this.safeValue2(params, 'stop', 'trigger');
3478
+ const trigger = this.safeValue2(params, 'stop', 'trigger');
3474
3479
  const trailing = this.safeBool(params, 'trailing', false);
3475
- if (stop || trailing) {
3480
+ if (trigger || trailing) {
3476
3481
  method = 'privatePostTradeCancelAlgos';
3477
3482
  }
3478
3483
  if (clientOrderIds === undefined) {
@@ -3486,7 +3491,7 @@ export default class okx extends Exchange {
3486
3491
  }
3487
3492
  }
3488
3493
  for (let i = 0; i < ids.length; i++) {
3489
- if (trailing || stop) {
3494
+ if (trailing || trigger) {
3490
3495
  request.push({
3491
3496
  'algoId': ids[i],
3492
3497
  'instId': market['id'],
@@ -3565,9 +3570,9 @@ export default class okx extends Exchange {
3565
3570
  const options = this.safeDict(this.options, 'cancelOrders', {});
3566
3571
  const defaultMethod = this.safeString(options, 'method', 'privatePostTradeCancelBatchOrders');
3567
3572
  let method = this.safeString(params, 'method', defaultMethod);
3568
- const stop = this.safeBool2(params, 'stop', 'trigger');
3573
+ const trigger = this.safeBool2(params, 'stop', 'trigger');
3569
3574
  const trailing = this.safeBool(params, 'trailing', false);
3570
- const isStopOrTrailing = stop || trailing;
3575
+ const isStopOrTrailing = trigger || trailing;
3571
3576
  if (isStopOrTrailing) {
3572
3577
  method = 'privatePostTradeCancelAlgos';
3573
3578
  }
@@ -3906,8 +3911,8 @@ export default class okx extends Exchange {
3906
3911
  const options = this.safeValue(this.options, 'fetchOrder', {});
3907
3912
  const defaultMethod = this.safeString(options, 'method', 'privateGetTradeOrder');
3908
3913
  let method = this.safeString(params, 'method', defaultMethod);
3909
- const stop = this.safeValue2(params, 'stop', 'trigger');
3910
- if (stop) {
3914
+ const trigger = this.safeValue2(params, 'stop', 'trigger');
3915
+ if (trigger) {
3911
3916
  method = 'privateGetTradeOrderAlgo';
3912
3917
  if (clientOrderId !== undefined) {
3913
3918
  request['algoClOrdId'] = clientOrderId;
@@ -4042,7 +4047,7 @@ export default class okx extends Exchange {
4042
4047
  * @param {int} [since] the earliest time in ms to fetch open orders for
4043
4048
  * @param {int} [limit] the maximum number of open orders structures to retrieve
4044
4049
  * @param {object} [params] extra parameters specific to the exchange API endpoint
4045
- * @param {bool} [params.stop] True if fetching trigger or conditional orders
4050
+ * @param {bool} [params.trigger] True if fetching trigger or conditional orders
4046
4051
  * @param {string} [params.ordType] "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"
4047
4052
  * @param {string} [params.algoId] Algo ID "'433845797218942976'"
4048
4053
  * @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)
@@ -4079,15 +4084,15 @@ export default class okx extends Exchange {
4079
4084
  const defaultMethod = this.safeString(options, 'method', 'privateGetTradeOrdersPending');
4080
4085
  let method = this.safeString(params, 'method', defaultMethod);
4081
4086
  const ordType = this.safeString(params, 'ordType');
4082
- const stop = this.safeValue2(params, 'stop', 'trigger');
4087
+ const trigger = this.safeValue2(params, 'stop', 'trigger');
4083
4088
  const trailing = this.safeBool(params, 'trailing', false);
4084
- if (trailing || stop || (ordType in algoOrderTypes)) {
4089
+ if (trailing || trigger || (ordType in algoOrderTypes)) {
4085
4090
  method = 'privateGetTradeOrdersAlgoPending';
4086
4091
  }
4087
4092
  if (trailing) {
4088
4093
  request['ordType'] = 'move_order_stop';
4089
4094
  }
4090
- else if (stop && (ordType === undefined)) {
4095
+ else if (trigger && (ordType === undefined)) {
4091
4096
  request['ordType'] = 'trigger';
4092
4097
  }
4093
4098
  const query = this.omit(params, ['method', 'stop', 'trigger', 'trailing']);
@@ -4206,7 +4211,7 @@ export default class okx extends Exchange {
4206
4211
  * @param {int} [since] timestamp in ms of the earliest order, default is undefined
4207
4212
  * @param {int} [limit] max number of orders to return, default is undefined
4208
4213
  * @param {object} [params] extra parameters specific to the exchange API endpoint
4209
- * @param {bool} [params.stop] True if fetching trigger or conditional orders
4214
+ * @param {bool} [params.trigger] True if fetching trigger or conditional orders
4210
4215
  * @param {string} [params.ordType] "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"
4211
4216
  * @param {string} [params.algoId] Algo ID "'433845797218942976'"
4212
4217
  * @param {int} [params.until] timestamp in ms to fetch orders for
@@ -4244,20 +4249,20 @@ export default class okx extends Exchange {
4244
4249
  const defaultMethod = this.safeString(options, 'method', 'privateGetTradeOrdersHistory');
4245
4250
  let method = this.safeString(params, 'method', defaultMethod);
4246
4251
  const ordType = this.safeString(params, 'ordType');
4247
- const stop = this.safeValue2(params, 'stop', 'trigger');
4252
+ const trigger = this.safeValue2(params, 'stop', 'trigger');
4248
4253
  const trailing = this.safeBool(params, 'trailing', false);
4249
4254
  if (trailing) {
4250
4255
  method = 'privateGetTradeOrdersAlgoHistory';
4251
4256
  request['ordType'] = 'move_order_stop';
4252
4257
  }
4253
- else if (stop || (ordType in algoOrderTypes)) {
4258
+ else if (trigger || (ordType in algoOrderTypes)) {
4254
4259
  method = 'privateGetTradeOrdersAlgoHistory';
4255
4260
  const algoId = this.safeString(params, 'algoId');
4256
4261
  if (algoId !== undefined) {
4257
4262
  request['algoId'] = algoId;
4258
4263
  params = this.omit(params, 'algoId');
4259
4264
  }
4260
- if (stop) {
4265
+ if (trigger) {
4261
4266
  if (ordType === undefined) {
4262
4267
  throw new ArgumentsRequired(this.id + ' fetchCanceledOrders() requires an "ordType" string parameter, "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"');
4263
4268
  }
@@ -4438,16 +4443,16 @@ export default class okx extends Exchange {
4438
4443
  const defaultMethod = this.safeString(options, 'method', 'privateGetTradeOrdersHistory');
4439
4444
  let method = this.safeString(params, 'method', defaultMethod);
4440
4445
  const ordType = this.safeString(params, 'ordType');
4441
- const stop = this.safeBool2(params, 'stop', 'trigger');
4446
+ const trigger = this.safeBool2(params, 'stop', 'trigger');
4442
4447
  const trailing = this.safeBool(params, 'trailing', false);
4443
- if (trailing || stop || (ordType in algoOrderTypes)) {
4448
+ if (trailing || trigger || (ordType in algoOrderTypes)) {
4444
4449
  method = 'privateGetTradeOrdersAlgoHistory';
4445
4450
  request['state'] = 'effective';
4446
4451
  }
4447
4452
  if (trailing) {
4448
4453
  request['ordType'] = 'move_order_stop';
4449
4454
  }
4450
- else if (stop) {
4455
+ else if (trigger) {
4451
4456
  if (ordType === undefined) {
4452
4457
  request['ordType'] = 'trigger';
4453
4458
  }
@@ -4680,7 +4685,7 @@ export default class okx extends Exchange {
4680
4685
  * @param {string} [params.marginMode] 'cross' or 'isolated'
4681
4686
  * @param {int} [params.until] the latest time in ms to fetch entries for
4682
4687
  * @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)
4683
- * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
4688
+ * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
4684
4689
  */
4685
4690
  async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
4686
4691
  await this.loadMarkets();
@@ -7398,7 +7403,7 @@ export default class okx extends Exchange {
7398
7403
  // }
7399
7404
  //
7400
7405
  const data = this.safeList(response, 'data', []);
7401
- return this.parseOpenInterests(data, undefined, since, limit);
7406
+ return this.parseOpenInterestsHistory(data, undefined, since, limit);
7402
7407
  }
7403
7408
  parseOpenInterest(interest, market = undefined) {
7404
7409
  //
package/js/src/phemex.js CHANGED
@@ -2965,15 +2965,15 @@ export default class phemex extends Exchange {
2965
2965
  }
2966
2966
  await this.loadMarkets();
2967
2967
  const market = this.market(symbol);
2968
- const stop = this.safeValue2(params, 'stop', 'trigger', false);
2969
- params = this.omit(params, 'stop', 'trigger');
2968
+ const trigger = this.safeValue2(params, 'stop', 'trigger', false);
2969
+ params = this.omit(params, ['stop', 'trigger']);
2970
2970
  const request = {
2971
2971
  'symbol': market['id'],
2972
2972
  // 'untriggerred': false, // false to cancel non-conditional orders, true to cancel conditional orders
2973
2973
  // 'text': 'up to 40 characters max',
2974
2974
  };
2975
- if (stop) {
2976
- request['untriggerred'] = stop;
2975
+ if (trigger) {
2976
+ request['untriggerred'] = trigger;
2977
2977
  }
2978
2978
  let response = undefined;
2979
2979
  if (market['settle'] === 'USDT') {
@@ -4147,19 +4147,23 @@ export default class phemex extends Exchange {
4147
4147
  const marketId = this.safeString(contract, 'symbol');
4148
4148
  const symbol = this.safeSymbol(marketId, market);
4149
4149
  const timestamp = this.safeIntegerProduct(contract, 'timestamp', 0.000001);
4150
+ const markEp = this.fromEp(this.safeString(contract, 'markEp'), market);
4151
+ const indexEp = this.fromEp(this.safeString(contract, 'indexEp'), market);
4152
+ const fundingRateEr = this.fromEr(this.safeString(contract, 'fundingRateEr'), market);
4153
+ const nextFundingRateEr = this.fromEr(this.safeString(contract, 'predFundingRateEr'), market);
4150
4154
  return {
4151
4155
  'info': contract,
4152
4156
  'symbol': symbol,
4153
- 'markPrice': this.fromEp(this.safeString2(contract, 'markEp', 'markPriceRp'), market),
4154
- 'indexPrice': this.fromEp(this.safeString2(contract, 'indexEp', 'indexPriceRp'), market),
4157
+ 'markPrice': this.safeNumber(contract, 'markPriceRp', markEp),
4158
+ 'indexPrice': this.safeNumber(contract, 'indexPriceRp', indexEp),
4155
4159
  'interestRate': undefined,
4156
4160
  'estimatedSettlePrice': undefined,
4157
4161
  'timestamp': timestamp,
4158
4162
  'datetime': this.iso8601(timestamp),
4159
- 'fundingRate': this.fromEr(this.safeString(contract, 'fundingRateEr'), market),
4163
+ 'fundingRate': this.safeNumber(contract, 'fundingRateRr', fundingRateEr),
4160
4164
  'fundingTimestamp': undefined,
4161
4165
  'fundingDatetime': undefined,
4162
- 'nextFundingRate': this.fromEr(this.safeString2(contract, 'predFundingRateEr', 'predFundingRateRr'), market),
4166
+ 'nextFundingRate': this.safeNumber(contract, 'predFundingRateRr', nextFundingRateEr),
4163
4167
  'nextFundingTimestamp': undefined,
4164
4168
  'nextFundingDatetime': undefined,
4165
4169
  'previousFundingRate': undefined,
@@ -113,7 +113,7 @@ export default class poloniex extends Exchange {
113
113
  * @param {int} [since] the earliest time in ms to fetch open orders for
114
114
  * @param {int} [limit] the maximum number of open orders structures to retrieve
115
115
  * @param {object} [params] extra parameters specific to the exchange API endpoint
116
- * @param {boolean} [params.stop] set true to fetch trigger orders instead of regular orders
116
+ * @param {boolean} [params.trigger] set true to fetch trigger orders instead of regular orders
117
117
  * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
118
118
  */
119
119
  fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
@@ -1210,7 +1210,7 @@ export default class poloniex extends Exchange {
1210
1210
  * @param {int} [since] the earliest time in ms to fetch open orders for
1211
1211
  * @param {int} [limit] the maximum number of open orders structures to retrieve
1212
1212
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1213
- * @param {boolean} [params.stop] set true to fetch trigger orders instead of regular orders
1213
+ * @param {boolean} [params.trigger] set true to fetch trigger orders instead of regular orders
1214
1214
  * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
1215
1215
  */
1216
1216
  async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
@@ -195,7 +195,7 @@ export default class poloniexfutures extends Exchange {
195
195
  * @description cancel all open orders
196
196
  * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
197
197
  * @param {object} [params] extra parameters specific to the exchange API endpoint
198
- * @param {object} [params.stop] When true, all the trigger orders will be cancelled
198
+ * @param {object} [params.trigger] When true, all the trigger orders will be cancelled
199
199
  * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
200
200
  */
201
201
  cancelAllOrders(symbol?: Str, params?: {}): Promise<any[]>;