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
@@ -88,7 +88,7 @@ class htx extends htx$1 {
88
88
  'fetchLeverageTiers': true,
89
89
  'fetchLiquidations': true,
90
90
  'fetchMarginAdjustmentHistory': false,
91
- 'fetchMarketLeverageTiers': true,
91
+ 'fetchMarketLeverageTiers': 'emulated',
92
92
  'fetchMarkets': true,
93
93
  'fetchMarkOHLCV': true,
94
94
  'fetchMyLiquidations': false,
@@ -1234,19 +1234,19 @@ class htx extends htx$1 {
1234
1234
  },
1235
1235
  });
1236
1236
  }
1237
+ /**
1238
+ * @method
1239
+ * @name htx#fetchStatus
1240
+ * @description the latest known information on the availability of the exchange API
1241
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#get-system-status
1242
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#get-system-status
1243
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-system-status
1244
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#get-system-status
1245
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#query-whether-the-system-is-available // contractPublicGetHeartbeat
1246
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1247
+ * @returns {object} a [status structure]{@link https://docs.ccxt.com/#/?id=exchange-status-structure}
1248
+ */
1237
1249
  async fetchStatus(params = {}) {
1238
- /**
1239
- * @method
1240
- * @name htx#fetchStatus
1241
- * @description the latest known information on the availability of the exchange API
1242
- * @see https://huobiapi.github.io/docs/spot/v1/en/#get-system-status
1243
- * @see https://huobiapi.github.io/docs/dm/v1/en/#get-system-status
1244
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-system-status
1245
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#get-system-status
1246
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#query-whether-the-system-is-available // contractPublicGetHeartbeat
1247
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1248
- * @returns {object} a [status structure]{@link https://docs.ccxt.com/#/?id=exchange-status-structure}
1249
- */
1250
1250
  await this.loadMarkets();
1251
1251
  let marketType = undefined;
1252
1252
  [marketType, params] = this.handleMarketTypeAndParams('fetchStatus', undefined, params);
@@ -1468,16 +1468,16 @@ class htx extends htx$1 {
1468
1468
  'info': response,
1469
1469
  };
1470
1470
  }
1471
+ /**
1472
+ * @method
1473
+ * @name htx#fetchTime
1474
+ * @description fetches the current integer timestamp in milliseconds from the exchange server
1475
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#get-current-timestamp
1476
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-current-system-timestamp
1477
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1478
+ * @returns {int} the current integer timestamp in milliseconds from the exchange server
1479
+ */
1471
1480
  async fetchTime(params = {}) {
1472
- /**
1473
- * @method
1474
- * @name htx#fetchTime
1475
- * @description fetches the current integer timestamp in milliseconds from the exchange server
1476
- * @see https://huobiapi.github.io/docs/spot/v1/en/#get-current-timestamp
1477
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-current-system-timestamp
1478
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1479
- * @returns {int} the current integer timestamp in milliseconds from the exchange server
1480
- */
1481
1481
  const options = this.safeValue(this.options, 'fetchTime', {});
1482
1482
  const defaultType = this.safeString(this.options, 'defaultType', 'spot');
1483
1483
  let type = this.safeString(options, 'type', defaultType);
@@ -1520,16 +1520,16 @@ class htx extends htx$1 {
1520
1520
  'tierBased': undefined,
1521
1521
  };
1522
1522
  }
1523
+ /**
1524
+ * @method
1525
+ * @name htx#fetchTradingFee
1526
+ * @description fetch the trading fees for a market
1527
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#get-current-fee-rate-applied-to-the-user
1528
+ * @param {string} symbol unified market symbol
1529
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1530
+ * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
1531
+ */
1523
1532
  async fetchTradingFee(symbol, params = {}) {
1524
- /**
1525
- * @method
1526
- * @name htx#fetchTradingFee
1527
- * @description fetch the trading fees for a market
1528
- * @see https://huobiapi.github.io/docs/spot/v1/en/#get-current-fee-rate-applied-to-the-user
1529
- * @param {string} symbol unified market symbol
1530
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1531
- * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
1532
- */
1533
1533
  await this.loadMarkets();
1534
1534
  const market = this.market(symbol);
1535
1535
  const request = {
@@ -1570,16 +1570,16 @@ class htx extends htx$1 {
1570
1570
  }
1571
1571
  return result;
1572
1572
  }
1573
+ /**
1574
+ * @ignore
1575
+ * @method
1576
+ * @name htx#fetchTradingLimitsById
1577
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#get-current-fee-rate-applied-to-the-user
1578
+ * @param {string} id market id
1579
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1580
+ * @returns {object} the limits object of a market structure
1581
+ */
1573
1582
  async fetchTradingLimitsById(id, params = {}) {
1574
- /**
1575
- * @ignore
1576
- * @method
1577
- * @name htx#fetchTradingLimitsById
1578
- * @see https://huobiapi.github.io/docs/spot/v1/en/#get-current-fee-rate-applied-to-the-user
1579
- * @param {string} id market id
1580
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1581
- * @returns {object} the limits object of a market structure
1582
- */
1583
1583
  const request = {
1584
1584
  'symbol': id,
1585
1585
  };
@@ -1631,18 +1631,18 @@ class htx extends htx$1 {
1631
1631
  costToPrecision(symbol, cost) {
1632
1632
  return this.decimalToPrecision(cost, number.TRUNCATE, this.markets[symbol]['precision']['cost'], this.precisionMode);
1633
1633
  }
1634
+ /**
1635
+ * @method
1636
+ * @name htx#fetchMarkets
1637
+ * @description retrieves data on all markets for huobi
1638
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#get-all-supported-trading-symbol-v1-deprecated
1639
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#get-contract-info
1640
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-swap-info
1641
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-swap-info
1642
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1643
+ * @returns {object[]} an array of objects representing market data
1644
+ */
1634
1645
  async fetchMarkets(params = {}) {
1635
- /**
1636
- * @method
1637
- * @name htx#fetchMarkets
1638
- * @description retrieves data on all markets for huobi
1639
- * @see https://huobiapi.github.io/docs/spot/v1/en/#get-all-supported-trading-symbol-v1-deprecated
1640
- * @see https://huobiapi.github.io/docs/dm/v1/en/#get-contract-info
1641
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-swap-info
1642
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-swap-info
1643
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1644
- * @returns {object[]} an array of objects representing market data
1645
- */
1646
1646
  let types = undefined;
1647
1647
  [types, params] = this.handleOptionAndParams(params, 'fetchMarkets', 'types', {});
1648
1648
  let allMarkets = [];
@@ -1669,21 +1669,21 @@ class htx extends htx$1 {
1669
1669
  }
1670
1670
  return allMarkets;
1671
1671
  }
1672
+ /**
1673
+ * @ignore
1674
+ * @method
1675
+ * @name htx#fetchMarketsByTypeAndSubType
1676
+ * @description retrieves data on all markets of a certain type and/or subtype
1677
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#get-all-supported-trading-symbol-v1-deprecated
1678
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#get-contract-info
1679
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-swap-info
1680
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-swap-info
1681
+ * @param {string} [type] 'spot', 'swap' or 'future'
1682
+ * @param {string} [subType] 'linear' or 'inverse'
1683
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1684
+ * @returns {object[]} an array of objects representing market data
1685
+ */
1672
1686
  async fetchMarketsByTypeAndSubType(type, subType, params = {}) {
1673
- /**
1674
- * @ignore
1675
- * @method
1676
- * @name htx#fetchMarketsByTypeAndSubType
1677
- * @description retrieves data on all markets of a certain type and/or subtype
1678
- * @see https://huobiapi.github.io/docs/spot/v1/en/#get-all-supported-trading-symbol-v1-deprecated
1679
- * @see https://huobiapi.github.io/docs/dm/v1/en/#get-contract-info
1680
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-swap-info
1681
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-swap-info
1682
- * @param {string} [type] 'spot', 'swap' or 'future'
1683
- * @param {string} [subType] 'linear' or 'inverse'
1684
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1685
- * @returns {object[]} an array of objects representing market data
1686
- */
1687
1687
  const isSpot = (type === 'spot');
1688
1688
  const request = {};
1689
1689
  let response = undefined;
@@ -2117,19 +2117,19 @@ class htx extends htx$1 {
2117
2117
  'info': ticker,
2118
2118
  }, market);
2119
2119
  }
2120
+ /**
2121
+ * @method
2122
+ * @name htx#fetchTicker
2123
+ * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
2124
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#get-latest-aggregated-ticker
2125
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#get-market-data-overview
2126
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-market-data-overview
2127
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-get-market-data-overview
2128
+ * @param {string} symbol unified symbol of the market to fetch the ticker for
2129
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2130
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
2131
+ */
2120
2132
  async fetchTicker(symbol, params = {}) {
2121
- /**
2122
- * @method
2123
- * @name htx#fetchTicker
2124
- * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
2125
- * @see https://huobiapi.github.io/docs/spot/v1/en/#get-latest-aggregated-ticker
2126
- * @see https://huobiapi.github.io/docs/dm/v1/en/#get-market-data-overview
2127
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-market-data-overview
2128
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-get-market-data-overview
2129
- * @param {string} symbol unified symbol of the market to fetch the ticker for
2130
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2131
- * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
2132
- */
2133
2133
  await this.loadMarkets();
2134
2134
  const market = this.market(symbol);
2135
2135
  const request = {};
@@ -2202,19 +2202,19 @@ class htx extends htx$1 {
2202
2202
  ticker['datetime'] = this.iso8601(timestamp);
2203
2203
  return ticker;
2204
2204
  }
2205
+ /**
2206
+ * @method
2207
+ * @name htx#fetchTickers
2208
+ * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
2209
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#get-latest-tickers-for-all-pairs
2210
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-get-a-batch-of-market-data-overview
2211
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#get-a-batch-of-market-data-overview
2212
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-a-batch-of-market-data-overview-v2
2213
+ * @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
2214
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2215
+ * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
2216
+ */
2205
2217
  async fetchTickers(symbols = undefined, params = {}) {
2206
- /**
2207
- * @method
2208
- * @name htx#fetchTickers
2209
- * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
2210
- * @see https://huobiapi.github.io/docs/spot/v1/en/#get-latest-tickers-for-all-pairs
2211
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-get-a-batch-of-market-data-overview
2212
- * @see https://huobiapi.github.io/docs/dm/v1/en/#get-a-batch-of-market-data-overview
2213
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-a-batch-of-market-data-overview-v2
2214
- * @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
2215
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2216
- * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
2217
- */
2218
2218
  await this.loadMarkets();
2219
2219
  symbols = this.marketSymbols(symbols);
2220
2220
  const first = this.safeString(symbols, 0);
@@ -2320,18 +2320,18 @@ class htx extends htx$1 {
2320
2320
  const tickers = this.parseTickers(rawTickers, symbols, params);
2321
2321
  return this.filterByArrayTickers(tickers, 'symbol', symbols);
2322
2322
  }
2323
+ /**
2324
+ * @method
2325
+ * @name htx#fetchLastPrices
2326
+ * @description fetches the last price for multiple markets
2327
+ * @see https://www.htx.com/en-us/opend/newApiPages/?id=8cb81024-77b5-11ed-9966-0242ac110003 linear swap & linear future
2328
+ * @see https://www.htx.com/en-us/opend/newApiPages/?id=28c2e8fc-77ae-11ed-9966-0242ac110003 inverse future
2329
+ * @see https://www.htx.com/en-us/opend/newApiPages/?id=5d517ef5-77b6-11ed-9966-0242ac110003 inverse swap
2330
+ * @param {string[]} [symbols] unified symbols of the markets to fetch the last prices
2331
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2332
+ * @returns {object} a dictionary of lastprices structures
2333
+ */
2323
2334
  async fetchLastPrices(symbols = undefined, params = {}) {
2324
- /**
2325
- * @method
2326
- * @name htx#fetchLastPrices
2327
- * @description fetches the last price for multiple markets
2328
- * @see https://www.htx.com/en-us/opend/newApiPages/?id=8cb81024-77b5-11ed-9966-0242ac110003 linear swap & linear future
2329
- * @see https://www.htx.com/en-us/opend/newApiPages/?id=28c2e8fc-77ae-11ed-9966-0242ac110003 inverse future
2330
- * @see https://www.htx.com/en-us/opend/newApiPages/?id=5d517ef5-77b6-11ed-9966-0242ac110003 inverse swap
2331
- * @param {string[]} [symbols] unified symbols of the markets to fetch the last prices
2332
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2333
- * @returns {object} a dictionary of lastprices structures
2334
- */
2335
2335
  await this.loadMarkets();
2336
2336
  symbols = this.marketSymbols(symbols);
2337
2337
  const market = this.getMarketFromSymbols(symbols);
@@ -2441,20 +2441,20 @@ class htx extends htx$1 {
2441
2441
  'info': entry,
2442
2442
  };
2443
2443
  }
2444
+ /**
2445
+ * @method
2446
+ * @name htx#fetchOrderBook
2447
+ * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
2448
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#get-market-depth
2449
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#get-market-depth
2450
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-market-depth
2451
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-get-market-depth
2452
+ * @param {string} symbol unified symbol of the market to fetch the order book for
2453
+ * @param {int} [limit] the maximum amount of order book entries to return
2454
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2455
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
2456
+ */
2444
2457
  async fetchOrderBook(symbol, limit = undefined, params = {}) {
2445
- /**
2446
- * @method
2447
- * @name htx#fetchOrderBook
2448
- * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
2449
- * @see https://huobiapi.github.io/docs/spot/v1/en/#get-market-depth
2450
- * @see https://huobiapi.github.io/docs/dm/v1/en/#get-market-depth
2451
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-market-depth
2452
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-get-market-depth
2453
- * @param {string} symbol unified symbol of the market to fetch the order book for
2454
- * @param {int} [limit] the maximum amount of order book entries to return
2455
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2456
- * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
2457
- */
2458
2458
  await this.loadMarkets();
2459
2459
  const market = this.market(symbol);
2460
2460
  const request = {
@@ -2674,19 +2674,19 @@ class htx extends htx$1 {
2674
2674
  'fee': fee,
2675
2675
  }, market);
2676
2676
  }
2677
+ /**
2678
+ * @method
2679
+ * @name htx#fetchOrderTrades
2680
+ * @description fetch all the trades made from a single order
2681
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#get-the-match-result-of-an-order
2682
+ * @param {string} id order id
2683
+ * @param {string} symbol unified market symbol
2684
+ * @param {int} [since] the earliest time in ms to fetch trades for
2685
+ * @param {int} [limit] the maximum number of trades to retrieve
2686
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2687
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
2688
+ */
2677
2689
  async fetchOrderTrades(id, symbol = undefined, since = undefined, limit = undefined, params = {}) {
2678
- /**
2679
- * @method
2680
- * @name htx#fetchOrderTrades
2681
- * @description fetch all the trades made from a single order
2682
- * @see https://huobiapi.github.io/docs/spot/v1/en/#get-the-match-result-of-an-order
2683
- * @param {string} id order id
2684
- * @param {string} symbol unified market symbol
2685
- * @param {int} [since] the earliest time in ms to fetch trades for
2686
- * @param {int} [limit] the maximum number of trades to retrieve
2687
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2688
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
2689
- */
2690
2690
  let market = undefined;
2691
2691
  if (symbol !== undefined) {
2692
2692
  market = this.market(symbol);
@@ -2698,20 +2698,20 @@ class htx extends htx$1 {
2698
2698
  }
2699
2699
  return await this.fetchSpotOrderTrades(id, symbol, since, limit, params);
2700
2700
  }
2701
+ /**
2702
+ * @ignore
2703
+ * @method
2704
+ * @name htx#fetchOrderTrades
2705
+ * @description fetch all the trades made from a single order
2706
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#get-the-match-result-of-an-order
2707
+ * @param {string} id order id
2708
+ * @param {string} symbol unified market symbol
2709
+ * @param {int} [since] the earliest time in ms to fetch trades for
2710
+ * @param {int} [limit] the maximum number of trades to retrieve
2711
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2712
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
2713
+ */
2701
2714
  async fetchSpotOrderTrades(id, symbol = undefined, since = undefined, limit = undefined, params = {}) {
2702
- /**
2703
- * @ignore
2704
- * @method
2705
- * @name htx#fetchOrderTrades
2706
- * @description fetch all the trades made from a single order
2707
- * @see https://huobiapi.github.io/docs/spot/v1/en/#get-the-match-result-of-an-order
2708
- * @param {string} id order id
2709
- * @param {string} symbol unified market symbol
2710
- * @param {int} [since] the earliest time in ms to fetch trades for
2711
- * @param {int} [limit] the maximum number of trades to retrieve
2712
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2713
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
2714
- */
2715
2715
  await this.loadMarkets();
2716
2716
  const request = {
2717
2717
  'order-id': id,
@@ -2719,22 +2719,22 @@ class htx extends htx$1 {
2719
2719
  const response = await this.spotPrivateGetV1OrderOrdersOrderIdMatchresults(this.extend(request, params));
2720
2720
  return this.parseTrades(response['data'], undefined, since, limit);
2721
2721
  }
2722
+ /**
2723
+ * @method
2724
+ * @name htx#fetchMyTrades
2725
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-get-history-match-results-via-multiple-fields-new
2726
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-get-history-match-results-via-multiple-fields-new
2727
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#search-match-results
2728
+ * @description fetch all trades made by the user
2729
+ * @param {string} symbol unified market symbol
2730
+ * @param {int} [since] the earliest time in ms to fetch trades for
2731
+ * @param {int} [limit] the maximum number of trades structures to retrieve
2732
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2733
+ * @param {int} [params.until] the latest time in ms to fetch trades for
2734
+ * @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)
2735
+ * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
2736
+ */
2722
2737
  async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
2723
- /**
2724
- * @method
2725
- * @name htx#fetchMyTrades
2726
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-get-history-match-results-via-multiple-fields-new
2727
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-get-history-match-results-via-multiple-fields-new
2728
- * @see https://huobiapi.github.io/docs/spot/v1/en/#search-match-results
2729
- * @description fetch all trades made by the user
2730
- * @param {string} symbol unified market symbol
2731
- * @param {int} [since] the earliest time in ms to fetch trades for
2732
- * @param {int} [limit] the maximum number of trades structures to retrieve
2733
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2734
- * @param {int} [params.until] the latest time in ms to fetch trades for
2735
- * @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)
2736
- * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
2737
- */
2738
2738
  await this.loadMarkets();
2739
2739
  let paginate = false;
2740
2740
  [paginate, params] = this.handleOptionAndParams(params, 'fetchMyTrades', 'paginate');
@@ -2892,21 +2892,21 @@ class htx extends htx$1 {
2892
2892
  }
2893
2893
  return this.parseTrades(trades, market, since, limit);
2894
2894
  }
2895
+ /**
2896
+ * @method
2897
+ * @name htx#fetchTrades
2898
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#get-the-most-recent-trades
2899
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#query-a-batch-of-trade-records-of-a-contract
2900
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-a-batch-of-trade-records-of-a-contract
2901
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-a-batch-of-trade-records-of-a-contract
2902
+ * @description get the list of most recent trades for a particular symbol
2903
+ * @param {string} symbol unified symbol of the market to fetch trades for
2904
+ * @param {int} [since] timestamp in ms of the earliest trade to fetch
2905
+ * @param {int} [limit] the maximum amount of trades to fetch
2906
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2907
+ * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
2908
+ */
2895
2909
  async fetchTrades(symbol, since = undefined, limit = 1000, params = {}) {
2896
- /**
2897
- * @method
2898
- * @name htx#fetchTrades
2899
- * @see https://huobiapi.github.io/docs/spot/v1/en/#get-the-most-recent-trades
2900
- * @see https://huobiapi.github.io/docs/dm/v1/en/#query-a-batch-of-trade-records-of-a-contract
2901
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-a-batch-of-trade-records-of-a-contract
2902
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-a-batch-of-trade-records-of-a-contract
2903
- * @description get the list of most recent trades for a particular symbol
2904
- * @param {string} symbol unified symbol of the market to fetch trades for
2905
- * @param {int} [since] timestamp in ms of the earliest trade to fetch
2906
- * @param {int} [limit] the maximum amount of trades to fetch
2907
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2908
- * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
2909
- */
2910
2910
  await this.loadMarkets();
2911
2911
  const market = this.market(symbol);
2912
2912
  const request = {
@@ -2998,24 +2998,24 @@ class htx extends htx$1 {
2998
2998
  this.safeNumber(ohlcv, 'amount'),
2999
2999
  ];
3000
3000
  }
3001
+ /**
3002
+ * @method
3003
+ * @name htx#fetchOHLCV
3004
+ * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
3005
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#get-klines-candles
3006
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#get-kline-data
3007
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-kline-data
3008
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-get-kline-data
3009
+ * @param {string} symbol unified symbol of the market to fetch OHLCV data for
3010
+ * @param {string} timeframe the length of time each candle represents
3011
+ * @param {int} [since] timestamp in ms of the earliest candle to fetch
3012
+ * @param {int} [limit] the maximum amount of candles to fetch
3013
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3014
+ * @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)
3015
+ * @param {string} [params.useHistoricalEndpointForSpot] true/false - whether use the historical candles endpoint for spot markets or default klines endpoint
3016
+ * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
3017
+ */
3001
3018
  async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
3002
- /**
3003
- * @method
3004
- * @name htx#fetchOHLCV
3005
- * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
3006
- * @see https://huobiapi.github.io/docs/spot/v1/en/#get-klines-candles
3007
- * @see https://huobiapi.github.io/docs/dm/v1/en/#get-kline-data
3008
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-kline-data
3009
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-get-kline-data
3010
- * @param {string} symbol unified symbol of the market to fetch OHLCV data for
3011
- * @param {string} timeframe the length of time each candle represents
3012
- * @param {int} [since] timestamp in ms of the earliest candle to fetch
3013
- * @param {int} [limit] the maximum amount of candles to fetch
3014
- * @param {object} [params] extra parameters specific to the exchange API endpoint
3015
- * @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)
3016
- * @param {string} [params.useHistoricalEndpointForSpot] true/false - whether use the historical candles endpoint for spot markets or default klines endpoint
3017
- * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
3018
- */
3019
3019
  await this.loadMarkets();
3020
3020
  let paginate = false;
3021
3021
  [paginate, params] = this.handleOptionAndParams(params, 'fetchOHLCV', 'paginate');
@@ -3163,15 +3163,15 @@ class htx extends htx$1 {
3163
3163
  const data = this.safeList(response, 'data', []);
3164
3164
  return this.parseOHLCVs(data, market, timeframe, since, limit);
3165
3165
  }
3166
+ /**
3167
+ * @method
3168
+ * @name htx#fetchAccounts
3169
+ * @description fetch all the accounts associated with a profile
3170
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#get-all-accounts-of-the-current-user
3171
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3172
+ * @returns {object} a dictionary of [account structures]{@link https://docs.ccxt.com/#/?id=account-structure} indexed by the account type
3173
+ */
3166
3174
  async fetchAccounts(params = {}) {
3167
- /**
3168
- * @method
3169
- * @name htx#fetchAccounts
3170
- * @description fetch all the accounts associated with a profile
3171
- * @see https://huobiapi.github.io/docs/spot/v1/en/#get-all-accounts-of-the-current-user
3172
- * @param {object} [params] extra parameters specific to the exchange API endpoint
3173
- * @returns {object} a dictionary of [account structures]{@link https://docs.ccxt.com/#/?id=account-structure} indexed by the account type
3174
- */
3175
3175
  await this.loadMarkets();
3176
3176
  const response = await this.spotPrivateGetV1AccountAccounts(params);
3177
3177
  //
@@ -3205,17 +3205,18 @@ class htx extends htx$1 {
3205
3205
  'code': undefined,
3206
3206
  };
3207
3207
  }
3208
+ /**
3209
+ * @method
3210
+ * @name htx#fetchAccountIdByType
3211
+ * @description fetch all the accounts by a type and marginModeassociated with a profile
3212
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#get-all-accounts-of-the-current-user
3213
+ * @param {string} type 'spot', 'swap' or 'future
3214
+ * @param {string} [marginMode] 'cross' or 'isolated'
3215
+ * @param {string} [symbol] unified ccxt market symbol
3216
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3217
+ * @returns {object} a dictionary of [account structures]{@link https://docs.ccxt.com/#/?id=account-structure} indexed by the account type
3218
+ */
3208
3219
  async fetchAccountIdByType(type, marginMode = undefined, symbol = undefined, params = {}) {
3209
- /**
3210
- * @method
3211
- * @name htx#fetchAccountIdByType
3212
- * @description fetch all the accounts by a type and marginModeassociated with a profile
3213
- * @see https://huobiapi.github.io/docs/spot/v1/en/#get-all-accounts-of-the-current-user
3214
- * @param {string} type 'spot', 'swap' or 'future
3215
- * @param {string} [marginMode] 'cross' or 'isolated'
3216
- * @param {object} [params] extra parameters specific to the exchange API endpoint
3217
- * @returns {object} a dictionary of [account structures]{@link https://docs.ccxt.com/#/?id=account-structure} indexed by the account type
3218
- */
3219
3220
  const accounts = await this.loadAccounts();
3220
3221
  const accountId = this.safeValue2(params, 'accountId', 'account-id');
3221
3222
  if (accountId !== undefined) {
@@ -3247,15 +3248,15 @@ class htx extends htx$1 {
3247
3248
  const defaultAccount = this.safeValue(accounts, 0, {});
3248
3249
  return this.safeString(defaultAccount, 'id');
3249
3250
  }
3251
+ /**
3252
+ * @method
3253
+ * @name htx#fetchCurrencies
3254
+ * @description fetches all available currencies on an exchange
3255
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#apiv2-currency-amp-chains
3256
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3257
+ * @returns {object} an associative dictionary of currencies
3258
+ */
3250
3259
  async fetchCurrencies(params = {}) {
3251
- /**
3252
- * @method
3253
- * @name htx#fetchCurrencies
3254
- * @description fetches all available currencies on an exchange
3255
- * @see https://huobiapi.github.io/docs/spot/v1/en/#apiv2-currency-amp-chains
3256
- * @param {object} [params] extra parameters specific to the exchange API endpoint
3257
- * @returns {object} an associative dictionary of currencies
3258
- */
3259
3260
  const response = await this.spotPublicGetV2ReferenceCurrencies(params);
3260
3261
  //
3261
3262
  // {
@@ -3413,22 +3414,22 @@ class htx extends htx$1 {
3413
3414
  return this.safeValue(uniqueNetworkIds, networkTitle, networkTitle);
3414
3415
  }
3415
3416
  }
3417
+ /**
3418
+ * @method
3419
+ * @name htx#fetchBalance
3420
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#get-account-balance-of-a-specific-account
3421
+ * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec4b429-7773-11ed-9966-0242ac110003
3422
+ * @see https://www.htx.com/en-us/opend/newApiPages/?id=10000074-77b7-11ed-9966-0242ac110003
3423
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#query-asset-valuation
3424
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-user-s-account-information
3425
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-query-user-s-account-information
3426
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-query-user-39-s-account-information
3427
+ * @description query for balance and get the amount of funds available for trading or funds locked in orders
3428
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3429
+ * @param {bool} [params.unified] provide this parameter if you have a recent account with unified cross+isolated margin account
3430
+ * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
3431
+ */
3416
3432
  async fetchBalance(params = {}) {
3417
- /**
3418
- * @method
3419
- * @name htx#fetchBalance
3420
- * @see https://huobiapi.github.io/docs/spot/v1/en/#get-account-balance-of-a-specific-account
3421
- * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec4b429-7773-11ed-9966-0242ac110003
3422
- * @see https://www.htx.com/en-us/opend/newApiPages/?id=10000074-77b7-11ed-9966-0242ac110003
3423
- * @see https://huobiapi.github.io/docs/dm/v1/en/#query-asset-valuation
3424
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-user-s-account-information
3425
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-query-user-s-account-information
3426
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-query-user-39-s-account-information
3427
- * @description query for balance and get the amount of funds available for trading or funds locked in orders
3428
- * @param {object} [params] extra parameters specific to the exchange API endpoint
3429
- * @param {bool} [params.unified] provide this parameter if you have a recent account with unified cross+isolated margin account
3430
- * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
3431
- */
3432
3433
  await this.loadMarkets();
3433
3434
  let type = undefined;
3434
3435
  [type, params] = this.handleMarketTypeAndParams('fetchBalance', undefined, params);
@@ -3749,21 +3750,22 @@ class htx extends htx$1 {
3749
3750
  }
3750
3751
  return result;
3751
3752
  }
3753
+ /**
3754
+ * @method
3755
+ * @name htx#fetchOrder
3756
+ * @description fetches information on an order made by the user
3757
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#get-the-order-detail-of-an-order-based-on-client-order-id
3758
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#get-the-order-detail-of-an-order
3759
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-get-information-of-an-order
3760
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-get-information-of-order
3761
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#get-information-of-an-order
3762
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-information-of-an-order
3763
+ * @param {string} id order id
3764
+ * @param {string} symbol unified symbol of the market the order was made in
3765
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3766
+ * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
3767
+ */
3752
3768
  async fetchOrder(id, symbol = undefined, params = {}) {
3753
- /**
3754
- * @method
3755
- * @name htx#fetchOrder
3756
- * @description fetches information on an order made by the user
3757
- * @see https://huobiapi.github.io/docs/spot/v1/en/#get-the-order-detail-of-an-order-based-on-client-order-id
3758
- * @see https://huobiapi.github.io/docs/spot/v1/en/#get-the-order-detail-of-an-order
3759
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-get-information-of-an-order
3760
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-get-information-of-order
3761
- * @see https://huobiapi.github.io/docs/dm/v1/en/#get-information-of-an-order
3762
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-information-of-an-order
3763
- * @param {string} symbol unified symbol of the market the order was made in
3764
- * @param {object} [params] extra parameters specific to the exchange API endpoint
3765
- * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
3766
- */
3767
3769
  await this.loadMarkets();
3768
3770
  let market = undefined;
3769
3771
  if (symbol !== undefined) {
@@ -4317,27 +4319,27 @@ class htx extends htx$1 {
4317
4319
  };
4318
4320
  return await this.fetchContractOrders(symbol, since, limit, this.extend(request, params));
4319
4321
  }
4322
+ /**
4323
+ * @method
4324
+ * @name htx#fetchOrders
4325
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#search-past-orders
4326
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#search-historical-orders-within-48-hours
4327
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-get-history-orders-new
4328
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-get-history-orders-new
4329
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-history-orders-new
4330
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-history-orders-via-multiple-fields-new
4331
+ * @description fetches information on multiple orders made by the user
4332
+ * @param {string} symbol unified market symbol of the market orders were made in
4333
+ * @param {int} [since] the earliest time in ms to fetch orders for
4334
+ * @param {int} [limit] the maximum number of order structures to retrieve
4335
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
4336
+ * @param {bool} [params.stop] *contract only* if the orders are stop trigger orders or not
4337
+ * @param {bool} [params.stopLossTakeProfit] *contract only* if the orders are stop-loss or take-profit orders
4338
+ * @param {int} [params.until] the latest time in ms to fetch entries for
4339
+ * @param {boolean} [params.trailing] *contract only* set to true if you want to fetch trailing stop orders
4340
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
4341
+ */
4320
4342
  async fetchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
4321
- /**
4322
- * @method
4323
- * @name htx#fetchOrders
4324
- * @see https://huobiapi.github.io/docs/spot/v1/en/#search-past-orders
4325
- * @see https://huobiapi.github.io/docs/spot/v1/en/#search-historical-orders-within-48-hours
4326
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-get-history-orders-new
4327
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-get-history-orders-new
4328
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-history-orders-new
4329
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-history-orders-via-multiple-fields-new
4330
- * @description fetches information on multiple orders made by the user
4331
- * @param {string} symbol unified market symbol of the market orders were made in
4332
- * @param {int} [since] the earliest time in ms to fetch orders for
4333
- * @param {int} [limit] the maximum number of order structures to retrieve
4334
- * @param {object} [params] extra parameters specific to the exchange API endpoint
4335
- * @param {bool} [params.stop] *contract only* if the orders are stop trigger orders or not
4336
- * @param {bool} [params.stopLossTakeProfit] *contract only* if the orders are stop-loss or take-profit orders
4337
- * @param {int} [params.until] the latest time in ms to fetch entries for
4338
- * @param {boolean} [params.trailing] *contract only* set to true if you want to fetch trailing stop orders
4339
- * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
4340
- */
4341
4343
  await this.loadMarkets();
4342
4344
  let market = undefined;
4343
4345
  if (symbol !== undefined) {
@@ -4356,25 +4358,25 @@ class htx extends htx$1 {
4356
4358
  return await this.fetchSpotOrders(symbol, since, limit, params);
4357
4359
  }
4358
4360
  }
4361
+ /**
4362
+ * @method
4363
+ * @name htx#fetchClosedOrders
4364
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#search-past-orders
4365
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#search-historical-orders-within-48-hours
4366
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-get-history-orders-new
4367
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-get-history-orders-new
4368
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-history-orders-new
4369
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-history-orders-via-multiple-fields-new
4370
+ * @description fetches information on multiple closed orders made by the user
4371
+ * @param {string} symbol unified market symbol of the market orders were made in
4372
+ * @param {int} [since] the earliest time in ms to fetch orders for
4373
+ * @param {int} [limit] the maximum number of order structures to retrieve
4374
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
4375
+ * @param {int} [params.until] the latest time in ms to fetch entries for
4376
+ * @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)
4377
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
4378
+ */
4359
4379
  async fetchClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
4360
- /**
4361
- * @method
4362
- * @name htx#fetchClosedOrders
4363
- * @see https://huobiapi.github.io/docs/spot/v1/en/#search-past-orders
4364
- * @see https://huobiapi.github.io/docs/spot/v1/en/#search-historical-orders-within-48-hours
4365
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-get-history-orders-new
4366
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-get-history-orders-new
4367
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-history-orders-new
4368
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-history-orders-via-multiple-fields-new
4369
- * @description fetches information on multiple closed orders made by the user
4370
- * @param {string} symbol unified market symbol of the market orders were made in
4371
- * @param {int} [since] the earliest time in ms to fetch orders for
4372
- * @param {int} [limit] the maximum number of order structures to retrieve
4373
- * @param {object} [params] extra parameters specific to the exchange API endpoint
4374
- * @param {int} [params.until] the latest time in ms to fetch entries for
4375
- * @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)
4376
- * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
4377
- */
4378
4380
  await this.loadMarkets();
4379
4381
  let paginate = false;
4380
4382
  [paginate, params] = this.handleOptionAndParams(params, 'fetchClosedOrders', 'paginate');
@@ -4394,23 +4396,23 @@ class htx extends htx$1 {
4394
4396
  return await this.fetchClosedContractOrders(symbol, since, limit, params);
4395
4397
  }
4396
4398
  }
4399
+ /**
4400
+ * @method
4401
+ * @name htx#fetchOpenOrders
4402
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#get-all-open-orders
4403
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-current-unfilled-order-acquisition
4404
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-current-unfilled-order-acquisition
4405
+ * @description fetch all unfilled currently open orders
4406
+ * @param {string} symbol unified market symbol
4407
+ * @param {int} [since] the earliest time in ms to fetch open orders for
4408
+ * @param {int} [limit] the maximum number of open order structures to retrieve
4409
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
4410
+ * @param {bool} [params.stop] *contract only* if the orders are stop trigger orders or not
4411
+ * @param {bool} [params.stopLossTakeProfit] *contract only* if the orders are stop-loss or take-profit orders
4412
+ * @param {boolean} [params.trailing] *contract only* set to true if you want to fetch trailing stop orders
4413
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
4414
+ */
4397
4415
  async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
4398
- /**
4399
- * @method
4400
- * @name htx#fetchOpenOrders
4401
- * @see https://huobiapi.github.io/docs/spot/v1/en/#get-all-open-orders
4402
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-current-unfilled-order-acquisition
4403
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-current-unfilled-order-acquisition
4404
- * @description fetch all unfilled currently open orders
4405
- * @param {string} symbol unified market symbol
4406
- * @param {int} [since] the earliest time in ms to fetch open orders for
4407
- * @param {int} [limit] the maximum number of open order structures to retrieve
4408
- * @param {object} [params] extra parameters specific to the exchange API endpoint
4409
- * @param {bool} [params.stop] *contract only* if the orders are stop trigger orders or not
4410
- * @param {bool} [params.stopLossTakeProfit] *contract only* if the orders are stop-loss or take-profit orders
4411
- * @param {boolean} [params.trailing] *contract only* set to true if you want to fetch trailing stop orders
4412
- * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
4413
- */
4414
4416
  await this.loadMarkets();
4415
4417
  let market = undefined;
4416
4418
  if (symbol !== undefined) {
@@ -5172,17 +5174,17 @@ class htx extends htx$1 {
5172
5174
  'trades': trades,
5173
5175
  }, market);
5174
5176
  }
5177
+ /**
5178
+ * @method
5179
+ * @name htx#createMarketBuyOrderWithCost
5180
+ * @description create a market buy order by providing the symbol and cost
5181
+ * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec4ee16-7773-11ed-9966-0242ac110003
5182
+ * @param {string} symbol unified symbol of the market to create an order in
5183
+ * @param {float} cost how much you want to trade in units of the quote currency
5184
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
5185
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
5186
+ */
5175
5187
  async createMarketBuyOrderWithCost(symbol, cost, params = {}) {
5176
- /**
5177
- * @method
5178
- * @name htx#createMarketBuyOrderWithCost
5179
- * @description create a market buy order by providing the symbol and cost
5180
- * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec4ee16-7773-11ed-9966-0242ac110003
5181
- * @param {string} symbol unified symbol of the market to create an order in
5182
- * @param {float} cost how much you want to trade in units of the quote currency
5183
- * @param {object} [params] extra parameters specific to the exchange API endpoint
5184
- * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
5185
- */
5186
5188
  await this.loadMarkets();
5187
5189
  const market = this.market(symbol);
5188
5190
  if (!market['spot']) {
@@ -5191,21 +5193,21 @@ class htx extends htx$1 {
5191
5193
  params['createMarketBuyOrderRequiresPrice'] = false;
5192
5194
  return await this.createOrder(symbol, 'market', 'buy', cost, undefined, params);
5193
5195
  }
5196
+ /**
5197
+ * @method
5198
+ * @name htx#createTrailingPercentOrder
5199
+ * @description create a trailing order by providing the symbol, type, side, amount, price and trailingPercent
5200
+ * @param {string} symbol unified symbol of the market to create an order in
5201
+ * @param {string} type 'market' or 'limit'
5202
+ * @param {string} side 'buy' or 'sell'
5203
+ * @param {float} amount how much you want to trade in units of the base currency, or number of contracts
5204
+ * @param {float} [price] the price for the order to be filled at, in units of the quote currency, ignored in market orders
5205
+ * @param {float} trailingPercent the percent to trail away from the current market price
5206
+ * @param {float} trailingTriggerPrice the price to activate a trailing order, default uses the price argument
5207
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
5208
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
5209
+ */
5194
5210
  async createTrailingPercentOrder(symbol, type, side, amount, price = undefined, trailingPercent = undefined, trailingTriggerPrice = undefined, params = {}) {
5195
- /**
5196
- * @method
5197
- * @name htx#createTrailingPercentOrder
5198
- * @description create a trailing order by providing the symbol, type, side, amount, price and trailingPercent
5199
- * @param {string} symbol unified symbol of the market to create an order in
5200
- * @param {string} type 'market' or 'limit'
5201
- * @param {string} side 'buy' or 'sell'
5202
- * @param {float} amount how much you want to trade in units of the base currency, or number of contracts
5203
- * @param {float} [price] the price for the order to be filled at, in units of the quote currency, ignored in market orders
5204
- * @param {float} trailingPercent the percent to trail away from the current market price
5205
- * @param {float} trailingTriggerPrice the price to activate a trailing order, default uses the price argument
5206
- * @param {object} [params] extra parameters specific to the exchange API endpoint
5207
- * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
5208
- */
5209
5211
  if (trailingPercent === undefined) {
5210
5212
  throw new errors.ArgumentsRequired(this.id + ' createTrailingPercentOrder() requires a trailingPercent argument');
5211
5213
  }
@@ -5216,22 +5218,22 @@ class htx extends htx$1 {
5216
5218
  params['trailingTriggerPrice'] = trailingTriggerPrice;
5217
5219
  return await this.createOrder(symbol, type, side, amount, price, params);
5218
5220
  }
5221
+ /**
5222
+ * @method
5223
+ * @ignore
5224
+ * @name htx#createSpotOrderRequest
5225
+ * @description helper function to build request
5226
+ * @param {string} symbol unified symbol of the market to create an order in
5227
+ * @param {string} type 'market' or 'limit'
5228
+ * @param {string} side 'buy' or 'sell'
5229
+ * @param {float} amount how much you want to trade in units of the base currency
5230
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
5231
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
5232
+ * @param {string} [params.timeInForce] supports 'IOC' and 'FOK'
5233
+ * @param {float} [params.cost] the quote quantity that can be used as an alternative for the amount for market buy orders
5234
+ * @returns {object} request to be sent to the exchange
5235
+ */
5219
5236
  async createSpotOrderRequest(symbol, type, side, amount, price = undefined, params = {}) {
5220
- /**
5221
- * @method
5222
- * @ignore
5223
- * @name htx#createSpotOrderRequest
5224
- * @description helper function to build request
5225
- * @param {string} symbol unified symbol of the market to create an order in
5226
- * @param {string} type 'market' or 'limit'
5227
- * @param {string} side 'buy' or 'sell'
5228
- * @param {float} amount how much you want to trade in units of the base currency
5229
- * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
5230
- * @param {object} [params] extra parameters specific to the exchange API endpoint
5231
- * @param {string} [params.timeInForce] supports 'IOC' and 'FOK'
5232
- * @param {float} [params.cost] the quote quantity that can be used as an alternative for the amount for market buy orders
5233
- * @returns {object} request to be sent to the exchange
5234
- */
5235
5237
  await this.loadMarkets();
5236
5238
  await this.loadAccounts();
5237
5239
  const market = this.market(symbol);
@@ -5443,40 +5445,40 @@ class htx extends htx$1 {
5443
5445
  params = this.omit(params, ['reduceOnly', 'triggerPrice', 'stopPrice', 'stopLossPrice', 'takeProfitPrice', 'triggerType', 'leverRate', 'timeInForce', 'leverage', 'trailingPercent', 'trailingTriggerPrice']);
5444
5446
  return this.extend(request, params);
5445
5447
  }
5448
+ /**
5449
+ * @method
5450
+ * @name htx#createOrder
5451
+ * @description create a trade order
5452
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#place-a-new-order // spot, margin
5453
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#place-an-order // coin-m swap
5454
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#place-trigger-order // coin-m swap trigger
5455
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-place-an-order // usdt-m swap cross
5456
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-place-trigger-order // usdt-m swap cross trigger
5457
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-place-an-order // usdt-m swap isolated
5458
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-place-trigger-order // usdt-m swap isolated trigger
5459
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#place-an-order // coin-m futures
5460
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#place-trigger-order // coin-m futures contract trigger
5461
+ * @param {string} symbol unified symbol of the market to create an order in
5462
+ * @param {string} type 'market' or 'limit'
5463
+ * @param {string} side 'buy' or 'sell'
5464
+ * @param {float} amount how much you want to trade in units of the base currency
5465
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
5466
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
5467
+ * @param {float} [params.triggerPrice] the price a trigger order is triggered at
5468
+ * @param {string} [params.triggerType] *contract trigger orders only* ge: greater than or equal to, le: less than or equal to
5469
+ * @param {float} [params.stopLossPrice] *contract only* the price a stop-loss order is triggered at
5470
+ * @param {float} [params.takeProfitPrice] *contract only* the price a take-profit order is triggered at
5471
+ * @param {string} [params.operator] *spot and margin only* gte or lte, trigger price condition
5472
+ * @param {string} [params.offset] *contract only* 'both' (linear only), 'open', or 'close', required in hedge mode and for inverse markets
5473
+ * @param {bool} [params.postOnly] *contract only* true or false
5474
+ * @param {int} [params.leverRate] *contract only* required for all contract orders except tpsl, leverage greater than 20x requires prior approval of high-leverage agreement
5475
+ * @param {string} [params.timeInForce] supports 'IOC' and 'FOK'
5476
+ * @param {float} [params.cost] *spot market buy only* the quote quantity that can be used as an alternative for the amount
5477
+ * @param {float} [params.trailingPercent] *contract only* the percent to trail away from the current market price
5478
+ * @param {float} [params.trailingTriggerPrice] *contract only* the price to trigger a trailing order, default uses the price argument
5479
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
5480
+ */
5446
5481
  async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
5447
- /**
5448
- * @method
5449
- * @name htx#createOrder
5450
- * @description create a trade order
5451
- * @see https://huobiapi.github.io/docs/spot/v1/en/#place-a-new-order // spot, margin
5452
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#place-an-order // coin-m swap
5453
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#place-trigger-order // coin-m swap trigger
5454
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-place-an-order // usdt-m swap cross
5455
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-place-trigger-order // usdt-m swap cross trigger
5456
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-place-an-order // usdt-m swap isolated
5457
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-place-trigger-order // usdt-m swap isolated trigger
5458
- * @see https://huobiapi.github.io/docs/dm/v1/en/#place-an-order // coin-m futures
5459
- * @see https://huobiapi.github.io/docs/dm/v1/en/#place-trigger-order // coin-m futures contract trigger
5460
- * @param {string} symbol unified symbol of the market to create an order in
5461
- * @param {string} type 'market' or 'limit'
5462
- * @param {string} side 'buy' or 'sell'
5463
- * @param {float} amount how much you want to trade in units of the base currency
5464
- * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
5465
- * @param {object} [params] extra parameters specific to the exchange API endpoint
5466
- * @param {float} [params.triggerPrice] the price a trigger order is triggered at
5467
- * @param {string} [params.triggerType] *contract trigger orders only* ge: greater than or equal to, le: less than or equal to
5468
- * @param {float} [params.stopLossPrice] *contract only* the price a stop-loss order is triggered at
5469
- * @param {float} [params.takeProfitPrice] *contract only* the price a take-profit order is triggered at
5470
- * @param {string} [params.operator] *spot and margin only* gte or lte, trigger price condition
5471
- * @param {string} [params.offset] *contract only* 'both' (linear only), 'open', or 'close', required in hedge mode and for inverse markets
5472
- * @param {bool} [params.postOnly] *contract only* true or false
5473
- * @param {int} [params.leverRate] *contract only* required for all contract orders except tpsl, leverage greater than 20x requires prior approval of high-leverage agreement
5474
- * @param {string} [params.timeInForce] supports 'IOC' and 'FOK'
5475
- * @param {float} [params.cost] *spot market buy only* the quote quantity that can be used as an alternative for the amount
5476
- * @param {float} [params.trailingPercent] *contract only* the percent to trail away from the current market price
5477
- * @param {float} [params.trailingTriggerPrice] *contract only* the price to trigger a trailing order, default uses the price argument
5478
- * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
5479
- */
5480
5482
  await this.loadMarkets();
5481
5483
  const market = this.market(symbol);
5482
5484
  const triggerPrice = this.safeNumberN(params, ['triggerPrice', 'stopPrice', 'trigger_price']);
@@ -5632,20 +5634,20 @@ class htx extends htx$1 {
5632
5634
  }
5633
5635
  return this.parseOrder(result, market);
5634
5636
  }
5637
+ /**
5638
+ * @method
5639
+ * @name htx#createOrders
5640
+ * @description create a list of trade orders
5641
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#place-a-batch-of-orders
5642
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#place-a-batch-of-orders
5643
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#place-a-batch-of-orders
5644
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-place-a-batch-of-orders
5645
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-place-a-batch-of-orders
5646
+ * @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
5647
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
5648
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
5649
+ */
5635
5650
  async createOrders(orders, params = {}) {
5636
- /**
5637
- * @method
5638
- * @name htx#createOrders
5639
- * @description create a list of trade orders
5640
- * @see https://huobiapi.github.io/docs/spot/v1/en/#place-a-batch-of-orders
5641
- * @see https://huobiapi.github.io/docs/dm/v1/en/#place-a-batch-of-orders
5642
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#place-a-batch-of-orders
5643
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-place-a-batch-of-orders
5644
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-place-a-batch-of-orders
5645
- * @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
5646
- * @param {object} [params] extra parameters specific to the exchange API endpoint
5647
- * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
5648
- */
5649
5651
  await this.loadMarkets();
5650
5652
  const ordersRequests = [];
5651
5653
  let symbol = undefined;
@@ -5768,19 +5770,19 @@ class htx extends htx$1 {
5768
5770
  }
5769
5771
  return this.parseOrders(result, market);
5770
5772
  }
5773
+ /**
5774
+ * @method
5775
+ * @name htx#cancelOrder
5776
+ * @description cancels an open order
5777
+ * @param {string} id order id
5778
+ * @param {string} symbol unified symbol of the market the order was made in
5779
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
5780
+ * @param {boolean} [params.stop] *contract only* if the order is a stop trigger order or not
5781
+ * @param {boolean} [params.stopLossTakeProfit] *contract only* if the order is a stop-loss or take-profit order
5782
+ * @param {boolean} [params.trailing] *contract only* set to true if you want to cancel a trailing order
5783
+ * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
5784
+ */
5771
5785
  async cancelOrder(id, symbol = undefined, params = {}) {
5772
- /**
5773
- * @method
5774
- * @name htx#cancelOrder
5775
- * @description cancels an open order
5776
- * @param {string} id order id
5777
- * @param {string} symbol unified symbol of the market the order was made in
5778
- * @param {object} [params] extra parameters specific to the exchange API endpoint
5779
- * @param {boolean} [params.stop] *contract only* if the order is a stop trigger order or not
5780
- * @param {boolean} [params.stopLossTakeProfit] *contract only* if the order is a stop-loss or take-profit order
5781
- * @param {boolean} [params.trailing] *contract only* set to true if you want to cancel a trailing order
5782
- * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
5783
- */
5784
5786
  await this.loadMarkets();
5785
5787
  let market = undefined;
5786
5788
  if (symbol !== undefined) {
@@ -5926,18 +5928,18 @@ class htx extends htx$1 {
5926
5928
  'status': 'canceled',
5927
5929
  });
5928
5930
  }
5931
+ /**
5932
+ * @method
5933
+ * @name htx#cancelOrders
5934
+ * @description cancel multiple orders
5935
+ * @param {string[]} ids order ids
5936
+ * @param {string} symbol unified market symbol, default is undefined
5937
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
5938
+ * @param {bool} [params.stop] *contract only* if the orders are stop trigger orders or not
5939
+ * @param {bool} [params.stopLossTakeProfit] *contract only* if the orders are stop-loss or take-profit orders
5940
+ * @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
5941
+ */
5929
5942
  async cancelOrders(ids, symbol = undefined, params = {}) {
5930
- /**
5931
- * @method
5932
- * @name htx#cancelOrders
5933
- * @description cancel multiple orders
5934
- * @param {string[]} ids order ids
5935
- * @param {string} symbol unified market symbol, default is undefined
5936
- * @param {object} [params] extra parameters specific to the exchange API endpoint
5937
- * @param {bool} [params.stop] *contract only* if the orders are stop trigger orders or not
5938
- * @param {bool} [params.stopLossTakeProfit] *contract only* if the orders are stop-loss or take-profit orders
5939
- * @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
5940
- */
5941
5943
  await this.loadMarkets();
5942
5944
  let market = undefined;
5943
5945
  if (symbol !== undefined) {
@@ -6167,18 +6169,18 @@ class htx extends htx$1 {
6167
6169
  }
6168
6170
  return result;
6169
6171
  }
6172
+ /**
6173
+ * @method
6174
+ * @name htx#cancelAllOrders
6175
+ * @description cancel all open orders
6176
+ * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
6177
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
6178
+ * @param {boolean} [params.stop] *contract only* if the orders are stop trigger orders or not
6179
+ * @param {boolean} [params.stopLossTakeProfit] *contract only* if the orders are stop-loss or take-profit orders
6180
+ * @param {boolean} [params.trailing] *contract only* set to true if you want to cancel all trailing orders
6181
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
6182
+ */
6170
6183
  async cancelAllOrders(symbol = undefined, params = {}) {
6171
- /**
6172
- * @method
6173
- * @name htx#cancelAllOrders
6174
- * @description cancel all open orders
6175
- * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
6176
- * @param {object} [params] extra parameters specific to the exchange API endpoint
6177
- * @param {boolean} [params.stop] *contract only* if the orders are stop trigger orders or not
6178
- * @param {boolean} [params.stopLossTakeProfit] *contract only* if the orders are stop-loss or take-profit orders
6179
- * @param {boolean} [params.trailing] *contract only* set to true if you want to cancel all trailing orders
6180
- * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
6181
- */
6182
6184
  await this.loadMarkets();
6183
6185
  let market = undefined;
6184
6186
  if (symbol !== undefined) {
@@ -6315,16 +6317,16 @@ class htx extends htx$1 {
6315
6317
  return this.parseCancelOrders(data);
6316
6318
  }
6317
6319
  }
6320
+ /**
6321
+ * @method
6322
+ * @name htx#cancelAllOrdersAfter
6323
+ * @description dead man's switch, cancel all orders after the given timeout
6324
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#dead-man-s-switch
6325
+ * @param {number} timeout time in milliseconds, 0 represents cancel the timer
6326
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
6327
+ * @returns {object} the api result
6328
+ */
6318
6329
  async cancelAllOrdersAfter(timeout, params = {}) {
6319
- /**
6320
- * @method
6321
- * @name htx#cancelAllOrdersAfter
6322
- * @description dead man's switch, cancel all orders after the given timeout
6323
- * @see https://huobiapi.github.io/docs/spot/v1/en/#dead-man-s-switch
6324
- * @param {number} timeout time in milliseconds, 0 represents cancel the timer
6325
- * @param {object} [params] extra parameters specific to the exchange API endpoint
6326
- * @returns {object} the api result
6327
- */
6328
6330
  await this.loadMarkets();
6329
6331
  const request = {
6330
6332
  'timeout': (timeout > 0) ? this.parseToInt(timeout / 1000) : 0,
@@ -6368,16 +6370,16 @@ class htx extends htx$1 {
6368
6370
  'info': depositAddress,
6369
6371
  };
6370
6372
  }
6373
+ /**
6374
+ * @method
6375
+ * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec50029-7773-11ed-9966-0242ac110003
6376
+ * @name htx#fetchDepositAddressesByNetwork
6377
+ * @description fetch a dictionary of addresses for a currency, indexed by network
6378
+ * @param {string} code unified currency code of the currency for the deposit address
6379
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
6380
+ * @returns {object} a dictionary of [address structures]{@link https://docs.ccxt.com/#/?id=address-structure} indexed by the network
6381
+ */
6371
6382
  async fetchDepositAddressesByNetwork(code, params = {}) {
6372
- /**
6373
- * @method
6374
- * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec50029-7773-11ed-9966-0242ac110003
6375
- * @name htx#fetchDepositAddressesByNetwork
6376
- * @description fetch a dictionary of addresses for a currency, indexed by network
6377
- * @param {string} code unified currency code of the currency for the deposit address
6378
- * @param {object} [params] extra parameters specific to the exchange API endpoint
6379
- * @returns {object} a dictionary of [address structures]{@link https://docs.ccxt.com/#/?id=address-structure} indexed by the network
6380
- */
6381
6383
  await this.loadMarkets();
6382
6384
  const currency = this.currency(code);
6383
6385
  const request = {
@@ -6401,16 +6403,16 @@ class htx extends htx$1 {
6401
6403
  const parsed = this.parseDepositAddresses(data, [currency['code']], false);
6402
6404
  return this.indexBy(parsed, 'network');
6403
6405
  }
6406
+ /**
6407
+ * @method
6408
+ * @name htx#fetchDepositAddress
6409
+ * @description fetch the deposit address for a currency associated with this account
6410
+ * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec50029-7773-11ed-9966-0242ac110003
6411
+ * @param {string} code unified currency code
6412
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
6413
+ * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
6414
+ */
6404
6415
  async fetchDepositAddress(code, params = {}) {
6405
- /**
6406
- * @method
6407
- * @name htx#fetchDepositAddress
6408
- * @description fetch the deposit address for a currency associated with this account
6409
- * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec50029-7773-11ed-9966-0242ac110003
6410
- * @param {string} code unified currency code
6411
- * @param {object} [params] extra parameters specific to the exchange API endpoint
6412
- * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
6413
- */
6414
6416
  await this.loadMarkets();
6415
6417
  const currency = this.currency(code);
6416
6418
  const [networkCode, paramsOmited] = this.handleNetworkCodeAndParams(params);
@@ -6452,18 +6454,18 @@ class htx extends htx$1 {
6452
6454
  }
6453
6455
  return addresses;
6454
6456
  }
6457
+ /**
6458
+ * @method
6459
+ * @name htx#fetchDeposits
6460
+ * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec4f050-7773-11ed-9966-0242ac110003
6461
+ * @description fetch all deposits made to an account
6462
+ * @param {string} code unified currency code
6463
+ * @param {int} [since] the earliest time in ms to fetch deposits for
6464
+ * @param {int} [limit] the maximum number of deposits structures to retrieve
6465
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
6466
+ * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
6467
+ */
6455
6468
  async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
6456
- /**
6457
- * @method
6458
- * @name htx#fetchDeposits
6459
- * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec4f050-7773-11ed-9966-0242ac110003
6460
- * @description fetch all deposits made to an account
6461
- * @param {string} code unified currency code
6462
- * @param {int} [since] the earliest time in ms to fetch deposits for
6463
- * @param {int} [limit] the maximum number of deposits structures to retrieve
6464
- * @param {object} [params] extra parameters specific to the exchange API endpoint
6465
- * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
6466
- */
6467
6469
  if (limit === undefined || limit > 100) {
6468
6470
  limit = 100;
6469
6471
  }
@@ -6512,18 +6514,18 @@ class htx extends htx$1 {
6512
6514
  //
6513
6515
  return this.parseTransactions(response['data'], currency, since, limit);
6514
6516
  }
6517
+ /**
6518
+ * @method
6519
+ * @name htx#fetchWithdrawals
6520
+ * @description fetch all withdrawals made from an account
6521
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#search-for-existed-withdraws-and-deposits
6522
+ * @param {string} code unified currency code
6523
+ * @param {int} [since] the earliest time in ms to fetch withdrawals for
6524
+ * @param {int} [limit] the maximum number of withdrawals structures to retrieve
6525
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
6526
+ * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
6527
+ */
6515
6528
  async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
6516
- /**
6517
- * @method
6518
- * @name htx#fetchWithdrawals
6519
- * @description fetch all withdrawals made from an account
6520
- * @see https://huobiapi.github.io/docs/spot/v1/en/#search-for-existed-withdraws-and-deposits
6521
- * @param {string} code unified currency code
6522
- * @param {int} [since] the earliest time in ms to fetch withdrawals for
6523
- * @param {int} [limit] the maximum number of withdrawals structures to retrieve
6524
- * @param {object} [params] extra parameters specific to the exchange API endpoint
6525
- * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
6526
- */
6527
6529
  if (limit === undefined || limit > 100) {
6528
6530
  limit = 100;
6529
6531
  }
@@ -6688,19 +6690,19 @@ class htx extends htx$1 {
6688
6690
  };
6689
6691
  return this.safeString(statuses, status, status);
6690
6692
  }
6693
+ /**
6694
+ * @method
6695
+ * @name htx#withdraw
6696
+ * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec4cc41-7773-11ed-9966-0242ac110003
6697
+ * @description make a withdrawal
6698
+ * @param {string} code unified currency code
6699
+ * @param {float} amount the amount to withdraw
6700
+ * @param {string} address the address to withdraw to
6701
+ * @param {string} tag
6702
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
6703
+ * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
6704
+ */
6691
6705
  async withdraw(code, amount, address, tag = undefined, params = {}) {
6692
- /**
6693
- * @method
6694
- * @name htx#withdraw
6695
- * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec4cc41-7773-11ed-9966-0242ac110003
6696
- * @description make a withdrawal
6697
- * @param {string} code unified currency code
6698
- * @param {float} amount the amount to withdraw
6699
- * @param {string} address the address to withdraw to
6700
- * @param {string} tag
6701
- * @param {object} [params] extra parameters specific to the exchange API endpoint
6702
- * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
6703
- */
6704
6706
  [tag, params] = this.handleWithdrawTagAndParams(tag, params);
6705
6707
  await this.loadMarkets();
6706
6708
  this.checkAddress(address);
@@ -6772,27 +6774,27 @@ class htx extends htx$1 {
6772
6774
  'status': undefined,
6773
6775
  };
6774
6776
  }
6777
+ /**
6778
+ * @method
6779
+ * @name htx#transfer
6780
+ * @description transfer currency internally between wallets on the same account
6781
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#transfer-margin-between-spot-account-and-future-account
6782
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#transfer-fund-between-spot-account-and-future-contract-account
6783
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-transfer-margin-between-spot-account-and-usdt-margined-contracts-account
6784
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#transfer-asset-from-spot-trading-account-to-cross-margin-account-cross
6785
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#transfer-asset-from-spot-trading-account-to-isolated-margin-account-isolated
6786
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#transfer-asset-from-cross-margin-account-to-spot-trading-account-cross
6787
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#transfer-asset-from-isolated-margin-account-to-spot-trading-account-isolated
6788
+ * @param {string} code unified currency code
6789
+ * @param {float} amount amount to transfer
6790
+ * @param {string} fromAccount account to transfer from 'spot', 'future', 'swap'
6791
+ * @param {string} toAccount account to transfer to 'spot', 'future', 'swap'
6792
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
6793
+ * @param {string} [params.symbol] used for isolated margin transfer
6794
+ * @param {string} [params.subType] 'linear' or 'inverse', only used when transfering to/from swap accounts
6795
+ * @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
6796
+ */
6775
6797
  async transfer(code, amount, fromAccount, toAccount, params = {}) {
6776
- /**
6777
- * @method
6778
- * @name htx#transfer
6779
- * @description transfer currency internally between wallets on the same account
6780
- * @see https://huobiapi.github.io/docs/dm/v1/en/#transfer-margin-between-spot-account-and-future-account
6781
- * @see https://huobiapi.github.io/docs/spot/v1/en/#transfer-fund-between-spot-account-and-future-contract-account
6782
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-transfer-margin-between-spot-account-and-usdt-margined-contracts-account
6783
- * @see https://huobiapi.github.io/docs/spot/v1/en/#transfer-asset-from-spot-trading-account-to-cross-margin-account-cross
6784
- * @see https://huobiapi.github.io/docs/spot/v1/en/#transfer-asset-from-spot-trading-account-to-isolated-margin-account-isolated
6785
- * @see https://huobiapi.github.io/docs/spot/v1/en/#transfer-asset-from-cross-margin-account-to-spot-trading-account-cross
6786
- * @see https://huobiapi.github.io/docs/spot/v1/en/#transfer-asset-from-isolated-margin-account-to-spot-trading-account-isolated
6787
- * @param {string} code unified currency code
6788
- * @param {float} amount amount to transfer
6789
- * @param {string} fromAccount account to transfer from 'spot', 'future', 'swap'
6790
- * @param {string} toAccount account to transfer to 'spot', 'future', 'swap'
6791
- * @param {object} [params] extra parameters specific to the exchange API endpoint
6792
- * @param {string} [params.symbol] used for isolated margin transfer
6793
- * @param {string} [params.subType] 'linear' or 'inverse', only used when transfering to/from swap accounts
6794
- * @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
6795
- */
6796
6798
  await this.loadMarkets();
6797
6799
  const currency = this.currency(code);
6798
6800
  const request = {
@@ -6868,15 +6870,15 @@ class htx extends htx$1 {
6868
6870
  //
6869
6871
  return this.parseTransfer(response, currency);
6870
6872
  }
6873
+ /**
6874
+ * @method
6875
+ * @name htx#fetchIsolatedBorrowRates
6876
+ * @description fetch the borrow interest rates of all currencies
6877
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#get-loan-interest-rate-and-quota-isolated
6878
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
6879
+ * @returns {object} a list of [isolated borrow rate structures]{@link https://docs.ccxt.com/#/?id=isolated-borrow-rate-structure}
6880
+ */
6871
6881
  async fetchIsolatedBorrowRates(params = {}) {
6872
- /**
6873
- * @method
6874
- * @name htx#fetchIsolatedBorrowRates
6875
- * @description fetch the borrow interest rates of all currencies
6876
- * @see https://huobiapi.github.io/docs/spot/v1/en/#get-loan-interest-rate-and-quota-isolated
6877
- * @param {object} [params] extra parameters specific to the exchange API endpoint
6878
- * @returns {object} a list of [isolated borrow rate structures]{@link https://docs.ccxt.com/#/?id=isolated-borrow-rate-structure}
6879
- */
6880
6882
  await this.loadMarkets();
6881
6883
  const response = await this.spotPrivateGetV1MarginLoanInfo(params);
6882
6884
  //
@@ -6954,20 +6956,20 @@ class htx extends htx$1 {
6954
6956
  'info': info,
6955
6957
  };
6956
6958
  }
6959
+ /**
6960
+ * @method
6961
+ * @name htx#fetchFundingRateHistory
6962
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-historical-funding-rate
6963
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-historical-funding-rate
6964
+ * @description fetches historical funding rate prices
6965
+ * @param {string} symbol unified symbol of the market to fetch the funding rate history for
6966
+ * @param {int} [since] not used by huobi, but filtered internally by ccxt
6967
+ * @param {int} [limit] not used by huobi, but filtered internally by ccxt
6968
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
6969
+ * @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)
6970
+ * @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
6971
+ */
6957
6972
  async fetchFundingRateHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
6958
- /**
6959
- * @method
6960
- * @name htx#fetchFundingRateHistory
6961
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-historical-funding-rate
6962
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-historical-funding-rate
6963
- * @description fetches historical funding rate prices
6964
- * @param {string} symbol unified symbol of the market to fetch the funding rate history for
6965
- * @param {int} [since] not used by huobi, but filtered internally by ccxt
6966
- * @param {int} [limit] not used by huobi, but filtered internally by ccxt
6967
- * @param {object} [params] extra parameters specific to the exchange API endpoint
6968
- * @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)
6969
- * @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
6970
- */
6971
6973
  if (symbol === undefined) {
6972
6974
  throw new errors.ArgumentsRequired(this.id + ' fetchFundingRateHistory() requires a symbol argument');
6973
6975
  }
@@ -7089,17 +7091,17 @@ class htx extends htx$1 {
7089
7091
  };
7090
7092
  return this.safeString(intervals, interval, interval);
7091
7093
  }
7094
+ /**
7095
+ * @method
7096
+ * @name htx#fetchFundingRate
7097
+ * @description fetch the current funding rate
7098
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-funding-rate
7099
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-funding-rate
7100
+ * @param {string} symbol unified market symbol
7101
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
7102
+ * @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
7103
+ */
7092
7104
  async fetchFundingRate(symbol, params = {}) {
7093
- /**
7094
- * @method
7095
- * @name htx#fetchFundingRate
7096
- * @description fetch the current funding rate
7097
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-funding-rate
7098
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-funding-rate
7099
- * @param {string} symbol unified market symbol
7100
- * @param {object} [params] extra parameters specific to the exchange API endpoint
7101
- * @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
7102
- */
7103
7105
  await this.loadMarkets();
7104
7106
  const market = this.market(symbol);
7105
7107
  const request = {
@@ -7133,17 +7135,17 @@ class htx extends htx$1 {
7133
7135
  const result = this.safeValue(response, 'data', {});
7134
7136
  return this.parseFundingRate(result, market);
7135
7137
  }
7138
+ /**
7139
+ * @method
7140
+ * @name htx#fetchFundingRates
7141
+ * @description fetch the funding rate for multiple markets
7142
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-a-batch-of-funding-rate
7143
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-a-batch-of-funding-rate
7144
+ * @param {string[]|undefined} symbols list of unified market symbols
7145
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
7146
+ * @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rates-structure}, indexed by market symbols
7147
+ */
7136
7148
  async fetchFundingRates(symbols = undefined, params = {}) {
7137
- /**
7138
- * @method
7139
- * @name htx#fetchFundingRates
7140
- * @description fetch the funding rate for multiple markets
7141
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-a-batch-of-funding-rate
7142
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-a-batch-of-funding-rate
7143
- * @param {string[]|undefined} symbols list of unified market symbols
7144
- * @param {object} [params] extra parameters specific to the exchange API endpoint
7145
- * @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rates-structure}, indexed by market symbols
7146
- */
7147
7149
  await this.loadMarkets();
7148
7150
  symbols = this.marketSymbols(symbols);
7149
7151
  const options = this.safeValue(this.options, 'fetchFundingRates', {});
@@ -7186,20 +7188,20 @@ class htx extends htx$1 {
7186
7188
  const result = this.parseFundingRates(data);
7187
7189
  return this.filterByArray(result, 'symbol', symbols);
7188
7190
  }
7191
+ /**
7192
+ * @method
7193
+ * @name htx#fetchBorrowInterest
7194
+ * @description fetch the interest owed by the user for borrowing currency for margin trading
7195
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#search-past-margin-orders-cross
7196
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#search-past-margin-orders-isolated
7197
+ * @param {string} code unified currency code
7198
+ * @param {string} symbol unified market symbol when fetch interest in isolated markets
7199
+ * @param {int} [since] the earliest time in ms to fetch borrrow interest for
7200
+ * @param {int} [limit] the maximum number of structures to retrieve
7201
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
7202
+ * @returns {object[]} a list of [borrow interest structures]{@link https://docs.ccxt.com/#/?id=borrow-interest-structure}
7203
+ */
7189
7204
  async fetchBorrowInterest(code = undefined, symbol = undefined, since = undefined, limit = undefined, params = {}) {
7190
- /**
7191
- * @method
7192
- * @name htx#fetchBorrowInterest
7193
- * @description fetch the interest owed by the user for borrowing currency for margin trading
7194
- * @see https://huobiapi.github.io/docs/spot/v1/en/#search-past-margin-orders-cross
7195
- * @see https://huobiapi.github.io/docs/spot/v1/en/#search-past-margin-orders-isolated
7196
- * @param {string} code unified currency code
7197
- * @param {string} symbol unified market symbol when fetch interest in isolated markets
7198
- * @param {int} [since] the earliest time in ms to fetch borrrow interest for
7199
- * @param {int} [limit] the maximum number of structures to retrieve
7200
- * @param {object} [params] extra parameters specific to the exchange API endpoint
7201
- * @returns {object[]} a list of [borrow interest structures]{@link https://docs.ccxt.com/#/?id=borrow-interest-structure}
7202
- */
7203
7205
  await this.loadMarkets();
7204
7206
  let marginMode = undefined;
7205
7207
  [marginMode, params] = this.handleMarginModeAndParams('fetchBorrowInterest', params);
@@ -7471,20 +7473,20 @@ class htx extends htx$1 {
7471
7473
  }
7472
7474
  return undefined;
7473
7475
  }
7476
+ /**
7477
+ * @method
7478
+ * @name htx#fetchFundingHistory
7479
+ * @description fetch the history of funding payments paid and received on this account
7480
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-account-financial-records-via-multiple-fields-new // linear swaps
7481
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#query-financial-records-via-multiple-fields-new // coin-m futures
7482
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-financial-records-via-multiple-fields-new // coin-m swaps
7483
+ * @param {string} symbol unified market symbol
7484
+ * @param {int} [since] the earliest time in ms to fetch funding history for
7485
+ * @param {int} [limit] the maximum number of funding history structures to retrieve
7486
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
7487
+ * @returns {object} a [funding history structure]{@link https://docs.ccxt.com/#/?id=funding-history-structure}
7488
+ */
7474
7489
  async fetchFundingHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
7475
- /**
7476
- * @method
7477
- * @name htx#fetchFundingHistory
7478
- * @description fetch the history of funding payments paid and received on this account
7479
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-account-financial-records-via-multiple-fields-new // linear swaps
7480
- * @see https://huobiapi.github.io/docs/dm/v1/en/#query-financial-records-via-multiple-fields-new // coin-m futures
7481
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-financial-records-via-multiple-fields-new // coin-m swaps
7482
- * @param {string} symbol unified market symbol
7483
- * @param {int} [since] the earliest time in ms to fetch funding history for
7484
- * @param {int} [limit] the maximum number of funding history structures to retrieve
7485
- * @param {object} [params] extra parameters specific to the exchange API endpoint
7486
- * @returns {object} a [funding history structure]{@link https://docs.ccxt.com/#/?id=funding-history-structure}
7487
- */
7488
7490
  await this.loadMarkets();
7489
7491
  const market = this.market(symbol);
7490
7492
  const [marketType, query] = this.handleMarketTypeAndParams('fetchFundingHistory', market, params);
@@ -7562,20 +7564,20 @@ class htx extends htx$1 {
7562
7564
  const data = this.safeList(response, 'data', []);
7563
7565
  return this.parseIncomes(data, market, since, limit);
7564
7566
  }
7567
+ /**
7568
+ * @method
7569
+ * @name htx#setLeverage
7570
+ * @description set the level of leverage for a market
7571
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-switch-leverage
7572
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-switch-leverage
7573
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#switch-leverage
7574
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#switch-leverage // Coin-m futures
7575
+ * @param {float} leverage the rate of leverage
7576
+ * @param {string} symbol unified market symbol
7577
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
7578
+ * @returns {object} response from the exchange
7579
+ */
7565
7580
  async setLeverage(leverage, symbol = undefined, params = {}) {
7566
- /**
7567
- * @method
7568
- * @name htx#setLeverage
7569
- * @description set the level of leverage for a market
7570
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-switch-leverage
7571
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-switch-leverage
7572
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#switch-leverage
7573
- * @see https://huobiapi.github.io/docs/dm/v1/en/#switch-leverage // Coin-m futures
7574
- * @param {float} leverage the rate of leverage
7575
- * @param {string} symbol unified market symbol
7576
- * @param {object} [params] extra parameters specific to the exchange API endpoint
7577
- * @returns {object} response from the exchange
7578
- */
7579
7581
  if (symbol === undefined) {
7580
7582
  throw new errors.ArgumentsRequired(this.id + ' setLeverage() requires a symbol argument');
7581
7583
  }
@@ -7766,22 +7768,22 @@ class htx extends htx$1 {
7766
7768
  'takeProfitPrice': undefined,
7767
7769
  });
7768
7770
  }
7771
+ /**
7772
+ * @method
7773
+ * @name htx#fetchPositions
7774
+ * @description fetch all open positions
7775
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-query-user-39-s-position-information
7776
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-query-user-s-position-information
7777
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-user-s-position-information
7778
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#query-user-s-position-information
7779
+ * @param {string[]} [symbols] list of unified market symbols
7780
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
7781
+ * @param {string} [params.subType] 'linear' or 'inverse'
7782
+ * @param {string} [params.type] *inverse only* 'future', or 'swap'
7783
+ * @param {string} [params.marginMode] *linear only* 'cross' or 'isolated'
7784
+ * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
7785
+ */
7769
7786
  async fetchPositions(symbols = undefined, params = {}) {
7770
- /**
7771
- * @method
7772
- * @name htx#fetchPositions
7773
- * @description fetch all open positions
7774
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-query-user-39-s-position-information
7775
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-query-user-s-position-information
7776
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-user-s-position-information
7777
- * @see https://huobiapi.github.io/docs/dm/v1/en/#query-user-s-position-information
7778
- * @param {string[]} [symbols] list of unified market symbols
7779
- * @param {object} [params] extra parameters specific to the exchange API endpoint
7780
- * @param {string} [params.subType] 'linear' or 'inverse'
7781
- * @param {string} [params.type] *inverse only* 'future', or 'swap'
7782
- * @param {string} [params.marginMode] *linear only* 'cross' or 'isolated'
7783
- * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
7784
- */
7785
7787
  await this.loadMarkets();
7786
7788
  symbols = this.marketSymbols(symbols);
7787
7789
  let market = undefined;
@@ -7914,19 +7916,19 @@ class htx extends htx$1 {
7914
7916
  }
7915
7917
  return this.filterByArrayPositions(result, 'symbol', symbols, false);
7916
7918
  }
7919
+ /**
7920
+ * @method
7921
+ * @name htx#fetchPosition
7922
+ * @description fetch data on a single open contract trade position
7923
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-query-assets-and-positions
7924
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-query-assets-and-positions
7925
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-assets-and-positions
7926
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#query-assets-and-positions
7927
+ * @param {string} symbol unified market symbol of the market the position is held in, default is undefined
7928
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
7929
+ * @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
7930
+ */
7917
7931
  async fetchPosition(symbol, params = {}) {
7918
- /**
7919
- * @method
7920
- * @name htx#fetchPosition
7921
- * @description fetch data on a single open contract trade position
7922
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-query-assets-and-positions
7923
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-query-assets-and-positions
7924
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-assets-and-positions
7925
- * @see https://huobiapi.github.io/docs/dm/v1/en/#query-assets-and-positions
7926
- * @param {string} symbol unified market symbol of the market the position is held in, default is undefined
7927
- * @param {object} [params] extra parameters specific to the exchange API endpoint
7928
- * @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
7929
- */
7930
7932
  await this.loadMarkets();
7931
7933
  const market = this.market(symbol);
7932
7934
  let marginMode = undefined;
@@ -8239,20 +8241,20 @@ class htx extends htx$1 {
8239
8241
  'fee': undefined,
8240
8242
  }, currency);
8241
8243
  }
8244
+ /**
8245
+ * @method
8246
+ * @name htx#fetchLedger
8247
+ * @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
8248
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#get-account-history
8249
+ * @param {string} [code] unified currency code, default is undefined
8250
+ * @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
8251
+ * @param {int} [limit] max number of ledger entries to return, default is undefined
8252
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
8253
+ * @param {int} [params.until] the latest time in ms to fetch entries for
8254
+ * @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)
8255
+ * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
8256
+ */
8242
8257
  async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
8243
- /**
8244
- * @method
8245
- * @name htx#fetchLedger
8246
- * @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
8247
- * @see https://huobiapi.github.io/docs/spot/v1/en/#get-account-history
8248
- * @param {string} [code] unified currency code, default is undefined
8249
- * @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
8250
- * @param {int} [limit] max number of ledger entries to return, default is undefined
8251
- * @param {object} [params] extra parameters specific to the exchange API endpoint
8252
- * @param {int} [params.until] the latest time in ms to fetch entries for
8253
- * @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)
8254
- * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
8255
- */
8256
8258
  await this.loadMarkets();
8257
8259
  let paginate = false;
8258
8260
  [paginate, params] = this.handleOptionAndParams(params, 'fetchLedger', 'paginate');
@@ -8318,15 +8320,15 @@ class htx extends htx$1 {
8318
8320
  const data = this.safeValue(response, 'data', []);
8319
8321
  return this.parseLedger(data, currency, since, limit);
8320
8322
  }
8323
+ /**
8324
+ * @method
8325
+ * @name htx#fetchLeverageTiers
8326
+ * @description retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
8327
+ * @param {string[]|undefined} symbols list of unified market symbols
8328
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
8329
+ * @returns {object} a dictionary of [leverage tiers structures]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}, indexed by market symbols
8330
+ */
8321
8331
  async fetchLeverageTiers(symbols = undefined, params = {}) {
8322
- /**
8323
- * @method
8324
- * @name htx#fetchLeverageTiers
8325
- * @description retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
8326
- * @param {string[]|undefined} symbols list of unified market symbols
8327
- * @param {object} [params] extra parameters specific to the exchange API endpoint
8328
- * @returns {object} a dictionary of [leverage tiers structures]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}, indexed by market symbols
8329
- */
8330
8332
  await this.loadMarkets();
8331
8333
  const response = await this.contractPublicGetLinearSwapApiV1SwapAdjustfactor(params);
8332
8334
  //
@@ -8358,111 +8360,52 @@ class htx extends htx$1 {
8358
8360
  // ]
8359
8361
  // }
8360
8362
  //
8361
- const data = this.safeList(response, 'data');
8363
+ const data = this.safeList(response, 'data', []);
8362
8364
  return this.parseLeverageTiers(data, symbols, 'contract_code');
8363
8365
  }
8364
- async fetchMarketLeverageTiers(symbol, params = {}) {
8365
- /**
8366
- * @method
8367
- * @name htx#fetchMarketLeverageTiers
8368
- * @description retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes for a single market
8369
- * @param {string} symbol unified market symbol
8370
- * @param {object} [params] extra parameters specific to the exchange API endpoint
8371
- * @returns {object} a [leverage tiers structure]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}
8372
- */
8373
- await this.loadMarkets();
8374
- const request = {};
8375
- if (symbol !== undefined) {
8376
- const market = this.market(symbol);
8377
- if (!market['contract']) {
8378
- throw new errors.BadRequest(this.id + ' fetchMarketLeverageTiers() symbol supports contract markets only');
8379
- }
8380
- request['contract_code'] = market['id'];
8381
- }
8382
- const response = await this.contractPublicGetLinearSwapApiV1SwapAdjustfactor(this.extend(request, params));
8383
- //
8384
- // {
8385
- // "status": "ok",
8386
- // "data": [
8387
- // {
8388
- // "symbol": "MANA",
8389
- // "contract_code": "MANA-USDT",
8390
- // "margin_mode": "isolated",
8391
- // "trade_partition": "USDT",
8392
- // "list": [
8393
- // {
8394
- // "lever_rate": 75,
8395
- // "ladders": [
8396
- // {
8397
- // "ladder": 0,
8398
- // "min_size": 0,
8399
- // "max_size": 999,
8400
- // "adjust_factor": 0.7
8401
- // },
8402
- // ...
8403
- // ]
8404
- // }
8405
- // ...
8406
- // ]
8407
- // },
8408
- // ...
8409
- // ]
8410
- // }
8411
- //
8412
- const data = this.safeValue(response, 'data');
8413
- const tiers = this.parseLeverageTiers(data, [symbol], 'contract_code');
8414
- return this.safeValue(tiers, symbol);
8415
- }
8416
- parseLeverageTiers(response, symbols = undefined, marketIdKey = undefined) {
8417
- const result = {};
8418
- for (let i = 0; i < response.length; i++) {
8419
- const item = response[i];
8420
- const list = this.safeValue(item, 'list', []);
8421
- const tiers = [];
8422
- const currency = this.safeString(item, 'trade_partition');
8423
- const id = this.safeString(item, marketIdKey);
8424
- const symbol = this.safeSymbol(id);
8425
- if (this.inArray(symbol, symbols)) {
8426
- for (let j = 0; j < list.length; j++) {
8427
- const obj = list[j];
8428
- const leverage = this.safeString(obj, 'lever_rate');
8429
- const ladders = this.safeValue(obj, 'ladders', []);
8430
- for (let k = 0; k < ladders.length; k++) {
8431
- const bracket = ladders[k];
8432
- const adjustFactor = this.safeString(bracket, 'adjust_factor');
8433
- tiers.push({
8434
- 'tier': this.safeInteger(bracket, 'ladder'),
8435
- 'currency': this.safeCurrencyCode(currency),
8436
- 'minNotional': this.safeNumber(bracket, 'min_size'),
8437
- 'maxNotional': this.safeNumber(bracket, 'max_size'),
8438
- 'maintenanceMarginRate': this.parseNumber(Precise["default"].stringDiv(adjustFactor, leverage)),
8439
- 'maxLeverage': this.parseNumber(leverage),
8440
- 'info': bracket,
8441
- });
8442
- }
8443
- }
8444
- result[symbol] = tiers;
8445
- }
8446
- }
8447
- return result;
8366
+ parseMarketLeverageTiers(info, market = undefined) {
8367
+ const currencyId = this.safeString(info, 'trade_partition');
8368
+ const marketId = this.safeString(info, 'contract_code');
8369
+ const tiers = [];
8370
+ const brackets = this.safeList(info, 'list', []);
8371
+ for (let i = 0; i < brackets.length; i++) {
8372
+ const item = brackets[i];
8373
+ const leverage = this.safeString(item, 'lever_rate');
8374
+ const ladders = this.safeList(item, 'ladders', []);
8375
+ for (let k = 0; k < ladders.length; k++) {
8376
+ const bracket = ladders[k];
8377
+ const adjustFactor = this.safeString(bracket, 'adjust_factor');
8378
+ tiers.push({
8379
+ 'tier': this.safeInteger(bracket, 'ladder'),
8380
+ 'symbol': this.safeSymbol(marketId, market, undefined, 'swap'),
8381
+ 'currency': this.safeCurrencyCode(currencyId),
8382
+ 'minNotional': this.safeNumber(bracket, 'min_size'),
8383
+ 'maxNotional': this.safeNumber(bracket, 'max_size'),
8384
+ 'maintenanceMarginRate': this.parseNumber(Precise["default"].stringDiv(adjustFactor, leverage)),
8385
+ 'maxLeverage': this.parseNumber(leverage),
8386
+ 'info': bracket,
8387
+ });
8388
+ }
8389
+ }
8390
+ return tiers;
8448
8391
  }
8392
+ /**
8393
+ * @method
8394
+ * @name htx#fetchOpenInterestHistory
8395
+ * @description Retrieves the open interest history of a currency
8396
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#query-information-on-open-interest
8397
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-information-on-open-interest
8398
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-information-on-open-interest
8399
+ * @param {string} symbol Unified CCXT market symbol
8400
+ * @param {string} timeframe '1h', '4h', '12h', or '1d'
8401
+ * @param {int} [since] Not used by huobi api, but response parsed by CCXT
8402
+ * @param {int} [limit] Default:48,Data Range [1,200]
8403
+ * @param {object} [params] Exchange specific parameters
8404
+ * @param {int} [params.amount_type] *required* Open interest unit. 1-cont,2-cryptocurrency
8405
+ * @param {int} [params.pair] eg BTC-USDT *Only for USDT-M*
8406
+ * @returns {object} an array of [open interest structures]{@link https://docs.ccxt.com/#/?id=open-interest-structure}
8407
+ */
8449
8408
  async fetchOpenInterestHistory(symbol, timeframe = '1h', since = undefined, limit = undefined, params = {}) {
8450
- /**
8451
- * @method
8452
- * @name htx#fetchOpenInterestHistory
8453
- * @description Retrieves the open interest history of a currency
8454
- * @see https://huobiapi.github.io/docs/dm/v1/en/#query-information-on-open-interest
8455
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-information-on-open-interest
8456
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-information-on-open-interest
8457
- * @param {string} symbol Unified CCXT market symbol
8458
- * @param {string} timeframe '1h', '4h', '12h', or '1d'
8459
- * @param {int} [since] Not used by huobi api, but response parsed by CCXT
8460
- * @param {int} [limit] Default:48,Data Range [1,200]
8461
- * @param {object} [params] Exchange specific parameters
8462
- * @param {int} [params.amount_type] *required* Open interest unit. 1-cont,2-cryptocurrency
8463
- * @param {int} [params.pair] eg BTC-USDT *Only for USDT-M*
8464
- * @returns {object} an array of [open interest structures]{@link https://docs.ccxt.com/#/?id=open-interest-structure}
8465
- */
8466
8409
  if (timeframe !== '1h' && timeframe !== '4h' && timeframe !== '12h' && timeframe !== '1d') {
8467
8410
  throw new errors.BadRequest(this.id + ' fetchOpenInterestHistory cannot only use the 1h, 4h, 12h and 1d timeframe');
8468
8411
  }
@@ -8565,18 +8508,18 @@ class htx extends htx$1 {
8565
8508
  const tick = this.safeList(data, 'tick');
8566
8509
  return this.parseOpenInterests(tick, market, since, limit);
8567
8510
  }
8511
+ /**
8512
+ * @method
8513
+ * @name htx#fetchOpenInterest
8514
+ * @description Retrieves the open interest of a currency
8515
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#get-contract-open-interest-information
8516
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-swap-open-interest-information
8517
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-get-swap-open-interest-information
8518
+ * @param {string} symbol Unified CCXT market symbol
8519
+ * @param {object} [params] exchange specific parameters
8520
+ * @returns {object} an open interest structure{@link https://docs.ccxt.com/#/?id=open-interest-structure}
8521
+ */
8568
8522
  async fetchOpenInterest(symbol, params = {}) {
8569
- /**
8570
- * @method
8571
- * @name htx#fetchOpenInterest
8572
- * @description Retrieves the open interest of a currency
8573
- * @see https://huobiapi.github.io/docs/dm/v1/en/#get-contract-open-interest-information
8574
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-swap-open-interest-information
8575
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-get-swap-open-interest-information
8576
- * @param {string} symbol Unified CCXT market symbol
8577
- * @param {object} [params] exchange specific parameters
8578
- * @returns {object} an open interest structure{@link https://docs.ccxt.com/#/?id=open-interest-structure}
8579
- */
8580
8523
  await this.loadMarkets();
8581
8524
  const market = this.market(symbol);
8582
8525
  if (!market['contract']) {
@@ -8739,19 +8682,19 @@ class htx extends htx$1 {
8739
8682
  'info': interest,
8740
8683
  }, market);
8741
8684
  }
8685
+ /**
8686
+ * @method
8687
+ * @name htx#borrowIsolatedMargin
8688
+ * @description create a loan to borrow margin
8689
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#request-a-margin-loan-isolated
8690
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#request-a-margin-loan-cross
8691
+ * @param {string} symbol unified market symbol, required for isolated margin
8692
+ * @param {string} code unified currency code of the currency to borrow
8693
+ * @param {float} amount the amount to borrow
8694
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
8695
+ * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
8696
+ */
8742
8697
  async borrowIsolatedMargin(symbol, code, amount, params = {}) {
8743
- /**
8744
- * @method
8745
- * @name htx#borrowIsolatedMargin
8746
- * @description create a loan to borrow margin
8747
- * @see https://huobiapi.github.io/docs/spot/v1/en/#request-a-margin-loan-isolated
8748
- * @see https://huobiapi.github.io/docs/spot/v1/en/#request-a-margin-loan-cross
8749
- * @param {string} symbol unified market symbol, required for isolated margin
8750
- * @param {string} code unified currency code of the currency to borrow
8751
- * @param {float} amount the amount to borrow
8752
- * @param {object} [params] extra parameters specific to the exchange API endpoint
8753
- * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
8754
- */
8755
8698
  await this.loadMarkets();
8756
8699
  const currency = this.currency(code);
8757
8700
  const market = this.market(symbol);
@@ -8774,18 +8717,18 @@ class htx extends htx$1 {
8774
8717
  'symbol': symbol,
8775
8718
  });
8776
8719
  }
8720
+ /**
8721
+ * @method
8722
+ * @name htx#borrowCrossMargin
8723
+ * @description create a loan to borrow margin
8724
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#request-a-margin-loan-isolated
8725
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#request-a-margin-loan-cross
8726
+ * @param {string} code unified currency code of the currency to borrow
8727
+ * @param {float} amount the amount to borrow
8728
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
8729
+ * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
8730
+ */
8777
8731
  async borrowCrossMargin(code, amount, params = {}) {
8778
- /**
8779
- * @method
8780
- * @name htx#borrowCrossMargin
8781
- * @description create a loan to borrow margin
8782
- * @see https://huobiapi.github.io/docs/spot/v1/en/#request-a-margin-loan-isolated
8783
- * @see https://huobiapi.github.io/docs/spot/v1/en/#request-a-margin-loan-cross
8784
- * @param {string} code unified currency code of the currency to borrow
8785
- * @param {float} amount the amount to borrow
8786
- * @param {object} [params] extra parameters specific to the exchange API endpoint
8787
- * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
8788
- */
8789
8732
  await this.loadMarkets();
8790
8733
  const currency = this.currency(code);
8791
8734
  const request = {
@@ -8806,18 +8749,18 @@ class htx extends htx$1 {
8806
8749
  'amount': amount,
8807
8750
  });
8808
8751
  }
8752
+ /**
8753
+ * @method
8754
+ * @name htx#repayIsolatedMargin
8755
+ * @description repay borrowed margin and interest
8756
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#repay-margin-loan-cross-isolated
8757
+ * @param {string} symbol unified market symbol
8758
+ * @param {string} code unified currency code of the currency to repay
8759
+ * @param {float} amount the amount to repay
8760
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
8761
+ * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
8762
+ */
8809
8763
  async repayIsolatedMargin(symbol, code, amount, params = {}) {
8810
- /**
8811
- * @method
8812
- * @name htx#repayIsolatedMargin
8813
- * @description repay borrowed margin and interest
8814
- * @see https://huobiapi.github.io/docs/spot/v1/en/#repay-margin-loan-cross-isolated
8815
- * @param {string} code unified currency code of the currency to repay
8816
- * @param {float} amount the amount to repay
8817
- * @param {string} symbol unified market symbol
8818
- * @param {object} [params] extra parameters specific to the exchange API endpoint
8819
- * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
8820
- */
8821
8764
  await this.loadMarkets();
8822
8765
  const currency = this.currency(code);
8823
8766
  const accountId = await this.fetchAccountIdByType('spot', 'isolated', symbol, params);
@@ -8846,17 +8789,17 @@ class htx extends htx$1 {
8846
8789
  'symbol': symbol,
8847
8790
  });
8848
8791
  }
8792
+ /**
8793
+ * @method
8794
+ * @name htx#repayCrossMargin
8795
+ * @description repay borrowed margin and interest
8796
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#repay-margin-loan-cross-isolated
8797
+ * @param {string} code unified currency code of the currency to repay
8798
+ * @param {float} amount the amount to repay
8799
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
8800
+ * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
8801
+ */
8849
8802
  async repayCrossMargin(code, amount, params = {}) {
8850
- /**
8851
- * @method
8852
- * @name htx#repayCrossMargin
8853
- * @description repay borrowed margin and interest
8854
- * @see https://huobiapi.github.io/docs/spot/v1/en/#repay-margin-loan-cross-isolated
8855
- * @param {string} code unified currency code of the currency to repay
8856
- * @param {float} amount the amount to repay
8857
- * @param {object} [params] extra parameters specific to the exchange API endpoint
8858
- * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
8859
- */
8860
8803
  await this.loadMarkets();
8861
8804
  const currency = this.currency(code);
8862
8805
  const accountId = await this.fetchAccountIdByType('spot', 'cross', undefined, params);
@@ -8917,23 +8860,23 @@ class htx extends htx$1 {
8917
8860
  'info': info,
8918
8861
  };
8919
8862
  }
8863
+ /**
8864
+ * @method
8865
+ * @name htx#fetchSettlementHistory
8866
+ * @description Fetches historical settlement records
8867
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#query-historical-settlement-records-of-the-platform-interface
8868
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-historical-settlement-records-of-the-platform-interface
8869
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-historical-settlement-records-of-the-platform-interface
8870
+ * @param {string} symbol unified symbol of the market to fetch the settlement history for
8871
+ * @param {int} [since] timestamp in ms, value range = current time - 90 days,default = current time - 90 days
8872
+ * @param {int} [limit] page items, default 20, shall not exceed 50
8873
+ * @param {object} [params] exchange specific params
8874
+ * @param {int} [params.until] timestamp in ms, value range = start_time -> current time,default = current time
8875
+ * @param {int} [params.page_index] page index, default page 1 if not filled
8876
+ * @param {int} [params.code] unified currency code, can be used when symbol is undefined
8877
+ * @returns {object[]} a list of [settlement history objects]{@link https://docs.ccxt.com/#/?id=settlement-history-structure}
8878
+ */
8920
8879
  async fetchSettlementHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
8921
- /**
8922
- * @method
8923
- * @name htx#fetchSettlementHistory
8924
- * @description Fetches historical settlement records
8925
- * @see https://huobiapi.github.io/docs/dm/v1/en/#query-historical-settlement-records-of-the-platform-interface
8926
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-historical-settlement-records-of-the-platform-interface
8927
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-historical-settlement-records-of-the-platform-interface
8928
- * @param {string} symbol unified symbol of the market to fetch the settlement history for
8929
- * @param {int} [since] timestamp in ms, value range = current time - 90 days,default = current time - 90 days
8930
- * @param {int} [limit] page items, default 20, shall not exceed 50
8931
- * @param {object} [params] exchange specific params
8932
- * @param {int} [params.until] timestamp in ms, value range = start_time -> current time,default = current time
8933
- * @param {int} [params.page_index] page index, default page 1 if not filled
8934
- * @param {int} [params.code] unified currency code, can be used when symbol is undefined
8935
- * @returns {object[]} a list of [settlement history objects]{@link https://docs.ccxt.com/#/?id=settlement-history-structure}
8936
- */
8937
8880
  if (symbol === undefined) {
8938
8881
  throw new errors.ArgumentsRequired(this.id + ' fetchSettlementHistory() requires a symbol argument');
8939
8882
  }
@@ -9025,16 +8968,16 @@ class htx extends htx$1 {
9025
8968
  const settlements = this.parseSettlements(settlementRecord, market);
9026
8969
  return this.sortBy(settlements, 'timestamp');
9027
8970
  }
8971
+ /**
8972
+ * @method
8973
+ * @name htx#fetchDepositWithdrawFees
8974
+ * @description fetch deposit and withdraw fees
8975
+ * @see https://huobiapi.github.io/docs/spot/v1/en/#get-all-supported-currencies-v2
8976
+ * @param {string[]|undefined} codes list of unified currency codes
8977
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
8978
+ * @returns {object[]} a list of [fees structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
8979
+ */
9028
8980
  async fetchDepositWithdrawFees(codes = undefined, params = {}) {
9029
- /**
9030
- * @method
9031
- * @name htx#fetchDepositWithdrawFees
9032
- * @description fetch deposit and withdraw fees
9033
- * @see https://huobiapi.github.io/docs/spot/v1/en/#get-all-supported-currencies-v2
9034
- * @param {string[]|undefined} codes list of unified currency codes
9035
- * @param {object} [params] extra parameters specific to the exchange API endpoint
9036
- * @returns {object[]} a list of [fees structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
9037
- */
9038
8981
  await this.loadMarkets();
9039
8982
  const response = await this.spotPublicGetV2ReferenceCurrencies(params);
9040
8983
  //
@@ -9235,22 +9178,22 @@ class htx extends htx$1 {
9235
9178
  'datetime': this.iso8601(timestamp),
9236
9179
  };
9237
9180
  }
9181
+ /**
9182
+ * @method
9183
+ * @name htx#fetchLiquidations
9184
+ * @description retrieves the public liquidations of a trading pair
9185
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-liquidation-orders-new
9186
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-liquidation-orders-new
9187
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#query-liquidation-order-information-new
9188
+ * @param {string} symbol unified CCXT market symbol
9189
+ * @param {int} [since] the earliest time in ms to fetch liquidations for
9190
+ * @param {int} [limit] the maximum number of liquidation structures to retrieve
9191
+ * @param {object} [params] exchange specific parameters for the huobi api endpoint
9192
+ * @param {int} [params.until] timestamp in ms of the latest liquidation
9193
+ * @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
9194
+ * @returns {object} an array of [liquidation structures]{@link https://docs.ccxt.com/#/?id=liquidation-structure}
9195
+ */
9238
9196
  async fetchLiquidations(symbol, since = undefined, limit = undefined, params = {}) {
9239
- /**
9240
- * @method
9241
- * @name htx#fetchLiquidations
9242
- * @description retrieves the public liquidations of a trading pair
9243
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-liquidation-orders-new
9244
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-liquidation-orders-new
9245
- * @see https://huobiapi.github.io/docs/dm/v1/en/#query-liquidation-order-information-new
9246
- * @param {string} symbol unified CCXT market symbol
9247
- * @param {int} [since] the earliest time in ms to fetch liquidations for
9248
- * @param {int} [limit] the maximum number of liquidation structures to retrieve
9249
- * @param {object} [params] exchange specific parameters for the huobi api endpoint
9250
- * @param {int} [params.until] timestamp in ms of the latest liquidation
9251
- * @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
9252
- * @returns {object} an array of [liquidation structures]{@link https://docs.ccxt.com/#/?id=liquidation-structure}
9253
- */
9254
9197
  await this.loadMarkets();
9255
9198
  const market = this.market(symbol);
9256
9199
  const tradeType = this.safeInteger(params, 'trade_type', 0);
@@ -9335,26 +9278,26 @@ class htx extends htx$1 {
9335
9278
  'datetime': this.iso8601(timestamp),
9336
9279
  });
9337
9280
  }
9281
+ /**
9282
+ * @method
9283
+ * @name htx#closePositions
9284
+ * @description closes open positions for a contract market, requires 'amount' in params, unlike other exchanges
9285
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-place-lightning-close-order // USDT-M (isolated)
9286
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-place-lightning-close-position // USDT-M (cross)
9287
+ * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#place-lightning-close-order // Coin-M swap
9288
+ * @see https://huobiapi.github.io/docs/dm/v1/en/#place-flash-close-order // Coin-M futures
9289
+ * @param {string} symbol unified CCXT market symbol
9290
+ * @param {string} side 'buy' or 'sell', the side of the closing order, opposite side as position side
9291
+ * @param {object} [params] extra parameters specific to the okx api endpoint
9292
+ * @param {string} [params.clientOrderId] client needs to provide unique API and have to maintain the API themselves afterwards. [1, 9223372036854775807]
9293
+ * @param {object} [params.marginMode] 'cross' or 'isolated', required for linear markets
9294
+ *
9295
+ * EXCHANGE SPECIFIC PARAMETERS
9296
+ * @param {number} [params.amount] order quantity
9297
+ * @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
9298
+ * @returns {object} [an order structure]{@link https://docs.ccxt.com/#/?id=position-structure}
9299
+ */
9338
9300
  async closePosition(symbol, side = undefined, params = {}) {
9339
- /**
9340
- * @method
9341
- * @name htx#closePositions
9342
- * @description closes open positions for a contract market, requires 'amount' in params, unlike other exchanges
9343
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-place-lightning-close-order // USDT-M (isolated)
9344
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-place-lightning-close-position // USDT-M (cross)
9345
- * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#place-lightning-close-order // Coin-M swap
9346
- * @see https://huobiapi.github.io/docs/dm/v1/en/#place-flash-close-order // Coin-M futures
9347
- * @param {string} symbol unified CCXT market symbol
9348
- * @param {string} side 'buy' or 'sell', the side of the closing order, opposite side as position side
9349
- * @param {object} [params] extra parameters specific to the okx api endpoint
9350
- * @param {string} [params.clientOrderId] client needs to provide unique API and have to maintain the API themselves afterwards. [1, 9223372036854775807]
9351
- * @param {object} [params.marginMode] 'cross' or 'isolated', required for linear markets
9352
- *
9353
- * EXCHANGE SPECIFIC PARAMETERS
9354
- * @param {number} [params.amount] order quantity
9355
- * @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
9356
- * @returns {object} [an order structure]{@link https://docs.ccxt.com/#/?id=position-structure}
9357
- */
9358
9301
  await this.loadMarkets();
9359
9302
  const market = this.market(symbol);
9360
9303
  const clientOrderId = this.safeString(params, 'clientOrderId');
@@ -9398,19 +9341,19 @@ class htx extends htx$1 {
9398
9341
  }
9399
9342
  return this.parseOrder(response, market);
9400
9343
  }
9344
+ /**
9345
+ * @method
9346
+ * @name htx#setPositionMode
9347
+ * @description set hedged to true or false
9348
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-switch-position-mode
9349
+ * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-switch-position-mode
9350
+ * @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
9351
+ * @param {string} [symbol] unified market symbol, required for isolated margin mode
9352
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
9353
+ * @param {string} [params.marginMode] "cross" (default) or "isolated"
9354
+ * @returns {object} response from the exchange
9355
+ */
9401
9356
  async setPositionMode(hedged, symbol = undefined, params = {}) {
9402
- /**
9403
- * @method
9404
- * @name htx#setPositionMode
9405
- * @description set hedged to true or false
9406
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-switch-position-mode
9407
- * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-switch-position-mode
9408
- * @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
9409
- * @param {string} [symbol] unified market symbol, required for isolated margin mode
9410
- * @param {object} [params] extra parameters specific to the exchange API endpoint
9411
- * @param {string} [params.marginMode] "cross" (default) or "isolated"
9412
- * @returns {object} response from the exchange
9413
- */
9414
9357
  await this.loadMarkets();
9415
9358
  const posMode = hedged ? 'dual_side' : 'single_side';
9416
9359
  let market = undefined;