ccxt 4.2.31 → 4.2.35

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 (302) hide show
  1. package/.gitattributes +1 -0
  2. package/CONTRIBUTING.md +20 -1
  3. package/README.md +8 -7
  4. package/build.sh +9 -2
  5. package/cleanup.sh +3 -0
  6. package/dist/ccxt.browser.js +741 -501
  7. package/dist/ccxt.browser.min.js +3 -3
  8. package/dist/cjs/ccxt.js +1 -1
  9. package/dist/cjs/src/ace.js +3 -2
  10. package/dist/cjs/src/ascendex.js +1 -1
  11. package/dist/cjs/src/base/Exchange.js +62 -20
  12. package/dist/cjs/src/bigone.js +21 -1
  13. package/dist/cjs/src/binance.js +59 -15
  14. package/dist/cjs/src/bingx.js +4 -3
  15. package/dist/cjs/src/bit2c.js +12 -0
  16. package/dist/cjs/src/bitfinex2.js +12 -1
  17. package/dist/cjs/src/bitget.js +3 -3
  18. package/dist/cjs/src/bitmart.js +1 -1
  19. package/dist/cjs/src/bitrue.js +3 -3
  20. package/dist/cjs/src/blockchaincom.js +1 -1
  21. package/dist/cjs/src/bybit.js +1 -1
  22. package/dist/cjs/src/coinbase.js +2 -2
  23. package/dist/cjs/src/coinex.js +1 -1
  24. package/dist/cjs/src/cryptocom.js +10 -10
  25. package/dist/cjs/src/gate.js +34 -29
  26. package/dist/cjs/src/kraken.js +39 -0
  27. package/dist/cjs/src/krakenfutures.js +25 -3
  28. package/dist/cjs/src/kucoin.js +1 -1
  29. package/dist/cjs/src/mexc.js +2 -1
  30. package/dist/cjs/src/okx.js +4 -3
  31. package/dist/cjs/src/phemex.js +8 -8
  32. package/dist/cjs/src/pro/alpaca.js +8 -4
  33. package/dist/cjs/src/pro/ascendex.js +1 -2
  34. package/dist/cjs/src/pro/binance.js +17 -13
  35. package/dist/cjs/src/pro/bingx.js +1 -1
  36. package/dist/cjs/src/pro/bitfinex.js +21 -24
  37. package/dist/cjs/src/pro/bitfinex2.js +13 -17
  38. package/dist/cjs/src/pro/bitget.js +3 -1
  39. package/dist/cjs/src/pro/bitmart.js +3 -8
  40. package/dist/cjs/src/pro/bitmex.js +4 -7
  41. package/dist/cjs/src/pro/bitopro.js +2 -5
  42. package/dist/cjs/src/pro/bitrue.js +1 -1
  43. package/dist/cjs/src/pro/bitstamp.js +2 -3
  44. package/dist/cjs/src/pro/bitvavo.js +12 -5
  45. package/dist/cjs/src/pro/blockchaincom.js +22 -23
  46. package/dist/cjs/src/pro/bybit.js +5 -5
  47. package/dist/cjs/src/pro/cex.js +7 -7
  48. package/dist/cjs/src/pro/coinbase.js +3 -2
  49. package/dist/cjs/src/pro/coinbasepro.js +1 -1
  50. package/dist/cjs/src/pro/coinex.js +15 -13
  51. package/dist/cjs/src/pro/currencycom.js +5 -7
  52. package/dist/cjs/src/pro/deribit.js +4 -4
  53. package/dist/cjs/src/pro/exmo.js +15 -13
  54. package/dist/cjs/src/pro/gate.js +1 -1
  55. package/dist/cjs/src/pro/gemini.js +4 -2
  56. package/dist/cjs/src/pro/hitbtc.js +9 -8
  57. package/dist/cjs/src/pro/hollaex.js +2 -2
  58. package/dist/cjs/src/pro/htx.js +6 -7
  59. package/dist/cjs/src/pro/huobijp.js +3 -5
  60. package/dist/cjs/src/pro/idex.js +1 -1
  61. package/dist/cjs/src/pro/independentreserve.js +14 -13
  62. package/dist/cjs/src/pro/kraken.js +10 -16
  63. package/dist/cjs/src/pro/krakenfutures.js +10 -6
  64. package/dist/cjs/src/pro/kucoin.js +10 -11
  65. package/dist/cjs/src/pro/kucoinfutures.js +12 -11
  66. package/dist/cjs/src/pro/lbank.js +10 -10
  67. package/dist/cjs/src/pro/luno.js +12 -14
  68. package/dist/cjs/src/pro/mexc.js +3 -2
  69. package/dist/cjs/src/pro/ndax.js +7 -13
  70. package/dist/cjs/src/pro/okcoin.js +7 -12
  71. package/dist/cjs/src/pro/okx.js +6 -11
  72. package/dist/cjs/src/pro/onetrading.js +16 -15
  73. package/dist/cjs/src/pro/p2b.js +5 -3
  74. package/dist/cjs/src/pro/phemex.js +16 -11
  75. package/dist/cjs/src/pro/poloniex.js +6 -4
  76. package/dist/cjs/src/pro/poloniexfutures.js +14 -9
  77. package/dist/cjs/src/pro/probit.js +15 -11
  78. package/dist/cjs/src/pro/upbit.js +8 -8
  79. package/dist/cjs/src/pro/wazirx.js +6 -3
  80. package/dist/cjs/src/pro/woo.js +8 -6
  81. package/dist/cjs/src/probit.js +3 -3
  82. package/dist/cjs/src/tokocrypto.js +2 -2
  83. package/dist/cjs/src/wavesexchange.js +2 -1
  84. package/dist/cjs/src/woo.js +1 -1
  85. package/dist/cjs/src/yobit.js +39 -0
  86. package/js/ccxt.d.ts +1 -1
  87. package/js/ccxt.js +1 -1
  88. package/js/src/ace.d.ts +1 -1
  89. package/js/src/ace.js +3 -2
  90. package/js/src/alpaca.d.ts +1 -1
  91. package/js/src/ascendex.d.ts +5 -15
  92. package/js/src/ascendex.js +1 -1
  93. package/js/src/base/Exchange.d.ts +86 -78
  94. package/js/src/base/Exchange.js +62 -20
  95. package/js/src/base/types.d.ts +90 -6
  96. package/js/src/bigone.d.ts +5 -15
  97. package/js/src/bigone.js +21 -1
  98. package/js/src/binance.d.ts +13 -23
  99. package/js/src/binance.js +59 -15
  100. package/js/src/bingx.d.ts +6 -16
  101. package/js/src/bingx.js +4 -3
  102. package/js/src/bit2c.d.ts +1 -1
  103. package/js/src/bit2c.js +12 -0
  104. package/js/src/bitbank.d.ts +2 -2
  105. package/js/src/bitbns.d.ts +1 -1
  106. package/js/src/bitfinex.d.ts +5 -5
  107. package/js/src/bitfinex2.d.ts +7 -17
  108. package/js/src/bitfinex2.js +12 -1
  109. package/js/src/bitflyer.d.ts +5 -5
  110. package/js/src/bitforex.d.ts +1 -1
  111. package/js/src/bitget.d.ts +8 -38
  112. package/js/src/bitget.js +3 -3
  113. package/js/src/bithumb.d.ts +2 -2
  114. package/js/src/bitmart.d.ts +10 -21
  115. package/js/src/bitmart.js +1 -1
  116. package/js/src/bitmex.d.ts +3 -3
  117. package/js/src/bitopro.d.ts +2 -2
  118. package/js/src/bitrue.d.ts +5 -15
  119. package/js/src/bitrue.js +3 -3
  120. package/js/src/bitso.d.ts +4 -4
  121. package/js/src/bitstamp.d.ts +2 -2
  122. package/js/src/bitteam.d.ts +1 -1
  123. package/js/src/bitvavo.d.ts +3 -3
  124. package/js/src/bl3p.d.ts +1 -1
  125. package/js/src/blockchaincom.d.ts +2 -2
  126. package/js/src/blockchaincom.js +1 -1
  127. package/js/src/btcalpha.d.ts +1 -1
  128. package/js/src/btcbox.d.ts +1 -1
  129. package/js/src/btcmarkets.d.ts +3 -3
  130. package/js/src/btcturk.d.ts +1 -1
  131. package/js/src/bybit.d.ts +8 -8
  132. package/js/src/bybit.js +1 -1
  133. package/js/src/cex.d.ts +1 -1
  134. package/js/src/coinbase.d.ts +6 -50
  135. package/js/src/coinbase.js +2 -2
  136. package/js/src/coinbasepro.d.ts +2 -2
  137. package/js/src/coincheck.d.ts +1 -1
  138. package/js/src/coinex.d.ts +8 -8
  139. package/js/src/coinex.js +1 -1
  140. package/js/src/coinlist.d.ts +4 -14
  141. package/js/src/coinmate.d.ts +2 -2
  142. package/js/src/coinmetro.d.ts +2 -2
  143. package/js/src/coinone.d.ts +1 -1
  144. package/js/src/coinsph.d.ts +2 -2
  145. package/js/src/coinspot.d.ts +1 -1
  146. package/js/src/cryptocom.d.ts +4 -4
  147. package/js/src/cryptocom.js +10 -10
  148. package/js/src/currencycom.d.ts +2 -2
  149. package/js/src/delta.d.ts +2 -2
  150. package/js/src/deribit.d.ts +4 -14
  151. package/js/src/digifinex.d.ts +10 -38
  152. package/js/src/exmo.d.ts +2 -2
  153. package/js/src/gate.d.ts +8 -18
  154. package/js/src/gate.js +34 -29
  155. package/js/src/gemini.d.ts +2 -2
  156. package/js/src/hitbtc.d.ts +6 -16
  157. package/js/src/hollaex.d.ts +2 -2
  158. package/js/src/htx.d.ts +11 -21
  159. package/js/src/huobijp.d.ts +4 -4
  160. package/js/src/idex.d.ts +3 -3
  161. package/js/src/independentreserve.d.ts +2 -2
  162. package/js/src/indodax.d.ts +2 -2
  163. package/js/src/kraken.d.ts +5 -5
  164. package/js/src/kraken.js +39 -0
  165. package/js/src/krakenfutures.d.ts +7 -7
  166. package/js/src/krakenfutures.js +25 -3
  167. package/js/src/kucoin.d.ts +8 -29
  168. package/js/src/kucoin.js +1 -1
  169. package/js/src/kucoinfutures.d.ts +4 -4
  170. package/js/src/kuna.d.ts +2 -2
  171. package/js/src/latoken.d.ts +4 -14
  172. package/js/src/lbank.d.ts +2 -5
  173. package/js/src/luno.d.ts +1 -1
  174. package/js/src/lykke.d.ts +2 -2
  175. package/js/src/mercado.d.ts +2 -2
  176. package/js/src/mexc.d.ts +6 -6
  177. package/js/src/mexc.js +2 -1
  178. package/js/src/ndax.d.ts +2 -2
  179. package/js/src/novadax.d.ts +4 -15
  180. package/js/src/oceanex.d.ts +1 -1
  181. package/js/src/okcoin.d.ts +5 -15
  182. package/js/src/okx.d.ts +8 -18
  183. package/js/src/okx.js +4 -3
  184. package/js/src/onetrading.d.ts +2 -2
  185. package/js/src/p2b.d.ts +1 -1
  186. package/js/src/paymium.d.ts +3 -13
  187. package/js/src/phemex.d.ts +5 -5
  188. package/js/src/phemex.js +8 -8
  189. package/js/src/poloniex.d.ts +4 -14
  190. package/js/src/poloniexfutures.d.ts +1 -1
  191. package/js/src/pro/alpaca.d.ts +2 -2
  192. package/js/src/pro/alpaca.js +8 -4
  193. package/js/src/pro/ascendex.d.ts +2 -2
  194. package/js/src/pro/ascendex.js +1 -2
  195. package/js/src/pro/binance.d.ts +3 -3
  196. package/js/src/pro/binance.js +17 -13
  197. package/js/src/pro/bingx.d.ts +1 -1
  198. package/js/src/pro/bingx.js +1 -1
  199. package/js/src/pro/bitfinex.d.ts +2 -2
  200. package/js/src/pro/bitfinex.js +21 -24
  201. package/js/src/pro/bitfinex2.d.ts +2 -2
  202. package/js/src/pro/bitfinex2.js +13 -17
  203. package/js/src/pro/bitget.js +3 -1
  204. package/js/src/pro/bitmart.d.ts +3 -3
  205. package/js/src/pro/bitmart.js +3 -8
  206. package/js/src/pro/bitmex.d.ts +1 -1
  207. package/js/src/pro/bitmex.js +4 -7
  208. package/js/src/pro/bitopro.d.ts +1 -1
  209. package/js/src/pro/bitopro.js +2 -5
  210. package/js/src/pro/bitrue.js +1 -1
  211. package/js/src/pro/bitstamp.d.ts +1 -1
  212. package/js/src/pro/bitstamp.js +2 -3
  213. package/js/src/pro/bitvavo.d.ts +3 -3
  214. package/js/src/pro/bitvavo.js +12 -5
  215. package/js/src/pro/blockchaincom.d.ts +8 -8
  216. package/js/src/pro/blockchaincom.js +22 -23
  217. package/js/src/pro/bybit.d.ts +2 -2
  218. package/js/src/pro/bybit.js +5 -5
  219. package/js/src/pro/cex.d.ts +1 -1
  220. package/js/src/pro/cex.js +7 -7
  221. package/js/src/pro/coinbase.d.ts +1 -1
  222. package/js/src/pro/coinbase.js +3 -2
  223. package/js/src/pro/coinbasepro.d.ts +1 -1
  224. package/js/src/pro/coinbasepro.js +1 -1
  225. package/js/src/pro/coinex.d.ts +2 -2
  226. package/js/src/pro/coinex.js +15 -13
  227. package/js/src/pro/currencycom.d.ts +1 -1
  228. package/js/src/pro/currencycom.js +5 -7
  229. package/js/src/pro/deribit.d.ts +2 -2
  230. package/js/src/pro/deribit.js +4 -4
  231. package/js/src/pro/exmo.d.ts +2 -2
  232. package/js/src/pro/exmo.js +15 -13
  233. package/js/src/pro/gate.js +1 -1
  234. package/js/src/pro/gemini.d.ts +1 -1
  235. package/js/src/pro/gemini.js +4 -2
  236. package/js/src/pro/hitbtc.d.ts +2 -2
  237. package/js/src/pro/hitbtc.js +9 -8
  238. package/js/src/pro/hollaex.d.ts +2 -2
  239. package/js/src/pro/hollaex.js +2 -2
  240. package/js/src/pro/htx.d.ts +2 -2
  241. package/js/src/pro/htx.js +6 -7
  242. package/js/src/pro/huobijp.d.ts +1 -1
  243. package/js/src/pro/huobijp.js +3 -5
  244. package/js/src/pro/idex.js +1 -1
  245. package/js/src/pro/independentreserve.d.ts +1 -1
  246. package/js/src/pro/independentreserve.js +14 -13
  247. package/js/src/pro/kraken.d.ts +2 -2
  248. package/js/src/pro/kraken.js +10 -16
  249. package/js/src/pro/krakenfutures.d.ts +1 -1
  250. package/js/src/pro/krakenfutures.js +10 -6
  251. package/js/src/pro/kucoin.d.ts +3 -3
  252. package/js/src/pro/kucoin.js +10 -11
  253. package/js/src/pro/kucoinfutures.d.ts +3 -3
  254. package/js/src/pro/kucoinfutures.js +12 -11
  255. package/js/src/pro/lbank.d.ts +1 -1
  256. package/js/src/pro/lbank.js +10 -10
  257. package/js/src/pro/luno.d.ts +2 -2
  258. package/js/src/pro/luno.js +12 -14
  259. package/js/src/pro/mexc.d.ts +2 -2
  260. package/js/src/pro/mexc.js +3 -2
  261. package/js/src/pro/ndax.d.ts +3 -3
  262. package/js/src/pro/ndax.js +7 -13
  263. package/js/src/pro/okcoin.d.ts +1 -1
  264. package/js/src/pro/okcoin.js +7 -12
  265. package/js/src/pro/okx.d.ts +1 -1
  266. package/js/src/pro/okx.js +6 -11
  267. package/js/src/pro/onetrading.d.ts +1 -1
  268. package/js/src/pro/onetrading.js +16 -15
  269. package/js/src/pro/p2b.d.ts +1 -1
  270. package/js/src/pro/p2b.js +5 -3
  271. package/js/src/pro/phemex.d.ts +3 -3
  272. package/js/src/pro/phemex.js +16 -11
  273. package/js/src/pro/poloniex.d.ts +1 -1
  274. package/js/src/pro/poloniex.js +6 -4
  275. package/js/src/pro/poloniexfutures.d.ts +4 -4
  276. package/js/src/pro/poloniexfutures.js +13 -10
  277. package/js/src/pro/probit.d.ts +1 -1
  278. package/js/src/pro/probit.js +14 -12
  279. package/js/src/pro/upbit.js +8 -8
  280. package/js/src/pro/wazirx.d.ts +1 -1
  281. package/js/src/pro/wazirx.js +6 -3
  282. package/js/src/pro/woo.d.ts +3 -3
  283. package/js/src/pro/woo.js +8 -6
  284. package/js/src/probit.d.ts +3 -3
  285. package/js/src/probit.js +3 -3
  286. package/js/src/timex.d.ts +1 -1
  287. package/js/src/tokocrypto.d.ts +3 -3
  288. package/js/src/tokocrypto.js +2 -2
  289. package/js/src/upbit.d.ts +2 -2
  290. package/js/src/wavesexchange.d.ts +3 -4
  291. package/js/src/wavesexchange.js +2 -1
  292. package/js/src/wazirx.d.ts +1 -1
  293. package/js/src/whitebit.d.ts +5 -15
  294. package/js/src/woo.d.ts +5 -15
  295. package/js/src/woo.js +1 -1
  296. package/js/src/yobit.d.ts +21 -6
  297. package/js/src/yobit.js +39 -0
  298. package/js/src/zaif.d.ts +2 -2
  299. package/js/src/zonda.d.ts +4 -14
  300. package/package.json +22 -8
  301. package/skip-tests.json +9 -1
  302. package/tests-manager.sh +1 -2
@@ -208,6 +208,7 @@ class bit2c extends bit2c$1 {
208
208
  * @method
209
209
  * @name bit2c#fetchBalance
210
210
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
211
+ * @see https://bit2c.co.il/home/api#balance
211
212
  * @param {object} [params] extra parameters specific to the exchange API endpoint
212
213
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
213
214
  */
@@ -262,6 +263,7 @@ class bit2c extends bit2c$1 {
262
263
  * @method
263
264
  * @name bit2c#fetchOrderBook
264
265
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
266
+ * @see https://bit2c.co.il/home/api#orderb
265
267
  * @param {string} symbol unified symbol of the market to fetch the order book for
266
268
  * @param {int} [limit] the maximum amount of order book entries to return
267
269
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -308,6 +310,7 @@ class bit2c extends bit2c$1 {
308
310
  * @method
309
311
  * @name bit2c#fetchTicker
310
312
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
313
+ * @see https://bit2c.co.il/home/api#ticker
311
314
  * @param {string} symbol unified symbol of the market to fetch the ticker for
312
315
  * @param {object} [params] extra parameters specific to the exchange API endpoint
313
316
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -325,6 +328,8 @@ class bit2c extends bit2c$1 {
325
328
  * @method
326
329
  * @name bit2c#fetchTrades
327
330
  * @description get the list of most recent trades for a particular symbol
331
+ * @see https://bit2c.co.il/home/api#transactions
332
+ * @see https://bit2c.co.il/home/api#trades
328
333
  * @param {string} symbol unified symbol of the market to fetch trades for
329
334
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
330
335
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -367,6 +372,7 @@ class bit2c extends bit2c$1 {
367
372
  * @method
368
373
  * @name bit2c#fetchTradingFees
369
374
  * @description fetch the trading fees for multiple markets
375
+ * @see https://bit2c.co.il/home/api#balance
370
376
  * @param {object} [params] extra parameters specific to the exchange API endpoint
371
377
  * @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
372
378
  */
@@ -415,6 +421,7 @@ class bit2c extends bit2c$1 {
415
421
  * @method
416
422
  * @name bit2c#createOrder
417
423
  * @description create a trade order
424
+ * @see https://bit2c.co.il/home/api#addo
418
425
  * @param {string} symbol unified symbol of the market to create an order in
419
426
  * @param {string} type 'market' or 'limit'
420
427
  * @param {string} side 'buy' or 'sell'
@@ -448,6 +455,7 @@ class bit2c extends bit2c$1 {
448
455
  * @method
449
456
  * @name bit2c#cancelOrder
450
457
  * @description cancels an open order
458
+ * @see https://bit2c.co.il/home/api#cancelo
451
459
  * @param {string} id order id
452
460
  * @param {string} symbol Not used by bit2c cancelOrder ()
453
461
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -463,6 +471,7 @@ class bit2c extends bit2c$1 {
463
471
  * @method
464
472
  * @name bit2c#fetchOpenOrders
465
473
  * @description fetch all unfilled currently open orders
474
+ * @see https://bit2c.co.il/home/api#geto
466
475
  * @param {string} symbol unified market symbol
467
476
  * @param {int} [since] the earliest time in ms to fetch open orders for
468
477
  * @param {int} [limit] the maximum number of open order structures to retrieve
@@ -488,6 +497,7 @@ class bit2c extends bit2c$1 {
488
497
  * @method
489
498
  * @name bit2c#fetchOrder
490
499
  * @description fetches information on an order made by the user
500
+ * @see https://bit2c.co.il/home/api#getoid
491
501
  * @param {string} symbol unified market symbol
492
502
  * @param {object} [params] extra parameters specific to the exchange API endpoint
493
503
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -640,6 +650,7 @@ class bit2c extends bit2c$1 {
640
650
  * @method
641
651
  * @name bit2c#fetchMyTrades
642
652
  * @description fetch all trades made by the user
653
+ * @see https://bit2c.co.il/home/api#orderh
643
654
  * @param {string} symbol unified market symbol
644
655
  * @param {int} [since] the earliest time in ms to fetch trades for
645
656
  * @param {int} [limit] the maximum number of trades structures to retrieve
@@ -820,6 +831,7 @@ class bit2c extends bit2c$1 {
820
831
  * @method
821
832
  * @name bit2c#fetchDepositAddress
822
833
  * @description fetch the deposit address for a currency associated with this account
834
+ * @see https://bit2c.co.il/home/api#addc
823
835
  * @param {string} code unified currency code
824
836
  * @param {object} [params] extra parameters specific to the exchange API endpoint
825
837
  * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
@@ -25,11 +25,13 @@ class bitfinex2 extends bitfinex2$1 {
25
25
  'has': {
26
26
  'CORS': undefined,
27
27
  'spot': true,
28
- 'margin': undefined,
28
+ 'margin': true,
29
29
  'swap': true,
30
30
  'future': undefined,
31
31
  'option': undefined,
32
32
  'addMargin': false,
33
+ 'borrowCrossMargin': false,
34
+ 'borrowIsolatedMargin': false,
33
35
  'cancelAllOrders': true,
34
36
  'cancelOrder': true,
35
37
  'cancelOrders': true,
@@ -46,8 +48,13 @@ class bitfinex2 extends bitfinex2$1 {
46
48
  'createTriggerOrder': true,
47
49
  'editOrder': true,
48
50
  'fetchBalance': true,
51
+ 'fetchBorrowInterest': false,
52
+ 'fetchBorrowRateHistories': false,
53
+ 'fetchBorrowRateHistory': false,
49
54
  'fetchClosedOrder': true,
50
55
  'fetchClosedOrders': true,
56
+ 'fetchCrossBorrowRate': false,
57
+ 'fetchCrossBorrowRates': false,
51
58
  'fetchCurrencies': true,
52
59
  'fetchDepositAddress': true,
53
60
  'fetchDepositsWithdrawals': true,
@@ -56,6 +63,8 @@ class bitfinex2 extends bitfinex2$1 {
56
63
  'fetchFundingRateHistory': true,
57
64
  'fetchFundingRates': true,
58
65
  'fetchIndexOHLCV': false,
66
+ 'fetchIsolatedBorrowRate': false,
67
+ 'fetchIsolatedBorrowRates': false,
59
68
  'fetchLedger': true,
60
69
  'fetchLeverage': false,
61
70
  'fetchLeverageTiers': false,
@@ -83,6 +92,8 @@ class bitfinex2 extends bitfinex2$1 {
83
92
  'fetchTransactionFees': undefined,
84
93
  'fetchTransactions': 'emulated',
85
94
  'reduceMargin': false,
95
+ 'repayCrossMargin': false,
96
+ 'repayIsolatedMargin': false,
86
97
  'setLeverage': false,
87
98
  'setMargin': true,
88
99
  'setMarginMode': false,
@@ -4135,7 +4135,7 @@ class bitget extends bitget$1 {
4135
4135
  const isTakeProfit = takeProfit !== undefined;
4136
4136
  const isStopLossOrTakeProfitTrigger = isStopLossTriggerOrder || isTakeProfitTriggerOrder;
4137
4137
  const isStopLossOrTakeProfit = isStopLoss || isTakeProfit;
4138
- const trailingTriggerPrice = this.safeString(params, 'trailingTriggerPrice', price);
4138
+ const trailingTriggerPrice = this.safeString(params, 'trailingTriggerPrice', this.numberToString(price));
4139
4139
  const trailingPercent = this.safeString2(params, 'trailingPercent', 'callbackRatio');
4140
4140
  const isTrailingPercentOrder = trailingPercent !== undefined;
4141
4141
  if (this.sum(isTriggerOrder, isStopLossTriggerOrder, isTakeProfitTriggerOrder, isTrailingPercentOrder) > 1) {
@@ -6958,7 +6958,7 @@ class bitget extends bitget$1 {
6958
6958
  * @name bitget#setLeverage
6959
6959
  * @description set the level of leverage for a market
6960
6960
  * @see https://www.bitget.com/api-doc/contract/account/Change-Leverage
6961
- * @param {float} leverage the rate of leverage
6961
+ * @param {int} leverage the rate of leverage
6962
6962
  * @param {string} symbol unified market symbol
6963
6963
  * @param {object} [params] extra parameters specific to the exchange API endpoint
6964
6964
  * @param {string} [params.holdSide] *isolated only* position direction, 'long' or 'short'
@@ -6982,7 +6982,7 @@ class bitget extends bitget$1 {
6982
6982
  const request = {
6983
6983
  'symbol': market['id'],
6984
6984
  'marginCoin': market['settleId'],
6985
- 'leverage': leverage,
6985
+ 'leverage': this.numberToString(leverage),
6986
6986
  'productType': productType,
6987
6987
  // 'holdSide': 'long',
6988
6988
  };
@@ -2416,7 +2416,7 @@ class bitmart extends bitmart$1 {
2416
2416
  }
2417
2417
  const triggerPrice = this.safeStringN(params, ['triggerPrice', 'stopPrice', 'trigger_price']);
2418
2418
  const isTriggerOrder = triggerPrice !== undefined;
2419
- const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activation_price', price);
2419
+ const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activation_price', this.numberToString(price));
2420
2420
  const trailingPercent = this.safeString2(params, 'trailingPercent', 'callback_rate');
2421
2421
  const isTrailingPercentOrder = trailingPercent !== undefined;
2422
2422
  if (isLimitOrder) {
@@ -1973,9 +1973,9 @@ class bitrue extends bitrue$1 {
1973
1973
  const amountString = this.numberToString(amount);
1974
1974
  const priceString = this.numberToString(price);
1975
1975
  const quoteAmount = Precise["default"].stringMul(amountString, priceString);
1976
- amount = (cost !== undefined) ? cost : quoteAmount;
1977
- request['amount'] = this.costToPrecision(symbol, amount);
1978
- request['volume'] = this.costToPrecision(symbol, amount);
1976
+ const requestAmount = (cost !== undefined) ? cost : quoteAmount;
1977
+ request['amount'] = this.costToPrecision(symbol, requestAmount);
1978
+ request['volume'] = this.costToPrecision(symbol, requestAmount);
1979
1979
  }
1980
1980
  }
1981
1981
  else {
@@ -525,7 +525,7 @@ class blockchaincom extends blockchaincom$1 {
525
525
  'remaining': remaining,
526
526
  'cost': undefined,
527
527
  'trades': [],
528
- 'fees': {},
528
+ 'fees': [],
529
529
  'info': order,
530
530
  });
531
531
  return result;
@@ -3692,7 +3692,7 @@ class bybit extends bybit$1 {
3692
3692
  const takeProfitTriggerPrice = this.safeValue(params, 'takeProfitPrice');
3693
3693
  const stopLoss = this.safeValue(params, 'stopLoss');
3694
3694
  const takeProfit = this.safeValue(params, 'takeProfit');
3695
- const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activePrice', price);
3695
+ const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activePrice', this.numberToString(price));
3696
3696
  const trailingAmount = this.safeString2(params, 'trailingAmount', 'trailingStop');
3697
3697
  const isTrailingAmountOrder = trailingAmount !== undefined;
3698
3698
  const isStopLossTriggerOrder = stopLossTriggerPrice !== undefined;
@@ -1622,7 +1622,7 @@ class coinbase extends coinbase$1 {
1622
1622
  'info': ticker,
1623
1623
  }, market);
1624
1624
  }
1625
- parseBalance(response, params = {}) {
1625
+ parseCustomBalance(response, params = {}) {
1626
1626
  const balances = this.safeValue2(response, 'data', 'accounts', []);
1627
1627
  const accounts = this.safeValue(params, 'type', this.options['accounts']);
1628
1628
  const v3Accounts = this.safeValue(params, 'type', this.options['v3Accounts']);
@@ -1773,7 +1773,7 @@ class coinbase extends coinbase$1 {
1773
1773
  // "size": 9
1774
1774
  // }
1775
1775
  //
1776
- return this.parseBalance(response, params);
1776
+ return this.parseCustomBalance(response, params);
1777
1777
  }
1778
1778
  async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
1779
1779
  /**
@@ -4370,7 +4370,7 @@ class coinex extends coinex$1 {
4370
4370
  const request = {
4371
4371
  'coin_type': currency['id'],
4372
4372
  'coin_address': address,
4373
- 'actual_amount': parseFloat(amount),
4373
+ 'actual_amount': parseFloat(this.numberToString(amount)),
4374
4374
  'transfer_method': 'onchain', // onchain, local
4375
4375
  };
4376
4376
  if (networkCode !== undefined) {
@@ -1067,10 +1067,10 @@ class cryptocom extends cryptocom$1 {
1067
1067
  const isTakeProfitTrigger = (takeProfitPrice !== undefined);
1068
1068
  if (isTrigger) {
1069
1069
  request['ref_price'] = this.priceToPrecision(symbol, triggerPrice);
1070
- price = price.toString();
1070
+ const priceString = this.numberToString(price);
1071
1071
  if ((uppercaseType === 'LIMIT') || (uppercaseType === 'STOP_LIMIT') || (uppercaseType === 'TAKE_PROFIT_LIMIT')) {
1072
1072
  if (side === 'buy') {
1073
- if (Precise["default"].stringLt(price, triggerPrice)) {
1073
+ if (Precise["default"].stringLt(priceString, triggerPrice)) {
1074
1074
  request['type'] = 'TAKE_PROFIT_LIMIT';
1075
1075
  }
1076
1076
  else {
@@ -1078,7 +1078,7 @@ class cryptocom extends cryptocom$1 {
1078
1078
  }
1079
1079
  }
1080
1080
  else {
1081
- if (Precise["default"].stringLt(price, triggerPrice)) {
1081
+ if (Precise["default"].stringLt(priceString, triggerPrice)) {
1082
1082
  request['type'] = 'STOP_LIMIT';
1083
1083
  }
1084
1084
  else {
@@ -1088,7 +1088,7 @@ class cryptocom extends cryptocom$1 {
1088
1088
  }
1089
1089
  else {
1090
1090
  if (side === 'buy') {
1091
- if (Precise["default"].stringLt(price, triggerPrice)) {
1091
+ if (Precise["default"].stringLt(priceString, triggerPrice)) {
1092
1092
  request['type'] = 'TAKE_PROFIT';
1093
1093
  }
1094
1094
  else {
@@ -1096,7 +1096,7 @@ class cryptocom extends cryptocom$1 {
1096
1096
  }
1097
1097
  }
1098
1098
  else {
1099
- if (Precise["default"].stringLt(price, triggerPrice)) {
1099
+ if (Precise["default"].stringLt(priceString, triggerPrice)) {
1100
1100
  request['type'] = 'STOP_LOSS';
1101
1101
  }
1102
1102
  else {
@@ -1287,10 +1287,10 @@ class cryptocom extends cryptocom$1 {
1287
1287
  const isStopLossTrigger = (stopLossPrice !== undefined);
1288
1288
  const isTakeProfitTrigger = (takeProfitPrice !== undefined);
1289
1289
  if (isTrigger) {
1290
- price = price.toString();
1290
+ const priceString = this.numberToString(price);
1291
1291
  if ((uppercaseType === 'LIMIT') || (uppercaseType === 'STOP_LIMIT') || (uppercaseType === 'TAKE_PROFIT_LIMIT')) {
1292
1292
  if (side === 'buy') {
1293
- if (Precise["default"].stringLt(price, triggerPrice)) {
1293
+ if (Precise["default"].stringLt(priceString, triggerPrice)) {
1294
1294
  request['type'] = 'TAKE_PROFIT_LIMIT';
1295
1295
  }
1296
1296
  else {
@@ -1298,7 +1298,7 @@ class cryptocom extends cryptocom$1 {
1298
1298
  }
1299
1299
  }
1300
1300
  else {
1301
- if (Precise["default"].stringLt(price, triggerPrice)) {
1301
+ if (Precise["default"].stringLt(priceString, triggerPrice)) {
1302
1302
  request['type'] = 'STOP_LIMIT';
1303
1303
  }
1304
1304
  else {
@@ -1308,7 +1308,7 @@ class cryptocom extends cryptocom$1 {
1308
1308
  }
1309
1309
  else {
1310
1310
  if (side === 'buy') {
1311
- if (Precise["default"].stringLt(price, triggerPrice)) {
1311
+ if (Precise["default"].stringLt(priceString, triggerPrice)) {
1312
1312
  request['type'] = 'TAKE_PROFIT';
1313
1313
  }
1314
1314
  else {
@@ -1316,7 +1316,7 @@ class cryptocom extends cryptocom$1 {
1316
1316
  }
1317
1317
  }
1318
1318
  else {
1319
- if (Precise["default"].stringLt(price, triggerPrice)) {
1319
+ if (Precise["default"].stringLt(priceString, triggerPrice)) {
1320
1320
  request['type'] = 'STOP_LOSS';
1321
1321
  }
1322
1322
  else {
@@ -1618,32 +1618,34 @@ class gate extends gate$1 {
1618
1618
  let withdrawAvailable = this.safeValue(result[code], 'withdraw');
1619
1619
  withdrawAvailable = (withdrawEnabled) ? withdrawEnabled : withdrawAvailable;
1620
1620
  const networks = this.safeValue(result[code], 'networks', {});
1621
- networks[networkCode] = {
1622
- 'info': entry,
1623
- 'id': networkId,
1624
- 'network': networkCode,
1625
- 'currencyId': currencyId,
1626
- 'lowerCaseCurrencyId': currencyIdLower,
1627
- 'deposit': depositEnabled,
1628
- 'withdraw': withdrawEnabled,
1629
- 'active': active,
1630
- 'fee': undefined,
1631
- 'precision': this.parseNumber('1e-4'),
1632
- 'limits': {
1633
- 'amount': {
1634
- 'min': undefined,
1635
- 'max': undefined,
1636
- },
1637
- 'withdraw': {
1638
- 'min': undefined,
1639
- 'max': undefined,
1640
- },
1641
- 'deposit': {
1642
- 'min': undefined,
1643
- 'max': undefined,
1621
+ if (networkCode !== undefined) {
1622
+ networks[networkCode] = {
1623
+ 'info': entry,
1624
+ 'id': networkId,
1625
+ 'network': networkCode,
1626
+ 'currencyId': currencyId,
1627
+ 'lowerCaseCurrencyId': currencyIdLower,
1628
+ 'deposit': depositEnabled,
1629
+ 'withdraw': withdrawEnabled,
1630
+ 'active': active,
1631
+ 'fee': undefined,
1632
+ 'precision': this.parseNumber('1e-4'),
1633
+ 'limits': {
1634
+ 'amount': {
1635
+ 'min': undefined,
1636
+ 'max': undefined,
1637
+ },
1638
+ 'withdraw': {
1639
+ 'min': undefined,
1640
+ 'max': undefined,
1641
+ },
1642
+ 'deposit': {
1643
+ 'min': undefined,
1644
+ 'max': undefined,
1645
+ },
1644
1646
  },
1645
- },
1646
- };
1647
+ };
1648
+ }
1647
1649
  result[code]['networks'] = networks;
1648
1650
  const info = this.safeValue(result[code], 'info', []);
1649
1651
  info.push(entry);
@@ -2599,6 +2601,7 @@ class gate extends gate$1 {
2599
2601
  const [type, query] = this.handleMarketTypeAndParams('fetchTickers', market, params);
2600
2602
  const [request, requestParams] = this.prepareRequest(undefined, type, query);
2601
2603
  let response = undefined;
2604
+ request['timezone'] = 'utc0'; // default to utc
2602
2605
  if (type === 'spot' || type === 'margin') {
2603
2606
  response = await this.publicSpotGetTickers(this.extend(request, requestParams));
2604
2607
  }
@@ -2616,7 +2619,7 @@ class gate extends gate$1 {
2616
2619
  response = await this.publicOptionsGetTickers(this.extend(request, requestParams));
2617
2620
  }
2618
2621
  else {
2619
- throw new errors.NotSupported(this.id + ' fetchTickers() not support this market type');
2622
+ throw new errors.NotSupported(this.id + ' fetchTickers() not support this market type, provide symbols or set params["defaultType"] to one from spot/margin/swap/future/option');
2620
2623
  }
2621
2624
  return this.parseTickers(response, symbols);
2622
2625
  }
@@ -5187,16 +5190,17 @@ class gate extends gate$1 {
5187
5190
  const defaultMarginMode = this.safeString2(this.options, 'marginMode', 'defaultMarginMode');
5188
5191
  const crossLeverageLimit = this.safeString(query, 'cross_leverage_limit');
5189
5192
  let marginMode = this.safeString(query, 'marginMode', defaultMarginMode);
5193
+ let stringifiedMargin = this.numberToString(leverage);
5190
5194
  if (crossLeverageLimit !== undefined) {
5191
5195
  marginMode = 'cross';
5192
- leverage = crossLeverageLimit;
5196
+ stringifiedMargin = crossLeverageLimit;
5193
5197
  }
5194
5198
  if (marginMode === 'cross' || marginMode === 'cross_margin') {
5195
- request['cross_leverage_limit'] = leverage.toString();
5199
+ request['cross_leverage_limit'] = stringifiedMargin;
5196
5200
  request['leverage'] = '0';
5197
5201
  }
5198
5202
  else {
5199
- request['leverage'] = leverage.toString();
5203
+ request['leverage'] = stringifiedMargin;
5200
5204
  }
5201
5205
  let response = undefined;
5202
5206
  if (market['swap']) {
@@ -6931,6 +6935,7 @@ class gate extends gate$1 {
6931
6935
  return this.parseGreeks(entry, market);
6932
6936
  }
6933
6937
  }
6938
+ return undefined;
6934
6939
  }
6935
6940
  parseGreeks(greeks, market = undefined) {
6936
6941
  //
@@ -1509,6 +1509,41 @@ class kraken extends kraken$1 {
1509
1509
  // "txid": "OTI672-HJFAO-XOIPPK"
1510
1510
  // }
1511
1511
  //
1512
+ // {
1513
+ // "error": [],
1514
+ // "result": {
1515
+ // "open": {
1516
+ // "OXVPSU-Q726F-L3SDEP": {
1517
+ // "refid": null,
1518
+ // "userref": 0,
1519
+ // "status": "open",
1520
+ // "opentm": 1706893367.4656649,
1521
+ // "starttm": 0,
1522
+ // "expiretm": 0,
1523
+ // "descr": {
1524
+ // "pair": "XRPEUR",
1525
+ // "type": "sell",
1526
+ // "ordertype": "trailing-stop",
1527
+ // "price": "+50.0000%",
1528
+ // "price2": "0",
1529
+ // "leverage": "none",
1530
+ // "order": "sell 10.00000000 XRPEUR @ trailing stop +50.0000%",
1531
+ // "close": ""
1532
+ // },
1533
+ // "vol": "10.00000000",
1534
+ // "vol_exec": "0.00000000",
1535
+ // "cost": "0.00000000",
1536
+ // "fee": "0.00000000",
1537
+ // "price": "0.00000000",
1538
+ // "stopprice": "0.23424000",
1539
+ // "limitprice": "0.46847000",
1540
+ // "misc": "",
1541
+ // "oflags": "fciq",
1542
+ // "trigger": "index"
1543
+ // }
1544
+ // }
1545
+ // }
1546
+ //
1512
1547
  const description = this.safeValue(order, 'descr', {});
1513
1548
  const orderDescription = this.safeString(description, 'order', description);
1514
1549
  let side = undefined;
@@ -1550,6 +1585,10 @@ class kraken extends kraken$1 {
1550
1585
  // kraken truncates the cost in the api response so we will ignore it and calculate it from average & filled
1551
1586
  // const cost = this.safeString (order, 'cost');
1552
1587
  price = this.safeString(description, 'price', price);
1588
+ // when type = trailling stop returns price = '+50.0000%'
1589
+ if ((price !== undefined) && price.endsWith('%')) {
1590
+ price = undefined; // this is not the price we want
1591
+ }
1553
1592
  if ((price === undefined) || Precise["default"].stringEquals(price, '0')) {
1554
1593
  price = this.safeString(description, 'price2');
1555
1594
  }
@@ -151,10 +151,32 @@ class krakenfutures extends krakenfutures$1 {
151
151
  },
152
152
  'fees': {
153
153
  'trading': {
154
- 'tierBased': false,
154
+ 'tierBased': true,
155
155
  'percentage': true,
156
- 'maker': this.parseNumber('-0.0002'),
157
- 'taker': this.parseNumber('0.00075'),
156
+ 'taker': this.parseNumber('0.0005'),
157
+ 'maker': this.parseNumber('0.0002'),
158
+ 'tiers': {
159
+ 'taker': [
160
+ [this.parseNumber('0'), this.parseNumber('0.0005')],
161
+ [this.parseNumber('100000'), this.parseNumber('0.0004')],
162
+ [this.parseNumber('1000000'), this.parseNumber('0.0003')],
163
+ [this.parseNumber('5000000'), this.parseNumber('0.00025')],
164
+ [this.parseNumber('10000000'), this.parseNumber('0.0002')],
165
+ [this.parseNumber('20000000'), this.parseNumber('0.00015')],
166
+ [this.parseNumber('50000000'), this.parseNumber('0.000125')],
167
+ [this.parseNumber('100000000'), this.parseNumber('0.0001')],
168
+ ],
169
+ 'maker': [
170
+ [this.parseNumber('0'), this.parseNumber('0.0002')],
171
+ [this.parseNumber('100000'), this.parseNumber('0.0015')],
172
+ [this.parseNumber('1000000'), this.parseNumber('0.000125')],
173
+ [this.parseNumber('5000000'), this.parseNumber('0.0001')],
174
+ [this.parseNumber('10000000'), this.parseNumber('0.000075')],
175
+ [this.parseNumber('20000000'), this.parseNumber('0.00005')],
176
+ [this.parseNumber('50000000'), this.parseNumber('0.000025')],
177
+ [this.parseNumber('100000000'), this.parseNumber('0')],
178
+ ],
179
+ },
158
180
  },
159
181
  },
160
182
  'exceptions': {
@@ -4422,7 +4422,7 @@ class kucoin extends kucoin$1 {
4422
4422
  let endpart = '';
4423
4423
  headers = (headers !== undefined) ? headers : {};
4424
4424
  let url = this.urls['api'][api];
4425
- if (Object.keys(query).length) {
4425
+ if (!this.isEmpty(query)) {
4426
4426
  if ((method === 'GET') || (method === 'DELETE')) {
4427
4427
  endpoint += '?' + this.rawencode(query);
4428
4428
  }
@@ -1355,7 +1355,8 @@ class mexc extends mexc$1 {
1355
1355
  }
1356
1356
  return orderbook;
1357
1357
  }
1358
- parseBidAsk(bidask, priceKey = 0, amountKey = 1, countKey = 2) {
1358
+ parseBidAsk(bidask, priceKey = 0, amountKey = 1, countOrIdKey = 2) {
1359
+ const countKey = 2;
1359
1360
  const price = this.safeNumber(bidask, priceKey);
1360
1361
  const amount = this.safeNumber(bidask, amountKey);
1361
1362
  const count = this.safeNumber(bidask, countKey);
@@ -1521,8 +1521,8 @@ class okx extends okx$1 {
1521
1521
  // "msg": ""
1522
1522
  // }
1523
1523
  //
1524
- const data = this.safeValue(response, 'data', []);
1525
- return this.parseMarkets(data);
1524
+ const dataResponse = this.safeValue(response, 'data', []);
1525
+ return this.parseMarkets(dataResponse);
1526
1526
  }
1527
1527
  safeNetwork(networkId) {
1528
1528
  const networksById = {
@@ -3149,7 +3149,7 @@ class okx extends okx$1 {
3149
3149
  * @param {string[]|string} ids order ids
3150
3150
  * @returns {string[]} list of order ids
3151
3151
  */
3152
- if (typeof ids === 'string') {
3152
+ if ((ids !== undefined) && typeof ids === 'string') {
3153
3153
  return ids.split(',');
3154
3154
  }
3155
3155
  else {
@@ -7228,6 +7228,7 @@ class okx extends okx$1 {
7228
7228
  return this.parseGreeks(entry, market);
7229
7229
  }
7230
7230
  }
7231
+ return undefined;
7231
7232
  }
7232
7233
  parseGreeks(greeks, market = undefined) {
7233
7234
  //
@@ -1130,7 +1130,7 @@ class phemex extends phemex$1 {
1130
1130
  return orderbook;
1131
1131
  }
1132
1132
  toEn(n, scale) {
1133
- const stringN = n.toString();
1133
+ const stringN = this.numberToString(n);
1134
1134
  const precise = new Precise["default"](stringN);
1135
1135
  precise.decimals = precise.decimals - scale;
1136
1136
  precise.reduce();
@@ -2523,11 +2523,11 @@ class phemex extends phemex$1 {
2523
2523
  }
2524
2524
  }
2525
2525
  cost = (cost === undefined) ? amount : cost;
2526
- const costString = cost.toString();
2526
+ const costString = this.numberToString(cost);
2527
2527
  request['quoteQtyEv'] = this.toEv(costString, market);
2528
2528
  }
2529
2529
  else {
2530
- const amountString = amount.toString();
2530
+ const amountString = this.numberToString(amount);
2531
2531
  request['baseQtyEv'] = this.toEv(amountString, market);
2532
2532
  }
2533
2533
  }
@@ -2545,7 +2545,7 @@ class phemex extends phemex$1 {
2545
2545
  request['orderQtyRq'] = amount;
2546
2546
  }
2547
2547
  else {
2548
- request['orderQty'] = parseInt(amount);
2548
+ request['orderQty'] = this.parseToInt(amount);
2549
2549
  }
2550
2550
  if (stopPrice !== undefined) {
2551
2551
  const triggerType = this.safeString(params, 'triggerType', 'ByMarkPrice');
@@ -4342,10 +4342,10 @@ class phemex extends phemex$1 {
4342
4342
  request['leverageRr'] = leverage;
4343
4343
  }
4344
4344
  else {
4345
- const long = (longLeverageRr !== undefined) ? longLeverageRr : leverage;
4346
- const short = (shortLeverageRr !== undefined) ? shortLeverageRr : leverage;
4347
- request['longLeverageRr'] = long;
4348
- request['shortLeverageRr'] = short;
4345
+ const longVar = (longLeverageRr !== undefined) ? longLeverageRr : leverage;
4346
+ const shortVar = (shortLeverageRr !== undefined) ? shortLeverageRr : leverage;
4347
+ request['longLeverageRr'] = longVar;
4348
+ request['shortLeverageRr'] = shortVar;
4349
4349
  }
4350
4350
  response = await this.privatePutGPositionsLeverage(this.extend(request, params));
4351
4351
  }
@@ -612,13 +612,16 @@ class alpaca extends alpaca$1 {
612
612
  const T = this.safeString(data, 'T');
613
613
  const msg = this.safeValue(data, 'msg', {});
614
614
  if (T === 'subscription') {
615
- return this.handleSubscription(client, data);
615
+ this.handleSubscription(client, data);
616
+ return;
616
617
  }
617
618
  if (T === 'success' && msg === 'connected') {
618
- return this.handleConnected(client, data);
619
+ this.handleConnected(client, data);
620
+ return;
619
621
  }
620
622
  if (T === 'success' && msg === 'authenticated') {
621
- return this.handleAuthenticate(client, data);
623
+ this.handleAuthenticate(client, data);
624
+ return;
622
625
  }
623
626
  const methods = {
624
627
  'error': this.handleErrorMessage,
@@ -647,7 +650,8 @@ class alpaca extends alpaca$1 {
647
650
  }
648
651
  handleMessage(client, message) {
649
652
  if (Array.isArray(message)) {
650
- return this.handleCryptoMessage(client, message);
653
+ this.handleCryptoMessage(client, message);
654
+ return;
651
655
  }
652
656
  this.handleTradingMessage(client, message);
653
657
  }