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
@@ -571,6 +571,8 @@ class kucoin extends kucoin$1 {
571
571
  '400303': errors.PermissionDenied,
572
572
  '500000': errors.ExchangeNotAvailable,
573
573
  '260220': errors.InvalidAddress,
574
+ '600100': errors.InsufficientFunds,
575
+ '600101': errors.InvalidOrder,
574
576
  '900014': errors.BadRequest, // {"code":"900014","msg":"Invalid chainId"}
575
577
  },
576
578
  'broad': {
@@ -986,15 +988,15 @@ class kucoin extends kucoin$1 {
986
988
  nonce() {
987
989
  return this.milliseconds();
988
990
  }
991
+ /**
992
+ * @method
993
+ * @name kucoin#fetchTime
994
+ * @description fetches the current integer timestamp in milliseconds from the exchange server
995
+ * @see https://docs.kucoin.com/#server-time
996
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
997
+ * @returns {int} the current integer timestamp in milliseconds from the exchange server
998
+ */
989
999
  async fetchTime(params = {}) {
990
- /**
991
- * @method
992
- * @name kucoin#fetchTime
993
- * @description fetches the current integer timestamp in milliseconds from the exchange server
994
- * @see https://docs.kucoin.com/#server-time
995
- * @param {object} [params] extra parameters specific to the exchange API endpoint
996
- * @returns {int} the current integer timestamp in milliseconds from the exchange server
997
- */
998
1000
  const response = await this.publicGetTimestamp(params);
999
1001
  //
1000
1002
  // {
@@ -1005,15 +1007,15 @@ class kucoin extends kucoin$1 {
1005
1007
  //
1006
1008
  return this.safeInteger(response, 'data');
1007
1009
  }
1010
+ /**
1011
+ * @method
1012
+ * @name kucoin#fetchStatus
1013
+ * @description the latest known information on the availability of the exchange API
1014
+ * @see https://docs.kucoin.com/#service-status
1015
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1016
+ * @returns {object} a [status structure]{@link https://docs.ccxt.com/#/?id=exchange-status-structure}
1017
+ */
1008
1018
  async fetchStatus(params = {}) {
1009
- /**
1010
- * @method
1011
- * @name kucoin#fetchStatus
1012
- * @description the latest known information on the availability of the exchange API
1013
- * @see https://docs.kucoin.com/#service-status
1014
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1015
- * @returns {object} a [status structure]{@link https://docs.ccxt.com/#/?id=exchange-status-structure}
1016
- */
1017
1019
  const response = await this.publicGetStatus(params);
1018
1020
  //
1019
1021
  // {
@@ -1034,16 +1036,16 @@ class kucoin extends kucoin$1 {
1034
1036
  'info': response,
1035
1037
  };
1036
1038
  }
1039
+ /**
1040
+ * @method
1041
+ * @name kucoin#fetchMarkets
1042
+ * @description retrieves data on all markets for kucoin
1043
+ * @see https://docs.kucoin.com/#get-symbols-list-deprecated
1044
+ * @see https://docs.kucoin.com/#get-all-tickers
1045
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1046
+ * @returns {object[]} an array of objects representing market data
1047
+ */
1037
1048
  async fetchMarkets(params = {}) {
1038
- /**
1039
- * @method
1040
- * @name kucoin#fetchMarkets
1041
- * @description retrieves data on all markets for kucoin
1042
- * @see https://docs.kucoin.com/#get-symbols-list-deprecated
1043
- * @see https://docs.kucoin.com/#get-all-tickers
1044
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1045
- * @returns {object[]} an array of objects representing market data
1046
- */
1047
1049
  let fetchTickersFees = undefined;
1048
1050
  [fetchTickersFees, params] = this.handleOptionAndParams(params, 'fetchMarkets', 'fetchTickersFees', true);
1049
1051
  const promises = [];
@@ -1227,13 +1229,14 @@ class kucoin extends kucoin$1 {
1227
1229
  }
1228
1230
  return result;
1229
1231
  }
1232
+ /**
1233
+ * @method
1234
+ * @name kucoin#loadMigrationStatus
1235
+ * @param {boolean} force load account state for non hf
1236
+ * @description loads the migration status for the account (hf or not)
1237
+ * @see https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/get-user-type
1238
+ */
1230
1239
  async loadMigrationStatus(force = false) {
1231
- /**
1232
- * @method
1233
- * @name kucoin#loadMigrationStatus
1234
- * @description loads the migration status for the account (hf or not)
1235
- * @see https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/get-user-type
1236
- */
1237
1240
  if (!('hf' in this.options) || (this.options['hf'] === undefined) || force) {
1238
1241
  const result = await this.privateGetHfAccountsOpened();
1239
1242
  this.options['hf'] = this.safeBool(result, 'data');
@@ -1254,15 +1257,15 @@ class kucoin extends kucoin$1 {
1254
1257
  params = this.omit(params, 'hf');
1255
1258
  return [hf, params];
1256
1259
  }
1260
+ /**
1261
+ * @method
1262
+ * @name kucoin#fetchCurrencies
1263
+ * @description fetches all available currencies on an exchange
1264
+ * @see https://docs.kucoin.com/#get-currencies
1265
+ * @param {object} params extra parameters specific to the exchange API endpoint
1266
+ * @returns {object} an associative dictionary of currencies
1267
+ */
1257
1268
  async fetchCurrencies(params = {}) {
1258
- /**
1259
- * @method
1260
- * @name kucoin#fetchCurrencies
1261
- * @description fetches all available currencies on an exchange
1262
- * @see https://docs.kucoin.com/#get-currencies
1263
- * @param {object} params extra parameters specific to the exchange API endpoint
1264
- * @returns {object} an associative dictionary of currencies
1265
- */
1266
1269
  const promises = [];
1267
1270
  promises.push(this.publicGetCurrencies(params));
1268
1271
  //
@@ -1417,15 +1420,15 @@ class kucoin extends kucoin$1 {
1417
1420
  }
1418
1421
  return result;
1419
1422
  }
1423
+ /**
1424
+ * @method
1425
+ * @name kucoin#fetchAccounts
1426
+ * @description fetch all the accounts associated with a profile
1427
+ * @see https://docs.kucoin.com/#list-accounts
1428
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1429
+ * @returns {object} a dictionary of [account structures]{@link https://docs.ccxt.com/#/?id=account-structure} indexed by the account type
1430
+ */
1420
1431
  async fetchAccounts(params = {}) {
1421
- /**
1422
- * @method
1423
- * @name kucoin#fetchAccounts
1424
- * @description fetch all the accounts associated with a profile
1425
- * @see https://docs.kucoin.com/#list-accounts
1426
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1427
- * @returns {object} a dictionary of [account structures]{@link https://docs.ccxt.com/#/?id=account-structure} indexed by the account type
1428
- */
1429
1432
  const response = await this.privateGetAccounts(params);
1430
1433
  //
1431
1434
  // {
@@ -1468,16 +1471,16 @@ class kucoin extends kucoin$1 {
1468
1471
  }
1469
1472
  return result;
1470
1473
  }
1474
+ /**
1475
+ * @method
1476
+ * @name kucoin#fetchTransactionFee
1477
+ * @description *DEPRECATED* please use fetchDepositWithdrawFee instead
1478
+ * @see https://docs.kucoin.com/#get-withdrawal-quotas
1479
+ * @param {string} code unified currency code
1480
+ * @param {object} params extra parameters specific to the exchange API endpoint
1481
+ * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
1482
+ */
1471
1483
  async fetchTransactionFee(code, params = {}) {
1472
- /**
1473
- * @method
1474
- * @name kucoin#fetchTransactionFee
1475
- * @description *DEPRECATED* please use fetchDepositWithdrawFee instead
1476
- * @see https://docs.kucoin.com/#get-withdrawal-quotas
1477
- * @param {string} code unified currency code
1478
- * @param {object} params extra parameters specific to the exchange API endpoint
1479
- * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
1480
- */
1481
1484
  await this.loadMarkets();
1482
1485
  const currency = this.currency(code);
1483
1486
  const request = {
@@ -1498,17 +1501,17 @@ class kucoin extends kucoin$1 {
1498
1501
  'deposit': {},
1499
1502
  };
1500
1503
  }
1504
+ /**
1505
+ * @method
1506
+ * @name kucoin#fetchDepositWithdrawFee
1507
+ * @description fetch the fee for deposits and withdrawals
1508
+ * @see https://docs.kucoin.com/#get-withdrawal-quotas
1509
+ * @param {string} code unified currency code
1510
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1511
+ * @param {string} [params.network] The chain of currency. This only apply for multi-chain currency, and there is no need for single chain currency; you can query the chain through the response of the GET /api/v2/currencies/{currency} interface
1512
+ * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
1513
+ */
1501
1514
  async fetchDepositWithdrawFee(code, params = {}) {
1502
- /**
1503
- * @method
1504
- * @name kucoin#fetchDepositWithdrawFee
1505
- * @description fetch the fee for deposits and withdrawals
1506
- * @see https://docs.kucoin.com/#get-withdrawal-quotas
1507
- * @param {string} code unified currency code
1508
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1509
- * @param {string} [params.network] The chain of currency. This only apply for multi-chain currency, and there is no need for single chain currency; you can query the chain through the response of the GET /api/v2/currencies/{currency} interface
1510
- * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
1511
- */
1512
1515
  await this.loadMarkets();
1513
1516
  const currency = this.currency(code);
1514
1517
  const request = {
@@ -1691,16 +1694,16 @@ class kucoin extends kucoin$1 {
1691
1694
  'info': ticker,
1692
1695
  }, market);
1693
1696
  }
1697
+ /**
1698
+ * @method
1699
+ * @name kucoin#fetchTickers
1700
+ * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
1701
+ * @see https://docs.kucoin.com/#get-all-tickers
1702
+ * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
1703
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1704
+ * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
1705
+ */
1694
1706
  async fetchTickers(symbols = undefined, params = {}) {
1695
- /**
1696
- * @method
1697
- * @name kucoin#fetchTickers
1698
- * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
1699
- * @see https://docs.kucoin.com/#get-all-tickers
1700
- * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
1701
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1702
- * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
1703
- */
1704
1707
  await this.loadMarkets();
1705
1708
  symbols = this.marketSymbols(symbols);
1706
1709
  const response = await this.publicGetMarketAllTickers(params);
@@ -1746,32 +1749,32 @@ class kucoin extends kucoin$1 {
1746
1749
  }
1747
1750
  return this.filterByArrayTickers(result, 'symbol', symbols);
1748
1751
  }
1752
+ /**
1753
+ * @method
1754
+ * @name kucoin#fetchMarkPrices
1755
+ * @description fetches the mark price for multiple markets
1756
+ * @see https://www.kucoin.com/docs/rest/margin-trading/margin-info/get-all-margin-trading-pairs-mark-prices
1757
+ * @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
1758
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1759
+ * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
1760
+ */
1749
1761
  async fetchMarkPrices(symbols = undefined, params = {}) {
1750
- /**
1751
- * @method
1752
- * @name kucoin#fetchMarkPrices
1753
- * @description fetches the mark price for multiple markets
1754
- * @see https://www.kucoin.com/docs/rest/margin-trading/margin-info/get-all-margin-trading-pairs-mark-prices
1755
- * @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
1756
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1757
- * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
1758
- */
1759
1762
  await this.loadMarkets();
1760
1763
  symbols = this.marketSymbols(symbols);
1761
1764
  const response = await this.publicGetMarkPriceAllSymbols(params);
1762
1765
  const data = this.safeList(response, 'data', []);
1763
1766
  return this.parseTickers(data);
1764
1767
  }
1768
+ /**
1769
+ * @method
1770
+ * @name kucoin#fetchTicker
1771
+ * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
1772
+ * @see https://docs.kucoin.com/#get-24hr-stats
1773
+ * @param {string} symbol unified symbol of the market to fetch the ticker for
1774
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1775
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
1776
+ */
1765
1777
  async fetchTicker(symbol, params = {}) {
1766
- /**
1767
- * @method
1768
- * @name kucoin#fetchTicker
1769
- * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
1770
- * @see https://docs.kucoin.com/#get-24hr-stats
1771
- * @param {string} symbol unified symbol of the market to fetch the ticker for
1772
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1773
- * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
1774
- */
1775
1778
  await this.loadMarkets();
1776
1779
  const market = this.market(symbol);
1777
1780
  const request = {
@@ -1804,16 +1807,16 @@ class kucoin extends kucoin$1 {
1804
1807
  const data = this.safeDict(response, 'data', {});
1805
1808
  return this.parseTicker(data, market);
1806
1809
  }
1810
+ /**
1811
+ * @method
1812
+ * @name kucoin#fetchMarkPrice
1813
+ * @description fetches the mark price for a specific market
1814
+ * @see https://www.kucoin.com/docs/rest/margin-trading/margin-info/get-mark-price
1815
+ * @param {string} symbol unified symbol of the market to fetch the ticker for
1816
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1817
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
1818
+ */
1807
1819
  async fetchMarkPrice(symbol, params = {}) {
1808
- /**
1809
- * @method
1810
- * @name kucoin#fetchMarkPrice
1811
- * @description fetches the mark price for a specific market
1812
- * @see https://www.kucoin.com/docs/rest/margin-trading/margin-info/get-mark-price
1813
- * @param {string} symbol unified symbol of the market to fetch the ticker for
1814
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1815
- * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
1816
- */
1817
1820
  await this.loadMarkets();
1818
1821
  const market = this.market(symbol);
1819
1822
  const request = {
@@ -1845,20 +1848,20 @@ class kucoin extends kucoin$1 {
1845
1848
  this.safeNumber(ohlcv, 5),
1846
1849
  ];
1847
1850
  }
1851
+ /**
1852
+ * @method
1853
+ * @name kucoin#fetchOHLCV
1854
+ * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
1855
+ * @see https://docs.kucoin.com/#get-klines
1856
+ * @param {string} symbol unified symbol of the market to fetch OHLCV data for
1857
+ * @param {string} timeframe the length of time each candle represents
1858
+ * @param {int} [since] timestamp in ms of the earliest candle to fetch
1859
+ * @param {int} [limit] the maximum amount of candles to fetch
1860
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1861
+ * @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)
1862
+ * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
1863
+ */
1848
1864
  async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
1849
- /**
1850
- * @method
1851
- * @name kucoin#fetchOHLCV
1852
- * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
1853
- * @see https://docs.kucoin.com/#get-klines
1854
- * @param {string} symbol unified symbol of the market to fetch OHLCV data for
1855
- * @param {string} timeframe the length of time each candle represents
1856
- * @param {int} [since] timestamp in ms of the earliest candle to fetch
1857
- * @param {int} [limit] the maximum amount of candles to fetch
1858
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1859
- * @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)
1860
- * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
1861
- */
1862
1865
  await this.loadMarkets();
1863
1866
  let paginate = false;
1864
1867
  [paginate, params] = this.handleOptionAndParams(params, 'fetchOHLCV', 'paginate');
@@ -1903,17 +1906,17 @@ class kucoin extends kucoin$1 {
1903
1906
  const data = this.safeList(response, 'data', []);
1904
1907
  return this.parseOHLCVs(data, market, timeframe, since, limit);
1905
1908
  }
1909
+ /**
1910
+ * @method
1911
+ * @name kucoin#createDepositAddress
1912
+ * @see https://www.kucoin.com/docs/rest/funding/deposit/create-deposit-address-v3-
1913
+ * @description create a currency deposit address
1914
+ * @param {string} code unified currency code of the currency for the deposit address
1915
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1916
+ * @param {string} [params.network] the blockchain network name
1917
+ * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
1918
+ */
1906
1919
  async createDepositAddress(code, params = {}) {
1907
- /**
1908
- * @method
1909
- * @name kucoin#createDepositAddress
1910
- * @see https://www.kucoin.com/docs/rest/funding/deposit/create-deposit-address-v3-
1911
- * @description create a currency deposit address
1912
- * @param {string} code unified currency code of the currency for the deposit address
1913
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1914
- * @param {string} [params.network] the blockchain network name
1915
- * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
1916
- */
1917
1920
  await this.loadMarkets();
1918
1921
  const currency = this.currency(code);
1919
1922
  const request = {
@@ -1943,17 +1946,17 @@ class kucoin extends kucoin$1 {
1943
1946
  const data = this.safeDict(response, 'data', {});
1944
1947
  return this.parseDepositAddress(data, currency);
1945
1948
  }
1949
+ /**
1950
+ * @method
1951
+ * @name kucoin#fetchDepositAddress
1952
+ * @description fetch the deposit address for a currency associated with this account
1953
+ * @see https://docs.kucoin.com/#get-deposit-addresses-v2
1954
+ * @param {string} code unified currency code
1955
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1956
+ * @param {string} [params.network] the blockchain network name
1957
+ * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
1958
+ */
1946
1959
  async fetchDepositAddress(code, params = {}) {
1947
- /**
1948
- * @method
1949
- * @name kucoin#fetchDepositAddress
1950
- * @description fetch the deposit address for a currency associated with this account
1951
- * @see https://docs.kucoin.com/#get-deposit-addresses-v2
1952
- * @param {string} code unified currency code
1953
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1954
- * @param {string} [params.network] the blockchain network name
1955
- * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
1956
- */
1957
1960
  await this.loadMarkets();
1958
1961
  const currency = this.currency(code);
1959
1962
  const request = {
@@ -2001,16 +2004,16 @@ class kucoin extends kucoin$1 {
2001
2004
  'tag': this.safeString(depositAddress, 'memo'),
2002
2005
  };
2003
2006
  }
2007
+ /**
2008
+ * @method
2009
+ * @name kucoin#fetchDepositAddressesByNetwork
2010
+ * @see https://docs.kucoin.com/#get-deposit-addresses-v2
2011
+ * @description fetch the deposit address for a currency associated with this account
2012
+ * @param {string} code unified currency code
2013
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2014
+ * @returns {object} an array of [address structures]{@link https://docs.ccxt.com/#/?id=address-structure}
2015
+ */
2004
2016
  async fetchDepositAddressesByNetwork(code, params = {}) {
2005
- /**
2006
- * @method
2007
- * @name kucoin#fetchDepositAddressesByNetwork
2008
- * @see https://docs.kucoin.com/#get-deposit-addresses-v2
2009
- * @description fetch the deposit address for a currency associated with this account
2010
- * @param {string} code unified currency code
2011
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2012
- * @returns {object} an array of [address structures]{@link https://docs.ccxt.com/#/?id=address-structure}
2013
- */
2014
2017
  await this.loadMarkets();
2015
2018
  const currency = this.currency(code);
2016
2019
  const request = {
@@ -2041,18 +2044,18 @@ class kucoin extends kucoin$1 {
2041
2044
  });
2042
2045
  return this.indexBy(parsed, 'network');
2043
2046
  }
2047
+ /**
2048
+ * @method
2049
+ * @name kucoin#fetchOrderBook
2050
+ * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
2051
+ * @see https://www.kucoin.com/docs/rest/spot-trading/market-data/get-part-order-book-aggregated-
2052
+ * @see https://www.kucoin.com/docs/rest/spot-trading/market-data/get-full-order-book-aggregated-
2053
+ * @param {string} symbol unified symbol of the market to fetch the order book for
2054
+ * @param {int} [limit] the maximum amount of order book entries to return
2055
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2056
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
2057
+ */
2044
2058
  async fetchOrderBook(symbol, limit = undefined, params = {}) {
2045
- /**
2046
- * @method
2047
- * @name kucoin#fetchOrderBook
2048
- * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
2049
- * @see https://www.kucoin.com/docs/rest/spot-trading/market-data/get-part-order-book-aggregated-
2050
- * @see https://www.kucoin.com/docs/rest/spot-trading/market-data/get-full-order-book-aggregated-
2051
- * @param {string} symbol unified symbol of the market to fetch the order book for
2052
- * @param {int} [limit] the maximum amount of order book entries to return
2053
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2054
- * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
2055
- */
2056
2059
  await this.loadMarkets();
2057
2060
  const market = this.market(symbol);
2058
2061
  const level = this.safeInteger(params, 'level', 2);
@@ -2125,51 +2128,51 @@ class kucoin extends kucoin$1 {
2125
2128
  }
2126
2129
  return [triggerPrice, stopLossPrice, takeProfitPrice];
2127
2130
  }
2131
+ /**
2132
+ * @method
2133
+ * @name kucoin#createOrder
2134
+ * @description Create an order on the exchange
2135
+ * @see https://docs.kucoin.com/spot#place-a-new-order
2136
+ * @see https://docs.kucoin.com/spot#place-a-new-order-2
2137
+ * @see https://docs.kucoin.com/spot#place-a-margin-order
2138
+ * @see https://docs.kucoin.com/spot-hf/#place-hf-order
2139
+ * @see https://www.kucoin.com/docs/rest/spot-trading/orders/place-order-test
2140
+ * @see https://www.kucoin.com/docs/rest/margin-trading/orders/place-margin-order-test
2141
+ * @see https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/sync-place-hf-order
2142
+ * @param {string} symbol Unified CCXT market symbol
2143
+ * @param {string} type 'limit' or 'market'
2144
+ * @param {string} side 'buy' or 'sell'
2145
+ * @param {float} amount the amount of currency to trade
2146
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
2147
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2148
+ * @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
2149
+ * @param {string} [params.marginMode] 'cross', // cross (cross mode) and isolated (isolated mode), set to cross by default, the isolated mode will be released soon, stay tuned
2150
+ * @param {string} [params.timeInForce] GTC, GTT, IOC, or FOK, default is GTC, limit orders only
2151
+ * @param {string} [params.postOnly] Post only flag, invalid when timeInForce is IOC or FOK
2152
+ *
2153
+ * EXCHANGE SPECIFIC PARAMETERS
2154
+ * @param {string} [params.clientOid] client order id, defaults to uuid if not passed
2155
+ * @param {string} [params.remark] remark for the order, length cannot exceed 100 utf8 characters
2156
+ * @param {string} [params.tradeType] 'TRADE', // TRADE, MARGIN_TRADE // not used with margin orders
2157
+ * limit orders ---------------------------------------------------
2158
+ * @param {float} [params.cancelAfter] long, // cancel after n seconds, requires timeInForce to be GTT
2159
+ * @param {bool} [params.hidden] false, // Order will not be displayed in the order book
2160
+ * @param {bool} [params.iceberg] false, // Only a portion of the order is displayed in the order book
2161
+ * @param {string} [params.visibleSize] this.amountToPrecision (symbol, visibleSize), // The maximum visible size of an iceberg order
2162
+ * market orders --------------------------------------------------
2163
+ * @param {string} [params.funds] // Amount of quote currency to use
2164
+ * stop orders ----------------------------------------------------
2165
+ * @param {string} [params.stop] Either loss or entry, the default is loss. Requires stopPrice to be defined
2166
+ * margin orders --------------------------------------------------
2167
+ * @param {float} [params.leverage] Leverage size of the order
2168
+ * @param {string} [params.stp] '', // self trade prevention, CN, CO, CB or DC
2169
+ * @param {bool} [params.autoBorrow] false, // The system will first borrow you funds at the optimal interest rate and then place an order for you
2170
+ * @param {bool} [params.hf] false, // true for hf order
2171
+ * @param {bool} [params.test] set to true to test an order, no order will be created but the request will be validated
2172
+ * @param {bool} [params.sync] set to true to use the hf sync call
2173
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2174
+ */
2128
2175
  async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
2129
- /**
2130
- * @method
2131
- * @name kucoin#createOrder
2132
- * @description Create an order on the exchange
2133
- * @see https://docs.kucoin.com/spot#place-a-new-order
2134
- * @see https://docs.kucoin.com/spot#place-a-new-order-2
2135
- * @see https://docs.kucoin.com/spot#place-a-margin-order
2136
- * @see https://docs.kucoin.com/spot-hf/#place-hf-order
2137
- * @see https://www.kucoin.com/docs/rest/spot-trading/orders/place-order-test
2138
- * @see https://www.kucoin.com/docs/rest/margin-trading/orders/place-margin-order-test
2139
- * @see https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/sync-place-hf-order
2140
- * @param {string} symbol Unified CCXT market symbol
2141
- * @param {string} type 'limit' or 'market'
2142
- * @param {string} side 'buy' or 'sell'
2143
- * @param {float} amount the amount of currency to trade
2144
- * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
2145
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2146
- * @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
2147
- * @param {string} [params.marginMode] 'cross', // cross (cross mode) and isolated (isolated mode), set to cross by default, the isolated mode will be released soon, stay tuned
2148
- * @param {string} [params.timeInForce] GTC, GTT, IOC, or FOK, default is GTC, limit orders only
2149
- * @param {string} [params.postOnly] Post only flag, invalid when timeInForce is IOC or FOK
2150
- *
2151
- * EXCHANGE SPECIFIC PARAMETERS
2152
- * @param {string} [params.clientOid] client order id, defaults to uuid if not passed
2153
- * @param {string} [params.remark] remark for the order, length cannot exceed 100 utf8 characters
2154
- * @param {string} [params.tradeType] 'TRADE', // TRADE, MARGIN_TRADE // not used with margin orders
2155
- * limit orders ---------------------------------------------------
2156
- * @param {float} [params.cancelAfter] long, // cancel after n seconds, requires timeInForce to be GTT
2157
- * @param {bool} [params.hidden] false, // Order will not be displayed in the order book
2158
- * @param {bool} [params.iceberg] false, // Only a portion of the order is displayed in the order book
2159
- * @param {string} [params.visibleSize] this.amountToPrecision (symbol, visibleSize), // The maximum visible size of an iceberg order
2160
- * market orders --------------------------------------------------
2161
- * @param {string} [params.funds] // Amount of quote currency to use
2162
- * stop orders ----------------------------------------------------
2163
- * @param {string} [params.stop] Either loss or entry, the default is loss. Requires stopPrice to be defined
2164
- * margin orders --------------------------------------------------
2165
- * @param {float} [params.leverage] Leverage size of the order
2166
- * @param {string} [params.stp] '', // self trade prevention, CN, CO, CB or DC
2167
- * @param {bool} [params.autoBorrow] false, // The system will first borrow you funds at the optimal interest rate and then place an order for you
2168
- * @param {bool} [params.hf] false, // true for hf order
2169
- * @param {bool} [params.test] set to true to test an order, no order will be created but the request will be validated
2170
- * @param {bool} [params.sync] set to true to use the hf sync call
2171
- * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2172
- */
2173
2176
  await this.loadMarkets();
2174
2177
  const market = this.market(symbol);
2175
2178
  const testOrder = this.safeBool(params, 'test', false);
@@ -2224,64 +2227,64 @@ class kucoin extends kucoin$1 {
2224
2227
  const data = this.safeDict(response, 'data', {});
2225
2228
  return this.parseOrder(data, market);
2226
2229
  }
2230
+ /**
2231
+ * @method
2232
+ * @name kucoin#createMarketOrderWithCost
2233
+ * @description create a market order by providing the symbol, side and cost
2234
+ * @see https://www.kucoin.com/docs/rest/spot-trading/orders/place-order
2235
+ * @param {string} symbol unified symbol of the market to create an order in
2236
+ * @param {string} side 'buy' or 'sell'
2237
+ * @param {float} cost how much you want to trade in units of the quote currency
2238
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2239
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2240
+ */
2227
2241
  async createMarketOrderWithCost(symbol, side, cost, params = {}) {
2228
- /**
2229
- * @method
2230
- * @name kucoin#createMarketOrderWithCost
2231
- * @description create a market order by providing the symbol, side and cost
2232
- * @see https://www.kucoin.com/docs/rest/spot-trading/orders/place-order
2233
- * @param {string} symbol unified symbol of the market to create an order in
2234
- * @param {string} side 'buy' or 'sell'
2235
- * @param {float} cost how much you want to trade in units of the quote currency
2236
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2237
- * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2238
- */
2239
2242
  await this.loadMarkets();
2240
2243
  params['cost'] = cost;
2241
2244
  return await this.createOrder(symbol, 'market', side, cost, undefined, params);
2242
2245
  }
2246
+ /**
2247
+ * @method
2248
+ * @name kucoin#createMarketBuyOrderWithCost
2249
+ * @description create a market buy order by providing the symbol and cost
2250
+ * @see https://www.kucoin.com/docs/rest/spot-trading/orders/place-order
2251
+ * @param {string} symbol unified symbol of the market to create an order in
2252
+ * @param {float} cost how much you want to trade in units of the quote currency
2253
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2254
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2255
+ */
2243
2256
  async createMarketBuyOrderWithCost(symbol, cost, params = {}) {
2244
- /**
2245
- * @method
2246
- * @name kucoin#createMarketBuyOrderWithCost
2247
- * @description create a market buy order by providing the symbol and cost
2248
- * @see https://www.kucoin.com/docs/rest/spot-trading/orders/place-order
2249
- * @param {string} symbol unified symbol of the market to create an order in
2250
- * @param {float} cost how much you want to trade in units of the quote currency
2251
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2252
- * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2253
- */
2254
2257
  await this.loadMarkets();
2255
2258
  return await this.createMarketOrderWithCost(symbol, 'buy', cost, params);
2256
2259
  }
2260
+ /**
2261
+ * @method
2262
+ * @name kucoin#createMarketSellOrderWithCost
2263
+ * @description create a market sell order by providing the symbol and cost
2264
+ * @see https://www.kucoin.com/docs/rest/spot-trading/orders/place-order
2265
+ * @param {string} symbol unified symbol of the market to create an order in
2266
+ * @param {float} cost how much you want to trade in units of the quote currency
2267
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2268
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2269
+ */
2257
2270
  async createMarketSellOrderWithCost(symbol, cost, params = {}) {
2258
- /**
2259
- * @method
2260
- * @name kucoin#createMarketSellOrderWithCost
2261
- * @description create a market sell order by providing the symbol and cost
2262
- * @see https://www.kucoin.com/docs/rest/spot-trading/orders/place-order
2263
- * @param {string} symbol unified symbol of the market to create an order in
2264
- * @param {float} cost how much you want to trade in units of the quote currency
2265
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2266
- * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2267
- */
2268
2271
  await this.loadMarkets();
2269
2272
  return await this.createMarketOrderWithCost(symbol, 'sell', cost, params);
2270
2273
  }
2274
+ /**
2275
+ * @method
2276
+ * @name kucoin#createOrders
2277
+ * @description create a list of trade orders
2278
+ * @see https://www.kucoin.com/docs/rest/spot-trading/orders/place-multiple-orders
2279
+ * @see https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/place-multiple-hf-orders
2280
+ * @see https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/sync-place-multiple-hf-orders
2281
+ * @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
2282
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2283
+ * @param {bool} [params.hf] false, // true for hf orders
2284
+ * @param {bool} [params.sync] false, // true to use the hf sync call
2285
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2286
+ */
2271
2287
  async createOrders(orders, params = {}) {
2272
- /**
2273
- * @method
2274
- * @name kucoin#createOrders
2275
- * @description create a list of trade orders
2276
- * @see https://www.kucoin.com/docs/rest/spot-trading/orders/place-multiple-orders
2277
- * @see https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/place-multiple-hf-orders
2278
- * @see https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/sync-place-multiple-hf-orders
2279
- * @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
2280
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2281
- * @param {bool} [params.hf] false, // true for hf orders
2282
- * @param {bool} [params.sync] false, // true to use the hf sync call
2283
- * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2284
- */
2285
2288
  await this.loadMarkets();
2286
2289
  const ordersRequests = [];
2287
2290
  let symbol = undefined;
@@ -2439,22 +2442,22 @@ class kucoin extends kucoin$1 {
2439
2442
  }
2440
2443
  return this.extend(request, params);
2441
2444
  }
2445
+ /**
2446
+ * @method
2447
+ * @name kucoin#editOrder
2448
+ * @description edit an order, kucoin currently only supports the modification of HF orders
2449
+ * @see https://docs.kucoin.com/spot-hf/#modify-order
2450
+ * @param {string} id order id
2451
+ * @param {string} symbol unified symbol of the market to create an order in
2452
+ * @param {string} type not used
2453
+ * @param {string} side not used
2454
+ * @param {float} amount how much of the currency you want to trade in units of the base currency
2455
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
2456
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2457
+ * @param {string} [params.clientOrderId] client order id, defaults to id if not passed
2458
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2459
+ */
2442
2460
  async editOrder(id, symbol, type, side, amount = undefined, price = undefined, params = {}) {
2443
- /**
2444
- * @method
2445
- * @name kucoin#editOrder
2446
- * @description edit an order, kucoin currently only supports the modification of HF orders
2447
- * @see https://docs.kucoin.com/spot-hf/#modify-order
2448
- * @param {string} id order id
2449
- * @param {string} symbol unified symbol of the market to create an order in
2450
- * @param {string} type not used
2451
- * @param {string} side not used
2452
- * @param {float} amount how much of the currency you want to trade in units of the base currency
2453
- * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
2454
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2455
- * @param {string} [params.clientOrderId] client order id, defaults to id if not passed
2456
- * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2457
- */
2458
2461
  await this.loadMarkets();
2459
2462
  const market = this.market(symbol);
2460
2463
  const request = {
@@ -2485,27 +2488,27 @@ class kucoin extends kucoin$1 {
2485
2488
  const data = this.safeDict(response, 'data', {});
2486
2489
  return this.parseOrder(data, market);
2487
2490
  }
2491
+ /**
2492
+ * @method
2493
+ * @name kucoin#cancelOrder
2494
+ * @description cancels an open order
2495
+ * @see https://docs.kucoin.com/spot#cancel-an-order
2496
+ * @see https://docs.kucoin.com/spot#cancel-an-order-2
2497
+ * @see https://docs.kucoin.com/spot#cancel-single-order-by-clientoid
2498
+ * @see https://docs.kucoin.com/spot#cancel-single-order-by-clientoid-2
2499
+ * @see https://docs.kucoin.com/spot-hf/#cancel-orders-by-orderid
2500
+ * @see https://docs.kucoin.com/spot-hf/#cancel-order-by-clientoid
2501
+ * @see https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/sync-cancel-hf-order-by-orderid
2502
+ * @see https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/sync-cancel-hf-order-by-clientoid
2503
+ * @param {string} id order id
2504
+ * @param {string} symbol unified symbol of the market the order was made in
2505
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2506
+ * @param {bool} [params.stop] True if cancelling a stop order
2507
+ * @param {bool} [params.hf] false, // true for hf order
2508
+ * @param {bool} [params.sync] false, // true to use the hf sync call
2509
+ * @returns Response from the exchange
2510
+ */
2488
2511
  async cancelOrder(id, symbol = undefined, params = {}) {
2489
- /**
2490
- * @method
2491
- * @name kucoin#cancelOrder
2492
- * @description cancels an open order
2493
- * @see https://docs.kucoin.com/spot#cancel-an-order
2494
- * @see https://docs.kucoin.com/spot#cancel-an-order-2
2495
- * @see https://docs.kucoin.com/spot#cancel-single-order-by-clientoid
2496
- * @see https://docs.kucoin.com/spot#cancel-single-order-by-clientoid-2
2497
- * @see https://docs.kucoin.com/spot-hf/#cancel-orders-by-orderid
2498
- * @see https://docs.kucoin.com/spot-hf/#cancel-order-by-clientoid
2499
- * @see https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/sync-cancel-hf-order-by-orderid
2500
- * @see https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/sync-cancel-hf-order-by-clientoid
2501
- * @param {string} id order id
2502
- * @param {string} symbol unified symbol of the market the order was made in
2503
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2504
- * @param {bool} [params.stop] True if cancelling a stop order
2505
- * @param {bool} [params.hf] false, // true for hf order
2506
- * @param {bool} [params.sync] false, // true to use the hf sync call
2507
- * @returns Response from the exchange
2508
- */
2509
2512
  await this.loadMarkets();
2510
2513
  const request = {};
2511
2514
  const clientOrderId = this.safeString2(params, 'clientOid', 'clientOrderId');
@@ -2612,23 +2615,22 @@ class kucoin extends kucoin$1 {
2612
2615
  });
2613
2616
  }
2614
2617
  }
2618
+ /**
2619
+ * @method
2620
+ * @name kucoin#cancelAllOrders
2621
+ * @description cancel all open orders
2622
+ * @see https://docs.kucoin.com/spot#cancel-all-orders
2623
+ * @see https://docs.kucoin.com/spot#cancel-orders
2624
+ * @see https://docs.kucoin.com/spot-hf/#cancel-all-hf-orders-by-symbol
2625
+ * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
2626
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2627
+ * @param {bool} [params.stop] *invalid for isolated margin* true if cancelling all stop orders
2628
+ * @param {string} [params.marginMode] 'cross' or 'isolated'
2629
+ * @param {string} [params.orderIds] *stop orders only* Comma seperated order IDs
2630
+ * @param {bool} [params.hf] false, // true for hf order
2631
+ * @returns Response from the exchange
2632
+ */
2615
2633
  async cancelAllOrders(symbol = undefined, params = {}) {
2616
- /**
2617
- * @method
2618
- * @name kucoin#cancelAllOrders
2619
- * @description cancel all open orders
2620
- * @see https://docs.kucoin.com/spot#cancel-all-orders
2621
- * @see https://docs.kucoin.com/spot#cancel-orders
2622
- * @see https://docs.kucoin.com/spot-hf/#cancel-all-hf-orders-by-symbol
2623
- * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
2624
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2625
- * @param {bool} [params.stop] *invalid for isolated margin* true if cancelling all stop orders
2626
- * @param {string} [params.marginMode] 'cross' or 'isolated'
2627
- * @param {string} [params.orderIds] *stop orders only* Comma seperated order IDs
2628
- * @param {bool} [params.stop] True if cancelling a stop order
2629
- * @param {bool} [params.hf] false, // true for hf order
2630
- * @returns Response from the exchange
2631
- */
2632
2634
  await this.loadMarkets();
2633
2635
  const request = {};
2634
2636
  const stop = this.safeBool(params, 'stop', false);
@@ -2662,31 +2664,30 @@ class kucoin extends kucoin$1 {
2662
2664
  }
2663
2665
  return response;
2664
2666
  }
2667
+ /**
2668
+ * @method
2669
+ * @name kucoin#fetchOrdersByStatus
2670
+ * @description fetch a list of orders
2671
+ * @see https://docs.kucoin.com/spot#list-orders
2672
+ * @see https://docs.kucoin.com/spot#list-stop-orders
2673
+ * @see https://docs.kucoin.com/spot-hf/#obtain-list-of-active-hf-orders
2674
+ * @see https://docs.kucoin.com/spot-hf/#obtain-list-of-filled-hf-orders
2675
+ * @param {string} status *not used for stop orders* 'open' or 'closed'
2676
+ * @param {string} symbol unified market symbol
2677
+ * @param {int} [since] timestamp in ms of the earliest order
2678
+ * @param {int} [limit] max number of orders to return
2679
+ * @param {object} [params] exchange specific params
2680
+ * @param {int} [params.until] end time in ms
2681
+ * @param {string} [params.side] buy or sell
2682
+ * @param {string} [params.type] limit, market, limit_stop or market_stop
2683
+ * @param {string} [params.tradeType] TRADE for spot trading, MARGIN_TRADE for Margin Trading
2684
+ * @param {int} [params.currentPage] *stop orders only* current page
2685
+ * @param {string} [params.orderIds] *stop orders only* comma seperated order ID list
2686
+ * @param {bool} [params.stop] True if fetching a stop order
2687
+ * @param {bool} [params.hf] false, // true for hf order
2688
+ * @returns An [array of order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
2689
+ */
2665
2690
  async fetchOrdersByStatus(status, symbol = undefined, since = undefined, limit = undefined, params = {}) {
2666
- /**
2667
- * @method
2668
- * @name kucoin#fetchOrdersByStatus
2669
- * @description fetch a list of orders
2670
- * @see https://docs.kucoin.com/spot#list-orders
2671
- * @see https://docs.kucoin.com/spot#list-stop-orders
2672
- * @see https://docs.kucoin.com/spot-hf/#obtain-list-of-active-hf-orders
2673
- * @see https://docs.kucoin.com/spot-hf/#obtain-list-of-filled-hf-orders
2674
- * @param {string} status *not used for stop orders* 'open' or 'closed'
2675
- * @param {string} symbol unified market symbol
2676
- * @param {int} [since] timestamp in ms of the earliest order
2677
- * @param {int} [limit] max number of orders to return
2678
- * @param {object} [params] exchange specific params
2679
- * @param {int} [params.until] end time in ms
2680
- * @param {bool} [params.stop] true if fetching stop orders
2681
- * @param {string} [params.side] buy or sell
2682
- * @param {string} [params.type] limit, market, limit_stop or market_stop
2683
- * @param {string} [params.tradeType] TRADE for spot trading, MARGIN_TRADE for Margin Trading
2684
- * @param {int} [params.currentPage] *stop orders only* current page
2685
- * @param {string} [params.orderIds] *stop orders only* comma seperated order ID list
2686
- * @param {bool} [params.stop] True if fetching a stop order
2687
- * @param {bool} [params.hf] false, // true for hf order
2688
- * @returns An [array of order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
2689
- */
2690
2691
  await this.loadMarkets();
2691
2692
  let lowercaseStatus = status.toLowerCase();
2692
2693
  const until = this.safeInteger(params, 'until');
@@ -2788,28 +2789,28 @@ class kucoin extends kucoin$1 {
2788
2789
  const orders = this.safeList(responseData, 'items', []);
2789
2790
  return this.parseOrders(orders, market, since, limit);
2790
2791
  }
2792
+ /**
2793
+ * @method
2794
+ * @name kucoin#fetchClosedOrders
2795
+ * @description fetches information on multiple closed orders made by the user
2796
+ * @see https://docs.kucoin.com/spot#list-orders
2797
+ * @see https://docs.kucoin.com/spot#list-stop-orders
2798
+ * @see https://docs.kucoin.com/spot-hf/#obtain-list-of-active-hf-orders
2799
+ * @see https://docs.kucoin.com/spot-hf/#obtain-list-of-filled-hf-orders
2800
+ * @param {string} symbol unified market symbol of the market orders were made in
2801
+ * @param {int} [since] the earliest time in ms to fetch orders for
2802
+ * @param {int} [limit] the maximum number of order structures to retrieve
2803
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2804
+ * @param {int} [params.until] end time in ms
2805
+ * @param {string} [params.side] buy or sell
2806
+ * @param {string} [params.type] limit, market, limit_stop or market_stop
2807
+ * @param {string} [params.tradeType] TRADE for spot trading, MARGIN_TRADE for Margin Trading
2808
+ * @param {bool} [params.stop] True if fetching a stop order
2809
+ * @param {bool} [params.hf] false, // true for hf order
2810
+ * @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)
2811
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
2812
+ */
2791
2813
  async fetchClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
2792
- /**
2793
- * @method
2794
- * @name kucoin#fetchClosedOrders
2795
- * @description fetches information on multiple closed orders made by the user
2796
- * @see https://docs.kucoin.com/spot#list-orders
2797
- * @see https://docs.kucoin.com/spot#list-stop-orders
2798
- * @see https://docs.kucoin.com/spot-hf/#obtain-list-of-active-hf-orders
2799
- * @see https://docs.kucoin.com/spot-hf/#obtain-list-of-filled-hf-orders
2800
- * @param {string} symbol unified market symbol of the market orders were made in
2801
- * @param {int} [since] the earliest time in ms to fetch orders for
2802
- * @param {int} [limit] the maximum number of order structures to retrieve
2803
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2804
- * @param {int} [params.until] end time in ms
2805
- * @param {string} [params.side] buy or sell
2806
- * @param {string} [params.type] limit, market, limit_stop or market_stop
2807
- * @param {string} [params.tradeType] TRADE for spot trading, MARGIN_TRADE for Margin Trading
2808
- * @param {bool} [params.stop] True if fetching a stop order
2809
- * @param {bool} [params.hf] false, // true for hf order
2810
- * @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)
2811
- * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
2812
- */
2813
2814
  await this.loadMarkets();
2814
2815
  let paginate = false;
2815
2816
  [paginate, params] = this.handleOptionAndParams(params, 'fetchClosedOrders', 'paginate');
@@ -2818,31 +2819,30 @@ class kucoin extends kucoin$1 {
2818
2819
  }
2819
2820
  return await this.fetchOrdersByStatus('done', symbol, since, limit, params);
2820
2821
  }
2822
+ /**
2823
+ * @method
2824
+ * @name kucoin#fetchOpenOrders
2825
+ * @description fetch all unfilled currently open orders
2826
+ * @see https://docs.kucoin.com/spot#list-orders
2827
+ * @see https://docs.kucoin.com/spot#list-stop-orders
2828
+ * @see https://docs.kucoin.com/spot-hf/#obtain-list-of-active-hf-orders
2829
+ * @see https://docs.kucoin.com/spot-hf/#obtain-list-of-filled-hf-orders
2830
+ * @param {string} symbol unified market symbol
2831
+ * @param {int} [since] the earliest time in ms to fetch open orders for
2832
+ * @param {int} [limit] the maximum number of open orders structures to retrieve
2833
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2834
+ * @param {int} [params.until] end time in ms
2835
+ * @param {bool} [params.stop] true if fetching stop orders
2836
+ * @param {string} [params.side] buy or sell
2837
+ * @param {string} [params.type] limit, market, limit_stop or market_stop
2838
+ * @param {string} [params.tradeType] TRADE for spot trading, MARGIN_TRADE for Margin Trading
2839
+ * @param {int} [params.currentPage] *stop orders only* current page
2840
+ * @param {string} [params.orderIds] *stop orders only* comma seperated order ID list
2841
+ * @param {bool} [params.hf] false, // true for hf order
2842
+ * @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)
2843
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
2844
+ */
2821
2845
  async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
2822
- /**
2823
- * @method
2824
- * @name kucoin#fetchOpenOrders
2825
- * @description fetch all unfilled currently open orders
2826
- * @see https://docs.kucoin.com/spot#list-orders
2827
- * @see https://docs.kucoin.com/spot#list-stop-orders
2828
- * @see https://docs.kucoin.com/spot-hf/#obtain-list-of-active-hf-orders
2829
- * @see https://docs.kucoin.com/spot-hf/#obtain-list-of-filled-hf-orders
2830
- * @param {string} symbol unified market symbol
2831
- * @param {int} [since] the earliest time in ms to fetch open orders for
2832
- * @param {int} [limit] the maximum number of open orders structures to retrieve
2833
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2834
- * @param {int} [params.until] end time in ms
2835
- * @param {bool} [params.stop] true if fetching stop orders
2836
- * @param {string} [params.side] buy or sell
2837
- * @param {string} [params.type] limit, market, limit_stop or market_stop
2838
- * @param {string} [params.tradeType] TRADE for spot trading, MARGIN_TRADE for Margin Trading
2839
- * @param {int} [params.currentPage] *stop orders only* current page
2840
- * @param {string} [params.orderIds] *stop orders only* comma seperated order ID list
2841
- * @param {bool} [params.stop] True if fetching a stop order
2842
- * @param {bool} [params.hf] false, // true for hf order
2843
- * @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)
2844
- * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
2845
- */
2846
2846
  await this.loadMarkets();
2847
2847
  let paginate = false;
2848
2848
  [paginate, params] = this.handleOptionAndParams(params, 'fetchOpenOrders', 'paginate');
@@ -2851,25 +2851,25 @@ class kucoin extends kucoin$1 {
2851
2851
  }
2852
2852
  return await this.fetchOrdersByStatus('active', symbol, since, limit, params);
2853
2853
  }
2854
+ /**
2855
+ * @method
2856
+ * @name kucoin#fetchOrder
2857
+ * @description fetch an order
2858
+ * @see https://docs.kucoin.com/spot#get-an-order
2859
+ * @see https://docs.kucoin.com/spot#get-single-active-order-by-clientoid
2860
+ * @see https://docs.kucoin.com/spot#get-single-order-info
2861
+ * @see https://docs.kucoin.com/spot#get-single-order-by-clientoid
2862
+ * @see https://docs.kucoin.com/spot-hf/#details-of-a-single-hf-order
2863
+ * @see https://docs.kucoin.com/spot-hf/#obtain-details-of-a-single-hf-order-using-clientoid
2864
+ * @param {string} id Order id
2865
+ * @param {string} symbol not sent to exchange except for stop orders with clientOid, but used internally by CCXT to filter
2866
+ * @param {object} [params] exchange specific parameters
2867
+ * @param {bool} [params.stop] true if fetching a stop order
2868
+ * @param {bool} [params.hf] false, // true for hf order
2869
+ * @param {bool} [params.clientOid] unique order id created by users to identify their orders
2870
+ * @returns An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2871
+ */
2854
2872
  async fetchOrder(id, symbol = undefined, params = {}) {
2855
- /**
2856
- * @method
2857
- * @name kucoin#fetchOrder
2858
- * @description fetch an order
2859
- * @see https://docs.kucoin.com/spot#get-an-order
2860
- * @see https://docs.kucoin.com/spot#get-single-active-order-by-clientoid
2861
- * @see https://docs.kucoin.com/spot#get-single-order-info
2862
- * @see https://docs.kucoin.com/spot#get-single-order-by-clientoid
2863
- * @see https://docs.kucoin.com/spot-hf/#details-of-a-single-hf-order
2864
- * @see https://docs.kucoin.com/spot-hf/#obtain-details-of-a-single-hf-order-using-clientoid
2865
- * @param {string} id Order id
2866
- * @param {string} symbol not sent to exchange except for stop orders with clientOid, but used internally by CCXT to filter
2867
- * @param {object} [params] exchange specific parameters
2868
- * @param {bool} [params.stop] true if fetching a stop order
2869
- * @param {bool} [params.hf] false, // true for hf order
2870
- * @param {bool} [params.clientOid] unique order id created by users to identify their orders
2871
- * @returns An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2872
- */
2873
2873
  await this.loadMarkets();
2874
2874
  const request = {};
2875
2875
  const clientOrderId = this.safeString2(params, 'clientOid', 'clientOrderId');
@@ -3110,41 +3110,41 @@ class kucoin extends kucoin$1 {
3110
3110
  'trades': undefined,
3111
3111
  }, market);
3112
3112
  }
3113
+ /**
3114
+ * @method
3115
+ * @name kucoin#fetchOrderTrades
3116
+ * @description fetch all the trades made from a single order
3117
+ * @see https://docs.kucoin.com/#list-fills
3118
+ * @see https://docs.kucoin.com/spot-hf/#transaction-details
3119
+ * @param {string} id order id
3120
+ * @param {string} symbol unified market symbol
3121
+ * @param {int} [since] the earliest time in ms to fetch trades for
3122
+ * @param {int} [limit] the maximum number of trades to retrieve
3123
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3124
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
3125
+ */
3113
3126
  async fetchOrderTrades(id, symbol = undefined, since = undefined, limit = undefined, params = {}) {
3114
- /**
3115
- * @method
3116
- * @name kucoin#fetchOrderTrades
3117
- * @description fetch all the trades made from a single order
3118
- * @see https://docs.kucoin.com/#list-fills
3119
- * @see https://docs.kucoin.com/spot-hf/#transaction-details
3120
- * @param {string} id order id
3121
- * @param {string} symbol unified market symbol
3122
- * @param {int} [since] the earliest time in ms to fetch trades for
3123
- * @param {int} [limit] the maximum number of trades to retrieve
3124
- * @param {object} [params] extra parameters specific to the exchange API endpoint
3125
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
3126
- */
3127
3127
  const request = {
3128
3128
  'orderId': id,
3129
3129
  };
3130
3130
  return await this.fetchMyTrades(symbol, since, limit, this.extend(request, params));
3131
3131
  }
3132
+ /**
3133
+ * @method
3134
+ * @name kucoin#fetchMyTrades
3135
+ * @see https://docs.kucoin.com/#list-fills
3136
+ * @see https://docs.kucoin.com/spot-hf/#transaction-details
3137
+ * @description fetch all trades made by the user
3138
+ * @param {string} symbol unified market symbol
3139
+ * @param {int} [since] the earliest time in ms to fetch trades for
3140
+ * @param {int} [limit] the maximum number of trades structures to retrieve
3141
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3142
+ * @param {int} [params.until] the latest time in ms to fetch entries for
3143
+ * @param {bool} [params.hf] false, // true for hf order
3144
+ * @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)
3145
+ * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
3146
+ */
3132
3147
  async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
3133
- /**
3134
- * @method
3135
- * @name kucoin#fetchMyTrades
3136
- * @see https://docs.kucoin.com/#list-fills
3137
- * @see https://docs.kucoin.com/spot-hf/#transaction-details
3138
- * @description fetch all trades made by the user
3139
- * @param {string} symbol unified market symbol
3140
- * @param {int} [since] the earliest time in ms to fetch trades for
3141
- * @param {int} [limit] the maximum number of trades structures to retrieve
3142
- * @param {object} [params] extra parameters specific to the exchange API endpoint
3143
- * @param {int} [params.until] the latest time in ms to fetch entries for
3144
- * @param {bool} [params.hf] false, // true for hf order
3145
- * @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)
3146
- * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
3147
- */
3148
3148
  await this.loadMarkets();
3149
3149
  let paginate = false;
3150
3150
  [paginate, params] = this.handleOptionAndParams(params, 'fetchMyTrades', 'paginate');
@@ -3240,18 +3240,18 @@ class kucoin extends kucoin$1 {
3240
3240
  }
3241
3241
  return this.parseTrades(trades, market, since, limit);
3242
3242
  }
3243
+ /**
3244
+ * @method
3245
+ * @name kucoin#fetchTrades
3246
+ * @description get the list of most recent trades for a particular symbol
3247
+ * @see https://www.kucoin.com/docs/rest/spot-trading/market-data/get-trade-histories
3248
+ * @param {string} symbol unified symbol of the market to fetch trades for
3249
+ * @param {int} [since] timestamp in ms of the earliest trade to fetch
3250
+ * @param {int} [limit] the maximum amount of trades to fetch
3251
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3252
+ * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
3253
+ */
3243
3254
  async fetchTrades(symbol, since = undefined, limit = undefined, params = {}) {
3244
- /**
3245
- * @method
3246
- * @name kucoin#fetchTrades
3247
- * @description get the list of most recent trades for a particular symbol
3248
- * @see https://www.kucoin.com/docs/rest/spot-trading/market-data/get-trade-histories
3249
- * @param {string} symbol unified symbol of the market to fetch trades for
3250
- * @param {int} [since] timestamp in ms of the earliest trade to fetch
3251
- * @param {int} [limit] the maximum amount of trades to fetch
3252
- * @param {object} [params] extra parameters specific to the exchange API endpoint
3253
- * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
3254
- */
3255
3255
  await this.loadMarkets();
3256
3256
  const market = this.market(symbol);
3257
3257
  const request = {
@@ -3413,16 +3413,16 @@ class kucoin extends kucoin$1 {
3413
3413
  'fee': fee,
3414
3414
  }, market);
3415
3415
  }
3416
+ /**
3417
+ * @method
3418
+ * @name kucoin#fetchTradingFee
3419
+ * @description fetch the trading fees for a market
3420
+ * @see https://www.kucoin.com/docs/rest/funding/trade-fee/trading-pair-actual-fee-spot-margin-trade_hf
3421
+ * @param {string} symbol unified market symbol
3422
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3423
+ * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
3424
+ */
3416
3425
  async fetchTradingFee(symbol, params = {}) {
3417
- /**
3418
- * @method
3419
- * @name kucoin#fetchTradingFee
3420
- * @description fetch the trading fees for a market
3421
- * @see https://www.kucoin.com/docs/rest/funding/trade-fee/trading-pair-actual-fee-spot-margin-trade_hf
3422
- * @param {string} symbol unified market symbol
3423
- * @param {object} [params] extra parameters specific to the exchange API endpoint
3424
- * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
3425
- */
3426
3426
  await this.loadMarkets();
3427
3427
  const market = this.market(symbol);
3428
3428
  const request = {
@@ -3453,19 +3453,19 @@ class kucoin extends kucoin$1 {
3453
3453
  'tierBased': true,
3454
3454
  };
3455
3455
  }
3456
+ /**
3457
+ * @method
3458
+ * @name kucoin#withdraw
3459
+ * @description make a withdrawal
3460
+ * @see https://www.kucoin.com/docs/rest/funding/withdrawals/apply-withdraw-v3-
3461
+ * @param {string} code unified currency code
3462
+ * @param {float} amount the amount to withdraw
3463
+ * @param {string} address the address to withdraw to
3464
+ * @param {string} tag
3465
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3466
+ * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
3467
+ */
3456
3468
  async withdraw(code, amount, address, tag = undefined, params = {}) {
3457
- /**
3458
- * @method
3459
- * @name kucoin#withdraw
3460
- * @description make a withdrawal
3461
- * @see https://www.kucoin.com/docs/rest/funding/withdrawals/apply-withdraw-v3-
3462
- * @param {string} code unified currency code
3463
- * @param {float} amount the amount to withdraw
3464
- * @param {string} address the address to withdraw to
3465
- * @param {string} tag
3466
- * @param {object} [params] extra parameters specific to the exchange API endpoint
3467
- * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
3468
- */
3469
3469
  [tag, params] = this.handleWithdrawTagAndParams(tag, params);
3470
3470
  await this.loadMarkets();
3471
3471
  this.checkAddress(address);
@@ -3629,21 +3629,21 @@ class kucoin extends kucoin$1 {
3629
3629
  'updated': updated,
3630
3630
  };
3631
3631
  }
3632
+ /**
3633
+ * @method
3634
+ * @name kucoin#fetchDeposits
3635
+ * @description fetch all deposits made to an account
3636
+ * @see https://www.kucoin.com/docs/rest/funding/deposit/get-deposit-list
3637
+ * @see https://www.kucoin.com/docs/rest/funding/deposit/get-v1-historical-deposits-list
3638
+ * @param {string} code unified currency code
3639
+ * @param {int} [since] the earliest time in ms to fetch deposits for
3640
+ * @param {int} [limit] the maximum number of deposits structures to retrieve
3641
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3642
+ * @param {int} [params.until] the latest time in ms to fetch entries for
3643
+ * @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)
3644
+ * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
3645
+ */
3632
3646
  async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
3633
- /**
3634
- * @method
3635
- * @name kucoin#fetchDeposits
3636
- * @description fetch all deposits made to an account
3637
- * @see https://www.kucoin.com/docs/rest/funding/deposit/get-deposit-list
3638
- * @see https://www.kucoin.com/docs/rest/funding/deposit/get-v1-historical-deposits-list
3639
- * @param {string} code unified currency code
3640
- * @param {int} [since] the earliest time in ms to fetch deposits for
3641
- * @param {int} [limit] the maximum number of deposits structures to retrieve
3642
- * @param {object} [params] extra parameters specific to the exchange API endpoint
3643
- * @param {int} [params.until] the latest time in ms to fetch entries for
3644
- * @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)
3645
- * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
3646
- */
3647
3647
  await this.loadMarkets();
3648
3648
  let paginate = false;
3649
3649
  [paginate, params] = this.handleOptionAndParams(params, 'fetchDeposits', 'paginate');
@@ -3714,21 +3714,21 @@ class kucoin extends kucoin$1 {
3714
3714
  const items = this.safeList(data, 'items', []);
3715
3715
  return this.parseTransactions(items, currency, since, limit, { 'type': 'deposit' });
3716
3716
  }
3717
+ /**
3718
+ * @method
3719
+ * @name kucoin#fetchWithdrawals
3720
+ * @description fetch all withdrawals made from an account
3721
+ * @see https://www.kucoin.com/docs/rest/funding/withdrawals/get-withdrawals-list
3722
+ * @see https://www.kucoin.com/docs/rest/funding/withdrawals/get-v1-historical-withdrawals-list
3723
+ * @param {string} code unified currency code
3724
+ * @param {int} [since] the earliest time in ms to fetch withdrawals for
3725
+ * @param {int} [limit] the maximum number of withdrawals structures to retrieve
3726
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3727
+ * @param {int} [params.until] the latest time in ms to fetch entries for
3728
+ * @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)
3729
+ * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
3730
+ */
3717
3731
  async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
3718
- /**
3719
- * @method
3720
- * @name kucoin#fetchWithdrawals
3721
- * @description fetch all withdrawals made from an account
3722
- * @see https://www.kucoin.com/docs/rest/funding/withdrawals/get-withdrawals-list
3723
- * @see https://www.kucoin.com/docs/rest/funding/withdrawals/get-v1-historical-withdrawals-list
3724
- * @param {string} code unified currency code
3725
- * @param {int} [since] the earliest time in ms to fetch withdrawals for
3726
- * @param {int} [limit] the maximum number of withdrawals structures to retrieve
3727
- * @param {object} [params] extra parameters specific to the exchange API endpoint
3728
- * @param {int} [params.until] the latest time in ms to fetch entries for
3729
- * @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)
3730
- * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
3731
- */
3732
3732
  await this.loadMarkets();
3733
3733
  let paginate = false;
3734
3734
  [paginate, params] = this.handleOptionAndParams(params, 'fetchWithdrawals', 'paginate');
@@ -3810,20 +3810,20 @@ class kucoin extends kucoin$1 {
3810
3810
  account['debt'] = Precise["default"].stringAdd(debt, interest);
3811
3811
  return account;
3812
3812
  }
3813
+ /**
3814
+ * @method
3815
+ * @name kucoin#fetchBalance
3816
+ * @description query for balance and get the amount of funds available for trading or funds locked in orders
3817
+ * @see https://www.kucoin.com/docs/rest/account/basic-info/get-account-list-spot-margin-trade_hf
3818
+ * @see https://www.kucoin.com/docs/rest/funding/funding-overview/get-account-detail-margin
3819
+ * @see https://www.kucoin.com/docs/rest/funding/funding-overview/get-account-detail-isolated-margin
3820
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3821
+ * @param {object} [params.marginMode] 'cross' or 'isolated', margin type for fetching margin balance
3822
+ * @param {object} [params.type] extra parameters specific to the exchange API endpoint
3823
+ * @param {object} [params.hf] *default if false* if true, the result includes the balance of the high frequency account
3824
+ * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
3825
+ */
3813
3826
  async fetchBalance(params = {}) {
3814
- /**
3815
- * @method
3816
- * @name kucoin#fetchBalance
3817
- * @description query for balance and get the amount of funds available for trading or funds locked in orders
3818
- * @see https://www.kucoin.com/docs/rest/account/basic-info/get-account-list-spot-margin-trade_hf
3819
- * @see https://www.kucoin.com/docs/rest/funding/funding-overview/get-account-detail-margin
3820
- * @see https://www.kucoin.com/docs/rest/funding/funding-overview/get-account-detail-isolated-margin
3821
- * @param {object} [params] extra parameters specific to the exchange API endpoint
3822
- * @param {object} [params.marginMode] 'cross' or 'isolated', margin type for fetching margin balance
3823
- * @param {object} [params.type] extra parameters specific to the exchange API endpoint
3824
- * @param {object} [params.hf] *default if false* if true, the result includes the balance of the high frequency account
3825
- * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
3826
- */
3827
3827
  await this.loadMarkets();
3828
3828
  const code = this.safeString(params, 'code');
3829
3829
  let currency = undefined;
@@ -3990,21 +3990,21 @@ class kucoin extends kucoin$1 {
3990
3990
  const returnType = isolated ? result : this.safeBalance(result);
3991
3991
  return returnType;
3992
3992
  }
3993
+ /**
3994
+ * @method
3995
+ * @name kucoin#transfer
3996
+ * @description transfer currency internally between wallets on the same account
3997
+ * @see https://www.kucoin.com/docs/rest/funding/transfer/inner-transfer
3998
+ * @see https://docs.kucoin.com/futures/#transfer-funds-to-kucoin-main-account-2
3999
+ * @see https://docs.kucoin.com/spot-hf/#internal-funds-transfers-in-high-frequency-trading-accounts
4000
+ * @param {string} code unified currency code
4001
+ * @param {float} amount amount to transfer
4002
+ * @param {string} fromAccount account to transfer from
4003
+ * @param {string} toAccount account to transfer to
4004
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
4005
+ * @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
4006
+ */
3993
4007
  async transfer(code, amount, fromAccount, toAccount, params = {}) {
3994
- /**
3995
- * @method
3996
- * @name kucoin#transfer
3997
- * @description transfer currency internally between wallets on the same account
3998
- * @see https://www.kucoin.com/docs/rest/funding/transfer/inner-transfer
3999
- * @see https://docs.kucoin.com/futures/#transfer-funds-to-kucoin-main-account-2
4000
- * @see https://docs.kucoin.com/spot-hf/#internal-funds-transfers-in-high-frequency-trading-accounts
4001
- * @param {string} code unified currency code
4002
- * @param {float} amount amount to transfer
4003
- * @param {string} fromAccount account to transfer from
4004
- * @param {string} toAccount account to transfer to
4005
- * @param {object} [params] extra parameters specific to the exchange API endpoint
4006
- * @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
4007
- */
4008
4008
  await this.loadMarkets();
4009
4009
  const currency = this.currency(code);
4010
4010
  const requestedAmount = this.currencyToPrecision(code, amount);
@@ -4275,23 +4275,23 @@ class kucoin extends kucoin$1 {
4275
4275
  'fee': fee,
4276
4276
  }, currency);
4277
4277
  }
4278
+ /**
4279
+ * @method
4280
+ * @name kucoin#fetchLedger
4281
+ * @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
4282
+ * @see https://www.kucoin.com/docs/rest/account/basic-info/get-account-ledgers-spot-margin
4283
+ * @see https://www.kucoin.com/docs/rest/account/basic-info/get-account-ledgers-trade_hf
4284
+ * @see https://www.kucoin.com/docs/rest/account/basic-info/get-account-ledgers-margin_hf
4285
+ * @param {string} [code] unified currency code, default is undefined
4286
+ * @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
4287
+ * @param {int} [limit] max number of ledger entries to return, default is undefined
4288
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
4289
+ * @param {boolean} [params.hf] default false, when true will fetch ledger entries for the high frequency trading account
4290
+ * @param {int} [params.until] the latest time in ms to fetch entries for
4291
+ * @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)
4292
+ * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
4293
+ */
4278
4294
  async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
4279
- /**
4280
- * @method
4281
- * @name kucoin#fetchLedger
4282
- * @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
4283
- * @see https://www.kucoin.com/docs/rest/account/basic-info/get-account-ledgers-spot-margin
4284
- * @see https://www.kucoin.com/docs/rest/account/basic-info/get-account-ledgers-trade_hf
4285
- * @see https://www.kucoin.com/docs/rest/account/basic-info/get-account-ledgers-margin_hf
4286
- * @param {string} [code] unified currency code, default is undefined
4287
- * @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
4288
- * @param {int} [limit] max number of ledger entries to return, default is undefined
4289
- * @param {object} [params] extra parameters specific to the exchange API endpoint
4290
- * @param {boolean} [params.hf] default false, when true will fetch ledger entries for the high frequency trading account
4291
- * @param {int} [params.until] the latest time in ms to fetch entries for
4292
- * @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)
4293
- * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
4294
- */
4295
4295
  await this.loadMarkets();
4296
4296
  await this.loadAccounts();
4297
4297
  let paginate = false;
@@ -4424,33 +4424,40 @@ class kucoin extends kucoin$1 {
4424
4424
  'info': info,
4425
4425
  };
4426
4426
  }
4427
+ /**
4428
+ * @method
4429
+ * @name kucoin#fetchBorrowInterest
4430
+ * @description fetch the interest owed by the user for borrowing currency for margin trading
4431
+ * @see https://docs.kucoin.com/#get-repay-record
4432
+ * @see https://docs.kucoin.com/#query-isolated-margin-account-info
4433
+ * @param {string} [code] unified currency code
4434
+ * @param {string} [symbol] unified market symbol, required for isolated margin
4435
+ * @param {int} [since] the earliest time in ms to fetch borrrow interest for
4436
+ * @param {int} [limit] the maximum number of structures to retrieve
4437
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
4438
+ * @param {string} [params.marginMode] 'cross' or 'isolated' default is 'cross'
4439
+ * @returns {object[]} a list of [borrow interest structures]{@link https://docs.ccxt.com/#/?id=borrow-interest-structure}
4440
+ */
4427
4441
  async fetchBorrowInterest(code = undefined, symbol = undefined, since = undefined, limit = undefined, params = {}) {
4428
- /**
4429
- * @method
4430
- * @name kucoin#fetchBorrowInterest
4431
- * @description fetch the interest owed by the user for borrowing currency for margin trading
4432
- * @see https://docs.kucoin.com/#get-repay-record
4433
- * @see https://docs.kucoin.com/#query-isolated-margin-account-info
4434
- * @param {string} code unified currency code
4435
- * @param {string} symbol unified market symbol, required for isolated margin
4436
- * @param {int} [since] the earliest time in ms to fetch borrrow interest for
4437
- * @param {int} [limit] the maximum number of structures to retrieve
4438
- * @param {object} [params] extra parameters specific to the exchange API endpoint
4439
- * @param {string} [params.marginMode] 'cross' or 'isolated' default is 'cross'
4440
- * @returns {object[]} a list of [borrow interest structures]{@link https://docs.ccxt.com/#/?id=borrow-interest-structure}
4441
- */
4442
4442
  await this.loadMarkets();
4443
4443
  let marginMode = undefined;
4444
- [marginMode, params] = this.handleMarginModeAndParams('fetchBorrowInterest', params);
4445
- if (marginMode === undefined) {
4446
- marginMode = 'cross'; // cross as default marginMode
4447
- }
4444
+ [marginMode, params] = this.handleMarginModeAndParams('fetchBorrowInterest', params, 'cross');
4448
4445
  const request = {};
4449
- let response = undefined;
4446
+ let currency = undefined;
4450
4447
  if (code !== undefined) {
4451
- const currency = this.currency(code);
4452
- request['quoteCurrency'] = currency['id'];
4448
+ currency = this.currency(code);
4449
+ if (marginMode === 'isolated') {
4450
+ request['balanceCurrency'] = currency['id'];
4451
+ }
4452
+ else {
4453
+ request['quoteCurrency'] = currency['id'];
4454
+ }
4453
4455
  }
4456
+ let market = undefined;
4457
+ if (symbol !== undefined) {
4458
+ market = this.market(symbol);
4459
+ }
4460
+ let response = undefined;
4454
4461
  if (marginMode === 'isolated') {
4455
4462
  response = await this.privateGetIsolatedAccounts(this.extend(request, params));
4456
4463
  }
@@ -4523,7 +4530,9 @@ class kucoin extends kucoin$1 {
4523
4530
  //
4524
4531
  const data = this.safeDict(response, 'data', {});
4525
4532
  const assets = (marginMode === 'isolated') ? this.safeList(data, 'assets', []) : this.safeList(data, 'accounts', []);
4526
- return this.parseBorrowInterests(assets, undefined);
4533
+ const interest = this.parseBorrowInterests(assets, market);
4534
+ const filteredByCurrency = this.filterByCurrencySinceLimit(interest, code, since, limit);
4535
+ return this.filterBySymbolSinceLimit(filteredByCurrency, symbol, since, limit);
4527
4536
  }
4528
4537
  parseBorrowInterest(info, market = undefined) {
4529
4538
  //
@@ -4601,20 +4610,20 @@ class kucoin extends kucoin$1 {
4601
4610
  'datetime': this.iso8601(timestamp),
4602
4611
  };
4603
4612
  }
4613
+ /**
4614
+ * @method
4615
+ * @name kucoin#fetchBorrowRateHistories
4616
+ * @description retrieves a history of a multiple currencies borrow interest rate at specific time slots, returns all currencies if no symbols passed, default is undefined
4617
+ * @see https://www.kucoin.com/docs/rest/margin-trading/margin-trading-v3-/get-cross-isolated-margin-interest-records
4618
+ * @param {string[]|undefined} codes list of unified currency codes, default is undefined
4619
+ * @param {int} [since] timestamp in ms of the earliest borrowRate, default is undefined
4620
+ * @param {int} [limit] max number of borrow rate prices to return, default is undefined
4621
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
4622
+ * @param {string} [params.marginMode] 'cross' or 'isolated' default is 'cross'
4623
+ * @param {int} [params.until] the latest time in ms to fetch entries for
4624
+ * @returns {object} a dictionary of [borrow rate structures]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure} indexed by the market symbol
4625
+ */
4604
4626
  async fetchBorrowRateHistories(codes = undefined, since = undefined, limit = undefined, params = {}) {
4605
- /**
4606
- * @method
4607
- * @name kucoin#fetchBorrowRateHistories
4608
- * @description retrieves a history of a multiple currencies borrow interest rate at specific time slots, returns all currencies if no symbols passed, default is undefined
4609
- * @see https://www.kucoin.com/docs/rest/margin-trading/margin-trading-v3-/get-cross-isolated-margin-interest-records
4610
- * @param {string[]|undefined} codes list of unified currency codes, default is undefined
4611
- * @param {int} [since] timestamp in ms of the earliest borrowRate, default is undefined
4612
- * @param {int} [limit] max number of borrow rate prices to return, default is undefined
4613
- * @param {object} [params] extra parameters specific to the exchange API endpoint
4614
- * @param {string} [params.marginMode] 'cross' or 'isolated' default is 'cross'
4615
- * @param {int} [params.until] the latest time in ms to fetch entries for
4616
- * @returns {object} a dictionary of [borrow rate structures]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure} indexed by the market symbol
4617
- */
4618
4627
  await this.loadMarkets();
4619
4628
  const marginResult = this.handleMarginModeAndParams('fetchBorrowRateHistories', params);
4620
4629
  const marginMode = this.safeString(marginResult, 0, 'cross');
@@ -4654,20 +4663,20 @@ class kucoin extends kucoin$1 {
4654
4663
  const rows = this.safeList(data, 'items', []);
4655
4664
  return this.parseBorrowRateHistories(rows, codes, since, limit);
4656
4665
  }
4666
+ /**
4667
+ * @method
4668
+ * @name kucoin#fetchBorrowRateHistory
4669
+ * @description retrieves a history of a currencies borrow interest rate at specific time slots
4670
+ * @see https://www.kucoin.com/docs/rest/margin-trading/margin-trading-v3-/get-cross-isolated-margin-interest-records
4671
+ * @param {string} code unified currency code
4672
+ * @param {int} [since] timestamp for the earliest borrow rate
4673
+ * @param {int} [limit] the maximum number of [borrow rate structures]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure} to retrieve
4674
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
4675
+ * @param {string} [params.marginMode] 'cross' or 'isolated' default is 'cross'
4676
+ * @param {int} [params.until] the latest time in ms to fetch entries for
4677
+ * @returns {object[]} an array of [borrow rate structures]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure}
4678
+ */
4657
4679
  async fetchBorrowRateHistory(code, since = undefined, limit = undefined, params = {}) {
4658
- /**
4659
- * @method
4660
- * @name kucoin#fetchBorrowRateHistory
4661
- * @description retrieves a history of a currencies borrow interest rate at specific time slots
4662
- * @see https://www.kucoin.com/docs/rest/margin-trading/margin-trading-v3-/get-cross-isolated-margin-interest-records
4663
- * @param {string} code unified currency code
4664
- * @param {int} [since] timestamp for the earliest borrow rate
4665
- * @param {int} [limit] the maximum number of [borrow rate structures]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure} to retrieve
4666
- * @param {object} [params] extra parameters specific to the exchange API endpoint
4667
- * @param {string} [params.marginMode] 'cross' or 'isolated' default is 'cross'
4668
- * @param {int} [params.until] the latest time in ms to fetch entries for
4669
- * @returns {object[]} an array of [borrow rate structures]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure}
4670
- */
4671
4680
  await this.loadMarkets();
4672
4681
  const marginResult = this.handleMarginModeAndParams('fetchBorrowRateHistories', params);
4673
4682
  const marginMode = this.safeString(marginResult, 0, 'cross');
@@ -4739,18 +4748,18 @@ class kucoin extends kucoin$1 {
4739
4748
  }
4740
4749
  return borrowRateHistories;
4741
4750
  }
4751
+ /**
4752
+ * @method
4753
+ * @name kucoin#borrowCrossMargin
4754
+ * @description create a loan to borrow margin
4755
+ * @see https://docs.kucoin.com/#1-margin-borrowing
4756
+ * @param {string} code unified currency code of the currency to borrow
4757
+ * @param {float} amount the amount to borrow
4758
+ * @param {object} [params] extra parameters specific to the exchange API endpoints
4759
+ * @param {string} [params.timeInForce] either IOC or FOK
4760
+ * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
4761
+ */
4742
4762
  async borrowCrossMargin(code, amount, params = {}) {
4743
- /**
4744
- * @method
4745
- * @name kucoin#borrowCrossMargin
4746
- * @description create a loan to borrow margin
4747
- * @see https://docs.kucoin.com/#1-margin-borrowing
4748
- * @param {string} code unified currency code of the currency to borrow
4749
- * @param {float} amount the amount to borrow
4750
- * @param {object} [params] extra parameters specific to the exchange API endpoints
4751
- * @param {string} [params.timeInForce] either IOC or FOK
4752
- * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
4753
- */
4754
4763
  await this.loadMarkets();
4755
4764
  const currency = this.currency(code);
4756
4765
  const request = {
@@ -4774,19 +4783,19 @@ class kucoin extends kucoin$1 {
4774
4783
  const data = this.safeDict(response, 'data', {});
4775
4784
  return this.parseMarginLoan(data, currency);
4776
4785
  }
4786
+ /**
4787
+ * @method
4788
+ * @name kucoin#borrowIsolatedMargin
4789
+ * @description create a loan to borrow margin
4790
+ * @see https://docs.kucoin.com/#1-margin-borrowing
4791
+ * @param {string} symbol unified market symbol, required for isolated margin
4792
+ * @param {string} code unified currency code of the currency to borrow
4793
+ * @param {float} amount the amount to borrow
4794
+ * @param {object} [params] extra parameters specific to the exchange API endpoints
4795
+ * @param {string} [params.timeInForce] either IOC or FOK
4796
+ * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
4797
+ */
4777
4798
  async borrowIsolatedMargin(symbol, code, amount, params = {}) {
4778
- /**
4779
- * @method
4780
- * @name kucoin#borrowIsolatedMargin
4781
- * @description create a loan to borrow margin
4782
- * @see https://docs.kucoin.com/#1-margin-borrowing
4783
- * @param {string} symbol unified market symbol, required for isolated margin
4784
- * @param {string} code unified currency code of the currency to borrow
4785
- * @param {float} amount the amount to borrow
4786
- * @param {object} [params] extra parameters specific to the exchange API endpoints
4787
- * @param {string} [params.timeInForce] either IOC or FOK
4788
- * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
4789
- */
4790
4799
  await this.loadMarkets();
4791
4800
  const market = this.market(symbol);
4792
4801
  const currency = this.currency(code);
@@ -4813,17 +4822,17 @@ class kucoin extends kucoin$1 {
4813
4822
  const data = this.safeDict(response, 'data', {});
4814
4823
  return this.parseMarginLoan(data, currency);
4815
4824
  }
4825
+ /**
4826
+ * @method
4827
+ * @name kucoin#repayCrossMargin
4828
+ * @description repay borrowed margin and interest
4829
+ * @see https://docs.kucoin.com/#2-repayment
4830
+ * @param {string} code unified currency code of the currency to repay
4831
+ * @param {float} amount the amount to repay
4832
+ * @param {object} [params] extra parameters specific to the exchange API endpoints
4833
+ * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
4834
+ */
4816
4835
  async repayCrossMargin(code, amount, params = {}) {
4817
- /**
4818
- * @method
4819
- * @name kucoin#repayCrossMargin
4820
- * @description repay borrowed margin and interest
4821
- * @see https://docs.kucoin.com/#2-repayment
4822
- * @param {string} code unified currency code of the currency to repay
4823
- * @param {float} amount the amount to repay
4824
- * @param {object} [params] extra parameters specific to the exchange API endpoints
4825
- * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
4826
- */
4827
4836
  await this.loadMarkets();
4828
4837
  const currency = this.currency(code);
4829
4838
  const request = {
@@ -4846,18 +4855,18 @@ class kucoin extends kucoin$1 {
4846
4855
  const data = this.safeDict(response, 'data', {});
4847
4856
  return this.parseMarginLoan(data, currency);
4848
4857
  }
4858
+ /**
4859
+ * @method
4860
+ * @name kucoin#repayIsolatedMargin
4861
+ * @description repay borrowed margin and interest
4862
+ * @see https://docs.kucoin.com/#2-repayment
4863
+ * @param {string} symbol unified market symbol
4864
+ * @param {string} code unified currency code of the currency to repay
4865
+ * @param {float} amount the amount to repay
4866
+ * @param {object} [params] extra parameters specific to the exchange API endpoints
4867
+ * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
4868
+ */
4849
4869
  async repayIsolatedMargin(symbol, code, amount, params = {}) {
4850
- /**
4851
- * @method
4852
- * @name kucoin#repayIsolatedMargin
4853
- * @description repay borrowed margin and interest
4854
- * @see https://docs.kucoin.com/#2-repayment
4855
- * @param {string} symbol unified market symbol
4856
- * @param {string} code unified currency code of the currency to repay
4857
- * @param {float} amount the amount to repay
4858
- * @param {object} [params] extra parameters specific to the exchange API endpoints
4859
- * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
4860
- */
4861
4870
  await this.loadMarkets();
4862
4871
  const market = this.market(symbol);
4863
4872
  const currency = this.currency(code);
@@ -4902,16 +4911,16 @@ class kucoin extends kucoin$1 {
4902
4911
  'info': info,
4903
4912
  };
4904
4913
  }
4914
+ /**
4915
+ * @method
4916
+ * @name kucoin#fetchDepositWithdrawFees
4917
+ * @description fetch deposit and withdraw fees - *IMPORTANT* use fetchDepositWithdrawFee to get more in-depth info
4918
+ * @see https://docs.kucoin.com/#get-currencies
4919
+ * @param {string[]|undefined} codes list of unified currency codes
4920
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
4921
+ * @returns {object} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
4922
+ */
4905
4923
  async fetchDepositWithdrawFees(codes = undefined, params = {}) {
4906
- /**
4907
- * @method
4908
- * @name kucoin#fetchDepositWithdrawFees
4909
- * @description fetch deposit and withdraw fees - *IMPORTANT* use fetchDepositWithdrawFee to get more in-depth info
4910
- * @see https://docs.kucoin.com/#get-currencies
4911
- * @param {string[]|undefined} codes list of unified currency codes
4912
- * @param {object} [params] extra parameters specific to the exchange API endpoint
4913
- * @returns {object} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
4914
- */
4915
4924
  await this.loadMarkets();
4916
4925
  const response = await this.publicGetCurrencies(params);
4917
4926
  //
@@ -4935,16 +4944,17 @@ class kucoin extends kucoin$1 {
4935
4944
  const data = this.safeList(response, 'data', []);
4936
4945
  return this.parseDepositWithdrawFees(data, codes, 'currency');
4937
4946
  }
4947
+ /**
4948
+ * @method
4949
+ * @name kucoin#setLeverage
4950
+ * @description set the level of leverage for a market
4951
+ * @see https://www.kucoin.com/docs/rest/margin-trading/margin-trading-v3-/modify-leverage-multiplier
4952
+ * @param {int } [leverage] New leverage multiplier. Must be greater than 1 and up to two decimal places, and cannot be less than the user's current debt leverage or greater than the system's maximum leverage
4953
+ * @param {string} [symbol] unified market symbol
4954
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
4955
+ * @returns {object} response from the exchange
4956
+ */
4938
4957
  async setLeverage(leverage, symbol = undefined, params = {}) {
4939
- /**
4940
- * @method
4941
- * @name kucoin#setLeverage
4942
- * @description set the level of leverage for a market
4943
- * @see https://www.kucoin.com/docs/rest/margin-trading/margin-trading-v3-/modify-leverage-multiplier
4944
- * @param {string} symbol unified market symbol
4945
- * @param {object} [params] extra parameters specific to the exchange API endpoint
4946
- * @returns {object} response from the exchange
4947
- */
4948
4958
  await this.loadMarkets();
4949
4959
  let market = undefined;
4950
4960
  let marketType = undefined;