ccxt 4.1.55 → 4.1.57

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 (328) hide show
  1. package/.git-templates/hooks/pre-push +2 -2
  2. package/CONTRIBUTING.md +1 -1
  3. package/README.md +6 -6
  4. package/build.sh +30 -8
  5. package/dist/ccxt.browser.js +5592 -4907
  6. package/dist/ccxt.browser.min.js +13 -13
  7. package/dist/cjs/ccxt.js +1 -1
  8. package/dist/cjs/src/ace.js +17 -13
  9. package/dist/cjs/src/alpaca.js +6 -6
  10. package/dist/cjs/src/ascendex.js +35 -29
  11. package/dist/cjs/src/base/Exchange.js +39 -26
  12. package/dist/cjs/src/base/Precise.js +1 -3
  13. package/dist/cjs/src/bigone.js +24 -20
  14. package/dist/cjs/src/binance.js +97 -76
  15. package/dist/cjs/src/bingx.js +63 -44
  16. package/dist/cjs/src/bit2c.js +18 -15
  17. package/dist/cjs/src/bitbank.js +17 -15
  18. package/dist/cjs/src/bitbns.js +28 -18
  19. package/dist/cjs/src/bitfinex.js +23 -21
  20. package/dist/cjs/src/bitfinex2.js +32 -28
  21. package/dist/cjs/src/bitflyer.js +28 -20
  22. package/dist/cjs/src/bitforex.js +25 -18
  23. package/dist/cjs/src/bitget.js +184 -147
  24. package/dist/cjs/src/bithumb.js +23 -16
  25. package/dist/cjs/src/bitmart.js +129 -94
  26. package/dist/cjs/src/bitmex.js +104 -64
  27. package/dist/cjs/src/bitopro.js +38 -26
  28. package/dist/cjs/src/bitpanda.js +24 -23
  29. package/dist/cjs/src/bitrue.js +33 -24
  30. package/dist/cjs/src/bitso.js +24 -23
  31. package/dist/cjs/src/bitstamp.js +24 -23
  32. package/dist/cjs/src/bittrex.js +30 -29
  33. package/dist/cjs/src/bitvavo.js +38 -30
  34. package/dist/cjs/src/bl3p.js +11 -10
  35. package/dist/cjs/src/blockchaincom.js +20 -20
  36. package/dist/cjs/src/btcalpha.js +18 -17
  37. package/dist/cjs/src/btcbox.js +13 -12
  38. package/dist/cjs/src/btcmarkets.js +20 -19
  39. package/dist/cjs/src/btcturk.js +14 -13
  40. package/dist/cjs/src/bybit.js +84 -54
  41. package/dist/cjs/src/cex.js +16 -14
  42. package/dist/cjs/src/coinbase.js +29 -27
  43. package/dist/cjs/src/coinbasepro.js +27 -25
  44. package/dist/cjs/src/coincheck.js +15 -14
  45. package/dist/cjs/src/coinex.js +101 -78
  46. package/dist/cjs/src/coinlist.js +28 -27
  47. package/dist/cjs/src/coinmate.js +20 -17
  48. package/dist/cjs/src/coinone.js +21 -16
  49. package/dist/cjs/src/coinsph.js +37 -28
  50. package/dist/cjs/src/coinspot.js +12 -11
  51. package/dist/cjs/src/cryptocom.js +40 -202
  52. package/dist/cjs/src/currencycom.js +32 -25
  53. package/dist/cjs/src/delta.js +34 -28
  54. package/dist/cjs/src/deribit.js +39 -36
  55. package/dist/cjs/src/digifinex.js +64 -44
  56. package/dist/cjs/src/exmo.js +29 -27
  57. package/dist/cjs/src/gate.js +67 -53
  58. package/dist/cjs/src/gemini.js +23 -20
  59. package/dist/cjs/src/hitbtc.js +65 -56
  60. package/dist/cjs/src/hollaex.js +30 -27
  61. package/dist/cjs/src/htx.js +135 -143
  62. package/dist/cjs/src/huobijp.js +22 -20
  63. package/dist/cjs/src/idex.js +22 -21
  64. package/dist/cjs/src/independentreserve.js +15 -14
  65. package/dist/cjs/src/indodax.js +30 -26
  66. package/dist/cjs/src/kraken.js +29 -27
  67. package/dist/cjs/src/krakenfutures.js +29 -22
  68. package/dist/cjs/src/kucoin.js +48 -43
  69. package/dist/cjs/src/kucoinfutures.js +33 -28
  70. package/dist/cjs/src/kuna.js +25 -24
  71. package/dist/cjs/src/latoken.js +24 -22
  72. package/dist/cjs/src/lbank.js +45 -30
  73. package/dist/cjs/src/luno.js +22 -19
  74. package/dist/cjs/src/lykke.js +19 -17
  75. package/dist/cjs/src/mercado.js +30 -19
  76. package/dist/cjs/src/mexc.js +60 -49
  77. package/dist/cjs/src/ndax.js +23 -22
  78. package/dist/cjs/src/novadax.js +23 -22
  79. package/dist/cjs/src/oceanex.js +22 -19
  80. package/dist/cjs/src/okcoin.js +29 -23
  81. package/dist/cjs/src/okx.js +92 -84
  82. package/dist/cjs/src/p2b.js +80 -83
  83. package/dist/cjs/src/paymium.js +10 -10
  84. package/dist/cjs/src/phemex.js +63 -40
  85. package/dist/cjs/src/poloniex.js +22 -22
  86. package/dist/cjs/src/poloniexfutures.js +23 -19
  87. package/dist/cjs/src/pro/alpaca.js +5 -5
  88. package/dist/cjs/src/pro/ascendex.js +4 -4
  89. package/dist/cjs/src/pro/binance.js +16 -16
  90. package/dist/cjs/src/pro/bingx.js +1 -1
  91. package/dist/cjs/src/pro/bitfinex.js +4 -4
  92. package/dist/cjs/src/pro/bitfinex2.js +6 -6
  93. package/dist/cjs/src/pro/bitget.js +7 -7
  94. package/dist/cjs/src/pro/bitmart.js +7 -5
  95. package/dist/cjs/src/pro/bitmex.js +6 -6
  96. package/dist/cjs/src/pro/bitopro.js +4 -4
  97. package/dist/cjs/src/pro/bitpanda.js +6 -6
  98. package/dist/cjs/src/pro/bitrue.js +2 -2
  99. package/dist/cjs/src/pro/bitstamp.js +6 -4
  100. package/dist/cjs/src/pro/bittrex.js +6 -6
  101. package/dist/cjs/src/pro/bitvavo.js +11 -7
  102. package/dist/cjs/src/pro/blockchaincom.js +8 -8
  103. package/dist/cjs/src/pro/bybit.js +7 -7
  104. package/dist/cjs/src/pro/cex.js +13 -9
  105. package/dist/cjs/src/pro/coinbase.js +5 -5
  106. package/dist/cjs/src/pro/coinbasepro.js +11 -10
  107. package/dist/cjs/src/pro/coinex.js +7 -9
  108. package/dist/cjs/src/pro/cryptocom.js +9 -9
  109. package/dist/cjs/src/pro/currencycom.js +4 -4
  110. package/dist/cjs/src/pro/deribit.js +6 -6
  111. package/dist/cjs/src/pro/exmo.js +12 -14
  112. package/dist/cjs/src/pro/gate.js +7 -7
  113. package/dist/cjs/src/pro/gemini.js +3 -3
  114. package/dist/cjs/src/pro/hitbtc.js +263 -4
  115. package/dist/cjs/src/pro/hollaex.js +5 -5
  116. package/dist/cjs/src/pro/htx.js +6 -6
  117. package/dist/cjs/src/pro/huobijp.js +3 -3
  118. package/dist/cjs/src/pro/idex.js +4 -4
  119. package/dist/cjs/src/pro/independentreserve.js +2 -2
  120. package/dist/cjs/src/pro/kraken.js +10 -10
  121. package/dist/cjs/src/pro/krakenfutures.js +41 -17
  122. package/dist/cjs/src/pro/kucoin.js +7 -7
  123. package/dist/cjs/src/pro/kucoinfutures.js +8 -6
  124. package/dist/cjs/src/pro/luno.js +2 -2
  125. package/dist/cjs/src/pro/mexc.js +6 -6
  126. package/dist/cjs/src/pro/ndax.js +3 -3
  127. package/dist/cjs/src/pro/okcoin.js +5 -5
  128. package/dist/cjs/src/pro/okx.js +12 -12
  129. package/dist/cjs/src/pro/phemex.js +6 -6
  130. package/dist/cjs/src/pro/poloniex.js +7 -7
  131. package/dist/cjs/src/pro/poloniexfutures.js +5 -5
  132. package/dist/cjs/src/pro/probit.js +6 -6
  133. package/dist/cjs/src/pro/upbit.js +3 -3
  134. package/dist/cjs/src/pro/wazirx.js +8 -8
  135. package/dist/cjs/src/pro/whitebit.js +12 -8
  136. package/dist/cjs/src/pro/woo.js +1 -1
  137. package/dist/cjs/src/probit.js +28 -23
  138. package/dist/cjs/src/tidex.js +16 -15
  139. package/dist/cjs/src/timex.js +19 -18
  140. package/dist/cjs/src/tokocrypto.js +27 -22
  141. package/dist/cjs/src/upbit.js +19 -19
  142. package/dist/cjs/src/wavesexchange.js +22 -19
  143. package/dist/cjs/src/wazirx.js +24 -17
  144. package/dist/cjs/src/whitebit.js +33 -27
  145. package/dist/cjs/src/woo.js +44 -34
  146. package/dist/cjs/src/yobit.js +25 -20
  147. package/dist/cjs/src/zaif.js +9 -9
  148. package/dist/cjs/src/zonda.js +18 -17
  149. package/js/ccxt.d.ts +1 -1
  150. package/js/ccxt.js +1 -1
  151. package/js/src/abstract/bitbank.d.ts +1 -0
  152. package/js/src/abstract/bybit.d.ts +1 -0
  153. package/js/src/abstract/cryptocom.d.ts +0 -20
  154. package/js/src/abstract/htx.d.ts +3 -0
  155. package/js/src/abstract/huobi.d.ts +3 -0
  156. package/js/src/abstract/huobipro.d.ts +3 -0
  157. package/js/src/abstract/okex.d.ts +3 -1
  158. package/js/src/abstract/okex5.d.ts +3 -1
  159. package/js/src/abstract/okx.d.ts +3 -1
  160. package/js/src/ace.js +18 -14
  161. package/js/src/alpaca.js +6 -6
  162. package/js/src/ascendex.js +35 -29
  163. package/js/src/base/Exchange.d.ts +37 -34
  164. package/js/src/base/Exchange.js +39 -26
  165. package/js/src/base/Precise.d.ts +4 -4
  166. package/js/src/base/Precise.js +1 -3
  167. package/js/src/base/functions/type.d.ts +25 -25
  168. package/js/src/base/types.d.ts +21 -14
  169. package/js/src/bigone.js +25 -21
  170. package/js/src/binance.d.ts +2 -2
  171. package/js/src/binance.js +97 -76
  172. package/js/src/bingx.js +63 -44
  173. package/js/src/bit2c.js +19 -16
  174. package/js/src/bitbank.js +17 -15
  175. package/js/src/bitbns.js +28 -18
  176. package/js/src/bitfinex.js +23 -21
  177. package/js/src/bitfinex2.js +32 -28
  178. package/js/src/bitflyer.js +28 -20
  179. package/js/src/bitforex.js +26 -19
  180. package/js/src/bitget.d.ts +25 -3
  181. package/js/src/bitget.js +184 -147
  182. package/js/src/bithumb.js +23 -16
  183. package/js/src/bitmart.d.ts +1 -1
  184. package/js/src/bitmart.js +129 -94
  185. package/js/src/bitmex.d.ts +2 -2
  186. package/js/src/bitmex.js +104 -64
  187. package/js/src/bitopro.js +38 -26
  188. package/js/src/bitpanda.js +24 -23
  189. package/js/src/bitrue.js +33 -24
  190. package/js/src/bitso.js +24 -23
  191. package/js/src/bitstamp.d.ts +2 -2
  192. package/js/src/bitstamp.js +24 -23
  193. package/js/src/bittrex.js +30 -29
  194. package/js/src/bitvavo.js +38 -30
  195. package/js/src/bl3p.js +11 -10
  196. package/js/src/blockchaincom.js +20 -20
  197. package/js/src/btcalpha.js +18 -17
  198. package/js/src/btcbox.js +13 -12
  199. package/js/src/btcmarkets.js +20 -19
  200. package/js/src/btcturk.js +14 -13
  201. package/js/src/bybit.d.ts +1 -1
  202. package/js/src/bybit.js +84 -54
  203. package/js/src/cex.js +16 -14
  204. package/js/src/coinbase.js +29 -27
  205. package/js/src/coinbasepro.js +27 -25
  206. package/js/src/coincheck.js +15 -14
  207. package/js/src/coinex.d.ts +1 -1
  208. package/js/src/coinex.js +101 -78
  209. package/js/src/coinlist.js +28 -27
  210. package/js/src/coinmate.js +21 -18
  211. package/js/src/coinone.js +21 -16
  212. package/js/src/coinsph.js +37 -28
  213. package/js/src/coinspot.js +12 -11
  214. package/js/src/cryptocom.d.ts +0 -23
  215. package/js/src/cryptocom.js +40 -202
  216. package/js/src/currencycom.js +32 -25
  217. package/js/src/delta.js +35 -29
  218. package/js/src/deribit.js +39 -36
  219. package/js/src/digifinex.d.ts +2 -2
  220. package/js/src/digifinex.js +65 -45
  221. package/js/src/exmo.js +29 -27
  222. package/js/src/gate.d.ts +1 -1
  223. package/js/src/gate.js +67 -53
  224. package/js/src/gemini.js +23 -20
  225. package/js/src/hitbtc.d.ts +1 -0
  226. package/js/src/hitbtc.js +65 -56
  227. package/js/src/hollaex.js +30 -27
  228. package/js/src/htx.d.ts +11 -3
  229. package/js/src/htx.js +135 -143
  230. package/js/src/huobijp.js +23 -21
  231. package/js/src/idex.js +22 -21
  232. package/js/src/independentreserve.js +15 -14
  233. package/js/src/indodax.js +30 -26
  234. package/js/src/kraken.js +29 -27
  235. package/js/src/krakenfutures.js +29 -22
  236. package/js/src/kucoin.d.ts +1 -1
  237. package/js/src/kucoin.js +48 -43
  238. package/js/src/kucoinfutures.js +33 -28
  239. package/js/src/kuna.js +25 -24
  240. package/js/src/latoken.js +25 -23
  241. package/js/src/lbank.js +46 -31
  242. package/js/src/luno.js +22 -19
  243. package/js/src/lykke.js +19 -17
  244. package/js/src/mercado.js +30 -19
  245. package/js/src/mexc.d.ts +1 -1
  246. package/js/src/mexc.js +60 -49
  247. package/js/src/ndax.js +23 -22
  248. package/js/src/novadax.js +23 -22
  249. package/js/src/oceanex.js +22 -19
  250. package/js/src/okcoin.js +29 -23
  251. package/js/src/okx.d.ts +2 -2
  252. package/js/src/okx.js +92 -84
  253. package/js/src/p2b.d.ts +8 -7
  254. package/js/src/p2b.js +80 -82
  255. package/js/src/paymium.js +10 -10
  256. package/js/src/phemex.js +63 -40
  257. package/js/src/poloniex.js +22 -22
  258. package/js/src/poloniexfutures.js +23 -19
  259. package/js/src/pro/alpaca.js +5 -5
  260. package/js/src/pro/ascendex.js +4 -4
  261. package/js/src/pro/binance.js +16 -16
  262. package/js/src/pro/bingx.js +1 -1
  263. package/js/src/pro/bitfinex.js +4 -4
  264. package/js/src/pro/bitfinex2.d.ts +1 -1
  265. package/js/src/pro/bitfinex2.js +6 -6
  266. package/js/src/pro/bitget.js +7 -7
  267. package/js/src/pro/bitmart.js +7 -5
  268. package/js/src/pro/bitmex.js +6 -6
  269. package/js/src/pro/bitopro.js +4 -4
  270. package/js/src/pro/bitpanda.js +6 -6
  271. package/js/src/pro/bitrue.js +2 -2
  272. package/js/src/pro/bitstamp.js +7 -5
  273. package/js/src/pro/bittrex.js +6 -6
  274. package/js/src/pro/bitvavo.js +12 -8
  275. package/js/src/pro/blockchaincom.js +8 -8
  276. package/js/src/pro/bybit.js +7 -7
  277. package/js/src/pro/cex.js +14 -10
  278. package/js/src/pro/coinbase.js +5 -5
  279. package/js/src/pro/coinbasepro.js +12 -11
  280. package/js/src/pro/coinex.js +7 -9
  281. package/js/src/pro/cryptocom.js +9 -9
  282. package/js/src/pro/currencycom.js +4 -4
  283. package/js/src/pro/deribit.js +6 -6
  284. package/js/src/pro/exmo.js +12 -14
  285. package/js/src/pro/gate.js +7 -7
  286. package/js/src/pro/gemini.js +3 -3
  287. package/js/src/pro/hitbtc.d.ts +8 -1
  288. package/js/src/pro/hitbtc.js +264 -5
  289. package/js/src/pro/hollaex.js +5 -5
  290. package/js/src/pro/htx.js +6 -6
  291. package/js/src/pro/huobijp.js +3 -3
  292. package/js/src/pro/idex.js +4 -4
  293. package/js/src/pro/independentreserve.js +2 -2
  294. package/js/src/pro/kraken.js +10 -10
  295. package/js/src/pro/krakenfutures.d.ts +1 -0
  296. package/js/src/pro/krakenfutures.js +42 -18
  297. package/js/src/pro/kucoin.js +7 -7
  298. package/js/src/pro/kucoinfutures.js +8 -6
  299. package/js/src/pro/luno.js +2 -2
  300. package/js/src/pro/mexc.js +6 -6
  301. package/js/src/pro/ndax.js +3 -3
  302. package/js/src/pro/okcoin.js +5 -5
  303. package/js/src/pro/okx.js +12 -12
  304. package/js/src/pro/phemex.js +6 -6
  305. package/js/src/pro/poloniex.js +7 -7
  306. package/js/src/pro/poloniexfutures.js +5 -5
  307. package/js/src/pro/probit.js +6 -6
  308. package/js/src/pro/upbit.js +3 -3
  309. package/js/src/pro/wazirx.js +8 -8
  310. package/js/src/pro/whitebit.js +13 -9
  311. package/js/src/pro/woo.js +1 -1
  312. package/js/src/probit.js +29 -24
  313. package/js/src/tidex.js +16 -15
  314. package/js/src/timex.js +19 -18
  315. package/js/src/tokocrypto.js +28 -23
  316. package/js/src/upbit.js +19 -19
  317. package/js/src/wavesexchange.js +23 -20
  318. package/js/src/wazirx.js +25 -18
  319. package/js/src/whitebit.js +33 -27
  320. package/js/src/woo.js +45 -35
  321. package/js/src/yobit.js +25 -20
  322. package/js/src/zaif.js +9 -9
  323. package/js/src/zonda.js +18 -17
  324. package/package.json +2 -2
  325. package/js/src/bitstamp1.d.ts +0 -28
  326. package/js/src/bitstamp1.js +0 -430
  327. package/js/src/lbank2.d.ts +0 -90
  328. package/js/src/lbank2.js +0 -2779
@@ -20,6 +20,10 @@ class hitbtc extends hitbtc$1 {
20
20
  'watchOrders': true,
21
21
  'watchOHLCV': true,
22
22
  'watchMyTrades': false,
23
+ 'createOrderWs': true,
24
+ 'cancelOrderWs': true,
25
+ 'fetchOpenOrdersWs': true,
26
+ 'cancelAllOrdersWs': true,
23
27
  },
24
28
  'urls': {
25
29
  'api': {
@@ -150,6 +154,25 @@ class hitbtc extends hitbtc$1 {
150
154
  };
151
155
  return await this.watch(url, messageHash, subscribe, messageHash);
152
156
  }
157
+ async tradeRequest(name, params = {}) {
158
+ /**
159
+ * @ignore
160
+ * @method
161
+ * @param {string} name websocket endpoint name
162
+ * @param {string} [symbol] unified CCXT symbol
163
+ * @param {object} [params] extra parameters specific to the hitbtc api
164
+ */
165
+ await this.loadMarkets();
166
+ await this.authenticate();
167
+ const url = this.urls['api']['ws']['private'];
168
+ const messageHash = this.nonce();
169
+ const subscribe = {
170
+ 'method': name,
171
+ 'params': params,
172
+ 'id': messageHash,
173
+ };
174
+ return await this.watch(url, messageHash, subscribe, messageHash);
175
+ }
153
176
  async watchOrderBook(symbol, limit = undefined, params = {}) {
154
177
  /**
155
178
  * @method
@@ -459,7 +482,7 @@ class hitbtc extends hitbtc$1 {
459
482
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
460
483
  * @param {int} [limit] the maximum amount of trades to fetch
461
484
  * @param {object} [params] extra parameters specific to the hitbtc api endpoint
462
- * @returns {object[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#public-trades}
485
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
463
486
  */
464
487
  await this.loadMarkets();
465
488
  const market = this.market(symbol);
@@ -895,6 +918,15 @@ class hitbtc extends hitbtc$1 {
895
918
  const trade = this.parseWsOrderTrade(order, market);
896
919
  trades = [trade];
897
920
  }
921
+ const rawStatus = this.safeString(order, 'status');
922
+ const report_type = this.safeString(order, 'report_type');
923
+ let parsedStatus = undefined;
924
+ if (report_type === 'canceled') {
925
+ parsedStatus = this.parseOrderStatus(report_type);
926
+ }
927
+ else {
928
+ parsedStatus = this.parseOrderStatus(rawStatus);
929
+ }
898
930
  return this.safeOrder({
899
931
  'info': order,
900
932
  'id': this.safeString(order, 'id'),
@@ -913,7 +945,7 @@ class hitbtc extends hitbtc$1 {
913
945
  'filled': undefined,
914
946
  'remaining': undefined,
915
947
  'cost': undefined,
916
- 'status': this.parseOrderStatus(this.safeString(order, 'status')),
948
+ 'status': parsedStatus,
917
949
  'average': undefined,
918
950
  'trades': trades,
919
951
  'fee': undefined,
@@ -948,6 +980,152 @@ class hitbtc extends hitbtc$1 {
948
980
  };
949
981
  return await this.subscribePrivate(name, undefined, this.extend(request, params));
950
982
  }
983
+ async createOrderWs(symbol, type, side, amount, price = undefined, params = {}) {
984
+ /**
985
+ * @method
986
+ * @name hitbtc#createOrder
987
+ * @description create a trade order
988
+ * @see https://api.hitbtc.com/#create-new-spot-order
989
+ * @see https://api.hitbtc.com/#create-margin-order
990
+ * @see https://api.hitbtc.com/#create-futures-order
991
+ * @param {string} symbol unified symbol of the market to create an order in
992
+ * @param {string} type 'market' or 'limit'
993
+ * @param {string} side 'buy' or 'sell'
994
+ * @param {float} amount how much of currency you want to trade in units of base currency
995
+ * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
996
+ * @param {object} [params] extra parameters specific to the hitbtc api endpoint
997
+ * @param {string} [params.marginMode] 'cross' or 'isolated' only 'isolated' is supported for spot-margin, swap supports both, default is 'cross'
998
+ * @param {bool} [params.margin] true for creating a margin order
999
+ * @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
1000
+ * @param {bool} [params.postOnly] if true, the order will only be posted to the order book and not executed immediately
1001
+ * @param {string} [params.timeInForce] "GTC", "IOC", "FOK", "Day", "GTD"
1002
+ * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
1003
+ */
1004
+ await this.loadMarkets();
1005
+ const market = this.market(symbol);
1006
+ let request = undefined;
1007
+ let marketType = undefined;
1008
+ [marketType, params] = this.handleMarketTypeAndParams('createOrder', market, params);
1009
+ let marginMode = undefined;
1010
+ [marginMode, params] = this.handleMarginModeAndParams('createOrder', params);
1011
+ [request, params] = this.createOrderRequest(market, marketType, type, side, amount, price, marginMode, params);
1012
+ request = this.extend(request, params);
1013
+ if (marketType === 'swap') {
1014
+ return await this.tradeRequest('futures_new_order', request);
1015
+ }
1016
+ else if ((marketType === 'margin') || (marginMode !== undefined)) {
1017
+ return await this.tradeRequest('margin_new_order', request);
1018
+ }
1019
+ else {
1020
+ return await this.tradeRequest('spot_new_order', request);
1021
+ }
1022
+ }
1023
+ async cancelOrderWs(id, symbol = undefined, params = {}) {
1024
+ /**
1025
+ * @method
1026
+ * @name hitbtc#cancelOrderWs
1027
+ * @see https://api.hitbtc.com/#cancel-spot-order-2
1028
+ * @see https://api.hitbtc.com/#cancel-futures-order-2
1029
+ * @see https://api.hitbtc.com/#cancel-margin-order-2
1030
+ * @description cancels an open order
1031
+ * @param {string} id order id
1032
+ * @param {string} symbol unified symbol of the market the order was made in
1033
+ * @param {object} [params] extra parameters specific to the hitbtc api endpoint
1034
+ * @param {string} [params.marginMode] 'cross' or 'isolated' only 'isolated' is supported
1035
+ * @param {bool} [params.margin] true for canceling a margin order
1036
+ * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
1037
+ */
1038
+ await this.loadMarkets();
1039
+ let market = undefined;
1040
+ let request = {
1041
+ 'client_order_id': id,
1042
+ };
1043
+ if (symbol !== undefined) {
1044
+ market = this.market(symbol);
1045
+ }
1046
+ let marketType = undefined;
1047
+ [marketType, params] = this.handleMarketTypeAndParams('cancelOrderWs', market, params);
1048
+ const [marginMode, query] = this.handleMarginModeAndParams('cancelOrderWs', params);
1049
+ request = this.extend(request, query);
1050
+ if (marketType === 'swap') {
1051
+ return await this.tradeRequest('futures_cancel_order', request);
1052
+ }
1053
+ else if ((marketType === 'margin') || (marginMode !== undefined)) {
1054
+ return await this.tradeRequest('margin_cancel_order', request);
1055
+ }
1056
+ else {
1057
+ return await this.tradeRequest('spot_cancel_order', request);
1058
+ }
1059
+ }
1060
+ async cancelAllOrdersWs(symbol = undefined, params = {}) {
1061
+ /**
1062
+ * @method
1063
+ * @name hitbtc#cancelAllOrdersWs
1064
+ * @see https://api.hitbtc.com/#cancel-spot-orders
1065
+ * @see https://api.hitbtc.com/#cancel-futures-order-3
1066
+ * @description cancel all open orders
1067
+ * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
1068
+ * @param {object} [params] extra parameters specific to the hitbtc api endpoint
1069
+ * @param {string} [params.marginMode] 'cross' or 'isolated' only 'isolated' is supported
1070
+ * @param {bool} [params.margin] true for canceling margin orders
1071
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
1072
+ */
1073
+ await this.loadMarkets();
1074
+ let market = undefined;
1075
+ if (symbol !== undefined) {
1076
+ market = this.market(symbol);
1077
+ }
1078
+ let marketType = undefined;
1079
+ [marketType, params] = this.handleMarketTypeAndParams('cancelAllOrdersWs', market, params);
1080
+ let marginMode = undefined;
1081
+ [marginMode, params] = this.handleMarginModeAndParams('cancelAllOrdersWs', params);
1082
+ if (marketType === 'swap') {
1083
+ return await this.tradeRequest('futures_cancel_orders', params);
1084
+ }
1085
+ else if ((marketType === 'margin') || (marginMode !== undefined)) {
1086
+ throw new errors.NotSupported(this.id + ' cancelAllOrdersWs is not supported for margin orders');
1087
+ }
1088
+ else {
1089
+ return await this.tradeRequest('spot_cancel_orders', params);
1090
+ }
1091
+ }
1092
+ async fetchOpenOrdersWs(symbol = undefined, since = undefined, limit = undefined, params = {}) {
1093
+ /**
1094
+ * @method
1095
+ * @name hitbtc#fetchOpenOrdersWs
1096
+ * @see https://api.hitbtc.com/#get-active-futures-orders-2
1097
+ * @see https://api.hitbtc.com/#get-margin-orders
1098
+ * @see https://api.hitbtc.com/#get-active-spot-orders
1099
+ * @description fetch all unfilled currently open orders
1100
+ * @param {string} symbol unified market symbol
1101
+ * @param {int} [since] the earliest time in ms to fetch open orders for
1102
+ * @param {int} [limit] the maximum number of open orders structures to retrieve
1103
+ * @param {object} [params] extra parameters specific to the hitbtc api endpoint
1104
+ * @param {string} [params.marginMode] 'cross' or 'isolated' only 'isolated' is supported
1105
+ * @param {bool} [params.margin] true for fetching open margin orders
1106
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
1107
+ */
1108
+ await this.loadMarkets();
1109
+ let market = undefined;
1110
+ const request = {};
1111
+ if (symbol !== undefined) {
1112
+ market = this.market(symbol);
1113
+ request['symbol'] = market['id'];
1114
+ }
1115
+ let marketType = undefined;
1116
+ [marketType, params] = this.handleMarketTypeAndParams('fetchOpenOrdersWs', market, params);
1117
+ let marginMode = undefined;
1118
+ [marginMode, params] = this.handleMarginModeAndParams('fetchOpenOrdersWs', params);
1119
+ if (marketType === 'swap') {
1120
+ return await this.tradeRequest('futures_get_orders', request);
1121
+ }
1122
+ else if ((marketType === 'margin') || (marginMode !== undefined)) {
1123
+ return await this.tradeRequest('margin_get_orders', request);
1124
+ }
1125
+ else {
1126
+ return await this.tradeRequest('spot_get_orders', request);
1127
+ }
1128
+ }
951
1129
  handleBalance(client, message) {
952
1130
  //
953
1131
  // {
@@ -976,7 +1154,52 @@ class hitbtc extends hitbtc$1 {
976
1154
  //
977
1155
  return message;
978
1156
  }
1157
+ handleOrderRequest(client, message) {
1158
+ //
1159
+ // createOrderWs, cancelOrderWs
1160
+ //
1161
+ // {
1162
+ // "jsonrpc": "2.0",
1163
+ // "result": {
1164
+ // "id": 1130310696965,
1165
+ // "client_order_id": "OPC2oyHSkEBqIpPtniLqeW-597hUL3Yo",
1166
+ // "symbol": "ADAUSDT",
1167
+ // "side": "buy",
1168
+ // "status": "new",
1169
+ // "type": "limit",
1170
+ // "time_in_force": "GTC",
1171
+ // "quantity": "4",
1172
+ // "quantity_cumulative": "0",
1173
+ // "price": "0.3300000",
1174
+ // "post_only": false,
1175
+ // "created_at": "2023-11-17T14:58:15.903Z",
1176
+ // "updated_at": "2023-11-17T14:58:15.903Z",
1177
+ // "original_client_order_id": "d6b645556af740b1bd1683400fd9cbce", // spot_replace_order only
1178
+ // "report_type": "new"
1179
+ // "margin_mode": "isolated", // margin and future only
1180
+ // "reduce_only": false, // margin and future only
1181
+ // },
1182
+ // "id": 1700233093414
1183
+ // }
1184
+ //
1185
+ const messageHash = this.safeInteger(message, 'id');
1186
+ const result = this.safeValue(message, 'result', {});
1187
+ if (Array.isArray(result)) {
1188
+ const parsedOrders = [];
1189
+ for (let i = 0; i < result.length; i++) {
1190
+ const parsedOrder = this.parseWsOrder(result[i]);
1191
+ parsedOrders.push(parsedOrder);
1192
+ }
1193
+ client.resolve(parsedOrders, messageHash);
1194
+ }
1195
+ else {
1196
+ const parsedOrder = this.parseWsOrder(result);
1197
+ client.resolve(parsedOrder, messageHash);
1198
+ }
1199
+ return message;
1200
+ }
979
1201
  handleMessage(client, message) {
1202
+ this.handleError(client, message);
980
1203
  let channel = this.safeString2(message, 'ch', 'method');
981
1204
  if (channel !== undefined) {
982
1205
  const splitChannel = channel.split('/');
@@ -1001,10 +1224,22 @@ class hitbtc extends hitbtc$1 {
1001
1224
  }
1002
1225
  }
1003
1226
  else {
1004
- const success = this.safeValue(message, 'result');
1005
- if ((success === true) && !('id' in message)) {
1227
+ const result = this.safeValue(message, 'result');
1228
+ const clientOrderId = this.safeString(result, 'client_order_id');
1229
+ if (clientOrderId !== undefined) {
1230
+ this.handleOrderRequest(client, message);
1231
+ }
1232
+ if ((result === true) && !('id' in message)) {
1006
1233
  this.handleAuthenticate(client, message);
1007
1234
  }
1235
+ if (Array.isArray(result)) {
1236
+ // to do improve this, not very reliable right now
1237
+ const first = this.safeValue(result, 0, {});
1238
+ const arrayLength = result.length;
1239
+ if ((arrayLength === 0) || ('client_order_id' in first)) {
1240
+ this.handleOrderRequest(client, message);
1241
+ }
1242
+ }
1008
1243
  }
1009
1244
  }
1010
1245
  handleAuthenticate(client, message) {
@@ -1029,6 +1264,30 @@ class hitbtc extends hitbtc$1 {
1029
1264
  }
1030
1265
  return message;
1031
1266
  }
1267
+ handleError(client, message) {
1268
+ //
1269
+ // {
1270
+ // jsonrpc: '2.0',
1271
+ // error: {
1272
+ // code: 20001,
1273
+ // message: 'Insufficient funds',
1274
+ // description: 'Check that the funds are sufficient, given commissions'
1275
+ // },
1276
+ // id: 1700228604325
1277
+ // }
1278
+ //
1279
+ const error = this.safeValue(message, 'error');
1280
+ if (error !== undefined) {
1281
+ const code = this.safeValue(error, 'code');
1282
+ const errorMessage = this.safeString(error, 'message');
1283
+ const description = this.safeString(error, 'description');
1284
+ const feedback = this.id + ' ' + description;
1285
+ this.throwExactlyMatchedException(this.exceptions['exact'], code, feedback);
1286
+ this.throwBroadlyMatchedException(this.exceptions['broad'], errorMessage, feedback);
1287
+ throw new errors.ExchangeError(feedback); // unknown message
1288
+ }
1289
+ return undefined;
1290
+ }
1032
1291
  }
1033
1292
 
1034
1293
  module.exports = hitbtc;
@@ -58,7 +58,7 @@ class hollaex extends hollaex$1 {
58
58
  * @param {string} symbol unified symbol of the market to fetch the order book for
59
59
  * @param {int} [limit] the maximum amount of order book entries to return
60
60
  * @param {object} [params] extra parameters specific to the hollaex api endpoint
61
- * @returns {object} A dictionary of [order book structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-book-structure} indexed by market symbols
61
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
62
62
  */
63
63
  await this.loadMarkets();
64
64
  const market = this.market(symbol);
@@ -117,7 +117,7 @@ class hollaex extends hollaex$1 {
117
117
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
118
118
  * @param {int} [limit] the maximum amount of trades to fetch
119
119
  * @param {object} [params] extra parameters specific to the hollaex api endpoint
120
- * @returns {object[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#public-trades}
120
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
121
121
  */
122
122
  await this.loadMarkets();
123
123
  const market = this.market(symbol);
@@ -173,7 +173,7 @@ class hollaex extends hollaex$1 {
173
173
  * @param {int} [since] the earliest time in ms to fetch trades for
174
174
  * @param {int} [limit] the maximum number of trade structures to retrieve
175
175
  * @param {object} [params] extra parameters specific to the hollaex api endpoint
176
- * @returns {object[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure
176
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
177
177
  */
178
178
  await this.loadMarkets();
179
179
  let messageHash = 'usertrade';
@@ -253,7 +253,7 @@ class hollaex extends hollaex$1 {
253
253
  * @param {int} [since] the earliest time in ms to fetch orders for
254
254
  * @param {int} [limit] the maximum number of orde structures to retrieve
255
255
  * @param {object} [params] extra parameters specific to the hollaex api endpoint
256
- * @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
256
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
257
257
  */
258
258
  await this.loadMarkets();
259
259
  let messageHash = 'order';
@@ -371,7 +371,7 @@ class hollaex extends hollaex$1 {
371
371
  * @name hollaex#watchBalance
372
372
  * @description watch balance and get the amount of funds available for trading or funds locked in orders
373
373
  * @param {object} [params] extra parameters specific to the hollaex api endpoint
374
- * @returns {object} a [balance structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#balance-structure}
374
+ * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
375
375
  */
376
376
  const messageHash = 'wallet';
377
377
  return await this.watchPrivate(messageHash, params);
@@ -121,7 +121,7 @@ class htx extends htx$1 {
121
121
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
122
122
  * @param {string} symbol unified symbol of the market to fetch the ticker for
123
123
  * @param {object} [params] extra parameters specific to the huobi api endpoint
124
- * @returns {object} a [ticker structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
124
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
125
125
  */
126
126
  await this.loadMarkets();
127
127
  const market = this.market(symbol);
@@ -191,7 +191,7 @@ class htx extends htx$1 {
191
191
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
192
192
  * @param {int} [limit] the maximum amount of trades to fetch
193
193
  * @param {object} [params] extra parameters specific to the huobi api endpoint
194
- * @returns {object[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#public-trades}
194
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
195
195
  */
196
196
  await this.loadMarkets();
197
197
  const market = this.market(symbol);
@@ -316,7 +316,7 @@ class htx extends htx$1 {
316
316
  * @param {string} symbol unified symbol of the market to fetch the order book for
317
317
  * @param {int} [limit] the maximum amount of order book entries to return
318
318
  * @param {object} [params] extra parameters specific to the huobi api endpoint
319
- * @returns {object} A dictionary of [order book structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-book-structure} indexed by market symbols
319
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
320
320
  */
321
321
  await this.loadMarkets();
322
322
  const market = this.market(symbol);
@@ -646,7 +646,7 @@ class htx extends htx$1 {
646
646
  * @param {int} [since] the earliest time in ms to fetch trades for
647
647
  * @param {int} [limit] the maximum number of trade structures to retrieve
648
648
  * @param {object} [params] extra parameters specific to the huobi api endpoint
649
- * @returns {object[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure
649
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
650
650
  */
651
651
  this.checkRequiredCredentials();
652
652
  await this.loadMarkets();
@@ -749,7 +749,7 @@ class htx extends htx$1 {
749
749
  * @param {int} [since] the earliest time in ms to fetch orders for
750
750
  * @param {int} [limit] the maximum number of orde structures to retrieve
751
751
  * @param {object} [params] extra parameters specific to the huobi api endpoint
752
- * @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
752
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
753
753
  */
754
754
  await this.loadMarkets();
755
755
  let type = undefined;
@@ -1314,7 +1314,7 @@ class htx extends htx$1 {
1314
1314
  * @name huobi#watchBalance
1315
1315
  * @description watch balance and get the amount of funds available for trading or funds locked in orders
1316
1316
  * @param {object} [params] extra parameters specific to the huobi api endpoint
1317
- * @returns {object} a [balance structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#balance-structure}
1317
+ * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
1318
1318
  */
1319
1319
  let type = undefined;
1320
1320
  [type, params] = this.handleMarketTypeAndParams('watchBalance', undefined, params);
@@ -50,7 +50,7 @@ class huobijp extends huobijp$1 {
50
50
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
51
51
  * @param {string} symbol unified symbol of the market to fetch the ticker for
52
52
  * @param {object} [params] extra parameters specific to the huobijp api endpoint
53
- * @returns {object} a [ticker structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
53
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
54
54
  */
55
55
  await this.loadMarkets();
56
56
  const market = this.market(symbol);
@@ -114,7 +114,7 @@ class huobijp extends huobijp$1 {
114
114
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
115
115
  * @param {int} [limit] the maximum amount of trades to fetch
116
116
  * @param {object} [params] extra parameters specific to the huobijp api endpoint
117
- * @returns {object[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#public-trades}
117
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
118
118
  */
119
119
  await this.loadMarkets();
120
120
  const market = this.market(symbol);
@@ -264,7 +264,7 @@ class huobijp extends huobijp$1 {
264
264
  * @param {string} symbol unified symbol of the market to fetch the order book for
265
265
  * @param {int} [limit] the maximum amount of order book entries to return
266
266
  * @param {object} [params] extra parameters specific to the huobijp api endpoint
267
- * @returns {object} A dictionary of [order book structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-book-structure} indexed by market symbols
267
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
268
268
  */
269
269
  if ((limit !== undefined) && (limit !== 150)) {
270
270
  throw new errors.ExchangeError(this.id + ' watchOrderBook accepts limit = 150 only');
@@ -70,7 +70,7 @@ class idex extends idex$1 {
70
70
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
71
71
  * @param {string} symbol unified symbol of the market to fetch the ticker for
72
72
  * @param {object} [params] extra parameters specific to the idex api endpoint
73
- * @returns {object} a [ticker structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
73
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
74
74
  */
75
75
  await this.loadMarkets();
76
76
  const market = this.market(symbol);
@@ -144,7 +144,7 @@ class idex extends idex$1 {
144
144
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
145
145
  * @param {int} [limit] the maximum amount of trades to fetch
146
146
  * @param {object} [params] extra parameters specific to the idex api endpoint
147
- * @returns {object[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#public-trades}
147
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
148
148
  */
149
149
  await this.loadMarkets();
150
150
  const market = this.market(symbol);
@@ -407,7 +407,7 @@ class idex extends idex$1 {
407
407
  * @param {string} symbol unified symbol of the market to fetch the order book for
408
408
  * @param {int} [limit] the maximum amount of order book entries to return
409
409
  * @param {object} [params] extra parameters specific to the idex api endpoint
410
- * @returns {object} A dictionary of [order book structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-book-structure} indexed by market symbols
410
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
411
411
  */
412
412
  await this.loadMarkets();
413
413
  const market = this.market(symbol);
@@ -511,7 +511,7 @@ class idex extends idex$1 {
511
511
  * @param {int} [since] the earliest time in ms to fetch orders for
512
512
  * @param {int} [limit] the maximum number of orde structures to retrieve
513
513
  * @param {object} [params] extra parameters specific to the idex api endpoint
514
- * @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
514
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
515
515
  */
516
516
  await this.loadMarkets();
517
517
  const name = 'orders';
@@ -41,7 +41,7 @@ class independentreserve extends independentreserve$1 {
41
41
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
42
42
  * @param {int} [limit] the maximum amount of trades to fetch
43
43
  * @param {object} [params] extra parameters specific to the independentreserve api endpoint
44
- * @returns {object[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#public-trades}
44
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
45
45
  */
46
46
  await this.loadMarkets();
47
47
  const market = this.market(symbol);
@@ -124,7 +124,7 @@ class independentreserve extends independentreserve$1 {
124
124
  * @param {string} symbol unified symbol of the market to fetch the order book for
125
125
  * @param {int} [limit] the maximum amount of order book entries to return
126
126
  * @param {object} [params] extra parameters specific to the independentreserve api endpoint
127
- * @returns {object} A dictionary of [order book structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-book-structure} indexed by market symbols
127
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
128
128
  */
129
129
  await this.loadMarkets();
130
130
  const market = this.market(symbol);
@@ -115,7 +115,7 @@ class kraken extends kraken$1 {
115
115
  * @param {float} amount how much of currency you want to trade in units of base currency
116
116
  * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
117
117
  * @param {object} [params] extra parameters specific to the kraken api endpoint
118
- * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
118
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
119
119
  */
120
120
  await this.loadMarkets();
121
121
  const token = await this.authenticate();
@@ -172,7 +172,7 @@ class kraken extends kraken$1 {
172
172
  * @param {float} amount how much of the currency you want to trade in units of the base currency
173
173
  * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
174
174
  * @param {object} [params] extra parameters specific to the kraken api endpoint
175
- * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
175
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
176
176
  */
177
177
  await this.loadMarkets();
178
178
  const token = await this.authenticate();
@@ -200,7 +200,7 @@ class kraken extends kraken$1 {
200
200
  * @param {string[]} ids order ids
201
201
  * @param {string} symbol unified market symbol, default is undefined
202
202
  * @param {object} [params] extra parameters specific to the kraken api endpoint
203
- * @returns {object} an list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
203
+ * @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
204
204
  */
205
205
  await this.loadMarkets();
206
206
  const token = await this.authenticate();
@@ -224,7 +224,7 @@ class kraken extends kraken$1 {
224
224
  * @param {string} id order id
225
225
  * @param {string} symbol unified symbol of the market the order was made in
226
226
  * @param {object} [params] extra parameters specific to the kraken api endpoint
227
- * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
227
+ * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
228
228
  */
229
229
  await this.loadMarkets();
230
230
  const token = await this.authenticate();
@@ -261,7 +261,7 @@ class kraken extends kraken$1 {
261
261
  * @description cancel all open orders
262
262
  * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
263
263
  * @param {object} [params] extra parameters specific to the kraken api endpoint
264
- * @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
264
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
265
265
  */
266
266
  if (symbol !== undefined) {
267
267
  throw new errors.NotSupported(this.id + ' cancelAllOrdersWs () does not support cancelling orders in a specific market.');
@@ -466,7 +466,7 @@ class kraken extends kraken$1 {
466
466
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
467
467
  * @param {string} symbol unified symbol of the market to fetch the ticker for
468
468
  * @param {object} [params] extra parameters specific to the kraken api endpoint
469
- * @returns {object} a [ticker structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
469
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
470
470
  */
471
471
  return await this.watchPublic('ticker', symbol, params);
472
472
  }
@@ -479,7 +479,7 @@ class kraken extends kraken$1 {
479
479
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
480
480
  * @param {int} [limit] the maximum amount of trades to fetch
481
481
  * @param {object} [params] extra parameters specific to the kraken api endpoint
482
- * @returns {object[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#public-trades}
482
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
483
483
  */
484
484
  await this.loadMarkets();
485
485
  symbol = this.symbol(symbol);
@@ -498,7 +498,7 @@ class kraken extends kraken$1 {
498
498
  * @param {string} symbol unified symbol of the market to fetch the order book for
499
499
  * @param {int} [limit] the maximum amount of order book entries to return
500
500
  * @param {object} [params] extra parameters specific to the kraken api endpoint
501
- * @returns {object} A dictionary of [order book structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-book-structure} indexed by market symbols
501
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
502
502
  */
503
503
  const name = 'book';
504
504
  const request = {};
@@ -830,7 +830,7 @@ class kraken extends kraken$1 {
830
830
  * @param {int} [since] the earliest time in ms to fetch trades for
831
831
  * @param {int} [limit] the maximum number of trade structures to retrieve
832
832
  * @param {object} [params] extra parameters specific to the kraken api endpoint
833
- * @returns {object[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure
833
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
834
834
  */
835
835
  return await this.watchPrivate('ownTrades', symbol, since, limit, params);
836
836
  }
@@ -992,7 +992,7 @@ class kraken extends kraken$1 {
992
992
  * @param {int} [since] the earliest time in ms to fetch orders for
993
993
  * @param {int} [limit] the maximum number of orde structures to retrieve
994
994
  * @param {object} [params] extra parameters specific to the kraken api endpoint
995
- * @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
995
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
996
996
  */
997
997
  return await this.watchPrivate('openOrders', symbol, since, limit, params);
998
998
  }