ccxt 4.4.30 → 4.4.32

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 (496) hide show
  1. package/README.md +9 -3
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +1 -1
  4. package/dist/cjs/src/ace.js +123 -123
  5. package/dist/cjs/src/alpaca.js +237 -237
  6. package/dist/cjs/src/ascendex.js +342 -341
  7. package/dist/cjs/src/bigone.js +242 -242
  8. package/dist/cjs/src/binance.js +1339 -1291
  9. package/dist/cjs/src/bingx.js +639 -639
  10. package/dist/cjs/src/bit2c.js +111 -111
  11. package/dist/cjs/src/bitbank.js +142 -142
  12. package/dist/cjs/src/bitbns.js +140 -140
  13. package/dist/cjs/src/bitfinex.js +231 -231
  14. package/dist/cjs/src/bitfinex2.js +403 -403
  15. package/dist/cjs/src/bitflyer.js +184 -184
  16. package/dist/cjs/src/bitget.js +848 -846
  17. package/dist/cjs/src/bithumb.js +125 -124
  18. package/dist/cjs/src/bitmart.js +525 -525
  19. package/dist/cjs/src/bitmex.js +317 -317
  20. package/dist/cjs/src/bitopro.js +221 -221
  21. package/dist/cjs/src/bitrue.js +315 -315
  22. package/dist/cjs/src/bitso.js +220 -220
  23. package/dist/cjs/src/bitstamp.js +251 -251
  24. package/dist/cjs/src/bitteam.js +183 -183
  25. package/dist/cjs/src/bitvavo.js +247 -251
  26. package/dist/cjs/src/bl3p.js +82 -82
  27. package/dist/cjs/src/blockchaincom.js +211 -211
  28. package/dist/cjs/src/blofin.js +332 -331
  29. package/dist/cjs/src/btcalpha.js +166 -166
  30. package/dist/cjs/src/btcbox.js +108 -108
  31. package/dist/cjs/src/btcmarkets.js +198 -198
  32. package/dist/cjs/src/btcturk.js +124 -124
  33. package/dist/cjs/src/bybit.js +906 -900
  34. package/dist/cjs/src/cex.js +227 -226
  35. package/dist/cjs/src/coinbase.js +481 -481
  36. package/dist/cjs/src/coinbaseexchange.js +274 -274
  37. package/dist/cjs/src/coinbaseinternational.js +304 -304
  38. package/dist/cjs/src/coincatch.js +650 -650
  39. package/dist/cjs/src/coincheck.js +113 -113
  40. package/dist/cjs/src/coinex.js +611 -601
  41. package/dist/cjs/src/coinlist.js +304 -303
  42. package/dist/cjs/src/coinmate.js +162 -161
  43. package/dist/cjs/src/coinmetro.js +187 -187
  44. package/dist/cjs/src/coinone.js +124 -123
  45. package/dist/cjs/src/coinsph.js +237 -237
  46. package/dist/cjs/src/coinspot.js +82 -82
  47. package/dist/cjs/src/cryptocom.js +342 -341
  48. package/dist/cjs/src/currencycom.js +225 -224
  49. package/dist/cjs/src/delta.js +320 -320
  50. package/dist/cjs/src/deribit.js +411 -408
  51. package/dist/cjs/src/digifinex.js +432 -431
  52. package/dist/cjs/src/exmo.js +328 -327
  53. package/dist/cjs/src/gate.js +830 -791
  54. package/dist/cjs/src/gemini.js +199 -198
  55. package/dist/cjs/src/hashkey.js +520 -517
  56. package/dist/cjs/src/hitbtc.js +465 -462
  57. package/dist/cjs/src/hollaex.js +253 -252
  58. package/dist/cjs/src/htx.js +791 -848
  59. package/dist/cjs/src/huobijp.js +219 -218
  60. package/dist/cjs/src/hyperliquid.js +421 -417
  61. package/dist/cjs/src/idex.js +238 -237
  62. package/dist/cjs/src/independentreserve.js +133 -132
  63. package/dist/cjs/src/indodax.js +177 -171
  64. package/dist/cjs/src/kraken.js +381 -377
  65. package/dist/cjs/src/krakenfutures.js +285 -279
  66. package/dist/cjs/src/kucoin.js +632 -622
  67. package/dist/cjs/src/kucoinfutures.js +533 -457
  68. package/dist/cjs/src/kuna.js +283 -282
  69. package/dist/cjs/src/latoken.js +211 -210
  70. package/dist/cjs/src/lbank.js +268 -267
  71. package/dist/cjs/src/luno.js +174 -173
  72. package/dist/cjs/src/lykke.js +172 -171
  73. package/dist/cjs/src/mercado.js +123 -122
  74. package/dist/cjs/src/mexc.js +650 -646
  75. package/dist/cjs/src/ndax.js +229 -228
  76. package/dist/cjs/src/novadax.js +230 -229
  77. package/dist/cjs/src/oceanex.js +187 -186
  78. package/dist/cjs/src/okcoin.js +286 -285
  79. package/dist/cjs/src/okx.js +909 -904
  80. package/dist/cjs/src/onetrading.js +218 -218
  81. package/dist/cjs/src/oxfun.js +335 -334
  82. package/dist/cjs/src/p2b.js +154 -154
  83. package/dist/cjs/src/paradex.js +249 -244
  84. package/dist/cjs/src/paymium.js +101 -101
  85. package/dist/cjs/src/phemex.js +388 -390
  86. package/dist/cjs/src/poloniex.js +270 -270
  87. package/dist/cjs/src/poloniexfutures.js +250 -250
  88. package/dist/cjs/src/pro/alpaca.js +64 -64
  89. package/dist/cjs/src/pro/ascendex.js +64 -64
  90. package/dist/cjs/src/pro/binance.js +546 -543
  91. package/dist/cjs/src/pro/bingx.js +116 -116
  92. package/dist/cjs/src/pro/bitfinex.js +42 -42
  93. package/dist/cjs/src/pro/bitfinex2.js +66 -66
  94. package/dist/cjs/src/pro/bitget.js +188 -181
  95. package/dist/cjs/src/pro/bithumb.js +40 -40
  96. package/dist/cjs/src/pro/bitmart.js +121 -119
  97. package/dist/cjs/src/pro/bitmex.js +135 -133
  98. package/dist/cjs/src/pro/bitopro.js +49 -49
  99. package/dist/cjs/src/pro/bitrue.js +19 -19
  100. package/dist/cjs/src/pro/bitstamp.js +29 -29
  101. package/dist/cjs/src/pro/bitvavo.js +299 -301
  102. package/dist/cjs/src/pro/blockchaincom.js +62 -62
  103. package/dist/cjs/src/pro/blofin.js +132 -130
  104. package/dist/cjs/src/pro/bybit.js +317 -313
  105. package/dist/cjs/src/pro/cex.js +168 -168
  106. package/dist/cjs/src/pro/coinbase.js +93 -91
  107. package/dist/cjs/src/pro/coinbaseexchange.js +95 -95
  108. package/dist/cjs/src/pro/coinbaseinternational.js +111 -111
  109. package/dist/cjs/src/pro/coincatch.js +150 -143
  110. package/dist/cjs/src/pro/coincheck.js +21 -21
  111. package/dist/cjs/src/pro/coinex.js +110 -110
  112. package/dist/cjs/src/pro/coinone.js +30 -30
  113. package/dist/cjs/src/pro/cryptocom.js +227 -227
  114. package/dist/cjs/src/pro/currencycom.js +45 -45
  115. package/dist/cjs/src/pro/deribit.js +127 -127
  116. package/dist/cjs/src/pro/exmo.js +66 -66
  117. package/dist/cjs/src/pro/gate.js +287 -283
  118. package/dist/cjs/src/pro/gemini.js +74 -74
  119. package/dist/cjs/src/pro/hashkey.js +87 -85
  120. package/dist/cjs/src/pro/hitbtc.js +190 -190
  121. package/dist/cjs/src/pro/hollaex.js +51 -51
  122. package/dist/cjs/src/pro/htx.js +96 -94
  123. package/dist/cjs/src/pro/huobijp.js +38 -38
  124. package/dist/cjs/src/pro/hyperliquid.js +151 -150
  125. package/dist/cjs/src/pro/idex.js +48 -48
  126. package/dist/cjs/src/pro/independentreserve.js +19 -19
  127. package/dist/cjs/src/pro/kraken.js +167 -167
  128. package/dist/cjs/src/pro/krakenfutures.js +137 -138
  129. package/dist/cjs/src/pro/kucoin.js +167 -168
  130. package/dist/cjs/src/pro/kucoinfutures.js +147 -147
  131. package/dist/cjs/src/pro/lbank.js +95 -95
  132. package/dist/cjs/src/pro/luno.js +21 -21
  133. package/dist/cjs/src/pro/mexc.js +102 -103
  134. package/dist/cjs/src/pro/ndax.js +42 -42
  135. package/dist/cjs/src/pro/okcoin.js +61 -61
  136. package/dist/cjs/src/pro/okx.js +332 -330
  137. package/dist/cjs/src/pro/onetrading.js +71 -71
  138. package/dist/cjs/src/pro/oxfun.js +193 -191
  139. package/dist/cjs/src/pro/p2b.js +77 -77
  140. package/dist/cjs/src/pro/paradex.js +39 -39
  141. package/dist/cjs/src/pro/phemex.js +94 -94
  142. package/dist/cjs/src/pro/poloniex.js +171 -171
  143. package/dist/cjs/src/pro/poloniexfutures.js +62 -62
  144. package/dist/cjs/src/pro/probit.js +63 -63
  145. package/dist/cjs/src/pro/upbit.js +80 -80
  146. package/dist/cjs/src/pro/vertex.js +65 -63
  147. package/dist/cjs/src/pro/wazirx.js +70 -70
  148. package/dist/cjs/src/pro/whitebit.js +83 -83
  149. package/dist/cjs/src/pro/woo.js +106 -104
  150. package/dist/cjs/src/pro/woofipro.js +105 -103
  151. package/dist/cjs/src/pro/xt.js +119 -119
  152. package/dist/cjs/src/probit.js +229 -229
  153. package/dist/cjs/src/timex.js +198 -197
  154. package/dist/cjs/src/tokocrypto.js +214 -213
  155. package/dist/cjs/src/tradeogre.js +92 -91
  156. package/dist/cjs/src/upbit.js +243 -242
  157. package/dist/cjs/src/vertex.js +258 -258
  158. package/dist/cjs/src/wavesexchange.js +176 -172
  159. package/dist/cjs/src/wazirx.js +168 -168
  160. package/dist/cjs/src/whitebit.js +361 -361
  161. package/dist/cjs/src/woo.js +571 -572
  162. package/dist/cjs/src/woofipro.js +392 -391
  163. package/dist/cjs/src/xt.js +436 -435
  164. package/dist/cjs/src/yobit.js +159 -158
  165. package/dist/cjs/src/zaif.js +103 -103
  166. package/dist/cjs/src/zonda.js +168 -168
  167. package/js/ccxt.d.ts +1 -1
  168. package/js/ccxt.js +1 -1
  169. package/js/src/ace.d.ts +123 -0
  170. package/js/src/ace.js +123 -123
  171. package/js/src/alpaca.d.ts +237 -0
  172. package/js/src/alpaca.js +237 -237
  173. package/js/src/ascendex.d.ts +339 -0
  174. package/js/src/ascendex.js +342 -341
  175. package/js/src/base/types.d.ts +1 -0
  176. package/js/src/bigone.d.ts +242 -0
  177. package/js/src/bigone.js +242 -242
  178. package/js/src/binance.d.ts +1306 -0
  179. package/js/src/binance.js +1339 -1291
  180. package/js/src/bingx.d.ts +639 -0
  181. package/js/src/bingx.js +639 -639
  182. package/js/src/bit2c.d.ts +111 -0
  183. package/js/src/bit2c.js +111 -111
  184. package/js/src/bitbank.d.ts +142 -0
  185. package/js/src/bitbank.js +142 -142
  186. package/js/src/bitbns.d.ts +140 -0
  187. package/js/src/bitbns.js +140 -140
  188. package/js/src/bitfinex.d.ts +231 -0
  189. package/js/src/bitfinex.js +231 -231
  190. package/js/src/bitfinex2.d.ts +403 -0
  191. package/js/src/bitfinex2.js +403 -403
  192. package/js/src/bitflyer.d.ts +184 -0
  193. package/js/src/bitflyer.js +184 -184
  194. package/js/src/bitget.d.ts +846 -0
  195. package/js/src/bitget.js +848 -846
  196. package/js/src/bithumb.d.ts +125 -0
  197. package/js/src/bithumb.js +125 -124
  198. package/js/src/bitmart.d.ts +525 -0
  199. package/js/src/bitmart.js +525 -525
  200. package/js/src/bitmex.d.ts +317 -0
  201. package/js/src/bitmex.js +317 -317
  202. package/js/src/bitopro.d.ts +221 -0
  203. package/js/src/bitopro.js +221 -221
  204. package/js/src/bitrue.d.ts +315 -0
  205. package/js/src/bitrue.js +315 -315
  206. package/js/src/bitso.d.ts +220 -0
  207. package/js/src/bitso.js +220 -220
  208. package/js/src/bitstamp.d.ts +251 -0
  209. package/js/src/bitstamp.js +251 -251
  210. package/js/src/bitteam.d.ts +183 -0
  211. package/js/src/bitteam.js +183 -183
  212. package/js/src/bitvavo.d.ts +247 -0
  213. package/js/src/bitvavo.js +247 -251
  214. package/js/src/bl3p.d.ts +82 -0
  215. package/js/src/bl3p.js +82 -82
  216. package/js/src/blockchaincom.d.ts +211 -0
  217. package/js/src/blockchaincom.js +211 -211
  218. package/js/src/blofin.d.ts +332 -0
  219. package/js/src/blofin.js +332 -331
  220. package/js/src/btcalpha.d.ts +166 -0
  221. package/js/src/btcalpha.js +166 -166
  222. package/js/src/btcbox.d.ts +108 -0
  223. package/js/src/btcbox.js +108 -108
  224. package/js/src/btcmarkets.d.ts +198 -0
  225. package/js/src/btcmarkets.js +198 -198
  226. package/js/src/btcturk.d.ts +124 -0
  227. package/js/src/btcturk.js +124 -124
  228. package/js/src/bybit.d.ts +906 -1
  229. package/js/src/bybit.js +906 -900
  230. package/js/src/cex.d.ts +227 -0
  231. package/js/src/cex.js +227 -226
  232. package/js/src/coinbase.d.ts +481 -0
  233. package/js/src/coinbase.js +481 -481
  234. package/js/src/coinbaseexchange.d.ts +274 -0
  235. package/js/src/coinbaseexchange.js +274 -274
  236. package/js/src/coinbaseinternational.d.ts +304 -0
  237. package/js/src/coinbaseinternational.js +304 -304
  238. package/js/src/coincatch.d.ts +646 -0
  239. package/js/src/coincatch.js +650 -650
  240. package/js/src/coincheck.d.ts +113 -0
  241. package/js/src/coincheck.js +113 -113
  242. package/js/src/coinex.d.ts +603 -0
  243. package/js/src/coinex.js +611 -601
  244. package/js/src/coinlist.d.ts +304 -0
  245. package/js/src/coinlist.js +304 -303
  246. package/js/src/coinmate.d.ts +162 -0
  247. package/js/src/coinmate.js +162 -161
  248. package/js/src/coinmetro.d.ts +187 -0
  249. package/js/src/coinmetro.js +187 -187
  250. package/js/src/coinone.d.ts +124 -0
  251. package/js/src/coinone.js +124 -123
  252. package/js/src/coinsph.d.ts +237 -0
  253. package/js/src/coinsph.js +237 -237
  254. package/js/src/coinspot.d.ts +82 -0
  255. package/js/src/coinspot.js +82 -82
  256. package/js/src/cryptocom.d.ts +342 -0
  257. package/js/src/cryptocom.js +342 -341
  258. package/js/src/currencycom.d.ts +225 -0
  259. package/js/src/currencycom.js +225 -224
  260. package/js/src/delta.d.ts +320 -0
  261. package/js/src/delta.js +320 -320
  262. package/js/src/deribit.d.ts +411 -0
  263. package/js/src/deribit.js +411 -408
  264. package/js/src/digifinex.d.ts +430 -0
  265. package/js/src/digifinex.js +432 -431
  266. package/js/src/exmo.d.ts +328 -0
  267. package/js/src/exmo.js +328 -327
  268. package/js/src/gate.d.ts +803 -1
  269. package/js/src/gate.js +830 -791
  270. package/js/src/gemini.d.ts +199 -0
  271. package/js/src/gemini.js +199 -198
  272. package/js/src/hashkey.d.ts +516 -0
  273. package/js/src/hashkey.js +520 -517
  274. package/js/src/hitbtc.d.ts +465 -0
  275. package/js/src/hitbtc.js +465 -462
  276. package/js/src/hollaex.d.ts +253 -0
  277. package/js/src/hollaex.js +253 -252
  278. package/js/src/htx.d.ts +765 -2
  279. package/js/src/htx.js +791 -848
  280. package/js/src/huobijp.d.ts +219 -0
  281. package/js/src/huobijp.js +219 -218
  282. package/js/src/hyperliquid.d.ts +419 -0
  283. package/js/src/hyperliquid.js +421 -417
  284. package/js/src/idex.d.ts +238 -0
  285. package/js/src/idex.js +238 -237
  286. package/js/src/independentreserve.d.ts +133 -0
  287. package/js/src/independentreserve.js +133 -132
  288. package/js/src/indodax.d.ts +171 -0
  289. package/js/src/indodax.js +177 -171
  290. package/js/src/kraken.d.ts +381 -0
  291. package/js/src/kraken.js +381 -377
  292. package/js/src/krakenfutures.d.ts +282 -0
  293. package/js/src/krakenfutures.js +285 -279
  294. package/js/src/kucoin.d.ts +613 -0
  295. package/js/src/kucoin.js +632 -622
  296. package/js/src/kucoinfutures.d.ts +441 -0
  297. package/js/src/kucoinfutures.js +533 -457
  298. package/js/src/kuna.d.ts +283 -0
  299. package/js/src/kuna.js +283 -282
  300. package/js/src/latoken.d.ts +211 -0
  301. package/js/src/latoken.js +211 -210
  302. package/js/src/lbank.d.ts +268 -0
  303. package/js/src/lbank.js +268 -267
  304. package/js/src/luno.d.ts +174 -0
  305. package/js/src/luno.js +174 -173
  306. package/js/src/lykke.d.ts +172 -0
  307. package/js/src/lykke.js +172 -171
  308. package/js/src/mercado.d.ts +123 -0
  309. package/js/src/mercado.js +123 -122
  310. package/js/src/mexc.d.ts +647 -0
  311. package/js/src/mexc.js +650 -646
  312. package/js/src/ndax.d.ts +229 -0
  313. package/js/src/ndax.js +229 -228
  314. package/js/src/novadax.d.ts +230 -0
  315. package/js/src/novadax.js +230 -229
  316. package/js/src/oceanex.d.ts +187 -0
  317. package/js/src/oceanex.js +187 -186
  318. package/js/src/okcoin.d.ts +286 -0
  319. package/js/src/okcoin.js +286 -285
  320. package/js/src/okx.d.ts +907 -0
  321. package/js/src/okx.js +909 -904
  322. package/js/src/onetrading.d.ts +218 -0
  323. package/js/src/onetrading.js +218 -218
  324. package/js/src/oxfun.d.ts +336 -3
  325. package/js/src/oxfun.js +335 -334
  326. package/js/src/p2b.d.ts +154 -0
  327. package/js/src/p2b.js +154 -154
  328. package/js/src/paradex.d.ts +241 -0
  329. package/js/src/paradex.js +249 -244
  330. package/js/src/paymium.d.ts +101 -0
  331. package/js/src/paymium.js +101 -101
  332. package/js/src/phemex.d.ts +366 -0
  333. package/js/src/phemex.js +388 -390
  334. package/js/src/poloniex.d.ts +270 -0
  335. package/js/src/poloniex.js +270 -270
  336. package/js/src/poloniexfutures.d.ts +250 -0
  337. package/js/src/poloniexfutures.js +250 -250
  338. package/js/src/pro/alpaca.d.ts +64 -0
  339. package/js/src/pro/alpaca.js +64 -64
  340. package/js/src/pro/ascendex.d.ts +64 -0
  341. package/js/src/pro/ascendex.js +64 -64
  342. package/js/src/pro/binance.d.ts +546 -0
  343. package/js/src/pro/binance.js +546 -543
  344. package/js/src/pro/bingx.d.ts +116 -0
  345. package/js/src/pro/bingx.js +116 -116
  346. package/js/src/pro/bitfinex.d.ts +42 -0
  347. package/js/src/pro/bitfinex.js +42 -42
  348. package/js/src/pro/bitfinex2.d.ts +66 -0
  349. package/js/src/pro/bitfinex2.js +66 -66
  350. package/js/src/pro/bitget.d.ts +187 -0
  351. package/js/src/pro/bitget.js +188 -181
  352. package/js/src/pro/bithumb.d.ts +40 -0
  353. package/js/src/pro/bithumb.js +40 -40
  354. package/js/src/pro/bitmart.d.ts +121 -0
  355. package/js/src/pro/bitmart.js +121 -119
  356. package/js/src/pro/bitmex.d.ts +135 -0
  357. package/js/src/pro/bitmex.js +135 -133
  358. package/js/src/pro/bitopro.d.ts +49 -0
  359. package/js/src/pro/bitopro.js +49 -49
  360. package/js/src/pro/bitrue.d.ts +19 -0
  361. package/js/src/pro/bitrue.js +19 -19
  362. package/js/src/pro/bitstamp.d.ts +29 -0
  363. package/js/src/pro/bitstamp.js +29 -29
  364. package/js/src/pro/bitvavo.d.ts +254 -1
  365. package/js/src/pro/bitvavo.js +299 -301
  366. package/js/src/pro/blockchaincom.d.ts +62 -0
  367. package/js/src/pro/blockchaincom.js +62 -62
  368. package/js/src/pro/blofin.d.ts +132 -0
  369. package/js/src/pro/blofin.js +132 -130
  370. package/js/src/pro/bybit.d.ts +317 -0
  371. package/js/src/pro/bybit.js +317 -313
  372. package/js/src/pro/cex.d.ts +168 -0
  373. package/js/src/pro/cex.js +168 -168
  374. package/js/src/pro/coinbase.d.ts +93 -0
  375. package/js/src/pro/coinbase.js +93 -91
  376. package/js/src/pro/coinbaseexchange.d.ts +95 -0
  377. package/js/src/pro/coinbaseexchange.js +95 -95
  378. package/js/src/pro/coinbaseinternational.d.ts +111 -0
  379. package/js/src/pro/coinbaseinternational.js +111 -111
  380. package/js/src/pro/coincatch.d.ts +150 -0
  381. package/js/src/pro/coincatch.js +150 -143
  382. package/js/src/pro/coincheck.d.ts +21 -0
  383. package/js/src/pro/coincheck.js +21 -21
  384. package/js/src/pro/coinex.d.ts +110 -0
  385. package/js/src/pro/coinex.js +110 -110
  386. package/js/src/pro/coinone.d.ts +30 -0
  387. package/js/src/pro/coinone.js +30 -30
  388. package/js/src/pro/cryptocom.d.ts +227 -0
  389. package/js/src/pro/cryptocom.js +227 -227
  390. package/js/src/pro/currencycom.d.ts +45 -0
  391. package/js/src/pro/currencycom.js +45 -45
  392. package/js/src/pro/deribit.d.ts +127 -0
  393. package/js/src/pro/deribit.js +127 -127
  394. package/js/src/pro/exmo.d.ts +66 -0
  395. package/js/src/pro/exmo.js +66 -66
  396. package/js/src/pro/gate.d.ts +287 -0
  397. package/js/src/pro/gate.js +287 -283
  398. package/js/src/pro/gemini.d.ts +74 -0
  399. package/js/src/pro/gemini.js +74 -74
  400. package/js/src/pro/hashkey.d.ts +87 -0
  401. package/js/src/pro/hashkey.js +87 -85
  402. package/js/src/pro/hitbtc.d.ts +190 -0
  403. package/js/src/pro/hitbtc.js +190 -190
  404. package/js/src/pro/hollaex.d.ts +51 -0
  405. package/js/src/pro/hollaex.js +51 -51
  406. package/js/src/pro/htx.d.ts +96 -0
  407. package/js/src/pro/htx.js +96 -94
  408. package/js/src/pro/huobijp.d.ts +38 -0
  409. package/js/src/pro/huobijp.js +38 -38
  410. package/js/src/pro/hyperliquid.d.ts +151 -0
  411. package/js/src/pro/hyperliquid.js +151 -150
  412. package/js/src/pro/idex.d.ts +48 -0
  413. package/js/src/pro/idex.js +48 -48
  414. package/js/src/pro/independentreserve.d.ts +19 -0
  415. package/js/src/pro/independentreserve.js +19 -19
  416. package/js/src/pro/kraken.d.ts +167 -0
  417. package/js/src/pro/kraken.js +167 -167
  418. package/js/src/pro/krakenfutures.d.ts +137 -0
  419. package/js/src/pro/krakenfutures.js +137 -138
  420. package/js/src/pro/kucoin.d.ts +167 -0
  421. package/js/src/pro/kucoin.js +167 -168
  422. package/js/src/pro/kucoinfutures.d.ts +147 -0
  423. package/js/src/pro/kucoinfutures.js +147 -147
  424. package/js/src/pro/lbank.d.ts +95 -0
  425. package/js/src/pro/lbank.js +95 -95
  426. package/js/src/pro/luno.d.ts +21 -0
  427. package/js/src/pro/luno.js +21 -21
  428. package/js/src/pro/mexc.d.ts +101 -0
  429. package/js/src/pro/mexc.js +102 -103
  430. package/js/src/pro/ndax.d.ts +42 -0
  431. package/js/src/pro/ndax.js +42 -42
  432. package/js/src/pro/okcoin.d.ts +61 -0
  433. package/js/src/pro/okcoin.js +61 -61
  434. package/js/src/pro/okx.d.ts +332 -0
  435. package/js/src/pro/okx.js +332 -330
  436. package/js/src/pro/onetrading.d.ts +71 -0
  437. package/js/src/pro/onetrading.js +71 -71
  438. package/js/src/pro/oxfun.d.ts +193 -0
  439. package/js/src/pro/oxfun.js +193 -191
  440. package/js/src/pro/p2b.d.ts +77 -0
  441. package/js/src/pro/p2b.js +77 -77
  442. package/js/src/pro/paradex.d.ts +39 -0
  443. package/js/src/pro/paradex.js +39 -39
  444. package/js/src/pro/phemex.d.ts +94 -0
  445. package/js/src/pro/phemex.js +94 -94
  446. package/js/src/pro/poloniex.d.ts +171 -0
  447. package/js/src/pro/poloniex.js +171 -171
  448. package/js/src/pro/poloniexfutures.d.ts +62 -0
  449. package/js/src/pro/poloniexfutures.js +62 -62
  450. package/js/src/pro/probit.d.ts +63 -0
  451. package/js/src/pro/probit.js +63 -63
  452. package/js/src/pro/upbit.d.ts +80 -0
  453. package/js/src/pro/upbit.js +80 -80
  454. package/js/src/pro/vertex.d.ts +65 -0
  455. package/js/src/pro/vertex.js +65 -63
  456. package/js/src/pro/wazirx.d.ts +70 -0
  457. package/js/src/pro/wazirx.js +70 -70
  458. package/js/src/pro/whitebit.d.ts +83 -0
  459. package/js/src/pro/whitebit.js +83 -83
  460. package/js/src/pro/woo.d.ts +106 -0
  461. package/js/src/pro/woo.js +106 -104
  462. package/js/src/pro/woofipro.d.ts +105 -0
  463. package/js/src/pro/woofipro.js +105 -103
  464. package/js/src/pro/xt.d.ts +119 -0
  465. package/js/src/pro/xt.js +119 -119
  466. package/js/src/probit.d.ts +229 -0
  467. package/js/src/probit.js +229 -229
  468. package/js/src/timex.d.ts +198 -0
  469. package/js/src/timex.js +198 -197
  470. package/js/src/tokocrypto.d.ts +214 -0
  471. package/js/src/tokocrypto.js +214 -213
  472. package/js/src/tradeogre.d.ts +92 -0
  473. package/js/src/tradeogre.js +92 -91
  474. package/js/src/upbit.d.ts +243 -0
  475. package/js/src/upbit.js +243 -242
  476. package/js/src/vertex.d.ts +258 -0
  477. package/js/src/vertex.js +258 -258
  478. package/js/src/wavesexchange.d.ts +176 -0
  479. package/js/src/wavesexchange.js +176 -172
  480. package/js/src/wazirx.d.ts +168 -0
  481. package/js/src/wazirx.js +168 -168
  482. package/js/src/whitebit.d.ts +361 -0
  483. package/js/src/whitebit.js +361 -361
  484. package/js/src/woo.d.ts +571 -0
  485. package/js/src/woo.js +571 -572
  486. package/js/src/woofipro.d.ts +392 -0
  487. package/js/src/woofipro.js +392 -391
  488. package/js/src/xt.d.ts +439 -4
  489. package/js/src/xt.js +436 -435
  490. package/js/src/yobit.d.ts +159 -0
  491. package/js/src/yobit.js +159 -158
  492. package/js/src/zaif.d.ts +103 -0
  493. package/js/src/zaif.js +103 -103
  494. package/js/src/zonda.d.ts +168 -0
  495. package/js/src/zonda.js +168 -168
  496. package/package.json +1 -1
package/js/src/htx.js CHANGED
@@ -91,7 +91,7 @@ export default class htx extends Exchange {
91
91
  'fetchLeverageTiers': true,
92
92
  'fetchLiquidations': true,
93
93
  'fetchMarginAdjustmentHistory': false,
94
- 'fetchMarketLeverageTiers': true,
94
+ 'fetchMarketLeverageTiers': 'emulated',
95
95
  'fetchMarkets': true,
96
96
  'fetchMarkOHLCV': true,
97
97
  'fetchMyLiquidations': false,
@@ -1237,19 +1237,19 @@ export default class htx extends Exchange {
1237
1237
  },
1238
1238
  });
1239
1239
  }
1240
+ /**
1241
+ * @method
1242
+ * @name htx#fetchStatus
1243
+ * @description the latest known information on the availability of the exchange API
1244
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#get-system-status
1245
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#get-system-status
1246
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-system-status
1247
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#get-system-status
1248
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#query-whether-the-system-is-available // contractPublicGetHeartbeat
1249
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1250
+ * @returns {object} a [status structure]{@link https://docs.ccxt.com/#/?id=exchange-status-structure}
1251
+ */
1240
1252
  async fetchStatus(params = {}) {
1241
- /**
1242
- * @method
1243
- * @name htx#fetchStatus
1244
- * @description the latest known information on the availability of the exchange API
1245
- * @see https://huobiapi.github.io/docs/spot/v1/en/#get-system-status
1246
- * @see https://huobiapi.github.io/docs/dm/v1/en/#get-system-status
1247
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-system-status
1248
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#get-system-status
1249
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#query-whether-the-system-is-available // contractPublicGetHeartbeat
1250
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1251
- * @returns {object} a [status structure]{@link https://docs.ccxt.com/#/?id=exchange-status-structure}
1252
- */
1253
1253
  await this.loadMarkets();
1254
1254
  let marketType = undefined;
1255
1255
  [marketType, params] = this.handleMarketTypeAndParams('fetchStatus', undefined, params);
@@ -1471,16 +1471,16 @@ export default class htx extends Exchange {
1471
1471
  'info': response,
1472
1472
  };
1473
1473
  }
1474
+ /**
1475
+ * @method
1476
+ * @name htx#fetchTime
1477
+ * @description fetches the current integer timestamp in milliseconds from the exchange server
1478
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#get-current-timestamp
1479
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-current-system-timestamp
1480
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1481
+ * @returns {int} the current integer timestamp in milliseconds from the exchange server
1482
+ */
1474
1483
  async fetchTime(params = {}) {
1475
- /**
1476
- * @method
1477
- * @name htx#fetchTime
1478
- * @description fetches the current integer timestamp in milliseconds from the exchange server
1479
- * @see https://huobiapi.github.io/docs/spot/v1/en/#get-current-timestamp
1480
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-current-system-timestamp
1481
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1482
- * @returns {int} the current integer timestamp in milliseconds from the exchange server
1483
- */
1484
1484
  const options = this.safeValue(this.options, 'fetchTime', {});
1485
1485
  const defaultType = this.safeString(this.options, 'defaultType', 'spot');
1486
1486
  let type = this.safeString(options, 'type', defaultType);
@@ -1523,16 +1523,16 @@ export default class htx extends Exchange {
1523
1523
  'tierBased': undefined,
1524
1524
  };
1525
1525
  }
1526
+ /**
1527
+ * @method
1528
+ * @name htx#fetchTradingFee
1529
+ * @description fetch the trading fees for a market
1530
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#get-current-fee-rate-applied-to-the-user
1531
+ * @param {string} symbol unified market symbol
1532
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1533
+ * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
1534
+ */
1526
1535
  async fetchTradingFee(symbol, params = {}) {
1527
- /**
1528
- * @method
1529
- * @name htx#fetchTradingFee
1530
- * @description fetch the trading fees for a market
1531
- * @see https://huobiapi.github.io/docs/spot/v1/en/#get-current-fee-rate-applied-to-the-user
1532
- * @param {string} symbol unified market symbol
1533
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1534
- * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
1535
- */
1536
1536
  await this.loadMarkets();
1537
1537
  const market = this.market(symbol);
1538
1538
  const request = {
@@ -1573,16 +1573,16 @@ export default class htx extends Exchange {
1573
1573
  }
1574
1574
  return result;
1575
1575
  }
1576
+ /**
1577
+ * @ignore
1578
+ * @method
1579
+ * @name htx#fetchTradingLimitsById
1580
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#get-current-fee-rate-applied-to-the-user
1581
+ * @param {string} id market id
1582
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1583
+ * @returns {object} the limits object of a market structure
1584
+ */
1576
1585
  async fetchTradingLimitsById(id, params = {}) {
1577
- /**
1578
- * @ignore
1579
- * @method
1580
- * @name htx#fetchTradingLimitsById
1581
- * @see https://huobiapi.github.io/docs/spot/v1/en/#get-current-fee-rate-applied-to-the-user
1582
- * @param {string} id market id
1583
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1584
- * @returns {object} the limits object of a market structure
1585
- */
1586
1586
  const request = {
1587
1587
  'symbol': id,
1588
1588
  };
@@ -1634,18 +1634,18 @@ export default class htx extends Exchange {
1634
1634
  costToPrecision(symbol, cost) {
1635
1635
  return this.decimalToPrecision(cost, TRUNCATE, this.markets[symbol]['precision']['cost'], this.precisionMode);
1636
1636
  }
1637
+ /**
1638
+ * @method
1639
+ * @name htx#fetchMarkets
1640
+ * @description retrieves data on all markets for huobi
1641
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#get-all-supported-trading-symbol-v1-deprecated
1642
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#get-contract-info
1643
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-swap-info
1644
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-swap-info
1645
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1646
+ * @returns {object[]} an array of objects representing market data
1647
+ */
1637
1648
  async fetchMarkets(params = {}) {
1638
- /**
1639
- * @method
1640
- * @name htx#fetchMarkets
1641
- * @description retrieves data on all markets for huobi
1642
- * @see https://huobiapi.github.io/docs/spot/v1/en/#get-all-supported-trading-symbol-v1-deprecated
1643
- * @see https://huobiapi.github.io/docs/dm/v1/en/#get-contract-info
1644
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-swap-info
1645
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-swap-info
1646
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1647
- * @returns {object[]} an array of objects representing market data
1648
- */
1649
1649
  let types = undefined;
1650
1650
  [types, params] = this.handleOptionAndParams(params, 'fetchMarkets', 'types', {});
1651
1651
  let allMarkets = [];
@@ -1672,21 +1672,21 @@ export default class htx extends Exchange {
1672
1672
  }
1673
1673
  return allMarkets;
1674
1674
  }
1675
+ /**
1676
+ * @ignore
1677
+ * @method
1678
+ * @name htx#fetchMarketsByTypeAndSubType
1679
+ * @description retrieves data on all markets of a certain type and/or subtype
1680
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#get-all-supported-trading-symbol-v1-deprecated
1681
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#get-contract-info
1682
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-swap-info
1683
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-swap-info
1684
+ * @param {string} [type] 'spot', 'swap' or 'future'
1685
+ * @param {string} [subType] 'linear' or 'inverse'
1686
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1687
+ * @returns {object[]} an array of objects representing market data
1688
+ */
1675
1689
  async fetchMarketsByTypeAndSubType(type, subType, params = {}) {
1676
- /**
1677
- * @ignore
1678
- * @method
1679
- * @name htx#fetchMarketsByTypeAndSubType
1680
- * @description retrieves data on all markets of a certain type and/or subtype
1681
- * @see https://huobiapi.github.io/docs/spot/v1/en/#get-all-supported-trading-symbol-v1-deprecated
1682
- * @see https://huobiapi.github.io/docs/dm/v1/en/#get-contract-info
1683
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-swap-info
1684
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-swap-info
1685
- * @param {string} [type] 'spot', 'swap' or 'future'
1686
- * @param {string} [subType] 'linear' or 'inverse'
1687
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1688
- * @returns {object[]} an array of objects representing market data
1689
- */
1690
1690
  const isSpot = (type === 'spot');
1691
1691
  const request = {};
1692
1692
  let response = undefined;
@@ -2120,19 +2120,19 @@ export default class htx extends Exchange {
2120
2120
  'info': ticker,
2121
2121
  }, market);
2122
2122
  }
2123
+ /**
2124
+ * @method
2125
+ * @name htx#fetchTicker
2126
+ * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
2127
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#get-latest-aggregated-ticker
2128
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#get-market-data-overview
2129
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-market-data-overview
2130
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-get-market-data-overview
2131
+ * @param {string} symbol unified symbol of the market to fetch the ticker for
2132
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2133
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
2134
+ */
2123
2135
  async fetchTicker(symbol, params = {}) {
2124
- /**
2125
- * @method
2126
- * @name htx#fetchTicker
2127
- * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
2128
- * @see https://huobiapi.github.io/docs/spot/v1/en/#get-latest-aggregated-ticker
2129
- * @see https://huobiapi.github.io/docs/dm/v1/en/#get-market-data-overview
2130
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-market-data-overview
2131
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-get-market-data-overview
2132
- * @param {string} symbol unified symbol of the market to fetch the ticker for
2133
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2134
- * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
2135
- */
2136
2136
  await this.loadMarkets();
2137
2137
  const market = this.market(symbol);
2138
2138
  const request = {};
@@ -2205,19 +2205,19 @@ export default class htx extends Exchange {
2205
2205
  ticker['datetime'] = this.iso8601(timestamp);
2206
2206
  return ticker;
2207
2207
  }
2208
+ /**
2209
+ * @method
2210
+ * @name htx#fetchTickers
2211
+ * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
2212
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#get-latest-tickers-for-all-pairs
2213
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-get-a-batch-of-market-data-overview
2214
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#get-a-batch-of-market-data-overview
2215
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-a-batch-of-market-data-overview-v2
2216
+ * @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
2217
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2218
+ * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
2219
+ */
2208
2220
  async fetchTickers(symbols = undefined, params = {}) {
2209
- /**
2210
- * @method
2211
- * @name htx#fetchTickers
2212
- * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
2213
- * @see https://huobiapi.github.io/docs/spot/v1/en/#get-latest-tickers-for-all-pairs
2214
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-get-a-batch-of-market-data-overview
2215
- * @see https://huobiapi.github.io/docs/dm/v1/en/#get-a-batch-of-market-data-overview
2216
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-a-batch-of-market-data-overview-v2
2217
- * @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
2218
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2219
- * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
2220
- */
2221
2221
  await this.loadMarkets();
2222
2222
  symbols = this.marketSymbols(symbols);
2223
2223
  const first = this.safeString(symbols, 0);
@@ -2323,18 +2323,18 @@ export default class htx extends Exchange {
2323
2323
  const tickers = this.parseTickers(rawTickers, symbols, params);
2324
2324
  return this.filterByArrayTickers(tickers, 'symbol', symbols);
2325
2325
  }
2326
+ /**
2327
+ * @method
2328
+ * @name htx#fetchLastPrices
2329
+ * @description fetches the last price for multiple markets
2330
+ * @see https://www.htx.com/en-us/opend/newApiPages/?id=8cb81024-77b5-11ed-9966-0242ac110003 linear swap & linear future
2331
+ * @see https://www.htx.com/en-us/opend/newApiPages/?id=28c2e8fc-77ae-11ed-9966-0242ac110003 inverse future
2332
+ * @see https://www.htx.com/en-us/opend/newApiPages/?id=5d517ef5-77b6-11ed-9966-0242ac110003 inverse swap
2333
+ * @param {string[]} [symbols] unified symbols of the markets to fetch the last prices
2334
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2335
+ * @returns {object} a dictionary of lastprices structures
2336
+ */
2326
2337
  async fetchLastPrices(symbols = undefined, params = {}) {
2327
- /**
2328
- * @method
2329
- * @name htx#fetchLastPrices
2330
- * @description fetches the last price for multiple markets
2331
- * @see https://www.htx.com/en-us/opend/newApiPages/?id=8cb81024-77b5-11ed-9966-0242ac110003 linear swap & linear future
2332
- * @see https://www.htx.com/en-us/opend/newApiPages/?id=28c2e8fc-77ae-11ed-9966-0242ac110003 inverse future
2333
- * @see https://www.htx.com/en-us/opend/newApiPages/?id=5d517ef5-77b6-11ed-9966-0242ac110003 inverse swap
2334
- * @param {string[]} [symbols] unified symbols of the markets to fetch the last prices
2335
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2336
- * @returns {object} a dictionary of lastprices structures
2337
- */
2338
2338
  await this.loadMarkets();
2339
2339
  symbols = this.marketSymbols(symbols);
2340
2340
  const market = this.getMarketFromSymbols(symbols);
@@ -2444,20 +2444,20 @@ export default class htx extends Exchange {
2444
2444
  'info': entry,
2445
2445
  };
2446
2446
  }
2447
+ /**
2448
+ * @method
2449
+ * @name htx#fetchOrderBook
2450
+ * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
2451
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#get-market-depth
2452
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#get-market-depth
2453
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-market-depth
2454
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-get-market-depth
2455
+ * @param {string} symbol unified symbol of the market to fetch the order book for
2456
+ * @param {int} [limit] the maximum amount of order book entries to return
2457
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2458
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
2459
+ */
2447
2460
  async fetchOrderBook(symbol, limit = undefined, params = {}) {
2448
- /**
2449
- * @method
2450
- * @name htx#fetchOrderBook
2451
- * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
2452
- * @see https://huobiapi.github.io/docs/spot/v1/en/#get-market-depth
2453
- * @see https://huobiapi.github.io/docs/dm/v1/en/#get-market-depth
2454
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-market-depth
2455
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-get-market-depth
2456
- * @param {string} symbol unified symbol of the market to fetch the order book for
2457
- * @param {int} [limit] the maximum amount of order book entries to return
2458
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2459
- * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
2460
- */
2461
2461
  await this.loadMarkets();
2462
2462
  const market = this.market(symbol);
2463
2463
  const request = {
@@ -2677,19 +2677,19 @@ export default class htx extends Exchange {
2677
2677
  'fee': fee,
2678
2678
  }, market);
2679
2679
  }
2680
+ /**
2681
+ * @method
2682
+ * @name htx#fetchOrderTrades
2683
+ * @description fetch all the trades made from a single order
2684
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#get-the-match-result-of-an-order
2685
+ * @param {string} id order id
2686
+ * @param {string} symbol unified market symbol
2687
+ * @param {int} [since] the earliest time in ms to fetch trades for
2688
+ * @param {int} [limit] the maximum number of trades to retrieve
2689
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2690
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
2691
+ */
2680
2692
  async fetchOrderTrades(id, symbol = undefined, since = undefined, limit = undefined, params = {}) {
2681
- /**
2682
- * @method
2683
- * @name htx#fetchOrderTrades
2684
- * @description fetch all the trades made from a single order
2685
- * @see https://huobiapi.github.io/docs/spot/v1/en/#get-the-match-result-of-an-order
2686
- * @param {string} id order id
2687
- * @param {string} symbol unified market symbol
2688
- * @param {int} [since] the earliest time in ms to fetch trades for
2689
- * @param {int} [limit] the maximum number of trades to retrieve
2690
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2691
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
2692
- */
2693
2693
  let market = undefined;
2694
2694
  if (symbol !== undefined) {
2695
2695
  market = this.market(symbol);
@@ -2701,20 +2701,20 @@ export default class htx extends Exchange {
2701
2701
  }
2702
2702
  return await this.fetchSpotOrderTrades(id, symbol, since, limit, params);
2703
2703
  }
2704
+ /**
2705
+ * @ignore
2706
+ * @method
2707
+ * @name htx#fetchOrderTrades
2708
+ * @description fetch all the trades made from a single order
2709
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#get-the-match-result-of-an-order
2710
+ * @param {string} id order id
2711
+ * @param {string} symbol unified market symbol
2712
+ * @param {int} [since] the earliest time in ms to fetch trades for
2713
+ * @param {int} [limit] the maximum number of trades to retrieve
2714
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2715
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
2716
+ */
2704
2717
  async fetchSpotOrderTrades(id, symbol = undefined, since = undefined, limit = undefined, params = {}) {
2705
- /**
2706
- * @ignore
2707
- * @method
2708
- * @name htx#fetchOrderTrades
2709
- * @description fetch all the trades made from a single order
2710
- * @see https://huobiapi.github.io/docs/spot/v1/en/#get-the-match-result-of-an-order
2711
- * @param {string} id order id
2712
- * @param {string} symbol unified market symbol
2713
- * @param {int} [since] the earliest time in ms to fetch trades for
2714
- * @param {int} [limit] the maximum number of trades to retrieve
2715
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2716
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
2717
- */
2718
2718
  await this.loadMarkets();
2719
2719
  const request = {
2720
2720
  'order-id': id,
@@ -2722,22 +2722,22 @@ export default class htx extends Exchange {
2722
2722
  const response = await this.spotPrivateGetV1OrderOrdersOrderIdMatchresults(this.extend(request, params));
2723
2723
  return this.parseTrades(response['data'], undefined, since, limit);
2724
2724
  }
2725
+ /**
2726
+ * @method
2727
+ * @name htx#fetchMyTrades
2728
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-get-history-match-results-via-multiple-fields-new
2729
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-get-history-match-results-via-multiple-fields-new
2730
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#search-match-results
2731
+ * @description fetch all trades made by the user
2732
+ * @param {string} symbol unified market symbol
2733
+ * @param {int} [since] the earliest time in ms to fetch trades for
2734
+ * @param {int} [limit] the maximum number of trades structures to retrieve
2735
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2736
+ * @param {int} [params.until] the latest time in ms to fetch trades for
2737
+ * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
2738
+ * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
2739
+ */
2725
2740
  async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
2726
- /**
2727
- * @method
2728
- * @name htx#fetchMyTrades
2729
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-get-history-match-results-via-multiple-fields-new
2730
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-get-history-match-results-via-multiple-fields-new
2731
- * @see https://huobiapi.github.io/docs/spot/v1/en/#search-match-results
2732
- * @description fetch all trades made by the user
2733
- * @param {string} symbol unified market symbol
2734
- * @param {int} [since] the earliest time in ms to fetch trades for
2735
- * @param {int} [limit] the maximum number of trades structures to retrieve
2736
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2737
- * @param {int} [params.until] the latest time in ms to fetch trades for
2738
- * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
2739
- * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
2740
- */
2741
2741
  await this.loadMarkets();
2742
2742
  let paginate = false;
2743
2743
  [paginate, params] = this.handleOptionAndParams(params, 'fetchMyTrades', 'paginate');
@@ -2895,21 +2895,21 @@ export default class htx extends Exchange {
2895
2895
  }
2896
2896
  return this.parseTrades(trades, market, since, limit);
2897
2897
  }
2898
+ /**
2899
+ * @method
2900
+ * @name htx#fetchTrades
2901
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#get-the-most-recent-trades
2902
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#query-a-batch-of-trade-records-of-a-contract
2903
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-a-batch-of-trade-records-of-a-contract
2904
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-a-batch-of-trade-records-of-a-contract
2905
+ * @description get the list of most recent trades for a particular symbol
2906
+ * @param {string} symbol unified symbol of the market to fetch trades for
2907
+ * @param {int} [since] timestamp in ms of the earliest trade to fetch
2908
+ * @param {int} [limit] the maximum amount of trades to fetch
2909
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2910
+ * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
2911
+ */
2898
2912
  async fetchTrades(symbol, since = undefined, limit = 1000, params = {}) {
2899
- /**
2900
- * @method
2901
- * @name htx#fetchTrades
2902
- * @see https://huobiapi.github.io/docs/spot/v1/en/#get-the-most-recent-trades
2903
- * @see https://huobiapi.github.io/docs/dm/v1/en/#query-a-batch-of-trade-records-of-a-contract
2904
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-a-batch-of-trade-records-of-a-contract
2905
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-a-batch-of-trade-records-of-a-contract
2906
- * @description get the list of most recent trades for a particular symbol
2907
- * @param {string} symbol unified symbol of the market to fetch trades for
2908
- * @param {int} [since] timestamp in ms of the earliest trade to fetch
2909
- * @param {int} [limit] the maximum amount of trades to fetch
2910
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2911
- * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
2912
- */
2913
2913
  await this.loadMarkets();
2914
2914
  const market = this.market(symbol);
2915
2915
  const request = {
@@ -3001,24 +3001,24 @@ export default class htx extends Exchange {
3001
3001
  this.safeNumber(ohlcv, 'amount'),
3002
3002
  ];
3003
3003
  }
3004
+ /**
3005
+ * @method
3006
+ * @name htx#fetchOHLCV
3007
+ * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
3008
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#get-klines-candles
3009
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#get-kline-data
3010
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-kline-data
3011
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-get-kline-data
3012
+ * @param {string} symbol unified symbol of the market to fetch OHLCV data for
3013
+ * @param {string} timeframe the length of time each candle represents
3014
+ * @param {int} [since] timestamp in ms of the earliest candle to fetch
3015
+ * @param {int} [limit] the maximum amount of candles to fetch
3016
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3017
+ * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
3018
+ * @param {string} [params.useHistoricalEndpointForSpot] true/false - whether use the historical candles endpoint for spot markets or default klines endpoint
3019
+ * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
3020
+ */
3004
3021
  async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
3005
- /**
3006
- * @method
3007
- * @name htx#fetchOHLCV
3008
- * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
3009
- * @see https://huobiapi.github.io/docs/spot/v1/en/#get-klines-candles
3010
- * @see https://huobiapi.github.io/docs/dm/v1/en/#get-kline-data
3011
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-kline-data
3012
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-get-kline-data
3013
- * @param {string} symbol unified symbol of the market to fetch OHLCV data for
3014
- * @param {string} timeframe the length of time each candle represents
3015
- * @param {int} [since] timestamp in ms of the earliest candle to fetch
3016
- * @param {int} [limit] the maximum amount of candles to fetch
3017
- * @param {object} [params] extra parameters specific to the exchange API endpoint
3018
- * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
3019
- * @param {string} [params.useHistoricalEndpointForSpot] true/false - whether use the historical candles endpoint for spot markets or default klines endpoint
3020
- * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
3021
- */
3022
3022
  await this.loadMarkets();
3023
3023
  let paginate = false;
3024
3024
  [paginate, params] = this.handleOptionAndParams(params, 'fetchOHLCV', 'paginate');
@@ -3166,15 +3166,15 @@ export default class htx extends Exchange {
3166
3166
  const data = this.safeList(response, 'data', []);
3167
3167
  return this.parseOHLCVs(data, market, timeframe, since, limit);
3168
3168
  }
3169
+ /**
3170
+ * @method
3171
+ * @name htx#fetchAccounts
3172
+ * @description fetch all the accounts associated with a profile
3173
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#get-all-accounts-of-the-current-user
3174
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3175
+ * @returns {object} a dictionary of [account structures]{@link https://docs.ccxt.com/#/?id=account-structure} indexed by the account type
3176
+ */
3169
3177
  async fetchAccounts(params = {}) {
3170
- /**
3171
- * @method
3172
- * @name htx#fetchAccounts
3173
- * @description fetch all the accounts associated with a profile
3174
- * @see https://huobiapi.github.io/docs/spot/v1/en/#get-all-accounts-of-the-current-user
3175
- * @param {object} [params] extra parameters specific to the exchange API endpoint
3176
- * @returns {object} a dictionary of [account structures]{@link https://docs.ccxt.com/#/?id=account-structure} indexed by the account type
3177
- */
3178
3178
  await this.loadMarkets();
3179
3179
  const response = await this.spotPrivateGetV1AccountAccounts(params);
3180
3180
  //
@@ -3208,17 +3208,18 @@ export default class htx extends Exchange {
3208
3208
  'code': undefined,
3209
3209
  };
3210
3210
  }
3211
+ /**
3212
+ * @method
3213
+ * @name htx#fetchAccountIdByType
3214
+ * @description fetch all the accounts by a type and marginModeassociated with a profile
3215
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#get-all-accounts-of-the-current-user
3216
+ * @param {string} type 'spot', 'swap' or 'future
3217
+ * @param {string} [marginMode] 'cross' or 'isolated'
3218
+ * @param {string} [symbol] unified ccxt market symbol
3219
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3220
+ * @returns {object} a dictionary of [account structures]{@link https://docs.ccxt.com/#/?id=account-structure} indexed by the account type
3221
+ */
3211
3222
  async fetchAccountIdByType(type, marginMode = undefined, symbol = undefined, params = {}) {
3212
- /**
3213
- * @method
3214
- * @name htx#fetchAccountIdByType
3215
- * @description fetch all the accounts by a type and marginModeassociated with a profile
3216
- * @see https://huobiapi.github.io/docs/spot/v1/en/#get-all-accounts-of-the-current-user
3217
- * @param {string} type 'spot', 'swap' or 'future
3218
- * @param {string} [marginMode] 'cross' or 'isolated'
3219
- * @param {object} [params] extra parameters specific to the exchange API endpoint
3220
- * @returns {object} a dictionary of [account structures]{@link https://docs.ccxt.com/#/?id=account-structure} indexed by the account type
3221
- */
3222
3223
  const accounts = await this.loadAccounts();
3223
3224
  const accountId = this.safeValue2(params, 'accountId', 'account-id');
3224
3225
  if (accountId !== undefined) {
@@ -3250,15 +3251,15 @@ export default class htx extends Exchange {
3250
3251
  const defaultAccount = this.safeValue(accounts, 0, {});
3251
3252
  return this.safeString(defaultAccount, 'id');
3252
3253
  }
3254
+ /**
3255
+ * @method
3256
+ * @name htx#fetchCurrencies
3257
+ * @description fetches all available currencies on an exchange
3258
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#apiv2-currency-amp-chains
3259
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3260
+ * @returns {object} an associative dictionary of currencies
3261
+ */
3253
3262
  async fetchCurrencies(params = {}) {
3254
- /**
3255
- * @method
3256
- * @name htx#fetchCurrencies
3257
- * @description fetches all available currencies on an exchange
3258
- * @see https://huobiapi.github.io/docs/spot/v1/en/#apiv2-currency-amp-chains
3259
- * @param {object} [params] extra parameters specific to the exchange API endpoint
3260
- * @returns {object} an associative dictionary of currencies
3261
- */
3262
3263
  const response = await this.spotPublicGetV2ReferenceCurrencies(params);
3263
3264
  //
3264
3265
  // {
@@ -3416,22 +3417,22 @@ export default class htx extends Exchange {
3416
3417
  return this.safeValue(uniqueNetworkIds, networkTitle, networkTitle);
3417
3418
  }
3418
3419
  }
3420
+ /**
3421
+ * @method
3422
+ * @name htx#fetchBalance
3423
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#get-account-balance-of-a-specific-account
3424
+ * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec4b429-7773-11ed-9966-0242ac110003
3425
+ * @see https://www.htx.com/en-us/opend/newApiPages/?id=10000074-77b7-11ed-9966-0242ac110003
3426
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#query-asset-valuation
3427
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-user-s-account-information
3428
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-query-user-s-account-information
3429
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-query-user-39-s-account-information
3430
+ * @description query for balance and get the amount of funds available for trading or funds locked in orders
3431
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3432
+ * @param {bool} [params.unified] provide this parameter if you have a recent account with unified cross+isolated margin account
3433
+ * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
3434
+ */
3419
3435
  async fetchBalance(params = {}) {
3420
- /**
3421
- * @method
3422
- * @name htx#fetchBalance
3423
- * @see https://huobiapi.github.io/docs/spot/v1/en/#get-account-balance-of-a-specific-account
3424
- * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec4b429-7773-11ed-9966-0242ac110003
3425
- * @see https://www.htx.com/en-us/opend/newApiPages/?id=10000074-77b7-11ed-9966-0242ac110003
3426
- * @see https://huobiapi.github.io/docs/dm/v1/en/#query-asset-valuation
3427
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-user-s-account-information
3428
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-query-user-s-account-information
3429
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-query-user-39-s-account-information
3430
- * @description query for balance and get the amount of funds available for trading or funds locked in orders
3431
- * @param {object} [params] extra parameters specific to the exchange API endpoint
3432
- * @param {bool} [params.unified] provide this parameter if you have a recent account with unified cross+isolated margin account
3433
- * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
3434
- */
3435
3436
  await this.loadMarkets();
3436
3437
  let type = undefined;
3437
3438
  [type, params] = this.handleMarketTypeAndParams('fetchBalance', undefined, params);
@@ -3752,21 +3753,22 @@ export default class htx extends Exchange {
3752
3753
  }
3753
3754
  return result;
3754
3755
  }
3756
+ /**
3757
+ * @method
3758
+ * @name htx#fetchOrder
3759
+ * @description fetches information on an order made by the user
3760
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#get-the-order-detail-of-an-order-based-on-client-order-id
3761
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#get-the-order-detail-of-an-order
3762
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-get-information-of-an-order
3763
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-get-information-of-order
3764
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#get-information-of-an-order
3765
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-information-of-an-order
3766
+ * @param {string} id order id
3767
+ * @param {string} symbol unified symbol of the market the order was made in
3768
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3769
+ * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
3770
+ */
3755
3771
  async fetchOrder(id, symbol = undefined, params = {}) {
3756
- /**
3757
- * @method
3758
- * @name htx#fetchOrder
3759
- * @description fetches information on an order made by the user
3760
- * @see https://huobiapi.github.io/docs/spot/v1/en/#get-the-order-detail-of-an-order-based-on-client-order-id
3761
- * @see https://huobiapi.github.io/docs/spot/v1/en/#get-the-order-detail-of-an-order
3762
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-get-information-of-an-order
3763
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-get-information-of-order
3764
- * @see https://huobiapi.github.io/docs/dm/v1/en/#get-information-of-an-order
3765
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-information-of-an-order
3766
- * @param {string} symbol unified symbol of the market the order was made in
3767
- * @param {object} [params] extra parameters specific to the exchange API endpoint
3768
- * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
3769
- */
3770
3772
  await this.loadMarkets();
3771
3773
  let market = undefined;
3772
3774
  if (symbol !== undefined) {
@@ -4320,27 +4322,27 @@ export default class htx extends Exchange {
4320
4322
  };
4321
4323
  return await this.fetchContractOrders(symbol, since, limit, this.extend(request, params));
4322
4324
  }
4325
+ /**
4326
+ * @method
4327
+ * @name htx#fetchOrders
4328
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#search-past-orders
4329
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#search-historical-orders-within-48-hours
4330
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-get-history-orders-new
4331
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-get-history-orders-new
4332
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-history-orders-new
4333
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-history-orders-via-multiple-fields-new
4334
+ * @description fetches information on multiple orders made by the user
4335
+ * @param {string} symbol unified market symbol of the market orders were made in
4336
+ * @param {int} [since] the earliest time in ms to fetch orders for
4337
+ * @param {int} [limit] the maximum number of order structures to retrieve
4338
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
4339
+ * @param {bool} [params.stop] *contract only* if the orders are stop trigger orders or not
4340
+ * @param {bool} [params.stopLossTakeProfit] *contract only* if the orders are stop-loss or take-profit orders
4341
+ * @param {int} [params.until] the latest time in ms to fetch entries for
4342
+ * @param {boolean} [params.trailing] *contract only* set to true if you want to fetch trailing stop orders
4343
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
4344
+ */
4323
4345
  async fetchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
4324
- /**
4325
- * @method
4326
- * @name htx#fetchOrders
4327
- * @see https://huobiapi.github.io/docs/spot/v1/en/#search-past-orders
4328
- * @see https://huobiapi.github.io/docs/spot/v1/en/#search-historical-orders-within-48-hours
4329
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-get-history-orders-new
4330
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-get-history-orders-new
4331
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-history-orders-new
4332
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-history-orders-via-multiple-fields-new
4333
- * @description fetches information on multiple orders made by the user
4334
- * @param {string} symbol unified market symbol of the market orders were made in
4335
- * @param {int} [since] the earliest time in ms to fetch orders for
4336
- * @param {int} [limit] the maximum number of order structures to retrieve
4337
- * @param {object} [params] extra parameters specific to the exchange API endpoint
4338
- * @param {bool} [params.stop] *contract only* if the orders are stop trigger orders or not
4339
- * @param {bool} [params.stopLossTakeProfit] *contract only* if the orders are stop-loss or take-profit orders
4340
- * @param {int} [params.until] the latest time in ms to fetch entries for
4341
- * @param {boolean} [params.trailing] *contract only* set to true if you want to fetch trailing stop orders
4342
- * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
4343
- */
4344
4346
  await this.loadMarkets();
4345
4347
  let market = undefined;
4346
4348
  if (symbol !== undefined) {
@@ -4359,25 +4361,25 @@ export default class htx extends Exchange {
4359
4361
  return await this.fetchSpotOrders(symbol, since, limit, params);
4360
4362
  }
4361
4363
  }
4364
+ /**
4365
+ * @method
4366
+ * @name htx#fetchClosedOrders
4367
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#search-past-orders
4368
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#search-historical-orders-within-48-hours
4369
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-get-history-orders-new
4370
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-get-history-orders-new
4371
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-history-orders-new
4372
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-history-orders-via-multiple-fields-new
4373
+ * @description fetches information on multiple closed orders made by the user
4374
+ * @param {string} symbol unified market symbol of the market orders were made in
4375
+ * @param {int} [since] the earliest time in ms to fetch orders for
4376
+ * @param {int} [limit] the maximum number of order structures to retrieve
4377
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
4378
+ * @param {int} [params.until] the latest time in ms to fetch entries for
4379
+ * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
4380
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
4381
+ */
4362
4382
  async fetchClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
4363
- /**
4364
- * @method
4365
- * @name htx#fetchClosedOrders
4366
- * @see https://huobiapi.github.io/docs/spot/v1/en/#search-past-orders
4367
- * @see https://huobiapi.github.io/docs/spot/v1/en/#search-historical-orders-within-48-hours
4368
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-get-history-orders-new
4369
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-get-history-orders-new
4370
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-history-orders-new
4371
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-history-orders-via-multiple-fields-new
4372
- * @description fetches information on multiple closed orders made by the user
4373
- * @param {string} symbol unified market symbol of the market orders were made in
4374
- * @param {int} [since] the earliest time in ms to fetch orders for
4375
- * @param {int} [limit] the maximum number of order structures to retrieve
4376
- * @param {object} [params] extra parameters specific to the exchange API endpoint
4377
- * @param {int} [params.until] the latest time in ms to fetch entries for
4378
- * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
4379
- * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
4380
- */
4381
4383
  await this.loadMarkets();
4382
4384
  let paginate = false;
4383
4385
  [paginate, params] = this.handleOptionAndParams(params, 'fetchClosedOrders', 'paginate');
@@ -4397,23 +4399,23 @@ export default class htx extends Exchange {
4397
4399
  return await this.fetchClosedContractOrders(symbol, since, limit, params);
4398
4400
  }
4399
4401
  }
4402
+ /**
4403
+ * @method
4404
+ * @name htx#fetchOpenOrders
4405
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#get-all-open-orders
4406
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-current-unfilled-order-acquisition
4407
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-current-unfilled-order-acquisition
4408
+ * @description fetch all unfilled currently open orders
4409
+ * @param {string} symbol unified market symbol
4410
+ * @param {int} [since] the earliest time in ms to fetch open orders for
4411
+ * @param {int} [limit] the maximum number of open order structures to retrieve
4412
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
4413
+ * @param {bool} [params.stop] *contract only* if the orders are stop trigger orders or not
4414
+ * @param {bool} [params.stopLossTakeProfit] *contract only* if the orders are stop-loss or take-profit orders
4415
+ * @param {boolean} [params.trailing] *contract only* set to true if you want to fetch trailing stop orders
4416
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
4417
+ */
4400
4418
  async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
4401
- /**
4402
- * @method
4403
- * @name htx#fetchOpenOrders
4404
- * @see https://huobiapi.github.io/docs/spot/v1/en/#get-all-open-orders
4405
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-current-unfilled-order-acquisition
4406
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-current-unfilled-order-acquisition
4407
- * @description fetch all unfilled currently open orders
4408
- * @param {string} symbol unified market symbol
4409
- * @param {int} [since] the earliest time in ms to fetch open orders for
4410
- * @param {int} [limit] the maximum number of open order structures to retrieve
4411
- * @param {object} [params] extra parameters specific to the exchange API endpoint
4412
- * @param {bool} [params.stop] *contract only* if the orders are stop trigger orders or not
4413
- * @param {bool} [params.stopLossTakeProfit] *contract only* if the orders are stop-loss or take-profit orders
4414
- * @param {boolean} [params.trailing] *contract only* set to true if you want to fetch trailing stop orders
4415
- * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
4416
- */
4417
4419
  await this.loadMarkets();
4418
4420
  let market = undefined;
4419
4421
  if (symbol !== undefined) {
@@ -5175,17 +5177,17 @@ export default class htx extends Exchange {
5175
5177
  'trades': trades,
5176
5178
  }, market);
5177
5179
  }
5180
+ /**
5181
+ * @method
5182
+ * @name htx#createMarketBuyOrderWithCost
5183
+ * @description create a market buy order by providing the symbol and cost
5184
+ * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec4ee16-7773-11ed-9966-0242ac110003
5185
+ * @param {string} symbol unified symbol of the market to create an order in
5186
+ * @param {float} cost how much you want to trade in units of the quote currency
5187
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
5188
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
5189
+ */
5178
5190
  async createMarketBuyOrderWithCost(symbol, cost, params = {}) {
5179
- /**
5180
- * @method
5181
- * @name htx#createMarketBuyOrderWithCost
5182
- * @description create a market buy order by providing the symbol and cost
5183
- * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec4ee16-7773-11ed-9966-0242ac110003
5184
- * @param {string} symbol unified symbol of the market to create an order in
5185
- * @param {float} cost how much you want to trade in units of the quote currency
5186
- * @param {object} [params] extra parameters specific to the exchange API endpoint
5187
- * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
5188
- */
5189
5191
  await this.loadMarkets();
5190
5192
  const market = this.market(symbol);
5191
5193
  if (!market['spot']) {
@@ -5194,21 +5196,21 @@ export default class htx extends Exchange {
5194
5196
  params['createMarketBuyOrderRequiresPrice'] = false;
5195
5197
  return await this.createOrder(symbol, 'market', 'buy', cost, undefined, params);
5196
5198
  }
5199
+ /**
5200
+ * @method
5201
+ * @name htx#createTrailingPercentOrder
5202
+ * @description create a trailing order by providing the symbol, type, side, amount, price and trailingPercent
5203
+ * @param {string} symbol unified symbol of the market to create an order in
5204
+ * @param {string} type 'market' or 'limit'
5205
+ * @param {string} side 'buy' or 'sell'
5206
+ * @param {float} amount how much you want to trade in units of the base currency, or number of contracts
5207
+ * @param {float} [price] the price for the order to be filled at, in units of the quote currency, ignored in market orders
5208
+ * @param {float} trailingPercent the percent to trail away from the current market price
5209
+ * @param {float} trailingTriggerPrice the price to activate a trailing order, default uses the price argument
5210
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
5211
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
5212
+ */
5197
5213
  async createTrailingPercentOrder(symbol, type, side, amount, price = undefined, trailingPercent = undefined, trailingTriggerPrice = undefined, params = {}) {
5198
- /**
5199
- * @method
5200
- * @name htx#createTrailingPercentOrder
5201
- * @description create a trailing order by providing the symbol, type, side, amount, price and trailingPercent
5202
- * @param {string} symbol unified symbol of the market to create an order in
5203
- * @param {string} type 'market' or 'limit'
5204
- * @param {string} side 'buy' or 'sell'
5205
- * @param {float} amount how much you want to trade in units of the base currency, or number of contracts
5206
- * @param {float} [price] the price for the order to be filled at, in units of the quote currency, ignored in market orders
5207
- * @param {float} trailingPercent the percent to trail away from the current market price
5208
- * @param {float} trailingTriggerPrice the price to activate a trailing order, default uses the price argument
5209
- * @param {object} [params] extra parameters specific to the exchange API endpoint
5210
- * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
5211
- */
5212
5214
  if (trailingPercent === undefined) {
5213
5215
  throw new ArgumentsRequired(this.id + ' createTrailingPercentOrder() requires a trailingPercent argument');
5214
5216
  }
@@ -5219,22 +5221,22 @@ export default class htx extends Exchange {
5219
5221
  params['trailingTriggerPrice'] = trailingTriggerPrice;
5220
5222
  return await this.createOrder(symbol, type, side, amount, price, params);
5221
5223
  }
5224
+ /**
5225
+ * @method
5226
+ * @ignore
5227
+ * @name htx#createSpotOrderRequest
5228
+ * @description helper function to build request
5229
+ * @param {string} symbol unified symbol of the market to create an order in
5230
+ * @param {string} type 'market' or 'limit'
5231
+ * @param {string} side 'buy' or 'sell'
5232
+ * @param {float} amount how much you want to trade in units of the base currency
5233
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
5234
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
5235
+ * @param {string} [params.timeInForce] supports 'IOC' and 'FOK'
5236
+ * @param {float} [params.cost] the quote quantity that can be used as an alternative for the amount for market buy orders
5237
+ * @returns {object} request to be sent to the exchange
5238
+ */
5222
5239
  async createSpotOrderRequest(symbol, type, side, amount, price = undefined, params = {}) {
5223
- /**
5224
- * @method
5225
- * @ignore
5226
- * @name htx#createSpotOrderRequest
5227
- * @description helper function to build request
5228
- * @param {string} symbol unified symbol of the market to create an order in
5229
- * @param {string} type 'market' or 'limit'
5230
- * @param {string} side 'buy' or 'sell'
5231
- * @param {float} amount how much you want to trade in units of the base currency
5232
- * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
5233
- * @param {object} [params] extra parameters specific to the exchange API endpoint
5234
- * @param {string} [params.timeInForce] supports 'IOC' and 'FOK'
5235
- * @param {float} [params.cost] the quote quantity that can be used as an alternative for the amount for market buy orders
5236
- * @returns {object} request to be sent to the exchange
5237
- */
5238
5240
  await this.loadMarkets();
5239
5241
  await this.loadAccounts();
5240
5242
  const market = this.market(symbol);
@@ -5446,40 +5448,40 @@ export default class htx extends Exchange {
5446
5448
  params = this.omit(params, ['reduceOnly', 'triggerPrice', 'stopPrice', 'stopLossPrice', 'takeProfitPrice', 'triggerType', 'leverRate', 'timeInForce', 'leverage', 'trailingPercent', 'trailingTriggerPrice']);
5447
5449
  return this.extend(request, params);
5448
5450
  }
5451
+ /**
5452
+ * @method
5453
+ * @name htx#createOrder
5454
+ * @description create a trade order
5455
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#place-a-new-order // spot, margin
5456
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#place-an-order // coin-m swap
5457
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#place-trigger-order // coin-m swap trigger
5458
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-place-an-order // usdt-m swap cross
5459
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-place-trigger-order // usdt-m swap cross trigger
5460
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-place-an-order // usdt-m swap isolated
5461
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-place-trigger-order // usdt-m swap isolated trigger
5462
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#place-an-order // coin-m futures
5463
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#place-trigger-order // coin-m futures contract trigger
5464
+ * @param {string} symbol unified symbol of the market to create an order in
5465
+ * @param {string} type 'market' or 'limit'
5466
+ * @param {string} side 'buy' or 'sell'
5467
+ * @param {float} amount how much you want to trade in units of the base currency
5468
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
5469
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
5470
+ * @param {float} [params.triggerPrice] the price a trigger order is triggered at
5471
+ * @param {string} [params.triggerType] *contract trigger orders only* ge: greater than or equal to, le: less than or equal to
5472
+ * @param {float} [params.stopLossPrice] *contract only* the price a stop-loss order is triggered at
5473
+ * @param {float} [params.takeProfitPrice] *contract only* the price a take-profit order is triggered at
5474
+ * @param {string} [params.operator] *spot and margin only* gte or lte, trigger price condition
5475
+ * @param {string} [params.offset] *contract only* 'both' (linear only), 'open', or 'close', required in hedge mode and for inverse markets
5476
+ * @param {bool} [params.postOnly] *contract only* true or false
5477
+ * @param {int} [params.leverRate] *contract only* required for all contract orders except tpsl, leverage greater than 20x requires prior approval of high-leverage agreement
5478
+ * @param {string} [params.timeInForce] supports 'IOC' and 'FOK'
5479
+ * @param {float} [params.cost] *spot market buy only* the quote quantity that can be used as an alternative for the amount
5480
+ * @param {float} [params.trailingPercent] *contract only* the percent to trail away from the current market price
5481
+ * @param {float} [params.trailingTriggerPrice] *contract only* the price to trigger a trailing order, default uses the price argument
5482
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
5483
+ */
5449
5484
  async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
5450
- /**
5451
- * @method
5452
- * @name htx#createOrder
5453
- * @description create a trade order
5454
- * @see https://huobiapi.github.io/docs/spot/v1/en/#place-a-new-order // spot, margin
5455
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#place-an-order // coin-m swap
5456
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#place-trigger-order // coin-m swap trigger
5457
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-place-an-order // usdt-m swap cross
5458
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-place-trigger-order // usdt-m swap cross trigger
5459
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-place-an-order // usdt-m swap isolated
5460
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-place-trigger-order // usdt-m swap isolated trigger
5461
- * @see https://huobiapi.github.io/docs/dm/v1/en/#place-an-order // coin-m futures
5462
- * @see https://huobiapi.github.io/docs/dm/v1/en/#place-trigger-order // coin-m futures contract trigger
5463
- * @param {string} symbol unified symbol of the market to create an order in
5464
- * @param {string} type 'market' or 'limit'
5465
- * @param {string} side 'buy' or 'sell'
5466
- * @param {float} amount how much you want to trade in units of the base currency
5467
- * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
5468
- * @param {object} [params] extra parameters specific to the exchange API endpoint
5469
- * @param {float} [params.triggerPrice] the price a trigger order is triggered at
5470
- * @param {string} [params.triggerType] *contract trigger orders only* ge: greater than or equal to, le: less than or equal to
5471
- * @param {float} [params.stopLossPrice] *contract only* the price a stop-loss order is triggered at
5472
- * @param {float} [params.takeProfitPrice] *contract only* the price a take-profit order is triggered at
5473
- * @param {string} [params.operator] *spot and margin only* gte or lte, trigger price condition
5474
- * @param {string} [params.offset] *contract only* 'both' (linear only), 'open', or 'close', required in hedge mode and for inverse markets
5475
- * @param {bool} [params.postOnly] *contract only* true or false
5476
- * @param {int} [params.leverRate] *contract only* required for all contract orders except tpsl, leverage greater than 20x requires prior approval of high-leverage agreement
5477
- * @param {string} [params.timeInForce] supports 'IOC' and 'FOK'
5478
- * @param {float} [params.cost] *spot market buy only* the quote quantity that can be used as an alternative for the amount
5479
- * @param {float} [params.trailingPercent] *contract only* the percent to trail away from the current market price
5480
- * @param {float} [params.trailingTriggerPrice] *contract only* the price to trigger a trailing order, default uses the price argument
5481
- * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
5482
- */
5483
5485
  await this.loadMarkets();
5484
5486
  const market = this.market(symbol);
5485
5487
  const triggerPrice = this.safeNumberN(params, ['triggerPrice', 'stopPrice', 'trigger_price']);
@@ -5635,20 +5637,20 @@ export default class htx extends Exchange {
5635
5637
  }
5636
5638
  return this.parseOrder(result, market);
5637
5639
  }
5640
+ /**
5641
+ * @method
5642
+ * @name htx#createOrders
5643
+ * @description create a list of trade orders
5644
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#place-a-batch-of-orders
5645
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#place-a-batch-of-orders
5646
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#place-a-batch-of-orders
5647
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-place-a-batch-of-orders
5648
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-place-a-batch-of-orders
5649
+ * @param {Array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
5650
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
5651
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
5652
+ */
5638
5653
  async createOrders(orders, params = {}) {
5639
- /**
5640
- * @method
5641
- * @name htx#createOrders
5642
- * @description create a list of trade orders
5643
- * @see https://huobiapi.github.io/docs/spot/v1/en/#place-a-batch-of-orders
5644
- * @see https://huobiapi.github.io/docs/dm/v1/en/#place-a-batch-of-orders
5645
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#place-a-batch-of-orders
5646
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-place-a-batch-of-orders
5647
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-place-a-batch-of-orders
5648
- * @param {Array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
5649
- * @param {object} [params] extra parameters specific to the exchange API endpoint
5650
- * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
5651
- */
5652
5654
  await this.loadMarkets();
5653
5655
  const ordersRequests = [];
5654
5656
  let symbol = undefined;
@@ -5771,19 +5773,19 @@ export default class htx extends Exchange {
5771
5773
  }
5772
5774
  return this.parseOrders(result, market);
5773
5775
  }
5776
+ /**
5777
+ * @method
5778
+ * @name htx#cancelOrder
5779
+ * @description cancels an open order
5780
+ * @param {string} id order id
5781
+ * @param {string} symbol unified symbol of the market the order was made in
5782
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
5783
+ * @param {boolean} [params.stop] *contract only* if the order is a stop trigger order or not
5784
+ * @param {boolean} [params.stopLossTakeProfit] *contract only* if the order is a stop-loss or take-profit order
5785
+ * @param {boolean} [params.trailing] *contract only* set to true if you want to cancel a trailing order
5786
+ * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
5787
+ */
5774
5788
  async cancelOrder(id, symbol = undefined, params = {}) {
5775
- /**
5776
- * @method
5777
- * @name htx#cancelOrder
5778
- * @description cancels an open order
5779
- * @param {string} id order id
5780
- * @param {string} symbol unified symbol of the market the order was made in
5781
- * @param {object} [params] extra parameters specific to the exchange API endpoint
5782
- * @param {boolean} [params.stop] *contract only* if the order is a stop trigger order or not
5783
- * @param {boolean} [params.stopLossTakeProfit] *contract only* if the order is a stop-loss or take-profit order
5784
- * @param {boolean} [params.trailing] *contract only* set to true if you want to cancel a trailing order
5785
- * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
5786
- */
5787
5789
  await this.loadMarkets();
5788
5790
  let market = undefined;
5789
5791
  if (symbol !== undefined) {
@@ -5929,18 +5931,18 @@ export default class htx extends Exchange {
5929
5931
  'status': 'canceled',
5930
5932
  });
5931
5933
  }
5934
+ /**
5935
+ * @method
5936
+ * @name htx#cancelOrders
5937
+ * @description cancel multiple orders
5938
+ * @param {string[]} ids order ids
5939
+ * @param {string} symbol unified market symbol, default is undefined
5940
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
5941
+ * @param {bool} [params.stop] *contract only* if the orders are stop trigger orders or not
5942
+ * @param {bool} [params.stopLossTakeProfit] *contract only* if the orders are stop-loss or take-profit orders
5943
+ * @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
5944
+ */
5932
5945
  async cancelOrders(ids, symbol = undefined, params = {}) {
5933
- /**
5934
- * @method
5935
- * @name htx#cancelOrders
5936
- * @description cancel multiple orders
5937
- * @param {string[]} ids order ids
5938
- * @param {string} symbol unified market symbol, default is undefined
5939
- * @param {object} [params] extra parameters specific to the exchange API endpoint
5940
- * @param {bool} [params.stop] *contract only* if the orders are stop trigger orders or not
5941
- * @param {bool} [params.stopLossTakeProfit] *contract only* if the orders are stop-loss or take-profit orders
5942
- * @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
5943
- */
5944
5946
  await this.loadMarkets();
5945
5947
  let market = undefined;
5946
5948
  if (symbol !== undefined) {
@@ -6170,18 +6172,18 @@ export default class htx extends Exchange {
6170
6172
  }
6171
6173
  return result;
6172
6174
  }
6175
+ /**
6176
+ * @method
6177
+ * @name htx#cancelAllOrders
6178
+ * @description cancel all open orders
6179
+ * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
6180
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
6181
+ * @param {boolean} [params.stop] *contract only* if the orders are stop trigger orders or not
6182
+ * @param {boolean} [params.stopLossTakeProfit] *contract only* if the orders are stop-loss or take-profit orders
6183
+ * @param {boolean} [params.trailing] *contract only* set to true if you want to cancel all trailing orders
6184
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
6185
+ */
6173
6186
  async cancelAllOrders(symbol = undefined, params = {}) {
6174
- /**
6175
- * @method
6176
- * @name htx#cancelAllOrders
6177
- * @description cancel all open orders
6178
- * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
6179
- * @param {object} [params] extra parameters specific to the exchange API endpoint
6180
- * @param {boolean} [params.stop] *contract only* if the orders are stop trigger orders or not
6181
- * @param {boolean} [params.stopLossTakeProfit] *contract only* if the orders are stop-loss or take-profit orders
6182
- * @param {boolean} [params.trailing] *contract only* set to true if you want to cancel all trailing orders
6183
- * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
6184
- */
6185
6187
  await this.loadMarkets();
6186
6188
  let market = undefined;
6187
6189
  if (symbol !== undefined) {
@@ -6318,16 +6320,16 @@ export default class htx extends Exchange {
6318
6320
  return this.parseCancelOrders(data);
6319
6321
  }
6320
6322
  }
6323
+ /**
6324
+ * @method
6325
+ * @name htx#cancelAllOrdersAfter
6326
+ * @description dead man's switch, cancel all orders after the given timeout
6327
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#dead-man-s-switch
6328
+ * @param {number} timeout time in milliseconds, 0 represents cancel the timer
6329
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
6330
+ * @returns {object} the api result
6331
+ */
6321
6332
  async cancelAllOrdersAfter(timeout, params = {}) {
6322
- /**
6323
- * @method
6324
- * @name htx#cancelAllOrdersAfter
6325
- * @description dead man's switch, cancel all orders after the given timeout
6326
- * @see https://huobiapi.github.io/docs/spot/v1/en/#dead-man-s-switch
6327
- * @param {number} timeout time in milliseconds, 0 represents cancel the timer
6328
- * @param {object} [params] extra parameters specific to the exchange API endpoint
6329
- * @returns {object} the api result
6330
- */
6331
6333
  await this.loadMarkets();
6332
6334
  const request = {
6333
6335
  'timeout': (timeout > 0) ? this.parseToInt(timeout / 1000) : 0,
@@ -6371,16 +6373,16 @@ export default class htx extends Exchange {
6371
6373
  'info': depositAddress,
6372
6374
  };
6373
6375
  }
6376
+ /**
6377
+ * @method
6378
+ * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec50029-7773-11ed-9966-0242ac110003
6379
+ * @name htx#fetchDepositAddressesByNetwork
6380
+ * @description fetch a dictionary of addresses for a currency, indexed by network
6381
+ * @param {string} code unified currency code of the currency for the deposit address
6382
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
6383
+ * @returns {object} a dictionary of [address structures]{@link https://docs.ccxt.com/#/?id=address-structure} indexed by the network
6384
+ */
6374
6385
  async fetchDepositAddressesByNetwork(code, params = {}) {
6375
- /**
6376
- * @method
6377
- * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec50029-7773-11ed-9966-0242ac110003
6378
- * @name htx#fetchDepositAddressesByNetwork
6379
- * @description fetch a dictionary of addresses for a currency, indexed by network
6380
- * @param {string} code unified currency code of the currency for the deposit address
6381
- * @param {object} [params] extra parameters specific to the exchange API endpoint
6382
- * @returns {object} a dictionary of [address structures]{@link https://docs.ccxt.com/#/?id=address-structure} indexed by the network
6383
- */
6384
6386
  await this.loadMarkets();
6385
6387
  const currency = this.currency(code);
6386
6388
  const request = {
@@ -6404,16 +6406,16 @@ export default class htx extends Exchange {
6404
6406
  const parsed = this.parseDepositAddresses(data, [currency['code']], false);
6405
6407
  return this.indexBy(parsed, 'network');
6406
6408
  }
6409
+ /**
6410
+ * @method
6411
+ * @name htx#fetchDepositAddress
6412
+ * @description fetch the deposit address for a currency associated with this account
6413
+ * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec50029-7773-11ed-9966-0242ac110003
6414
+ * @param {string} code unified currency code
6415
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
6416
+ * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
6417
+ */
6407
6418
  async fetchDepositAddress(code, params = {}) {
6408
- /**
6409
- * @method
6410
- * @name htx#fetchDepositAddress
6411
- * @description fetch the deposit address for a currency associated with this account
6412
- * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec50029-7773-11ed-9966-0242ac110003
6413
- * @param {string} code unified currency code
6414
- * @param {object} [params] extra parameters specific to the exchange API endpoint
6415
- * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
6416
- */
6417
6419
  await this.loadMarkets();
6418
6420
  const currency = this.currency(code);
6419
6421
  const [networkCode, paramsOmited] = this.handleNetworkCodeAndParams(params);
@@ -6455,18 +6457,18 @@ export default class htx extends Exchange {
6455
6457
  }
6456
6458
  return addresses;
6457
6459
  }
6460
+ /**
6461
+ * @method
6462
+ * @name htx#fetchDeposits
6463
+ * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec4f050-7773-11ed-9966-0242ac110003
6464
+ * @description fetch all deposits made to an account
6465
+ * @param {string} code unified currency code
6466
+ * @param {int} [since] the earliest time in ms to fetch deposits for
6467
+ * @param {int} [limit] the maximum number of deposits structures to retrieve
6468
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
6469
+ * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
6470
+ */
6458
6471
  async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
6459
- /**
6460
- * @method
6461
- * @name htx#fetchDeposits
6462
- * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec4f050-7773-11ed-9966-0242ac110003
6463
- * @description fetch all deposits made to an account
6464
- * @param {string} code unified currency code
6465
- * @param {int} [since] the earliest time in ms to fetch deposits for
6466
- * @param {int} [limit] the maximum number of deposits structures to retrieve
6467
- * @param {object} [params] extra parameters specific to the exchange API endpoint
6468
- * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
6469
- */
6470
6472
  if (limit === undefined || limit > 100) {
6471
6473
  limit = 100;
6472
6474
  }
@@ -6515,18 +6517,18 @@ export default class htx extends Exchange {
6515
6517
  //
6516
6518
  return this.parseTransactions(response['data'], currency, since, limit);
6517
6519
  }
6520
+ /**
6521
+ * @method
6522
+ * @name htx#fetchWithdrawals
6523
+ * @description fetch all withdrawals made from an account
6524
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#search-for-existed-withdraws-and-deposits
6525
+ * @param {string} code unified currency code
6526
+ * @param {int} [since] the earliest time in ms to fetch withdrawals for
6527
+ * @param {int} [limit] the maximum number of withdrawals structures to retrieve
6528
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
6529
+ * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
6530
+ */
6518
6531
  async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
6519
- /**
6520
- * @method
6521
- * @name htx#fetchWithdrawals
6522
- * @description fetch all withdrawals made from an account
6523
- * @see https://huobiapi.github.io/docs/spot/v1/en/#search-for-existed-withdraws-and-deposits
6524
- * @param {string} code unified currency code
6525
- * @param {int} [since] the earliest time in ms to fetch withdrawals for
6526
- * @param {int} [limit] the maximum number of withdrawals structures to retrieve
6527
- * @param {object} [params] extra parameters specific to the exchange API endpoint
6528
- * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
6529
- */
6530
6532
  if (limit === undefined || limit > 100) {
6531
6533
  limit = 100;
6532
6534
  }
@@ -6691,19 +6693,19 @@ export default class htx extends Exchange {
6691
6693
  };
6692
6694
  return this.safeString(statuses, status, status);
6693
6695
  }
6696
+ /**
6697
+ * @method
6698
+ * @name htx#withdraw
6699
+ * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec4cc41-7773-11ed-9966-0242ac110003
6700
+ * @description make a withdrawal
6701
+ * @param {string} code unified currency code
6702
+ * @param {float} amount the amount to withdraw
6703
+ * @param {string} address the address to withdraw to
6704
+ * @param {string} tag
6705
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
6706
+ * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
6707
+ */
6694
6708
  async withdraw(code, amount, address, tag = undefined, params = {}) {
6695
- /**
6696
- * @method
6697
- * @name htx#withdraw
6698
- * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec4cc41-7773-11ed-9966-0242ac110003
6699
- * @description make a withdrawal
6700
- * @param {string} code unified currency code
6701
- * @param {float} amount the amount to withdraw
6702
- * @param {string} address the address to withdraw to
6703
- * @param {string} tag
6704
- * @param {object} [params] extra parameters specific to the exchange API endpoint
6705
- * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
6706
- */
6707
6709
  [tag, params] = this.handleWithdrawTagAndParams(tag, params);
6708
6710
  await this.loadMarkets();
6709
6711
  this.checkAddress(address);
@@ -6775,27 +6777,27 @@ export default class htx extends Exchange {
6775
6777
  'status': undefined,
6776
6778
  };
6777
6779
  }
6780
+ /**
6781
+ * @method
6782
+ * @name htx#transfer
6783
+ * @description transfer currency internally between wallets on the same account
6784
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#transfer-margin-between-spot-account-and-future-account
6785
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#transfer-fund-between-spot-account-and-future-contract-account
6786
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-transfer-margin-between-spot-account-and-usdt-margined-contracts-account
6787
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#transfer-asset-from-spot-trading-account-to-cross-margin-account-cross
6788
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#transfer-asset-from-spot-trading-account-to-isolated-margin-account-isolated
6789
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#transfer-asset-from-cross-margin-account-to-spot-trading-account-cross
6790
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#transfer-asset-from-isolated-margin-account-to-spot-trading-account-isolated
6791
+ * @param {string} code unified currency code
6792
+ * @param {float} amount amount to transfer
6793
+ * @param {string} fromAccount account to transfer from 'spot', 'future', 'swap'
6794
+ * @param {string} toAccount account to transfer to 'spot', 'future', 'swap'
6795
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
6796
+ * @param {string} [params.symbol] used for isolated margin transfer
6797
+ * @param {string} [params.subType] 'linear' or 'inverse', only used when transfering to/from swap accounts
6798
+ * @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
6799
+ */
6778
6800
  async transfer(code, amount, fromAccount, toAccount, params = {}) {
6779
- /**
6780
- * @method
6781
- * @name htx#transfer
6782
- * @description transfer currency internally between wallets on the same account
6783
- * @see https://huobiapi.github.io/docs/dm/v1/en/#transfer-margin-between-spot-account-and-future-account
6784
- * @see https://huobiapi.github.io/docs/spot/v1/en/#transfer-fund-between-spot-account-and-future-contract-account
6785
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-transfer-margin-between-spot-account-and-usdt-margined-contracts-account
6786
- * @see https://huobiapi.github.io/docs/spot/v1/en/#transfer-asset-from-spot-trading-account-to-cross-margin-account-cross
6787
- * @see https://huobiapi.github.io/docs/spot/v1/en/#transfer-asset-from-spot-trading-account-to-isolated-margin-account-isolated
6788
- * @see https://huobiapi.github.io/docs/spot/v1/en/#transfer-asset-from-cross-margin-account-to-spot-trading-account-cross
6789
- * @see https://huobiapi.github.io/docs/spot/v1/en/#transfer-asset-from-isolated-margin-account-to-spot-trading-account-isolated
6790
- * @param {string} code unified currency code
6791
- * @param {float} amount amount to transfer
6792
- * @param {string} fromAccount account to transfer from 'spot', 'future', 'swap'
6793
- * @param {string} toAccount account to transfer to 'spot', 'future', 'swap'
6794
- * @param {object} [params] extra parameters specific to the exchange API endpoint
6795
- * @param {string} [params.symbol] used for isolated margin transfer
6796
- * @param {string} [params.subType] 'linear' or 'inverse', only used when transfering to/from swap accounts
6797
- * @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
6798
- */
6799
6801
  await this.loadMarkets();
6800
6802
  const currency = this.currency(code);
6801
6803
  const request = {
@@ -6871,15 +6873,15 @@ export default class htx extends Exchange {
6871
6873
  //
6872
6874
  return this.parseTransfer(response, currency);
6873
6875
  }
6876
+ /**
6877
+ * @method
6878
+ * @name htx#fetchIsolatedBorrowRates
6879
+ * @description fetch the borrow interest rates of all currencies
6880
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#get-loan-interest-rate-and-quota-isolated
6881
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
6882
+ * @returns {object} a list of [isolated borrow rate structures]{@link https://docs.ccxt.com/#/?id=isolated-borrow-rate-structure}
6883
+ */
6874
6884
  async fetchIsolatedBorrowRates(params = {}) {
6875
- /**
6876
- * @method
6877
- * @name htx#fetchIsolatedBorrowRates
6878
- * @description fetch the borrow interest rates of all currencies
6879
- * @see https://huobiapi.github.io/docs/spot/v1/en/#get-loan-interest-rate-and-quota-isolated
6880
- * @param {object} [params] extra parameters specific to the exchange API endpoint
6881
- * @returns {object} a list of [isolated borrow rate structures]{@link https://docs.ccxt.com/#/?id=isolated-borrow-rate-structure}
6882
- */
6883
6885
  await this.loadMarkets();
6884
6886
  const response = await this.spotPrivateGetV1MarginLoanInfo(params);
6885
6887
  //
@@ -6957,20 +6959,20 @@ export default class htx extends Exchange {
6957
6959
  'info': info,
6958
6960
  };
6959
6961
  }
6962
+ /**
6963
+ * @method
6964
+ * @name htx#fetchFundingRateHistory
6965
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-historical-funding-rate
6966
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-historical-funding-rate
6967
+ * @description fetches historical funding rate prices
6968
+ * @param {string} symbol unified symbol of the market to fetch the funding rate history for
6969
+ * @param {int} [since] not used by huobi, but filtered internally by ccxt
6970
+ * @param {int} [limit] not used by huobi, but filtered internally by ccxt
6971
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
6972
+ * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
6973
+ * @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
6974
+ */
6960
6975
  async fetchFundingRateHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
6961
- /**
6962
- * @method
6963
- * @name htx#fetchFundingRateHistory
6964
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-historical-funding-rate
6965
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-historical-funding-rate
6966
- * @description fetches historical funding rate prices
6967
- * @param {string} symbol unified symbol of the market to fetch the funding rate history for
6968
- * @param {int} [since] not used by huobi, but filtered internally by ccxt
6969
- * @param {int} [limit] not used by huobi, but filtered internally by ccxt
6970
- * @param {object} [params] extra parameters specific to the exchange API endpoint
6971
- * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
6972
- * @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
6973
- */
6974
6976
  if (symbol === undefined) {
6975
6977
  throw new ArgumentsRequired(this.id + ' fetchFundingRateHistory() requires a symbol argument');
6976
6978
  }
@@ -7092,17 +7094,17 @@ export default class htx extends Exchange {
7092
7094
  };
7093
7095
  return this.safeString(intervals, interval, interval);
7094
7096
  }
7097
+ /**
7098
+ * @method
7099
+ * @name htx#fetchFundingRate
7100
+ * @description fetch the current funding rate
7101
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-funding-rate
7102
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-funding-rate
7103
+ * @param {string} symbol unified market symbol
7104
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
7105
+ * @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
7106
+ */
7095
7107
  async fetchFundingRate(symbol, params = {}) {
7096
- /**
7097
- * @method
7098
- * @name htx#fetchFundingRate
7099
- * @description fetch the current funding rate
7100
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-funding-rate
7101
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-funding-rate
7102
- * @param {string} symbol unified market symbol
7103
- * @param {object} [params] extra parameters specific to the exchange API endpoint
7104
- * @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
7105
- */
7106
7108
  await this.loadMarkets();
7107
7109
  const market = this.market(symbol);
7108
7110
  const request = {
@@ -7136,17 +7138,17 @@ export default class htx extends Exchange {
7136
7138
  const result = this.safeValue(response, 'data', {});
7137
7139
  return this.parseFundingRate(result, market);
7138
7140
  }
7141
+ /**
7142
+ * @method
7143
+ * @name htx#fetchFundingRates
7144
+ * @description fetch the funding rate for multiple markets
7145
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-a-batch-of-funding-rate
7146
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-a-batch-of-funding-rate
7147
+ * @param {string[]|undefined} symbols list of unified market symbols
7148
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
7149
+ * @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rates-structure}, indexed by market symbols
7150
+ */
7139
7151
  async fetchFundingRates(symbols = undefined, params = {}) {
7140
- /**
7141
- * @method
7142
- * @name htx#fetchFundingRates
7143
- * @description fetch the funding rate for multiple markets
7144
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-a-batch-of-funding-rate
7145
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-a-batch-of-funding-rate
7146
- * @param {string[]|undefined} symbols list of unified market symbols
7147
- * @param {object} [params] extra parameters specific to the exchange API endpoint
7148
- * @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rates-structure}, indexed by market symbols
7149
- */
7150
7152
  await this.loadMarkets();
7151
7153
  symbols = this.marketSymbols(symbols);
7152
7154
  const options = this.safeValue(this.options, 'fetchFundingRates', {});
@@ -7189,20 +7191,20 @@ export default class htx extends Exchange {
7189
7191
  const result = this.parseFundingRates(data);
7190
7192
  return this.filterByArray(result, 'symbol', symbols);
7191
7193
  }
7194
+ /**
7195
+ * @method
7196
+ * @name htx#fetchBorrowInterest
7197
+ * @description fetch the interest owed by the user for borrowing currency for margin trading
7198
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#search-past-margin-orders-cross
7199
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#search-past-margin-orders-isolated
7200
+ * @param {string} code unified currency code
7201
+ * @param {string} symbol unified market symbol when fetch interest in isolated markets
7202
+ * @param {int} [since] the earliest time in ms to fetch borrrow interest for
7203
+ * @param {int} [limit] the maximum number of structures to retrieve
7204
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
7205
+ * @returns {object[]} a list of [borrow interest structures]{@link https://docs.ccxt.com/#/?id=borrow-interest-structure}
7206
+ */
7192
7207
  async fetchBorrowInterest(code = undefined, symbol = undefined, since = undefined, limit = undefined, params = {}) {
7193
- /**
7194
- * @method
7195
- * @name htx#fetchBorrowInterest
7196
- * @description fetch the interest owed by the user for borrowing currency for margin trading
7197
- * @see https://huobiapi.github.io/docs/spot/v1/en/#search-past-margin-orders-cross
7198
- * @see https://huobiapi.github.io/docs/spot/v1/en/#search-past-margin-orders-isolated
7199
- * @param {string} code unified currency code
7200
- * @param {string} symbol unified market symbol when fetch interest in isolated markets
7201
- * @param {int} [since] the earliest time in ms to fetch borrrow interest for
7202
- * @param {int} [limit] the maximum number of structures to retrieve
7203
- * @param {object} [params] extra parameters specific to the exchange API endpoint
7204
- * @returns {object[]} a list of [borrow interest structures]{@link https://docs.ccxt.com/#/?id=borrow-interest-structure}
7205
- */
7206
7208
  await this.loadMarkets();
7207
7209
  let marginMode = undefined;
7208
7210
  [marginMode, params] = this.handleMarginModeAndParams('fetchBorrowInterest', params);
@@ -7474,20 +7476,20 @@ export default class htx extends Exchange {
7474
7476
  }
7475
7477
  return undefined;
7476
7478
  }
7479
+ /**
7480
+ * @method
7481
+ * @name htx#fetchFundingHistory
7482
+ * @description fetch the history of funding payments paid and received on this account
7483
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-account-financial-records-via-multiple-fields-new // linear swaps
7484
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#query-financial-records-via-multiple-fields-new // coin-m futures
7485
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-financial-records-via-multiple-fields-new // coin-m swaps
7486
+ * @param {string} symbol unified market symbol
7487
+ * @param {int} [since] the earliest time in ms to fetch funding history for
7488
+ * @param {int} [limit] the maximum number of funding history structures to retrieve
7489
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
7490
+ * @returns {object} a [funding history structure]{@link https://docs.ccxt.com/#/?id=funding-history-structure}
7491
+ */
7477
7492
  async fetchFundingHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
7478
- /**
7479
- * @method
7480
- * @name htx#fetchFundingHistory
7481
- * @description fetch the history of funding payments paid and received on this account
7482
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-account-financial-records-via-multiple-fields-new // linear swaps
7483
- * @see https://huobiapi.github.io/docs/dm/v1/en/#query-financial-records-via-multiple-fields-new // coin-m futures
7484
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-financial-records-via-multiple-fields-new // coin-m swaps
7485
- * @param {string} symbol unified market symbol
7486
- * @param {int} [since] the earliest time in ms to fetch funding history for
7487
- * @param {int} [limit] the maximum number of funding history structures to retrieve
7488
- * @param {object} [params] extra parameters specific to the exchange API endpoint
7489
- * @returns {object} a [funding history structure]{@link https://docs.ccxt.com/#/?id=funding-history-structure}
7490
- */
7491
7493
  await this.loadMarkets();
7492
7494
  const market = this.market(symbol);
7493
7495
  const [marketType, query] = this.handleMarketTypeAndParams('fetchFundingHistory', market, params);
@@ -7565,20 +7567,20 @@ export default class htx extends Exchange {
7565
7567
  const data = this.safeList(response, 'data', []);
7566
7568
  return this.parseIncomes(data, market, since, limit);
7567
7569
  }
7570
+ /**
7571
+ * @method
7572
+ * @name htx#setLeverage
7573
+ * @description set the level of leverage for a market
7574
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-switch-leverage
7575
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-switch-leverage
7576
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#switch-leverage
7577
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#switch-leverage // Coin-m futures
7578
+ * @param {float} leverage the rate of leverage
7579
+ * @param {string} symbol unified market symbol
7580
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
7581
+ * @returns {object} response from the exchange
7582
+ */
7568
7583
  async setLeverage(leverage, symbol = undefined, params = {}) {
7569
- /**
7570
- * @method
7571
- * @name htx#setLeverage
7572
- * @description set the level of leverage for a market
7573
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-switch-leverage
7574
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-switch-leverage
7575
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#switch-leverage
7576
- * @see https://huobiapi.github.io/docs/dm/v1/en/#switch-leverage // Coin-m futures
7577
- * @param {float} leverage the rate of leverage
7578
- * @param {string} symbol unified market symbol
7579
- * @param {object} [params] extra parameters specific to the exchange API endpoint
7580
- * @returns {object} response from the exchange
7581
- */
7582
7584
  if (symbol === undefined) {
7583
7585
  throw new ArgumentsRequired(this.id + ' setLeverage() requires a symbol argument');
7584
7586
  }
@@ -7769,22 +7771,22 @@ export default class htx extends Exchange {
7769
7771
  'takeProfitPrice': undefined,
7770
7772
  });
7771
7773
  }
7774
+ /**
7775
+ * @method
7776
+ * @name htx#fetchPositions
7777
+ * @description fetch all open positions
7778
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-query-user-39-s-position-information
7779
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-query-user-s-position-information
7780
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-user-s-position-information
7781
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#query-user-s-position-information
7782
+ * @param {string[]} [symbols] list of unified market symbols
7783
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
7784
+ * @param {string} [params.subType] 'linear' or 'inverse'
7785
+ * @param {string} [params.type] *inverse only* 'future', or 'swap'
7786
+ * @param {string} [params.marginMode] *linear only* 'cross' or 'isolated'
7787
+ * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
7788
+ */
7772
7789
  async fetchPositions(symbols = undefined, params = {}) {
7773
- /**
7774
- * @method
7775
- * @name htx#fetchPositions
7776
- * @description fetch all open positions
7777
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-query-user-39-s-position-information
7778
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-query-user-s-position-information
7779
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-user-s-position-information
7780
- * @see https://huobiapi.github.io/docs/dm/v1/en/#query-user-s-position-information
7781
- * @param {string[]} [symbols] list of unified market symbols
7782
- * @param {object} [params] extra parameters specific to the exchange API endpoint
7783
- * @param {string} [params.subType] 'linear' or 'inverse'
7784
- * @param {string} [params.type] *inverse only* 'future', or 'swap'
7785
- * @param {string} [params.marginMode] *linear only* 'cross' or 'isolated'
7786
- * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
7787
- */
7788
7790
  await this.loadMarkets();
7789
7791
  symbols = this.marketSymbols(symbols);
7790
7792
  let market = undefined;
@@ -7917,19 +7919,19 @@ export default class htx extends Exchange {
7917
7919
  }
7918
7920
  return this.filterByArrayPositions(result, 'symbol', symbols, false);
7919
7921
  }
7922
+ /**
7923
+ * @method
7924
+ * @name htx#fetchPosition
7925
+ * @description fetch data on a single open contract trade position
7926
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-query-assets-and-positions
7927
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-query-assets-and-positions
7928
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-assets-and-positions
7929
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#query-assets-and-positions
7930
+ * @param {string} symbol unified market symbol of the market the position is held in, default is undefined
7931
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
7932
+ * @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
7933
+ */
7920
7934
  async fetchPosition(symbol, params = {}) {
7921
- /**
7922
- * @method
7923
- * @name htx#fetchPosition
7924
- * @description fetch data on a single open contract trade position
7925
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-query-assets-and-positions
7926
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-query-assets-and-positions
7927
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-assets-and-positions
7928
- * @see https://huobiapi.github.io/docs/dm/v1/en/#query-assets-and-positions
7929
- * @param {string} symbol unified market symbol of the market the position is held in, default is undefined
7930
- * @param {object} [params] extra parameters specific to the exchange API endpoint
7931
- * @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
7932
- */
7933
7935
  await this.loadMarkets();
7934
7936
  const market = this.market(symbol);
7935
7937
  let marginMode = undefined;
@@ -8242,20 +8244,20 @@ export default class htx extends Exchange {
8242
8244
  'fee': undefined,
8243
8245
  }, currency);
8244
8246
  }
8247
+ /**
8248
+ * @method
8249
+ * @name htx#fetchLedger
8250
+ * @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
8251
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#get-account-history
8252
+ * @param {string} [code] unified currency code, default is undefined
8253
+ * @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
8254
+ * @param {int} [limit] max number of ledger entries to return, default is undefined
8255
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
8256
+ * @param {int} [params.until] the latest time in ms to fetch entries for
8257
+ * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
8258
+ * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
8259
+ */
8245
8260
  async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
8246
- /**
8247
- * @method
8248
- * @name htx#fetchLedger
8249
- * @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
8250
- * @see https://huobiapi.github.io/docs/spot/v1/en/#get-account-history
8251
- * @param {string} [code] unified currency code, default is undefined
8252
- * @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
8253
- * @param {int} [limit] max number of ledger entries to return, default is undefined
8254
- * @param {object} [params] extra parameters specific to the exchange API endpoint
8255
- * @param {int} [params.until] the latest time in ms to fetch entries for
8256
- * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
8257
- * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
8258
- */
8259
8261
  await this.loadMarkets();
8260
8262
  let paginate = false;
8261
8263
  [paginate, params] = this.handleOptionAndParams(params, 'fetchLedger', 'paginate');
@@ -8321,15 +8323,15 @@ export default class htx extends Exchange {
8321
8323
  const data = this.safeValue(response, 'data', []);
8322
8324
  return this.parseLedger(data, currency, since, limit);
8323
8325
  }
8326
+ /**
8327
+ * @method
8328
+ * @name htx#fetchLeverageTiers
8329
+ * @description retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
8330
+ * @param {string[]|undefined} symbols list of unified market symbols
8331
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
8332
+ * @returns {object} a dictionary of [leverage tiers structures]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}, indexed by market symbols
8333
+ */
8324
8334
  async fetchLeverageTiers(symbols = undefined, params = {}) {
8325
- /**
8326
- * @method
8327
- * @name htx#fetchLeverageTiers
8328
- * @description retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
8329
- * @param {string[]|undefined} symbols list of unified market symbols
8330
- * @param {object} [params] extra parameters specific to the exchange API endpoint
8331
- * @returns {object} a dictionary of [leverage tiers structures]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}, indexed by market symbols
8332
- */
8333
8335
  await this.loadMarkets();
8334
8336
  const response = await this.contractPublicGetLinearSwapApiV1SwapAdjustfactor(params);
8335
8337
  //
@@ -8361,111 +8363,52 @@ export default class htx extends Exchange {
8361
8363
  // ]
8362
8364
  // }
8363
8365
  //
8364
- const data = this.safeList(response, 'data');
8366
+ const data = this.safeList(response, 'data', []);
8365
8367
  return this.parseLeverageTiers(data, symbols, 'contract_code');
8366
8368
  }
8367
- async fetchMarketLeverageTiers(symbol, params = {}) {
8368
- /**
8369
- * @method
8370
- * @name htx#fetchMarketLeverageTiers
8371
- * @description retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes for a single market
8372
- * @param {string} symbol unified market symbol
8373
- * @param {object} [params] extra parameters specific to the exchange API endpoint
8374
- * @returns {object} a [leverage tiers structure]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}
8375
- */
8376
- await this.loadMarkets();
8377
- const request = {};
8378
- if (symbol !== undefined) {
8379
- const market = this.market(symbol);
8380
- if (!market['contract']) {
8381
- throw new BadRequest(this.id + ' fetchMarketLeverageTiers() symbol supports contract markets only');
8382
- }
8383
- request['contract_code'] = market['id'];
8384
- }
8385
- const response = await this.contractPublicGetLinearSwapApiV1SwapAdjustfactor(this.extend(request, params));
8386
- //
8387
- // {
8388
- // "status": "ok",
8389
- // "data": [
8390
- // {
8391
- // "symbol": "MANA",
8392
- // "contract_code": "MANA-USDT",
8393
- // "margin_mode": "isolated",
8394
- // "trade_partition": "USDT",
8395
- // "list": [
8396
- // {
8397
- // "lever_rate": 75,
8398
- // "ladders": [
8399
- // {
8400
- // "ladder": 0,
8401
- // "min_size": 0,
8402
- // "max_size": 999,
8403
- // "adjust_factor": 0.7
8404
- // },
8405
- // ...
8406
- // ]
8407
- // }
8408
- // ...
8409
- // ]
8410
- // },
8411
- // ...
8412
- // ]
8413
- // }
8414
- //
8415
- const data = this.safeValue(response, 'data');
8416
- const tiers = this.parseLeverageTiers(data, [symbol], 'contract_code');
8417
- return this.safeValue(tiers, symbol);
8418
- }
8419
- parseLeverageTiers(response, symbols = undefined, marketIdKey = undefined) {
8420
- const result = {};
8421
- for (let i = 0; i < response.length; i++) {
8422
- const item = response[i];
8423
- const list = this.safeValue(item, 'list', []);
8424
- const tiers = [];
8425
- const currency = this.safeString(item, 'trade_partition');
8426
- const id = this.safeString(item, marketIdKey);
8427
- const symbol = this.safeSymbol(id);
8428
- if (this.inArray(symbol, symbols)) {
8429
- for (let j = 0; j < list.length; j++) {
8430
- const obj = list[j];
8431
- const leverage = this.safeString(obj, 'lever_rate');
8432
- const ladders = this.safeValue(obj, 'ladders', []);
8433
- for (let k = 0; k < ladders.length; k++) {
8434
- const bracket = ladders[k];
8435
- const adjustFactor = this.safeString(bracket, 'adjust_factor');
8436
- tiers.push({
8437
- 'tier': this.safeInteger(bracket, 'ladder'),
8438
- 'currency': this.safeCurrencyCode(currency),
8439
- 'minNotional': this.safeNumber(bracket, 'min_size'),
8440
- 'maxNotional': this.safeNumber(bracket, 'max_size'),
8441
- 'maintenanceMarginRate': this.parseNumber(Precise.stringDiv(adjustFactor, leverage)),
8442
- 'maxLeverage': this.parseNumber(leverage),
8443
- 'info': bracket,
8444
- });
8445
- }
8446
- }
8447
- result[symbol] = tiers;
8448
- }
8449
- }
8450
- return result;
8369
+ parseMarketLeverageTiers(info, market = undefined) {
8370
+ const currencyId = this.safeString(info, 'trade_partition');
8371
+ const marketId = this.safeString(info, 'contract_code');
8372
+ const tiers = [];
8373
+ const brackets = this.safeList(info, 'list', []);
8374
+ for (let i = 0; i < brackets.length; i++) {
8375
+ const item = brackets[i];
8376
+ const leverage = this.safeString(item, 'lever_rate');
8377
+ const ladders = this.safeList(item, 'ladders', []);
8378
+ for (let k = 0; k < ladders.length; k++) {
8379
+ const bracket = ladders[k];
8380
+ const adjustFactor = this.safeString(bracket, 'adjust_factor');
8381
+ tiers.push({
8382
+ 'tier': this.safeInteger(bracket, 'ladder'),
8383
+ 'symbol': this.safeSymbol(marketId, market, undefined, 'swap'),
8384
+ 'currency': this.safeCurrencyCode(currencyId),
8385
+ 'minNotional': this.safeNumber(bracket, 'min_size'),
8386
+ 'maxNotional': this.safeNumber(bracket, 'max_size'),
8387
+ 'maintenanceMarginRate': this.parseNumber(Precise.stringDiv(adjustFactor, leverage)),
8388
+ 'maxLeverage': this.parseNumber(leverage),
8389
+ 'info': bracket,
8390
+ });
8391
+ }
8392
+ }
8393
+ return tiers;
8451
8394
  }
8395
+ /**
8396
+ * @method
8397
+ * @name htx#fetchOpenInterestHistory
8398
+ * @description Retrieves the open interest history of a currency
8399
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#query-information-on-open-interest
8400
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-information-on-open-interest
8401
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-information-on-open-interest
8402
+ * @param {string} symbol Unified CCXT market symbol
8403
+ * @param {string} timeframe '1h', '4h', '12h', or '1d'
8404
+ * @param {int} [since] Not used by huobi api, but response parsed by CCXT
8405
+ * @param {int} [limit] Default:48,Data Range [1,200]
8406
+ * @param {object} [params] Exchange specific parameters
8407
+ * @param {int} [params.amount_type] *required* Open interest unit. 1-cont,2-cryptocurrency
8408
+ * @param {int} [params.pair] eg BTC-USDT *Only for USDT-M*
8409
+ * @returns {object} an array of [open interest structures]{@link https://docs.ccxt.com/#/?id=open-interest-structure}
8410
+ */
8452
8411
  async fetchOpenInterestHistory(symbol, timeframe = '1h', since = undefined, limit = undefined, params = {}) {
8453
- /**
8454
- * @method
8455
- * @name htx#fetchOpenInterestHistory
8456
- * @description Retrieves the open interest history of a currency
8457
- * @see https://huobiapi.github.io/docs/dm/v1/en/#query-information-on-open-interest
8458
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-information-on-open-interest
8459
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-information-on-open-interest
8460
- * @param {string} symbol Unified CCXT market symbol
8461
- * @param {string} timeframe '1h', '4h', '12h', or '1d'
8462
- * @param {int} [since] Not used by huobi api, but response parsed by CCXT
8463
- * @param {int} [limit] Default:48,Data Range [1,200]
8464
- * @param {object} [params] Exchange specific parameters
8465
- * @param {int} [params.amount_type] *required* Open interest unit. 1-cont,2-cryptocurrency
8466
- * @param {int} [params.pair] eg BTC-USDT *Only for USDT-M*
8467
- * @returns {object} an array of [open interest structures]{@link https://docs.ccxt.com/#/?id=open-interest-structure}
8468
- */
8469
8412
  if (timeframe !== '1h' && timeframe !== '4h' && timeframe !== '12h' && timeframe !== '1d') {
8470
8413
  throw new BadRequest(this.id + ' fetchOpenInterestHistory cannot only use the 1h, 4h, 12h and 1d timeframe');
8471
8414
  }
@@ -8568,18 +8511,18 @@ export default class htx extends Exchange {
8568
8511
  const tick = this.safeList(data, 'tick');
8569
8512
  return this.parseOpenInterests(tick, market, since, limit);
8570
8513
  }
8514
+ /**
8515
+ * @method
8516
+ * @name htx#fetchOpenInterest
8517
+ * @description Retrieves the open interest of a currency
8518
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#get-contract-open-interest-information
8519
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-swap-open-interest-information
8520
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-get-swap-open-interest-information
8521
+ * @param {string} symbol Unified CCXT market symbol
8522
+ * @param {object} [params] exchange specific parameters
8523
+ * @returns {object} an open interest structure{@link https://docs.ccxt.com/#/?id=open-interest-structure}
8524
+ */
8571
8525
  async fetchOpenInterest(symbol, params = {}) {
8572
- /**
8573
- * @method
8574
- * @name htx#fetchOpenInterest
8575
- * @description Retrieves the open interest of a currency
8576
- * @see https://huobiapi.github.io/docs/dm/v1/en/#get-contract-open-interest-information
8577
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-swap-open-interest-information
8578
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-get-swap-open-interest-information
8579
- * @param {string} symbol Unified CCXT market symbol
8580
- * @param {object} [params] exchange specific parameters
8581
- * @returns {object} an open interest structure{@link https://docs.ccxt.com/#/?id=open-interest-structure}
8582
- */
8583
8526
  await this.loadMarkets();
8584
8527
  const market = this.market(symbol);
8585
8528
  if (!market['contract']) {
@@ -8742,19 +8685,19 @@ export default class htx extends Exchange {
8742
8685
  'info': interest,
8743
8686
  }, market);
8744
8687
  }
8688
+ /**
8689
+ * @method
8690
+ * @name htx#borrowIsolatedMargin
8691
+ * @description create a loan to borrow margin
8692
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#request-a-margin-loan-isolated
8693
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#request-a-margin-loan-cross
8694
+ * @param {string} symbol unified market symbol, required for isolated margin
8695
+ * @param {string} code unified currency code of the currency to borrow
8696
+ * @param {float} amount the amount to borrow
8697
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
8698
+ * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
8699
+ */
8745
8700
  async borrowIsolatedMargin(symbol, code, amount, params = {}) {
8746
- /**
8747
- * @method
8748
- * @name htx#borrowIsolatedMargin
8749
- * @description create a loan to borrow margin
8750
- * @see https://huobiapi.github.io/docs/spot/v1/en/#request-a-margin-loan-isolated
8751
- * @see https://huobiapi.github.io/docs/spot/v1/en/#request-a-margin-loan-cross
8752
- * @param {string} symbol unified market symbol, required for isolated margin
8753
- * @param {string} code unified currency code of the currency to borrow
8754
- * @param {float} amount the amount to borrow
8755
- * @param {object} [params] extra parameters specific to the exchange API endpoint
8756
- * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
8757
- */
8758
8701
  await this.loadMarkets();
8759
8702
  const currency = this.currency(code);
8760
8703
  const market = this.market(symbol);
@@ -8777,18 +8720,18 @@ export default class htx extends Exchange {
8777
8720
  'symbol': symbol,
8778
8721
  });
8779
8722
  }
8723
+ /**
8724
+ * @method
8725
+ * @name htx#borrowCrossMargin
8726
+ * @description create a loan to borrow margin
8727
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#request-a-margin-loan-isolated
8728
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#request-a-margin-loan-cross
8729
+ * @param {string} code unified currency code of the currency to borrow
8730
+ * @param {float} amount the amount to borrow
8731
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
8732
+ * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
8733
+ */
8780
8734
  async borrowCrossMargin(code, amount, params = {}) {
8781
- /**
8782
- * @method
8783
- * @name htx#borrowCrossMargin
8784
- * @description create a loan to borrow margin
8785
- * @see https://huobiapi.github.io/docs/spot/v1/en/#request-a-margin-loan-isolated
8786
- * @see https://huobiapi.github.io/docs/spot/v1/en/#request-a-margin-loan-cross
8787
- * @param {string} code unified currency code of the currency to borrow
8788
- * @param {float} amount the amount to borrow
8789
- * @param {object} [params] extra parameters specific to the exchange API endpoint
8790
- * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
8791
- */
8792
8735
  await this.loadMarkets();
8793
8736
  const currency = this.currency(code);
8794
8737
  const request = {
@@ -8809,18 +8752,18 @@ export default class htx extends Exchange {
8809
8752
  'amount': amount,
8810
8753
  });
8811
8754
  }
8755
+ /**
8756
+ * @method
8757
+ * @name htx#repayIsolatedMargin
8758
+ * @description repay borrowed margin and interest
8759
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#repay-margin-loan-cross-isolated
8760
+ * @param {string} symbol unified market symbol
8761
+ * @param {string} code unified currency code of the currency to repay
8762
+ * @param {float} amount the amount to repay
8763
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
8764
+ * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
8765
+ */
8812
8766
  async repayIsolatedMargin(symbol, code, amount, params = {}) {
8813
- /**
8814
- * @method
8815
- * @name htx#repayIsolatedMargin
8816
- * @description repay borrowed margin and interest
8817
- * @see https://huobiapi.github.io/docs/spot/v1/en/#repay-margin-loan-cross-isolated
8818
- * @param {string} code unified currency code of the currency to repay
8819
- * @param {float} amount the amount to repay
8820
- * @param {string} symbol unified market symbol
8821
- * @param {object} [params] extra parameters specific to the exchange API endpoint
8822
- * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
8823
- */
8824
8767
  await this.loadMarkets();
8825
8768
  const currency = this.currency(code);
8826
8769
  const accountId = await this.fetchAccountIdByType('spot', 'isolated', symbol, params);
@@ -8849,17 +8792,17 @@ export default class htx extends Exchange {
8849
8792
  'symbol': symbol,
8850
8793
  });
8851
8794
  }
8795
+ /**
8796
+ * @method
8797
+ * @name htx#repayCrossMargin
8798
+ * @description repay borrowed margin and interest
8799
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#repay-margin-loan-cross-isolated
8800
+ * @param {string} code unified currency code of the currency to repay
8801
+ * @param {float} amount the amount to repay
8802
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
8803
+ * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
8804
+ */
8852
8805
  async repayCrossMargin(code, amount, params = {}) {
8853
- /**
8854
- * @method
8855
- * @name htx#repayCrossMargin
8856
- * @description repay borrowed margin and interest
8857
- * @see https://huobiapi.github.io/docs/spot/v1/en/#repay-margin-loan-cross-isolated
8858
- * @param {string} code unified currency code of the currency to repay
8859
- * @param {float} amount the amount to repay
8860
- * @param {object} [params] extra parameters specific to the exchange API endpoint
8861
- * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
8862
- */
8863
8806
  await this.loadMarkets();
8864
8807
  const currency = this.currency(code);
8865
8808
  const accountId = await this.fetchAccountIdByType('spot', 'cross', undefined, params);
@@ -8920,23 +8863,23 @@ export default class htx extends Exchange {
8920
8863
  'info': info,
8921
8864
  };
8922
8865
  }
8866
+ /**
8867
+ * @method
8868
+ * @name htx#fetchSettlementHistory
8869
+ * @description Fetches historical settlement records
8870
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#query-historical-settlement-records-of-the-platform-interface
8871
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-historical-settlement-records-of-the-platform-interface
8872
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-historical-settlement-records-of-the-platform-interface
8873
+ * @param {string} symbol unified symbol of the market to fetch the settlement history for
8874
+ * @param {int} [since] timestamp in ms, value range = current time - 90 days,default = current time - 90 days
8875
+ * @param {int} [limit] page items, default 20, shall not exceed 50
8876
+ * @param {object} [params] exchange specific params
8877
+ * @param {int} [params.until] timestamp in ms, value range = start_time -> current time,default = current time
8878
+ * @param {int} [params.page_index] page index, default page 1 if not filled
8879
+ * @param {int} [params.code] unified currency code, can be used when symbol is undefined
8880
+ * @returns {object[]} a list of [settlement history objects]{@link https://docs.ccxt.com/#/?id=settlement-history-structure}
8881
+ */
8923
8882
  async fetchSettlementHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
8924
- /**
8925
- * @method
8926
- * @name htx#fetchSettlementHistory
8927
- * @description Fetches historical settlement records
8928
- * @see https://huobiapi.github.io/docs/dm/v1/en/#query-historical-settlement-records-of-the-platform-interface
8929
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-historical-settlement-records-of-the-platform-interface
8930
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-historical-settlement-records-of-the-platform-interface
8931
- * @param {string} symbol unified symbol of the market to fetch the settlement history for
8932
- * @param {int} [since] timestamp in ms, value range = current time - 90 days,default = current time - 90 days
8933
- * @param {int} [limit] page items, default 20, shall not exceed 50
8934
- * @param {object} [params] exchange specific params
8935
- * @param {int} [params.until] timestamp in ms, value range = start_time -> current time,default = current time
8936
- * @param {int} [params.page_index] page index, default page 1 if not filled
8937
- * @param {int} [params.code] unified currency code, can be used when symbol is undefined
8938
- * @returns {object[]} a list of [settlement history objects]{@link https://docs.ccxt.com/#/?id=settlement-history-structure}
8939
- */
8940
8883
  if (symbol === undefined) {
8941
8884
  throw new ArgumentsRequired(this.id + ' fetchSettlementHistory() requires a symbol argument');
8942
8885
  }
@@ -9028,16 +8971,16 @@ export default class htx extends Exchange {
9028
8971
  const settlements = this.parseSettlements(settlementRecord, market);
9029
8972
  return this.sortBy(settlements, 'timestamp');
9030
8973
  }
8974
+ /**
8975
+ * @method
8976
+ * @name htx#fetchDepositWithdrawFees
8977
+ * @description fetch deposit and withdraw fees
8978
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#get-all-supported-currencies-v2
8979
+ * @param {string[]|undefined} codes list of unified currency codes
8980
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
8981
+ * @returns {object[]} a list of [fees structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
8982
+ */
9031
8983
  async fetchDepositWithdrawFees(codes = undefined, params = {}) {
9032
- /**
9033
- * @method
9034
- * @name htx#fetchDepositWithdrawFees
9035
- * @description fetch deposit and withdraw fees
9036
- * @see https://huobiapi.github.io/docs/spot/v1/en/#get-all-supported-currencies-v2
9037
- * @param {string[]|undefined} codes list of unified currency codes
9038
- * @param {object} [params] extra parameters specific to the exchange API endpoint
9039
- * @returns {object[]} a list of [fees structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
9040
- */
9041
8984
  await this.loadMarkets();
9042
8985
  const response = await this.spotPublicGetV2ReferenceCurrencies(params);
9043
8986
  //
@@ -9238,22 +9181,22 @@ export default class htx extends Exchange {
9238
9181
  'datetime': this.iso8601(timestamp),
9239
9182
  };
9240
9183
  }
9184
+ /**
9185
+ * @method
9186
+ * @name htx#fetchLiquidations
9187
+ * @description retrieves the public liquidations of a trading pair
9188
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-liquidation-orders-new
9189
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-liquidation-orders-new
9190
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#query-liquidation-order-information-new
9191
+ * @param {string} symbol unified CCXT market symbol
9192
+ * @param {int} [since] the earliest time in ms to fetch liquidations for
9193
+ * @param {int} [limit] the maximum number of liquidation structures to retrieve
9194
+ * @param {object} [params] exchange specific parameters for the huobi api endpoint
9195
+ * @param {int} [params.until] timestamp in ms of the latest liquidation
9196
+ * @param {int} [params.tradeType] default 0, linear swap 0: all liquidated orders, 5: liquidated longs; 6: liquidated shorts, inverse swap and future 0: filled liquidated orders, 5: liquidated close orders, 6: liquidated open orders
9197
+ * @returns {object} an array of [liquidation structures]{@link https://docs.ccxt.com/#/?id=liquidation-structure}
9198
+ */
9241
9199
  async fetchLiquidations(symbol, since = undefined, limit = undefined, params = {}) {
9242
- /**
9243
- * @method
9244
- * @name htx#fetchLiquidations
9245
- * @description retrieves the public liquidations of a trading pair
9246
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-liquidation-orders-new
9247
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-liquidation-orders-new
9248
- * @see https://huobiapi.github.io/docs/dm/v1/en/#query-liquidation-order-information-new
9249
- * @param {string} symbol unified CCXT market symbol
9250
- * @param {int} [since] the earliest time in ms to fetch liquidations for
9251
- * @param {int} [limit] the maximum number of liquidation structures to retrieve
9252
- * @param {object} [params] exchange specific parameters for the huobi api endpoint
9253
- * @param {int} [params.until] timestamp in ms of the latest liquidation
9254
- * @param {int} [params.tradeType] default 0, linear swap 0: all liquidated orders, 5: liquidated longs; 6: liquidated shorts, inverse swap and future 0: filled liquidated orders, 5: liquidated close orders, 6: liquidated open orders
9255
- * @returns {object} an array of [liquidation structures]{@link https://docs.ccxt.com/#/?id=liquidation-structure}
9256
- */
9257
9200
  await this.loadMarkets();
9258
9201
  const market = this.market(symbol);
9259
9202
  const tradeType = this.safeInteger(params, 'trade_type', 0);
@@ -9338,26 +9281,26 @@ export default class htx extends Exchange {
9338
9281
  'datetime': this.iso8601(timestamp),
9339
9282
  });
9340
9283
  }
9284
+ /**
9285
+ * @method
9286
+ * @name htx#closePositions
9287
+ * @description closes open positions for a contract market, requires 'amount' in params, unlike other exchanges
9288
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-place-lightning-close-order // USDT-M (isolated)
9289
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-place-lightning-close-position // USDT-M (cross)
9290
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#place-lightning-close-order // Coin-M swap
9291
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#place-flash-close-order // Coin-M futures
9292
+ * @param {string} symbol unified CCXT market symbol
9293
+ * @param {string} side 'buy' or 'sell', the side of the closing order, opposite side as position side
9294
+ * @param {object} [params] extra parameters specific to the okx api endpoint
9295
+ * @param {string} [params.clientOrderId] client needs to provide unique API and have to maintain the API themselves afterwards. [1, 9223372036854775807]
9296
+ * @param {object} [params.marginMode] 'cross' or 'isolated', required for linear markets
9297
+ *
9298
+ * EXCHANGE SPECIFIC PARAMETERS
9299
+ * @param {number} [params.amount] order quantity
9300
+ * @param {string} [params.order_price_type] 'lightning' by default, 'lightning_fok': lightning fok type, 'lightning_ioc': lightning ioc type 'market' by default, 'market': market order type, 'lightning_fok': lightning
9301
+ * @returns {object} [an order structure]{@link https://docs.ccxt.com/#/?id=position-structure}
9302
+ */
9341
9303
  async closePosition(symbol, side = undefined, params = {}) {
9342
- /**
9343
- * @method
9344
- * @name htx#closePositions
9345
- * @description closes open positions for a contract market, requires 'amount' in params, unlike other exchanges
9346
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-place-lightning-close-order // USDT-M (isolated)
9347
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-place-lightning-close-position // USDT-M (cross)
9348
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#place-lightning-close-order // Coin-M swap
9349
- * @see https://huobiapi.github.io/docs/dm/v1/en/#place-flash-close-order // Coin-M futures
9350
- * @param {string} symbol unified CCXT market symbol
9351
- * @param {string} side 'buy' or 'sell', the side of the closing order, opposite side as position side
9352
- * @param {object} [params] extra parameters specific to the okx api endpoint
9353
- * @param {string} [params.clientOrderId] client needs to provide unique API and have to maintain the API themselves afterwards. [1, 9223372036854775807]
9354
- * @param {object} [params.marginMode] 'cross' or 'isolated', required for linear markets
9355
- *
9356
- * EXCHANGE SPECIFIC PARAMETERS
9357
- * @param {number} [params.amount] order quantity
9358
- * @param {string} [params.order_price_type] 'lightning' by default, 'lightning_fok': lightning fok type, 'lightning_ioc': lightning ioc type 'market' by default, 'market': market order type, 'lightning_fok': lightning
9359
- * @returns {object} [an order structure]{@link https://docs.ccxt.com/#/?id=position-structure}
9360
- */
9361
9304
  await this.loadMarkets();
9362
9305
  const market = this.market(symbol);
9363
9306
  const clientOrderId = this.safeString(params, 'clientOrderId');
@@ -9401,19 +9344,19 @@ export default class htx extends Exchange {
9401
9344
  }
9402
9345
  return this.parseOrder(response, market);
9403
9346
  }
9347
+ /**
9348
+ * @method
9349
+ * @name htx#setPositionMode
9350
+ * @description set hedged to true or false
9351
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-switch-position-mode
9352
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-switch-position-mode
9353
+ * @param {bool} hedged set to true to for hedged mode, must be set separately for each market in isolated margin mode, only valid for linear markets
9354
+ * @param {string} [symbol] unified market symbol, required for isolated margin mode
9355
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
9356
+ * @param {string} [params.marginMode] "cross" (default) or "isolated"
9357
+ * @returns {object} response from the exchange
9358
+ */
9404
9359
  async setPositionMode(hedged, symbol = undefined, params = {}) {
9405
- /**
9406
- * @method
9407
- * @name htx#setPositionMode
9408
- * @description set hedged to true or false
9409
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-switch-position-mode
9410
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-switch-position-mode
9411
- * @param {bool} hedged set to true to for hedged mode, must be set separately for each market in isolated margin mode, only valid for linear markets
9412
- * @param {string} [symbol] unified market symbol, required for isolated margin mode
9413
- * @param {object} [params] extra parameters specific to the exchange API endpoint
9414
- * @param {string} [params.marginMode] "cross" (default) or "isolated"
9415
- * @returns {object} response from the exchange
9416
- */
9417
9360
  await this.loadMarkets();
9418
9361
  const posMode = hedged ? 'dual_side' : 'single_side';
9419
9362
  let market = undefined;