ccxt 4.3.53 → 4.3.55

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 (231) hide show
  1. package/README.md +4 -4
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +1 -1
  4. package/dist/cjs/src/ace.js +1 -1
  5. package/dist/cjs/src/alpaca.js +1 -1
  6. package/dist/cjs/src/ascendex.js +6 -4
  7. package/dist/cjs/src/bigone.js +1 -1
  8. package/dist/cjs/src/binance.js +6 -6
  9. package/dist/cjs/src/bingx.js +4 -4
  10. package/dist/cjs/src/bit2c.js +1 -1
  11. package/dist/cjs/src/bitbank.js +1 -1
  12. package/dist/cjs/src/bitbns.js +1 -1
  13. package/dist/cjs/src/bitfinex.js +1 -1
  14. package/dist/cjs/src/bitfinex2.js +1 -1
  15. package/dist/cjs/src/bitflyer.js +1 -1
  16. package/dist/cjs/src/bitget.js +2 -2
  17. package/dist/cjs/src/bithumb.js +1 -1
  18. package/dist/cjs/src/bitmart.js +3 -3
  19. package/dist/cjs/src/bitmex.js +1 -1
  20. package/dist/cjs/src/bitopro.js +1 -1
  21. package/dist/cjs/src/bitrue.js +1 -1
  22. package/dist/cjs/src/bitso.js +1 -1
  23. package/dist/cjs/src/bitstamp.js +1 -1
  24. package/dist/cjs/src/bitteam.js +1 -1
  25. package/dist/cjs/src/bitvavo.js +2 -2
  26. package/dist/cjs/src/bl3p.js +1 -1
  27. package/dist/cjs/src/blockchaincom.js +28 -28
  28. package/dist/cjs/src/blofin.js +1 -1
  29. package/dist/cjs/src/btcalpha.js +4 -12
  30. package/dist/cjs/src/btcbox.js +1 -1
  31. package/dist/cjs/src/btcmarkets.js +1 -1
  32. package/dist/cjs/src/btcturk.js +1 -1
  33. package/dist/cjs/src/bybit.js +2 -2
  34. package/dist/cjs/src/cex.js +2 -2
  35. package/dist/cjs/src/coinbase.js +33 -33
  36. package/dist/cjs/src/coinbaseexchange.js +1 -1
  37. package/dist/cjs/src/coinbaseinternational.js +1 -1
  38. package/dist/cjs/src/coincheck.js +1 -1
  39. package/dist/cjs/src/coinex.js +2 -2
  40. package/dist/cjs/src/coinlist.js +2 -2
  41. package/dist/cjs/src/coinmate.js +1 -1
  42. package/dist/cjs/src/coinmetro.js +1 -1
  43. package/dist/cjs/src/coinone.js +1 -1
  44. package/dist/cjs/src/coinsph.js +1 -1
  45. package/dist/cjs/src/coinspot.js +1 -1
  46. package/dist/cjs/src/cryptocom.js +1 -1
  47. package/dist/cjs/src/currencycom.js +1 -1
  48. package/dist/cjs/src/delta.js +2 -2
  49. package/dist/cjs/src/deribit.js +4 -4
  50. package/dist/cjs/src/digifinex.js +2 -2
  51. package/dist/cjs/src/exmo.js +2 -2
  52. package/dist/cjs/src/gate.js +2 -2
  53. package/dist/cjs/src/gemini.js +1 -1
  54. package/dist/cjs/src/hitbtc.js +1 -1
  55. package/dist/cjs/src/hollaex.js +1 -1
  56. package/dist/cjs/src/htx.js +3 -3
  57. package/dist/cjs/src/huobijp.js +1 -1
  58. package/dist/cjs/src/hyperliquid.js +2 -2
  59. package/dist/cjs/src/idex.js +1 -1
  60. package/dist/cjs/src/independentreserve.js +1 -1
  61. package/dist/cjs/src/indodax.js +1 -1
  62. package/dist/cjs/src/kraken.js +2 -2
  63. package/dist/cjs/src/kucoin.js +136 -47
  64. package/dist/cjs/src/kucoinfutures.js +1 -1
  65. package/dist/cjs/src/kuna.js +1 -1
  66. package/dist/cjs/src/latoken.js +1 -1
  67. package/dist/cjs/src/lbank.js +1 -1
  68. package/dist/cjs/src/luno.js +1 -1
  69. package/dist/cjs/src/lykke.js +1 -1
  70. package/dist/cjs/src/mercado.js +1 -1
  71. package/dist/cjs/src/mexc.js +1 -1
  72. package/dist/cjs/src/ndax.js +1 -1
  73. package/dist/cjs/src/novadax.js +1 -1
  74. package/dist/cjs/src/oceanex.js +1 -1
  75. package/dist/cjs/src/okcoin.js +1 -1
  76. package/dist/cjs/src/okx.js +3 -3
  77. package/dist/cjs/src/onetrading.js +1 -1
  78. package/dist/cjs/src/oxfun.js +2 -2
  79. package/dist/cjs/src/p2b.js +1 -1
  80. package/dist/cjs/src/paymium.js +1 -1
  81. package/dist/cjs/src/phemex.js +30 -3
  82. package/dist/cjs/src/poloniex.js +6 -4
  83. package/dist/cjs/src/poloniexfutures.js +1 -1
  84. package/dist/cjs/src/pro/binance.js +3 -3
  85. package/dist/cjs/src/pro/bitvavo.js +2 -2
  86. package/dist/cjs/src/pro/bybit.js +22 -14
  87. package/dist/cjs/src/pro/cex.js +3 -3
  88. package/dist/cjs/src/pro/coinbase.js +23 -1
  89. package/dist/cjs/src/pro/cryptocom.js +1 -1
  90. package/dist/cjs/src/pro/gate.js +2 -2
  91. package/dist/cjs/src/pro/hitbtc.js +1 -1
  92. package/dist/cjs/src/pro/kraken.js +2 -2
  93. package/dist/cjs/src/pro/kucoin.js +66 -28
  94. package/dist/cjs/src/pro/okx.js +2 -2
  95. package/dist/cjs/src/pro/oxfun.js +2 -2
  96. package/dist/cjs/src/pro/poloniex.js +1 -1
  97. package/dist/cjs/src/pro/vertex.js +2 -2
  98. package/dist/cjs/src/probit.js +1 -1
  99. package/dist/cjs/src/timex.js +1 -1
  100. package/dist/cjs/src/tokocrypto.js +1 -1
  101. package/dist/cjs/src/tradeogre.js +1 -1
  102. package/dist/cjs/src/upbit.js +1 -1
  103. package/dist/cjs/src/vertex.js +2 -2
  104. package/dist/cjs/src/wavesexchange.js +1 -1
  105. package/dist/cjs/src/wazirx.js +1 -1
  106. package/dist/cjs/src/whitebit.js +2 -2
  107. package/dist/cjs/src/woo.js +34 -26
  108. package/dist/cjs/src/woofipro.js +3 -3
  109. package/dist/cjs/src/yobit.js +1 -1
  110. package/dist/cjs/src/zaif.js +1 -1
  111. package/dist/cjs/src/zonda.js +1 -1
  112. package/js/ccxt.d.ts +1 -1
  113. package/js/ccxt.js +1 -1
  114. package/js/src/abstract/kucoin.d.ts +3 -0
  115. package/js/src/abstract/kucoinfutures.d.ts +3 -0
  116. package/js/src/ace.js +1 -1
  117. package/js/src/alpaca.js +1 -1
  118. package/js/src/ascendex.d.ts +1 -1
  119. package/js/src/ascendex.js +6 -4
  120. package/js/src/base/types.d.ts +4 -0
  121. package/js/src/bigone.js +1 -1
  122. package/js/src/binance.js +6 -6
  123. package/js/src/bingx.js +4 -4
  124. package/js/src/bit2c.js +1 -1
  125. package/js/src/bitbank.js +1 -1
  126. package/js/src/bitbns.js +1 -1
  127. package/js/src/bitfinex.js +1 -1
  128. package/js/src/bitfinex2.js +1 -1
  129. package/js/src/bitflyer.js +1 -1
  130. package/js/src/bitget.js +2 -2
  131. package/js/src/bithumb.js +1 -1
  132. package/js/src/bitmart.js +3 -3
  133. package/js/src/bitmex.js +1 -1
  134. package/js/src/bitopro.js +1 -1
  135. package/js/src/bitrue.js +1 -1
  136. package/js/src/bitso.js +1 -1
  137. package/js/src/bitstamp.js +1 -1
  138. package/js/src/bitteam.js +1 -1
  139. package/js/src/bitvavo.js +2 -2
  140. package/js/src/bl3p.js +1 -1
  141. package/js/src/blockchaincom.js +28 -28
  142. package/js/src/blofin.js +1 -1
  143. package/js/src/btcalpha.js +5 -13
  144. package/js/src/btcbox.js +1 -1
  145. package/js/src/btcmarkets.js +1 -1
  146. package/js/src/btcturk.js +1 -1
  147. package/js/src/bybit.js +2 -2
  148. package/js/src/cex.js +2 -2
  149. package/js/src/coinbase.js +33 -33
  150. package/js/src/coinbaseexchange.js +1 -1
  151. package/js/src/coinbaseinternational.js +1 -1
  152. package/js/src/coincheck.js +1 -1
  153. package/js/src/coinex.js +2 -2
  154. package/js/src/coinlist.js +2 -2
  155. package/js/src/coinmate.js +1 -1
  156. package/js/src/coinmetro.js +1 -1
  157. package/js/src/coinone.js +1 -1
  158. package/js/src/coinsph.js +1 -1
  159. package/js/src/coinspot.js +1 -1
  160. package/js/src/cryptocom.js +1 -1
  161. package/js/src/currencycom.js +1 -1
  162. package/js/src/delta.js +2 -2
  163. package/js/src/deribit.js +4 -4
  164. package/js/src/digifinex.js +2 -2
  165. package/js/src/exmo.js +2 -2
  166. package/js/src/gate.js +2 -2
  167. package/js/src/gemini.js +1 -1
  168. package/js/src/hitbtc.js +1 -1
  169. package/js/src/hollaex.js +1 -1
  170. package/js/src/htx.js +3 -3
  171. package/js/src/huobijp.js +1 -1
  172. package/js/src/hyperliquid.js +2 -2
  173. package/js/src/idex.js +1 -1
  174. package/js/src/independentreserve.js +1 -1
  175. package/js/src/indodax.js +1 -1
  176. package/js/src/kraken.js +2 -2
  177. package/js/src/kucoin.d.ts +1 -0
  178. package/js/src/kucoin.js +136 -47
  179. package/js/src/kucoinfutures.js +1 -1
  180. package/js/src/kuna.js +1 -1
  181. package/js/src/latoken.js +1 -1
  182. package/js/src/lbank.js +1 -1
  183. package/js/src/luno.js +1 -1
  184. package/js/src/lykke.js +1 -1
  185. package/js/src/mercado.js +1 -1
  186. package/js/src/mexc.js +1 -1
  187. package/js/src/ndax.js +1 -1
  188. package/js/src/novadax.js +1 -1
  189. package/js/src/oceanex.js +1 -1
  190. package/js/src/okcoin.js +1 -1
  191. package/js/src/okx.js +3 -3
  192. package/js/src/onetrading.js +1 -1
  193. package/js/src/oxfun.js +2 -2
  194. package/js/src/p2b.js +1 -1
  195. package/js/src/paymium.js +1 -1
  196. package/js/src/phemex.d.ts +1 -1
  197. package/js/src/phemex.js +30 -3
  198. package/js/src/poloniex.js +6 -4
  199. package/js/src/poloniexfutures.js +1 -1
  200. package/js/src/pro/binance.js +3 -3
  201. package/js/src/pro/bitvavo.js +2 -2
  202. package/js/src/pro/bybit.d.ts +1 -1
  203. package/js/src/pro/bybit.js +22 -14
  204. package/js/src/pro/cex.js +3 -3
  205. package/js/src/pro/coinbase.d.ts +1 -0
  206. package/js/src/pro/coinbase.js +23 -1
  207. package/js/src/pro/cryptocom.js +1 -1
  208. package/js/src/pro/gate.js +2 -2
  209. package/js/src/pro/hitbtc.js +1 -1
  210. package/js/src/pro/kraken.js +2 -2
  211. package/js/src/pro/kucoin.js +66 -28
  212. package/js/src/pro/okx.js +2 -2
  213. package/js/src/pro/oxfun.js +2 -2
  214. package/js/src/pro/poloniex.js +1 -1
  215. package/js/src/pro/vertex.js +2 -2
  216. package/js/src/probit.js +1 -1
  217. package/js/src/timex.js +1 -1
  218. package/js/src/tokocrypto.js +1 -1
  219. package/js/src/tradeogre.js +1 -1
  220. package/js/src/upbit.js +1 -1
  221. package/js/src/vertex.js +2 -2
  222. package/js/src/wavesexchange.js +1 -1
  223. package/js/src/wazirx.js +1 -1
  224. package/js/src/whitebit.js +2 -2
  225. package/js/src/woo.d.ts +1 -0
  226. package/js/src/woo.js +34 -26
  227. package/js/src/woofipro.js +3 -3
  228. package/js/src/yobit.js +1 -1
  229. package/js/src/zaif.js +1 -1
  230. package/js/src/zonda.js +1 -1
  231. package/package.json +54 -52
package/js/src/kucoin.js CHANGED
@@ -107,7 +107,7 @@ export default class kucoin extends Exchange {
107
107
  'fetchWithdrawals': true,
108
108
  'repayCrossMargin': true,
109
109
  'repayIsolatedMargin': true,
110
- 'setLeverage': false,
110
+ 'setLeverage': true,
111
111
  'setMarginMode': false,
112
112
  'setPositionMode': false,
113
113
  'signIn': false,
@@ -203,6 +203,7 @@ export default class kucoin extends Exchange {
203
203
  'market/orderbook/level3': 3,
204
204
  'hf/orders/active': 2,
205
205
  'hf/orders/active/symbols': 2,
206
+ 'hf/margin/order/active/symbols': 2,
206
207
  'hf/orders/done': 2,
207
208
  'hf/orders/{orderId}': 2,
208
209
  'hf/orders/client-order/{clientOid}': 2,
@@ -231,6 +232,7 @@ export default class kucoin extends Exchange {
231
232
  'margin/currencies': 20,
232
233
  'risk/limit/strategy': 20,
233
234
  'isolated/symbols': 20,
235
+ 'margin/symbols': 5,
234
236
  'isolated/account/{symbol}': 50,
235
237
  'margin/borrow': 15,
236
238
  'margin/repay': 15,
@@ -279,7 +281,8 @@ export default class kucoin extends Exchange {
279
281
  'redeem': 15,
280
282
  'lend/purchase/update': 10,
281
283
  // ws
282
- 'bullet-private': 10, // 10SW
284
+ 'bullet-private': 10,
285
+ 'position/update-user-leverage': 5,
283
286
  },
284
287
  'delete': {
285
288
  // account
@@ -666,6 +669,7 @@ export default class kucoin extends Exchange {
666
669
  'oco/orders': 'v3',
667
670
  // margin trading
668
671
  'hf/margin/orders/active': 'v3',
672
+ 'hf/margin/order/active/symbols': 'v3',
669
673
  'hf/margin/orders/done': 'v3',
670
674
  'hf/margin/orders/{orderId}': 'v3',
671
675
  'hf/margin/orders/client-order/{clientOid}': 'v3',
@@ -679,6 +683,7 @@ export default class kucoin extends Exchange {
679
683
  'project/marketInterestRate': 'v3',
680
684
  'redeem/orders': 'v3',
681
685
  'purchase/orders': 'v3',
686
+ 'margin/symbols': 'v3',
682
687
  },
683
688
  'POST': {
684
689
  // account
@@ -698,6 +703,7 @@ export default class kucoin extends Exchange {
698
703
  'purchase': 'v3',
699
704
  'redeem': 'v3',
700
705
  'lend/purchase/update': 'v3',
706
+ 'position/update-user-leverage': 'v3',
701
707
  },
702
708
  'DELETE': {
703
709
  // account
@@ -1020,7 +1026,10 @@ export default class kucoin extends Exchange {
1020
1026
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1021
1027
  * @returns {object[]} an array of objects representing market data
1022
1028
  */
1023
- const response = await this.publicGetSymbols(params);
1029
+ let fetchTickersFees = undefined;
1030
+ [fetchTickersFees, params] = this.handleOptionAndParams(params, 'fetchMarkets', 'fetchTickersFees', true);
1031
+ const promises = [];
1032
+ promises.push(this.publicGetSymbols(params));
1024
1033
  //
1025
1034
  // {
1026
1035
  // "code": "200000",
@@ -1043,60 +1052,100 @@ export default class kucoin extends Exchange {
1043
1052
  // "isMarginEnabled": true,
1044
1053
  // "enableTrading": true
1045
1054
  // },
1046
- // ]
1047
- // }
1048
1055
  //
1049
- const data = this.safeList(response, 'data');
1050
- const options = this.safeDict(this.options, 'fetchMarkets', {});
1051
- const fetchTickersFees = this.safeBool(options, 'fetchTickersFees', true);
1052
- let tickersResponse = {};
1056
+ const requestMarginables = this.checkRequiredCredentials(false);
1057
+ if (requestMarginables) {
1058
+ promises.push(this.privateGetMarginSymbols(params)); // cross margin symbols
1059
+ //
1060
+ // {
1061
+ // "code": "200000",
1062
+ // "data": {
1063
+ // "timestamp": 1719393213421,
1064
+ // "items": [
1065
+ // {
1066
+ // // same object as in market, with one additional field:
1067
+ // "minFunds": "0.1"
1068
+ // },
1069
+ //
1070
+ promises.push(this.privateGetIsolatedSymbols(params)); // isolated margin symbols
1071
+ //
1072
+ // {
1073
+ // "code": "200000",
1074
+ // "data": [
1075
+ // {
1076
+ // "symbol": "NKN-USDT",
1077
+ // "symbolName": "NKN-USDT",
1078
+ // "baseCurrency": "NKN",
1079
+ // "quoteCurrency": "USDT",
1080
+ // "maxLeverage": 5,
1081
+ // "flDebtRatio": "0.97",
1082
+ // "tradeEnable": true,
1083
+ // "autoRenewMaxDebtRatio": "0.96",
1084
+ // "baseBorrowEnable": true,
1085
+ // "quoteBorrowEnable": true,
1086
+ // "baseTransferInEnable": true,
1087
+ // "quoteTransferInEnable": true,
1088
+ // "baseBorrowCoefficient": "1",
1089
+ // "quoteBorrowCoefficient": "1"
1090
+ // },
1091
+ //
1092
+ }
1053
1093
  if (fetchTickersFees) {
1054
- tickersResponse = await this.publicGetMarketAllTickers(params);
1094
+ promises.push(this.publicGetMarketAllTickers(params));
1095
+ //
1096
+ // {
1097
+ // "code": "200000",
1098
+ // "data": {
1099
+ // "time":1602832092060,
1100
+ // "ticker":[
1101
+ // {
1102
+ // "symbol": "BTC-USDT", // symbol
1103
+ // "symbolName":"BTC-USDT", // Name of trading pairs, it would change after renaming
1104
+ // "buy": "11328.9", // bestAsk
1105
+ // "sell": "11329", // bestBid
1106
+ // "changeRate": "-0.0055", // 24h change rate
1107
+ // "changePrice": "-63.6", // 24h change price
1108
+ // "high": "11610", // 24h highest price
1109
+ // "low": "11200", // 24h lowest price
1110
+ // "vol": "2282.70993217", // 24h volume,the aggregated trading volume in BTC
1111
+ // "volValue": "25984946.157790431", // 24h total, the trading volume in quote currency of last 24 hours
1112
+ // "last": "11328.9", // last price
1113
+ // "averagePrice": "11360.66065903", // 24h average transaction price yesterday
1114
+ // "takerFeeRate": "0.001", // Basic Taker Fee
1115
+ // "makerFeeRate": "0.001", // Basic Maker Fee
1116
+ // "takerCoefficient": "1", // Taker Fee Coefficient
1117
+ // "makerCoefficient": "1" // Maker Fee Coefficient
1118
+ // }
1119
+ //
1055
1120
  }
1056
- //
1057
- // {
1058
- // "code": "200000",
1059
- // "data": {
1060
- // "time":1602832092060,
1061
- // "ticker":[
1062
- // {
1063
- // "symbol": "BTC-USDT", // symbol
1064
- // "symbolName":"BTC-USDT", // Name of trading pairs, it would change after renaming
1065
- // "buy": "11328.9", // bestAsk
1066
- // "sell": "11329", // bestBid
1067
- // "changeRate": "-0.0055", // 24h change rate
1068
- // "changePrice": "-63.6", // 24h change price
1069
- // "high": "11610", // 24h highest price
1070
- // "low": "11200", // 24h lowest price
1071
- // "vol": "2282.70993217", // 24h volume,the aggregated trading volume in BTC
1072
- // "volValue": "25984946.157790431", // 24h total, the trading volume in quote currency of last 24 hours
1073
- // "last": "11328.9", // last price
1074
- // "averagePrice": "11360.66065903", // 24h average transaction price yesterday
1075
- // "takerFeeRate": "0.001", // Basic Taker Fee
1076
- // "makerFeeRate": "0.001", // Basic Maker Fee
1077
- // "takerCoefficient": "1", // Taker Fee Coefficient
1078
- // "makerCoefficient": "1" // Maker Fee Coefficient
1079
- // }
1080
- // ]
1081
- // }
1082
- // }
1083
- //
1084
- const tickersData = this.safeDict(tickersResponse, 'data', {});
1085
- const tickers = this.safeList(tickersData, 'ticker', []);
1086
- const tickersByMarketId = this.indexBy(tickers, 'symbol');
1121
+ const responses = await Promise.all(promises);
1122
+ const symbolsData = this.safeList(responses[0], 'data');
1123
+ const crossData = requestMarginables ? this.safeDict(responses[1], 'data', {}) : {};
1124
+ const crossItems = this.safeList(crossData, 'items', []);
1125
+ const crossById = this.indexBy(crossItems, 'symbol');
1126
+ const isolatedData = requestMarginables ? responses[2] : {};
1127
+ const isolatedItems = this.safeList(isolatedData, 'data', []);
1128
+ const isolatedById = this.indexBy(isolatedItems, 'symbol');
1129
+ const tickersIdx = requestMarginables ? 3 : 1;
1130
+ const tickersResponse = this.safeDict(responses, tickersIdx, {});
1131
+ const tickerItems = this.safeList(this.safeDict(tickersResponse, 'data', {}), 'ticker', []);
1132
+ const tickersById = this.indexBy(tickerItems, 'symbol');
1087
1133
  const result = [];
1088
- for (let i = 0; i < data.length; i++) {
1089
- const market = data[i];
1134
+ for (let i = 0; i < symbolsData.length; i++) {
1135
+ const market = symbolsData[i];
1090
1136
  const id = this.safeString(market, 'symbol');
1091
1137
  const [baseId, quoteId] = id.split('-');
1092
1138
  const base = this.safeCurrencyCode(baseId);
1093
1139
  const quote = this.safeCurrencyCode(quoteId);
1094
1140
  // const quoteIncrement = this.safeNumber (market, 'quoteIncrement');
1095
- const ticker = this.safeDict(tickersByMarketId, id, {});
1141
+ const ticker = this.safeDict(tickersById, id, {});
1096
1142
  const makerFeeRate = this.safeString(ticker, 'makerFeeRate');
1097
1143
  const takerFeeRate = this.safeString(ticker, 'takerFeeRate');
1098
1144
  const makerCoefficient = this.safeString(ticker, 'makerCoefficient');
1099
1145
  const takerCoefficient = this.safeString(ticker, 'takerCoefficient');
1146
+ const hasCrossMargin = (id in crossById);
1147
+ const hasIsolatedMargin = (id in isolatedById);
1148
+ const isMarginable = this.safeBool(market, 'isMarginEnabled', false) || hasCrossMargin || hasIsolatedMargin;
1100
1149
  result.push({
1101
1150
  'id': id,
1102
1151
  'symbol': base + '/' + quote,
@@ -1108,7 +1157,11 @@ export default class kucoin extends Exchange {
1108
1157
  'settleId': undefined,
1109
1158
  'type': 'spot',
1110
1159
  'spot': true,
1111
- 'margin': this.safeBool(market, 'isMarginEnabled'),
1160
+ 'margin': isMarginable,
1161
+ 'marginMode': {
1162
+ 'cross': hasCrossMargin,
1163
+ 'isolated': hasIsolatedMargin,
1164
+ },
1112
1165
  'swap': false,
1113
1166
  'future': false,
1114
1167
  'option': false,
@@ -1993,7 +2046,7 @@ export default class kucoin extends Exchange {
1993
2046
  * @param {string} type 'limit' or 'market'
1994
2047
  * @param {string} side 'buy' or 'sell'
1995
2048
  * @param {float} amount the amount of currency to trade
1996
- * @param {float} [price] *ignored in "market" orders* the price at which the order is to be fullfilled at in units of the quote currency
2049
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
1997
2050
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1998
2051
  * @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
1999
2052
  * @param {string} [params.marginMode] 'cross', // cross (cross mode) and isolated (isolated mode), set to cross by default, the isolated mode will be released soon, stay tuned
@@ -2285,7 +2338,7 @@ export default class kucoin extends Exchange {
2285
2338
  * @param {string} type not used
2286
2339
  * @param {string} side not used
2287
2340
  * @param {float} amount how much of the currency you want to trade in units of the base currency
2288
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the base currency, ignored in market orders
2341
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
2289
2342
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2290
2343
  * @param {string} [params.clientOrderId] client order id, defaults to id if not passed
2291
2344
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -4805,6 +4858,42 @@ export default class kucoin extends Exchange {
4805
4858
  const data = this.safeList(response, 'data', []);
4806
4859
  return this.parseDepositWithdrawFees(data, codes, 'currency');
4807
4860
  }
4861
+ async setLeverage(leverage, symbol = undefined, params = {}) {
4862
+ /**
4863
+ * @method
4864
+ * @name kucoin#setLeverage
4865
+ * @description set the level of leverage for a market
4866
+ * @see https://www.kucoin.com/docs/rest/margin-trading/margin-trading-v3-/modify-leverage-multiplier
4867
+ * @param {string} symbol unified market symbol
4868
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
4869
+ * @returns {object} response from the exchange
4870
+ */
4871
+ await this.loadMarkets();
4872
+ let market = undefined;
4873
+ let marketType = undefined;
4874
+ [marketType, params] = this.handleMarketTypeAndParams('setLeverage', undefined, params);
4875
+ if ((symbol !== undefined) || marketType !== 'spot') {
4876
+ market = this.market(symbol);
4877
+ if (market['contract']) {
4878
+ throw new NotSupported(this.id + ' setLeverage currently supports only spot margin');
4879
+ }
4880
+ }
4881
+ let marginMode = undefined;
4882
+ [marginMode, params] = this.handleMarginModeAndParams('setLeverage', params);
4883
+ if (marginMode === undefined) {
4884
+ throw new ArgumentsRequired(this.id + ' setLeverage requires a marginMode parameter');
4885
+ }
4886
+ const request = {};
4887
+ if (marginMode === 'isolated' && symbol === undefined) {
4888
+ throw new ArgumentsRequired(this.id + ' setLeverage requires a symbol parameter for isolated margin');
4889
+ }
4890
+ if (symbol !== undefined) {
4891
+ request['symbol'] = market['id'];
4892
+ }
4893
+ request['leverage'] = leverage.toString();
4894
+ request['isIsolated'] = (marginMode === 'isolated');
4895
+ return await this.privatePostPositionUpdateUserLeverage(this.extend(request, params));
4896
+ }
4808
4897
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
4809
4898
  //
4810
4899
  // the v2 URL is https://openapi-v2.kucoin.com/api/v1/endpoint
@@ -1356,7 +1356,7 @@ export default class kucoinfutures extends kucoin {
1356
1356
  * @param {string} type 'limit' or 'market'
1357
1357
  * @param {string} side 'buy' or 'sell'
1358
1358
  * @param {float} amount the amount of currency to trade
1359
- * @param {float} [price] *ignored in "market" orders* the price at which the order is to be fullfilled at in units of the quote currency
1359
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
1360
1360
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1361
1361
  * @param {float} [params.triggerPrice] The price a trigger order is triggered at
1362
1362
  * @param {float} [params.stopLossPrice] price to trigger stop-loss orders
package/js/src/kuna.js CHANGED
@@ -947,7 +947,7 @@ export default class kuna extends Exchange {
947
947
  * @param {string} type 'market' or 'limit'
948
948
  * @param {string} side 'buy' or 'sell'
949
949
  * @param {float} amount how much of currency you want to trade in units of base currency
950
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
950
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
951
951
  * @param {object} [params] extra parameters specific to the exchange API endpoint
952
952
  * @param {float} [params.triggerPrice] the price at which a trigger order is triggered at
953
953
  *
package/js/src/latoken.js CHANGED
@@ -1285,7 +1285,7 @@ export default class latoken extends Exchange {
1285
1285
  * @param {string} type 'market' or 'limit'
1286
1286
  * @param {string} side 'buy' or 'sell'
1287
1287
  * @param {float} amount how much of currency you want to trade in units of base currency
1288
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
1288
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
1289
1289
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1290
1290
  * @param {float} [params.triggerPrice] the price at which a trigger order is triggered at
1291
1291
  *
package/js/src/lbank.js CHANGED
@@ -1314,7 +1314,7 @@ export default class lbank extends Exchange {
1314
1314
  * @param {string} type 'market' or 'limit'
1315
1315
  * @param {string} side 'buy' or 'sell'
1316
1316
  * @param {float} amount how much of currency you want to trade in units of base currency
1317
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
1317
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
1318
1318
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1319
1319
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
1320
1320
  */
package/js/src/luno.js CHANGED
@@ -917,7 +917,7 @@ export default class luno extends Exchange {
917
917
  * @param {string} type 'market' or 'limit'
918
918
  * @param {string} side 'buy' or 'sell'
919
919
  * @param {float} amount how much of currency you want to trade in units of base currency
920
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
920
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
921
921
  * @param {object} [params] extra parameters specific to the exchange API endpoint
922
922
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
923
923
  */
package/js/src/lykke.js CHANGED
@@ -796,7 +796,7 @@ export default class lykke extends Exchange {
796
796
  * @param {string} type 'market' or 'limit'
797
797
  * @param {string} side 'buy' or 'sell'
798
798
  * @param {float} amount how much of currency you want to trade in units of base currency
799
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
799
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
800
800
  * @param {object} [params] extra parameters specific to the exchange API endpoint
801
801
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
802
802
  */
package/js/src/mercado.js CHANGED
@@ -442,7 +442,7 @@ export default class mercado extends Exchange {
442
442
  * @param {string} type 'market' or 'limit'
443
443
  * @param {string} side 'buy' or 'sell'
444
444
  * @param {float} amount how much of currency you want to trade in units of base currency
445
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
445
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
446
446
  * @param {object} [params] extra parameters specific to the exchange API endpoint
447
447
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
448
448
  */
package/js/src/mexc.js CHANGED
@@ -2212,7 +2212,7 @@ export default class mexc extends Exchange {
2212
2212
  * @param {string} type 'market' or 'limit'
2213
2213
  * @param {string} side 'buy' or 'sell'
2214
2214
  * @param {float} amount how much of currency you want to trade in units of base currency
2215
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
2215
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
2216
2216
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2217
2217
  * @param {string} [params.marginMode] only 'isolated' is supported for spot-margin trading
2218
2218
  * @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
package/js/src/ndax.js CHANGED
@@ -1345,7 +1345,7 @@ export default class ndax extends Exchange {
1345
1345
  * @param {string} type 'market' or 'limit'
1346
1346
  * @param {string} side 'buy' or 'sell'
1347
1347
  * @param {float} amount how much of currency you want to trade in units of base currency
1348
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
1348
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
1349
1349
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1350
1350
  * @param {float} [params.triggerPrice] the price at which a trigger order would be triggered
1351
1351
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
package/js/src/novadax.js CHANGED
@@ -741,7 +741,7 @@ export default class novadax extends Exchange {
741
741
  * @param {string} type 'market' or 'limit'
742
742
  * @param {string} side 'buy' or 'sell'
743
743
  * @param {float} amount how much you want to trade in units of the base currency
744
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
744
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
745
745
  * @param {object} [params] extra parameters specific to the exchange API endpoint
746
746
  * @param {float} [params.cost] for spot market buy orders, the quote quantity that can be used as an alternative for the amount
747
747
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
package/js/src/oceanex.js CHANGED
@@ -633,7 +633,7 @@ export default class oceanex extends Exchange {
633
633
  * @param {string} type 'market' or 'limit'
634
634
  * @param {string} side 'buy' or 'sell'
635
635
  * @param {float} amount how much of currency you want to trade in units of base currency
636
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
636
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
637
637
  * @param {object} [params] extra parameters specific to the exchange API endpoint
638
638
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
639
639
  */
package/js/src/okcoin.js CHANGED
@@ -1333,7 +1333,7 @@ export default class okcoin extends Exchange {
1333
1333
  * @param {string} type 'market' or 'limit'
1334
1334
  * @param {string} side 'buy' or 'sell'
1335
1335
  * @param {float} amount how much of currency you want to trade in units of base currency
1336
- * @param {float} price the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
1336
+ * @param {float} price the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
1337
1337
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1338
1338
  * @param {bool} [params.reduceOnly] MARGIN orders only, or swap/future orders in net mode
1339
1339
  * @param {bool} [params.postOnly] true to place a post only order
package/js/src/okx.js CHANGED
@@ -2916,7 +2916,7 @@ export default class okx extends Exchange {
2916
2916
  * @param {string} type 'market' or 'limit'
2917
2917
  * @param {string} side 'buy' or 'sell'
2918
2918
  * @param {float} amount how much of currency you want to trade in units of base currency
2919
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
2919
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
2920
2920
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2921
2921
  * @param {bool} [params.reduceOnly] a mark to reduce the position size for margin, swap and future orders
2922
2922
  * @param {bool} [params.postOnly] true to place a post only order
@@ -3126,7 +3126,7 @@ export default class okx extends Exchange {
3126
3126
  * @param {string} type 'market' or 'limit'
3127
3127
  * @param {string} side 'buy' or 'sell'
3128
3128
  * @param {float} amount how much of the currency you want to trade in units of the base currency
3129
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
3129
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
3130
3130
  * @param {object} [params] extra parameters specific to the exchange API endpoint
3131
3131
  * @param {string} [params.clientOrderId] client order id, uses id if not passed
3132
3132
  * @param {float} [params.stopLossPrice] stop loss trigger price
@@ -5529,7 +5529,7 @@ export default class okx extends Exchange {
5529
5529
  for (let i = 0; i < positions.length; i++) {
5530
5530
  result.push(this.parsePosition(positions[i]));
5531
5531
  }
5532
- return this.filterByArrayPositions(result, 'symbol', symbols, false);
5532
+ return this.filterByArrayPositions(result, 'symbol', this.marketSymbols(symbols), false);
5533
5533
  }
5534
5534
  async fetchPositionsForSymbol(symbol, params = {}) {
5535
5535
  /**
@@ -1504,7 +1504,7 @@ export default class onetrading extends Exchange {
1504
1504
  * @param {string} type 'market' or 'limit'
1505
1505
  * @param {string} side 'buy' or 'sell'
1506
1506
  * @param {float} amount how much of currency you want to trade in units of base currency
1507
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
1507
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
1508
1508
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1509
1509
  * @param {float} [params.triggerPrice] onetrading only does stop limit orders and does not do stop market
1510
1510
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
package/js/src/oxfun.js CHANGED
@@ -2228,7 +2228,7 @@ export default class oxfun extends Exchange {
2228
2228
  * @param {string} type 'market', 'limit', 'STOP_LIMIT' or 'STOP_MARKET'
2229
2229
  * @param {string} side 'buy' or 'sell'
2230
2230
  * @param {float} amount how much of currency you want to trade in units of base currency
2231
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
2231
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
2232
2232
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2233
2233
  * @param {int} [params.clientOrderId] a unique id for the order
2234
2234
  * @param {int} [params.timestamp] in milliseconds. If an order reaches the matching engine and the current timestamp exceeds timestamp + recvWindow, then the order will be rejected.
@@ -2418,7 +2418,7 @@ export default class oxfun extends Exchange {
2418
2418
  * @param {string} type 'market', 'limit', 'STOP_LIMIT' or 'STOP_MARKET'
2419
2419
  * @param {string} side 'buy' or 'sell'
2420
2420
  * @param {float} amount how much of currency you want to trade in units of base currency
2421
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
2421
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
2422
2422
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2423
2423
  * @param {int} [params.clientOrderId] a unique id for the order
2424
2424
  * @param {float} [params.cost] the quote quantity that can be used as an alternative for the amount for market buy orders
package/js/src/p2b.js CHANGED
@@ -787,7 +787,7 @@ export default class p2b extends Exchange {
787
787
  * @param {string} type must be 'limit'
788
788
  * @param {string} side 'buy' or 'sell'
789
789
  * @param {float} amount how much of currency you want to trade in units of base currency
790
- * @param {float} price the price at which the order is to be fullfilled, in units of the quote currency
790
+ * @param {float} price the price at which the order is to be fulfilled, in units of the quote currency
791
791
  * @param {object} [params] extra parameters specific to the exchange API endpoint
792
792
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
793
793
  */
package/js/src/paymium.js CHANGED
@@ -393,7 +393,7 @@ export default class paymium extends Exchange {
393
393
  * @param {string} type 'market' or 'limit'
394
394
  * @param {string} side 'buy' or 'sell'
395
395
  * @param {float} amount how much of currency you want to trade in units of base currency
396
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
396
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
397
397
  * @param {object} [params] extra parameters specific to the exchange API endpoint
398
398
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
399
399
  */
@@ -41,7 +41,7 @@ export default class phemex extends Exchange {
41
41
  createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
42
42
  editOrder(id: string, symbol: string, type?: OrderType, side?: OrderSide, amount?: Num, price?: Num, params?: {}): Promise<Order>;
43
43
  cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
44
- cancelAllOrders(symbol?: Str, params?: {}): Promise<any>;
44
+ cancelAllOrders(symbol?: Str, params?: {}): Promise<Order[]>;
45
45
  fetchOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
46
46
  fetchOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
47
47
  fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
package/js/src/phemex.js CHANGED
@@ -2491,7 +2491,7 @@ export default class phemex extends Exchange {
2491
2491
  * @param {string} type 'market' or 'limit'
2492
2492
  * @param {string} side 'buy' or 'sell'
2493
2493
  * @param {float} amount how much of currency you want to trade in units of base currency
2494
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
2494
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
2495
2495
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2496
2496
  * @param {float} [params.trigger] trigger price for conditional orders
2497
2497
  * @param {object} [params.takeProfit] *swap only* *takeProfit object in params* containing the triggerPrice at which the attached take profit order will be triggered (perpetual swap markets only)
@@ -2803,7 +2803,7 @@ export default class phemex extends Exchange {
2803
2803
  * @param {string} type 'market' or 'limit'
2804
2804
  * @param {string} side 'buy' or 'sell'
2805
2805
  * @param {float} amount how much of currency you want to trade in units of base currency
2806
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the base currency, ignored in market orders
2806
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
2807
2807
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2808
2808
  * @param {string} [params.posSide] either 'Merged' or 'Long' or 'Short'
2809
2809
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -2944,14 +2944,41 @@ export default class phemex extends Exchange {
2944
2944
  let response = undefined;
2945
2945
  if (market['settle'] === 'USDT') {
2946
2946
  response = await this.privateDeleteGOrdersAll(this.extend(request, params));
2947
+ //
2948
+ // {
2949
+ // code: '0',
2950
+ // msg: '',
2951
+ // data: '1'
2952
+ // }
2953
+ //
2947
2954
  }
2948
2955
  else if (market['swap']) {
2949
2956
  response = await this.privateDeleteOrdersAll(this.extend(request, params));
2957
+ //
2958
+ // {
2959
+ // code: '0',
2960
+ // msg: '',
2961
+ // data: '1'
2962
+ // }
2963
+ //
2950
2964
  }
2951
2965
  else {
2952
2966
  response = await this.privateDeleteSpotOrdersAll(this.extend(request, params));
2967
+ //
2968
+ // {
2969
+ // code: '0',
2970
+ // msg: '',
2971
+ // data: {
2972
+ // total: '1'
2973
+ // }
2974
+ // }
2975
+ //
2953
2976
  }
2954
- return response;
2977
+ return [
2978
+ this.safeOrder({
2979
+ 'info': response,
2980
+ }),
2981
+ ];
2955
2982
  }
2956
2983
  async fetchOrder(id, symbol = undefined, params = {}) {
2957
2984
  /**
@@ -1257,7 +1257,7 @@ export default class poloniex extends Exchange {
1257
1257
  * @param {string} type 'market' or 'limit'
1258
1258
  * @param {string} side 'buy' or 'sell'
1259
1259
  * @param {float} amount how much of currency you want to trade in units of base currency
1260
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
1260
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
1261
1261
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1262
1262
  * @param {float} [params.triggerPrice] *spot only* The price at which a trigger order is triggered at
1263
1263
  * @param {float} [params.cost] *spot market buy only* the quote quantity that can be used as an alternative for the amount
@@ -1291,7 +1291,8 @@ export default class poloniex extends Exchange {
1291
1291
  // }
1292
1292
  //
1293
1293
  response = this.extend(response, {
1294
- 'type': side,
1294
+ 'type': type,
1295
+ 'side': side,
1295
1296
  });
1296
1297
  return this.parseOrder(response, market);
1297
1298
  }
@@ -1363,7 +1364,7 @@ export default class poloniex extends Exchange {
1363
1364
  * @param {string} type 'market' or 'limit'
1364
1365
  * @param {string} side 'buy' or 'sell'
1365
1366
  * @param {float} [amount] how much of the currency you want to trade in units of the base currency
1366
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
1367
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
1367
1368
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1368
1369
  * @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
1369
1370
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -1393,7 +1394,8 @@ export default class poloniex extends Exchange {
1393
1394
  // }
1394
1395
  //
1395
1396
  response = this.extend(response, {
1396
- 'type': side,
1397
+ 'side': side,
1398
+ 'type': type,
1397
1399
  });
1398
1400
  return this.parseOrder(response, market);
1399
1401
  }
@@ -834,7 +834,7 @@ export default class poloniexfutures extends Exchange {
834
834
  * @param {string} type 'limit' or 'market'
835
835
  * @param {string} side 'buy' or 'sell'
836
836
  * @param {float} amount the amount of currency to trade
837
- * @param {float} [price] *ignored in "market" orders* the price at which the order is to be fullfilled at in units of the quote currency
837
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
838
838
  * @param {object} [params] extra parameters specific to the exchange API endpoint
839
839
  * @param {float} [params.leverage] Leverage size of the order
840
840
  * @param {float} [params.stopPrice] The price at which a trigger order is triggered at