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
@@ -8,7 +8,7 @@
8
8
  import hitbtcRest from '../hitbtc.js';
9
9
  import { ArrayCache, ArrayCacheBySymbolById, ArrayCacheByTimestamp } from '../base/ws/Cache.js';
10
10
  import { sha256 } from '../static_dependencies/noble-hashes/sha256.js';
11
- import { AuthenticationError } from '../base/errors.js';
11
+ import { AuthenticationError, ExchangeError, NotSupported } from '../base/errors.js';
12
12
  // ---------------------------------------------------------------------------
13
13
  export default class hitbtc extends hitbtcRest {
14
14
  describe() {
@@ -23,6 +23,10 @@ export default class hitbtc extends hitbtcRest {
23
23
  'watchOrders': true,
24
24
  'watchOHLCV': true,
25
25
  'watchMyTrades': false,
26
+ 'createOrderWs': true,
27
+ 'cancelOrderWs': true,
28
+ 'fetchOpenOrdersWs': true,
29
+ 'cancelAllOrdersWs': true,
26
30
  },
27
31
  'urls': {
28
32
  'api': {
@@ -153,6 +157,25 @@ export default class hitbtc extends hitbtcRest {
153
157
  };
154
158
  return await this.watch(url, messageHash, subscribe, messageHash);
155
159
  }
160
+ async tradeRequest(name, params = {}) {
161
+ /**
162
+ * @ignore
163
+ * @method
164
+ * @param {string} name websocket endpoint name
165
+ * @param {string} [symbol] unified CCXT symbol
166
+ * @param {object} [params] extra parameters specific to the hitbtc api
167
+ */
168
+ await this.loadMarkets();
169
+ await this.authenticate();
170
+ const url = this.urls['api']['ws']['private'];
171
+ const messageHash = this.nonce();
172
+ const subscribe = {
173
+ 'method': name,
174
+ 'params': params,
175
+ 'id': messageHash,
176
+ };
177
+ return await this.watch(url, messageHash, subscribe, messageHash);
178
+ }
156
179
  async watchOrderBook(symbol, limit = undefined, params = {}) {
157
180
  /**
158
181
  * @method
@@ -462,7 +485,7 @@ export default class hitbtc extends hitbtcRest {
462
485
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
463
486
  * @param {int} [limit] the maximum amount of trades to fetch
464
487
  * @param {object} [params] extra parameters specific to the hitbtc api endpoint
465
- * @returns {object[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#public-trades}
488
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
466
489
  */
467
490
  await this.loadMarkets();
468
491
  const market = this.market(symbol);
@@ -898,6 +921,15 @@ export default class hitbtc extends hitbtcRest {
898
921
  const trade = this.parseWsOrderTrade(order, market);
899
922
  trades = [trade];
900
923
  }
924
+ const rawStatus = this.safeString(order, 'status');
925
+ const report_type = this.safeString(order, 'report_type');
926
+ let parsedStatus = undefined;
927
+ if (report_type === 'canceled') {
928
+ parsedStatus = this.parseOrderStatus(report_type);
929
+ }
930
+ else {
931
+ parsedStatus = this.parseOrderStatus(rawStatus);
932
+ }
901
933
  return this.safeOrder({
902
934
  'info': order,
903
935
  'id': this.safeString(order, 'id'),
@@ -916,7 +948,7 @@ export default class hitbtc extends hitbtcRest {
916
948
  'filled': undefined,
917
949
  'remaining': undefined,
918
950
  'cost': undefined,
919
- 'status': this.parseOrderStatus(this.safeString(order, 'status')),
951
+ 'status': parsedStatus,
920
952
  'average': undefined,
921
953
  'trades': trades,
922
954
  'fee': undefined,
@@ -951,6 +983,152 @@ export default class hitbtc extends hitbtcRest {
951
983
  };
952
984
  return await this.subscribePrivate(name, undefined, this.extend(request, params));
953
985
  }
986
+ async createOrderWs(symbol, type, side, amount, price = undefined, params = {}) {
987
+ /**
988
+ * @method
989
+ * @name hitbtc#createOrder
990
+ * @description create a trade order
991
+ * @see https://api.hitbtc.com/#create-new-spot-order
992
+ * @see https://api.hitbtc.com/#create-margin-order
993
+ * @see https://api.hitbtc.com/#create-futures-order
994
+ * @param {string} symbol unified symbol of the market to create an order in
995
+ * @param {string} type 'market' or 'limit'
996
+ * @param {string} side 'buy' or 'sell'
997
+ * @param {float} amount how much of currency you want to trade in units of base currency
998
+ * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
999
+ * @param {object} [params] extra parameters specific to the hitbtc api endpoint
1000
+ * @param {string} [params.marginMode] 'cross' or 'isolated' only 'isolated' is supported for spot-margin, swap supports both, default is 'cross'
1001
+ * @param {bool} [params.margin] true for creating a margin order
1002
+ * @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
1003
+ * @param {bool} [params.postOnly] if true, the order will only be posted to the order book and not executed immediately
1004
+ * @param {string} [params.timeInForce] "GTC", "IOC", "FOK", "Day", "GTD"
1005
+ * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
1006
+ */
1007
+ await this.loadMarkets();
1008
+ const market = this.market(symbol);
1009
+ let request = undefined;
1010
+ let marketType = undefined;
1011
+ [marketType, params] = this.handleMarketTypeAndParams('createOrder', market, params);
1012
+ let marginMode = undefined;
1013
+ [marginMode, params] = this.handleMarginModeAndParams('createOrder', params);
1014
+ [request, params] = this.createOrderRequest(market, marketType, type, side, amount, price, marginMode, params);
1015
+ request = this.extend(request, params);
1016
+ if (marketType === 'swap') {
1017
+ return await this.tradeRequest('futures_new_order', request);
1018
+ }
1019
+ else if ((marketType === 'margin') || (marginMode !== undefined)) {
1020
+ return await this.tradeRequest('margin_new_order', request);
1021
+ }
1022
+ else {
1023
+ return await this.tradeRequest('spot_new_order', request);
1024
+ }
1025
+ }
1026
+ async cancelOrderWs(id, symbol = undefined, params = {}) {
1027
+ /**
1028
+ * @method
1029
+ * @name hitbtc#cancelOrderWs
1030
+ * @see https://api.hitbtc.com/#cancel-spot-order-2
1031
+ * @see https://api.hitbtc.com/#cancel-futures-order-2
1032
+ * @see https://api.hitbtc.com/#cancel-margin-order-2
1033
+ * @description cancels an open order
1034
+ * @param {string} id order id
1035
+ * @param {string} symbol unified symbol of the market the order was made in
1036
+ * @param {object} [params] extra parameters specific to the hitbtc api endpoint
1037
+ * @param {string} [params.marginMode] 'cross' or 'isolated' only 'isolated' is supported
1038
+ * @param {bool} [params.margin] true for canceling a margin order
1039
+ * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
1040
+ */
1041
+ await this.loadMarkets();
1042
+ let market = undefined;
1043
+ let request = {
1044
+ 'client_order_id': id,
1045
+ };
1046
+ if (symbol !== undefined) {
1047
+ market = this.market(symbol);
1048
+ }
1049
+ let marketType = undefined;
1050
+ [marketType, params] = this.handleMarketTypeAndParams('cancelOrderWs', market, params);
1051
+ const [marginMode, query] = this.handleMarginModeAndParams('cancelOrderWs', params);
1052
+ request = this.extend(request, query);
1053
+ if (marketType === 'swap') {
1054
+ return await this.tradeRequest('futures_cancel_order', request);
1055
+ }
1056
+ else if ((marketType === 'margin') || (marginMode !== undefined)) {
1057
+ return await this.tradeRequest('margin_cancel_order', request);
1058
+ }
1059
+ else {
1060
+ return await this.tradeRequest('spot_cancel_order', request);
1061
+ }
1062
+ }
1063
+ async cancelAllOrdersWs(symbol = undefined, params = {}) {
1064
+ /**
1065
+ * @method
1066
+ * @name hitbtc#cancelAllOrdersWs
1067
+ * @see https://api.hitbtc.com/#cancel-spot-orders
1068
+ * @see https://api.hitbtc.com/#cancel-futures-order-3
1069
+ * @description cancel all open orders
1070
+ * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
1071
+ * @param {object} [params] extra parameters specific to the hitbtc api endpoint
1072
+ * @param {string} [params.marginMode] 'cross' or 'isolated' only 'isolated' is supported
1073
+ * @param {bool} [params.margin] true for canceling margin orders
1074
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
1075
+ */
1076
+ await this.loadMarkets();
1077
+ let market = undefined;
1078
+ if (symbol !== undefined) {
1079
+ market = this.market(symbol);
1080
+ }
1081
+ let marketType = undefined;
1082
+ [marketType, params] = this.handleMarketTypeAndParams('cancelAllOrdersWs', market, params);
1083
+ let marginMode = undefined;
1084
+ [marginMode, params] = this.handleMarginModeAndParams('cancelAllOrdersWs', params);
1085
+ if (marketType === 'swap') {
1086
+ return await this.tradeRequest('futures_cancel_orders', params);
1087
+ }
1088
+ else if ((marketType === 'margin') || (marginMode !== undefined)) {
1089
+ throw new NotSupported(this.id + ' cancelAllOrdersWs is not supported for margin orders');
1090
+ }
1091
+ else {
1092
+ return await this.tradeRequest('spot_cancel_orders', params);
1093
+ }
1094
+ }
1095
+ async fetchOpenOrdersWs(symbol = undefined, since = undefined, limit = undefined, params = {}) {
1096
+ /**
1097
+ * @method
1098
+ * @name hitbtc#fetchOpenOrdersWs
1099
+ * @see https://api.hitbtc.com/#get-active-futures-orders-2
1100
+ * @see https://api.hitbtc.com/#get-margin-orders
1101
+ * @see https://api.hitbtc.com/#get-active-spot-orders
1102
+ * @description fetch all unfilled currently open orders
1103
+ * @param {string} symbol unified market symbol
1104
+ * @param {int} [since] the earliest time in ms to fetch open orders for
1105
+ * @param {int} [limit] the maximum number of open orders structures to retrieve
1106
+ * @param {object} [params] extra parameters specific to the hitbtc api endpoint
1107
+ * @param {string} [params.marginMode] 'cross' or 'isolated' only 'isolated' is supported
1108
+ * @param {bool} [params.margin] true for fetching open margin orders
1109
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
1110
+ */
1111
+ await this.loadMarkets();
1112
+ let market = undefined;
1113
+ const request = {};
1114
+ if (symbol !== undefined) {
1115
+ market = this.market(symbol);
1116
+ request['symbol'] = market['id'];
1117
+ }
1118
+ let marketType = undefined;
1119
+ [marketType, params] = this.handleMarketTypeAndParams('fetchOpenOrdersWs', market, params);
1120
+ let marginMode = undefined;
1121
+ [marginMode, params] = this.handleMarginModeAndParams('fetchOpenOrdersWs', params);
1122
+ if (marketType === 'swap') {
1123
+ return await this.tradeRequest('futures_get_orders', request);
1124
+ }
1125
+ else if ((marketType === 'margin') || (marginMode !== undefined)) {
1126
+ return await this.tradeRequest('margin_get_orders', request);
1127
+ }
1128
+ else {
1129
+ return await this.tradeRequest('spot_get_orders', request);
1130
+ }
1131
+ }
954
1132
  handleBalance(client, message) {
955
1133
  //
956
1134
  // {
@@ -979,7 +1157,52 @@ export default class hitbtc extends hitbtcRest {
979
1157
  //
980
1158
  return message;
981
1159
  }
1160
+ handleOrderRequest(client, message) {
1161
+ //
1162
+ // createOrderWs, cancelOrderWs
1163
+ //
1164
+ // {
1165
+ // "jsonrpc": "2.0",
1166
+ // "result": {
1167
+ // "id": 1130310696965,
1168
+ // "client_order_id": "OPC2oyHSkEBqIpPtniLqeW-597hUL3Yo",
1169
+ // "symbol": "ADAUSDT",
1170
+ // "side": "buy",
1171
+ // "status": "new",
1172
+ // "type": "limit",
1173
+ // "time_in_force": "GTC",
1174
+ // "quantity": "4",
1175
+ // "quantity_cumulative": "0",
1176
+ // "price": "0.3300000",
1177
+ // "post_only": false,
1178
+ // "created_at": "2023-11-17T14:58:15.903Z",
1179
+ // "updated_at": "2023-11-17T14:58:15.903Z",
1180
+ // "original_client_order_id": "d6b645556af740b1bd1683400fd9cbce", // spot_replace_order only
1181
+ // "report_type": "new"
1182
+ // "margin_mode": "isolated", // margin and future only
1183
+ // "reduce_only": false, // margin and future only
1184
+ // },
1185
+ // "id": 1700233093414
1186
+ // }
1187
+ //
1188
+ const messageHash = this.safeInteger(message, 'id');
1189
+ const result = this.safeValue(message, 'result', {});
1190
+ if (Array.isArray(result)) {
1191
+ const parsedOrders = [];
1192
+ for (let i = 0; i < result.length; i++) {
1193
+ const parsedOrder = this.parseWsOrder(result[i]);
1194
+ parsedOrders.push(parsedOrder);
1195
+ }
1196
+ client.resolve(parsedOrders, messageHash);
1197
+ }
1198
+ else {
1199
+ const parsedOrder = this.parseWsOrder(result);
1200
+ client.resolve(parsedOrder, messageHash);
1201
+ }
1202
+ return message;
1203
+ }
982
1204
  handleMessage(client, message) {
1205
+ this.handleError(client, message);
983
1206
  let channel = this.safeString2(message, 'ch', 'method');
984
1207
  if (channel !== undefined) {
985
1208
  const splitChannel = channel.split('/');
@@ -1004,10 +1227,22 @@ export default class hitbtc extends hitbtcRest {
1004
1227
  }
1005
1228
  }
1006
1229
  else {
1007
- const success = this.safeValue(message, 'result');
1008
- if ((success === true) && !('id' in message)) {
1230
+ const result = this.safeValue(message, 'result');
1231
+ const clientOrderId = this.safeString(result, 'client_order_id');
1232
+ if (clientOrderId !== undefined) {
1233
+ this.handleOrderRequest(client, message);
1234
+ }
1235
+ if ((result === true) && !('id' in message)) {
1009
1236
  this.handleAuthenticate(client, message);
1010
1237
  }
1238
+ if (Array.isArray(result)) {
1239
+ // to do improve this, not very reliable right now
1240
+ const first = this.safeValue(result, 0, {});
1241
+ const arrayLength = result.length;
1242
+ if ((arrayLength === 0) || ('client_order_id' in first)) {
1243
+ this.handleOrderRequest(client, message);
1244
+ }
1245
+ }
1011
1246
  }
1012
1247
  }
1013
1248
  handleAuthenticate(client, message) {
@@ -1032,4 +1267,28 @@ export default class hitbtc extends hitbtcRest {
1032
1267
  }
1033
1268
  return message;
1034
1269
  }
1270
+ handleError(client, message) {
1271
+ //
1272
+ // {
1273
+ // jsonrpc: '2.0',
1274
+ // error: {
1275
+ // code: 20001,
1276
+ // message: 'Insufficient funds',
1277
+ // description: 'Check that the funds are sufficient, given commissions'
1278
+ // },
1279
+ // id: 1700228604325
1280
+ // }
1281
+ //
1282
+ const error = this.safeValue(message, 'error');
1283
+ if (error !== undefined) {
1284
+ const code = this.safeValue(error, 'code');
1285
+ const errorMessage = this.safeString(error, 'message');
1286
+ const description = this.safeString(error, 'description');
1287
+ const feedback = this.id + ' ' + description;
1288
+ this.throwExactlyMatchedException(this.exceptions['exact'], code, feedback);
1289
+ this.throwBroadlyMatchedException(this.exceptions['broad'], errorMessage, feedback);
1290
+ throw new ExchangeError(feedback); // unknown message
1291
+ }
1292
+ return undefined;
1293
+ }
1035
1294
  }
@@ -61,7 +61,7 @@ export default class hollaex extends hollaexRest {
61
61
  * @param {string} symbol unified symbol of the market to fetch the order book for
62
62
  * @param {int} [limit] the maximum amount of order book entries to return
63
63
  * @param {object} [params] extra parameters specific to the hollaex api endpoint
64
- * @returns {object} A dictionary of [order book structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-book-structure} indexed by market symbols
64
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
65
65
  */
66
66
  await this.loadMarkets();
67
67
  const market = this.market(symbol);
@@ -120,7 +120,7 @@ export default class hollaex extends hollaexRest {
120
120
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
121
121
  * @param {int} [limit] the maximum amount of trades to fetch
122
122
  * @param {object} [params] extra parameters specific to the hollaex api endpoint
123
- * @returns {object[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#public-trades}
123
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
124
124
  */
125
125
  await this.loadMarkets();
126
126
  const market = this.market(symbol);
@@ -176,7 +176,7 @@ export default class hollaex extends hollaexRest {
176
176
  * @param {int} [since] the earliest time in ms to fetch trades for
177
177
  * @param {int} [limit] the maximum number of trade structures to retrieve
178
178
  * @param {object} [params] extra parameters specific to the hollaex api endpoint
179
- * @returns {object[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure
179
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
180
180
  */
181
181
  await this.loadMarkets();
182
182
  let messageHash = 'usertrade';
@@ -256,7 +256,7 @@ export default class hollaex extends hollaexRest {
256
256
  * @param {int} [since] the earliest time in ms to fetch orders for
257
257
  * @param {int} [limit] the maximum number of orde structures to retrieve
258
258
  * @param {object} [params] extra parameters specific to the hollaex api endpoint
259
- * @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
259
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
260
260
  */
261
261
  await this.loadMarkets();
262
262
  let messageHash = 'order';
@@ -374,7 +374,7 @@ export default class hollaex extends hollaexRest {
374
374
  * @name hollaex#watchBalance
375
375
  * @description watch balance and get the amount of funds available for trading or funds locked in orders
376
376
  * @param {object} [params] extra parameters specific to the hollaex api endpoint
377
- * @returns {object} a [balance structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#balance-structure}
377
+ * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
378
378
  */
379
379
  const messageHash = 'wallet';
380
380
  return await this.watchPrivate(messageHash, params);
package/js/src/pro/htx.js CHANGED
@@ -124,7 +124,7 @@ export default class htx extends htxRest {
124
124
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
125
125
  * @param {string} symbol unified symbol of the market to fetch the ticker for
126
126
  * @param {object} [params] extra parameters specific to the huobi api endpoint
127
- * @returns {object} a [ticker structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
127
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
128
128
  */
129
129
  await this.loadMarkets();
130
130
  const market = this.market(symbol);
@@ -194,7 +194,7 @@ export default class htx extends htxRest {
194
194
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
195
195
  * @param {int} [limit] the maximum amount of trades to fetch
196
196
  * @param {object} [params] extra parameters specific to the huobi api endpoint
197
- * @returns {object[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#public-trades}
197
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
198
198
  */
199
199
  await this.loadMarkets();
200
200
  const market = this.market(symbol);
@@ -319,7 +319,7 @@ export default class htx extends htxRest {
319
319
  * @param {string} symbol unified symbol of the market to fetch the order book for
320
320
  * @param {int} [limit] the maximum amount of order book entries to return
321
321
  * @param {object} [params] extra parameters specific to the huobi api endpoint
322
- * @returns {object} A dictionary of [order book structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-book-structure} indexed by market symbols
322
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
323
323
  */
324
324
  await this.loadMarkets();
325
325
  const market = this.market(symbol);
@@ -649,7 +649,7 @@ export default class htx extends htxRest {
649
649
  * @param {int} [since] the earliest time in ms to fetch trades for
650
650
  * @param {int} [limit] the maximum number of trade structures to retrieve
651
651
  * @param {object} [params] extra parameters specific to the huobi api endpoint
652
- * @returns {object[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure
652
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
653
653
  */
654
654
  this.checkRequiredCredentials();
655
655
  await this.loadMarkets();
@@ -752,7 +752,7 @@ export default class htx extends htxRest {
752
752
  * @param {int} [since] the earliest time in ms to fetch orders for
753
753
  * @param {int} [limit] the maximum number of orde structures to retrieve
754
754
  * @param {object} [params] extra parameters specific to the huobi api endpoint
755
- * @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
755
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
756
756
  */
757
757
  await this.loadMarkets();
758
758
  let type = undefined;
@@ -1317,7 +1317,7 @@ export default class htx extends htxRest {
1317
1317
  * @name huobi#watchBalance
1318
1318
  * @description watch balance and get the amount of funds available for trading or funds locked in orders
1319
1319
  * @param {object} [params] extra parameters specific to the huobi api endpoint
1320
- * @returns {object} a [balance structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#balance-structure}
1320
+ * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
1321
1321
  */
1322
1322
  let type = undefined;
1323
1323
  [type, params] = this.handleMarketTypeAndParams('watchBalance', undefined, params);
@@ -53,7 +53,7 @@ export default class huobijp extends huobijpRest {
53
53
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
54
54
  * @param {string} symbol unified symbol of the market to fetch the ticker for
55
55
  * @param {object} [params] extra parameters specific to the huobijp api endpoint
56
- * @returns {object} a [ticker structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
56
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
57
57
  */
58
58
  await this.loadMarkets();
59
59
  const market = this.market(symbol);
@@ -117,7 +117,7 @@ export default class huobijp extends huobijpRest {
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 huobijp 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);
@@ -267,7 +267,7 @@ export default class huobijp extends huobijpRest {
267
267
  * @param {string} symbol unified symbol of the market to fetch the order book for
268
268
  * @param {int} [limit] the maximum amount of order book entries to return
269
269
  * @param {object} [params] extra parameters specific to the huobijp api endpoint
270
- * @returns {object} A dictionary of [order book structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-book-structure} indexed by market symbols
270
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
271
271
  */
272
272
  if ((limit !== undefined) && (limit !== 150)) {
273
273
  throw new ExchangeError(this.id + ' watchOrderBook accepts limit = 150 only');
@@ -73,7 +73,7 @@ export default class idex extends idexRest {
73
73
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
74
74
  * @param {string} symbol unified symbol of the market to fetch the ticker for
75
75
  * @param {object} [params] extra parameters specific to the idex api endpoint
76
- * @returns {object} a [ticker structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
76
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
77
77
  */
78
78
  await this.loadMarkets();
79
79
  const market = this.market(symbol);
@@ -147,7 +147,7 @@ export default class idex extends idexRest {
147
147
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
148
148
  * @param {int} [limit] the maximum amount of trades to fetch
149
149
  * @param {object} [params] extra parameters specific to the idex api endpoint
150
- * @returns {object[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#public-trades}
150
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
151
151
  */
152
152
  await this.loadMarkets();
153
153
  const market = this.market(symbol);
@@ -410,7 +410,7 @@ export default class idex extends idexRest {
410
410
  * @param {string} symbol unified symbol of the market to fetch the order book for
411
411
  * @param {int} [limit] the maximum amount of order book entries to return
412
412
  * @param {object} [params] extra parameters specific to the idex api endpoint
413
- * @returns {object} A dictionary of [order book structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-book-structure} indexed by market symbols
413
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
414
414
  */
415
415
  await this.loadMarkets();
416
416
  const market = this.market(symbol);
@@ -514,7 +514,7 @@ export default class idex extends idexRest {
514
514
  * @param {int} [since] the earliest time in ms to fetch orders for
515
515
  * @param {int} [limit] the maximum number of orde structures to retrieve
516
516
  * @param {object} [params] extra parameters specific to the idex api endpoint
517
- * @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
517
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
518
518
  */
519
519
  await this.loadMarkets();
520
520
  const name = 'orders';
@@ -44,7 +44,7 @@ export default class independentreserve extends independentreserveRest {
44
44
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
45
45
  * @param {int} [limit] the maximum amount of trades to fetch
46
46
  * @param {object} [params] extra parameters specific to the independentreserve api endpoint
47
- * @returns {object[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#public-trades}
47
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
48
48
  */
49
49
  await this.loadMarkets();
50
50
  const market = this.market(symbol);
@@ -127,7 +127,7 @@ export default class independentreserve extends independentreserveRest {
127
127
  * @param {string} symbol unified symbol of the market to fetch the order book for
128
128
  * @param {int} [limit] the maximum amount of order book entries to return
129
129
  * @param {object} [params] extra parameters specific to the independentreserve api endpoint
130
- * @returns {object} A dictionary of [order book structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-book-structure} indexed by market symbols
130
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
131
131
  */
132
132
  await this.loadMarkets();
133
133
  const market = this.market(symbol);
@@ -118,7 +118,7 @@ export default class kraken extends krakenRest {
118
118
  * @param {float} amount how much of currency you want to trade in units of base currency
119
119
  * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
120
120
  * @param {object} [params] extra parameters specific to the kraken api endpoint
121
- * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
121
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
122
122
  */
123
123
  await this.loadMarkets();
124
124
  const token = await this.authenticate();
@@ -175,7 +175,7 @@ export default class kraken extends krakenRest {
175
175
  * @param {float} amount how much of the currency you want to trade in units of the base currency
176
176
  * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
177
177
  * @param {object} [params] extra parameters specific to the kraken api endpoint
178
- * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
178
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
179
179
  */
180
180
  await this.loadMarkets();
181
181
  const token = await this.authenticate();
@@ -203,7 +203,7 @@ export default class kraken extends krakenRest {
203
203
  * @param {string[]} ids order ids
204
204
  * @param {string} symbol unified market symbol, default is undefined
205
205
  * @param {object} [params] extra parameters specific to the kraken api endpoint
206
- * @returns {object} an list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
206
+ * @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
207
207
  */
208
208
  await this.loadMarkets();
209
209
  const token = await this.authenticate();
@@ -227,7 +227,7 @@ export default class kraken extends krakenRest {
227
227
  * @param {string} id order id
228
228
  * @param {string} symbol unified symbol of the market the order was made in
229
229
  * @param {object} [params] extra parameters specific to the kraken api endpoint
230
- * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
230
+ * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
231
231
  */
232
232
  await this.loadMarkets();
233
233
  const token = await this.authenticate();
@@ -264,7 +264,7 @@ export default class kraken extends krakenRest {
264
264
  * @description cancel all open orders
265
265
  * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
266
266
  * @param {object} [params] extra parameters specific to the kraken api endpoint
267
- * @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
267
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
268
268
  */
269
269
  if (symbol !== undefined) {
270
270
  throw new NotSupported(this.id + ' cancelAllOrdersWs () does not support cancelling orders in a specific market.');
@@ -469,7 +469,7 @@ export default class kraken extends krakenRest {
469
469
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
470
470
  * @param {string} symbol unified symbol of the market to fetch the ticker for
471
471
  * @param {object} [params] extra parameters specific to the kraken api endpoint
472
- * @returns {object} a [ticker structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
472
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
473
473
  */
474
474
  return await this.watchPublic('ticker', symbol, params);
475
475
  }
@@ -482,7 +482,7 @@ export default class kraken extends krakenRest {
482
482
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
483
483
  * @param {int} [limit] the maximum amount of trades to fetch
484
484
  * @param {object} [params] extra parameters specific to the kraken api endpoint
485
- * @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}
486
486
  */
487
487
  await this.loadMarkets();
488
488
  symbol = this.symbol(symbol);
@@ -501,7 +501,7 @@ export default class kraken extends krakenRest {
501
501
  * @param {string} symbol unified symbol of the market to fetch the order book for
502
502
  * @param {int} [limit] the maximum amount of order book entries to return
503
503
  * @param {object} [params] extra parameters specific to the kraken api endpoint
504
- * @returns {object} A dictionary of [order book structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-book-structure} indexed by market symbols
504
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
505
505
  */
506
506
  const name = 'book';
507
507
  const request = {};
@@ -833,7 +833,7 @@ export default class kraken extends krakenRest {
833
833
  * @param {int} [since] the earliest time in ms to fetch trades for
834
834
  * @param {int} [limit] the maximum number of trade structures to retrieve
835
835
  * @param {object} [params] extra parameters specific to the kraken api endpoint
836
- * @returns {object[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure
836
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
837
837
  */
838
838
  return await this.watchPrivate('ownTrades', symbol, since, limit, params);
839
839
  }
@@ -995,7 +995,7 @@ export default class kraken extends krakenRest {
995
995
  * @param {int} [since] the earliest time in ms to fetch orders for
996
996
  * @param {int} [limit] the maximum number of orde structures to retrieve
997
997
  * @param {object} [params] extra parameters specific to the kraken api endpoint
998
- * @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
998
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
999
999
  */
1000
1000
  return await this.watchPrivate('openOrders', symbol, since, limit, params);
1001
1001
  }
@@ -29,6 +29,7 @@ export default class krakenfutures extends krakenfuturesRest {
29
29
  handleBalance(client: Client, message: any): void;
30
30
  handleMyTrades(client: Client, message: any): void;
31
31
  parseWsMyTrade(trade: any, market?: any): import("../base/types.js").Trade;
32
+ handleErrorMessage(client: Client, message: any): void;
32
33
  handleMessage(client: any, message: any): any;
33
34
  handleAuthenticate(client: Client, message: any): any;
34
35
  }