ccxt 4.4.30 → 4.4.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (496) hide show
  1. package/README.md +9 -3
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +1 -1
  4. package/dist/cjs/src/ace.js +123 -123
  5. package/dist/cjs/src/alpaca.js +237 -237
  6. package/dist/cjs/src/ascendex.js +342 -341
  7. package/dist/cjs/src/bigone.js +242 -242
  8. package/dist/cjs/src/binance.js +1339 -1291
  9. package/dist/cjs/src/bingx.js +639 -639
  10. package/dist/cjs/src/bit2c.js +111 -111
  11. package/dist/cjs/src/bitbank.js +142 -142
  12. package/dist/cjs/src/bitbns.js +140 -140
  13. package/dist/cjs/src/bitfinex.js +231 -231
  14. package/dist/cjs/src/bitfinex2.js +403 -403
  15. package/dist/cjs/src/bitflyer.js +184 -184
  16. package/dist/cjs/src/bitget.js +848 -846
  17. package/dist/cjs/src/bithumb.js +125 -124
  18. package/dist/cjs/src/bitmart.js +525 -525
  19. package/dist/cjs/src/bitmex.js +317 -317
  20. package/dist/cjs/src/bitopro.js +221 -221
  21. package/dist/cjs/src/bitrue.js +315 -315
  22. package/dist/cjs/src/bitso.js +220 -220
  23. package/dist/cjs/src/bitstamp.js +251 -251
  24. package/dist/cjs/src/bitteam.js +183 -183
  25. package/dist/cjs/src/bitvavo.js +247 -251
  26. package/dist/cjs/src/bl3p.js +82 -82
  27. package/dist/cjs/src/blockchaincom.js +211 -211
  28. package/dist/cjs/src/blofin.js +332 -331
  29. package/dist/cjs/src/btcalpha.js +166 -166
  30. package/dist/cjs/src/btcbox.js +108 -108
  31. package/dist/cjs/src/btcmarkets.js +198 -198
  32. package/dist/cjs/src/btcturk.js +124 -124
  33. package/dist/cjs/src/bybit.js +906 -900
  34. package/dist/cjs/src/cex.js +227 -226
  35. package/dist/cjs/src/coinbase.js +481 -481
  36. package/dist/cjs/src/coinbaseexchange.js +274 -274
  37. package/dist/cjs/src/coinbaseinternational.js +304 -304
  38. package/dist/cjs/src/coincatch.js +650 -650
  39. package/dist/cjs/src/coincheck.js +113 -113
  40. package/dist/cjs/src/coinex.js +611 -601
  41. package/dist/cjs/src/coinlist.js +304 -303
  42. package/dist/cjs/src/coinmate.js +162 -161
  43. package/dist/cjs/src/coinmetro.js +187 -187
  44. package/dist/cjs/src/coinone.js +124 -123
  45. package/dist/cjs/src/coinsph.js +237 -237
  46. package/dist/cjs/src/coinspot.js +82 -82
  47. package/dist/cjs/src/cryptocom.js +342 -341
  48. package/dist/cjs/src/currencycom.js +225 -224
  49. package/dist/cjs/src/delta.js +320 -320
  50. package/dist/cjs/src/deribit.js +411 -408
  51. package/dist/cjs/src/digifinex.js +432 -431
  52. package/dist/cjs/src/exmo.js +328 -327
  53. package/dist/cjs/src/gate.js +830 -791
  54. package/dist/cjs/src/gemini.js +199 -198
  55. package/dist/cjs/src/hashkey.js +520 -517
  56. package/dist/cjs/src/hitbtc.js +465 -462
  57. package/dist/cjs/src/hollaex.js +253 -252
  58. package/dist/cjs/src/htx.js +791 -848
  59. package/dist/cjs/src/huobijp.js +219 -218
  60. package/dist/cjs/src/hyperliquid.js +421 -417
  61. package/dist/cjs/src/idex.js +238 -237
  62. package/dist/cjs/src/independentreserve.js +133 -132
  63. package/dist/cjs/src/indodax.js +177 -171
  64. package/dist/cjs/src/kraken.js +381 -377
  65. package/dist/cjs/src/krakenfutures.js +285 -279
  66. package/dist/cjs/src/kucoin.js +632 -622
  67. package/dist/cjs/src/kucoinfutures.js +533 -457
  68. package/dist/cjs/src/kuna.js +283 -282
  69. package/dist/cjs/src/latoken.js +211 -210
  70. package/dist/cjs/src/lbank.js +268 -267
  71. package/dist/cjs/src/luno.js +174 -173
  72. package/dist/cjs/src/lykke.js +172 -171
  73. package/dist/cjs/src/mercado.js +123 -122
  74. package/dist/cjs/src/mexc.js +650 -646
  75. package/dist/cjs/src/ndax.js +229 -228
  76. package/dist/cjs/src/novadax.js +230 -229
  77. package/dist/cjs/src/oceanex.js +187 -186
  78. package/dist/cjs/src/okcoin.js +286 -285
  79. package/dist/cjs/src/okx.js +909 -904
  80. package/dist/cjs/src/onetrading.js +218 -218
  81. package/dist/cjs/src/oxfun.js +335 -334
  82. package/dist/cjs/src/p2b.js +154 -154
  83. package/dist/cjs/src/paradex.js +249 -244
  84. package/dist/cjs/src/paymium.js +101 -101
  85. package/dist/cjs/src/phemex.js +388 -390
  86. package/dist/cjs/src/poloniex.js +270 -270
  87. package/dist/cjs/src/poloniexfutures.js +250 -250
  88. package/dist/cjs/src/pro/alpaca.js +64 -64
  89. package/dist/cjs/src/pro/ascendex.js +64 -64
  90. package/dist/cjs/src/pro/binance.js +546 -543
  91. package/dist/cjs/src/pro/bingx.js +116 -116
  92. package/dist/cjs/src/pro/bitfinex.js +42 -42
  93. package/dist/cjs/src/pro/bitfinex2.js +66 -66
  94. package/dist/cjs/src/pro/bitget.js +188 -181
  95. package/dist/cjs/src/pro/bithumb.js +40 -40
  96. package/dist/cjs/src/pro/bitmart.js +121 -119
  97. package/dist/cjs/src/pro/bitmex.js +135 -133
  98. package/dist/cjs/src/pro/bitopro.js +49 -49
  99. package/dist/cjs/src/pro/bitrue.js +19 -19
  100. package/dist/cjs/src/pro/bitstamp.js +29 -29
  101. package/dist/cjs/src/pro/bitvavo.js +299 -301
  102. package/dist/cjs/src/pro/blockchaincom.js +62 -62
  103. package/dist/cjs/src/pro/blofin.js +132 -130
  104. package/dist/cjs/src/pro/bybit.js +317 -313
  105. package/dist/cjs/src/pro/cex.js +168 -168
  106. package/dist/cjs/src/pro/coinbase.js +93 -91
  107. package/dist/cjs/src/pro/coinbaseexchange.js +95 -95
  108. package/dist/cjs/src/pro/coinbaseinternational.js +111 -111
  109. package/dist/cjs/src/pro/coincatch.js +150 -143
  110. package/dist/cjs/src/pro/coincheck.js +21 -21
  111. package/dist/cjs/src/pro/coinex.js +110 -110
  112. package/dist/cjs/src/pro/coinone.js +30 -30
  113. package/dist/cjs/src/pro/cryptocom.js +227 -227
  114. package/dist/cjs/src/pro/currencycom.js +45 -45
  115. package/dist/cjs/src/pro/deribit.js +127 -127
  116. package/dist/cjs/src/pro/exmo.js +66 -66
  117. package/dist/cjs/src/pro/gate.js +287 -283
  118. package/dist/cjs/src/pro/gemini.js +74 -74
  119. package/dist/cjs/src/pro/hashkey.js +87 -85
  120. package/dist/cjs/src/pro/hitbtc.js +190 -190
  121. package/dist/cjs/src/pro/hollaex.js +51 -51
  122. package/dist/cjs/src/pro/htx.js +96 -94
  123. package/dist/cjs/src/pro/huobijp.js +38 -38
  124. package/dist/cjs/src/pro/hyperliquid.js +151 -150
  125. package/dist/cjs/src/pro/idex.js +48 -48
  126. package/dist/cjs/src/pro/independentreserve.js +19 -19
  127. package/dist/cjs/src/pro/kraken.js +167 -167
  128. package/dist/cjs/src/pro/krakenfutures.js +137 -138
  129. package/dist/cjs/src/pro/kucoin.js +167 -168
  130. package/dist/cjs/src/pro/kucoinfutures.js +147 -147
  131. package/dist/cjs/src/pro/lbank.js +95 -95
  132. package/dist/cjs/src/pro/luno.js +21 -21
  133. package/dist/cjs/src/pro/mexc.js +102 -103
  134. package/dist/cjs/src/pro/ndax.js +42 -42
  135. package/dist/cjs/src/pro/okcoin.js +61 -61
  136. package/dist/cjs/src/pro/okx.js +332 -330
  137. package/dist/cjs/src/pro/onetrading.js +71 -71
  138. package/dist/cjs/src/pro/oxfun.js +193 -191
  139. package/dist/cjs/src/pro/p2b.js +77 -77
  140. package/dist/cjs/src/pro/paradex.js +39 -39
  141. package/dist/cjs/src/pro/phemex.js +94 -94
  142. package/dist/cjs/src/pro/poloniex.js +171 -171
  143. package/dist/cjs/src/pro/poloniexfutures.js +62 -62
  144. package/dist/cjs/src/pro/probit.js +63 -63
  145. package/dist/cjs/src/pro/upbit.js +80 -80
  146. package/dist/cjs/src/pro/vertex.js +65 -63
  147. package/dist/cjs/src/pro/wazirx.js +70 -70
  148. package/dist/cjs/src/pro/whitebit.js +83 -83
  149. package/dist/cjs/src/pro/woo.js +106 -104
  150. package/dist/cjs/src/pro/woofipro.js +105 -103
  151. package/dist/cjs/src/pro/xt.js +119 -119
  152. package/dist/cjs/src/probit.js +229 -229
  153. package/dist/cjs/src/timex.js +198 -197
  154. package/dist/cjs/src/tokocrypto.js +214 -213
  155. package/dist/cjs/src/tradeogre.js +92 -91
  156. package/dist/cjs/src/upbit.js +243 -242
  157. package/dist/cjs/src/vertex.js +258 -258
  158. package/dist/cjs/src/wavesexchange.js +176 -172
  159. package/dist/cjs/src/wazirx.js +168 -168
  160. package/dist/cjs/src/whitebit.js +361 -361
  161. package/dist/cjs/src/woo.js +571 -572
  162. package/dist/cjs/src/woofipro.js +392 -391
  163. package/dist/cjs/src/xt.js +436 -435
  164. package/dist/cjs/src/yobit.js +159 -158
  165. package/dist/cjs/src/zaif.js +103 -103
  166. package/dist/cjs/src/zonda.js +168 -168
  167. package/js/ccxt.d.ts +1 -1
  168. package/js/ccxt.js +1 -1
  169. package/js/src/ace.d.ts +123 -0
  170. package/js/src/ace.js +123 -123
  171. package/js/src/alpaca.d.ts +237 -0
  172. package/js/src/alpaca.js +237 -237
  173. package/js/src/ascendex.d.ts +339 -0
  174. package/js/src/ascendex.js +342 -341
  175. package/js/src/base/types.d.ts +1 -0
  176. package/js/src/bigone.d.ts +242 -0
  177. package/js/src/bigone.js +242 -242
  178. package/js/src/binance.d.ts +1306 -0
  179. package/js/src/binance.js +1339 -1291
  180. package/js/src/bingx.d.ts +639 -0
  181. package/js/src/bingx.js +639 -639
  182. package/js/src/bit2c.d.ts +111 -0
  183. package/js/src/bit2c.js +111 -111
  184. package/js/src/bitbank.d.ts +142 -0
  185. package/js/src/bitbank.js +142 -142
  186. package/js/src/bitbns.d.ts +140 -0
  187. package/js/src/bitbns.js +140 -140
  188. package/js/src/bitfinex.d.ts +231 -0
  189. package/js/src/bitfinex.js +231 -231
  190. package/js/src/bitfinex2.d.ts +403 -0
  191. package/js/src/bitfinex2.js +403 -403
  192. package/js/src/bitflyer.d.ts +184 -0
  193. package/js/src/bitflyer.js +184 -184
  194. package/js/src/bitget.d.ts +846 -0
  195. package/js/src/bitget.js +848 -846
  196. package/js/src/bithumb.d.ts +125 -0
  197. package/js/src/bithumb.js +125 -124
  198. package/js/src/bitmart.d.ts +525 -0
  199. package/js/src/bitmart.js +525 -525
  200. package/js/src/bitmex.d.ts +317 -0
  201. package/js/src/bitmex.js +317 -317
  202. package/js/src/bitopro.d.ts +221 -0
  203. package/js/src/bitopro.js +221 -221
  204. package/js/src/bitrue.d.ts +315 -0
  205. package/js/src/bitrue.js +315 -315
  206. package/js/src/bitso.d.ts +220 -0
  207. package/js/src/bitso.js +220 -220
  208. package/js/src/bitstamp.d.ts +251 -0
  209. package/js/src/bitstamp.js +251 -251
  210. package/js/src/bitteam.d.ts +183 -0
  211. package/js/src/bitteam.js +183 -183
  212. package/js/src/bitvavo.d.ts +247 -0
  213. package/js/src/bitvavo.js +247 -251
  214. package/js/src/bl3p.d.ts +82 -0
  215. package/js/src/bl3p.js +82 -82
  216. package/js/src/blockchaincom.d.ts +211 -0
  217. package/js/src/blockchaincom.js +211 -211
  218. package/js/src/blofin.d.ts +332 -0
  219. package/js/src/blofin.js +332 -331
  220. package/js/src/btcalpha.d.ts +166 -0
  221. package/js/src/btcalpha.js +166 -166
  222. package/js/src/btcbox.d.ts +108 -0
  223. package/js/src/btcbox.js +108 -108
  224. package/js/src/btcmarkets.d.ts +198 -0
  225. package/js/src/btcmarkets.js +198 -198
  226. package/js/src/btcturk.d.ts +124 -0
  227. package/js/src/btcturk.js +124 -124
  228. package/js/src/bybit.d.ts +906 -1
  229. package/js/src/bybit.js +906 -900
  230. package/js/src/cex.d.ts +227 -0
  231. package/js/src/cex.js +227 -226
  232. package/js/src/coinbase.d.ts +481 -0
  233. package/js/src/coinbase.js +481 -481
  234. package/js/src/coinbaseexchange.d.ts +274 -0
  235. package/js/src/coinbaseexchange.js +274 -274
  236. package/js/src/coinbaseinternational.d.ts +304 -0
  237. package/js/src/coinbaseinternational.js +304 -304
  238. package/js/src/coincatch.d.ts +646 -0
  239. package/js/src/coincatch.js +650 -650
  240. package/js/src/coincheck.d.ts +113 -0
  241. package/js/src/coincheck.js +113 -113
  242. package/js/src/coinex.d.ts +603 -0
  243. package/js/src/coinex.js +611 -601
  244. package/js/src/coinlist.d.ts +304 -0
  245. package/js/src/coinlist.js +304 -303
  246. package/js/src/coinmate.d.ts +162 -0
  247. package/js/src/coinmate.js +162 -161
  248. package/js/src/coinmetro.d.ts +187 -0
  249. package/js/src/coinmetro.js +187 -187
  250. package/js/src/coinone.d.ts +124 -0
  251. package/js/src/coinone.js +124 -123
  252. package/js/src/coinsph.d.ts +237 -0
  253. package/js/src/coinsph.js +237 -237
  254. package/js/src/coinspot.d.ts +82 -0
  255. package/js/src/coinspot.js +82 -82
  256. package/js/src/cryptocom.d.ts +342 -0
  257. package/js/src/cryptocom.js +342 -341
  258. package/js/src/currencycom.d.ts +225 -0
  259. package/js/src/currencycom.js +225 -224
  260. package/js/src/delta.d.ts +320 -0
  261. package/js/src/delta.js +320 -320
  262. package/js/src/deribit.d.ts +411 -0
  263. package/js/src/deribit.js +411 -408
  264. package/js/src/digifinex.d.ts +430 -0
  265. package/js/src/digifinex.js +432 -431
  266. package/js/src/exmo.d.ts +328 -0
  267. package/js/src/exmo.js +328 -327
  268. package/js/src/gate.d.ts +803 -1
  269. package/js/src/gate.js +830 -791
  270. package/js/src/gemini.d.ts +199 -0
  271. package/js/src/gemini.js +199 -198
  272. package/js/src/hashkey.d.ts +516 -0
  273. package/js/src/hashkey.js +520 -517
  274. package/js/src/hitbtc.d.ts +465 -0
  275. package/js/src/hitbtc.js +465 -462
  276. package/js/src/hollaex.d.ts +253 -0
  277. package/js/src/hollaex.js +253 -252
  278. package/js/src/htx.d.ts +765 -2
  279. package/js/src/htx.js +791 -848
  280. package/js/src/huobijp.d.ts +219 -0
  281. package/js/src/huobijp.js +219 -218
  282. package/js/src/hyperliquid.d.ts +419 -0
  283. package/js/src/hyperliquid.js +421 -417
  284. package/js/src/idex.d.ts +238 -0
  285. package/js/src/idex.js +238 -237
  286. package/js/src/independentreserve.d.ts +133 -0
  287. package/js/src/independentreserve.js +133 -132
  288. package/js/src/indodax.d.ts +171 -0
  289. package/js/src/indodax.js +177 -171
  290. package/js/src/kraken.d.ts +381 -0
  291. package/js/src/kraken.js +381 -377
  292. package/js/src/krakenfutures.d.ts +282 -0
  293. package/js/src/krakenfutures.js +285 -279
  294. package/js/src/kucoin.d.ts +613 -0
  295. package/js/src/kucoin.js +632 -622
  296. package/js/src/kucoinfutures.d.ts +441 -0
  297. package/js/src/kucoinfutures.js +533 -457
  298. package/js/src/kuna.d.ts +283 -0
  299. package/js/src/kuna.js +283 -282
  300. package/js/src/latoken.d.ts +211 -0
  301. package/js/src/latoken.js +211 -210
  302. package/js/src/lbank.d.ts +268 -0
  303. package/js/src/lbank.js +268 -267
  304. package/js/src/luno.d.ts +174 -0
  305. package/js/src/luno.js +174 -173
  306. package/js/src/lykke.d.ts +172 -0
  307. package/js/src/lykke.js +172 -171
  308. package/js/src/mercado.d.ts +123 -0
  309. package/js/src/mercado.js +123 -122
  310. package/js/src/mexc.d.ts +647 -0
  311. package/js/src/mexc.js +650 -646
  312. package/js/src/ndax.d.ts +229 -0
  313. package/js/src/ndax.js +229 -228
  314. package/js/src/novadax.d.ts +230 -0
  315. package/js/src/novadax.js +230 -229
  316. package/js/src/oceanex.d.ts +187 -0
  317. package/js/src/oceanex.js +187 -186
  318. package/js/src/okcoin.d.ts +286 -0
  319. package/js/src/okcoin.js +286 -285
  320. package/js/src/okx.d.ts +907 -0
  321. package/js/src/okx.js +909 -904
  322. package/js/src/onetrading.d.ts +218 -0
  323. package/js/src/onetrading.js +218 -218
  324. package/js/src/oxfun.d.ts +336 -3
  325. package/js/src/oxfun.js +335 -334
  326. package/js/src/p2b.d.ts +154 -0
  327. package/js/src/p2b.js +154 -154
  328. package/js/src/paradex.d.ts +241 -0
  329. package/js/src/paradex.js +249 -244
  330. package/js/src/paymium.d.ts +101 -0
  331. package/js/src/paymium.js +101 -101
  332. package/js/src/phemex.d.ts +366 -0
  333. package/js/src/phemex.js +388 -390
  334. package/js/src/poloniex.d.ts +270 -0
  335. package/js/src/poloniex.js +270 -270
  336. package/js/src/poloniexfutures.d.ts +250 -0
  337. package/js/src/poloniexfutures.js +250 -250
  338. package/js/src/pro/alpaca.d.ts +64 -0
  339. package/js/src/pro/alpaca.js +64 -64
  340. package/js/src/pro/ascendex.d.ts +64 -0
  341. package/js/src/pro/ascendex.js +64 -64
  342. package/js/src/pro/binance.d.ts +546 -0
  343. package/js/src/pro/binance.js +546 -543
  344. package/js/src/pro/bingx.d.ts +116 -0
  345. package/js/src/pro/bingx.js +116 -116
  346. package/js/src/pro/bitfinex.d.ts +42 -0
  347. package/js/src/pro/bitfinex.js +42 -42
  348. package/js/src/pro/bitfinex2.d.ts +66 -0
  349. package/js/src/pro/bitfinex2.js +66 -66
  350. package/js/src/pro/bitget.d.ts +187 -0
  351. package/js/src/pro/bitget.js +188 -181
  352. package/js/src/pro/bithumb.d.ts +40 -0
  353. package/js/src/pro/bithumb.js +40 -40
  354. package/js/src/pro/bitmart.d.ts +121 -0
  355. package/js/src/pro/bitmart.js +121 -119
  356. package/js/src/pro/bitmex.d.ts +135 -0
  357. package/js/src/pro/bitmex.js +135 -133
  358. package/js/src/pro/bitopro.d.ts +49 -0
  359. package/js/src/pro/bitopro.js +49 -49
  360. package/js/src/pro/bitrue.d.ts +19 -0
  361. package/js/src/pro/bitrue.js +19 -19
  362. package/js/src/pro/bitstamp.d.ts +29 -0
  363. package/js/src/pro/bitstamp.js +29 -29
  364. package/js/src/pro/bitvavo.d.ts +254 -1
  365. package/js/src/pro/bitvavo.js +299 -301
  366. package/js/src/pro/blockchaincom.d.ts +62 -0
  367. package/js/src/pro/blockchaincom.js +62 -62
  368. package/js/src/pro/blofin.d.ts +132 -0
  369. package/js/src/pro/blofin.js +132 -130
  370. package/js/src/pro/bybit.d.ts +317 -0
  371. package/js/src/pro/bybit.js +317 -313
  372. package/js/src/pro/cex.d.ts +168 -0
  373. package/js/src/pro/cex.js +168 -168
  374. package/js/src/pro/coinbase.d.ts +93 -0
  375. package/js/src/pro/coinbase.js +93 -91
  376. package/js/src/pro/coinbaseexchange.d.ts +95 -0
  377. package/js/src/pro/coinbaseexchange.js +95 -95
  378. package/js/src/pro/coinbaseinternational.d.ts +111 -0
  379. package/js/src/pro/coinbaseinternational.js +111 -111
  380. package/js/src/pro/coincatch.d.ts +150 -0
  381. package/js/src/pro/coincatch.js +150 -143
  382. package/js/src/pro/coincheck.d.ts +21 -0
  383. package/js/src/pro/coincheck.js +21 -21
  384. package/js/src/pro/coinex.d.ts +110 -0
  385. package/js/src/pro/coinex.js +110 -110
  386. package/js/src/pro/coinone.d.ts +30 -0
  387. package/js/src/pro/coinone.js +30 -30
  388. package/js/src/pro/cryptocom.d.ts +227 -0
  389. package/js/src/pro/cryptocom.js +227 -227
  390. package/js/src/pro/currencycom.d.ts +45 -0
  391. package/js/src/pro/currencycom.js +45 -45
  392. package/js/src/pro/deribit.d.ts +127 -0
  393. package/js/src/pro/deribit.js +127 -127
  394. package/js/src/pro/exmo.d.ts +66 -0
  395. package/js/src/pro/exmo.js +66 -66
  396. package/js/src/pro/gate.d.ts +287 -0
  397. package/js/src/pro/gate.js +287 -283
  398. package/js/src/pro/gemini.d.ts +74 -0
  399. package/js/src/pro/gemini.js +74 -74
  400. package/js/src/pro/hashkey.d.ts +87 -0
  401. package/js/src/pro/hashkey.js +87 -85
  402. package/js/src/pro/hitbtc.d.ts +190 -0
  403. package/js/src/pro/hitbtc.js +190 -190
  404. package/js/src/pro/hollaex.d.ts +51 -0
  405. package/js/src/pro/hollaex.js +51 -51
  406. package/js/src/pro/htx.d.ts +96 -0
  407. package/js/src/pro/htx.js +96 -94
  408. package/js/src/pro/huobijp.d.ts +38 -0
  409. package/js/src/pro/huobijp.js +38 -38
  410. package/js/src/pro/hyperliquid.d.ts +151 -0
  411. package/js/src/pro/hyperliquid.js +151 -150
  412. package/js/src/pro/idex.d.ts +48 -0
  413. package/js/src/pro/idex.js +48 -48
  414. package/js/src/pro/independentreserve.d.ts +19 -0
  415. package/js/src/pro/independentreserve.js +19 -19
  416. package/js/src/pro/kraken.d.ts +167 -0
  417. package/js/src/pro/kraken.js +167 -167
  418. package/js/src/pro/krakenfutures.d.ts +137 -0
  419. package/js/src/pro/krakenfutures.js +137 -138
  420. package/js/src/pro/kucoin.d.ts +167 -0
  421. package/js/src/pro/kucoin.js +167 -168
  422. package/js/src/pro/kucoinfutures.d.ts +147 -0
  423. package/js/src/pro/kucoinfutures.js +147 -147
  424. package/js/src/pro/lbank.d.ts +95 -0
  425. package/js/src/pro/lbank.js +95 -95
  426. package/js/src/pro/luno.d.ts +21 -0
  427. package/js/src/pro/luno.js +21 -21
  428. package/js/src/pro/mexc.d.ts +101 -0
  429. package/js/src/pro/mexc.js +102 -103
  430. package/js/src/pro/ndax.d.ts +42 -0
  431. package/js/src/pro/ndax.js +42 -42
  432. package/js/src/pro/okcoin.d.ts +61 -0
  433. package/js/src/pro/okcoin.js +61 -61
  434. package/js/src/pro/okx.d.ts +332 -0
  435. package/js/src/pro/okx.js +332 -330
  436. package/js/src/pro/onetrading.d.ts +71 -0
  437. package/js/src/pro/onetrading.js +71 -71
  438. package/js/src/pro/oxfun.d.ts +193 -0
  439. package/js/src/pro/oxfun.js +193 -191
  440. package/js/src/pro/p2b.d.ts +77 -0
  441. package/js/src/pro/p2b.js +77 -77
  442. package/js/src/pro/paradex.d.ts +39 -0
  443. package/js/src/pro/paradex.js +39 -39
  444. package/js/src/pro/phemex.d.ts +94 -0
  445. package/js/src/pro/phemex.js +94 -94
  446. package/js/src/pro/poloniex.d.ts +171 -0
  447. package/js/src/pro/poloniex.js +171 -171
  448. package/js/src/pro/poloniexfutures.d.ts +62 -0
  449. package/js/src/pro/poloniexfutures.js +62 -62
  450. package/js/src/pro/probit.d.ts +63 -0
  451. package/js/src/pro/probit.js +63 -63
  452. package/js/src/pro/upbit.d.ts +80 -0
  453. package/js/src/pro/upbit.js +80 -80
  454. package/js/src/pro/vertex.d.ts +65 -0
  455. package/js/src/pro/vertex.js +65 -63
  456. package/js/src/pro/wazirx.d.ts +70 -0
  457. package/js/src/pro/wazirx.js +70 -70
  458. package/js/src/pro/whitebit.d.ts +83 -0
  459. package/js/src/pro/whitebit.js +83 -83
  460. package/js/src/pro/woo.d.ts +106 -0
  461. package/js/src/pro/woo.js +106 -104
  462. package/js/src/pro/woofipro.d.ts +105 -0
  463. package/js/src/pro/woofipro.js +105 -103
  464. package/js/src/pro/xt.d.ts +119 -0
  465. package/js/src/pro/xt.js +119 -119
  466. package/js/src/probit.d.ts +229 -0
  467. package/js/src/probit.js +229 -229
  468. package/js/src/timex.d.ts +198 -0
  469. package/js/src/timex.js +198 -197
  470. package/js/src/tokocrypto.d.ts +214 -0
  471. package/js/src/tokocrypto.js +214 -213
  472. package/js/src/tradeogre.d.ts +92 -0
  473. package/js/src/tradeogre.js +92 -91
  474. package/js/src/upbit.d.ts +243 -0
  475. package/js/src/upbit.js +243 -242
  476. package/js/src/vertex.d.ts +258 -0
  477. package/js/src/vertex.js +258 -258
  478. package/js/src/wavesexchange.d.ts +176 -0
  479. package/js/src/wavesexchange.js +176 -172
  480. package/js/src/wazirx.d.ts +168 -0
  481. package/js/src/wazirx.js +168 -168
  482. package/js/src/whitebit.d.ts +361 -0
  483. package/js/src/whitebit.js +361 -361
  484. package/js/src/woo.d.ts +571 -0
  485. package/js/src/woo.js +571 -572
  486. package/js/src/woofipro.d.ts +392 -0
  487. package/js/src/woofipro.js +392 -391
  488. package/js/src/xt.d.ts +439 -4
  489. package/js/src/xt.js +436 -435
  490. package/js/src/yobit.d.ts +159 -0
  491. package/js/src/yobit.js +159 -158
  492. package/js/src/zaif.d.ts +103 -0
  493. package/js/src/zaif.js +103 -103
  494. package/js/src/zonda.d.ts +168 -0
  495. package/js/src/zonda.js +168 -168
  496. package/package.json +1 -1
@@ -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
+ * @method
901
+ * @name gate#isUnifiedEnabled
902
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
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,31 +3129,47 @@ 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
+ * @param {int} [params.until] timestamp in ms of the latest funding rate to fetch
3142
+ * @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)
3143
+ * @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
3144
+ */
3111
3145
  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
3146
  if (symbol === undefined) {
3124
3147
  throw new errors.ArgumentsRequired(this.id + ' fetchFundingRateHistory() requires a symbol argument');
3125
3148
  }
3126
3149
  await this.loadMarkets();
3150
+ let paginate = false;
3151
+ [paginate, params] = this.handleOptionAndParams(params, 'fetchFundingRateHistory', 'paginate');
3152
+ if (paginate) {
3153
+ return await this.fetchPaginatedCallDeterministic('fetchFundingRateHistory', symbol, since, limit, '8h', params);
3154
+ }
3127
3155
  const market = this.market(symbol);
3128
3156
  if (!market['swap']) {
3129
3157
  throw new errors.BadSymbol(this.id + ' fetchFundingRateHistory() supports swap contracts only');
3130
3158
  }
3131
- const [request, query] = this.prepareRequest(market, undefined, params);
3159
+ let request = {};
3160
+ [request, params] = this.prepareRequest(market, undefined, params);
3132
3161
  if (limit !== undefined) {
3133
3162
  request['limit'] = limit;
3134
3163
  }
3135
- const response = await this.publicFuturesGetSettleFundingRate(this.extend(request, query));
3164
+ if (since !== undefined) {
3165
+ request['from'] = this.parseToInt(since / 1000);
3166
+ }
3167
+ const until = this.safeInteger(params, 'until');
3168
+ if (until !== undefined) {
3169
+ params = this.omit(params, 'until');
3170
+ request['to'] = this.parseToInt(until / 1000);
3171
+ }
3172
+ const response = await this.publicFuturesGetSettleFundingRate(this.extend(request, params));
3136
3173
  //
3137
3174
  // {
3138
3175
  // "r": "0.00063521",
@@ -3201,23 +3238,23 @@ class gate extends gate$1 {
3201
3238
  ];
3202
3239
  }
3203
3240
  }
3241
+ /**
3242
+ * @method
3243
+ * @name gate#fetchTrades
3244
+ * @description get the list of most recent trades for a particular symbol
3245
+ * @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-market-trades
3246
+ * @see https://www.gate.io/docs/developers/apiv4/en/#futures-trading-history
3247
+ * @see https://www.gate.io/docs/developers/apiv4/en/#futures-trading-history-2
3248
+ * @see https://www.gate.io/docs/developers/apiv4/en/#options-trade-history
3249
+ * @param {string} symbol unified symbol of the market to fetch trades for
3250
+ * @param {int} [since] timestamp in ms of the earliest trade to fetch
3251
+ * @param {int} [limit] the maximum amount of trades to fetch
3252
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3253
+ * @param {int} [params.until] timestamp in ms of the latest trade to fetch
3254
+ * @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)
3255
+ * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
3256
+ */
3204
3257
  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
3258
  await this.loadMarkets();
3222
3259
  let paginate = false;
3223
3260
  [paginate, params] = this.handleOptionAndParams(params, 'fetchTrades', 'paginate');
@@ -3316,22 +3353,22 @@ class gate extends gate$1 {
3316
3353
  //
3317
3354
  return this.parseTrades(response, market, since, limit);
3318
3355
  }
3356
+ /**
3357
+ * @method
3358
+ * @name gate#fetchOrderTrades
3359
+ * @description fetch all the trades made from a single order
3360
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history
3361
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-2
3362
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-3
3363
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-4
3364
+ * @param {string} id order id
3365
+ * @param {string} symbol unified market symbol
3366
+ * @param {int} [since] the earliest time in ms to fetch trades for
3367
+ * @param {int} [limit] the maximum number of trades to retrieve
3368
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3369
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
3370
+ */
3319
3371
  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
3372
  if (symbol === undefined) {
3336
3373
  throw new errors.ArgumentsRequired(this.id + ' fetchOrderTrades() requires a symbol argument');
3337
3374
  }
@@ -3358,32 +3395,32 @@ class gate extends gate$1 {
3358
3395
  const response = await this.fetchMyTrades(symbol, since, limit, { 'order_id': id });
3359
3396
  return response;
3360
3397
  }
3398
+ /**
3399
+ * @method
3400
+ * @name gate#fetchMyTrades
3401
+ * @description Fetch personal trading history
3402
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history
3403
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-2
3404
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-3
3405
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-4
3406
+ * @param {string} symbol unified market symbol
3407
+ * @param {int} [since] the earliest time in ms to fetch trades for
3408
+ * @param {int} [limit] the maximum number of trades structures to retrieve
3409
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3410
+ * @param {string} [params.marginMode] 'cross' or 'isolated' - marginMode for margin trading if not provided this.options['defaultMarginMode'] is used
3411
+ * @param {string} [params.type] 'spot', 'swap', or 'future', if not provided this.options['defaultMarginMode'] is used
3412
+ * @param {int} [params.until] The latest timestamp, in ms, that fetched trades were made
3413
+ * @param {int} [params.page] *spot only* Page number
3414
+ * @param {string} [params.order_id] *spot only* Filter trades with specified order ID. symbol is also required if this field is present
3415
+ * @param {string} [params.order] *contract only* Futures order ID, return related data only if specified
3416
+ * @param {int} [params.offset] *contract only* list offset, starting from 0
3417
+ * @param {string} [params.last_id] *contract only* specify list staring point using the id of last record in previous list-query results
3418
+ * @param {int} [params.count_total] *contract only* whether to return total number matched, default to 0(no return)
3419
+ * @param {bool} [params.unifiedAccount] set to true for fetching trades in a unified account
3420
+ * @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)
3421
+ * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
3422
+ */
3361
3423
  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
3424
  await this.loadMarkets();
3388
3425
  await this.loadUnifiedStatus();
3389
3426
  let paginate = false;
@@ -3649,20 +3686,20 @@ class gate extends gate$1 {
3649
3686
  'fees': fees,
3650
3687
  }, market);
3651
3688
  }
3689
+ /**
3690
+ * @method
3691
+ * @name gate#fetchDeposits
3692
+ * @description fetch all deposits made to an account
3693
+ * @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-deposit-records
3694
+ * @param {string} code unified currency code
3695
+ * @param {int} [since] the earliest time in ms to fetch deposits for
3696
+ * @param {int} [limit] the maximum number of deposits structures to retrieve
3697
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3698
+ * @param {int} [params.until] end time in ms
3699
+ * @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)
3700
+ * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
3701
+ */
3652
3702
  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
3703
  await this.loadMarkets();
3667
3704
  let paginate = false;
3668
3705
  [paginate, params] = this.handleOptionAndParams(params, 'fetchDeposits', 'paginate');
@@ -3687,20 +3724,20 @@ class gate extends gate$1 {
3687
3724
  const response = await this.privateWalletGetDeposits(this.extend(request, params));
3688
3725
  return this.parseTransactions(response, currency);
3689
3726
  }
3727
+ /**
3728
+ * @method
3729
+ * @name gate#fetchWithdrawals
3730
+ * @description fetch all withdrawals made from an account
3731
+ * @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-withdrawal-records
3732
+ * @param {string} code unified currency code
3733
+ * @param {int} [since] the earliest time in ms to fetch withdrawals for
3734
+ * @param {int} [limit] the maximum number of withdrawals structures to retrieve
3735
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3736
+ * @param {int} [params.until] end time in ms
3737
+ * @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)
3738
+ * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
3739
+ */
3690
3740
  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
3741
  await this.loadMarkets();
3705
3742
  let paginate = false;
3706
3743
  [paginate, params] = this.handleOptionAndParams(params, 'fetchWithdrawals', 'paginate');
@@ -3725,19 +3762,19 @@ class gate extends gate$1 {
3725
3762
  const response = await this.privateWalletGetWithdrawals(this.extend(request, params));
3726
3763
  return this.parseTransactions(response, currency);
3727
3764
  }
3765
+ /**
3766
+ * @method
3767
+ * @name gate#withdraw
3768
+ * @description make a withdrawal
3769
+ * @see https://www.gate.io/docs/developers/apiv4/en/#withdraw
3770
+ * @param {string} code unified currency code
3771
+ * @param {float} amount the amount to withdraw
3772
+ * @param {string} address the address to withdraw to
3773
+ * @param {string} tag
3774
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3775
+ * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
3776
+ */
3728
3777
  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
3778
  [tag, params] = this.handleWithdrawTagAndParams(tag, params);
3742
3779
  this.checkAddress(address);
3743
3780
  await this.loadMarkets();
@@ -3910,42 +3947,42 @@ class gate extends gate$1 {
3910
3947
  },
3911
3948
  };
3912
3949
  }
3950
+ /**
3951
+ * @method
3952
+ * @name gate#createOrder
3953
+ * @description Create an order on the exchange
3954
+ * @see https://www.gate.io/docs/developers/apiv4/en/#create-an-order
3955
+ * @see https://www.gate.io/docs/developers/apiv4/en/#create-a-price-triggered-order
3956
+ * @see https://www.gate.io/docs/developers/apiv4/en/#create-a-futures-order
3957
+ * @see https://www.gate.io/docs/developers/apiv4/en/#create-a-price-triggered-order-2
3958
+ * @see https://www.gate.io/docs/developers/apiv4/en/#create-a-futures-order-2
3959
+ * @see https://www.gate.io/docs/developers/apiv4/en/#create-a-price-triggered-order-3
3960
+ * @see https://www.gate.io/docs/developers/apiv4/en/#create-an-options-order
3961
+ * @param {string} symbol Unified CCXT market symbol
3962
+ * @param {string} type 'limit' or 'market' *"market" is contract only*
3963
+ * @param {string} side 'buy' or 'sell'
3964
+ * @param {float} amount the amount of currency to trade
3965
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
3966
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3967
+ * @param {float} [params.stopPrice] The price at which a trigger order is triggered at
3968
+ * @param {string} [params.timeInForce] "GTC", "IOC", or "PO"
3969
+ * @param {float} [params.stopLossPrice] The price at which a stop loss order is triggered at
3970
+ * @param {float} [params.takeProfitPrice] The price at which a take profit order is triggered at
3971
+ * @param {string} [params.marginMode] 'cross' or 'isolated' - marginMode for margin trading if not provided this.options['defaultMarginMode'] is used
3972
+ * @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
3973
+ * @param {string} [params.text] User defined information
3974
+ * @param {string} [params.account] *spot and margin only* "spot", "margin" or "cross_margin"
3975
+ * @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
3976
+ * @param {string} [params.settle] *contract only* Unified Currency Code for settle currency
3977
+ * @param {bool} [params.reduceOnly] *contract only* Indicates if this order is to reduce the size of a position
3978
+ * @param {bool} [params.close] *contract only* Set as true to close the position, with size set to 0
3979
+ * @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
3980
+ * @param {int} [params.price_type] *contract only* 0 latest deal price, 1 mark price, 2 index price
3981
+ * @param {float} [params.cost] *spot market buy only* the quote quantity that can be used as an alternative for the amount
3982
+ * @param {bool} [params.unifiedAccount] set to true for creating an order in the unified account
3983
+ * @returns {object|undefined} [An order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
3984
+ */
3913
3985
  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
3986
  await this.loadMarkets();
3950
3987
  await this.loadUnifiedStatus();
3951
3988
  const market = this.market(symbol);
@@ -4087,17 +4124,18 @@ class gate extends gate$1 {
4087
4124
  }
4088
4125
  return ordersRequests;
4089
4126
  }
4127
+ /**
4128
+ * @method
4129
+ * @name gate#createOrders
4130
+ * @description create a list of trade orders
4131
+ * @see https://www.gate.io/docs/developers/apiv4/en/#get-a-single-order-2
4132
+ * @see https://www.gate.io/docs/developers/apiv4/en/#create-a-batch-of-orders
4133
+ * @see https://www.gate.io/docs/developers/apiv4/en/#create-a-batch-of-futures-orders
4134
+ * @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
4135
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
4136
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
4137
+ */
4090
4138
  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
4139
  await this.loadMarkets();
4102
4140
  await this.loadUnifiedStatus();
4103
4141
  const ordersRequests = this.createOrdersRequest(orders, params);
@@ -4372,18 +4410,18 @@ class gate extends gate$1 {
4372
4410
  }
4373
4411
  return this.extend(request, params);
4374
4412
  }
4413
+ /**
4414
+ * @method
4415
+ * @name gate#createMarketBuyOrderWithCost
4416
+ * @description create a market buy order by providing the symbol and cost
4417
+ * @see https://www.gate.io/docs/developers/apiv4/en/#create-an-order
4418
+ * @param {string} symbol unified symbol of the market to create an order in
4419
+ * @param {float} cost how much you want to trade in units of the quote currency
4420
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
4421
+ * @param {bool} [params.unifiedAccount] set to true for creating a unified account order
4422
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
4423
+ */
4375
4424
  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
4425
  await this.loadMarkets();
4388
4426
  await this.loadUnifiedStatus();
4389
4427
  const market = this.market(symbol);
@@ -4436,23 +4474,23 @@ class gate extends gate$1 {
4436
4474
  }
4437
4475
  return this.extend(request, params);
4438
4476
  }
4477
+ /**
4478
+ * @method
4479
+ * @name gate#editOrder
4480
+ * @description edit a trade order, gate currently only supports the modification of the price or amount fields
4481
+ * @see https://www.gate.io/docs/developers/apiv4/en/#amend-an-order
4482
+ * @see https://www.gate.io/docs/developers/apiv4/en/#amend-an-order-2
4483
+ * @param {string} id order id
4484
+ * @param {string} symbol unified symbol of the market to create an order in
4485
+ * @param {string} type 'market' or 'limit'
4486
+ * @param {string} side 'buy' or 'sell'
4487
+ * @param {float} amount how much of the currency you want to trade in units of the base currency
4488
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
4489
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
4490
+ * @param {bool} [params.unifiedAccount] set to true for editing an order in a unified account
4491
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
4492
+ */
4439
4493
  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
4494
  await this.loadMarkets();
4457
4495
  await this.loadUnifiedStatus();
4458
4496
  const market = this.market(symbol);
@@ -4798,25 +4836,25 @@ class gate extends gate$1 {
4798
4836
  request['order_id'] = orderId.toString();
4799
4837
  return [request, requestParams];
4800
4838
  }
4839
+ /**
4840
+ * @method
4841
+ * @name gate#fetchOrder
4842
+ * @description Retrieves information on an order
4843
+ * @see https://www.gate.io/docs/developers/apiv4/en/#get-a-single-order
4844
+ * @see https://www.gate.io/docs/developers/apiv4/en/#get-a-single-order-2
4845
+ * @see https://www.gate.io/docs/developers/apiv4/en/#get-a-single-order-3
4846
+ * @see https://www.gate.io/docs/developers/apiv4/en/#get-a-single-order-4
4847
+ * @param {string} id Order id
4848
+ * @param {string} symbol Unified market symbol, *required for spot and margin*
4849
+ * @param {object} [params] Parameters specified by the exchange api
4850
+ * @param {bool} [params.trigger] True if the order being fetched is a trigger order
4851
+ * @param {string} [params.marginMode] 'cross' or 'isolated' - marginMode for margin trading if not provided this.options['defaultMarginMode'] is used
4852
+ * @param {string} [params.type] 'spot', 'swap', or 'future', if not provided this.options['defaultMarginMode'] is used
4853
+ * @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
4854
+ * @param {bool} [params.unifiedAccount] set to true for fetching a unified account order
4855
+ * @returns An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
4856
+ */
4801
4857
  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
4858
  await this.loadMarkets();
4821
4859
  await this.loadUnifiedStatus();
4822
4860
  const market = (symbol === undefined) ? undefined : this.market(symbol);
@@ -4857,49 +4895,49 @@ class gate extends gate$1 {
4857
4895
  }
4858
4896
  return this.parseOrder(response, market);
4859
4897
  }
4898
+ /**
4899
+ * @method
4900
+ * @name gate#fetchOpenOrders
4901
+ * @description fetch all unfilled currently open orders
4902
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-open-orders
4903
+ * @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-running-auto-order-list
4904
+ * @param {string} symbol unified market symbol
4905
+ * @param {int} [since] the earliest time in ms to fetch open orders for
4906
+ * @param {int} [limit] the maximum number of open orders structures to retrieve
4907
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
4908
+ * @param {bool} [params.stop] true for fetching stop orders
4909
+ * @param {string} [params.type] spot, margin, swap or future, if not provided this.options['defaultType'] is used
4910
+ * @param {string} [params.marginMode] 'cross' or 'isolated' - marginMode for type='margin', if not provided this.options['defaultMarginMode'] is used
4911
+ * @param {bool} [params.unifiedAccount] set to true for fetching unified account orders
4912
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
4913
+ */
4860
4914
  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
4915
  return await this.fetchOrdersByStatus('open', symbol, since, limit, params);
4878
4916
  }
4917
+ /**
4918
+ * @method
4919
+ * @name gate#fetchClosedOrders
4920
+ * @description fetches information on multiple closed orders made by the user
4921
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-orders
4922
+ * @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-running-auto-order-list
4923
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-futures-orders
4924
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-auto-orders
4925
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-futures-orders-2
4926
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-auto-orders-2
4927
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-options-orders
4928
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-futures-orders-by-time-range
4929
+ * @param {string} symbol unified market symbol of the market orders were made in
4930
+ * @param {int} [since] the earliest time in ms to fetch orders for
4931
+ * @param {int} [limit] the maximum number of order structures to retrieve
4932
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
4933
+ * @param {bool} [params.stop] true for fetching stop orders
4934
+ * @param {string} [params.type] spot, swap or future, if not provided this.options['defaultType'] is used
4935
+ * @param {string} [params.marginMode] 'cross' or 'isolated' - marginMode for margin trading if not provided this.options['defaultMarginMode'] is used
4936
+ * @param {boolean} [params.historical] *swap only* true for using historical endpoint
4937
+ * @param {bool} [params.unifiedAccount] set to true for fetching unified account orders
4938
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
4939
+ */
4879
4940
  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
4941
  await this.loadMarkets();
4904
4942
  await this.loadUnifiedStatus();
4905
4943
  const until = this.safeInteger(params, 'until');
@@ -5179,22 +5217,22 @@ class gate extends gate$1 {
5179
5217
  const orders = this.parseOrders(result, market, since, limit);
5180
5218
  return this.filterBySymbolSinceLimit(orders, symbol, since, limit);
5181
5219
  }
5220
+ /**
5221
+ * @method
5222
+ * @name gate#cancelOrder
5223
+ * @description Cancels an open order
5224
+ * @see https://www.gate.io/docs/developers/apiv4/en/#cancel-a-single-order
5225
+ * @see https://www.gate.io/docs/developers/apiv4/en/#cancel-a-single-order-2
5226
+ * @see https://www.gate.io/docs/developers/apiv4/en/#cancel-a-single-order-3
5227
+ * @see https://www.gate.io/docs/developers/apiv4/en/#cancel-a-single-order-4
5228
+ * @param {string} id Order id
5229
+ * @param {string} symbol Unified market symbol
5230
+ * @param {object} [params] Parameters specified by the exchange api
5231
+ * @param {bool} [params.stop] True if the order to be cancelled is a trigger order
5232
+ * @param {bool} [params.unifiedAccount] set to true for canceling unified account orders
5233
+ * @returns An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
5234
+ */
5182
5235
  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
5236
  await this.loadMarkets();
5199
5237
  await this.loadUnifiedStatus();
5200
5238
  const market = (symbol === undefined) ? undefined : this.market(symbol);
@@ -5317,19 +5355,19 @@ class gate extends gate$1 {
5317
5355
  //
5318
5356
  return this.parseOrder(response, market);
5319
5357
  }
5358
+ /**
5359
+ * @method
5360
+ * @name gate#cancelOrders
5361
+ * @description cancel multiple orders
5362
+ * @see https://www.gate.io/docs/developers/apiv4/en/#cancel-a-batch-of-orders-with-an-id-list
5363
+ * @see https://www.gate.io/docs/developers/apiv4/en/#cancel-a-batch-of-orders-with-an-id-list-2
5364
+ * @param {string[]} ids order ids
5365
+ * @param {string} symbol unified symbol of the market the order was made in
5366
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
5367
+ * @param {bool} [params.unifiedAccount] set to true for canceling unified account orders
5368
+ * @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
5369
+ */
5320
5370
  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
5371
  await this.loadMarkets();
5334
5372
  await this.loadUnifiedStatus();
5335
5373
  let market = undefined;
@@ -5366,18 +5404,18 @@ class gate extends gate$1 {
5366
5404
  const response = await this.privateFuturesPostSettleBatchCancelOrders(finalList);
5367
5405
  return this.parseOrders(response);
5368
5406
  }
5407
+ /**
5408
+ * @method
5409
+ * @name gate#cancelOrdersForSymbols
5410
+ * @description cancel multiple orders for multiple symbols
5411
+ * @see https://www.gate.io/docs/developers/apiv4/en/#cancel-a-batch-of-orders-with-an-id-list
5412
+ * @param {CancellationRequest[]} orders list of order ids with symbol, example [{"id": "a", "symbol": "BTC/USDT"}, {"id": "b", "symbol": "ETH/USDT"}]
5413
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
5414
+ * @param {string[]} [params.clientOrderIds] client order ids
5415
+ * @param {bool} [params.unifiedAccount] set to true for canceling unified account orders
5416
+ * @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
5417
+ */
5369
5418
  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
5419
  await this.loadMarkets();
5382
5420
  await this.loadUnifiedStatus();
5383
5421
  const ordersRequests = [];
@@ -5406,20 +5444,20 @@ class gate extends gate$1 {
5406
5444
  //
5407
5445
  return this.parseOrders(response);
5408
5446
  }
5447
+ /**
5448
+ * @method
5449
+ * @name gate#cancelAllOrders
5450
+ * @description cancel all open orders
5451
+ * @see https://www.gate.io/docs/developers/apiv4/en/#cancel-all-open-orders-in-specified-currency-pair
5452
+ * @see https://www.gate.io/docs/developers/apiv4/en/#cancel-all-open-orders-matched
5453
+ * @see https://www.gate.io/docs/developers/apiv4/en/#cancel-all-open-orders-matched-2
5454
+ * @see https://www.gate.io/docs/developers/apiv4/en/#cancel-all-open-orders-matched-3
5455
+ * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
5456
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
5457
+ * @param {bool} [params.unifiedAccount] set to true for canceling unified account orders
5458
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
5459
+ */
5409
5460
  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
5461
  await this.loadMarkets();
5424
5462
  await this.loadUnifiedStatus();
5425
5463
  const market = (symbol === undefined) ? undefined : this.market(symbol);
@@ -5488,20 +5526,20 @@ class gate extends gate$1 {
5488
5526
  //
5489
5527
  return this.parseOrders(response, market);
5490
5528
  }
5529
+ /**
5530
+ * @method
5531
+ * @name gate#transfer
5532
+ * @description transfer currency internally between wallets on the same account
5533
+ * @see https://www.gate.io/docs/developers/apiv4/en/#transfer-between-trading-accounts
5534
+ * @param {string} code unified currency code for currency being transferred
5535
+ * @param {float} amount the amount of currency to transfer
5536
+ * @param {string} fromAccount the account to transfer currency from
5537
+ * @param {string} toAccount the account to transfer currency to
5538
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
5539
+ * @param {string} [params.symbol] Unified market symbol *required for type == margin*
5540
+ * @returns A [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
5541
+ */
5491
5542
  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
5543
  await this.loadMarkets();
5506
5544
  const currency = this.currency(code);
5507
5545
  const fromId = this.convertTypeToAccount(fromAccount);
@@ -5573,18 +5611,18 @@ class gate extends gate$1 {
5573
5611
  'info': transfer,
5574
5612
  };
5575
5613
  }
5614
+ /**
5615
+ * @method
5616
+ * @name gate#setLeverage
5617
+ * @description set the level of leverage for a market
5618
+ * @see https://www.gate.io/docs/developers/apiv4/en/#update-position-leverage
5619
+ * @see https://www.gate.io/docs/developers/apiv4/en/#update-position-leverage-2
5620
+ * @param {float} leverage the rate of leverage
5621
+ * @param {string} symbol unified market symbol
5622
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
5623
+ * @returns {object} response from the exchange
5624
+ */
5576
5625
  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
5626
  if (symbol === undefined) {
5589
5627
  throw new errors.ArgumentsRequired(this.id + ' setLeverage() requires a symbol argument');
5590
5628
  }
@@ -5793,18 +5831,18 @@ class gate extends gate$1 {
5793
5831
  'takeProfitPrice': undefined,
5794
5832
  });
5795
5833
  }
5834
+ /**
5835
+ * @method
5836
+ * @name gate#fetchPosition
5837
+ * @description fetch data on an open contract position
5838
+ * @see https://www.gate.io/docs/developers/apiv4/en/#get-single-position
5839
+ * @see https://www.gate.io/docs/developers/apiv4/en/#get-single-position-2
5840
+ * @see https://www.gate.io/docs/developers/apiv4/en/#get-specified-contract-position
5841
+ * @param {string} symbol unified market symbol of the market the position is held in
5842
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
5843
+ * @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
5844
+ */
5796
5845
  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
5846
  await this.loadMarkets();
5809
5847
  const market = this.market(symbol);
5810
5848
  if (!market['contract']) {
@@ -5881,20 +5919,20 @@ class gate extends gate$1 {
5881
5919
  //
5882
5920
  return this.parsePosition(response, market);
5883
5921
  }
5922
+ /**
5923
+ * @method
5924
+ * @name gate#fetchPositions
5925
+ * @description fetch all open positions
5926
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-positions-of-a-user
5927
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-positions-of-a-user-2
5928
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-user-s-positions-of-specified-underlying
5929
+ * @param {string[]|undefined} symbols Not used by gate, but parsed internally by CCXT
5930
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
5931
+ * @param {string} [params.settle] 'btc' or 'usdt' - settle currency for perpetual swap and future - default="usdt" for swap and "btc" for future
5932
+ * @param {string} [params.type] swap, future or option, if not provided this.options['defaultType'] is used
5933
+ * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
5934
+ */
5884
5935
  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
5936
  await this.loadMarkets();
5899
5937
  let market = undefined;
5900
5938
  symbols = this.marketSymbols(symbols, undefined, true, true, true);
@@ -5992,17 +6030,17 @@ class gate extends gate$1 {
5992
6030
  //
5993
6031
  return this.parsePositions(response, symbols);
5994
6032
  }
6033
+ /**
6034
+ * @method
6035
+ * @name gate#fetchLeverageTiers
6036
+ * @description retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
6037
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-futures-contracts
6038
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-futures-contracts-2
6039
+ * @param {string[]} [symbols] list of unified market symbols
6040
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
6041
+ * @returns {object} a dictionary of [leverage tiers structures]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}, indexed by market symbols
6042
+ */
5995
6043
  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
6044
  await this.loadMarkets();
6007
6045
  const [type, query] = this.handleMarketTypeAndParams('fetchLeverageTiers', undefined, params);
6008
6046
  const [request, requestParams] = this.prepareRequest(undefined, type, query);
@@ -6113,16 +6151,16 @@ class gate extends gate$1 {
6113
6151
  //
6114
6152
  return this.parseLeverageTiers(response, symbols, 'name');
6115
6153
  }
6154
+ /**
6155
+ * @method
6156
+ * @name gate#fetchMarketLeverageTiers
6157
+ * @description retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes for a single market
6158
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-risk-limit-tiers
6159
+ * @param {string} symbol unified market symbol
6160
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
6161
+ * @returns {object} a [leverage tiers structure]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}
6162
+ */
6116
6163
  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
6164
  await this.loadMarkets();
6127
6165
  const market = this.market(symbol);
6128
6166
  const [type, query] = this.handleMarketTypeAndParams('fetchMarketLeverageTiers', market, params);
@@ -6145,6 +6183,7 @@ class gate extends gate$1 {
6145
6183
  return this.parseMarketLeverageTiers(response, market);
6146
6184
  }
6147
6185
  parseEmulatedLeverageTiers(info, market = undefined) {
6186
+ const marketId = this.safeString(info, 'name');
6148
6187
  const maintenanceMarginUnit = this.safeString(info, 'maintenance_rate'); // '0.005',
6149
6188
  const leverageMax = this.safeString(info, 'leverage_max'); // '100',
6150
6189
  const riskLimitStep = this.safeString(info, 'risk_limit_step'); // '1000000',
@@ -6158,6 +6197,7 @@ class gate extends gate$1 {
6158
6197
  const cap = Precise["default"].stringAdd(floor, riskLimitStep);
6159
6198
  tiers.push({
6160
6199
  'tier': this.parseNumber(Precise["default"].stringDiv(cap, riskLimitStep)),
6200
+ 'symbol': this.safeSymbol(marketId, market, undefined, 'contract'),
6161
6201
  'currency': this.safeString(market, 'settle'),
6162
6202
  'minNotional': this.parseNumber(floor),
6163
6203
  'maxNotional': this.parseNumber(cap),
@@ -6193,6 +6233,7 @@ class gate extends gate$1 {
6193
6233
  const maxNotional = this.safeNumber(item, 'risk_limit');
6194
6234
  tiers.push({
6195
6235
  'tier': this.sum(i, 1),
6236
+ 'symbol': market['symbol'],
6196
6237
  'currency': market['base'],
6197
6238
  'minNotional': minNotional,
6198
6239
  'maxNotional': maxNotional,
@@ -6204,20 +6245,20 @@ class gate extends gate$1 {
6204
6245
  }
6205
6246
  return tiers;
6206
6247
  }
6248
+ /**
6249
+ * @method
6250
+ * @name gate#repayMargin
6251
+ * @description repay borrowed margin and interest
6252
+ * @see https://www.gate.io/docs/apiv4/en/#repay-a-loan
6253
+ * @param {string} symbol unified market symbol
6254
+ * @param {string} code unified currency code of the currency to repay
6255
+ * @param {float} amount the amount to repay
6256
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
6257
+ * @param {string} [params.mode] 'all' or 'partial' payment mode, extra parameter required for isolated margin
6258
+ * @param {string} [params.id] '34267567' loan id, extra parameter required for isolated margin
6259
+ * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
6260
+ */
6207
6261
  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
6262
  await this.loadMarkets();
6222
6263
  const currency = this.currency(code);
6223
6264
  const request = {
@@ -6233,22 +6274,21 @@ class gate extends gate$1 {
6233
6274
  //
6234
6275
  return this.parseMarginLoan(response, currency);
6235
6276
  }
6277
+ /**
6278
+ * @method
6279
+ * @name gate#repayCrossMargin
6280
+ * @description repay cross margin borrowed margin and interest
6281
+ * @see https://www.gate.io/docs/developers/apiv4/en/#cross-margin-repayments
6282
+ * @see https://www.gate.io/docs/developers/apiv4/en/#borrow-or-repay
6283
+ * @param {string} code unified currency code of the currency to repay
6284
+ * @param {float} amount the amount to repay
6285
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
6286
+ * @param {string} [params.mode] 'all' or 'partial' payment mode, extra parameter required for isolated margin
6287
+ * @param {string} [params.id] '34267567' loan id, extra parameter required for isolated margin
6288
+ * @param {boolean} [params.unifiedAccount] set to true for repaying in the unified account
6289
+ * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
6290
+ */
6236
6291
  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
6292
  await this.loadMarkets();
6253
6293
  await this.loadUnifiedStatus();
6254
6294
  const currency = this.currency(code);
@@ -6285,19 +6325,19 @@ class gate extends gate$1 {
6285
6325
  }
6286
6326
  return this.parseMarginLoan(response, currency);
6287
6327
  }
6328
+ /**
6329
+ * @method
6330
+ * @name gate#borrowMargin
6331
+ * @description create a loan to borrow margin
6332
+ * @see https://www.gate.io/docs/developers/apiv4/en/#marginuni
6333
+ * @param {string} symbol unified market symbol, required for isolated margin
6334
+ * @param {string} code unified currency code of the currency to borrow
6335
+ * @param {float} amount the amount to borrow
6336
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
6337
+ * @param {string} [params.rate] '0.0002' or '0.002' extra parameter required for isolated margin
6338
+ * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
6339
+ */
6288
6340
  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
6341
  await this.loadMarkets();
6302
6342
  const currency = this.currency(code);
6303
6343
  const request = {
@@ -6330,21 +6370,20 @@ class gate extends gate$1 {
6330
6370
  //
6331
6371
  return this.parseMarginLoan(response, currency);
6332
6372
  }
6373
+ /**
6374
+ * @method
6375
+ * @name gate#borrowMargin
6376
+ * @description create a loan to borrow margin
6377
+ * @see https://www.gate.io/docs/apiv4/en/#create-a-cross-margin-borrow-loan
6378
+ * @see https://www.gate.io/docs/developers/apiv4/en/#borrow-or-repay
6379
+ * @param {string} code unified currency code of the currency to borrow
6380
+ * @param {float} amount the amount to borrow
6381
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
6382
+ * @param {string} [params.rate] '0.0002' or '0.002' extra parameter required for isolated margin
6383
+ * @param {boolean} [params.unifiedAccount] set to true for borrowing in the unified account
6384
+ * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
6385
+ */
6333
6386
  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
6387
  await this.loadMarkets();
6349
6388
  await this.loadUnifiedStatus();
6350
6389
  const currency = this.currency(code);
@@ -6432,22 +6471,22 @@ class gate extends gate$1 {
6432
6471
  'info': info,
6433
6472
  };
6434
6473
  }
6474
+ /**
6475
+ * @method
6476
+ * @name gate#fetchBorrowInterest
6477
+ * @description fetch the interest owed by the user for borrowing currency for margin trading
6478
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-interest-records
6479
+ * @see https://www.gate.io/docs/developers/apiv4/en/#interest-records-for-the-cross-margin-account
6480
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-interest-records-2
6481
+ * @param {string} [code] unified currency code
6482
+ * @param {string} [symbol] unified market symbol when fetching interest in isolated markets
6483
+ * @param {int} [since] the earliest time in ms to fetch borrow interest for
6484
+ * @param {int} [limit] the maximum number of structures to retrieve
6485
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
6486
+ * @param {boolean} [params.unifiedAccount] set to true for fetching borrow interest in the unified account
6487
+ * @returns {object[]} a list of [borrow interest structures]{@link https://docs.ccxt.com/#/?id=borrow-interest-structure}
6488
+ */
6435
6489
  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
6490
  await this.loadMarkets();
6452
6491
  await this.loadUnifiedStatus();
6453
6492
  let isUnifiedAccount = false;
@@ -6654,48 +6693,48 @@ class gate extends gate$1 {
6654
6693
  'datetime': undefined,
6655
6694
  };
6656
6695
  }
6696
+ /**
6697
+ * @method
6698
+ * @name gate#reduceMargin
6699
+ * @description remove margin from a position
6700
+ * @see https://www.gate.io/docs/developers/apiv4/en/#update-position-margin
6701
+ * @see https://www.gate.io/docs/developers/apiv4/en/#update-position-margin-2
6702
+ * @param {string} symbol unified market symbol
6703
+ * @param {float} amount the amount of margin to remove
6704
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
6705
+ * @returns {object} a [margin structure]{@link https://docs.ccxt.com/#/?id=reduce-margin-structure}
6706
+ */
6657
6707
  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
6708
  return await this.modifyMarginHelper(symbol, -amount, params);
6670
6709
  }
6710
+ /**
6711
+ * @method
6712
+ * @name gate#addMargin
6713
+ * @description add margin
6714
+ * @see https://www.gate.io/docs/developers/apiv4/en/#update-position-margin
6715
+ * @see https://www.gate.io/docs/developers/apiv4/en/#update-position-margin-2
6716
+ * @param {string} symbol unified market symbol
6717
+ * @param {float} amount amount of margin to add
6718
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
6719
+ * @returns {object} a [margin structure]{@link https://docs.ccxt.com/#/?id=add-margin-structure}
6720
+ */
6671
6721
  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
6722
  return await this.modifyMarginHelper(symbol, amount, params);
6684
6723
  }
6724
+ /**
6725
+ * @method
6726
+ * @name gate#fetchOpenInterest
6727
+ * @description Retrieves the open interest of a currency
6728
+ * @see https://www.gate.io/docs/developers/apiv4/en/#futures-stats
6729
+ * @param {string} symbol Unified CCXT market symbol
6730
+ * @param {string} timeframe "5m", "15m", "30m", "1h", "4h", "1d"
6731
+ * @param {int} [since] the time(ms) of the earliest record to retrieve as a unix timestamp
6732
+ * @param {int} [limit] default 30
6733
+ * @param {object} [params] exchange specific parameters
6734
+ * @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)
6735
+ * @returns {object} an open interest structure{@link https://docs.ccxt.com/#/?id=open-interest-structure}
6736
+ */
6685
6737
  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
6738
  await this.loadMarkets();
6700
6739
  let paginate = false;
6701
6740
  [paginate, params] = this.handleOptionAndParams(params, 'fetchOpenInterestHistory', 'paginate', false);
@@ -6770,18 +6809,18 @@ class gate extends gate$1 {
6770
6809
  'info': interest,
6771
6810
  };
6772
6811
  }
6812
+ /**
6813
+ * @method
6814
+ * @name gate#fetchSettlementHistory
6815
+ * @description fetches historical settlement records
6816
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-settlement-history-2
6817
+ * @param {string} symbol unified market symbol of the settlement history, required on gate
6818
+ * @param {int} [since] timestamp in ms
6819
+ * @param {int} [limit] number of records
6820
+ * @param {object} [params] exchange specific params
6821
+ * @returns {object[]} a list of [settlement history objects]{@link https://docs.ccxt.com/#/?id=settlement-history-structure}
6822
+ */
6773
6823
  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
6824
  if (symbol === undefined) {
6786
6825
  throw new errors.ArgumentsRequired(this.id + ' fetchSettlementHistory() requires a symbol argument');
6787
6826
  }
@@ -6820,18 +6859,18 @@ class gate extends gate$1 {
6820
6859
  const sorted = this.sortBy(settlements, 'timestamp');
6821
6860
  return this.filterBySymbolSinceLimit(sorted, symbol, since, limit);
6822
6861
  }
6862
+ /**
6863
+ * @method
6864
+ * @name gate#fetchMySettlementHistory
6865
+ * @description fetches historical settlement records of the user
6866
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-my-options-settlements
6867
+ * @param {string} symbol unified market symbol of the settlement history
6868
+ * @param {int} [since] timestamp in ms
6869
+ * @param {int} [limit] number of records
6870
+ * @param {object} [params] exchange specific params
6871
+ * @returns {object[]} a list of [settlement history objects]
6872
+ */
6823
6873
  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
6874
  if (symbol === undefined) {
6836
6875
  throw new errors.ArgumentsRequired(this.id + ' fetchMySettlementHistory() requires a symbol argument');
6837
6876
  }
@@ -6950,24 +6989,24 @@ class gate extends gate$1 {
6950
6989
  }
6951
6990
  return result;
6952
6991
  }
6992
+ /**
6993
+ * @method
6994
+ * @name gate#fetchLedger
6995
+ * @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
6996
+ * @see https://www.gate.io/docs/developers/apiv4/en/#query-account-book
6997
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-margin-account-balance-change-history
6998
+ * @see https://www.gate.io/docs/developers/apiv4/en/#query-account-book-2
6999
+ * @see https://www.gate.io/docs/developers/apiv4/en/#query-account-book-3
7000
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-account-changing-history
7001
+ * @param {string} [code] unified currency code
7002
+ * @param {int} [since] timestamp in ms of the earliest ledger entry
7003
+ * @param {int} [limit] max number of ledger entries to return
7004
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
7005
+ * @param {int} [params.until] end time in ms
7006
+ * @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)
7007
+ * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
7008
+ */
6953
7009
  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
7010
  await this.loadMarkets();
6972
7011
  let paginate = false;
6973
7012
  [paginate, params] = this.handleOptionAndParams(params, 'fetchLedger', 'paginate');
@@ -7196,33 +7235,33 @@ class gate extends gate$1 {
7196
7235
  };
7197
7236
  return this.safeString(ledgerType, type, type);
7198
7237
  }
7238
+ /**
7239
+ * @method
7240
+ * @name gate#setPositionMode
7241
+ * @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
7242
+ * @see https://www.gate.io/docs/developers/apiv4/en/#enable-or-disable-dual-mode
7243
+ * @param {bool} hedged set to true to enable dual mode
7244
+ * @param {string|undefined} symbol if passed, dual mode is set for all markets with the same settle currency
7245
+ * @param {object} params extra parameters specific to the exchange API endpoint
7246
+ * @param {string} params.settle settle currency
7247
+ * @returns {object} response from the exchange
7248
+ */
7199
7249
  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
7250
  const market = (symbol !== undefined) ? this.market(symbol) : undefined;
7212
7251
  const [request, query] = this.prepareRequest(market, 'swap', params);
7213
7252
  request['dual_mode'] = hedged;
7214
7253
  return await this.privateFuturesPostSettleDualMode(this.extend(request, query));
7215
7254
  }
7255
+ /**
7256
+ * @method
7257
+ * @name gate#fetchUnderlyingAssets
7258
+ * @description fetches the market ids of underlying assets for a specific contract market type
7259
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-underlyings
7260
+ * @param {object} [params] exchange specific params
7261
+ * @param {string} [params.type] the contract market type, 'option', 'swap' or 'future', the default is 'option'
7262
+ * @returns {object[]} a list of [underlying assets]{@link https://docs.ccxt.com/#/?id=underlying-assets-structure}
7263
+ */
7216
7264
  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
7265
  await this.loadMarkets();
7227
7266
  let marketType = undefined;
7228
7267
  [marketType, params] = this.handleMarketTypeAndParams('fetchUnderlyingAssets', undefined, params);
@@ -7252,19 +7291,19 @@ class gate extends gate$1 {
7252
7291
  }
7253
7292
  return underlyings;
7254
7293
  }
7294
+ /**
7295
+ * @method
7296
+ * @name gate#fetchLiquidations
7297
+ * @description retrieves the public liquidations of a trading pair
7298
+ * @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-liquidation-history
7299
+ * @param {string} symbol unified CCXT market symbol
7300
+ * @param {int} [since] the earliest time in ms to fetch liquidations for
7301
+ * @param {int} [limit] the maximum number of liquidation structures to retrieve
7302
+ * @param {object} [params] exchange specific parameters for the exchange API endpoint
7303
+ * @param {int} [params.until] timestamp in ms of the latest liquidation
7304
+ * @returns {object} an array of [liquidation structures]{@link https://docs.ccxt.com/#/?id=liquidation-structure}
7305
+ */
7255
7306
  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
7307
  await this.loadMarkets();
7269
7308
  const market = this.market(symbol);
7270
7309
  if (!market['swap']) {
@@ -7296,20 +7335,20 @@ class gate extends gate$1 {
7296
7335
  //
7297
7336
  return this.parseLiquidations(response, market, since, limit);
7298
7337
  }
7338
+ /**
7339
+ * @method
7340
+ * @name gate#fetchMyLiquidations
7341
+ * @description retrieves the users liquidated positions
7342
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-liquidation-history
7343
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-liquidation-history-2
7344
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-user-s-liquidation-history-of-specified-underlying
7345
+ * @param {string} symbol unified CCXT market symbol
7346
+ * @param {int} [since] the earliest time in ms to fetch liquidations for
7347
+ * @param {int} [limit] the maximum number of liquidation structures to retrieve
7348
+ * @param {object} [params] exchange specific parameters for the exchange API endpoint
7349
+ * @returns {object} an array of [liquidation structures]{@link https://docs.ccxt.com/#/?id=liquidation-structure}
7350
+ */
7299
7351
  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
7352
  if (symbol === undefined) {
7314
7353
  throw new errors.ArgumentsRequired(this.id + ' fetchMyLiquidations() requires a symbol argument');
7315
7354
  }
@@ -7442,16 +7481,16 @@ class gate extends gate$1 {
7442
7481
  'datetime': this.iso8601(timestamp),
7443
7482
  });
7444
7483
  }
7484
+ /**
7485
+ * @method
7486
+ * @name gate#fetchGreeks
7487
+ * @description fetches an option contracts greeks, financial metrics used to measure the factors that affect the price of an options contract
7488
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-tickers-of-options-contracts
7489
+ * @param {string} symbol unified symbol of the market to fetch greeks for
7490
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
7491
+ * @returns {object} a [greeks structure]{@link https://docs.ccxt.com/#/?id=greeks-structure}
7492
+ */
7445
7493
  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
7494
  await this.loadMarkets();
7456
7495
  const market = this.market(symbol);
7457
7496
  const request = {
@@ -7535,19 +7574,19 @@ class gate extends gate$1 {
7535
7574
  'info': greeks,
7536
7575
  };
7537
7576
  }
7577
+ /**
7578
+ * @method
7579
+ * @name gate#closePosition
7580
+ * @description closes open positions for a market
7581
+ * @see https://www.gate.io/docs/developers/apiv4/en/#create-a-futures-order
7582
+ * @see https://www.gate.io/docs/developers/apiv4/en/#create-a-futures-order-2
7583
+ * @see https://www.gate.io/docs/developers/apiv4/en/#create-an-options-order
7584
+ * @param {string} symbol Unified CCXT market symbol
7585
+ * @param {string} side 'buy' or 'sell'
7586
+ * @param {object} [params] extra parameters specific to the okx api endpoint
7587
+ * @returns {object[]} [A list of position structures]{@link https://docs.ccxt.com/#/?id=position-structure}
7588
+ */
7538
7589
  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
7590
  const request = {
7552
7591
  'close': true,
7553
7592
  };
@@ -7557,19 +7596,19 @@ class gate extends gate$1 {
7557
7596
  }
7558
7597
  return await this.createOrder(symbol, 'market', side, 0, undefined, params);
7559
7598
  }
7599
+ /**
7600
+ * @method
7601
+ * @name gate#fetchLeverage
7602
+ * @description fetch the set leverage for a market
7603
+ * @see https://www.gate.io/docs/developers/apiv4/en/#get-unified-account-information
7604
+ * @see https://www.gate.io/docs/developers/apiv4/en/#get-detail-of-lending-market
7605
+ * @see https://www.gate.io/docs/developers/apiv4/en/#query-one-single-margin-currency-pair-deprecated
7606
+ * @param {string} symbol unified market symbol
7607
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
7608
+ * @param {boolean} [params.unified] default false, set to true for fetching the unified accounts leverage
7609
+ * @returns {object} a [leverage structure]{@link https://docs.ccxt.com/#/?id=leverage-structure}
7610
+ */
7560
7611
  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
7612
  await this.loadMarkets();
7574
7613
  let market = undefined;
7575
7614
  if (symbol !== undefined) {
@@ -7667,18 +7706,18 @@ class gate extends gate$1 {
7667
7706
  }
7668
7707
  return this.parseLeverage(response, market);
7669
7708
  }
7709
+ /**
7710
+ * @method
7711
+ * @name gate#fetchLeverages
7712
+ * @description fetch the set leverage for all leverage markets, only spot margin is supported on gate
7713
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-lending-markets
7714
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-supported-currency-pairs-supported-in-margin-trading-deprecated
7715
+ * @param {string[]} symbols a list of unified market symbols
7716
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
7717
+ * @param {boolean} [params.unified] default false, set to true for fetching unified account leverages
7718
+ * @returns {object} a list of [leverage structures]{@link https://docs.ccxt.com/#/?id=leverage-structure}
7719
+ */
7670
7720
  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
7721
  await this.loadMarkets();
7683
7722
  symbols = this.marketSymbols(symbols);
7684
7723
  let response = undefined;
@@ -7729,16 +7768,16 @@ class gate extends gate$1 {
7729
7768
  'shortLeverage': leverageValue,
7730
7769
  };
7731
7770
  }
7771
+ /**
7772
+ * @method
7773
+ * @name gate#fetchOption
7774
+ * @description fetches option data that is commonly found in an option chain
7775
+ * @see https://www.gate.io/docs/developers/apiv4/en/#query-specified-contract-detail
7776
+ * @param {string} symbol unified market symbol
7777
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
7778
+ * @returns {object} an [option chain structure]{@link https://docs.ccxt.com/#/?id=option-chain-structure}
7779
+ */
7732
7780
  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
7781
  await this.loadMarkets();
7743
7782
  const market = this.market(symbol);
7744
7783
  const request = {
@@ -7787,18 +7826,18 @@ class gate extends gate$1 {
7787
7826
  //
7788
7827
  return this.parseOption(response, undefined, market);
7789
7828
  }
7829
+ /**
7830
+ * @method
7831
+ * @name gate#fetchOptionChain
7832
+ * @description fetches data for an underlying asset that is commonly found in an option chain
7833
+ * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-the-contracts-with-specified-underlying-and-expiration-time
7834
+ * @param {string} code base currency to fetch an option chain for
7835
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
7836
+ * @param {string} [params.underlying] the underlying asset, can be obtained from fetchUnderlyingAssets ()
7837
+ * @param {int} [params.expiration] unix timestamp of the expiration time
7838
+ * @returns {object} a list of [option chain structures]{@link https://docs.ccxt.com/#/?id=option-chain-structure}
7839
+ */
7790
7840
  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
7841
  await this.loadMarkets();
7803
7842
  const currency = this.currency(code);
7804
7843
  const request = {
@@ -7913,25 +7952,25 @@ class gate extends gate$1 {
7913
7952
  'quoteVolume': undefined,
7914
7953
  };
7915
7954
  }
7955
+ /**
7956
+ * @method
7957
+ * @name gate#fetchPositionsHistory
7958
+ * @description fetches historical positions
7959
+ * @see https://www.gate.io/docs/developers/apiv4/#list-position-close-history
7960
+ * @see https://www.gate.io/docs/developers/apiv4/#list-position-close-history-2
7961
+ * @param {string[]} symbols unified conract symbols, must all have the same settle currency and the same market type
7962
+ * @param {int} [since] the earliest time in ms to fetch positions for
7963
+ * @param {int} [limit] the maximum amount of records to fetch, default=1000
7964
+ * @param {object} params extra parameters specific to the exchange api endpoint
7965
+ * @param {int} [params.until] the latest time in ms to fetch positions for
7966
+ *
7967
+ * EXCHANGE SPECIFIC PARAMETERS
7968
+ * @param {int} [params.offset] list offset, starting from 0
7969
+ * @param {string} [params.side] long or short
7970
+ * @param {string} [params.pnl] query profit or loss
7971
+ * @returns {object[]} a list of [position structures]{@link https://docs.ccxt.com/#/?id=position-structure}
7972
+ */
7916
7973
  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
7974
  await this.loadMarkets();
7936
7975
  let market = undefined;
7937
7976
  if (symbols !== undefined) {