ccxt 4.4.30 → 4.4.31

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 +3 -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 +1338 -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 -247
  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 +648 -648
  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 +812 -789
  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 +176 -170
  64. package/dist/cjs/src/kraken.js +379 -377
  65. package/dist/cjs/src/krakenfutures.js +283 -279
  66. package/dist/cjs/src/kucoin.js +630 -622
  67. package/dist/cjs/src/kucoinfutures.js +439 -434
  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 +369 -367
  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 +187 -180
  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 +253 -253
  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 +101 -101
  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 +175 -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 +1305 -0
  179. package/js/src/binance.js +1338 -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 -247
  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 +648 -648
  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 +801 -1
  269. package/js/src/gate.js +812 -789
  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 +176 -170
  290. package/js/src/kraken.d.ts +379 -0
  291. package/js/src/kraken.js +379 -377
  292. package/js/src/krakenfutures.d.ts +280 -0
  293. package/js/src/krakenfutures.js +283 -279
  294. package/js/src/kucoin.d.ts +613 -0
  295. package/js/src/kucoin.js +630 -622
  296. package/js/src/kucoinfutures.d.ts +437 -0
  297. package/js/src/kucoinfutures.js +439 -434
  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 +369 -367
  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 +187 -180
  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 +253 -0
  365. package/js/src/pro/bitvavo.js +253 -253
  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 +101 -101
  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 +175 -0
  479. package/js/src/wavesexchange.js +175 -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
@@ -151,7 +151,7 @@ class gate extends gate$1 {
151
151
  'fetchSettlementHistory': true,
152
152
  'fetchTicker': true,
153
153
  'fetchTickers': true,
154
- 'fetchTime': false,
154
+ 'fetchTime': true,
155
155
  'fetchTrades': true,
156
156
  'fetchTradingFee': true,
157
157
  'fetchTradingFees': true,
@@ -896,14 +896,15 @@ class gate extends gate$1 {
896
896
  super.setSandboxMode(enable);
897
897
  this.options['sandboxMode'] = enable;
898
898
  }
899
+ /**
900
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
901
+ * @method
902
+ * @name gate#isUnifiedEnabled
903
+ * @description returns unifiedAccount so the user can check if the unified account is enabled
904
+ * @see https://www.gate.io/docs/developers/apiv4/#get-account-detail
905
+ * @returns {boolean} true or false if the enabled unified account is enabled or not and sets the unifiedAccount option if it is undefined
906
+ */
899
907
  async loadUnifiedStatus(params = {}) {
900
- /**
901
- * @method
902
- * @name gate#isUnifiedEnabled
903
- * @description returns unifiedAccount so the user can check if the unified account is enabled
904
- * @see https://www.gate.io/docs/developers/apiv4/#get-account-detail
905
- * @returns {boolean} true or false if the enabled unified account is enabled or not and sets the unifiedAccount option if it is undefined
906
- */
907
908
  const unifiedAccount = this.safeBool(this.options, 'unifiedAccount');
908
909
  if (unifiedAccount === undefined) {
909
910
  try {
@@ -933,6 +934,23 @@ class gate extends gate$1 {
933
934
  async upgradeUnifiedTradeAccount(params = {}) {
934
935
  return await this.privateUnifiedPutUnifiedMode(params);
935
936
  }
937
+ /**
938
+ * @method
939
+ * @name gate#fetchTime
940
+ * @description fetches the current integer timestamp in milliseconds from the exchange server
941
+ * @see https://www.gate.io/docs/developers/apiv4/en/#get-server-current-time
942
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
943
+ * @returns {int} the current integer timestamp in milliseconds from the exchange server
944
+ */
945
+ async fetchTime(params = {}) {
946
+ const response = await this.publicSpotGetTime(params);
947
+ //
948
+ // {
949
+ // "server_time": 1731447921098
950
+ // }
951
+ //
952
+ return this.safeInteger(response, 'server_time');
953
+ }
936
954
  createExpiredOptionMarket(symbol) {
937
955
  // support expired option contracts
938
956
  const quote = 'USDT';
@@ -1006,19 +1024,19 @@ class gate extends gate$1 {
1006
1024
  }
1007
1025
  return super.safeMarket(marketId, market, delimiter, marketType);
1008
1026
  }
1027
+ /**
1028
+ * @method
1029
+ * @name gate#fetchMarkets
1030
+ * @description retrieves data on all markets for gate
1031
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-currency-pairs-supported // spot
1032
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-supported-currency-pairs-supported-in-margin-trading // margin
1033
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-futures-contracts // swap
1034
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-futures-contracts-2 // future
1035
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-the-contracts-with-specified-underlying-and-expiration-time // option
1036
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1037
+ * @returns {object[]} an array of objects representing market data
1038
+ */
1009
1039
  async fetchMarkets(params = {}) {
1010
- /**
1011
- * @method
1012
- * @name gate#fetchMarkets
1013
- * @description retrieves data on all markets for gate
1014
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-currency-pairs-supported // spot
1015
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-supported-currency-pairs-supported-in-margin-trading // margin
1016
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-futures-contracts // swap
1017
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-futures-contracts-2 // future
1018
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-the-contracts-with-specified-underlying-and-expiration-time // option
1019
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1020
- * @returns {object[]} an array of objects representing market data
1021
- */
1022
1040
  const sandboxMode = this.safeBool(this.options, 'sandboxMode', false);
1023
1041
  let rawPromises = [
1024
1042
  this.fetchContractMarkets(params),
@@ -1613,15 +1631,15 @@ class gate extends gate$1 {
1613
1631
  const defaultSettle = (type === 'swap') ? ['usdt'] : ['btc'];
1614
1632
  return this.safeValue(fetchMarketsContractOptions, 'settlementCurrencies', defaultSettle);
1615
1633
  }
1634
+ /**
1635
+ * @method
1636
+ * @name gate#fetchCurrencies
1637
+ * @description fetches all available currencies on an exchange
1638
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-currencies-details
1639
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1640
+ * @returns {object} an associative dictionary of currencies
1641
+ */
1616
1642
  async fetchCurrencies(params = {}) {
1617
- /**
1618
- * @method
1619
- * @name gate#fetchCurrencies
1620
- * @description fetches all available currencies on an exchange
1621
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-currencies-details
1622
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1623
- * @returns {object} an associative dictionary of currencies
1624
- */
1625
1643
  // sandbox/testnet only supports future markets
1626
1644
  const apiBackup = this.safeValue(this.urls, 'apiBackup');
1627
1645
  if (apiBackup !== undefined) {
@@ -1732,16 +1750,16 @@ class gate extends gate$1 {
1732
1750
  }
1733
1751
  return result;
1734
1752
  }
1753
+ /**
1754
+ * @method
1755
+ * @name gate#fetchFundingRate
1756
+ * @description fetch the current funding rate
1757
+ * @see https://www.gate.io/docs/developers/apiv4/en/#get-a-single-contract
1758
+ * @param {string} symbol unified market symbol
1759
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1760
+ * @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
1761
+ */
1735
1762
  async fetchFundingRate(symbol, params = {}) {
1736
- /**
1737
- * @method
1738
- * @name gate#fetchFundingRate
1739
- * @description fetch the current funding rate
1740
- * @see https://www.gate.io/docs/developers/apiv4/en/#get-a-single-contract
1741
- * @param {string} symbol unified market symbol
1742
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1743
- * @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
1744
- */
1745
1763
  await this.loadMarkets();
1746
1764
  const market = this.market(symbol);
1747
1765
  if (!market['swap']) {
@@ -1795,16 +1813,16 @@ class gate extends gate$1 {
1795
1813
  //
1796
1814
  return this.parseFundingRate(response);
1797
1815
  }
1816
+ /**
1817
+ * @method
1818
+ * @name gate#fetchFundingRates
1819
+ * @description fetch the funding rate for multiple markets
1820
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-futures-contracts
1821
+ * @param {string[]|undefined} symbols list of unified market symbols
1822
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1823
+ * @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rates-structure}, indexed by market symbols
1824
+ */
1798
1825
  async fetchFundingRates(symbols = undefined, params = {}) {
1799
- /**
1800
- * @method
1801
- * @name gate#fetchFundingRates
1802
- * @description fetch the funding rate for multiple markets
1803
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-futures-contracts
1804
- * @param {string[]|undefined} symbols list of unified market symbols
1805
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1806
- * @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rates-structure}, indexed by market symbols
1807
- */
1808
1826
  await this.loadMarkets();
1809
1827
  symbols = this.marketSymbols(symbols);
1810
1828
  const [request, query] = this.prepareRequest(undefined, 'swap', params);
@@ -1978,17 +1996,17 @@ class gate extends gate$1 {
1978
1996
  }
1979
1997
  return result;
1980
1998
  }
1999
+ /**
2000
+ * @method
2001
+ * @name gate#fetchDepositAddress
2002
+ * @description fetch the deposit address for a currency associated with this account
2003
+ * @see https://www.gate.io/docs/developers/apiv4/en/#generate-currency-deposit-address
2004
+ * @param {string} code unified currency code
2005
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2006
+ * @param {string} [params.network] unified network code (not used directly by gate.io but used by ccxt to filter the response)
2007
+ * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
2008
+ */
1981
2009
  async fetchDepositAddress(code, params = {}) {
1982
- /**
1983
- * @method
1984
- * @name gate#fetchDepositAddress
1985
- * @description fetch the deposit address for a currency associated with this account
1986
- * @see https://www.gate.io/docs/developers/apiv4/en/#generate-currency-deposit-address
1987
- * @param {string} code unified currency code
1988
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1989
- * @param {string} [params.network] unified network code (not used directly by gate.io but used by ccxt to filter the response)
1990
- * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
1991
- */
1992
2010
  await this.loadMarkets();
1993
2011
  const currency = this.currency(code);
1994
2012
  const rawNetwork = this.safeStringUpper(params, 'network');
@@ -2060,16 +2078,16 @@ class gate extends gate$1 {
2060
2078
  'tag': tag,
2061
2079
  };
2062
2080
  }
2081
+ /**
2082
+ * @method
2083
+ * @name gate#fetchTradingFee
2084
+ * @description fetch the trading fees for a market
2085
+ * @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-personal-trading-fee
2086
+ * @param {string} symbol unified market symbol
2087
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2088
+ * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
2089
+ */
2063
2090
  async fetchTradingFee(symbol, params = {}) {
2064
- /**
2065
- * @method
2066
- * @name gate#fetchTradingFee
2067
- * @description fetch the trading fees for a market
2068
- * @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-personal-trading-fee
2069
- * @param {string} symbol unified market symbol
2070
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2071
- * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
2072
- */
2073
2091
  await this.loadMarkets();
2074
2092
  const market = this.market(symbol);
2075
2093
  const request = {
@@ -2092,15 +2110,15 @@ class gate extends gate$1 {
2092
2110
  //
2093
2111
  return this.parseTradingFee(response, market);
2094
2112
  }
2113
+ /**
2114
+ * @method
2115
+ * @name gate#fetchTradingFees
2116
+ * @description fetch the trading fees for multiple markets
2117
+ * @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-personal-trading-fee
2118
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2119
+ * @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
2120
+ */
2095
2121
  async fetchTradingFees(params = {}) {
2096
- /**
2097
- * @method
2098
- * @name gate#fetchTradingFees
2099
- * @description fetch the trading fees for multiple markets
2100
- * @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-personal-trading-fee
2101
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2102
- * @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
2103
- */
2104
2122
  await this.loadMarkets();
2105
2123
  const response = await this.privateWalletGetFee(params);
2106
2124
  //
@@ -2158,17 +2176,17 @@ class gate extends gate$1 {
2158
2176
  'tierBased': undefined,
2159
2177
  };
2160
2178
  }
2179
+ /**
2180
+ * @method
2181
+ * @name gate#fetchTransactionFees
2182
+ * @deprecated
2183
+ * @description please use fetchDepositWithdrawFees instead
2184
+ * @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-withdrawal-status
2185
+ * @param {string[]|undefined} codes list of unified currency codes
2186
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2187
+ * @returns {object} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
2188
+ */
2161
2189
  async fetchTransactionFees(codes = undefined, params = {}) {
2162
- /**
2163
- * @method
2164
- * @name gate#fetchTransactionFees
2165
- * @deprecated
2166
- * @description please use fetchDepositWithdrawFees instead
2167
- * @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-withdrawal-status
2168
- * @param {string[]|undefined} codes list of unified currency codes
2169
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2170
- * @returns {object} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
2171
- */
2172
2190
  await this.loadMarkets();
2173
2191
  const response = await this.privateWalletGetWithdrawStatus(params);
2174
2192
  //
@@ -2217,16 +2235,16 @@ class gate extends gate$1 {
2217
2235
  }
2218
2236
  return result;
2219
2237
  }
2238
+ /**
2239
+ * @method
2240
+ * @name gate#fetchDepositWithdrawFees
2241
+ * @description fetch deposit and withdraw fees
2242
+ * @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-withdrawal-status
2243
+ * @param {string[]|undefined} codes list of unified currency codes
2244
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2245
+ * @returns {object} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
2246
+ */
2220
2247
  async fetchDepositWithdrawFees(codes = undefined, params = {}) {
2221
- /**
2222
- * @method
2223
- * @name gate#fetchDepositWithdrawFees
2224
- * @description fetch deposit and withdraw fees
2225
- * @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-withdrawal-status
2226
- * @param {string[]|undefined} codes list of unified currency codes
2227
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2228
- * @returns {object} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
2229
- */
2230
2248
  await this.loadMarkets();
2231
2249
  const response = await this.privateWalletGetWithdrawStatus(params);
2232
2250
  //
@@ -2299,19 +2317,19 @@ class gate extends gate$1 {
2299
2317
  }
2300
2318
  return result;
2301
2319
  }
2320
+ /**
2321
+ * @method
2322
+ * @name gate#fetchFundingHistory
2323
+ * @description fetch the history of funding payments paid and received on this account
2324
+ * @see https://www.gate.io/docs/developers/apiv4/en/#query-account-book-2
2325
+ * @see https://www.gate.io/docs/developers/apiv4/en/#query-account-book-3
2326
+ * @param {string} symbol unified market symbol
2327
+ * @param {int} [since] the earliest time in ms to fetch funding history for
2328
+ * @param {int} [limit] the maximum number of funding history structures to retrieve
2329
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2330
+ * @returns {object} a [funding history structure]{@link https://docs.ccxt.com/#/?id=funding-history-structure}
2331
+ */
2302
2332
  async fetchFundingHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
2303
- /**
2304
- * @method
2305
- * @name gate#fetchFundingHistory
2306
- * @description fetch the history of funding payments paid and received on this account
2307
- * @see https://www.gate.io/docs/developers/apiv4/en/#query-account-book-2
2308
- * @see https://www.gate.io/docs/developers/apiv4/en/#query-account-book-3
2309
- * @param {string} symbol unified market symbol
2310
- * @param {int} [since] the earliest time in ms to fetch funding history for
2311
- * @param {int} [limit] the maximum number of funding history structures to retrieve
2312
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2313
- * @returns {object} a [funding history structure]{@link https://docs.ccxt.com/#/?id=funding-history-structure}
2314
- */
2315
2333
  await this.loadMarkets();
2316
2334
  // let defaultType = 'future';
2317
2335
  let market = undefined;
@@ -2386,20 +2404,20 @@ class gate extends gate$1 {
2386
2404
  'amount': this.safeNumber(info, 'change'),
2387
2405
  };
2388
2406
  }
2407
+ /**
2408
+ * @method
2409
+ * @name gate#fetchOrderBook
2410
+ * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
2411
+ * @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-order-book
2412
+ * @see https://www.gate.io/docs/developers/apiv4/en/#futures-order-book
2413
+ * @see https://www.gate.io/docs/developers/apiv4/en/#futures-order-book-2
2414
+ * @see https://www.gate.io/docs/developers/apiv4/en/#options-order-book
2415
+ * @param {string} symbol unified symbol of the market to fetch the order book for
2416
+ * @param {int} [limit] the maximum amount of order book entries to return
2417
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2418
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
2419
+ */
2389
2420
  async fetchOrderBook(symbol, limit = undefined, params = {}) {
2390
- /**
2391
- * @method
2392
- * @name gate#fetchOrderBook
2393
- * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
2394
- * @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-order-book
2395
- * @see https://www.gate.io/docs/developers/apiv4/en/#futures-order-book
2396
- * @see https://www.gate.io/docs/developers/apiv4/en/#futures-order-book-2
2397
- * @see https://www.gate.io/docs/developers/apiv4/en/#options-order-book
2398
- * @param {string} symbol unified symbol of the market to fetch the order book for
2399
- * @param {int} [limit] the maximum amount of order book entries to return
2400
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2401
- * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
2402
- */
2403
2421
  await this.loadMarkets();
2404
2422
  const market = this.market(symbol);
2405
2423
  //
@@ -2506,19 +2524,19 @@ class gate extends gate$1 {
2506
2524
  result['nonce'] = nonce;
2507
2525
  return result;
2508
2526
  }
2527
+ /**
2528
+ * @method
2529
+ * @name gate#fetchTicker
2530
+ * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
2531
+ * @see https://www.gate.io/docs/developers/apiv4/en/#get-details-of-a-specifc-order
2532
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-futures-tickers
2533
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-futures-tickers-2
2534
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-tickers-of-options-contracts
2535
+ * @param {string} symbol unified symbol of the market to fetch the ticker for
2536
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2537
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
2538
+ */
2509
2539
  async fetchTicker(symbol, params = {}) {
2510
- /**
2511
- * @method
2512
- * @name gate#fetchTicker
2513
- * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
2514
- * @see https://www.gate.io/docs/developers/apiv4/en/#get-details-of-a-specifc-order
2515
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-futures-tickers
2516
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-futures-tickers-2
2517
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-tickers-of-options-contracts
2518
- * @param {string} symbol unified symbol of the market to fetch the ticker for
2519
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2520
- * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
2521
- */
2522
2540
  await this.loadMarkets();
2523
2541
  const market = this.market(symbol);
2524
2542
  const [request, query] = this.prepareRequest(market, undefined, params);
@@ -2670,19 +2688,19 @@ class gate extends gate$1 {
2670
2688
  'info': ticker,
2671
2689
  }, market);
2672
2690
  }
2691
+ /**
2692
+ * @method
2693
+ * @name gate#fetchTickers
2694
+ * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
2695
+ * @see https://www.gate.io/docs/developers/apiv4/en/#get-details-of-a-specifc-order
2696
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-futures-tickers
2697
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-futures-tickers-2
2698
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-tickers-of-options-contracts
2699
+ * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
2700
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2701
+ * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
2702
+ */
2673
2703
  async fetchTickers(symbols = undefined, params = {}) {
2674
- /**
2675
- * @method
2676
- * @name gate#fetchTickers
2677
- * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
2678
- * @see https://www.gate.io/docs/developers/apiv4/en/#get-details-of-a-specifc-order
2679
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-futures-tickers
2680
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-futures-tickers-2
2681
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-tickers-of-options-contracts
2682
- * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
2683
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2684
- * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
2685
- */
2686
2704
  await this.loadMarkets();
2687
2705
  symbols = this.marketSymbols(symbols);
2688
2706
  const first = this.safeString(symbols, 0);
@@ -2725,15 +2743,18 @@ class gate extends gate$1 {
2725
2743
  }
2726
2744
  return account;
2727
2745
  }
2746
+ /**
2747
+ * @method
2748
+ * @name gate#fetchBalance
2749
+ * @param {object} [params] exchange specific parameters
2750
+ * @param {string} [params.type] spot, margin, swap or future, if not provided this.options['defaultType'] is used
2751
+ * @param {string} [params.settle] 'btc' or 'usdt' - settle currency for perpetual swap and future - default="usdt" for swap and "btc" for future
2752
+ * @param {string} [params.marginMode] 'cross' or 'isolated' - marginMode for margin trading if not provided this.options['defaultMarginMode'] is used
2753
+ * @param {string} [params.symbol] margin only - unified ccxt symbol
2754
+ * @param {boolean} [params.unifiedAccount] default false, set to true for fetching the unified account balance
2755
+ * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
2756
+ */
2728
2757
  async fetchBalance(params = {}) {
2729
- /**
2730
- * @param {object} [params] exchange specific parameters
2731
- * @param {string} [params.type] spot, margin, swap or future, if not provided this.options['defaultType'] is used
2732
- * @param {string} [params.settle] 'btc' or 'usdt' - settle currency for perpetual swap and future - default="usdt" for swap and "btc" for future
2733
- * @param {string} [params.marginMode] 'cross' or 'isolated' - marginMode for margin trading if not provided this.options['defaultMarginMode'] is used
2734
- * @param {string} [params.symbol] margin only - unified ccxt symbol
2735
- * @param {boolean} [params.unifiedAccount] default false, set to true for fetching the unified account balance
2736
- */
2737
2758
  await this.loadMarkets();
2738
2759
  await this.loadUnifiedStatus();
2739
2760
  const symbol = this.safeString(params, 'symbol');
@@ -3017,25 +3038,25 @@ class gate extends gate$1 {
3017
3038
  const returnResult = isolated ? result : this.safeBalance(result);
3018
3039
  return returnResult;
3019
3040
  }
3041
+ /**
3042
+ * @method
3043
+ * @name gateio#fetchOHLCV
3044
+ * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
3045
+ * @see https://www.gate.io/docs/developers/apiv4/en/#market-candlesticks // spot
3046
+ * @see https://www.gate.io/docs/developers/apiv4/en/#get-futures-candlesticks // swap
3047
+ * @see https://www.gate.io/docs/developers/apiv4/en/#market-candlesticks // future
3048
+ * @see https://www.gate.io/docs/developers/apiv4/en/#get-options-candlesticks // option
3049
+ * @param {string} symbol unified symbol of the market to fetch OHLCV data for
3050
+ * @param {string} timeframe the length of time each candle represents
3051
+ * @param {int} [since] timestamp in ms of the earliest candle to fetch
3052
+ * @param {int} [limit] the maximum amount of candles to fetch, limit is conflicted with since and params["until"], If either since and params["until"] is specified, request will be rejected
3053
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3054
+ * @param {string} [params.price] "mark" or "index" for mark price and index price candles
3055
+ * @param {int} [params.until] timestamp in ms of the latest candle to fetch
3056
+ * @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)
3057
+ * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume (units in quote currency)
3058
+ */
3020
3059
  async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
3021
- /**
3022
- * @method
3023
- * @name gateio#fetchOHLCV
3024
- * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
3025
- * @see https://www.gate.io/docs/developers/apiv4/en/#market-candlesticks // spot
3026
- * @see https://www.gate.io/docs/developers/apiv4/en/#get-futures-candlesticks // swap
3027
- * @see https://www.gate.io/docs/developers/apiv4/en/#market-candlesticks // future
3028
- * @see https://www.gate.io/docs/developers/apiv4/en/#get-options-candlesticks // option
3029
- * @param {string} symbol unified symbol of the market to fetch OHLCV data for
3030
- * @param {string} timeframe the length of time each candle represents
3031
- * @param {int} [since] timestamp in ms of the earliest candle to fetch
3032
- * @param {int} [limit] the maximum amount of candles to fetch, limit is conflicted with since and params["until"], If either since and params["until"] is specified, request will be rejected
3033
- * @param {object} [params] extra parameters specific to the exchange API endpoint
3034
- * @param {string} [params.price] "mark" or "index" for mark price and index price candles
3035
- * @param {int} [params.until] timestamp in ms of the latest candle to fetch
3036
- * @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)
3037
- * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume (units in quote currency)
3038
- */
3039
3060
  await this.loadMarkets();
3040
3061
  const market = this.market(symbol);
3041
3062
  let paginate = false;
@@ -3108,18 +3129,18 @@ class gate extends gate$1 {
3108
3129
  const response = await this.publicOptionsGetCandlesticks(this.extend(request, params));
3109
3130
  return this.parseOHLCVs(response, market, timeframe, since, limit);
3110
3131
  }
3132
+ /**
3133
+ * @method
3134
+ * @name gate#fetchFundingRateHistory
3135
+ * @description fetches historical funding rate prices
3136
+ * @see https://www.gate.io/docs/developers/apiv4/en/#funding-rate-history
3137
+ * @param {string} symbol unified symbol of the market to fetch the funding rate history for
3138
+ * @param {int} [since] timestamp in ms of the earliest funding rate to fetch
3139
+ * @param {int} [limit] the maximum amount of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure} to fetch
3140
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3141
+ * @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
3142
+ */
3111
3143
  async fetchFundingRateHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
3112
- /**
3113
- * @method
3114
- * @name gate#fetchFundingRateHistory
3115
- * @description fetches historical funding rate prices
3116
- * @see https://www.gate.io/docs/developers/apiv4/en/#funding-rate-history
3117
- * @param {string} symbol unified symbol of the market to fetch the funding rate history for
3118
- * @param {int} [since] timestamp in ms of the earliest funding rate to fetch
3119
- * @param {int} [limit] the maximum amount of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure} to fetch
3120
- * @param {object} [params] extra parameters specific to the exchange API endpoint
3121
- * @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
3122
- */
3123
3144
  if (symbol === undefined) {
3124
3145
  throw new errors.ArgumentsRequired(this.id + ' fetchFundingRateHistory() requires a symbol argument');
3125
3146
  }
@@ -3201,23 +3222,23 @@ class gate extends gate$1 {
3201
3222
  ];
3202
3223
  }
3203
3224
  }
3225
+ /**
3226
+ * @method
3227
+ * @name gate#fetchTrades
3228
+ * @description get the list of most recent trades for a particular symbol
3229
+ * @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-market-trades
3230
+ * @see https://www.gate.io/docs/developers/apiv4/en/#futures-trading-history
3231
+ * @see https://www.gate.io/docs/developers/apiv4/en/#futures-trading-history-2
3232
+ * @see https://www.gate.io/docs/developers/apiv4/en/#options-trade-history
3233
+ * @param {string} symbol unified symbol of the market to fetch trades for
3234
+ * @param {int} [since] timestamp in ms of the earliest trade to fetch
3235
+ * @param {int} [limit] the maximum amount of trades to fetch
3236
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3237
+ * @param {int} [params.until] timestamp in ms of the latest trade to fetch
3238
+ * @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)
3239
+ * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
3240
+ */
3204
3241
  async fetchTrades(symbol, since = undefined, limit = undefined, params = {}) {
3205
- /**
3206
- * @method
3207
- * @name gate#fetchTrades
3208
- * @description get the list of most recent trades for a particular symbol
3209
- * @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-market-trades
3210
- * @see https://www.gate.io/docs/developers/apiv4/en/#futures-trading-history
3211
- * @see https://www.gate.io/docs/developers/apiv4/en/#futures-trading-history-2
3212
- * @see https://www.gate.io/docs/developers/apiv4/en/#options-trade-history
3213
- * @param {string} symbol unified symbol of the market to fetch trades for
3214
- * @param {int} [since] timestamp in ms of the earliest trade to fetch
3215
- * @param {int} [limit] the maximum amount of trades to fetch
3216
- * @param {object} [params] extra parameters specific to the exchange API endpoint
3217
- * @param {int} [params.until] timestamp in ms of the latest trade to fetch
3218
- * @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)
3219
- * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
3220
- */
3221
3242
  await this.loadMarkets();
3222
3243
  let paginate = false;
3223
3244
  [paginate, params] = this.handleOptionAndParams(params, 'fetchTrades', 'paginate');
@@ -3316,22 +3337,22 @@ class gate extends gate$1 {
3316
3337
  //
3317
3338
  return this.parseTrades(response, market, since, limit);
3318
3339
  }
3340
+ /**
3341
+ * @method
3342
+ * @name gate#fetchOrderTrades
3343
+ * @description fetch all the trades made from a single order
3344
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history
3345
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-2
3346
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-3
3347
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-4
3348
+ * @param {string} id order id
3349
+ * @param {string} symbol unified market symbol
3350
+ * @param {int} [since] the earliest time in ms to fetch trades for
3351
+ * @param {int} [limit] the maximum number of trades to retrieve
3352
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3353
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
3354
+ */
3319
3355
  async fetchOrderTrades(id, symbol = undefined, since = undefined, limit = undefined, params = {}) {
3320
- /**
3321
- * @method
3322
- * @name gate#fetchOrderTrades
3323
- * @description fetch all the trades made from a single order
3324
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history
3325
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-2
3326
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-3
3327
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-4
3328
- * @param {string} id order id
3329
- * @param {string} symbol unified market symbol
3330
- * @param {int} [since] the earliest time in ms to fetch trades for
3331
- * @param {int} [limit] the maximum number of trades to retrieve
3332
- * @param {object} [params] extra parameters specific to the exchange API endpoint
3333
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
3334
- */
3335
3356
  if (symbol === undefined) {
3336
3357
  throw new errors.ArgumentsRequired(this.id + ' fetchOrderTrades() requires a symbol argument');
3337
3358
  }
@@ -3358,32 +3379,32 @@ class gate extends gate$1 {
3358
3379
  const response = await this.fetchMyTrades(symbol, since, limit, { 'order_id': id });
3359
3380
  return response;
3360
3381
  }
3382
+ /**
3383
+ * @method
3384
+ * @name gate#fetchMyTrades
3385
+ * @description Fetch personal trading history
3386
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history
3387
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-2
3388
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-3
3389
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-4
3390
+ * @param {string} symbol unified market symbol
3391
+ * @param {int} [since] the earliest time in ms to fetch trades for
3392
+ * @param {int} [limit] the maximum number of trades structures to retrieve
3393
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3394
+ * @param {string} [params.marginMode] 'cross' or 'isolated' - marginMode for margin trading if not provided this.options['defaultMarginMode'] is used
3395
+ * @param {string} [params.type] 'spot', 'swap', or 'future', if not provided this.options['defaultMarginMode'] is used
3396
+ * @param {int} [params.until] The latest timestamp, in ms, that fetched trades were made
3397
+ * @param {int} [params.page] *spot only* Page number
3398
+ * @param {string} [params.order_id] *spot only* Filter trades with specified order ID. symbol is also required if this field is present
3399
+ * @param {string} [params.order] *contract only* Futures order ID, return related data only if specified
3400
+ * @param {int} [params.offset] *contract only* list offset, starting from 0
3401
+ * @param {string} [params.last_id] *contract only* specify list staring point using the id of last record in previous list-query results
3402
+ * @param {int} [params.count_total] *contract only* whether to return total number matched, default to 0(no return)
3403
+ * @param {bool} [params.unifiedAccount] set to true for fetching trades in a unified account
3404
+ * @param {bool} [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)
3405
+ * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
3406
+ */
3361
3407
  async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
3362
- /**
3363
- * @method
3364
- * @name gate#fetchMyTrades
3365
- * @description Fetch personal trading history
3366
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history
3367
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-2
3368
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-3
3369
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-4
3370
- * @param {string} symbol unified market symbol
3371
- * @param {int} [since] the earliest time in ms to fetch trades for
3372
- * @param {int} [limit] the maximum number of trades structures to retrieve
3373
- * @param {object} [params] extra parameters specific to the exchange API endpoint
3374
- * @param {string} [params.marginMode] 'cross' or 'isolated' - marginMode for margin trading if not provided this.options['defaultMarginMode'] is used
3375
- * @param {string} [params.type] 'spot', 'swap', or 'future', if not provided this.options['defaultMarginMode'] is used
3376
- * @param {int} [params.until] The latest timestamp, in ms, that fetched trades were made
3377
- * @param {int} [params.page] *spot only* Page number
3378
- * @param {string} [params.order_id] *spot only* Filter trades with specified order ID. symbol is also required if this field is present
3379
- * @param {string} [params.order] *contract only* Futures order ID, return related data only if specified
3380
- * @param {int} [params.offset] *contract only* list offset, starting from 0
3381
- * @param {string} [params.last_id] *contract only* specify list staring point using the id of last record in previous list-query results
3382
- * @param {int} [params.count_total] *contract only* whether to return total number matched, default to 0(no return)
3383
- * @param {bool} [params.unifiedAccount] set to true for fetching trades in a unified account
3384
- * @param {bool} [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)
3385
- * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
3386
- */
3387
3408
  await this.loadMarkets();
3388
3409
  await this.loadUnifiedStatus();
3389
3410
  let paginate = false;
@@ -3649,20 +3670,20 @@ class gate extends gate$1 {
3649
3670
  'fees': fees,
3650
3671
  }, market);
3651
3672
  }
3673
+ /**
3674
+ * @method
3675
+ * @name gate#fetchDeposits
3676
+ * @description fetch all deposits made to an account
3677
+ * @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-deposit-records
3678
+ * @param {string} code unified currency code
3679
+ * @param {int} [since] the earliest time in ms to fetch deposits for
3680
+ * @param {int} [limit] the maximum number of deposits structures to retrieve
3681
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3682
+ * @param {int} [params.until] end time in ms
3683
+ * @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)
3684
+ * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
3685
+ */
3652
3686
  async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
3653
- /**
3654
- * @method
3655
- * @name gate#fetchDeposits
3656
- * @description fetch all deposits made to an account
3657
- * @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-deposit-records
3658
- * @param {string} code unified currency code
3659
- * @param {int} [since] the earliest time in ms to fetch deposits for
3660
- * @param {int} [limit] the maximum number of deposits structures to retrieve
3661
- * @param {int} [params.until] end time in ms
3662
- * @param {object} [params] extra parameters specific to the exchange API endpoint
3663
- * @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)
3664
- * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
3665
- */
3666
3687
  await this.loadMarkets();
3667
3688
  let paginate = false;
3668
3689
  [paginate, params] = this.handleOptionAndParams(params, 'fetchDeposits', 'paginate');
@@ -3687,20 +3708,20 @@ class gate extends gate$1 {
3687
3708
  const response = await this.privateWalletGetDeposits(this.extend(request, params));
3688
3709
  return this.parseTransactions(response, currency);
3689
3710
  }
3711
+ /**
3712
+ * @method
3713
+ * @name gate#fetchWithdrawals
3714
+ * @description fetch all withdrawals made from an account
3715
+ * @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-withdrawal-records
3716
+ * @param {string} code unified currency code
3717
+ * @param {int} [since] the earliest time in ms to fetch withdrawals for
3718
+ * @param {int} [limit] the maximum number of withdrawals structures to retrieve
3719
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3720
+ * @param {int} [params.until] end time in ms
3721
+ * @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)
3722
+ * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
3723
+ */
3690
3724
  async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
3691
- /**
3692
- * @method
3693
- * @name gate#fetchWithdrawals
3694
- * @description fetch all withdrawals made from an account
3695
- * @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-withdrawal-records
3696
- * @param {string} code unified currency code
3697
- * @param {int} [since] the earliest time in ms to fetch withdrawals for
3698
- * @param {int} [limit] the maximum number of withdrawals structures to retrieve
3699
- * @param {object} [params] extra parameters specific to the exchange API endpoint
3700
- * @param {int} [params.until] end time in ms
3701
- * @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)
3702
- * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
3703
- */
3704
3725
  await this.loadMarkets();
3705
3726
  let paginate = false;
3706
3727
  [paginate, params] = this.handleOptionAndParams(params, 'fetchWithdrawals', 'paginate');
@@ -3725,19 +3746,19 @@ class gate extends gate$1 {
3725
3746
  const response = await this.privateWalletGetWithdrawals(this.extend(request, params));
3726
3747
  return this.parseTransactions(response, currency);
3727
3748
  }
3749
+ /**
3750
+ * @method
3751
+ * @name gate#withdraw
3752
+ * @description make a withdrawal
3753
+ * @see https://www.gate.io/docs/developers/apiv4/en/#withdraw
3754
+ * @param {string} code unified currency code
3755
+ * @param {float} amount the amount to withdraw
3756
+ * @param {string} address the address to withdraw to
3757
+ * @param {string} tag
3758
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3759
+ * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
3760
+ */
3728
3761
  async withdraw(code, amount, address, tag = undefined, params = {}) {
3729
- /**
3730
- * @method
3731
- * @name gate#withdraw
3732
- * @description make a withdrawal
3733
- * @see https://www.gate.io/docs/developers/apiv4/en/#withdraw
3734
- * @param {string} code unified currency code
3735
- * @param {float} amount the amount to withdraw
3736
- * @param {string} address the address to withdraw to
3737
- * @param {string} tag
3738
- * @param {object} [params] extra parameters specific to the exchange API endpoint
3739
- * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
3740
- */
3741
3762
  [tag, params] = this.handleWithdrawTagAndParams(tag, params);
3742
3763
  this.checkAddress(address);
3743
3764
  await this.loadMarkets();
@@ -3910,42 +3931,42 @@ class gate extends gate$1 {
3910
3931
  },
3911
3932
  };
3912
3933
  }
3934
+ /**
3935
+ * @method
3936
+ * @name gate#createOrder
3937
+ * @description Create an order on the exchange
3938
+ * @see https://www.gate.io/docs/developers/apiv4/en/#create-an-order
3939
+ * @see https://www.gate.io/docs/developers/apiv4/en/#create-a-price-triggered-order
3940
+ * @see https://www.gate.io/docs/developers/apiv4/en/#create-a-futures-order
3941
+ * @see https://www.gate.io/docs/developers/apiv4/en/#create-a-price-triggered-order-2
3942
+ * @see https://www.gate.io/docs/developers/apiv4/en/#create-a-futures-order-2
3943
+ * @see https://www.gate.io/docs/developers/apiv4/en/#create-a-price-triggered-order-3
3944
+ * @see https://www.gate.io/docs/developers/apiv4/en/#create-an-options-order
3945
+ * @param {string} symbol Unified CCXT market symbol
3946
+ * @param {string} type 'limit' or 'market' *"market" is contract only*
3947
+ * @param {string} side 'buy' or 'sell'
3948
+ * @param {float} amount the amount of currency to trade
3949
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
3950
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3951
+ * @param {float} [params.stopPrice] The price at which a trigger order is triggered at
3952
+ * @param {string} [params.timeInForce] "GTC", "IOC", or "PO"
3953
+ * @param {float} [params.stopLossPrice] The price at which a stop loss order is triggered at
3954
+ * @param {float} [params.takeProfitPrice] The price at which a take profit order is triggered at
3955
+ * @param {string} [params.marginMode] 'cross' or 'isolated' - marginMode for margin trading if not provided this.options['defaultMarginMode'] is used
3956
+ * @param {int} [params.iceberg] Amount to display for the iceberg order, Null or 0 for normal orders, Set to -1 to hide the order completely
3957
+ * @param {string} [params.text] User defined information
3958
+ * @param {string} [params.account] *spot and margin only* "spot", "margin" or "cross_margin"
3959
+ * @param {bool} [params.auto_borrow] *margin only* Used in margin or cross margin trading to allow automatic loan of insufficient amount if balance is not enough
3960
+ * @param {string} [params.settle] *contract only* Unified Currency Code for settle currency
3961
+ * @param {bool} [params.reduceOnly] *contract only* Indicates if this order is to reduce the size of a position
3962
+ * @param {bool} [params.close] *contract only* Set as true to close the position, with size set to 0
3963
+ * @param {bool} [params.auto_size] *contract only* Set side to close dual-mode position, close_long closes the long side, while close_short the short one, size also needs to be set to 0
3964
+ * @param {int} [params.price_type] *contract only* 0 latest deal price, 1 mark price, 2 index price
3965
+ * @param {float} [params.cost] *spot market buy only* the quote quantity that can be used as an alternative for the amount
3966
+ * @param {bool} [params.unifiedAccount] set to true for creating an order in the unified account
3967
+ * @returns {object|undefined} [An order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
3968
+ */
3913
3969
  async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
3914
- /**
3915
- * @method
3916
- * @name gate#createOrder
3917
- * @description Create an order on the exchange
3918
- * @see https://www.gate.io/docs/developers/apiv4/en/#create-an-order
3919
- * @see https://www.gate.io/docs/developers/apiv4/en/#create-a-price-triggered-order
3920
- * @see https://www.gate.io/docs/developers/apiv4/en/#create-a-futures-order
3921
- * @see https://www.gate.io/docs/developers/apiv4/en/#create-a-price-triggered-order-2
3922
- * @see https://www.gate.io/docs/developers/apiv4/en/#create-a-futures-order-2
3923
- * @see https://www.gate.io/docs/developers/apiv4/en/#create-a-price-triggered-order-3
3924
- * @see https://www.gate.io/docs/developers/apiv4/en/#create-an-options-order
3925
- * @param {string} symbol Unified CCXT market symbol
3926
- * @param {string} type 'limit' or 'market' *"market" is contract only*
3927
- * @param {string} side 'buy' or 'sell'
3928
- * @param {float} amount the amount of currency to trade
3929
- * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
3930
- * @param {object} [params] extra parameters specific to the exchange API endpoint
3931
- * @param {float} [params.stopPrice] The price at which a trigger order is triggered at
3932
- * @param {string} [params.timeInForce] "GTC", "IOC", or "PO"
3933
- * @param {float} [params.stopLossPrice] The price at which a stop loss order is triggered at
3934
- * @param {float} [params.takeProfitPrice] The price at which a take profit order is triggered at
3935
- * @param {string} [params.marginMode] 'cross' or 'isolated' - marginMode for margin trading if not provided this.options['defaultMarginMode'] is used
3936
- * @param {int} [params.iceberg] Amount to display for the iceberg order, Null or 0 for normal orders, Set to -1 to hide the order completely
3937
- * @param {string} [params.text] User defined information
3938
- * @param {string} [params.account] *spot and margin only* "spot", "margin" or "cross_margin"
3939
- * @param {bool} [params.auto_borrow] *margin only* Used in margin or cross margin trading to allow automatic loan of insufficient amount if balance is not enough
3940
- * @param {string} [params.settle] *contract only* Unified Currency Code for settle currency
3941
- * @param {bool} [params.reduceOnly] *contract only* Indicates if this order is to reduce the size of a position
3942
- * @param {bool} [params.close] *contract only* Set as true to close the position, with size set to 0
3943
- * @param {bool} [params.auto_size] *contract only* Set side to close dual-mode position, close_long closes the long side, while close_short the short one, size also needs to be set to 0
3944
- * @param {int} [params.price_type] *contract only* 0 latest deal price, 1 mark price, 2 index price
3945
- * @param {float} [params.cost] *spot market buy only* the quote quantity that can be used as an alternative for the amount
3946
- * @param {bool} [params.unifiedAccount] set to true for creating an order in the unified account
3947
- * @returns {object|undefined} [An order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
3948
- */
3949
3970
  await this.loadMarkets();
3950
3971
  await this.loadUnifiedStatus();
3951
3972
  const market = this.market(symbol);
@@ -4087,17 +4108,18 @@ class gate extends gate$1 {
4087
4108
  }
4088
4109
  return ordersRequests;
4089
4110
  }
4111
+ /**
4112
+ * @method
4113
+ * @name gate#createOrders
4114
+ * @description create a list of trade orders
4115
+ * @see https://www.gate.io/docs/developers/apiv4/en/#get-a-single-order-2
4116
+ * @see https://www.gate.io/docs/developers/apiv4/en/#create-a-batch-of-orders
4117
+ * @see https://www.gate.io/docs/developers/apiv4/en/#create-a-batch-of-futures-orders
4118
+ * @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
4119
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
4120
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
4121
+ */
4090
4122
  async createOrders(orders, params = {}) {
4091
- /**
4092
- * @method
4093
- * @name gate#createOrders
4094
- * @description create a list of trade orders
4095
- * @see https://www.gate.io/docs/developers/apiv4/en/#get-a-single-order-2
4096
- * @see https://www.gate.io/docs/developers/apiv4/en/#create-a-batch-of-orders
4097
- * @see https://www.gate.io/docs/developers/apiv4/en/#create-a-batch-of-futures-orders
4098
- * @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
4099
- * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
4100
- */
4101
4123
  await this.loadMarkets();
4102
4124
  await this.loadUnifiedStatus();
4103
4125
  const ordersRequests = this.createOrdersRequest(orders, params);
@@ -4372,18 +4394,18 @@ class gate extends gate$1 {
4372
4394
  }
4373
4395
  return this.extend(request, params);
4374
4396
  }
4397
+ /**
4398
+ * @method
4399
+ * @name gate#createMarketBuyOrderWithCost
4400
+ * @description create a market buy order by providing the symbol and cost
4401
+ * @see https://www.gate.io/docs/developers/apiv4/en/#create-an-order
4402
+ * @param {string} symbol unified symbol of the market to create an order in
4403
+ * @param {float} cost how much you want to trade in units of the quote currency
4404
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
4405
+ * @param {bool} [params.unifiedAccount] set to true for creating a unified account order
4406
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
4407
+ */
4375
4408
  async createMarketBuyOrderWithCost(symbol, cost, params = {}) {
4376
- /**
4377
- * @method
4378
- * @name gate#createMarketBuyOrderWithCost
4379
- * @description create a market buy order by providing the symbol and cost
4380
- * @see https://www.gate.io/docs/developers/apiv4/en/#create-an-order
4381
- * @param {string} symbol unified symbol of the market to create an order in
4382
- * @param {float} cost how much you want to trade in units of the quote currency
4383
- * @param {object} [params] extra parameters specific to the exchange API endpoint
4384
- * @param {bool} [params.unifiedAccount] set to true for creating a unified account order
4385
- * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
4386
- */
4387
4409
  await this.loadMarkets();
4388
4410
  await this.loadUnifiedStatus();
4389
4411
  const market = this.market(symbol);
@@ -4436,23 +4458,23 @@ class gate extends gate$1 {
4436
4458
  }
4437
4459
  return this.extend(request, params);
4438
4460
  }
4461
+ /**
4462
+ * @method
4463
+ * @name gate#editOrder
4464
+ * @description edit a trade order, gate currently only supports the modification of the price or amount fields
4465
+ * @see https://www.gate.io/docs/developers/apiv4/en/#amend-an-order
4466
+ * @see https://www.gate.io/docs/developers/apiv4/en/#amend-an-order-2
4467
+ * @param {string} id order id
4468
+ * @param {string} symbol unified symbol of the market to create an order in
4469
+ * @param {string} type 'market' or 'limit'
4470
+ * @param {string} side 'buy' or 'sell'
4471
+ * @param {float} amount how much of the currency you want to trade in units of the base currency
4472
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
4473
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
4474
+ * @param {bool} [params.unifiedAccount] set to true for editing an order in a unified account
4475
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
4476
+ */
4439
4477
  async editOrder(id, symbol, type, side, amount = undefined, price = undefined, params = {}) {
4440
- /**
4441
- * @method
4442
- * @name gate#editOrder
4443
- * @description edit a trade order, gate currently only supports the modification of the price or amount fields
4444
- * @see https://www.gate.io/docs/developers/apiv4/en/#amend-an-order
4445
- * @see https://www.gate.io/docs/developers/apiv4/en/#amend-an-order-2
4446
- * @param {string} id order id
4447
- * @param {string} symbol unified symbol of the market to create an order in
4448
- * @param {string} type 'market' or 'limit'
4449
- * @param {string} side 'buy' or 'sell'
4450
- * @param {float} amount how much of the currency you want to trade in units of the base currency
4451
- * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
4452
- * @param {object} [params] extra parameters specific to the exchange API endpoint
4453
- * @param {bool} [params.unifiedAccount] set to true for editing an order in a unified account
4454
- * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
4455
- */
4456
4478
  await this.loadMarkets();
4457
4479
  await this.loadUnifiedStatus();
4458
4480
  const market = this.market(symbol);
@@ -4798,25 +4820,25 @@ class gate extends gate$1 {
4798
4820
  request['order_id'] = orderId.toString();
4799
4821
  return [request, requestParams];
4800
4822
  }
4823
+ /**
4824
+ * @method
4825
+ * @name gate#fetchOrder
4826
+ * @description Retrieves information on an order
4827
+ * @see https://www.gate.io/docs/developers/apiv4/en/#get-a-single-order
4828
+ * @see https://www.gate.io/docs/developers/apiv4/en/#get-a-single-order-2
4829
+ * @see https://www.gate.io/docs/developers/apiv4/en/#get-a-single-order-3
4830
+ * @see https://www.gate.io/docs/developers/apiv4/en/#get-a-single-order-4
4831
+ * @param {string} id Order id
4832
+ * @param {string} symbol Unified market symbol, *required for spot and margin*
4833
+ * @param {object} [params] Parameters specified by the exchange api
4834
+ * @param {bool} [params.trigger] True if the order being fetched is a trigger order
4835
+ * @param {string} [params.marginMode] 'cross' or 'isolated' - marginMode for margin trading if not provided this.options['defaultMarginMode'] is used
4836
+ * @param {string} [params.type] 'spot', 'swap', or 'future', if not provided this.options['defaultMarginMode'] is used
4837
+ * @param {string} [params.settle] 'btc' or 'usdt' - settle currency for perpetual swap and future - market settle currency is used if symbol !== undefined, default="usdt" for swap and "btc" for future
4838
+ * @param {bool} [params.unifiedAccount] set to true for fetching a unified account order
4839
+ * @returns An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
4840
+ */
4801
4841
  async fetchOrder(id, symbol = undefined, params = {}) {
4802
- /**
4803
- * @method
4804
- * @name gate#fetchOrder
4805
- * @description Retrieves information on an order
4806
- * @see https://www.gate.io/docs/developers/apiv4/en/#get-a-single-order
4807
- * @see https://www.gate.io/docs/developers/apiv4/en/#get-a-single-order-2
4808
- * @see https://www.gate.io/docs/developers/apiv4/en/#get-a-single-order-3
4809
- * @see https://www.gate.io/docs/developers/apiv4/en/#get-a-single-order-4
4810
- * @param {string} id Order id
4811
- * @param {string} symbol Unified market symbol, *required for spot and margin*
4812
- * @param {object} [params] Parameters specified by the exchange api
4813
- * @param {bool} [params.trigger] True if the order being fetched is a trigger order
4814
- * @param {string} [params.marginMode] 'cross' or 'isolated' - marginMode for margin trading if not provided this.options['defaultMarginMode'] is used
4815
- * @param {string} [params.type] 'spot', 'swap', or 'future', if not provided this.options['defaultMarginMode'] is used
4816
- * @param {string} [params.settle] 'btc' or 'usdt' - settle currency for perpetual swap and future - market settle currency is used if symbol !== undefined, default="usdt" for swap and "btc" for future
4817
- * @param {bool} [params.unifiedAccount] set to true for fetching a unified account order
4818
- * @returns An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
4819
- */
4820
4842
  await this.loadMarkets();
4821
4843
  await this.loadUnifiedStatus();
4822
4844
  const market = (symbol === undefined) ? undefined : this.market(symbol);
@@ -4857,49 +4879,49 @@ class gate extends gate$1 {
4857
4879
  }
4858
4880
  return this.parseOrder(response, market);
4859
4881
  }
4882
+ /**
4883
+ * @method
4884
+ * @name gate#fetchOpenOrders
4885
+ * @description fetch all unfilled currently open orders
4886
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-open-orders
4887
+ * @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-running-auto-order-list
4888
+ * @param {string} symbol unified market symbol
4889
+ * @param {int} [since] the earliest time in ms to fetch open orders for
4890
+ * @param {int} [limit] the maximum number of open orders structures to retrieve
4891
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
4892
+ * @param {bool} [params.stop] true for fetching stop orders
4893
+ * @param {string} [params.type] spot, margin, swap or future, if not provided this.options['defaultType'] is used
4894
+ * @param {string} [params.marginMode] 'cross' or 'isolated' - marginMode for type='margin', if not provided this.options['defaultMarginMode'] is used
4895
+ * @param {bool} [params.unifiedAccount] set to true for fetching unified account orders
4896
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
4897
+ */
4860
4898
  async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
4861
- /**
4862
- * @method
4863
- * @name gate#fetchOpenOrders
4864
- * @description fetch all unfilled currently open orders
4865
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-open-orders
4866
- * @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-running-auto-order-list
4867
- * @param {string} symbol unified market symbol
4868
- * @param {int} [since] the earliest time in ms to fetch open orders for
4869
- * @param {int} [limit] the maximum number of open orders structures to retrieve
4870
- * @param {object} [params] extra parameters specific to the exchange API endpoint
4871
- * @param {bool} [params.stop] true for fetching stop orders
4872
- * @param {string} [params.type] spot, margin, swap or future, if not provided this.options['defaultType'] is used
4873
- * @param {string} [params.marginMode] 'cross' or 'isolated' - marginMode for type='margin', if not provided this.options['defaultMarginMode'] is used
4874
- * @param {bool} [params.unifiedAccount] set to true for fetching unified account orders
4875
- * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
4876
- */
4877
4899
  return await this.fetchOrdersByStatus('open', symbol, since, limit, params);
4878
4900
  }
4901
+ /**
4902
+ * @method
4903
+ * @name gate#fetchClosedOrders
4904
+ * @description fetches information on multiple closed orders made by the user
4905
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-orders
4906
+ * @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-running-auto-order-list
4907
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-futures-orders
4908
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-auto-orders
4909
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-futures-orders-2
4910
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-auto-orders-2
4911
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-options-orders
4912
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-futures-orders-by-time-range
4913
+ * @param {string} symbol unified market symbol of the market orders were made in
4914
+ * @param {int} [since] the earliest time in ms to fetch orders for
4915
+ * @param {int} [limit] the maximum number of order structures to retrieve
4916
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
4917
+ * @param {bool} [params.stop] true for fetching stop orders
4918
+ * @param {string} [params.type] spot, swap or future, if not provided this.options['defaultType'] is used
4919
+ * @param {string} [params.marginMode] 'cross' or 'isolated' - marginMode for margin trading if not provided this.options['defaultMarginMode'] is used
4920
+ * @param {boolean} [params.historical] *swap only* true for using historical endpoint
4921
+ * @param {bool} [params.unifiedAccount] set to true for fetching unified account orders
4922
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
4923
+ */
4879
4924
  async fetchClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
4880
- /**
4881
- * @method
4882
- * @name gate#fetchClosedOrders
4883
- * @description fetches information on multiple closed orders made by the user
4884
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-orders
4885
- * @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-running-auto-order-list
4886
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-futures-orders
4887
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-auto-orders
4888
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-futures-orders-2
4889
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-auto-orders-2
4890
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-options-orders
4891
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-futures-orders-by-time-range
4892
- * @param {string} symbol unified market symbol of the market orders were made in
4893
- * @param {int} [since] the earliest time in ms to fetch orders for
4894
- * @param {int} [limit] the maximum number of order structures to retrieve
4895
- * @param {object} [params] extra parameters specific to the exchange API endpoint
4896
- * @param {bool} [params.stop] true for fetching stop orders
4897
- * @param {string} [params.type] spot, swap or future, if not provided this.options['defaultType'] is used
4898
- * @param {string} [params.marginMode] 'cross' or 'isolated' - marginMode for margin trading if not provided this.options['defaultMarginMode'] is used
4899
- * @param {boolean} [params.historical] *swap only* true for using historical endpoint
4900
- * @param {bool} [params.unifiedAccount] set to true for fetching unified account orders
4901
- * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
4902
- */
4903
4925
  await this.loadMarkets();
4904
4926
  await this.loadUnifiedStatus();
4905
4927
  const until = this.safeInteger(params, 'until');
@@ -5179,22 +5201,22 @@ class gate extends gate$1 {
5179
5201
  const orders = this.parseOrders(result, market, since, limit);
5180
5202
  return this.filterBySymbolSinceLimit(orders, symbol, since, limit);
5181
5203
  }
5204
+ /**
5205
+ * @method
5206
+ * @name gate#cancelOrder
5207
+ * @description Cancels an open order
5208
+ * @see https://www.gate.io/docs/developers/apiv4/en/#cancel-a-single-order
5209
+ * @see https://www.gate.io/docs/developers/apiv4/en/#cancel-a-single-order-2
5210
+ * @see https://www.gate.io/docs/developers/apiv4/en/#cancel-a-single-order-3
5211
+ * @see https://www.gate.io/docs/developers/apiv4/en/#cancel-a-single-order-4
5212
+ * @param {string} id Order id
5213
+ * @param {string} symbol Unified market symbol
5214
+ * @param {object} [params] Parameters specified by the exchange api
5215
+ * @param {bool} [params.stop] True if the order to be cancelled is a trigger order
5216
+ * @param {bool} [params.unifiedAccount] set to true for canceling unified account orders
5217
+ * @returns An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
5218
+ */
5182
5219
  async cancelOrder(id, symbol = undefined, params = {}) {
5183
- /**
5184
- * @method
5185
- * @name gate#cancelOrder
5186
- * @description Cancels an open order
5187
- * @see https://www.gate.io/docs/developers/apiv4/en/#cancel-a-single-order
5188
- * @see https://www.gate.io/docs/developers/apiv4/en/#cancel-a-single-order-2
5189
- * @see https://www.gate.io/docs/developers/apiv4/en/#cancel-a-single-order-3
5190
- * @see https://www.gate.io/docs/developers/apiv4/en/#cancel-a-single-order-4
5191
- * @param {string} id Order id
5192
- * @param {string} symbol Unified market symbol
5193
- * @param {object} [params] Parameters specified by the exchange api
5194
- * @param {bool} [params.stop] True if the order to be cancelled is a trigger order
5195
- * @param {bool} [params.unifiedAccount] set to true for canceling unified account orders
5196
- * @returns An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
5197
- */
5198
5220
  await this.loadMarkets();
5199
5221
  await this.loadUnifiedStatus();
5200
5222
  const market = (symbol === undefined) ? undefined : this.market(symbol);
@@ -5317,19 +5339,19 @@ class gate extends gate$1 {
5317
5339
  //
5318
5340
  return this.parseOrder(response, market);
5319
5341
  }
5342
+ /**
5343
+ * @method
5344
+ * @name gate#cancelOrders
5345
+ * @description cancel multiple orders
5346
+ * @see https://www.gate.io/docs/developers/apiv4/en/#cancel-a-batch-of-orders-with-an-id-list
5347
+ * @see https://www.gate.io/docs/developers/apiv4/en/#cancel-a-batch-of-orders-with-an-id-list-2
5348
+ * @param {string[]} ids order ids
5349
+ * @param {string} symbol unified symbol of the market the order was made in
5350
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
5351
+ * @param {bool} [params.unifiedAccount] set to true for canceling unified account orders
5352
+ * @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
5353
+ */
5320
5354
  async cancelOrders(ids, symbol = undefined, params = {}) {
5321
- /**
5322
- * @method
5323
- * @name gate#cancelOrders
5324
- * @description cancel multiple orders
5325
- * @see https://www.gate.io/docs/developers/apiv4/en/#cancel-a-batch-of-orders-with-an-id-list
5326
- * @see https://www.gate.io/docs/developers/apiv4/en/#cancel-a-batch-of-orders-with-an-id-list-2
5327
- * @param {string[]} ids order ids
5328
- * @param {string} symbol unified symbol of the market the order was made in
5329
- * @param {object} [params] extra parameters specific to the exchange API endpoint
5330
- * @param {bool} [params.unifiedAccount] set to true for canceling unified account orders
5331
- * @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
5332
- */
5333
5355
  await this.loadMarkets();
5334
5356
  await this.loadUnifiedStatus();
5335
5357
  let market = undefined;
@@ -5366,18 +5388,18 @@ class gate extends gate$1 {
5366
5388
  const response = await this.privateFuturesPostSettleBatchCancelOrders(finalList);
5367
5389
  return this.parseOrders(response);
5368
5390
  }
5391
+ /**
5392
+ * @method
5393
+ * @name gate#cancelOrdersForSymbols
5394
+ * @description cancel multiple orders for multiple symbols
5395
+ * @see https://www.gate.io/docs/developers/apiv4/en/#cancel-a-batch-of-orders-with-an-id-list
5396
+ * @param {CancellationRequest[]} orders list of order ids with symbol, example [{"id": "a", "symbol": "BTC/USDT"}, {"id": "b", "symbol": "ETH/USDT"}]
5397
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
5398
+ * @param {string[]} [params.clientOrderIds] client order ids
5399
+ * @param {bool} [params.unifiedAccount] set to true for canceling unified account orders
5400
+ * @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
5401
+ */
5369
5402
  async cancelOrdersForSymbols(orders, params = {}) {
5370
- /**
5371
- * @method
5372
- * @name gate#cancelOrdersForSymbols
5373
- * @description cancel multiple orders for multiple symbols
5374
- * @see https://www.gate.io/docs/developers/apiv4/en/#cancel-a-batch-of-orders-with-an-id-list
5375
- * @param {CancellationRequest[]} orders list of order ids with symbol, example [{"id": "a", "symbol": "BTC/USDT"}, {"id": "b", "symbol": "ETH/USDT"}]
5376
- * @param {object} [params] extra parameters specific to the exchange API endpoint
5377
- * @param {string[]} [params.clientOrderIds] client order ids
5378
- * @param {bool} [params.unifiedAccount] set to true for canceling unified account orders
5379
- * @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
5380
- */
5381
5403
  await this.loadMarkets();
5382
5404
  await this.loadUnifiedStatus();
5383
5405
  const ordersRequests = [];
@@ -5406,20 +5428,20 @@ class gate extends gate$1 {
5406
5428
  //
5407
5429
  return this.parseOrders(response);
5408
5430
  }
5431
+ /**
5432
+ * @method
5433
+ * @name gate#cancelAllOrders
5434
+ * @description cancel all open orders
5435
+ * @see https://www.gate.io/docs/developers/apiv4/en/#cancel-all-open-orders-in-specified-currency-pair
5436
+ * @see https://www.gate.io/docs/developers/apiv4/en/#cancel-all-open-orders-matched
5437
+ * @see https://www.gate.io/docs/developers/apiv4/en/#cancel-all-open-orders-matched-2
5438
+ * @see https://www.gate.io/docs/developers/apiv4/en/#cancel-all-open-orders-matched-3
5439
+ * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
5440
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
5441
+ * @param {bool} [params.unifiedAccount] set to true for canceling unified account orders
5442
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
5443
+ */
5409
5444
  async cancelAllOrders(symbol = undefined, params = {}) {
5410
- /**
5411
- * @method
5412
- * @name gate#cancelAllOrders
5413
- * @description cancel all open orders
5414
- * @see https://www.gate.io/docs/developers/apiv4/en/#cancel-all-open-orders-in-specified-currency-pair
5415
- * @see https://www.gate.io/docs/developers/apiv4/en/#cancel-all-open-orders-matched
5416
- * @see https://www.gate.io/docs/developers/apiv4/en/#cancel-all-open-orders-matched-2
5417
- * @see https://www.gate.io/docs/developers/apiv4/en/#cancel-all-open-orders-matched-3
5418
- * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
5419
- * @param {object} [params] extra parameters specific to the exchange API endpoint
5420
- * @param {bool} [params.unifiedAccount] set to true for canceling unified account orders
5421
- * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
5422
- */
5423
5445
  await this.loadMarkets();
5424
5446
  await this.loadUnifiedStatus();
5425
5447
  const market = (symbol === undefined) ? undefined : this.market(symbol);
@@ -5488,20 +5510,20 @@ class gate extends gate$1 {
5488
5510
  //
5489
5511
  return this.parseOrders(response, market);
5490
5512
  }
5513
+ /**
5514
+ * @method
5515
+ * @name gate#transfer
5516
+ * @description transfer currency internally between wallets on the same account
5517
+ * @see https://www.gate.io/docs/developers/apiv4/en/#transfer-between-trading-accounts
5518
+ * @param {string} code unified currency code for currency being transferred
5519
+ * @param {float} amount the amount of currency to transfer
5520
+ * @param {string} fromAccount the account to transfer currency from
5521
+ * @param {string} toAccount the account to transfer currency to
5522
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
5523
+ * @param {string} [params.symbol] Unified market symbol *required for type == margin*
5524
+ * @returns A [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
5525
+ */
5491
5526
  async transfer(code, amount, fromAccount, toAccount, params = {}) {
5492
- /**
5493
- * @method
5494
- * @name gate#transfer
5495
- * @description transfer currency internally between wallets on the same account
5496
- * @see https://www.gate.io/docs/developers/apiv4/en/#transfer-between-trading-accounts
5497
- * @param {string} code unified currency code for currency being transferred
5498
- * @param {float} amount the amount of currency to transfer
5499
- * @param {string} fromAccount the account to transfer currency from
5500
- * @param {string} toAccount the account to transfer currency to
5501
- * @param {object} [params] extra parameters specific to the exchange API endpoint
5502
- * @param {string} [params.symbol] Unified market symbol *required for type == margin*
5503
- * @returns A [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
5504
- */
5505
5527
  await this.loadMarkets();
5506
5528
  const currency = this.currency(code);
5507
5529
  const fromId = this.convertTypeToAccount(fromAccount);
@@ -5573,18 +5595,18 @@ class gate extends gate$1 {
5573
5595
  'info': transfer,
5574
5596
  };
5575
5597
  }
5598
+ /**
5599
+ * @method
5600
+ * @name gate#setLeverage
5601
+ * @description set the level of leverage for a market
5602
+ * @see https://www.gate.io/docs/developers/apiv4/en/#update-position-leverage
5603
+ * @see https://www.gate.io/docs/developers/apiv4/en/#update-position-leverage-2
5604
+ * @param {float} leverage the rate of leverage
5605
+ * @param {string} symbol unified market symbol
5606
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
5607
+ * @returns {object} response from the exchange
5608
+ */
5576
5609
  async setLeverage(leverage, symbol = undefined, params = {}) {
5577
- /**
5578
- * @method
5579
- * @name gate#setLeverage
5580
- * @description set the level of leverage for a market
5581
- * @see https://www.gate.io/docs/developers/apiv4/en/#update-position-leverage
5582
- * @see https://www.gate.io/docs/developers/apiv4/en/#update-position-leverage-2
5583
- * @param {float} leverage the rate of leverage
5584
- * @param {string} symbol unified market symbol
5585
- * @param {object} [params] extra parameters specific to the exchange API endpoint
5586
- * @returns {object} response from the exchange
5587
- */
5588
5610
  if (symbol === undefined) {
5589
5611
  throw new errors.ArgumentsRequired(this.id + ' setLeverage() requires a symbol argument');
5590
5612
  }
@@ -5793,18 +5815,18 @@ class gate extends gate$1 {
5793
5815
  'takeProfitPrice': undefined,
5794
5816
  });
5795
5817
  }
5818
+ /**
5819
+ * @method
5820
+ * @name gate#fetchPosition
5821
+ * @description fetch data on an open contract position
5822
+ * @see https://www.gate.io/docs/developers/apiv4/en/#get-single-position
5823
+ * @see https://www.gate.io/docs/developers/apiv4/en/#get-single-position-2
5824
+ * @see https://www.gate.io/docs/developers/apiv4/en/#get-specified-contract-position
5825
+ * @param {string} symbol unified market symbol of the market the position is held in
5826
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
5827
+ * @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
5828
+ */
5796
5829
  async fetchPosition(symbol, params = {}) {
5797
- /**
5798
- * @method
5799
- * @name gate#fetchPosition
5800
- * @description fetch data on an open contract position
5801
- * @see https://www.gate.io/docs/developers/apiv4/en/#get-single-position
5802
- * @see https://www.gate.io/docs/developers/apiv4/en/#get-single-position-2
5803
- * @see https://www.gate.io/docs/developers/apiv4/en/#get-specified-contract-position
5804
- * @param {string} symbol unified market symbol of the market the position is held in
5805
- * @param {object} [params] extra parameters specific to the exchange API endpoint
5806
- * @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
5807
- */
5808
5830
  await this.loadMarkets();
5809
5831
  const market = this.market(symbol);
5810
5832
  if (!market['contract']) {
@@ -5881,20 +5903,20 @@ class gate extends gate$1 {
5881
5903
  //
5882
5904
  return this.parsePosition(response, market);
5883
5905
  }
5906
+ /**
5907
+ * @method
5908
+ * @name gate#fetchPositions
5909
+ * @description fetch all open positions
5910
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-positions-of-a-user
5911
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-positions-of-a-user-2
5912
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-user-s-positions-of-specified-underlying
5913
+ * @param {string[]|undefined} symbols Not used by gate, but parsed internally by CCXT
5914
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
5915
+ * @param {string} [params.settle] 'btc' or 'usdt' - settle currency for perpetual swap and future - default="usdt" for swap and "btc" for future
5916
+ * @param {string} [params.type] swap, future or option, if not provided this.options['defaultType'] is used
5917
+ * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
5918
+ */
5884
5919
  async fetchPositions(symbols = undefined, params = {}) {
5885
- /**
5886
- * @method
5887
- * @name gate#fetchPositions
5888
- * @description fetch all open positions
5889
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-positions-of-a-user
5890
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-positions-of-a-user-2
5891
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-user-s-positions-of-specified-underlying
5892
- * @param {string[]|undefined} symbols Not used by gate, but parsed internally by CCXT
5893
- * @param {object} [params] extra parameters specific to the exchange API endpoint
5894
- * @param {string} [params.settle] 'btc' or 'usdt' - settle currency for perpetual swap and future - default="usdt" for swap and "btc" for future
5895
- * @param {string} [params.type] swap, future or option, if not provided this.options['defaultType'] is used
5896
- * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
5897
- */
5898
5920
  await this.loadMarkets();
5899
5921
  let market = undefined;
5900
5922
  symbols = this.marketSymbols(symbols, undefined, true, true, true);
@@ -5992,17 +6014,17 @@ class gate extends gate$1 {
5992
6014
  //
5993
6015
  return this.parsePositions(response, symbols);
5994
6016
  }
6017
+ /**
6018
+ * @method
6019
+ * @name gate#fetchLeverageTiers
6020
+ * @description retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
6021
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-futures-contracts
6022
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-futures-contracts-2
6023
+ * @param {string[]} [symbols] list of unified market symbols
6024
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
6025
+ * @returns {object} a dictionary of [leverage tiers structures]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}, indexed by market symbols
6026
+ */
5995
6027
  async fetchLeverageTiers(symbols = undefined, params = {}) {
5996
- /**
5997
- * @method
5998
- * @name gate#fetchLeverageTiers
5999
- * @description retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
6000
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-futures-contracts
6001
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-futures-contracts-2
6002
- * @param {string[]} [symbols] list of unified market symbols
6003
- * @param {object} [params] extra parameters specific to the exchange API endpoint
6004
- * @returns {object} a dictionary of [leverage tiers structures]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}, indexed by market symbols
6005
- */
6006
6028
  await this.loadMarkets();
6007
6029
  const [type, query] = this.handleMarketTypeAndParams('fetchLeverageTiers', undefined, params);
6008
6030
  const [request, requestParams] = this.prepareRequest(undefined, type, query);
@@ -6113,16 +6135,16 @@ class gate extends gate$1 {
6113
6135
  //
6114
6136
  return this.parseLeverageTiers(response, symbols, 'name');
6115
6137
  }
6138
+ /**
6139
+ * @method
6140
+ * @name gate#fetchMarketLeverageTiers
6141
+ * @description retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes for a single market
6142
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-risk-limit-tiers
6143
+ * @param {string} symbol unified market symbol
6144
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
6145
+ * @returns {object} a [leverage tiers structure]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}
6146
+ */
6116
6147
  async fetchMarketLeverageTiers(symbol, params = {}) {
6117
- /**
6118
- * @method
6119
- * @name gate#fetchMarketLeverageTiers
6120
- * @description retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes for a single market
6121
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-risk-limit-tiers
6122
- * @param {string} symbol unified market symbol
6123
- * @param {object} [params] extra parameters specific to the exchange API endpoint
6124
- * @returns {object} a [leverage tiers structure]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}
6125
- */
6126
6148
  await this.loadMarkets();
6127
6149
  const market = this.market(symbol);
6128
6150
  const [type, query] = this.handleMarketTypeAndParams('fetchMarketLeverageTiers', market, params);
@@ -6145,6 +6167,7 @@ class gate extends gate$1 {
6145
6167
  return this.parseMarketLeverageTiers(response, market);
6146
6168
  }
6147
6169
  parseEmulatedLeverageTiers(info, market = undefined) {
6170
+ const marketId = this.safeString(info, 'name');
6148
6171
  const maintenanceMarginUnit = this.safeString(info, 'maintenance_rate'); // '0.005',
6149
6172
  const leverageMax = this.safeString(info, 'leverage_max'); // '100',
6150
6173
  const riskLimitStep = this.safeString(info, 'risk_limit_step'); // '1000000',
@@ -6158,6 +6181,7 @@ class gate extends gate$1 {
6158
6181
  const cap = Precise["default"].stringAdd(floor, riskLimitStep);
6159
6182
  tiers.push({
6160
6183
  'tier': this.parseNumber(Precise["default"].stringDiv(cap, riskLimitStep)),
6184
+ 'symbol': this.safeSymbol(marketId, market, undefined, 'contract'),
6161
6185
  'currency': this.safeString(market, 'settle'),
6162
6186
  'minNotional': this.parseNumber(floor),
6163
6187
  'maxNotional': this.parseNumber(cap),
@@ -6193,6 +6217,7 @@ class gate extends gate$1 {
6193
6217
  const maxNotional = this.safeNumber(item, 'risk_limit');
6194
6218
  tiers.push({
6195
6219
  'tier': this.sum(i, 1),
6220
+ 'symbol': market['symbol'],
6196
6221
  'currency': market['base'],
6197
6222
  'minNotional': minNotional,
6198
6223
  'maxNotional': maxNotional,
@@ -6204,20 +6229,20 @@ class gate extends gate$1 {
6204
6229
  }
6205
6230
  return tiers;
6206
6231
  }
6232
+ /**
6233
+ * @method
6234
+ * @name gate#repayMargin
6235
+ * @description repay borrowed margin and interest
6236
+ * @see https://www.gate.io/docs/apiv4/en/#repay-a-loan
6237
+ * @param {string} symbol unified market symbol
6238
+ * @param {string} code unified currency code of the currency to repay
6239
+ * @param {float} amount the amount to repay
6240
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
6241
+ * @param {string} [params.mode] 'all' or 'partial' payment mode, extra parameter required for isolated margin
6242
+ * @param {string} [params.id] '34267567' loan id, extra parameter required for isolated margin
6243
+ * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
6244
+ */
6207
6245
  async repayIsolatedMargin(symbol, code, amount, params = {}) {
6208
- /**
6209
- * @method
6210
- * @name gate#repayMargin
6211
- * @description repay borrowed margin and interest
6212
- * @see https://www.gate.io/docs/apiv4/en/#repay-a-loan
6213
- * @param {string} symbol unified market symbol
6214
- * @param {string} code unified currency code of the currency to repay
6215
- * @param {float} amount the amount to repay
6216
- * @param {object} [params] extra parameters specific to the exchange API endpoint
6217
- * @param {string} [params.mode] 'all' or 'partial' payment mode, extra parameter required for isolated margin
6218
- * @param {string} [params.id] '34267567' loan id, extra parameter required for isolated margin
6219
- * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
6220
- */
6221
6246
  await this.loadMarkets();
6222
6247
  const currency = this.currency(code);
6223
6248
  const request = {
@@ -6233,22 +6258,21 @@ class gate extends gate$1 {
6233
6258
  //
6234
6259
  return this.parseMarginLoan(response, currency);
6235
6260
  }
6261
+ /**
6262
+ * @method
6263
+ * @name gate#repayCrossMargin
6264
+ * @description repay cross margin borrowed margin and interest
6265
+ * @see https://www.gate.io/docs/developers/apiv4/en/#cross-margin-repayments
6266
+ * @see https://www.gate.io/docs/developers/apiv4/en/#borrow-or-repay
6267
+ * @param {string} code unified currency code of the currency to repay
6268
+ * @param {float} amount the amount to repay
6269
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
6270
+ * @param {string} [params.mode] 'all' or 'partial' payment mode, extra parameter required for isolated margin
6271
+ * @param {string} [params.id] '34267567' loan id, extra parameter required for isolated margin
6272
+ * @param {boolean} [params.unifiedAccount] set to true for repaying in the unified account
6273
+ * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
6274
+ */
6236
6275
  async repayCrossMargin(code, amount, params = {}) {
6237
- /**
6238
- * @method
6239
- * @name gate#repayCrossMargin
6240
- * @description repay cross margin borrowed margin and interest
6241
- * @see https://www.gate.io/docs/developers/apiv4/en/#cross-margin-repayments
6242
- * @see https://www.gate.io/docs/developers/apiv4/en/#borrow-or-repay
6243
- * @param {string} code unified currency code of the currency to repay
6244
- * @param {float} amount the amount to repay
6245
- * @param {string} symbol unified market symbol, required for isolated margin
6246
- * @param {object} [params] extra parameters specific to the exchange API endpoint
6247
- * @param {string} [params.mode] 'all' or 'partial' payment mode, extra parameter required for isolated margin
6248
- * @param {string} [params.id] '34267567' loan id, extra parameter required for isolated margin
6249
- * @param {boolean} [params.unifiedAccount] set to true for repaying in the unified account
6250
- * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
6251
- */
6252
6276
  await this.loadMarkets();
6253
6277
  await this.loadUnifiedStatus();
6254
6278
  const currency = this.currency(code);
@@ -6285,19 +6309,19 @@ class gate extends gate$1 {
6285
6309
  }
6286
6310
  return this.parseMarginLoan(response, currency);
6287
6311
  }
6312
+ /**
6313
+ * @method
6314
+ * @name gate#borrowMargin
6315
+ * @description create a loan to borrow margin
6316
+ * @see https://www.gate.io/docs/developers/apiv4/en/#marginuni
6317
+ * @param {string} symbol unified market symbol, required for isolated margin
6318
+ * @param {string} code unified currency code of the currency to borrow
6319
+ * @param {float} amount the amount to borrow
6320
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
6321
+ * @param {string} [params.rate] '0.0002' or '0.002' extra parameter required for isolated margin
6322
+ * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
6323
+ */
6288
6324
  async borrowIsolatedMargin(symbol, code, amount, params = {}) {
6289
- /**
6290
- * @method
6291
- * @name gate#borrowMargin
6292
- * @description create a loan to borrow margin
6293
- * @see https://www.gate.io/docs/developers/apiv4/en/#marginuni
6294
- * @param {string} code unified currency code of the currency to borrow
6295
- * @param {float} amount the amount to borrow
6296
- * @param {string} symbol unified market symbol, required for isolated margin
6297
- * @param {object} [params] extra parameters specific to the exchange API endpoint
6298
- * @param {string} [params.rate] '0.0002' or '0.002' extra parameter required for isolated margin
6299
- * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
6300
- */
6301
6325
  await this.loadMarkets();
6302
6326
  const currency = this.currency(code);
6303
6327
  const request = {
@@ -6330,21 +6354,20 @@ class gate extends gate$1 {
6330
6354
  //
6331
6355
  return this.parseMarginLoan(response, currency);
6332
6356
  }
6357
+ /**
6358
+ * @method
6359
+ * @name gate#borrowMargin
6360
+ * @description create a loan to borrow margin
6361
+ * @see https://www.gate.io/docs/apiv4/en/#create-a-cross-margin-borrow-loan
6362
+ * @see https://www.gate.io/docs/developers/apiv4/en/#borrow-or-repay
6363
+ * @param {string} code unified currency code of the currency to borrow
6364
+ * @param {float} amount the amount to borrow
6365
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
6366
+ * @param {string} [params.rate] '0.0002' or '0.002' extra parameter required for isolated margin
6367
+ * @param {boolean} [params.unifiedAccount] set to true for borrowing in the unified account
6368
+ * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
6369
+ */
6333
6370
  async borrowCrossMargin(code, amount, params = {}) {
6334
- /**
6335
- * @method
6336
- * @name gate#borrowMargin
6337
- * @description create a loan to borrow margin
6338
- * @see https://www.gate.io/docs/apiv4/en/#create-a-cross-margin-borrow-loan
6339
- * @see https://www.gate.io/docs/developers/apiv4/en/#borrow-or-repay
6340
- * @param {string} code unified currency code of the currency to borrow
6341
- * @param {float} amount the amount to borrow
6342
- * @param {string} symbol unified market symbol, required for isolated margin
6343
- * @param {object} [params] extra parameters specific to the exchange API endpoint
6344
- * @param {string} [params.rate] '0.0002' or '0.002' extra parameter required for isolated margin
6345
- * @param {boolean} [params.unifiedAccount] set to true for borrowing in the unified account
6346
- * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
6347
- */
6348
6371
  await this.loadMarkets();
6349
6372
  await this.loadUnifiedStatus();
6350
6373
  const currency = this.currency(code);
@@ -6432,22 +6455,22 @@ class gate extends gate$1 {
6432
6455
  'info': info,
6433
6456
  };
6434
6457
  }
6458
+ /**
6459
+ * @method
6460
+ * @name gate#fetchBorrowInterest
6461
+ * @description fetch the interest owed by the user for borrowing currency for margin trading
6462
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-interest-records
6463
+ * @see https://www.gate.io/docs/developers/apiv4/en/#interest-records-for-the-cross-margin-account
6464
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-interest-records-2
6465
+ * @param {string} [code] unified currency code
6466
+ * @param {string} [symbol] unified market symbol when fetching interest in isolated markets
6467
+ * @param {int} [since] the earliest time in ms to fetch borrow interest for
6468
+ * @param {int} [limit] the maximum number of structures to retrieve
6469
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
6470
+ * @param {boolean} [params.unifiedAccount] set to true for fetching borrow interest in the unified account
6471
+ * @returns {object[]} a list of [borrow interest structures]{@link https://docs.ccxt.com/#/?id=borrow-interest-structure}
6472
+ */
6435
6473
  async fetchBorrowInterest(code = undefined, symbol = undefined, since = undefined, limit = undefined, params = {}) {
6436
- /**
6437
- * @method
6438
- * @name gate#fetchBorrowInterest
6439
- * @description fetch the interest owed by the user for borrowing currency for margin trading
6440
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-interest-records
6441
- * @see https://www.gate.io/docs/developers/apiv4/en/#interest-records-for-the-cross-margin-account
6442
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-interest-records-2
6443
- * @param {string} [code] unified currency code
6444
- * @param {string} [symbol] unified market symbol when fetching interest in isolated markets
6445
- * @param {int} [since] the earliest time in ms to fetch borrow interest for
6446
- * @param {int} [limit] the maximum number of structures to retrieve
6447
- * @param {object} [params] extra parameters specific to the exchange API endpoint
6448
- * @param {boolean} [params.unifiedAccount] set to true for fetching borrow interest in the unified account
6449
- * @returns {object[]} a list of [borrow interest structures]{@link https://docs.ccxt.com/#/?id=borrow-interest-structure}
6450
- */
6451
6474
  await this.loadMarkets();
6452
6475
  await this.loadUnifiedStatus();
6453
6476
  let isUnifiedAccount = false;
@@ -6654,48 +6677,48 @@ class gate extends gate$1 {
6654
6677
  'datetime': undefined,
6655
6678
  };
6656
6679
  }
6680
+ /**
6681
+ * @method
6682
+ * @name gate#reduceMargin
6683
+ * @description remove margin from a position
6684
+ * @see https://www.gate.io/docs/developers/apiv4/en/#update-position-margin
6685
+ * @see https://www.gate.io/docs/developers/apiv4/en/#update-position-margin-2
6686
+ * @param {string} symbol unified market symbol
6687
+ * @param {float} amount the amount of margin to remove
6688
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
6689
+ * @returns {object} a [margin structure]{@link https://docs.ccxt.com/#/?id=reduce-margin-structure}
6690
+ */
6657
6691
  async reduceMargin(symbol, amount, params = {}) {
6658
- /**
6659
- * @method
6660
- * @name gate#reduceMargin
6661
- * @description remove margin from a position
6662
- * @see https://www.gate.io/docs/developers/apiv4/en/#update-position-margin
6663
- * @see https://www.gate.io/docs/developers/apiv4/en/#update-position-margin-2
6664
- * @param {string} symbol unified market symbol
6665
- * @param {float} amount the amount of margin to remove
6666
- * @param {object} [params] extra parameters specific to the exchange API endpoint
6667
- * @returns {object} a [margin structure]{@link https://docs.ccxt.com/#/?id=reduce-margin-structure}
6668
- */
6669
6692
  return await this.modifyMarginHelper(symbol, -amount, params);
6670
6693
  }
6694
+ /**
6695
+ * @method
6696
+ * @name gate#addMargin
6697
+ * @description add margin
6698
+ * @see https://www.gate.io/docs/developers/apiv4/en/#update-position-margin
6699
+ * @see https://www.gate.io/docs/developers/apiv4/en/#update-position-margin-2
6700
+ * @param {string} symbol unified market symbol
6701
+ * @param {float} amount amount of margin to add
6702
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
6703
+ * @returns {object} a [margin structure]{@link https://docs.ccxt.com/#/?id=add-margin-structure}
6704
+ */
6671
6705
  async addMargin(symbol, amount, params = {}) {
6672
- /**
6673
- * @method
6674
- * @name gate#addMargin
6675
- * @description add margin
6676
- * @see https://www.gate.io/docs/developers/apiv4/en/#update-position-margin
6677
- * @see https://www.gate.io/docs/developers/apiv4/en/#update-position-margin-2
6678
- * @param {string} symbol unified market symbol
6679
- * @param {float} amount amount of margin to add
6680
- * @param {object} [params] extra parameters specific to the exchange API endpoint
6681
- * @returns {object} a [margin structure]{@link https://docs.ccxt.com/#/?id=add-margin-structure}
6682
- */
6683
6706
  return await this.modifyMarginHelper(symbol, amount, params);
6684
6707
  }
6708
+ /**
6709
+ * @method
6710
+ * @name gate#fetchOpenInterest
6711
+ * @description Retrieves the open interest of a currency
6712
+ * @see https://www.gate.io/docs/developers/apiv4/en/#futures-stats
6713
+ * @param {string} symbol Unified CCXT market symbol
6714
+ * @param {string} timeframe "5m", "15m", "30m", "1h", "4h", "1d"
6715
+ * @param {int} [since] the time(ms) of the earliest record to retrieve as a unix timestamp
6716
+ * @param {int} [limit] default 30
6717
+ * @param {object} [params] exchange specific parameters
6718
+ * @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)
6719
+ * @returns {object} an open interest structure{@link https://docs.ccxt.com/#/?id=open-interest-structure}
6720
+ */
6685
6721
  async fetchOpenInterestHistory(symbol, timeframe = '5m', since = undefined, limit = undefined, params = {}) {
6686
- /**
6687
- * @method
6688
- * @name gate#fetchOpenInterest
6689
- * @description Retrieves the open interest of a currency
6690
- * @see https://www.gate.io/docs/developers/apiv4/en/#futures-stats
6691
- * @param {string} symbol Unified CCXT market symbol
6692
- * @param {string} timeframe "5m", "15m", "30m", "1h", "4h", "1d"
6693
- * @param {int} [since] the time(ms) of the earliest record to retrieve as a unix timestamp
6694
- * @param {int} [limit] default 30
6695
- * @param {object} [params] exchange specific parameters
6696
- * @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)
6697
- * @returns {object} an open interest structure{@link https://docs.ccxt.com/#/?id=open-interest-structure}
6698
- */
6699
6722
  await this.loadMarkets();
6700
6723
  let paginate = false;
6701
6724
  [paginate, params] = this.handleOptionAndParams(params, 'fetchOpenInterestHistory', 'paginate', false);
@@ -6770,18 +6793,18 @@ class gate extends gate$1 {
6770
6793
  'info': interest,
6771
6794
  };
6772
6795
  }
6796
+ /**
6797
+ * @method
6798
+ * @name gate#fetchSettlementHistory
6799
+ * @description fetches historical settlement records
6800
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-settlement-history-2
6801
+ * @param {string} symbol unified market symbol of the settlement history, required on gate
6802
+ * @param {int} [since] timestamp in ms
6803
+ * @param {int} [limit] number of records
6804
+ * @param {object} [params] exchange specific params
6805
+ * @returns {object[]} a list of [settlement history objects]{@link https://docs.ccxt.com/#/?id=settlement-history-structure}
6806
+ */
6773
6807
  async fetchSettlementHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
6774
- /**
6775
- * @method
6776
- * @name gate#fetchSettlementHistory
6777
- * @description fetches historical settlement records
6778
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-settlement-history-2
6779
- * @param {string} symbol unified market symbol of the settlement history, required on gate
6780
- * @param {int} [since] timestamp in ms
6781
- * @param {int} [limit] number of records
6782
- * @param {object} [params] exchange specific params
6783
- * @returns {object[]} a list of [settlement history objects]{@link https://docs.ccxt.com/#/?id=settlement-history-structure}
6784
- */
6785
6808
  if (symbol === undefined) {
6786
6809
  throw new errors.ArgumentsRequired(this.id + ' fetchSettlementHistory() requires a symbol argument');
6787
6810
  }
@@ -6820,18 +6843,18 @@ class gate extends gate$1 {
6820
6843
  const sorted = this.sortBy(settlements, 'timestamp');
6821
6844
  return this.filterBySymbolSinceLimit(sorted, symbol, since, limit);
6822
6845
  }
6846
+ /**
6847
+ * @method
6848
+ * @name gate#fetchMySettlementHistory
6849
+ * @description fetches historical settlement records of the user
6850
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-my-options-settlements
6851
+ * @param {string} symbol unified market symbol of the settlement history
6852
+ * @param {int} [since] timestamp in ms
6853
+ * @param {int} [limit] number of records
6854
+ * @param {object} [params] exchange specific params
6855
+ * @returns {object[]} a list of [settlement history objects]
6856
+ */
6823
6857
  async fetchMySettlementHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
6824
- /**
6825
- * @method
6826
- * @name gate#fetchMySettlementHistory
6827
- * @description fetches historical settlement records of the user
6828
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-my-options-settlements
6829
- * @param {string} symbol unified market symbol of the settlement history
6830
- * @param {int} [since] timestamp in ms
6831
- * @param {int} [limit] number of records
6832
- * @param {object} [params] exchange specific params
6833
- * @returns {object[]} a list of [settlement history objects]
6834
- */
6835
6858
  if (symbol === undefined) {
6836
6859
  throw new errors.ArgumentsRequired(this.id + ' fetchMySettlementHistory() requires a symbol argument');
6837
6860
  }
@@ -6950,24 +6973,24 @@ class gate extends gate$1 {
6950
6973
  }
6951
6974
  return result;
6952
6975
  }
6976
+ /**
6977
+ * @method
6978
+ * @name gate#fetchLedger
6979
+ * @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
6980
+ * @see https://www.gate.io/docs/developers/apiv4/en/#query-account-book
6981
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-margin-account-balance-change-history
6982
+ * @see https://www.gate.io/docs/developers/apiv4/en/#query-account-book-2
6983
+ * @see https://www.gate.io/docs/developers/apiv4/en/#query-account-book-3
6984
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-account-changing-history
6985
+ * @param {string} [code] unified currency code
6986
+ * @param {int} [since] timestamp in ms of the earliest ledger entry
6987
+ * @param {int} [limit] max number of ledger entries to return
6988
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
6989
+ * @param {int} [params.until] end time in ms
6990
+ * @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)
6991
+ * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
6992
+ */
6953
6993
  async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
6954
- /**
6955
- * @method
6956
- * @name gate#fetchLedger
6957
- * @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
6958
- * @see https://www.gate.io/docs/developers/apiv4/en/#query-account-book
6959
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-margin-account-balance-change-history
6960
- * @see https://www.gate.io/docs/developers/apiv4/en/#query-account-book-2
6961
- * @see https://www.gate.io/docs/developers/apiv4/en/#query-account-book-3
6962
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-account-changing-history
6963
- * @param {string} [code] unified currency code
6964
- * @param {int} [since] timestamp in ms of the earliest ledger entry
6965
- * @param {int} [limit] max number of ledger entries to return
6966
- * @param {object} [params] extra parameters specific to the exchange API endpoint
6967
- * @param {int} [params.until] end time in ms
6968
- * @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)
6969
- * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
6970
- */
6971
6994
  await this.loadMarkets();
6972
6995
  let paginate = false;
6973
6996
  [paginate, params] = this.handleOptionAndParams(params, 'fetchLedger', 'paginate');
@@ -7196,33 +7219,33 @@ class gate extends gate$1 {
7196
7219
  };
7197
7220
  return this.safeString(ledgerType, type, type);
7198
7221
  }
7222
+ /**
7223
+ * @method
7224
+ * @name gate#setPositionMode
7225
+ * @description set dual/hedged mode to true or false for a swap market, make sure all positions are closed and no orders are open before setting dual mode
7226
+ * @see https://www.gate.io/docs/developers/apiv4/en/#enable-or-disable-dual-mode
7227
+ * @param {bool} hedged set to true to enable dual mode
7228
+ * @param {string|undefined} symbol if passed, dual mode is set for all markets with the same settle currency
7229
+ * @param {object} params extra parameters specific to the exchange API endpoint
7230
+ * @param {string} params.settle settle currency
7231
+ * @returns {object} response from the exchange
7232
+ */
7199
7233
  async setPositionMode(hedged, symbol = undefined, params = {}) {
7200
- /**
7201
- * @method
7202
- * @name gate#setPositionMode
7203
- * @description set dual/hedged mode to true or false for a swap market, make sure all positions are closed and no orders are open before setting dual mode
7204
- * @see https://www.gate.io/docs/developers/apiv4/en/#enable-or-disable-dual-mode
7205
- * @param {bool} hedged set to true to enable dual mode
7206
- * @param {string|undefined} symbol if passed, dual mode is set for all markets with the same settle currency
7207
- * @param {object} params extra parameters specific to the exchange API endpoint
7208
- * @param {string} params.settle settle currency
7209
- * @returns {object} response from the exchange
7210
- */
7211
7234
  const market = (symbol !== undefined) ? this.market(symbol) : undefined;
7212
7235
  const [request, query] = this.prepareRequest(market, 'swap', params);
7213
7236
  request['dual_mode'] = hedged;
7214
7237
  return await this.privateFuturesPostSettleDualMode(this.extend(request, query));
7215
7238
  }
7239
+ /**
7240
+ * @method
7241
+ * @name gate#fetchUnderlyingAssets
7242
+ * @description fetches the market ids of underlying assets for a specific contract market type
7243
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-underlyings
7244
+ * @param {object} [params] exchange specific params
7245
+ * @param {string} [params.type] the contract market type, 'option', 'swap' or 'future', the default is 'option'
7246
+ * @returns {object[]} a list of [underlying assets]{@link https://docs.ccxt.com/#/?id=underlying-assets-structure}
7247
+ */
7216
7248
  async fetchUnderlyingAssets(params = {}) {
7217
- /**
7218
- * @method
7219
- * @name gate#fetchUnderlyingAssets
7220
- * @description fetches the market ids of underlying assets for a specific contract market type
7221
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-underlyings
7222
- * @param {object} [params] exchange specific params
7223
- * @param {string} [params.type] the contract market type, 'option', 'swap' or 'future', the default is 'option'
7224
- * @returns {object[]} a list of [underlying assets]{@link https://docs.ccxt.com/#/?id=underlying-assets-structure}
7225
- */
7226
7249
  await this.loadMarkets();
7227
7250
  let marketType = undefined;
7228
7251
  [marketType, params] = this.handleMarketTypeAndParams('fetchUnderlyingAssets', undefined, params);
@@ -7252,19 +7275,19 @@ class gate extends gate$1 {
7252
7275
  }
7253
7276
  return underlyings;
7254
7277
  }
7278
+ /**
7279
+ * @method
7280
+ * @name gate#fetchLiquidations
7281
+ * @description retrieves the public liquidations of a trading pair
7282
+ * @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-liquidation-history
7283
+ * @param {string} symbol unified CCXT market symbol
7284
+ * @param {int} [since] the earliest time in ms to fetch liquidations for
7285
+ * @param {int} [limit] the maximum number of liquidation structures to retrieve
7286
+ * @param {object} [params] exchange specific parameters for the exchange API endpoint
7287
+ * @param {int} [params.until] timestamp in ms of the latest liquidation
7288
+ * @returns {object} an array of [liquidation structures]{@link https://docs.ccxt.com/#/?id=liquidation-structure}
7289
+ */
7255
7290
  async fetchLiquidations(symbol, since = undefined, limit = undefined, params = {}) {
7256
- /**
7257
- * @method
7258
- * @name gate#fetchLiquidations
7259
- * @description retrieves the public liquidations of a trading pair
7260
- * @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-liquidation-history
7261
- * @param {string} symbol unified CCXT market symbol
7262
- * @param {int} [since] the earliest time in ms to fetch liquidations for
7263
- * @param {int} [limit] the maximum number of liquidation structures to retrieve
7264
- * @param {object} [params] exchange specific parameters for the exchange API endpoint
7265
- * @param {int} [params.until] timestamp in ms of the latest liquidation
7266
- * @returns {object} an array of [liquidation structures]{@link https://docs.ccxt.com/#/?id=liquidation-structure}
7267
- */
7268
7291
  await this.loadMarkets();
7269
7292
  const market = this.market(symbol);
7270
7293
  if (!market['swap']) {
@@ -7296,20 +7319,20 @@ class gate extends gate$1 {
7296
7319
  //
7297
7320
  return this.parseLiquidations(response, market, since, limit);
7298
7321
  }
7322
+ /**
7323
+ * @method
7324
+ * @name gate#fetchMyLiquidations
7325
+ * @description retrieves the users liquidated positions
7326
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-liquidation-history
7327
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-liquidation-history-2
7328
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-user-s-liquidation-history-of-specified-underlying
7329
+ * @param {string} symbol unified CCXT market symbol
7330
+ * @param {int} [since] the earliest time in ms to fetch liquidations for
7331
+ * @param {int} [limit] the maximum number of liquidation structures to retrieve
7332
+ * @param {object} [params] exchange specific parameters for the exchange API endpoint
7333
+ * @returns {object} an array of [liquidation structures]{@link https://docs.ccxt.com/#/?id=liquidation-structure}
7334
+ */
7299
7335
  async fetchMyLiquidations(symbol = undefined, since = undefined, limit = undefined, params = {}) {
7300
- /**
7301
- * @method
7302
- * @name gate#fetchMyLiquidations
7303
- * @description retrieves the users liquidated positions
7304
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-liquidation-history
7305
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-liquidation-history-2
7306
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-user-s-liquidation-history-of-specified-underlying
7307
- * @param {string} symbol unified CCXT market symbol
7308
- * @param {int} [since] the earliest time in ms to fetch liquidations for
7309
- * @param {int} [limit] the maximum number of liquidation structures to retrieve
7310
- * @param {object} [params] exchange specific parameters for the exchange API endpoint
7311
- * @returns {object} an array of [liquidation structures]{@link https://docs.ccxt.com/#/?id=liquidation-structure}
7312
- */
7313
7336
  if (symbol === undefined) {
7314
7337
  throw new errors.ArgumentsRequired(this.id + ' fetchMyLiquidations() requires a symbol argument');
7315
7338
  }
@@ -7442,16 +7465,16 @@ class gate extends gate$1 {
7442
7465
  'datetime': this.iso8601(timestamp),
7443
7466
  });
7444
7467
  }
7468
+ /**
7469
+ * @method
7470
+ * @name gate#fetchGreeks
7471
+ * @description fetches an option contracts greeks, financial metrics used to measure the factors that affect the price of an options contract
7472
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-tickers-of-options-contracts
7473
+ * @param {string} symbol unified symbol of the market to fetch greeks for
7474
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
7475
+ * @returns {object} a [greeks structure]{@link https://docs.ccxt.com/#/?id=greeks-structure}
7476
+ */
7445
7477
  async fetchGreeks(symbol, params = {}) {
7446
- /**
7447
- * @method
7448
- * @name gate#fetchGreeks
7449
- * @description fetches an option contracts greeks, financial metrics used to measure the factors that affect the price of an options contract
7450
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-tickers-of-options-contracts
7451
- * @param {string} symbol unified symbol of the market to fetch greeks for
7452
- * @param {object} [params] extra parameters specific to the exchange API endpoint
7453
- * @returns {object} a [greeks structure]{@link https://docs.ccxt.com/#/?id=greeks-structure}
7454
- */
7455
7478
  await this.loadMarkets();
7456
7479
  const market = this.market(symbol);
7457
7480
  const request = {
@@ -7535,19 +7558,19 @@ class gate extends gate$1 {
7535
7558
  'info': greeks,
7536
7559
  };
7537
7560
  }
7561
+ /**
7562
+ * @method
7563
+ * @name gate#closePosition
7564
+ * @description closes open positions for a market
7565
+ * @see https://www.gate.io/docs/developers/apiv4/en/#create-a-futures-order
7566
+ * @see https://www.gate.io/docs/developers/apiv4/en/#create-a-futures-order-2
7567
+ * @see https://www.gate.io/docs/developers/apiv4/en/#create-an-options-order
7568
+ * @param {string} symbol Unified CCXT market symbol
7569
+ * @param {string} side 'buy' or 'sell'
7570
+ * @param {object} [params] extra parameters specific to the okx api endpoint
7571
+ * @returns {object[]} [A list of position structures]{@link https://docs.ccxt.com/#/?id=position-structure}
7572
+ */
7538
7573
  async closePosition(symbol, side = undefined, params = {}) {
7539
- /**
7540
- * @method
7541
- * @name gate#closePosition
7542
- * @description closes open positions for a market
7543
- * @see https://www.gate.io/docs/developers/apiv4/en/#create-a-futures-order
7544
- * @see https://www.gate.io/docs/developers/apiv4/en/#create-a-futures-order-2
7545
- * @see https://www.gate.io/docs/developers/apiv4/en/#create-an-options-order
7546
- * @param {string} symbol Unified CCXT market symbol
7547
- * @param {string} side 'buy' or 'sell'
7548
- * @param {object} [params] extra parameters specific to the okx api endpoint
7549
- * @returns {object[]} [A list of position structures]{@link https://docs.ccxt.com/#/?id=position-structure}
7550
- */
7551
7574
  const request = {
7552
7575
  'close': true,
7553
7576
  };
@@ -7557,19 +7580,19 @@ class gate extends gate$1 {
7557
7580
  }
7558
7581
  return await this.createOrder(symbol, 'market', side, 0, undefined, params);
7559
7582
  }
7583
+ /**
7584
+ * @method
7585
+ * @name gate#fetchLeverage
7586
+ * @description fetch the set leverage for a market
7587
+ * @see https://www.gate.io/docs/developers/apiv4/en/#get-unified-account-information
7588
+ * @see https://www.gate.io/docs/developers/apiv4/en/#get-detail-of-lending-market
7589
+ * @see https://www.gate.io/docs/developers/apiv4/en/#query-one-single-margin-currency-pair-deprecated
7590
+ * @param {string} symbol unified market symbol
7591
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
7592
+ * @param {boolean} [params.unified] default false, set to true for fetching the unified accounts leverage
7593
+ * @returns {object} a [leverage structure]{@link https://docs.ccxt.com/#/?id=leverage-structure}
7594
+ */
7560
7595
  async fetchLeverage(symbol, params = {}) {
7561
- /**
7562
- * @method
7563
- * @name gate#fetchLeverage
7564
- * @description fetch the set leverage for a market
7565
- * @see https://www.gate.io/docs/developers/apiv4/en/#get-unified-account-information
7566
- * @see https://www.gate.io/docs/developers/apiv4/en/#get-detail-of-lending-market
7567
- * @see https://www.gate.io/docs/developers/apiv4/en/#query-one-single-margin-currency-pair-deprecated
7568
- * @param {string} symbol unified market symbol
7569
- * @param {object} [params] extra parameters specific to the exchange API endpoint
7570
- * @param {boolean} [params.unified] default false, set to true for fetching the unified accounts leverage
7571
- * @returns {object} a [leverage structure]{@link https://docs.ccxt.com/#/?id=leverage-structure}
7572
- */
7573
7596
  await this.loadMarkets();
7574
7597
  let market = undefined;
7575
7598
  if (symbol !== undefined) {
@@ -7667,18 +7690,18 @@ class gate extends gate$1 {
7667
7690
  }
7668
7691
  return this.parseLeverage(response, market);
7669
7692
  }
7693
+ /**
7694
+ * @method
7695
+ * @name gate#fetchLeverages
7696
+ * @description fetch the set leverage for all leverage markets, only spot margin is supported on gate
7697
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-lending-markets
7698
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-supported-currency-pairs-supported-in-margin-trading-deprecated
7699
+ * @param {string[]} symbols a list of unified market symbols
7700
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
7701
+ * @param {boolean} [params.unified] default false, set to true for fetching unified account leverages
7702
+ * @returns {object} a list of [leverage structures]{@link https://docs.ccxt.com/#/?id=leverage-structure}
7703
+ */
7670
7704
  async fetchLeverages(symbols = undefined, params = {}) {
7671
- /**
7672
- * @method
7673
- * @name gate#fetchLeverages
7674
- * @description fetch the set leverage for all leverage markets, only spot margin is supported on gate
7675
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-lending-markets
7676
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-supported-currency-pairs-supported-in-margin-trading-deprecated
7677
- * @param {string[]} symbols a list of unified market symbols
7678
- * @param {object} [params] extra parameters specific to the exchange API endpoint
7679
- * @param {boolean} [params.unified] default false, set to true for fetching unified account leverages
7680
- * @returns {object} a list of [leverage structures]{@link https://docs.ccxt.com/#/?id=leverage-structure}
7681
- */
7682
7705
  await this.loadMarkets();
7683
7706
  symbols = this.marketSymbols(symbols);
7684
7707
  let response = undefined;
@@ -7729,16 +7752,16 @@ class gate extends gate$1 {
7729
7752
  'shortLeverage': leverageValue,
7730
7753
  };
7731
7754
  }
7755
+ /**
7756
+ * @method
7757
+ * @name gate#fetchOption
7758
+ * @description fetches option data that is commonly found in an option chain
7759
+ * @see https://www.gate.io/docs/developers/apiv4/en/#query-specified-contract-detail
7760
+ * @param {string} symbol unified market symbol
7761
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
7762
+ * @returns {object} an [option chain structure]{@link https://docs.ccxt.com/#/?id=option-chain-structure}
7763
+ */
7732
7764
  async fetchOption(symbol, params = {}) {
7733
- /**
7734
- * @method
7735
- * @name gate#fetchOption
7736
- * @description fetches option data that is commonly found in an option chain
7737
- * @see https://www.gate.io/docs/developers/apiv4/en/#query-specified-contract-detail
7738
- * @param {string} symbol unified market symbol
7739
- * @param {object} [params] extra parameters specific to the exchange API endpoint
7740
- * @returns {object} an [option chain structure]{@link https://docs.ccxt.com/#/?id=option-chain-structure}
7741
- */
7742
7765
  await this.loadMarkets();
7743
7766
  const market = this.market(symbol);
7744
7767
  const request = {
@@ -7787,18 +7810,18 @@ class gate extends gate$1 {
7787
7810
  //
7788
7811
  return this.parseOption(response, undefined, market);
7789
7812
  }
7813
+ /**
7814
+ * @method
7815
+ * @name gate#fetchOptionChain
7816
+ * @description fetches data for an underlying asset that is commonly found in an option chain
7817
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-the-contracts-with-specified-underlying-and-expiration-time
7818
+ * @param {string} code base currency to fetch an option chain for
7819
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
7820
+ * @param {string} [params.underlying] the underlying asset, can be obtained from fetchUnderlyingAssets ()
7821
+ * @param {int} [params.expiration] unix timestamp of the expiration time
7822
+ * @returns {object} a list of [option chain structures]{@link https://docs.ccxt.com/#/?id=option-chain-structure}
7823
+ */
7790
7824
  async fetchOptionChain(code, params = {}) {
7791
- /**
7792
- * @method
7793
- * @name gate#fetchOptionChain
7794
- * @description fetches data for an underlying asset that is commonly found in an option chain
7795
- * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-the-contracts-with-specified-underlying-and-expiration-time
7796
- * @param {string} currency base currency to fetch an option chain for
7797
- * @param {object} [params] extra parameters specific to the exchange API endpoint
7798
- * @param {string} [params.underlying] the underlying asset, can be obtained from fetchUnderlyingAssets ()
7799
- * @param {int} [params.expiration] unix timestamp of the expiration time
7800
- * @returns {object} a list of [option chain structures]{@link https://docs.ccxt.com/#/?id=option-chain-structure}
7801
- */
7802
7825
  await this.loadMarkets();
7803
7826
  const currency = this.currency(code);
7804
7827
  const request = {
@@ -7913,25 +7936,25 @@ class gate extends gate$1 {
7913
7936
  'quoteVolume': undefined,
7914
7937
  };
7915
7938
  }
7939
+ /**
7940
+ * @method
7941
+ * @name gate#fetchPositionsHistory
7942
+ * @description fetches historical positions
7943
+ * @see https://www.gate.io/docs/developers/apiv4/#list-position-close-history
7944
+ * @see https://www.gate.io/docs/developers/apiv4/#list-position-close-history-2
7945
+ * @param {string[]} symbols unified conract symbols, must all have the same settle currency and the same market type
7946
+ * @param {int} [since] the earliest time in ms to fetch positions for
7947
+ * @param {int} [limit] the maximum amount of records to fetch, default=1000
7948
+ * @param {object} params extra parameters specific to the exchange api endpoint
7949
+ * @param {int} [params.until] the latest time in ms to fetch positions for
7950
+ *
7951
+ * EXCHANGE SPECIFIC PARAMETERS
7952
+ * @param {int} [params.offset] list offset, starting from 0
7953
+ * @param {string} [params.side] long or short
7954
+ * @param {string} [params.pnl] query profit or loss
7955
+ * @returns {object[]} a list of [position structures]{@link https://docs.ccxt.com/#/?id=position-structure}
7956
+ */
7916
7957
  async fetchPositionsHistory(symbols = undefined, since = undefined, limit = undefined, params = {}) {
7917
- /**
7918
- * @method
7919
- * @name gate#fetchPositionsHistory
7920
- * @description fetches historical positions
7921
- * @see https://www.gate.io/docs/developers/apiv4/#list-position-close-history
7922
- * @see https://www.gate.io/docs/developers/apiv4/#list-position-close-history-2
7923
- * @param {string[]} symbols unified conract symbols, must all have the same settle currency and the same market type
7924
- * @param {int} [since] the earliest time in ms to fetch positions for
7925
- * @param {int} [limit] the maximum amount of records to fetch, default=1000
7926
- * @param {object} params extra parameters specific to the exchange api endpoint
7927
- * @param {int} [params.until] the latest time in ms to fetch positions for
7928
- *
7929
- * EXCHANGE SPECIFIC PARAMETERS
7930
- * @param {int} offset list offset, starting from 0
7931
- * @param {string} side long or short
7932
- * @param {string} pnl query profit or loss
7933
- * @returns {object[]} a list of [position structures]{@link https://docs.ccxt.com/#/?id=position-structure}
7934
- */
7935
7958
  await this.loadMarkets();
7936
7959
  let market = undefined;
7937
7960
  if (symbols !== undefined) {