ccxt 4.4.30 → 4.4.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (496) hide show
  1. package/README.md +9 -3
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +1 -1
  4. package/dist/cjs/src/ace.js +123 -123
  5. package/dist/cjs/src/alpaca.js +237 -237
  6. package/dist/cjs/src/ascendex.js +342 -341
  7. package/dist/cjs/src/bigone.js +242 -242
  8. package/dist/cjs/src/binance.js +1339 -1291
  9. package/dist/cjs/src/bingx.js +639 -639
  10. package/dist/cjs/src/bit2c.js +111 -111
  11. package/dist/cjs/src/bitbank.js +142 -142
  12. package/dist/cjs/src/bitbns.js +140 -140
  13. package/dist/cjs/src/bitfinex.js +231 -231
  14. package/dist/cjs/src/bitfinex2.js +403 -403
  15. package/dist/cjs/src/bitflyer.js +184 -184
  16. package/dist/cjs/src/bitget.js +848 -846
  17. package/dist/cjs/src/bithumb.js +125 -124
  18. package/dist/cjs/src/bitmart.js +525 -525
  19. package/dist/cjs/src/bitmex.js +317 -317
  20. package/dist/cjs/src/bitopro.js +221 -221
  21. package/dist/cjs/src/bitrue.js +315 -315
  22. package/dist/cjs/src/bitso.js +220 -220
  23. package/dist/cjs/src/bitstamp.js +251 -251
  24. package/dist/cjs/src/bitteam.js +183 -183
  25. package/dist/cjs/src/bitvavo.js +247 -251
  26. package/dist/cjs/src/bl3p.js +82 -82
  27. package/dist/cjs/src/blockchaincom.js +211 -211
  28. package/dist/cjs/src/blofin.js +332 -331
  29. package/dist/cjs/src/btcalpha.js +166 -166
  30. package/dist/cjs/src/btcbox.js +108 -108
  31. package/dist/cjs/src/btcmarkets.js +198 -198
  32. package/dist/cjs/src/btcturk.js +124 -124
  33. package/dist/cjs/src/bybit.js +906 -900
  34. package/dist/cjs/src/cex.js +227 -226
  35. package/dist/cjs/src/coinbase.js +481 -481
  36. package/dist/cjs/src/coinbaseexchange.js +274 -274
  37. package/dist/cjs/src/coinbaseinternational.js +304 -304
  38. package/dist/cjs/src/coincatch.js +650 -650
  39. package/dist/cjs/src/coincheck.js +113 -113
  40. package/dist/cjs/src/coinex.js +611 -601
  41. package/dist/cjs/src/coinlist.js +304 -303
  42. package/dist/cjs/src/coinmate.js +162 -161
  43. package/dist/cjs/src/coinmetro.js +187 -187
  44. package/dist/cjs/src/coinone.js +124 -123
  45. package/dist/cjs/src/coinsph.js +237 -237
  46. package/dist/cjs/src/coinspot.js +82 -82
  47. package/dist/cjs/src/cryptocom.js +342 -341
  48. package/dist/cjs/src/currencycom.js +225 -224
  49. package/dist/cjs/src/delta.js +320 -320
  50. package/dist/cjs/src/deribit.js +411 -408
  51. package/dist/cjs/src/digifinex.js +432 -431
  52. package/dist/cjs/src/exmo.js +328 -327
  53. package/dist/cjs/src/gate.js +830 -791
  54. package/dist/cjs/src/gemini.js +199 -198
  55. package/dist/cjs/src/hashkey.js +520 -517
  56. package/dist/cjs/src/hitbtc.js +465 -462
  57. package/dist/cjs/src/hollaex.js +253 -252
  58. package/dist/cjs/src/htx.js +791 -848
  59. package/dist/cjs/src/huobijp.js +219 -218
  60. package/dist/cjs/src/hyperliquid.js +421 -417
  61. package/dist/cjs/src/idex.js +238 -237
  62. package/dist/cjs/src/independentreserve.js +133 -132
  63. package/dist/cjs/src/indodax.js +177 -171
  64. package/dist/cjs/src/kraken.js +381 -377
  65. package/dist/cjs/src/krakenfutures.js +285 -279
  66. package/dist/cjs/src/kucoin.js +632 -622
  67. package/dist/cjs/src/kucoinfutures.js +533 -457
  68. package/dist/cjs/src/kuna.js +283 -282
  69. package/dist/cjs/src/latoken.js +211 -210
  70. package/dist/cjs/src/lbank.js +268 -267
  71. package/dist/cjs/src/luno.js +174 -173
  72. package/dist/cjs/src/lykke.js +172 -171
  73. package/dist/cjs/src/mercado.js +123 -122
  74. package/dist/cjs/src/mexc.js +650 -646
  75. package/dist/cjs/src/ndax.js +229 -228
  76. package/dist/cjs/src/novadax.js +230 -229
  77. package/dist/cjs/src/oceanex.js +187 -186
  78. package/dist/cjs/src/okcoin.js +286 -285
  79. package/dist/cjs/src/okx.js +909 -904
  80. package/dist/cjs/src/onetrading.js +218 -218
  81. package/dist/cjs/src/oxfun.js +335 -334
  82. package/dist/cjs/src/p2b.js +154 -154
  83. package/dist/cjs/src/paradex.js +249 -244
  84. package/dist/cjs/src/paymium.js +101 -101
  85. package/dist/cjs/src/phemex.js +388 -390
  86. package/dist/cjs/src/poloniex.js +270 -270
  87. package/dist/cjs/src/poloniexfutures.js +250 -250
  88. package/dist/cjs/src/pro/alpaca.js +64 -64
  89. package/dist/cjs/src/pro/ascendex.js +64 -64
  90. package/dist/cjs/src/pro/binance.js +546 -543
  91. package/dist/cjs/src/pro/bingx.js +116 -116
  92. package/dist/cjs/src/pro/bitfinex.js +42 -42
  93. package/dist/cjs/src/pro/bitfinex2.js +66 -66
  94. package/dist/cjs/src/pro/bitget.js +188 -181
  95. package/dist/cjs/src/pro/bithumb.js +40 -40
  96. package/dist/cjs/src/pro/bitmart.js +121 -119
  97. package/dist/cjs/src/pro/bitmex.js +135 -133
  98. package/dist/cjs/src/pro/bitopro.js +49 -49
  99. package/dist/cjs/src/pro/bitrue.js +19 -19
  100. package/dist/cjs/src/pro/bitstamp.js +29 -29
  101. package/dist/cjs/src/pro/bitvavo.js +299 -301
  102. package/dist/cjs/src/pro/blockchaincom.js +62 -62
  103. package/dist/cjs/src/pro/blofin.js +132 -130
  104. package/dist/cjs/src/pro/bybit.js +317 -313
  105. package/dist/cjs/src/pro/cex.js +168 -168
  106. package/dist/cjs/src/pro/coinbase.js +93 -91
  107. package/dist/cjs/src/pro/coinbaseexchange.js +95 -95
  108. package/dist/cjs/src/pro/coinbaseinternational.js +111 -111
  109. package/dist/cjs/src/pro/coincatch.js +150 -143
  110. package/dist/cjs/src/pro/coincheck.js +21 -21
  111. package/dist/cjs/src/pro/coinex.js +110 -110
  112. package/dist/cjs/src/pro/coinone.js +30 -30
  113. package/dist/cjs/src/pro/cryptocom.js +227 -227
  114. package/dist/cjs/src/pro/currencycom.js +45 -45
  115. package/dist/cjs/src/pro/deribit.js +127 -127
  116. package/dist/cjs/src/pro/exmo.js +66 -66
  117. package/dist/cjs/src/pro/gate.js +287 -283
  118. package/dist/cjs/src/pro/gemini.js +74 -74
  119. package/dist/cjs/src/pro/hashkey.js +87 -85
  120. package/dist/cjs/src/pro/hitbtc.js +190 -190
  121. package/dist/cjs/src/pro/hollaex.js +51 -51
  122. package/dist/cjs/src/pro/htx.js +96 -94
  123. package/dist/cjs/src/pro/huobijp.js +38 -38
  124. package/dist/cjs/src/pro/hyperliquid.js +151 -150
  125. package/dist/cjs/src/pro/idex.js +48 -48
  126. package/dist/cjs/src/pro/independentreserve.js +19 -19
  127. package/dist/cjs/src/pro/kraken.js +167 -167
  128. package/dist/cjs/src/pro/krakenfutures.js +137 -138
  129. package/dist/cjs/src/pro/kucoin.js +167 -168
  130. package/dist/cjs/src/pro/kucoinfutures.js +147 -147
  131. package/dist/cjs/src/pro/lbank.js +95 -95
  132. package/dist/cjs/src/pro/luno.js +21 -21
  133. package/dist/cjs/src/pro/mexc.js +102 -103
  134. package/dist/cjs/src/pro/ndax.js +42 -42
  135. package/dist/cjs/src/pro/okcoin.js +61 -61
  136. package/dist/cjs/src/pro/okx.js +332 -330
  137. package/dist/cjs/src/pro/onetrading.js +71 -71
  138. package/dist/cjs/src/pro/oxfun.js +193 -191
  139. package/dist/cjs/src/pro/p2b.js +77 -77
  140. package/dist/cjs/src/pro/paradex.js +39 -39
  141. package/dist/cjs/src/pro/phemex.js +94 -94
  142. package/dist/cjs/src/pro/poloniex.js +171 -171
  143. package/dist/cjs/src/pro/poloniexfutures.js +62 -62
  144. package/dist/cjs/src/pro/probit.js +63 -63
  145. package/dist/cjs/src/pro/upbit.js +80 -80
  146. package/dist/cjs/src/pro/vertex.js +65 -63
  147. package/dist/cjs/src/pro/wazirx.js +70 -70
  148. package/dist/cjs/src/pro/whitebit.js +83 -83
  149. package/dist/cjs/src/pro/woo.js +106 -104
  150. package/dist/cjs/src/pro/woofipro.js +105 -103
  151. package/dist/cjs/src/pro/xt.js +119 -119
  152. package/dist/cjs/src/probit.js +229 -229
  153. package/dist/cjs/src/timex.js +198 -197
  154. package/dist/cjs/src/tokocrypto.js +214 -213
  155. package/dist/cjs/src/tradeogre.js +92 -91
  156. package/dist/cjs/src/upbit.js +243 -242
  157. package/dist/cjs/src/vertex.js +258 -258
  158. package/dist/cjs/src/wavesexchange.js +176 -172
  159. package/dist/cjs/src/wazirx.js +168 -168
  160. package/dist/cjs/src/whitebit.js +361 -361
  161. package/dist/cjs/src/woo.js +571 -572
  162. package/dist/cjs/src/woofipro.js +392 -391
  163. package/dist/cjs/src/xt.js +436 -435
  164. package/dist/cjs/src/yobit.js +159 -158
  165. package/dist/cjs/src/zaif.js +103 -103
  166. package/dist/cjs/src/zonda.js +168 -168
  167. package/js/ccxt.d.ts +1 -1
  168. package/js/ccxt.js +1 -1
  169. package/js/src/ace.d.ts +123 -0
  170. package/js/src/ace.js +123 -123
  171. package/js/src/alpaca.d.ts +237 -0
  172. package/js/src/alpaca.js +237 -237
  173. package/js/src/ascendex.d.ts +339 -0
  174. package/js/src/ascendex.js +342 -341
  175. package/js/src/base/types.d.ts +1 -0
  176. package/js/src/bigone.d.ts +242 -0
  177. package/js/src/bigone.js +242 -242
  178. package/js/src/binance.d.ts +1306 -0
  179. package/js/src/binance.js +1339 -1291
  180. package/js/src/bingx.d.ts +639 -0
  181. package/js/src/bingx.js +639 -639
  182. package/js/src/bit2c.d.ts +111 -0
  183. package/js/src/bit2c.js +111 -111
  184. package/js/src/bitbank.d.ts +142 -0
  185. package/js/src/bitbank.js +142 -142
  186. package/js/src/bitbns.d.ts +140 -0
  187. package/js/src/bitbns.js +140 -140
  188. package/js/src/bitfinex.d.ts +231 -0
  189. package/js/src/bitfinex.js +231 -231
  190. package/js/src/bitfinex2.d.ts +403 -0
  191. package/js/src/bitfinex2.js +403 -403
  192. package/js/src/bitflyer.d.ts +184 -0
  193. package/js/src/bitflyer.js +184 -184
  194. package/js/src/bitget.d.ts +846 -0
  195. package/js/src/bitget.js +848 -846
  196. package/js/src/bithumb.d.ts +125 -0
  197. package/js/src/bithumb.js +125 -124
  198. package/js/src/bitmart.d.ts +525 -0
  199. package/js/src/bitmart.js +525 -525
  200. package/js/src/bitmex.d.ts +317 -0
  201. package/js/src/bitmex.js +317 -317
  202. package/js/src/bitopro.d.ts +221 -0
  203. package/js/src/bitopro.js +221 -221
  204. package/js/src/bitrue.d.ts +315 -0
  205. package/js/src/bitrue.js +315 -315
  206. package/js/src/bitso.d.ts +220 -0
  207. package/js/src/bitso.js +220 -220
  208. package/js/src/bitstamp.d.ts +251 -0
  209. package/js/src/bitstamp.js +251 -251
  210. package/js/src/bitteam.d.ts +183 -0
  211. package/js/src/bitteam.js +183 -183
  212. package/js/src/bitvavo.d.ts +247 -0
  213. package/js/src/bitvavo.js +247 -251
  214. package/js/src/bl3p.d.ts +82 -0
  215. package/js/src/bl3p.js +82 -82
  216. package/js/src/blockchaincom.d.ts +211 -0
  217. package/js/src/blockchaincom.js +211 -211
  218. package/js/src/blofin.d.ts +332 -0
  219. package/js/src/blofin.js +332 -331
  220. package/js/src/btcalpha.d.ts +166 -0
  221. package/js/src/btcalpha.js +166 -166
  222. package/js/src/btcbox.d.ts +108 -0
  223. package/js/src/btcbox.js +108 -108
  224. package/js/src/btcmarkets.d.ts +198 -0
  225. package/js/src/btcmarkets.js +198 -198
  226. package/js/src/btcturk.d.ts +124 -0
  227. package/js/src/btcturk.js +124 -124
  228. package/js/src/bybit.d.ts +906 -1
  229. package/js/src/bybit.js +906 -900
  230. package/js/src/cex.d.ts +227 -0
  231. package/js/src/cex.js +227 -226
  232. package/js/src/coinbase.d.ts +481 -0
  233. package/js/src/coinbase.js +481 -481
  234. package/js/src/coinbaseexchange.d.ts +274 -0
  235. package/js/src/coinbaseexchange.js +274 -274
  236. package/js/src/coinbaseinternational.d.ts +304 -0
  237. package/js/src/coinbaseinternational.js +304 -304
  238. package/js/src/coincatch.d.ts +646 -0
  239. package/js/src/coincatch.js +650 -650
  240. package/js/src/coincheck.d.ts +113 -0
  241. package/js/src/coincheck.js +113 -113
  242. package/js/src/coinex.d.ts +603 -0
  243. package/js/src/coinex.js +611 -601
  244. package/js/src/coinlist.d.ts +304 -0
  245. package/js/src/coinlist.js +304 -303
  246. package/js/src/coinmate.d.ts +162 -0
  247. package/js/src/coinmate.js +162 -161
  248. package/js/src/coinmetro.d.ts +187 -0
  249. package/js/src/coinmetro.js +187 -187
  250. package/js/src/coinone.d.ts +124 -0
  251. package/js/src/coinone.js +124 -123
  252. package/js/src/coinsph.d.ts +237 -0
  253. package/js/src/coinsph.js +237 -237
  254. package/js/src/coinspot.d.ts +82 -0
  255. package/js/src/coinspot.js +82 -82
  256. package/js/src/cryptocom.d.ts +342 -0
  257. package/js/src/cryptocom.js +342 -341
  258. package/js/src/currencycom.d.ts +225 -0
  259. package/js/src/currencycom.js +225 -224
  260. package/js/src/delta.d.ts +320 -0
  261. package/js/src/delta.js +320 -320
  262. package/js/src/deribit.d.ts +411 -0
  263. package/js/src/deribit.js +411 -408
  264. package/js/src/digifinex.d.ts +430 -0
  265. package/js/src/digifinex.js +432 -431
  266. package/js/src/exmo.d.ts +328 -0
  267. package/js/src/exmo.js +328 -327
  268. package/js/src/gate.d.ts +803 -1
  269. package/js/src/gate.js +830 -791
  270. package/js/src/gemini.d.ts +199 -0
  271. package/js/src/gemini.js +199 -198
  272. package/js/src/hashkey.d.ts +516 -0
  273. package/js/src/hashkey.js +520 -517
  274. package/js/src/hitbtc.d.ts +465 -0
  275. package/js/src/hitbtc.js +465 -462
  276. package/js/src/hollaex.d.ts +253 -0
  277. package/js/src/hollaex.js +253 -252
  278. package/js/src/htx.d.ts +765 -2
  279. package/js/src/htx.js +791 -848
  280. package/js/src/huobijp.d.ts +219 -0
  281. package/js/src/huobijp.js +219 -218
  282. package/js/src/hyperliquid.d.ts +419 -0
  283. package/js/src/hyperliquid.js +421 -417
  284. package/js/src/idex.d.ts +238 -0
  285. package/js/src/idex.js +238 -237
  286. package/js/src/independentreserve.d.ts +133 -0
  287. package/js/src/independentreserve.js +133 -132
  288. package/js/src/indodax.d.ts +171 -0
  289. package/js/src/indodax.js +177 -171
  290. package/js/src/kraken.d.ts +381 -0
  291. package/js/src/kraken.js +381 -377
  292. package/js/src/krakenfutures.d.ts +282 -0
  293. package/js/src/krakenfutures.js +285 -279
  294. package/js/src/kucoin.d.ts +613 -0
  295. package/js/src/kucoin.js +632 -622
  296. package/js/src/kucoinfutures.d.ts +441 -0
  297. package/js/src/kucoinfutures.js +533 -457
  298. package/js/src/kuna.d.ts +283 -0
  299. package/js/src/kuna.js +283 -282
  300. package/js/src/latoken.d.ts +211 -0
  301. package/js/src/latoken.js +211 -210
  302. package/js/src/lbank.d.ts +268 -0
  303. package/js/src/lbank.js +268 -267
  304. package/js/src/luno.d.ts +174 -0
  305. package/js/src/luno.js +174 -173
  306. package/js/src/lykke.d.ts +172 -0
  307. package/js/src/lykke.js +172 -171
  308. package/js/src/mercado.d.ts +123 -0
  309. package/js/src/mercado.js +123 -122
  310. package/js/src/mexc.d.ts +647 -0
  311. package/js/src/mexc.js +650 -646
  312. package/js/src/ndax.d.ts +229 -0
  313. package/js/src/ndax.js +229 -228
  314. package/js/src/novadax.d.ts +230 -0
  315. package/js/src/novadax.js +230 -229
  316. package/js/src/oceanex.d.ts +187 -0
  317. package/js/src/oceanex.js +187 -186
  318. package/js/src/okcoin.d.ts +286 -0
  319. package/js/src/okcoin.js +286 -285
  320. package/js/src/okx.d.ts +907 -0
  321. package/js/src/okx.js +909 -904
  322. package/js/src/onetrading.d.ts +218 -0
  323. package/js/src/onetrading.js +218 -218
  324. package/js/src/oxfun.d.ts +336 -3
  325. package/js/src/oxfun.js +335 -334
  326. package/js/src/p2b.d.ts +154 -0
  327. package/js/src/p2b.js +154 -154
  328. package/js/src/paradex.d.ts +241 -0
  329. package/js/src/paradex.js +249 -244
  330. package/js/src/paymium.d.ts +101 -0
  331. package/js/src/paymium.js +101 -101
  332. package/js/src/phemex.d.ts +366 -0
  333. package/js/src/phemex.js +388 -390
  334. package/js/src/poloniex.d.ts +270 -0
  335. package/js/src/poloniex.js +270 -270
  336. package/js/src/poloniexfutures.d.ts +250 -0
  337. package/js/src/poloniexfutures.js +250 -250
  338. package/js/src/pro/alpaca.d.ts +64 -0
  339. package/js/src/pro/alpaca.js +64 -64
  340. package/js/src/pro/ascendex.d.ts +64 -0
  341. package/js/src/pro/ascendex.js +64 -64
  342. package/js/src/pro/binance.d.ts +546 -0
  343. package/js/src/pro/binance.js +546 -543
  344. package/js/src/pro/bingx.d.ts +116 -0
  345. package/js/src/pro/bingx.js +116 -116
  346. package/js/src/pro/bitfinex.d.ts +42 -0
  347. package/js/src/pro/bitfinex.js +42 -42
  348. package/js/src/pro/bitfinex2.d.ts +66 -0
  349. package/js/src/pro/bitfinex2.js +66 -66
  350. package/js/src/pro/bitget.d.ts +187 -0
  351. package/js/src/pro/bitget.js +188 -181
  352. package/js/src/pro/bithumb.d.ts +40 -0
  353. package/js/src/pro/bithumb.js +40 -40
  354. package/js/src/pro/bitmart.d.ts +121 -0
  355. package/js/src/pro/bitmart.js +121 -119
  356. package/js/src/pro/bitmex.d.ts +135 -0
  357. package/js/src/pro/bitmex.js +135 -133
  358. package/js/src/pro/bitopro.d.ts +49 -0
  359. package/js/src/pro/bitopro.js +49 -49
  360. package/js/src/pro/bitrue.d.ts +19 -0
  361. package/js/src/pro/bitrue.js +19 -19
  362. package/js/src/pro/bitstamp.d.ts +29 -0
  363. package/js/src/pro/bitstamp.js +29 -29
  364. package/js/src/pro/bitvavo.d.ts +254 -1
  365. package/js/src/pro/bitvavo.js +299 -301
  366. package/js/src/pro/blockchaincom.d.ts +62 -0
  367. package/js/src/pro/blockchaincom.js +62 -62
  368. package/js/src/pro/blofin.d.ts +132 -0
  369. package/js/src/pro/blofin.js +132 -130
  370. package/js/src/pro/bybit.d.ts +317 -0
  371. package/js/src/pro/bybit.js +317 -313
  372. package/js/src/pro/cex.d.ts +168 -0
  373. package/js/src/pro/cex.js +168 -168
  374. package/js/src/pro/coinbase.d.ts +93 -0
  375. package/js/src/pro/coinbase.js +93 -91
  376. package/js/src/pro/coinbaseexchange.d.ts +95 -0
  377. package/js/src/pro/coinbaseexchange.js +95 -95
  378. package/js/src/pro/coinbaseinternational.d.ts +111 -0
  379. package/js/src/pro/coinbaseinternational.js +111 -111
  380. package/js/src/pro/coincatch.d.ts +150 -0
  381. package/js/src/pro/coincatch.js +150 -143
  382. package/js/src/pro/coincheck.d.ts +21 -0
  383. package/js/src/pro/coincheck.js +21 -21
  384. package/js/src/pro/coinex.d.ts +110 -0
  385. package/js/src/pro/coinex.js +110 -110
  386. package/js/src/pro/coinone.d.ts +30 -0
  387. package/js/src/pro/coinone.js +30 -30
  388. package/js/src/pro/cryptocom.d.ts +227 -0
  389. package/js/src/pro/cryptocom.js +227 -227
  390. package/js/src/pro/currencycom.d.ts +45 -0
  391. package/js/src/pro/currencycom.js +45 -45
  392. package/js/src/pro/deribit.d.ts +127 -0
  393. package/js/src/pro/deribit.js +127 -127
  394. package/js/src/pro/exmo.d.ts +66 -0
  395. package/js/src/pro/exmo.js +66 -66
  396. package/js/src/pro/gate.d.ts +287 -0
  397. package/js/src/pro/gate.js +287 -283
  398. package/js/src/pro/gemini.d.ts +74 -0
  399. package/js/src/pro/gemini.js +74 -74
  400. package/js/src/pro/hashkey.d.ts +87 -0
  401. package/js/src/pro/hashkey.js +87 -85
  402. package/js/src/pro/hitbtc.d.ts +190 -0
  403. package/js/src/pro/hitbtc.js +190 -190
  404. package/js/src/pro/hollaex.d.ts +51 -0
  405. package/js/src/pro/hollaex.js +51 -51
  406. package/js/src/pro/htx.d.ts +96 -0
  407. package/js/src/pro/htx.js +96 -94
  408. package/js/src/pro/huobijp.d.ts +38 -0
  409. package/js/src/pro/huobijp.js +38 -38
  410. package/js/src/pro/hyperliquid.d.ts +151 -0
  411. package/js/src/pro/hyperliquid.js +151 -150
  412. package/js/src/pro/idex.d.ts +48 -0
  413. package/js/src/pro/idex.js +48 -48
  414. package/js/src/pro/independentreserve.d.ts +19 -0
  415. package/js/src/pro/independentreserve.js +19 -19
  416. package/js/src/pro/kraken.d.ts +167 -0
  417. package/js/src/pro/kraken.js +167 -167
  418. package/js/src/pro/krakenfutures.d.ts +137 -0
  419. package/js/src/pro/krakenfutures.js +137 -138
  420. package/js/src/pro/kucoin.d.ts +167 -0
  421. package/js/src/pro/kucoin.js +167 -168
  422. package/js/src/pro/kucoinfutures.d.ts +147 -0
  423. package/js/src/pro/kucoinfutures.js +147 -147
  424. package/js/src/pro/lbank.d.ts +95 -0
  425. package/js/src/pro/lbank.js +95 -95
  426. package/js/src/pro/luno.d.ts +21 -0
  427. package/js/src/pro/luno.js +21 -21
  428. package/js/src/pro/mexc.d.ts +101 -0
  429. package/js/src/pro/mexc.js +102 -103
  430. package/js/src/pro/ndax.d.ts +42 -0
  431. package/js/src/pro/ndax.js +42 -42
  432. package/js/src/pro/okcoin.d.ts +61 -0
  433. package/js/src/pro/okcoin.js +61 -61
  434. package/js/src/pro/okx.d.ts +332 -0
  435. package/js/src/pro/okx.js +332 -330
  436. package/js/src/pro/onetrading.d.ts +71 -0
  437. package/js/src/pro/onetrading.js +71 -71
  438. package/js/src/pro/oxfun.d.ts +193 -0
  439. package/js/src/pro/oxfun.js +193 -191
  440. package/js/src/pro/p2b.d.ts +77 -0
  441. package/js/src/pro/p2b.js +77 -77
  442. package/js/src/pro/paradex.d.ts +39 -0
  443. package/js/src/pro/paradex.js +39 -39
  444. package/js/src/pro/phemex.d.ts +94 -0
  445. package/js/src/pro/phemex.js +94 -94
  446. package/js/src/pro/poloniex.d.ts +171 -0
  447. package/js/src/pro/poloniex.js +171 -171
  448. package/js/src/pro/poloniexfutures.d.ts +62 -0
  449. package/js/src/pro/poloniexfutures.js +62 -62
  450. package/js/src/pro/probit.d.ts +63 -0
  451. package/js/src/pro/probit.js +63 -63
  452. package/js/src/pro/upbit.d.ts +80 -0
  453. package/js/src/pro/upbit.js +80 -80
  454. package/js/src/pro/vertex.d.ts +65 -0
  455. package/js/src/pro/vertex.js +65 -63
  456. package/js/src/pro/wazirx.d.ts +70 -0
  457. package/js/src/pro/wazirx.js +70 -70
  458. package/js/src/pro/whitebit.d.ts +83 -0
  459. package/js/src/pro/whitebit.js +83 -83
  460. package/js/src/pro/woo.d.ts +106 -0
  461. package/js/src/pro/woo.js +106 -104
  462. package/js/src/pro/woofipro.d.ts +105 -0
  463. package/js/src/pro/woofipro.js +105 -103
  464. package/js/src/pro/xt.d.ts +119 -0
  465. package/js/src/pro/xt.js +119 -119
  466. package/js/src/probit.d.ts +229 -0
  467. package/js/src/probit.js +229 -229
  468. package/js/src/timex.d.ts +198 -0
  469. package/js/src/timex.js +198 -197
  470. package/js/src/tokocrypto.d.ts +214 -0
  471. package/js/src/tokocrypto.js +214 -213
  472. package/js/src/tradeogre.d.ts +92 -0
  473. package/js/src/tradeogre.js +92 -91
  474. package/js/src/upbit.d.ts +243 -0
  475. package/js/src/upbit.js +243 -242
  476. package/js/src/vertex.d.ts +258 -0
  477. package/js/src/vertex.js +258 -258
  478. package/js/src/wavesexchange.d.ts +176 -0
  479. package/js/src/wavesexchange.js +176 -172
  480. package/js/src/wazirx.d.ts +168 -0
  481. package/js/src/wazirx.js +168 -168
  482. package/js/src/whitebit.d.ts +361 -0
  483. package/js/src/whitebit.js +361 -361
  484. package/js/src/woo.d.ts +571 -0
  485. package/js/src/woo.js +571 -572
  486. package/js/src/woofipro.d.ts +392 -0
  487. package/js/src/woofipro.js +392 -391
  488. package/js/src/xt.d.ts +439 -4
  489. package/js/src/xt.js +436 -435
  490. package/js/src/yobit.d.ts +159 -0
  491. package/js/src/yobit.js +159 -158
  492. package/js/src/zaif.d.ts +103 -0
  493. package/js/src/zaif.js +103 -103
  494. package/js/src/zonda.d.ts +168 -0
  495. package/js/src/zonda.js +168 -168
  496. package/package.json +1 -1
package/js/src/kucoin.js CHANGED
@@ -574,6 +574,8 @@ export default class kucoin extends Exchange {
574
574
  '400303': PermissionDenied,
575
575
  '500000': ExchangeNotAvailable,
576
576
  '260220': InvalidAddress,
577
+ '600100': InsufficientFunds,
578
+ '600101': InvalidOrder,
577
579
  '900014': BadRequest, // {"code":"900014","msg":"Invalid chainId"}
578
580
  },
579
581
  'broad': {
@@ -989,15 +991,15 @@ export default class kucoin extends Exchange {
989
991
  nonce() {
990
992
  return this.milliseconds();
991
993
  }
994
+ /**
995
+ * @method
996
+ * @name kucoin#fetchTime
997
+ * @description fetches the current integer timestamp in milliseconds from the exchange server
998
+ * @see https://docs.kucoin.com/#server-time
999
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1000
+ * @returns {int} the current integer timestamp in milliseconds from the exchange server
1001
+ */
992
1002
  async fetchTime(params = {}) {
993
- /**
994
- * @method
995
- * @name kucoin#fetchTime
996
- * @description fetches the current integer timestamp in milliseconds from the exchange server
997
- * @see https://docs.kucoin.com/#server-time
998
- * @param {object} [params] extra parameters specific to the exchange API endpoint
999
- * @returns {int} the current integer timestamp in milliseconds from the exchange server
1000
- */
1001
1003
  const response = await this.publicGetTimestamp(params);
1002
1004
  //
1003
1005
  // {
@@ -1008,15 +1010,15 @@ export default class kucoin extends Exchange {
1008
1010
  //
1009
1011
  return this.safeInteger(response, 'data');
1010
1012
  }
1013
+ /**
1014
+ * @method
1015
+ * @name kucoin#fetchStatus
1016
+ * @description the latest known information on the availability of the exchange API
1017
+ * @see https://docs.kucoin.com/#service-status
1018
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1019
+ * @returns {object} a [status structure]{@link https://docs.ccxt.com/#/?id=exchange-status-structure}
1020
+ */
1011
1021
  async fetchStatus(params = {}) {
1012
- /**
1013
- * @method
1014
- * @name kucoin#fetchStatus
1015
- * @description the latest known information on the availability of the exchange API
1016
- * @see https://docs.kucoin.com/#service-status
1017
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1018
- * @returns {object} a [status structure]{@link https://docs.ccxt.com/#/?id=exchange-status-structure}
1019
- */
1020
1022
  const response = await this.publicGetStatus(params);
1021
1023
  //
1022
1024
  // {
@@ -1037,16 +1039,16 @@ export default class kucoin extends Exchange {
1037
1039
  'info': response,
1038
1040
  };
1039
1041
  }
1042
+ /**
1043
+ * @method
1044
+ * @name kucoin#fetchMarkets
1045
+ * @description retrieves data on all markets for kucoin
1046
+ * @see https://docs.kucoin.com/#get-symbols-list-deprecated
1047
+ * @see https://docs.kucoin.com/#get-all-tickers
1048
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1049
+ * @returns {object[]} an array of objects representing market data
1050
+ */
1040
1051
  async fetchMarkets(params = {}) {
1041
- /**
1042
- * @method
1043
- * @name kucoin#fetchMarkets
1044
- * @description retrieves data on all markets for kucoin
1045
- * @see https://docs.kucoin.com/#get-symbols-list-deprecated
1046
- * @see https://docs.kucoin.com/#get-all-tickers
1047
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1048
- * @returns {object[]} an array of objects representing market data
1049
- */
1050
1052
  let fetchTickersFees = undefined;
1051
1053
  [fetchTickersFees, params] = this.handleOptionAndParams(params, 'fetchMarkets', 'fetchTickersFees', true);
1052
1054
  const promises = [];
@@ -1230,13 +1232,14 @@ export default class kucoin extends Exchange {
1230
1232
  }
1231
1233
  return result;
1232
1234
  }
1235
+ /**
1236
+ * @method
1237
+ * @name kucoin#loadMigrationStatus
1238
+ * @param {boolean} force load account state for non hf
1239
+ * @description loads the migration status for the account (hf or not)
1240
+ * @see https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/get-user-type
1241
+ */
1233
1242
  async loadMigrationStatus(force = false) {
1234
- /**
1235
- * @method
1236
- * @name kucoin#loadMigrationStatus
1237
- * @description loads the migration status for the account (hf or not)
1238
- * @see https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/get-user-type
1239
- */
1240
1243
  if (!('hf' in this.options) || (this.options['hf'] === undefined) || force) {
1241
1244
  const result = await this.privateGetHfAccountsOpened();
1242
1245
  this.options['hf'] = this.safeBool(result, 'data');
@@ -1257,15 +1260,15 @@ export default class kucoin extends Exchange {
1257
1260
  params = this.omit(params, 'hf');
1258
1261
  return [hf, params];
1259
1262
  }
1263
+ /**
1264
+ * @method
1265
+ * @name kucoin#fetchCurrencies
1266
+ * @description fetches all available currencies on an exchange
1267
+ * @see https://docs.kucoin.com/#get-currencies
1268
+ * @param {object} params extra parameters specific to the exchange API endpoint
1269
+ * @returns {object} an associative dictionary of currencies
1270
+ */
1260
1271
  async fetchCurrencies(params = {}) {
1261
- /**
1262
- * @method
1263
- * @name kucoin#fetchCurrencies
1264
- * @description fetches all available currencies on an exchange
1265
- * @see https://docs.kucoin.com/#get-currencies
1266
- * @param {object} params extra parameters specific to the exchange API endpoint
1267
- * @returns {object} an associative dictionary of currencies
1268
- */
1269
1272
  const promises = [];
1270
1273
  promises.push(this.publicGetCurrencies(params));
1271
1274
  //
@@ -1420,15 +1423,15 @@ export default class kucoin extends Exchange {
1420
1423
  }
1421
1424
  return result;
1422
1425
  }
1426
+ /**
1427
+ * @method
1428
+ * @name kucoin#fetchAccounts
1429
+ * @description fetch all the accounts associated with a profile
1430
+ * @see https://docs.kucoin.com/#list-accounts
1431
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1432
+ * @returns {object} a dictionary of [account structures]{@link https://docs.ccxt.com/#/?id=account-structure} indexed by the account type
1433
+ */
1423
1434
  async fetchAccounts(params = {}) {
1424
- /**
1425
- * @method
1426
- * @name kucoin#fetchAccounts
1427
- * @description fetch all the accounts associated with a profile
1428
- * @see https://docs.kucoin.com/#list-accounts
1429
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1430
- * @returns {object} a dictionary of [account structures]{@link https://docs.ccxt.com/#/?id=account-structure} indexed by the account type
1431
- */
1432
1435
  const response = await this.privateGetAccounts(params);
1433
1436
  //
1434
1437
  // {
@@ -1471,16 +1474,16 @@ export default class kucoin extends Exchange {
1471
1474
  }
1472
1475
  return result;
1473
1476
  }
1477
+ /**
1478
+ * @method
1479
+ * @name kucoin#fetchTransactionFee
1480
+ * @description *DEPRECATED* please use fetchDepositWithdrawFee instead
1481
+ * @see https://docs.kucoin.com/#get-withdrawal-quotas
1482
+ * @param {string} code unified currency code
1483
+ * @param {object} params extra parameters specific to the exchange API endpoint
1484
+ * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
1485
+ */
1474
1486
  async fetchTransactionFee(code, params = {}) {
1475
- /**
1476
- * @method
1477
- * @name kucoin#fetchTransactionFee
1478
- * @description *DEPRECATED* please use fetchDepositWithdrawFee instead
1479
- * @see https://docs.kucoin.com/#get-withdrawal-quotas
1480
- * @param {string} code unified currency code
1481
- * @param {object} params extra parameters specific to the exchange API endpoint
1482
- * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
1483
- */
1484
1487
  await this.loadMarkets();
1485
1488
  const currency = this.currency(code);
1486
1489
  const request = {
@@ -1501,17 +1504,17 @@ export default class kucoin extends Exchange {
1501
1504
  'deposit': {},
1502
1505
  };
1503
1506
  }
1507
+ /**
1508
+ * @method
1509
+ * @name kucoin#fetchDepositWithdrawFee
1510
+ * @description fetch the fee for deposits and withdrawals
1511
+ * @see https://docs.kucoin.com/#get-withdrawal-quotas
1512
+ * @param {string} code unified currency code
1513
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1514
+ * @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
1515
+ * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
1516
+ */
1504
1517
  async fetchDepositWithdrawFee(code, params = {}) {
1505
- /**
1506
- * @method
1507
- * @name kucoin#fetchDepositWithdrawFee
1508
- * @description fetch the fee for deposits and withdrawals
1509
- * @see https://docs.kucoin.com/#get-withdrawal-quotas
1510
- * @param {string} code unified currency code
1511
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1512
- * @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
1513
- * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
1514
- */
1515
1518
  await this.loadMarkets();
1516
1519
  const currency = this.currency(code);
1517
1520
  const request = {
@@ -1694,16 +1697,16 @@ export default class kucoin extends Exchange {
1694
1697
  'info': ticker,
1695
1698
  }, market);
1696
1699
  }
1700
+ /**
1701
+ * @method
1702
+ * @name kucoin#fetchTickers
1703
+ * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
1704
+ * @see https://docs.kucoin.com/#get-all-tickers
1705
+ * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
1706
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1707
+ * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
1708
+ */
1697
1709
  async fetchTickers(symbols = undefined, params = {}) {
1698
- /**
1699
- * @method
1700
- * @name kucoin#fetchTickers
1701
- * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
1702
- * @see https://docs.kucoin.com/#get-all-tickers
1703
- * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
1704
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1705
- * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
1706
- */
1707
1710
  await this.loadMarkets();
1708
1711
  symbols = this.marketSymbols(symbols);
1709
1712
  const response = await this.publicGetMarketAllTickers(params);
@@ -1749,32 +1752,32 @@ export default class kucoin extends Exchange {
1749
1752
  }
1750
1753
  return this.filterByArrayTickers(result, 'symbol', symbols);
1751
1754
  }
1755
+ /**
1756
+ * @method
1757
+ * @name kucoin#fetchMarkPrices
1758
+ * @description fetches the mark price for multiple markets
1759
+ * @see https://www.kucoin.com/docs/rest/margin-trading/margin-info/get-all-margin-trading-pairs-mark-prices
1760
+ * @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
1761
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1762
+ * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
1763
+ */
1752
1764
  async fetchMarkPrices(symbols = undefined, params = {}) {
1753
- /**
1754
- * @method
1755
- * @name kucoin#fetchMarkPrices
1756
- * @description fetches the mark price for multiple markets
1757
- * @see https://www.kucoin.com/docs/rest/margin-trading/margin-info/get-all-margin-trading-pairs-mark-prices
1758
- * @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
1759
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1760
- * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
1761
- */
1762
1765
  await this.loadMarkets();
1763
1766
  symbols = this.marketSymbols(symbols);
1764
1767
  const response = await this.publicGetMarkPriceAllSymbols(params);
1765
1768
  const data = this.safeList(response, 'data', []);
1766
1769
  return this.parseTickers(data);
1767
1770
  }
1771
+ /**
1772
+ * @method
1773
+ * @name kucoin#fetchTicker
1774
+ * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
1775
+ * @see https://docs.kucoin.com/#get-24hr-stats
1776
+ * @param {string} symbol unified symbol of the market to fetch the ticker for
1777
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1778
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
1779
+ */
1768
1780
  async fetchTicker(symbol, params = {}) {
1769
- /**
1770
- * @method
1771
- * @name kucoin#fetchTicker
1772
- * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
1773
- * @see https://docs.kucoin.com/#get-24hr-stats
1774
- * @param {string} symbol unified symbol of the market to fetch the ticker for
1775
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1776
- * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
1777
- */
1778
1781
  await this.loadMarkets();
1779
1782
  const market = this.market(symbol);
1780
1783
  const request = {
@@ -1807,16 +1810,16 @@ export default class kucoin extends Exchange {
1807
1810
  const data = this.safeDict(response, 'data', {});
1808
1811
  return this.parseTicker(data, market);
1809
1812
  }
1813
+ /**
1814
+ * @method
1815
+ * @name kucoin#fetchMarkPrice
1816
+ * @description fetches the mark price for a specific market
1817
+ * @see https://www.kucoin.com/docs/rest/margin-trading/margin-info/get-mark-price
1818
+ * @param {string} symbol unified symbol of the market to fetch the ticker for
1819
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1820
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
1821
+ */
1810
1822
  async fetchMarkPrice(symbol, params = {}) {
1811
- /**
1812
- * @method
1813
- * @name kucoin#fetchMarkPrice
1814
- * @description fetches the mark price for a specific market
1815
- * @see https://www.kucoin.com/docs/rest/margin-trading/margin-info/get-mark-price
1816
- * @param {string} symbol unified symbol of the market to fetch the ticker for
1817
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1818
- * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
1819
- */
1820
1823
  await this.loadMarkets();
1821
1824
  const market = this.market(symbol);
1822
1825
  const request = {
@@ -1848,20 +1851,20 @@ export default class kucoin extends Exchange {
1848
1851
  this.safeNumber(ohlcv, 5),
1849
1852
  ];
1850
1853
  }
1854
+ /**
1855
+ * @method
1856
+ * @name kucoin#fetchOHLCV
1857
+ * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
1858
+ * @see https://docs.kucoin.com/#get-klines
1859
+ * @param {string} symbol unified symbol of the market to fetch OHLCV data for
1860
+ * @param {string} timeframe the length of time each candle represents
1861
+ * @param {int} [since] timestamp in ms of the earliest candle to fetch
1862
+ * @param {int} [limit] the maximum amount of candles to fetch
1863
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1864
+ * @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)
1865
+ * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
1866
+ */
1851
1867
  async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
1852
- /**
1853
- * @method
1854
- * @name kucoin#fetchOHLCV
1855
- * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
1856
- * @see https://docs.kucoin.com/#get-klines
1857
- * @param {string} symbol unified symbol of the market to fetch OHLCV data for
1858
- * @param {string} timeframe the length of time each candle represents
1859
- * @param {int} [since] timestamp in ms of the earliest candle to fetch
1860
- * @param {int} [limit] the maximum amount of candles to fetch
1861
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1862
- * @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)
1863
- * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
1864
- */
1865
1868
  await this.loadMarkets();
1866
1869
  let paginate = false;
1867
1870
  [paginate, params] = this.handleOptionAndParams(params, 'fetchOHLCV', 'paginate');
@@ -1906,17 +1909,17 @@ export default class kucoin extends Exchange {
1906
1909
  const data = this.safeList(response, 'data', []);
1907
1910
  return this.parseOHLCVs(data, market, timeframe, since, limit);
1908
1911
  }
1912
+ /**
1913
+ * @method
1914
+ * @name kucoin#createDepositAddress
1915
+ * @see https://www.kucoin.com/docs/rest/funding/deposit/create-deposit-address-v3-
1916
+ * @description create a currency deposit address
1917
+ * @param {string} code unified currency code of the currency for the deposit address
1918
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1919
+ * @param {string} [params.network] the blockchain network name
1920
+ * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
1921
+ */
1909
1922
  async createDepositAddress(code, params = {}) {
1910
- /**
1911
- * @method
1912
- * @name kucoin#createDepositAddress
1913
- * @see https://www.kucoin.com/docs/rest/funding/deposit/create-deposit-address-v3-
1914
- * @description create a currency deposit address
1915
- * @param {string} code unified currency code of the currency for the deposit address
1916
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1917
- * @param {string} [params.network] the blockchain network name
1918
- * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
1919
- */
1920
1923
  await this.loadMarkets();
1921
1924
  const currency = this.currency(code);
1922
1925
  const request = {
@@ -1946,17 +1949,17 @@ export default class kucoin extends Exchange {
1946
1949
  const data = this.safeDict(response, 'data', {});
1947
1950
  return this.parseDepositAddress(data, currency);
1948
1951
  }
1952
+ /**
1953
+ * @method
1954
+ * @name kucoin#fetchDepositAddress
1955
+ * @description fetch the deposit address for a currency associated with this account
1956
+ * @see https://docs.kucoin.com/#get-deposit-addresses-v2
1957
+ * @param {string} code unified currency code
1958
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1959
+ * @param {string} [params.network] the blockchain network name
1960
+ * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
1961
+ */
1949
1962
  async fetchDepositAddress(code, params = {}) {
1950
- /**
1951
- * @method
1952
- * @name kucoin#fetchDepositAddress
1953
- * @description fetch the deposit address for a currency associated with this account
1954
- * @see https://docs.kucoin.com/#get-deposit-addresses-v2
1955
- * @param {string} code unified currency code
1956
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1957
- * @param {string} [params.network] the blockchain network name
1958
- * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
1959
- */
1960
1963
  await this.loadMarkets();
1961
1964
  const currency = this.currency(code);
1962
1965
  const request = {
@@ -2004,16 +2007,16 @@ export default class kucoin extends Exchange {
2004
2007
  'tag': this.safeString(depositAddress, 'memo'),
2005
2008
  };
2006
2009
  }
2010
+ /**
2011
+ * @method
2012
+ * @name kucoin#fetchDepositAddressesByNetwork
2013
+ * @see https://docs.kucoin.com/#get-deposit-addresses-v2
2014
+ * @description fetch the deposit address for a currency associated with this account
2015
+ * @param {string} code unified currency code
2016
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2017
+ * @returns {object} an array of [address structures]{@link https://docs.ccxt.com/#/?id=address-structure}
2018
+ */
2007
2019
  async fetchDepositAddressesByNetwork(code, params = {}) {
2008
- /**
2009
- * @method
2010
- * @name kucoin#fetchDepositAddressesByNetwork
2011
- * @see https://docs.kucoin.com/#get-deposit-addresses-v2
2012
- * @description fetch the deposit address for a currency associated with this account
2013
- * @param {string} code unified currency code
2014
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2015
- * @returns {object} an array of [address structures]{@link https://docs.ccxt.com/#/?id=address-structure}
2016
- */
2017
2020
  await this.loadMarkets();
2018
2021
  const currency = this.currency(code);
2019
2022
  const request = {
@@ -2044,18 +2047,18 @@ export default class kucoin extends Exchange {
2044
2047
  });
2045
2048
  return this.indexBy(parsed, 'network');
2046
2049
  }
2050
+ /**
2051
+ * @method
2052
+ * @name kucoin#fetchOrderBook
2053
+ * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
2054
+ * @see https://www.kucoin.com/docs/rest/spot-trading/market-data/get-part-order-book-aggregated-
2055
+ * @see https://www.kucoin.com/docs/rest/spot-trading/market-data/get-full-order-book-aggregated-
2056
+ * @param {string} symbol unified symbol of the market to fetch the order book for
2057
+ * @param {int} [limit] the maximum amount of order book entries to return
2058
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2059
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
2060
+ */
2047
2061
  async fetchOrderBook(symbol, limit = undefined, params = {}) {
2048
- /**
2049
- * @method
2050
- * @name kucoin#fetchOrderBook
2051
- * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
2052
- * @see https://www.kucoin.com/docs/rest/spot-trading/market-data/get-part-order-book-aggregated-
2053
- * @see https://www.kucoin.com/docs/rest/spot-trading/market-data/get-full-order-book-aggregated-
2054
- * @param {string} symbol unified symbol of the market to fetch the order book for
2055
- * @param {int} [limit] the maximum amount of order book entries to return
2056
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2057
- * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
2058
- */
2059
2062
  await this.loadMarkets();
2060
2063
  const market = this.market(symbol);
2061
2064
  const level = this.safeInteger(params, 'level', 2);
@@ -2128,51 +2131,51 @@ export default class kucoin extends Exchange {
2128
2131
  }
2129
2132
  return [triggerPrice, stopLossPrice, takeProfitPrice];
2130
2133
  }
2134
+ /**
2135
+ * @method
2136
+ * @name kucoin#createOrder
2137
+ * @description Create an order on the exchange
2138
+ * @see https://docs.kucoin.com/spot#place-a-new-order
2139
+ * @see https://docs.kucoin.com/spot#place-a-new-order-2
2140
+ * @see https://docs.kucoin.com/spot#place-a-margin-order
2141
+ * @see https://docs.kucoin.com/spot-hf/#place-hf-order
2142
+ * @see https://www.kucoin.com/docs/rest/spot-trading/orders/place-order-test
2143
+ * @see https://www.kucoin.com/docs/rest/margin-trading/orders/place-margin-order-test
2144
+ * @see https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/sync-place-hf-order
2145
+ * @param {string} symbol Unified CCXT market symbol
2146
+ * @param {string} type 'limit' or 'market'
2147
+ * @param {string} side 'buy' or 'sell'
2148
+ * @param {float} amount the amount of currency to trade
2149
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
2150
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2151
+ * @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
2152
+ * @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
2153
+ * @param {string} [params.timeInForce] GTC, GTT, IOC, or FOK, default is GTC, limit orders only
2154
+ * @param {string} [params.postOnly] Post only flag, invalid when timeInForce is IOC or FOK
2155
+ *
2156
+ * EXCHANGE SPECIFIC PARAMETERS
2157
+ * @param {string} [params.clientOid] client order id, defaults to uuid if not passed
2158
+ * @param {string} [params.remark] remark for the order, length cannot exceed 100 utf8 characters
2159
+ * @param {string} [params.tradeType] 'TRADE', // TRADE, MARGIN_TRADE // not used with margin orders
2160
+ * limit orders ---------------------------------------------------
2161
+ * @param {float} [params.cancelAfter] long, // cancel after n seconds, requires timeInForce to be GTT
2162
+ * @param {bool} [params.hidden] false, // Order will not be displayed in the order book
2163
+ * @param {bool} [params.iceberg] false, // Only a portion of the order is displayed in the order book
2164
+ * @param {string} [params.visibleSize] this.amountToPrecision (symbol, visibleSize), // The maximum visible size of an iceberg order
2165
+ * market orders --------------------------------------------------
2166
+ * @param {string} [params.funds] // Amount of quote currency to use
2167
+ * stop orders ----------------------------------------------------
2168
+ * @param {string} [params.stop] Either loss or entry, the default is loss. Requires stopPrice to be defined
2169
+ * margin orders --------------------------------------------------
2170
+ * @param {float} [params.leverage] Leverage size of the order
2171
+ * @param {string} [params.stp] '', // self trade prevention, CN, CO, CB or DC
2172
+ * @param {bool} [params.autoBorrow] false, // The system will first borrow you funds at the optimal interest rate and then place an order for you
2173
+ * @param {bool} [params.hf] false, // true for hf order
2174
+ * @param {bool} [params.test] set to true to test an order, no order will be created but the request will be validated
2175
+ * @param {bool} [params.sync] set to true to use the hf sync call
2176
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2177
+ */
2131
2178
  async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
2132
- /**
2133
- * @method
2134
- * @name kucoin#createOrder
2135
- * @description Create an order on the exchange
2136
- * @see https://docs.kucoin.com/spot#place-a-new-order
2137
- * @see https://docs.kucoin.com/spot#place-a-new-order-2
2138
- * @see https://docs.kucoin.com/spot#place-a-margin-order
2139
- * @see https://docs.kucoin.com/spot-hf/#place-hf-order
2140
- * @see https://www.kucoin.com/docs/rest/spot-trading/orders/place-order-test
2141
- * @see https://www.kucoin.com/docs/rest/margin-trading/orders/place-margin-order-test
2142
- * @see https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/sync-place-hf-order
2143
- * @param {string} symbol Unified CCXT market symbol
2144
- * @param {string} type 'limit' or 'market'
2145
- * @param {string} side 'buy' or 'sell'
2146
- * @param {float} amount the amount of currency to trade
2147
- * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
2148
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2149
- * @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
2150
- * @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
2151
- * @param {string} [params.timeInForce] GTC, GTT, IOC, or FOK, default is GTC, limit orders only
2152
- * @param {string} [params.postOnly] Post only flag, invalid when timeInForce is IOC or FOK
2153
- *
2154
- * EXCHANGE SPECIFIC PARAMETERS
2155
- * @param {string} [params.clientOid] client order id, defaults to uuid if not passed
2156
- * @param {string} [params.remark] remark for the order, length cannot exceed 100 utf8 characters
2157
- * @param {string} [params.tradeType] 'TRADE', // TRADE, MARGIN_TRADE // not used with margin orders
2158
- * limit orders ---------------------------------------------------
2159
- * @param {float} [params.cancelAfter] long, // cancel after n seconds, requires timeInForce to be GTT
2160
- * @param {bool} [params.hidden] false, // Order will not be displayed in the order book
2161
- * @param {bool} [params.iceberg] false, // Only a portion of the order is displayed in the order book
2162
- * @param {string} [params.visibleSize] this.amountToPrecision (symbol, visibleSize), // The maximum visible size of an iceberg order
2163
- * market orders --------------------------------------------------
2164
- * @param {string} [params.funds] // Amount of quote currency to use
2165
- * stop orders ----------------------------------------------------
2166
- * @param {string} [params.stop] Either loss or entry, the default is loss. Requires stopPrice to be defined
2167
- * margin orders --------------------------------------------------
2168
- * @param {float} [params.leverage] Leverage size of the order
2169
- * @param {string} [params.stp] '', // self trade prevention, CN, CO, CB or DC
2170
- * @param {bool} [params.autoBorrow] false, // The system will first borrow you funds at the optimal interest rate and then place an order for you
2171
- * @param {bool} [params.hf] false, // true for hf order
2172
- * @param {bool} [params.test] set to true to test an order, no order will be created but the request will be validated
2173
- * @param {bool} [params.sync] set to true to use the hf sync call
2174
- * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2175
- */
2176
2179
  await this.loadMarkets();
2177
2180
  const market = this.market(symbol);
2178
2181
  const testOrder = this.safeBool(params, 'test', false);
@@ -2227,64 +2230,64 @@ export default class kucoin extends Exchange {
2227
2230
  const data = this.safeDict(response, 'data', {});
2228
2231
  return this.parseOrder(data, market);
2229
2232
  }
2233
+ /**
2234
+ * @method
2235
+ * @name kucoin#createMarketOrderWithCost
2236
+ * @description create a market order by providing the symbol, side and cost
2237
+ * @see https://www.kucoin.com/docs/rest/spot-trading/orders/place-order
2238
+ * @param {string} symbol unified symbol of the market to create an order in
2239
+ * @param {string} side 'buy' or 'sell'
2240
+ * @param {float} cost how much you want to trade in units of the quote currency
2241
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2242
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2243
+ */
2230
2244
  async createMarketOrderWithCost(symbol, side, cost, params = {}) {
2231
- /**
2232
- * @method
2233
- * @name kucoin#createMarketOrderWithCost
2234
- * @description create a market order by providing the symbol, side and cost
2235
- * @see https://www.kucoin.com/docs/rest/spot-trading/orders/place-order
2236
- * @param {string} symbol unified symbol of the market to create an order in
2237
- * @param {string} side 'buy' or 'sell'
2238
- * @param {float} cost how much you want to trade in units of the quote currency
2239
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2240
- * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2241
- */
2242
2245
  await this.loadMarkets();
2243
2246
  params['cost'] = cost;
2244
2247
  return await this.createOrder(symbol, 'market', side, cost, undefined, params);
2245
2248
  }
2249
+ /**
2250
+ * @method
2251
+ * @name kucoin#createMarketBuyOrderWithCost
2252
+ * @description create a market buy order by providing the symbol and cost
2253
+ * @see https://www.kucoin.com/docs/rest/spot-trading/orders/place-order
2254
+ * @param {string} symbol unified symbol of the market to create an order in
2255
+ * @param {float} cost how much you want to trade in units of the quote currency
2256
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2257
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2258
+ */
2246
2259
  async createMarketBuyOrderWithCost(symbol, cost, params = {}) {
2247
- /**
2248
- * @method
2249
- * @name kucoin#createMarketBuyOrderWithCost
2250
- * @description create a market buy order by providing the symbol and cost
2251
- * @see https://www.kucoin.com/docs/rest/spot-trading/orders/place-order
2252
- * @param {string} symbol unified symbol of the market to create an order in
2253
- * @param {float} cost how much you want to trade in units of the quote currency
2254
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2255
- * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2256
- */
2257
2260
  await this.loadMarkets();
2258
2261
  return await this.createMarketOrderWithCost(symbol, 'buy', cost, params);
2259
2262
  }
2263
+ /**
2264
+ * @method
2265
+ * @name kucoin#createMarketSellOrderWithCost
2266
+ * @description create a market sell order by providing the symbol and cost
2267
+ * @see https://www.kucoin.com/docs/rest/spot-trading/orders/place-order
2268
+ * @param {string} symbol unified symbol of the market to create an order in
2269
+ * @param {float} cost how much you want to trade in units of the quote currency
2270
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2271
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2272
+ */
2260
2273
  async createMarketSellOrderWithCost(symbol, cost, params = {}) {
2261
- /**
2262
- * @method
2263
- * @name kucoin#createMarketSellOrderWithCost
2264
- * @description create a market sell order by providing the symbol and cost
2265
- * @see https://www.kucoin.com/docs/rest/spot-trading/orders/place-order
2266
- * @param {string} symbol unified symbol of the market to create an order in
2267
- * @param {float} cost how much you want to trade in units of the quote currency
2268
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2269
- * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2270
- */
2271
2274
  await this.loadMarkets();
2272
2275
  return await this.createMarketOrderWithCost(symbol, 'sell', cost, params);
2273
2276
  }
2277
+ /**
2278
+ * @method
2279
+ * @name kucoin#createOrders
2280
+ * @description create a list of trade orders
2281
+ * @see https://www.kucoin.com/docs/rest/spot-trading/orders/place-multiple-orders
2282
+ * @see https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/place-multiple-hf-orders
2283
+ * @see https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/sync-place-multiple-hf-orders
2284
+ * @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
2285
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2286
+ * @param {bool} [params.hf] false, // true for hf orders
2287
+ * @param {bool} [params.sync] false, // true to use the hf sync call
2288
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2289
+ */
2274
2290
  async createOrders(orders, params = {}) {
2275
- /**
2276
- * @method
2277
- * @name kucoin#createOrders
2278
- * @description create a list of trade orders
2279
- * @see https://www.kucoin.com/docs/rest/spot-trading/orders/place-multiple-orders
2280
- * @see https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/place-multiple-hf-orders
2281
- * @see https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/sync-place-multiple-hf-orders
2282
- * @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
2283
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2284
- * @param {bool} [params.hf] false, // true for hf orders
2285
- * @param {bool} [params.sync] false, // true to use the hf sync call
2286
- * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2287
- */
2288
2291
  await this.loadMarkets();
2289
2292
  const ordersRequests = [];
2290
2293
  let symbol = undefined;
@@ -2442,22 +2445,22 @@ export default class kucoin extends Exchange {
2442
2445
  }
2443
2446
  return this.extend(request, params);
2444
2447
  }
2448
+ /**
2449
+ * @method
2450
+ * @name kucoin#editOrder
2451
+ * @description edit an order, kucoin currently only supports the modification of HF orders
2452
+ * @see https://docs.kucoin.com/spot-hf/#modify-order
2453
+ * @param {string} id order id
2454
+ * @param {string} symbol unified symbol of the market to create an order in
2455
+ * @param {string} type not used
2456
+ * @param {string} side not used
2457
+ * @param {float} amount how much of the currency you want to trade in units of the base currency
2458
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
2459
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2460
+ * @param {string} [params.clientOrderId] client order id, defaults to id if not passed
2461
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2462
+ */
2445
2463
  async editOrder(id, symbol, type, side, amount = undefined, price = undefined, params = {}) {
2446
- /**
2447
- * @method
2448
- * @name kucoin#editOrder
2449
- * @description edit an order, kucoin currently only supports the modification of HF orders
2450
- * @see https://docs.kucoin.com/spot-hf/#modify-order
2451
- * @param {string} id order id
2452
- * @param {string} symbol unified symbol of the market to create an order in
2453
- * @param {string} type not used
2454
- * @param {string} side not used
2455
- * @param {float} amount how much of the currency you want to trade in units of the base currency
2456
- * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
2457
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2458
- * @param {string} [params.clientOrderId] client order id, defaults to id if not passed
2459
- * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2460
- */
2461
2464
  await this.loadMarkets();
2462
2465
  const market = this.market(symbol);
2463
2466
  const request = {
@@ -2488,27 +2491,27 @@ export default class kucoin extends Exchange {
2488
2491
  const data = this.safeDict(response, 'data', {});
2489
2492
  return this.parseOrder(data, market);
2490
2493
  }
2494
+ /**
2495
+ * @method
2496
+ * @name kucoin#cancelOrder
2497
+ * @description cancels an open order
2498
+ * @see https://docs.kucoin.com/spot#cancel-an-order
2499
+ * @see https://docs.kucoin.com/spot#cancel-an-order-2
2500
+ * @see https://docs.kucoin.com/spot#cancel-single-order-by-clientoid
2501
+ * @see https://docs.kucoin.com/spot#cancel-single-order-by-clientoid-2
2502
+ * @see https://docs.kucoin.com/spot-hf/#cancel-orders-by-orderid
2503
+ * @see https://docs.kucoin.com/spot-hf/#cancel-order-by-clientoid
2504
+ * @see https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/sync-cancel-hf-order-by-orderid
2505
+ * @see https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/sync-cancel-hf-order-by-clientoid
2506
+ * @param {string} id order id
2507
+ * @param {string} symbol unified symbol of the market the order was made in
2508
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2509
+ * @param {bool} [params.stop] True if cancelling a stop order
2510
+ * @param {bool} [params.hf] false, // true for hf order
2511
+ * @param {bool} [params.sync] false, // true to use the hf sync call
2512
+ * @returns Response from the exchange
2513
+ */
2491
2514
  async cancelOrder(id, symbol = undefined, params = {}) {
2492
- /**
2493
- * @method
2494
- * @name kucoin#cancelOrder
2495
- * @description cancels an open order
2496
- * @see https://docs.kucoin.com/spot#cancel-an-order
2497
- * @see https://docs.kucoin.com/spot#cancel-an-order-2
2498
- * @see https://docs.kucoin.com/spot#cancel-single-order-by-clientoid
2499
- * @see https://docs.kucoin.com/spot#cancel-single-order-by-clientoid-2
2500
- * @see https://docs.kucoin.com/spot-hf/#cancel-orders-by-orderid
2501
- * @see https://docs.kucoin.com/spot-hf/#cancel-order-by-clientoid
2502
- * @see https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/sync-cancel-hf-order-by-orderid
2503
- * @see https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/sync-cancel-hf-order-by-clientoid
2504
- * @param {string} id order id
2505
- * @param {string} symbol unified symbol of the market the order was made in
2506
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2507
- * @param {bool} [params.stop] True if cancelling a stop order
2508
- * @param {bool} [params.hf] false, // true for hf order
2509
- * @param {bool} [params.sync] false, // true to use the hf sync call
2510
- * @returns Response from the exchange
2511
- */
2512
2515
  await this.loadMarkets();
2513
2516
  const request = {};
2514
2517
  const clientOrderId = this.safeString2(params, 'clientOid', 'clientOrderId');
@@ -2615,23 +2618,22 @@ export default class kucoin extends Exchange {
2615
2618
  });
2616
2619
  }
2617
2620
  }
2621
+ /**
2622
+ * @method
2623
+ * @name kucoin#cancelAllOrders
2624
+ * @description cancel all open orders
2625
+ * @see https://docs.kucoin.com/spot#cancel-all-orders
2626
+ * @see https://docs.kucoin.com/spot#cancel-orders
2627
+ * @see https://docs.kucoin.com/spot-hf/#cancel-all-hf-orders-by-symbol
2628
+ * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
2629
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2630
+ * @param {bool} [params.stop] *invalid for isolated margin* true if cancelling all stop orders
2631
+ * @param {string} [params.marginMode] 'cross' or 'isolated'
2632
+ * @param {string} [params.orderIds] *stop orders only* Comma seperated order IDs
2633
+ * @param {bool} [params.hf] false, // true for hf order
2634
+ * @returns Response from the exchange
2635
+ */
2618
2636
  async cancelAllOrders(symbol = undefined, params = {}) {
2619
- /**
2620
- * @method
2621
- * @name kucoin#cancelAllOrders
2622
- * @description cancel all open orders
2623
- * @see https://docs.kucoin.com/spot#cancel-all-orders
2624
- * @see https://docs.kucoin.com/spot#cancel-orders
2625
- * @see https://docs.kucoin.com/spot-hf/#cancel-all-hf-orders-by-symbol
2626
- * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
2627
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2628
- * @param {bool} [params.stop] *invalid for isolated margin* true if cancelling all stop orders
2629
- * @param {string} [params.marginMode] 'cross' or 'isolated'
2630
- * @param {string} [params.orderIds] *stop orders only* Comma seperated order IDs
2631
- * @param {bool} [params.stop] True if cancelling a stop order
2632
- * @param {bool} [params.hf] false, // true for hf order
2633
- * @returns Response from the exchange
2634
- */
2635
2637
  await this.loadMarkets();
2636
2638
  const request = {};
2637
2639
  const stop = this.safeBool(params, 'stop', false);
@@ -2665,31 +2667,30 @@ export default class kucoin extends Exchange {
2665
2667
  }
2666
2668
  return response;
2667
2669
  }
2670
+ /**
2671
+ * @method
2672
+ * @name kucoin#fetchOrdersByStatus
2673
+ * @description fetch a list of orders
2674
+ * @see https://docs.kucoin.com/spot#list-orders
2675
+ * @see https://docs.kucoin.com/spot#list-stop-orders
2676
+ * @see https://docs.kucoin.com/spot-hf/#obtain-list-of-active-hf-orders
2677
+ * @see https://docs.kucoin.com/spot-hf/#obtain-list-of-filled-hf-orders
2678
+ * @param {string} status *not used for stop orders* 'open' or 'closed'
2679
+ * @param {string} symbol unified market symbol
2680
+ * @param {int} [since] timestamp in ms of the earliest order
2681
+ * @param {int} [limit] max number of orders to return
2682
+ * @param {object} [params] exchange specific params
2683
+ * @param {int} [params.until] end time in ms
2684
+ * @param {string} [params.side] buy or sell
2685
+ * @param {string} [params.type] limit, market, limit_stop or market_stop
2686
+ * @param {string} [params.tradeType] TRADE for spot trading, MARGIN_TRADE for Margin Trading
2687
+ * @param {int} [params.currentPage] *stop orders only* current page
2688
+ * @param {string} [params.orderIds] *stop orders only* comma seperated order ID list
2689
+ * @param {bool} [params.stop] True if fetching a stop order
2690
+ * @param {bool} [params.hf] false, // true for hf order
2691
+ * @returns An [array of order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
2692
+ */
2668
2693
  async fetchOrdersByStatus(status, symbol = undefined, since = undefined, limit = undefined, params = {}) {
2669
- /**
2670
- * @method
2671
- * @name kucoin#fetchOrdersByStatus
2672
- * @description fetch a list of orders
2673
- * @see https://docs.kucoin.com/spot#list-orders
2674
- * @see https://docs.kucoin.com/spot#list-stop-orders
2675
- * @see https://docs.kucoin.com/spot-hf/#obtain-list-of-active-hf-orders
2676
- * @see https://docs.kucoin.com/spot-hf/#obtain-list-of-filled-hf-orders
2677
- * @param {string} status *not used for stop orders* 'open' or 'closed'
2678
- * @param {string} symbol unified market symbol
2679
- * @param {int} [since] timestamp in ms of the earliest order
2680
- * @param {int} [limit] max number of orders to return
2681
- * @param {object} [params] exchange specific params
2682
- * @param {int} [params.until] end time in ms
2683
- * @param {bool} [params.stop] true if fetching stop orders
2684
- * @param {string} [params.side] buy or sell
2685
- * @param {string} [params.type] limit, market, limit_stop or market_stop
2686
- * @param {string} [params.tradeType] TRADE for spot trading, MARGIN_TRADE for Margin Trading
2687
- * @param {int} [params.currentPage] *stop orders only* current page
2688
- * @param {string} [params.orderIds] *stop orders only* comma seperated order ID list
2689
- * @param {bool} [params.stop] True if fetching a stop order
2690
- * @param {bool} [params.hf] false, // true for hf order
2691
- * @returns An [array of order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
2692
- */
2693
2694
  await this.loadMarkets();
2694
2695
  let lowercaseStatus = status.toLowerCase();
2695
2696
  const until = this.safeInteger(params, 'until');
@@ -2791,28 +2792,28 @@ export default class kucoin extends Exchange {
2791
2792
  const orders = this.safeList(responseData, 'items', []);
2792
2793
  return this.parseOrders(orders, market, since, limit);
2793
2794
  }
2795
+ /**
2796
+ * @method
2797
+ * @name kucoin#fetchClosedOrders
2798
+ * @description fetches information on multiple closed orders made by the user
2799
+ * @see https://docs.kucoin.com/spot#list-orders
2800
+ * @see https://docs.kucoin.com/spot#list-stop-orders
2801
+ * @see https://docs.kucoin.com/spot-hf/#obtain-list-of-active-hf-orders
2802
+ * @see https://docs.kucoin.com/spot-hf/#obtain-list-of-filled-hf-orders
2803
+ * @param {string} symbol unified market symbol of the market orders were made in
2804
+ * @param {int} [since] the earliest time in ms to fetch orders for
2805
+ * @param {int} [limit] the maximum number of order structures to retrieve
2806
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2807
+ * @param {int} [params.until] end time in ms
2808
+ * @param {string} [params.side] buy or sell
2809
+ * @param {string} [params.type] limit, market, limit_stop or market_stop
2810
+ * @param {string} [params.tradeType] TRADE for spot trading, MARGIN_TRADE for Margin Trading
2811
+ * @param {bool} [params.stop] True if fetching a stop order
2812
+ * @param {bool} [params.hf] false, // true for hf order
2813
+ * @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)
2814
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
2815
+ */
2794
2816
  async fetchClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
2795
- /**
2796
- * @method
2797
- * @name kucoin#fetchClosedOrders
2798
- * @description fetches information on multiple closed orders made by the user
2799
- * @see https://docs.kucoin.com/spot#list-orders
2800
- * @see https://docs.kucoin.com/spot#list-stop-orders
2801
- * @see https://docs.kucoin.com/spot-hf/#obtain-list-of-active-hf-orders
2802
- * @see https://docs.kucoin.com/spot-hf/#obtain-list-of-filled-hf-orders
2803
- * @param {string} symbol unified market symbol of the market orders were made in
2804
- * @param {int} [since] the earliest time in ms to fetch orders for
2805
- * @param {int} [limit] the maximum number of order structures to retrieve
2806
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2807
- * @param {int} [params.until] end time in ms
2808
- * @param {string} [params.side] buy or sell
2809
- * @param {string} [params.type] limit, market, limit_stop or market_stop
2810
- * @param {string} [params.tradeType] TRADE for spot trading, MARGIN_TRADE for Margin Trading
2811
- * @param {bool} [params.stop] True if fetching a stop order
2812
- * @param {bool} [params.hf] false, // true for hf order
2813
- * @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)
2814
- * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
2815
- */
2816
2817
  await this.loadMarkets();
2817
2818
  let paginate = false;
2818
2819
  [paginate, params] = this.handleOptionAndParams(params, 'fetchClosedOrders', 'paginate');
@@ -2821,31 +2822,30 @@ export default class kucoin extends Exchange {
2821
2822
  }
2822
2823
  return await this.fetchOrdersByStatus('done', symbol, since, limit, params);
2823
2824
  }
2825
+ /**
2826
+ * @method
2827
+ * @name kucoin#fetchOpenOrders
2828
+ * @description fetch all unfilled currently open orders
2829
+ * @see https://docs.kucoin.com/spot#list-orders
2830
+ * @see https://docs.kucoin.com/spot#list-stop-orders
2831
+ * @see https://docs.kucoin.com/spot-hf/#obtain-list-of-active-hf-orders
2832
+ * @see https://docs.kucoin.com/spot-hf/#obtain-list-of-filled-hf-orders
2833
+ * @param {string} symbol unified market symbol
2834
+ * @param {int} [since] the earliest time in ms to fetch open orders for
2835
+ * @param {int} [limit] the maximum number of open orders structures to retrieve
2836
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2837
+ * @param {int} [params.until] end time in ms
2838
+ * @param {bool} [params.stop] true if fetching stop orders
2839
+ * @param {string} [params.side] buy or sell
2840
+ * @param {string} [params.type] limit, market, limit_stop or market_stop
2841
+ * @param {string} [params.tradeType] TRADE for spot trading, MARGIN_TRADE for Margin Trading
2842
+ * @param {int} [params.currentPage] *stop orders only* current page
2843
+ * @param {string} [params.orderIds] *stop orders only* comma seperated order ID list
2844
+ * @param {bool} [params.hf] false, // true for hf order
2845
+ * @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)
2846
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
2847
+ */
2824
2848
  async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
2825
- /**
2826
- * @method
2827
- * @name kucoin#fetchOpenOrders
2828
- * @description fetch all unfilled currently open orders
2829
- * @see https://docs.kucoin.com/spot#list-orders
2830
- * @see https://docs.kucoin.com/spot#list-stop-orders
2831
- * @see https://docs.kucoin.com/spot-hf/#obtain-list-of-active-hf-orders
2832
- * @see https://docs.kucoin.com/spot-hf/#obtain-list-of-filled-hf-orders
2833
- * @param {string} symbol unified market symbol
2834
- * @param {int} [since] the earliest time in ms to fetch open orders for
2835
- * @param {int} [limit] the maximum number of open orders structures to retrieve
2836
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2837
- * @param {int} [params.until] end time in ms
2838
- * @param {bool} [params.stop] true if fetching stop orders
2839
- * @param {string} [params.side] buy or sell
2840
- * @param {string} [params.type] limit, market, limit_stop or market_stop
2841
- * @param {string} [params.tradeType] TRADE for spot trading, MARGIN_TRADE for Margin Trading
2842
- * @param {int} [params.currentPage] *stop orders only* current page
2843
- * @param {string} [params.orderIds] *stop orders only* comma seperated order ID list
2844
- * @param {bool} [params.stop] True if fetching a stop order
2845
- * @param {bool} [params.hf] false, // true for hf order
2846
- * @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)
2847
- * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
2848
- */
2849
2849
  await this.loadMarkets();
2850
2850
  let paginate = false;
2851
2851
  [paginate, params] = this.handleOptionAndParams(params, 'fetchOpenOrders', 'paginate');
@@ -2854,25 +2854,25 @@ export default class kucoin extends Exchange {
2854
2854
  }
2855
2855
  return await this.fetchOrdersByStatus('active', symbol, since, limit, params);
2856
2856
  }
2857
+ /**
2858
+ * @method
2859
+ * @name kucoin#fetchOrder
2860
+ * @description fetch an order
2861
+ * @see https://docs.kucoin.com/spot#get-an-order
2862
+ * @see https://docs.kucoin.com/spot#get-single-active-order-by-clientoid
2863
+ * @see https://docs.kucoin.com/spot#get-single-order-info
2864
+ * @see https://docs.kucoin.com/spot#get-single-order-by-clientoid
2865
+ * @see https://docs.kucoin.com/spot-hf/#details-of-a-single-hf-order
2866
+ * @see https://docs.kucoin.com/spot-hf/#obtain-details-of-a-single-hf-order-using-clientoid
2867
+ * @param {string} id Order id
2868
+ * @param {string} symbol not sent to exchange except for stop orders with clientOid, but used internally by CCXT to filter
2869
+ * @param {object} [params] exchange specific parameters
2870
+ * @param {bool} [params.stop] true if fetching a stop order
2871
+ * @param {bool} [params.hf] false, // true for hf order
2872
+ * @param {bool} [params.clientOid] unique order id created by users to identify their orders
2873
+ * @returns An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2874
+ */
2857
2875
  async fetchOrder(id, symbol = undefined, params = {}) {
2858
- /**
2859
- * @method
2860
- * @name kucoin#fetchOrder
2861
- * @description fetch an order
2862
- * @see https://docs.kucoin.com/spot#get-an-order
2863
- * @see https://docs.kucoin.com/spot#get-single-active-order-by-clientoid
2864
- * @see https://docs.kucoin.com/spot#get-single-order-info
2865
- * @see https://docs.kucoin.com/spot#get-single-order-by-clientoid
2866
- * @see https://docs.kucoin.com/spot-hf/#details-of-a-single-hf-order
2867
- * @see https://docs.kucoin.com/spot-hf/#obtain-details-of-a-single-hf-order-using-clientoid
2868
- * @param {string} id Order id
2869
- * @param {string} symbol not sent to exchange except for stop orders with clientOid, but used internally by CCXT to filter
2870
- * @param {object} [params] exchange specific parameters
2871
- * @param {bool} [params.stop] true if fetching a stop order
2872
- * @param {bool} [params.hf] false, // true for hf order
2873
- * @param {bool} [params.clientOid] unique order id created by users to identify their orders
2874
- * @returns An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2875
- */
2876
2876
  await this.loadMarkets();
2877
2877
  const request = {};
2878
2878
  const clientOrderId = this.safeString2(params, 'clientOid', 'clientOrderId');
@@ -3113,41 +3113,41 @@ export default class kucoin extends Exchange {
3113
3113
  'trades': undefined,
3114
3114
  }, market);
3115
3115
  }
3116
+ /**
3117
+ * @method
3118
+ * @name kucoin#fetchOrderTrades
3119
+ * @description fetch all the trades made from a single order
3120
+ * @see https://docs.kucoin.com/#list-fills
3121
+ * @see https://docs.kucoin.com/spot-hf/#transaction-details
3122
+ * @param {string} id order id
3123
+ * @param {string} symbol unified market symbol
3124
+ * @param {int} [since] the earliest time in ms to fetch trades for
3125
+ * @param {int} [limit] the maximum number of trades to retrieve
3126
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3127
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
3128
+ */
3116
3129
  async fetchOrderTrades(id, symbol = undefined, since = undefined, limit = undefined, params = {}) {
3117
- /**
3118
- * @method
3119
- * @name kucoin#fetchOrderTrades
3120
- * @description fetch all the trades made from a single order
3121
- * @see https://docs.kucoin.com/#list-fills
3122
- * @see https://docs.kucoin.com/spot-hf/#transaction-details
3123
- * @param {string} id order id
3124
- * @param {string} symbol unified market symbol
3125
- * @param {int} [since] the earliest time in ms to fetch trades for
3126
- * @param {int} [limit] the maximum number of trades to retrieve
3127
- * @param {object} [params] extra parameters specific to the exchange API endpoint
3128
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
3129
- */
3130
3130
  const request = {
3131
3131
  'orderId': id,
3132
3132
  };
3133
3133
  return await this.fetchMyTrades(symbol, since, limit, this.extend(request, params));
3134
3134
  }
3135
+ /**
3136
+ * @method
3137
+ * @name kucoin#fetchMyTrades
3138
+ * @see https://docs.kucoin.com/#list-fills
3139
+ * @see https://docs.kucoin.com/spot-hf/#transaction-details
3140
+ * @description fetch all trades made by the user
3141
+ * @param {string} symbol unified market symbol
3142
+ * @param {int} [since] the earliest time in ms to fetch trades for
3143
+ * @param {int} [limit] the maximum number of trades structures to retrieve
3144
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3145
+ * @param {int} [params.until] the latest time in ms to fetch entries for
3146
+ * @param {bool} [params.hf] false, // true for hf order
3147
+ * @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)
3148
+ * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
3149
+ */
3135
3150
  async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
3136
- /**
3137
- * @method
3138
- * @name kucoin#fetchMyTrades
3139
- * @see https://docs.kucoin.com/#list-fills
3140
- * @see https://docs.kucoin.com/spot-hf/#transaction-details
3141
- * @description fetch all trades made by the user
3142
- * @param {string} symbol unified market symbol
3143
- * @param {int} [since] the earliest time in ms to fetch trades for
3144
- * @param {int} [limit] the maximum number of trades structures to retrieve
3145
- * @param {object} [params] extra parameters specific to the exchange API endpoint
3146
- * @param {int} [params.until] the latest time in ms to fetch entries for
3147
- * @param {bool} [params.hf] false, // true for hf order
3148
- * @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)
3149
- * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
3150
- */
3151
3151
  await this.loadMarkets();
3152
3152
  let paginate = false;
3153
3153
  [paginate, params] = this.handleOptionAndParams(params, 'fetchMyTrades', 'paginate');
@@ -3243,18 +3243,18 @@ export default class kucoin extends Exchange {
3243
3243
  }
3244
3244
  return this.parseTrades(trades, market, since, limit);
3245
3245
  }
3246
+ /**
3247
+ * @method
3248
+ * @name kucoin#fetchTrades
3249
+ * @description get the list of most recent trades for a particular symbol
3250
+ * @see https://www.kucoin.com/docs/rest/spot-trading/market-data/get-trade-histories
3251
+ * @param {string} symbol unified symbol of the market to fetch trades for
3252
+ * @param {int} [since] timestamp in ms of the earliest trade to fetch
3253
+ * @param {int} [limit] the maximum amount of trades to fetch
3254
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3255
+ * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
3256
+ */
3246
3257
  async fetchTrades(symbol, since = undefined, limit = undefined, params = {}) {
3247
- /**
3248
- * @method
3249
- * @name kucoin#fetchTrades
3250
- * @description get the list of most recent trades for a particular symbol
3251
- * @see https://www.kucoin.com/docs/rest/spot-trading/market-data/get-trade-histories
3252
- * @param {string} symbol unified symbol of the market to fetch trades for
3253
- * @param {int} [since] timestamp in ms of the earliest trade to fetch
3254
- * @param {int} [limit] the maximum amount of trades to fetch
3255
- * @param {object} [params] extra parameters specific to the exchange API endpoint
3256
- * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
3257
- */
3258
3258
  await this.loadMarkets();
3259
3259
  const market = this.market(symbol);
3260
3260
  const request = {
@@ -3416,16 +3416,16 @@ export default class kucoin extends Exchange {
3416
3416
  'fee': fee,
3417
3417
  }, market);
3418
3418
  }
3419
+ /**
3420
+ * @method
3421
+ * @name kucoin#fetchTradingFee
3422
+ * @description fetch the trading fees for a market
3423
+ * @see https://www.kucoin.com/docs/rest/funding/trade-fee/trading-pair-actual-fee-spot-margin-trade_hf
3424
+ * @param {string} symbol unified market symbol
3425
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3426
+ * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
3427
+ */
3419
3428
  async fetchTradingFee(symbol, params = {}) {
3420
- /**
3421
- * @method
3422
- * @name kucoin#fetchTradingFee
3423
- * @description fetch the trading fees for a market
3424
- * @see https://www.kucoin.com/docs/rest/funding/trade-fee/trading-pair-actual-fee-spot-margin-trade_hf
3425
- * @param {string} symbol unified market symbol
3426
- * @param {object} [params] extra parameters specific to the exchange API endpoint
3427
- * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
3428
- */
3429
3429
  await this.loadMarkets();
3430
3430
  const market = this.market(symbol);
3431
3431
  const request = {
@@ -3456,19 +3456,19 @@ export default class kucoin extends Exchange {
3456
3456
  'tierBased': true,
3457
3457
  };
3458
3458
  }
3459
+ /**
3460
+ * @method
3461
+ * @name kucoin#withdraw
3462
+ * @description make a withdrawal
3463
+ * @see https://www.kucoin.com/docs/rest/funding/withdrawals/apply-withdraw-v3-
3464
+ * @param {string} code unified currency code
3465
+ * @param {float} amount the amount to withdraw
3466
+ * @param {string} address the address to withdraw to
3467
+ * @param {string} tag
3468
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3469
+ * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
3470
+ */
3459
3471
  async withdraw(code, amount, address, tag = undefined, params = {}) {
3460
- /**
3461
- * @method
3462
- * @name kucoin#withdraw
3463
- * @description make a withdrawal
3464
- * @see https://www.kucoin.com/docs/rest/funding/withdrawals/apply-withdraw-v3-
3465
- * @param {string} code unified currency code
3466
- * @param {float} amount the amount to withdraw
3467
- * @param {string} address the address to withdraw to
3468
- * @param {string} tag
3469
- * @param {object} [params] extra parameters specific to the exchange API endpoint
3470
- * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
3471
- */
3472
3472
  [tag, params] = this.handleWithdrawTagAndParams(tag, params);
3473
3473
  await this.loadMarkets();
3474
3474
  this.checkAddress(address);
@@ -3632,21 +3632,21 @@ export default class kucoin extends Exchange {
3632
3632
  'updated': updated,
3633
3633
  };
3634
3634
  }
3635
+ /**
3636
+ * @method
3637
+ * @name kucoin#fetchDeposits
3638
+ * @description fetch all deposits made to an account
3639
+ * @see https://www.kucoin.com/docs/rest/funding/deposit/get-deposit-list
3640
+ * @see https://www.kucoin.com/docs/rest/funding/deposit/get-v1-historical-deposits-list
3641
+ * @param {string} code unified currency code
3642
+ * @param {int} [since] the earliest time in ms to fetch deposits for
3643
+ * @param {int} [limit] the maximum number of deposits structures to retrieve
3644
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3645
+ * @param {int} [params.until] the latest time in ms to fetch entries for
3646
+ * @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)
3647
+ * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
3648
+ */
3635
3649
  async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
3636
- /**
3637
- * @method
3638
- * @name kucoin#fetchDeposits
3639
- * @description fetch all deposits made to an account
3640
- * @see https://www.kucoin.com/docs/rest/funding/deposit/get-deposit-list
3641
- * @see https://www.kucoin.com/docs/rest/funding/deposit/get-v1-historical-deposits-list
3642
- * @param {string} code unified currency code
3643
- * @param {int} [since] the earliest time in ms to fetch deposits for
3644
- * @param {int} [limit] the maximum number of deposits structures to retrieve
3645
- * @param {object} [params] extra parameters specific to the exchange API endpoint
3646
- * @param {int} [params.until] the latest time in ms to fetch entries for
3647
- * @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)
3648
- * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
3649
- */
3650
3650
  await this.loadMarkets();
3651
3651
  let paginate = false;
3652
3652
  [paginate, params] = this.handleOptionAndParams(params, 'fetchDeposits', 'paginate');
@@ -3717,21 +3717,21 @@ export default class kucoin extends Exchange {
3717
3717
  const items = this.safeList(data, 'items', []);
3718
3718
  return this.parseTransactions(items, currency, since, limit, { 'type': 'deposit' });
3719
3719
  }
3720
+ /**
3721
+ * @method
3722
+ * @name kucoin#fetchWithdrawals
3723
+ * @description fetch all withdrawals made from an account
3724
+ * @see https://www.kucoin.com/docs/rest/funding/withdrawals/get-withdrawals-list
3725
+ * @see https://www.kucoin.com/docs/rest/funding/withdrawals/get-v1-historical-withdrawals-list
3726
+ * @param {string} code unified currency code
3727
+ * @param {int} [since] the earliest time in ms to fetch withdrawals for
3728
+ * @param {int} [limit] the maximum number of withdrawals structures to retrieve
3729
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3730
+ * @param {int} [params.until] the latest time in ms to fetch entries for
3731
+ * @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)
3732
+ * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
3733
+ */
3720
3734
  async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
3721
- /**
3722
- * @method
3723
- * @name kucoin#fetchWithdrawals
3724
- * @description fetch all withdrawals made from an account
3725
- * @see https://www.kucoin.com/docs/rest/funding/withdrawals/get-withdrawals-list
3726
- * @see https://www.kucoin.com/docs/rest/funding/withdrawals/get-v1-historical-withdrawals-list
3727
- * @param {string} code unified currency code
3728
- * @param {int} [since] the earliest time in ms to fetch withdrawals for
3729
- * @param {int} [limit] the maximum number of withdrawals structures to retrieve
3730
- * @param {object} [params] extra parameters specific to the exchange API endpoint
3731
- * @param {int} [params.until] the latest time in ms to fetch entries for
3732
- * @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)
3733
- * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
3734
- */
3735
3735
  await this.loadMarkets();
3736
3736
  let paginate = false;
3737
3737
  [paginate, params] = this.handleOptionAndParams(params, 'fetchWithdrawals', 'paginate');
@@ -3813,20 +3813,20 @@ export default class kucoin extends Exchange {
3813
3813
  account['debt'] = Precise.stringAdd(debt, interest);
3814
3814
  return account;
3815
3815
  }
3816
+ /**
3817
+ * @method
3818
+ * @name kucoin#fetchBalance
3819
+ * @description query for balance and get the amount of funds available for trading or funds locked in orders
3820
+ * @see https://www.kucoin.com/docs/rest/account/basic-info/get-account-list-spot-margin-trade_hf
3821
+ * @see https://www.kucoin.com/docs/rest/funding/funding-overview/get-account-detail-margin
3822
+ * @see https://www.kucoin.com/docs/rest/funding/funding-overview/get-account-detail-isolated-margin
3823
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3824
+ * @param {object} [params.marginMode] 'cross' or 'isolated', margin type for fetching margin balance
3825
+ * @param {object} [params.type] extra parameters specific to the exchange API endpoint
3826
+ * @param {object} [params.hf] *default if false* if true, the result includes the balance of the high frequency account
3827
+ * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
3828
+ */
3816
3829
  async fetchBalance(params = {}) {
3817
- /**
3818
- * @method
3819
- * @name kucoin#fetchBalance
3820
- * @description query for balance and get the amount of funds available for trading or funds locked in orders
3821
- * @see https://www.kucoin.com/docs/rest/account/basic-info/get-account-list-spot-margin-trade_hf
3822
- * @see https://www.kucoin.com/docs/rest/funding/funding-overview/get-account-detail-margin
3823
- * @see https://www.kucoin.com/docs/rest/funding/funding-overview/get-account-detail-isolated-margin
3824
- * @param {object} [params] extra parameters specific to the exchange API endpoint
3825
- * @param {object} [params.marginMode] 'cross' or 'isolated', margin type for fetching margin balance
3826
- * @param {object} [params.type] extra parameters specific to the exchange API endpoint
3827
- * @param {object} [params.hf] *default if false* if true, the result includes the balance of the high frequency account
3828
- * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
3829
- */
3830
3830
  await this.loadMarkets();
3831
3831
  const code = this.safeString(params, 'code');
3832
3832
  let currency = undefined;
@@ -3993,21 +3993,21 @@ export default class kucoin extends Exchange {
3993
3993
  const returnType = isolated ? result : this.safeBalance(result);
3994
3994
  return returnType;
3995
3995
  }
3996
+ /**
3997
+ * @method
3998
+ * @name kucoin#transfer
3999
+ * @description transfer currency internally between wallets on the same account
4000
+ * @see https://www.kucoin.com/docs/rest/funding/transfer/inner-transfer
4001
+ * @see https://docs.kucoin.com/futures/#transfer-funds-to-kucoin-main-account-2
4002
+ * @see https://docs.kucoin.com/spot-hf/#internal-funds-transfers-in-high-frequency-trading-accounts
4003
+ * @param {string} code unified currency code
4004
+ * @param {float} amount amount to transfer
4005
+ * @param {string} fromAccount account to transfer from
4006
+ * @param {string} toAccount account to transfer to
4007
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
4008
+ * @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
4009
+ */
3996
4010
  async transfer(code, amount, fromAccount, toAccount, params = {}) {
3997
- /**
3998
- * @method
3999
- * @name kucoin#transfer
4000
- * @description transfer currency internally between wallets on the same account
4001
- * @see https://www.kucoin.com/docs/rest/funding/transfer/inner-transfer
4002
- * @see https://docs.kucoin.com/futures/#transfer-funds-to-kucoin-main-account-2
4003
- * @see https://docs.kucoin.com/spot-hf/#internal-funds-transfers-in-high-frequency-trading-accounts
4004
- * @param {string} code unified currency code
4005
- * @param {float} amount amount to transfer
4006
- * @param {string} fromAccount account to transfer from
4007
- * @param {string} toAccount account to transfer to
4008
- * @param {object} [params] extra parameters specific to the exchange API endpoint
4009
- * @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
4010
- */
4011
4011
  await this.loadMarkets();
4012
4012
  const currency = this.currency(code);
4013
4013
  const requestedAmount = this.currencyToPrecision(code, amount);
@@ -4278,23 +4278,23 @@ export default class kucoin extends Exchange {
4278
4278
  'fee': fee,
4279
4279
  }, currency);
4280
4280
  }
4281
+ /**
4282
+ * @method
4283
+ * @name kucoin#fetchLedger
4284
+ * @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
4285
+ * @see https://www.kucoin.com/docs/rest/account/basic-info/get-account-ledgers-spot-margin
4286
+ * @see https://www.kucoin.com/docs/rest/account/basic-info/get-account-ledgers-trade_hf
4287
+ * @see https://www.kucoin.com/docs/rest/account/basic-info/get-account-ledgers-margin_hf
4288
+ * @param {string} [code] unified currency code, default is undefined
4289
+ * @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
4290
+ * @param {int} [limit] max number of ledger entries to return, default is undefined
4291
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
4292
+ * @param {boolean} [params.hf] default false, when true will fetch ledger entries for the high frequency trading account
4293
+ * @param {int} [params.until] the latest time in ms to fetch entries for
4294
+ * @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)
4295
+ * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
4296
+ */
4281
4297
  async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
4282
- /**
4283
- * @method
4284
- * @name kucoin#fetchLedger
4285
- * @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
4286
- * @see https://www.kucoin.com/docs/rest/account/basic-info/get-account-ledgers-spot-margin
4287
- * @see https://www.kucoin.com/docs/rest/account/basic-info/get-account-ledgers-trade_hf
4288
- * @see https://www.kucoin.com/docs/rest/account/basic-info/get-account-ledgers-margin_hf
4289
- * @param {string} [code] unified currency code, default is undefined
4290
- * @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
4291
- * @param {int} [limit] max number of ledger entries to return, default is undefined
4292
- * @param {object} [params] extra parameters specific to the exchange API endpoint
4293
- * @param {boolean} [params.hf] default false, when true will fetch ledger entries for the high frequency trading account
4294
- * @param {int} [params.until] the latest time in ms to fetch entries for
4295
- * @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)
4296
- * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
4297
- */
4298
4298
  await this.loadMarkets();
4299
4299
  await this.loadAccounts();
4300
4300
  let paginate = false;
@@ -4427,33 +4427,40 @@ export default class kucoin extends Exchange {
4427
4427
  'info': info,
4428
4428
  };
4429
4429
  }
4430
+ /**
4431
+ * @method
4432
+ * @name kucoin#fetchBorrowInterest
4433
+ * @description fetch the interest owed by the user for borrowing currency for margin trading
4434
+ * @see https://docs.kucoin.com/#get-repay-record
4435
+ * @see https://docs.kucoin.com/#query-isolated-margin-account-info
4436
+ * @param {string} [code] unified currency code
4437
+ * @param {string} [symbol] unified market symbol, required for isolated margin
4438
+ * @param {int} [since] the earliest time in ms to fetch borrrow interest for
4439
+ * @param {int} [limit] the maximum number of structures to retrieve
4440
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
4441
+ * @param {string} [params.marginMode] 'cross' or 'isolated' default is 'cross'
4442
+ * @returns {object[]} a list of [borrow interest structures]{@link https://docs.ccxt.com/#/?id=borrow-interest-structure}
4443
+ */
4430
4444
  async fetchBorrowInterest(code = undefined, symbol = undefined, since = undefined, limit = undefined, params = {}) {
4431
- /**
4432
- * @method
4433
- * @name kucoin#fetchBorrowInterest
4434
- * @description fetch the interest owed by the user for borrowing currency for margin trading
4435
- * @see https://docs.kucoin.com/#get-repay-record
4436
- * @see https://docs.kucoin.com/#query-isolated-margin-account-info
4437
- * @param {string} code unified currency code
4438
- * @param {string} symbol unified market symbol, required for isolated margin
4439
- * @param {int} [since] the earliest time in ms to fetch borrrow interest for
4440
- * @param {int} [limit] the maximum number of structures to retrieve
4441
- * @param {object} [params] extra parameters specific to the exchange API endpoint
4442
- * @param {string} [params.marginMode] 'cross' or 'isolated' default is 'cross'
4443
- * @returns {object[]} a list of [borrow interest structures]{@link https://docs.ccxt.com/#/?id=borrow-interest-structure}
4444
- */
4445
4445
  await this.loadMarkets();
4446
4446
  let marginMode = undefined;
4447
- [marginMode, params] = this.handleMarginModeAndParams('fetchBorrowInterest', params);
4448
- if (marginMode === undefined) {
4449
- marginMode = 'cross'; // cross as default marginMode
4450
- }
4447
+ [marginMode, params] = this.handleMarginModeAndParams('fetchBorrowInterest', params, 'cross');
4451
4448
  const request = {};
4452
- let response = undefined;
4449
+ let currency = undefined;
4453
4450
  if (code !== undefined) {
4454
- const currency = this.currency(code);
4455
- request['quoteCurrency'] = currency['id'];
4451
+ currency = this.currency(code);
4452
+ if (marginMode === 'isolated') {
4453
+ request['balanceCurrency'] = currency['id'];
4454
+ }
4455
+ else {
4456
+ request['quoteCurrency'] = currency['id'];
4457
+ }
4456
4458
  }
4459
+ let market = undefined;
4460
+ if (symbol !== undefined) {
4461
+ market = this.market(symbol);
4462
+ }
4463
+ let response = undefined;
4457
4464
  if (marginMode === 'isolated') {
4458
4465
  response = await this.privateGetIsolatedAccounts(this.extend(request, params));
4459
4466
  }
@@ -4526,7 +4533,9 @@ export default class kucoin extends Exchange {
4526
4533
  //
4527
4534
  const data = this.safeDict(response, 'data', {});
4528
4535
  const assets = (marginMode === 'isolated') ? this.safeList(data, 'assets', []) : this.safeList(data, 'accounts', []);
4529
- return this.parseBorrowInterests(assets, undefined);
4536
+ const interest = this.parseBorrowInterests(assets, market);
4537
+ const filteredByCurrency = this.filterByCurrencySinceLimit(interest, code, since, limit);
4538
+ return this.filterBySymbolSinceLimit(filteredByCurrency, symbol, since, limit);
4530
4539
  }
4531
4540
  parseBorrowInterest(info, market = undefined) {
4532
4541
  //
@@ -4604,20 +4613,20 @@ export default class kucoin extends Exchange {
4604
4613
  'datetime': this.iso8601(timestamp),
4605
4614
  };
4606
4615
  }
4616
+ /**
4617
+ * @method
4618
+ * @name kucoin#fetchBorrowRateHistories
4619
+ * @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
4620
+ * @see https://www.kucoin.com/docs/rest/margin-trading/margin-trading-v3-/get-cross-isolated-margin-interest-records
4621
+ * @param {string[]|undefined} codes list of unified currency codes, default is undefined
4622
+ * @param {int} [since] timestamp in ms of the earliest borrowRate, default is undefined
4623
+ * @param {int} [limit] max number of borrow rate prices to return, default is undefined
4624
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
4625
+ * @param {string} [params.marginMode] 'cross' or 'isolated' default is 'cross'
4626
+ * @param {int} [params.until] the latest time in ms to fetch entries for
4627
+ * @returns {object} a dictionary of [borrow rate structures]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure} indexed by the market symbol
4628
+ */
4607
4629
  async fetchBorrowRateHistories(codes = undefined, since = undefined, limit = undefined, params = {}) {
4608
- /**
4609
- * @method
4610
- * @name kucoin#fetchBorrowRateHistories
4611
- * @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
4612
- * @see https://www.kucoin.com/docs/rest/margin-trading/margin-trading-v3-/get-cross-isolated-margin-interest-records
4613
- * @param {string[]|undefined} codes list of unified currency codes, default is undefined
4614
- * @param {int} [since] timestamp in ms of the earliest borrowRate, default is undefined
4615
- * @param {int} [limit] max number of borrow rate prices to return, default is undefined
4616
- * @param {object} [params] extra parameters specific to the exchange API endpoint
4617
- * @param {string} [params.marginMode] 'cross' or 'isolated' default is 'cross'
4618
- * @param {int} [params.until] the latest time in ms to fetch entries for
4619
- * @returns {object} a dictionary of [borrow rate structures]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure} indexed by the market symbol
4620
- */
4621
4630
  await this.loadMarkets();
4622
4631
  const marginResult = this.handleMarginModeAndParams('fetchBorrowRateHistories', params);
4623
4632
  const marginMode = this.safeString(marginResult, 0, 'cross');
@@ -4657,20 +4666,20 @@ export default class kucoin extends Exchange {
4657
4666
  const rows = this.safeList(data, 'items', []);
4658
4667
  return this.parseBorrowRateHistories(rows, codes, since, limit);
4659
4668
  }
4669
+ /**
4670
+ * @method
4671
+ * @name kucoin#fetchBorrowRateHistory
4672
+ * @description retrieves a history of a currencies borrow interest rate at specific time slots
4673
+ * @see https://www.kucoin.com/docs/rest/margin-trading/margin-trading-v3-/get-cross-isolated-margin-interest-records
4674
+ * @param {string} code unified currency code
4675
+ * @param {int} [since] timestamp for the earliest borrow rate
4676
+ * @param {int} [limit] the maximum number of [borrow rate structures]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure} to retrieve
4677
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
4678
+ * @param {string} [params.marginMode] 'cross' or 'isolated' default is 'cross'
4679
+ * @param {int} [params.until] the latest time in ms to fetch entries for
4680
+ * @returns {object[]} an array of [borrow rate structures]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure}
4681
+ */
4660
4682
  async fetchBorrowRateHistory(code, since = undefined, limit = undefined, params = {}) {
4661
- /**
4662
- * @method
4663
- * @name kucoin#fetchBorrowRateHistory
4664
- * @description retrieves a history of a currencies borrow interest rate at specific time slots
4665
- * @see https://www.kucoin.com/docs/rest/margin-trading/margin-trading-v3-/get-cross-isolated-margin-interest-records
4666
- * @param {string} code unified currency code
4667
- * @param {int} [since] timestamp for the earliest borrow rate
4668
- * @param {int} [limit] the maximum number of [borrow rate structures]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure} to retrieve
4669
- * @param {object} [params] extra parameters specific to the exchange API endpoint
4670
- * @param {string} [params.marginMode] 'cross' or 'isolated' default is 'cross'
4671
- * @param {int} [params.until] the latest time in ms to fetch entries for
4672
- * @returns {object[]} an array of [borrow rate structures]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure}
4673
- */
4674
4683
  await this.loadMarkets();
4675
4684
  const marginResult = this.handleMarginModeAndParams('fetchBorrowRateHistories', params);
4676
4685
  const marginMode = this.safeString(marginResult, 0, 'cross');
@@ -4742,18 +4751,18 @@ export default class kucoin extends Exchange {
4742
4751
  }
4743
4752
  return borrowRateHistories;
4744
4753
  }
4754
+ /**
4755
+ * @method
4756
+ * @name kucoin#borrowCrossMargin
4757
+ * @description create a loan to borrow margin
4758
+ * @see https://docs.kucoin.com/#1-margin-borrowing
4759
+ * @param {string} code unified currency code of the currency to borrow
4760
+ * @param {float} amount the amount to borrow
4761
+ * @param {object} [params] extra parameters specific to the exchange API endpoints
4762
+ * @param {string} [params.timeInForce] either IOC or FOK
4763
+ * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
4764
+ */
4745
4765
  async borrowCrossMargin(code, amount, params = {}) {
4746
- /**
4747
- * @method
4748
- * @name kucoin#borrowCrossMargin
4749
- * @description create a loan to borrow margin
4750
- * @see https://docs.kucoin.com/#1-margin-borrowing
4751
- * @param {string} code unified currency code of the currency to borrow
4752
- * @param {float} amount the amount to borrow
4753
- * @param {object} [params] extra parameters specific to the exchange API endpoints
4754
- * @param {string} [params.timeInForce] either IOC or FOK
4755
- * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
4756
- */
4757
4766
  await this.loadMarkets();
4758
4767
  const currency = this.currency(code);
4759
4768
  const request = {
@@ -4777,19 +4786,19 @@ export default class kucoin extends Exchange {
4777
4786
  const data = this.safeDict(response, 'data', {});
4778
4787
  return this.parseMarginLoan(data, currency);
4779
4788
  }
4789
+ /**
4790
+ * @method
4791
+ * @name kucoin#borrowIsolatedMargin
4792
+ * @description create a loan to borrow margin
4793
+ * @see https://docs.kucoin.com/#1-margin-borrowing
4794
+ * @param {string} symbol unified market symbol, required for isolated margin
4795
+ * @param {string} code unified currency code of the currency to borrow
4796
+ * @param {float} amount the amount to borrow
4797
+ * @param {object} [params] extra parameters specific to the exchange API endpoints
4798
+ * @param {string} [params.timeInForce] either IOC or FOK
4799
+ * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
4800
+ */
4780
4801
  async borrowIsolatedMargin(symbol, code, amount, params = {}) {
4781
- /**
4782
- * @method
4783
- * @name kucoin#borrowIsolatedMargin
4784
- * @description create a loan to borrow margin
4785
- * @see https://docs.kucoin.com/#1-margin-borrowing
4786
- * @param {string} symbol unified market symbol, required for isolated margin
4787
- * @param {string} code unified currency code of the currency to borrow
4788
- * @param {float} amount the amount to borrow
4789
- * @param {object} [params] extra parameters specific to the exchange API endpoints
4790
- * @param {string} [params.timeInForce] either IOC or FOK
4791
- * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
4792
- */
4793
4802
  await this.loadMarkets();
4794
4803
  const market = this.market(symbol);
4795
4804
  const currency = this.currency(code);
@@ -4816,17 +4825,17 @@ export default class kucoin extends Exchange {
4816
4825
  const data = this.safeDict(response, 'data', {});
4817
4826
  return this.parseMarginLoan(data, currency);
4818
4827
  }
4828
+ /**
4829
+ * @method
4830
+ * @name kucoin#repayCrossMargin
4831
+ * @description repay borrowed margin and interest
4832
+ * @see https://docs.kucoin.com/#2-repayment
4833
+ * @param {string} code unified currency code of the currency to repay
4834
+ * @param {float} amount the amount to repay
4835
+ * @param {object} [params] extra parameters specific to the exchange API endpoints
4836
+ * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
4837
+ */
4819
4838
  async repayCrossMargin(code, amount, params = {}) {
4820
- /**
4821
- * @method
4822
- * @name kucoin#repayCrossMargin
4823
- * @description repay borrowed margin and interest
4824
- * @see https://docs.kucoin.com/#2-repayment
4825
- * @param {string} code unified currency code of the currency to repay
4826
- * @param {float} amount the amount to repay
4827
- * @param {object} [params] extra parameters specific to the exchange API endpoints
4828
- * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
4829
- */
4830
4839
  await this.loadMarkets();
4831
4840
  const currency = this.currency(code);
4832
4841
  const request = {
@@ -4849,18 +4858,18 @@ export default class kucoin extends Exchange {
4849
4858
  const data = this.safeDict(response, 'data', {});
4850
4859
  return this.parseMarginLoan(data, currency);
4851
4860
  }
4861
+ /**
4862
+ * @method
4863
+ * @name kucoin#repayIsolatedMargin
4864
+ * @description repay borrowed margin and interest
4865
+ * @see https://docs.kucoin.com/#2-repayment
4866
+ * @param {string} symbol unified market symbol
4867
+ * @param {string} code unified currency code of the currency to repay
4868
+ * @param {float} amount the amount to repay
4869
+ * @param {object} [params] extra parameters specific to the exchange API endpoints
4870
+ * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
4871
+ */
4852
4872
  async repayIsolatedMargin(symbol, code, amount, params = {}) {
4853
- /**
4854
- * @method
4855
- * @name kucoin#repayIsolatedMargin
4856
- * @description repay borrowed margin and interest
4857
- * @see https://docs.kucoin.com/#2-repayment
4858
- * @param {string} symbol unified market symbol
4859
- * @param {string} code unified currency code of the currency to repay
4860
- * @param {float} amount the amount to repay
4861
- * @param {object} [params] extra parameters specific to the exchange API endpoints
4862
- * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
4863
- */
4864
4873
  await this.loadMarkets();
4865
4874
  const market = this.market(symbol);
4866
4875
  const currency = this.currency(code);
@@ -4905,16 +4914,16 @@ export default class kucoin extends Exchange {
4905
4914
  'info': info,
4906
4915
  };
4907
4916
  }
4917
+ /**
4918
+ * @method
4919
+ * @name kucoin#fetchDepositWithdrawFees
4920
+ * @description fetch deposit and withdraw fees - *IMPORTANT* use fetchDepositWithdrawFee to get more in-depth info
4921
+ * @see https://docs.kucoin.com/#get-currencies
4922
+ * @param {string[]|undefined} codes list of unified currency codes
4923
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
4924
+ * @returns {object} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
4925
+ */
4908
4926
  async fetchDepositWithdrawFees(codes = undefined, params = {}) {
4909
- /**
4910
- * @method
4911
- * @name kucoin#fetchDepositWithdrawFees
4912
- * @description fetch deposit and withdraw fees - *IMPORTANT* use fetchDepositWithdrawFee to get more in-depth info
4913
- * @see https://docs.kucoin.com/#get-currencies
4914
- * @param {string[]|undefined} codes list of unified currency codes
4915
- * @param {object} [params] extra parameters specific to the exchange API endpoint
4916
- * @returns {object} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
4917
- */
4918
4927
  await this.loadMarkets();
4919
4928
  const response = await this.publicGetCurrencies(params);
4920
4929
  //
@@ -4938,16 +4947,17 @@ export default class kucoin extends Exchange {
4938
4947
  const data = this.safeList(response, 'data', []);
4939
4948
  return this.parseDepositWithdrawFees(data, codes, 'currency');
4940
4949
  }
4950
+ /**
4951
+ * @method
4952
+ * @name kucoin#setLeverage
4953
+ * @description set the level of leverage for a market
4954
+ * @see https://www.kucoin.com/docs/rest/margin-trading/margin-trading-v3-/modify-leverage-multiplier
4955
+ * @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
4956
+ * @param {string} [symbol] unified market symbol
4957
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
4958
+ * @returns {object} response from the exchange
4959
+ */
4941
4960
  async setLeverage(leverage, symbol = undefined, params = {}) {
4942
- /**
4943
- * @method
4944
- * @name kucoin#setLeverage
4945
- * @description set the level of leverage for a market
4946
- * @see https://www.kucoin.com/docs/rest/margin-trading/margin-trading-v3-/modify-leverage-multiplier
4947
- * @param {string} symbol unified market symbol
4948
- * @param {object} [params] extra parameters specific to the exchange API endpoint
4949
- * @returns {object} response from the exchange
4950
- */
4951
4961
  await this.loadMarkets();
4952
4962
  let market = undefined;
4953
4963
  let marketType = undefined;