ccxt 4.2.73 → 4.2.74

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 (267) hide show
  1. package/README.md +5 -5
  2. package/build.sh +1 -1
  3. package/dist/ccxt.browser.js +181 -100
  4. package/dist/ccxt.browser.min.js +2 -2
  5. package/dist/cjs/ccxt.js +1 -1
  6. package/dist/cjs/src/base/Exchange.js +1 -1
  7. package/dist/cjs/src/bitget.js +62 -50
  8. package/dist/cjs/src/bybit.js +90 -30
  9. package/dist/cjs/src/coinbaseinternational.js +1 -1
  10. package/dist/cjs/src/htx.js +16 -9
  11. package/dist/cjs/src/hyperliquid.js +2 -1
  12. package/dist/cjs/src/pro/krakenfutures.js +8 -7
  13. package/examples/README.md +308 -0
  14. package/examples/ccxt.pro/html/watchTicker.html +51 -0
  15. package/examples/ccxt.pro/js/binance-fetch-balance-snapshot-watch-balance-updates.js +55 -0
  16. package/examples/ccxt.pro/js/binance-https-proxy.js +48 -0
  17. package/examples/ccxt.pro/js/binance-watch-ohlcv-many-symbols-continuously.js +38 -0
  18. package/examples/ccxt.pro/js/binance-watch-ohlcv-many-symbols.js +64 -0
  19. package/examples/ccxt.pro/js/binance-watch-ticker-many-symbols.js +62 -0
  20. package/examples/ccxt.pro/js/build-ohlcv-many-symbols.js +68 -0
  21. package/examples/ccxt.pro/js/calculate-ohlcvs-from-trades-warmup.js +82 -0
  22. package/examples/ccxt.pro/js/calculate-ohlcvs-from-trades.js +59 -0
  23. package/examples/ccxt.pro/js/exchange-capabitities.js +72 -0
  24. package/examples/ccxt.pro/js/exchange-close.js +46 -0
  25. package/examples/ccxt.pro/js/gateio-swap-watch-many-orderbooks.js +30 -0
  26. package/examples/ccxt.pro/js/gateio-watch-balance.js +23 -0
  27. package/examples/ccxt.pro/js/gateio-watch-order-book.js +71 -0
  28. package/examples/ccxt.pro/js/graceful-shutdown.js +43 -0
  29. package/examples/ccxt.pro/js/many-exchanges-many-streams.js +37 -0
  30. package/examples/ccxt.pro/js/okex-create-futures-order.js +48 -0
  31. package/examples/ccxt.pro/js/okex-watch-balance-and-create-order.js +54 -0
  32. package/examples/ccxt.pro/js/okx-watch-tickers.js +31 -0
  33. package/examples/ccxt.pro/js/one-exchange-many-different-streams.js +46 -0
  34. package/examples/ccxt.pro/js/one-exchange-many-streams-2.js +26 -0
  35. package/examples/ccxt.pro/js/one-exchange-many-streams.js +28 -0
  36. package/examples/ccxt.pro/js/socks-binance-watch-orderbook.js +30 -0
  37. package/examples/ccxt.pro/js/watch-fetch-many-exchanges-many-ordersbooks.js +40 -0
  38. package/examples/ccxt.pro/js/watch-many-exchanges-many-ordersbooks.js +38 -0
  39. package/examples/ccxt.pro/js/watch-many-exchanges-many-symbols.js +40 -0
  40. package/examples/ccxt.pro/js/watch-many-orderbooks.js +27 -0
  41. package/examples/ccxt.pro/js/watch-new-trades-only.js +43 -0
  42. package/examples/ccxt.pro/js/watch-new-trades.js +42 -0
  43. package/examples/ccxt.pro/js/watch-trades-many-symbols.js +29 -0
  44. package/examples/ccxt.pro/js/watch-vs-fetch.js +29 -0
  45. package/examples/cs/Examples.sln +22 -0
  46. package/examples/cs/c#.csproj +19 -0
  47. package/examples/html/basic-cors-proxy.html +46 -0
  48. package/examples/html/basic-inheritance.html +47 -0
  49. package/examples/html/basic-poller.html +52 -0
  50. package/examples/html/basic-rate-limiting.html +49 -0
  51. package/examples/html/basic.html +43 -0
  52. package/examples/html/binance-cors-proxy.html +28 -0
  53. package/examples/html/bitmex-browser-cors-proxy.js +7 -0
  54. package/examples/html/bitmex-cors.html +46 -0
  55. package/examples/html/tradingview-charts.html +61 -0
  56. package/examples/html/webworker/index.html +97 -0
  57. package/examples/html/webworker/worker.js +43 -0
  58. package/examples/js/README.md +15 -0
  59. package/examples/js/advanced-error-handling.js +39 -0
  60. package/examples/js/aggregate-orderbook.js +54 -0
  61. package/examples/js/arbitrage-pairs.js +130 -0
  62. package/examples/js/basic-chart.js +29 -0
  63. package/examples/js/basic-orderbook-polling.js +13 -0
  64. package/examples/js/bcc-vs-bch.js +115 -0
  65. package/examples/js/binance-fetch-all-deposits.js +45 -0
  66. package/examples/js/binance-fetch-ohlcv-many-symbols-async-await.js +34 -0
  67. package/examples/js/binance-fetch-ohlcv-many-symbols-promise-then-callbacks.js +33 -0
  68. package/examples/js/binance-fetchTicker-delivery-vs-future.js +31 -0
  69. package/examples/js/binance-futures-transfer-from-sub-account-to-master.js +41 -0
  70. package/examples/js/binance-margin-stop-order.js +39 -0
  71. package/examples/js/binance-server-time.js +34 -0
  72. package/examples/js/binance-universal-transfer.js +16 -0
  73. package/examples/js/bitfinex-fetch-trades.js +35 -0
  74. package/examples/js/bitfinex2-fetch-trades.js +35 -0
  75. package/examples/js/bitmex-browser-cors-proxy.js +7 -0
  76. package/examples/js/bitpanda-fetchMyTrades-reduce.js +36 -0
  77. package/examples/js/bitrue-fetch-balance.js +28 -0
  78. package/examples/js/bitstamp-private-api.js +115 -0
  79. package/examples/js/bitstamp-public-api.js +39 -0
  80. package/examples/js/bittrex-balance.js +50 -0
  81. package/examples/js/bittrex-fetch-closed-orders-history.js +69 -0
  82. package/examples/js/blockchaincom-withdrawal.js +59 -0
  83. package/examples/js/build-ohlcv-bars.js +48 -0
  84. package/examples/js/builtin-rate-limiting-rest-poller.js +25 -0
  85. package/examples/js/bybit-trailing.js +62 -0
  86. package/examples/js/bybit-updated.cjs +154 -0
  87. package/examples/js/cli.js +405 -0
  88. package/examples/js/coinbase-fetch-all-balances.js +36 -0
  89. package/examples/js/coinex-fetch-all-deposit-addresses-using-fetchDepositAddress.js +47 -0
  90. package/examples/js/coinex-futures.js +75 -0
  91. package/examples/js/coinone-fetch-tickers.js +54 -0
  92. package/examples/js/coinone-markets.js +16 -0
  93. package/examples/js/compare-two-exchanges-capabilities.js +36 -0
  94. package/examples/js/cors-proxy.js +5 -0
  95. package/examples/js/create-order-handle-errors.js +55 -0
  96. package/examples/js/create-order-position-with-takeprofit-stoploss.js +71 -0
  97. package/examples/js/create-order-with-retry.js +65 -0
  98. package/examples/js/create-order-ws-example.js +25 -0
  99. package/examples/js/create-orders-example.js +17 -0
  100. package/examples/js/create-trailing-amount-order.js +36 -0
  101. package/examples/js/create-trailing-percent-order.js +36 -0
  102. package/examples/js/credentials.json +5 -0
  103. package/examples/js/custom-proxy-agent-for-js.js +10 -0
  104. package/examples/js/custom-proxy-url.js +23 -0
  105. package/examples/js/delta-maintenance-margin-rate-max-leverage.js +60 -0
  106. package/examples/js/env-variables.js +26 -0
  107. package/examples/js/error-handling.js +89 -0
  108. package/examples/js/exchange-capabilities.js +135 -0
  109. package/examples/js/exchanges-by-volume.js +60 -0
  110. package/examples/js/exchanges.js +40 -0
  111. package/examples/js/fetch-all-balances.js +219 -0
  112. package/examples/js/fetch-all-tickers-to-files-2.js +53 -0
  113. package/examples/js/fetch-all-tickers-to-files.js +77 -0
  114. package/examples/js/fetch-balance.js +28 -0
  115. package/examples/js/fetch-create-deposit-address.js +101 -0
  116. package/examples/js/fetch-from-many-exchanges-simultaneously.js +21 -0
  117. package/examples/js/fetch-funding-rate-history.js +25 -0
  118. package/examples/js/fetch-futures/prettier.config.js +5 -0
  119. package/examples/js/fetch-futures/src/index.js +25 -0
  120. package/examples/js/fetch-ohlcv-from-to-mark-index-premium.js +72 -0
  121. package/examples/js/fetch-ohlcv-many-exchanges-continuosly.js +39 -0
  122. package/examples/js/fetch-ohlcv.js +16 -0
  123. package/examples/js/fetch-okex-futures.js +22 -0
  124. package/examples/js/fetch-orders.js +27 -0
  125. package/examples/js/fetch-ticker-from-multiple-exchanges.js +35 -0
  126. package/examples/js/fetch-ticker-where-available.js +75 -0
  127. package/examples/js/fetch-tickers/build/index.js +19 -0
  128. package/examples/js/fetch-tickers/prettier.config.js +5 -0
  129. package/examples/js/fetch-tickers/src/index.js +17 -0
  130. package/examples/js/gateio-create-batch-order.js +43 -0
  131. package/examples/js/gateio-futures.js +49 -0
  132. package/examples/js/gateio-open-close-contract.js +49 -0
  133. package/examples/js/gateio-swaps.js +74 -0
  134. package/examples/js/gdax-fetch-trades-pagination.js +29 -0
  135. package/examples/js/hitbtc2-withdraw.js +61 -0
  136. package/examples/js/how-to-import-one-exchange-esm.js +10 -0
  137. package/examples/js/huobi-futures.js +71 -0
  138. package/examples/js/huobi-open-close-contract.js +63 -0
  139. package/examples/js/huobi-swaps.js +70 -0
  140. package/examples/js/huobipro-market-buy-sell-fetch-trading-limits.js +98 -0
  141. package/examples/js/hybridCJSExample.cjs +19 -0
  142. package/examples/js/hybridESMExample.js +19 -0
  143. package/examples/js/idex-fetch-balance.js +13 -0
  144. package/examples/js/instantiate-all-at-once.js +46 -0
  145. package/examples/js/instantiate-all-from-json.js +31 -0
  146. package/examples/js/kraken-create-and-close-position.js +54 -0
  147. package/examples/js/kraken-fetch-order-trades.js +33 -0
  148. package/examples/js/kraken-margin-trading.js +89 -0
  149. package/examples/js/kucoin-rate-limit.js +38 -0
  150. package/examples/js/latoken-example.js +108 -0
  151. package/examples/js/live-orderbook.js +106 -0
  152. package/examples/js/live-ticker.js +80 -0
  153. package/examples/js/live-tickers.js +74 -0
  154. package/examples/js/load-all-contracts.js +41 -0
  155. package/examples/js/load-all-symbols-at-once.js +69 -0
  156. package/examples/js/load-all-tickers-at-once.js +91 -0
  157. package/examples/js/load-markets-to-files.js +57 -0
  158. package/examples/js/looping-over-all-symbols-of-specific-exchanges.js +61 -0
  159. package/examples/js/looping-over-specific-symbols-of-all-exchanges.js +91 -0
  160. package/examples/js/margin-loan-borrow-buy-sell-repay.js +70 -0
  161. package/examples/js/market-status-and-currency-status.js +29 -0
  162. package/examples/js/ohlcv-console-chart.js +29 -0
  163. package/examples/js/okex-fetch-closed-orders-archive.js +31 -0
  164. package/examples/js/okex-transfer.js +51 -0
  165. package/examples/js/okx-poll-fetch-my-trades.js +37 -0
  166. package/examples/js/okx-poll-rate-limit.js +48 -0
  167. package/examples/js/order-book-extra-level-depth-param.js +20 -0
  168. package/examples/js/phemex-create-order-position-with-takeprofit-stoploss.js +49 -0
  169. package/examples/js/poll-ohlcv.js +43 -0
  170. package/examples/js/poloniex-fetch-order-books.js +35 -0
  171. package/examples/js/poloniex-limits-amount-min.js +62 -0
  172. package/examples/js/proxy-round-robin.js +98 -0
  173. package/examples/js/proxy-usage.js +32 -0
  174. package/examples/js/sample-local-proxy-server-with-cors.js +12 -0
  175. package/examples/js/search-all-exchanges.js +159 -0
  176. package/examples/js/shared-load-markets.js +80 -0
  177. package/examples/js/sort-swap-markets-by-hourly-price-change.js +55 -0
  178. package/examples/js/symbols.js +110 -0
  179. package/examples/js/theocean.js +41 -0
  180. package/examples/js/tickers.js +106 -0
  181. package/examples/js/validate-paginated-data.js +61 -0
  182. package/examples/js/watch-OHLCV-For-Symbols.js +15 -0
  183. package/examples/js/watch-OHLCV.js +12 -0
  184. package/examples/js/watch-OrderBook-For-Symbols.js +11 -0
  185. package/examples/js/watch-Trades-For-Symbols.js +11 -0
  186. package/examples/js/watch-tickers.js +11 -0
  187. package/examples/js/watchOHLCVForSymbols.js +15 -0
  188. package/examples/js/watchOrderBookForSymbols.js +11 -0
  189. package/examples/js/watchPositions-many-exchanges-continuosly.d.ts +2 -0
  190. package/examples/js/watchPositions-many-exchanges-continuosly.d.ts.map +1 -0
  191. package/examples/js/watchPositions-many-exchanges-continuosly.js +49 -0
  192. package/examples/js/watchPositions.d.ts +2 -0
  193. package/examples/js/watchPositions.d.ts.map +1 -0
  194. package/examples/js/watchPositions.js +13 -0
  195. package/examples/js/watchPositionsForSymbols.d.ts +2 -0
  196. package/examples/js/watchPositionsForSymbols.d.ts.map +1 -0
  197. package/examples/js/watchPositionsForSymbols.js +14 -0
  198. package/examples/js/watchTradesForSymbols.js +11 -0
  199. package/examples/js/withdraw-from-one-exchange-to-another.js +50 -0
  200. package/examples/php/README.md +7 -0
  201. package/examples/py/README.md +15 -0
  202. package/examples/py/playing_with_ccxt_example.ipynb +222 -0
  203. package/examples/ts/.eslintrc +111 -0
  204. package/examples/ts/build-ohlcv-bars.ts +53 -0
  205. package/examples/ts/cli.ts +397 -0
  206. package/examples/ts/compare-two-exchanges-capabilities.ts +36 -0
  207. package/examples/ts/create-order-position-with-takeprofit-stoploss.ts +89 -0
  208. package/examples/ts/create-order-ws-example.ts +33 -0
  209. package/examples/ts/create-orders-example.ts +21 -0
  210. package/examples/ts/create-trailing-amount-order.ts +37 -0
  211. package/examples/ts/create-trailing-percent-order.ts +37 -0
  212. package/examples/ts/custom-proxy-agent-for-js.ts +14 -0
  213. package/examples/ts/fetch-futures/package-lock.json +116 -0
  214. package/examples/ts/fetch-futures/package.json +34 -0
  215. package/examples/ts/fetch-futures/prettier.config.js +4 -0
  216. package/examples/ts/fetch-futures/src/index.ts +28 -0
  217. package/examples/ts/fetch-futures/tsconfig.json +28 -0
  218. package/examples/ts/fetch-ohlcv-many-exchanges-continuosly.ts +44 -0
  219. package/examples/ts/fetch-ohlcv.ts +17 -0
  220. package/examples/ts/fetch-tickers/package-lock.json +116 -0
  221. package/examples/ts/fetch-tickers/package.json +34 -0
  222. package/examples/ts/fetch-tickers/prettier.config.js +4 -0
  223. package/examples/ts/fetch-tickers/src/index.ts +21 -0
  224. package/examples/ts/fetch-tickers/tsconfig.json +28 -0
  225. package/examples/ts/how-to-import-one-exchange-esm.ts +11 -0
  226. package/examples/ts/kraken-create-and-close-position.ts +69 -0
  227. package/examples/ts/margin-loan-borrow-buy-sell-repay.ts +72 -0
  228. package/examples/ts/nextjs-page-router/.eslintrc.json +3 -0
  229. package/examples/ts/nextjs-page-router/README.md +43 -0
  230. package/examples/ts/nextjs-page-router/next.config.js +6 -0
  231. package/examples/ts/nextjs-page-router/package-lock.json +7425 -0
  232. package/examples/ts/nextjs-page-router/package.json +28 -0
  233. package/examples/ts/nextjs-page-router/postcss.config.js +6 -0
  234. package/examples/ts/nextjs-page-router/public/favicon.ico +0 -0
  235. package/examples/ts/nextjs-page-router/src/pages/_app.tsx +6 -0
  236. package/examples/ts/nextjs-page-router/src/pages/_document.tsx +13 -0
  237. package/examples/ts/nextjs-page-router/src/pages/balance.tsx +46 -0
  238. package/examples/ts/nextjs-page-router/src/pages/index.tsx +8 -0
  239. package/examples/ts/nextjs-page-router/src/pages/tickers.tsx +61 -0
  240. package/examples/ts/nextjs-page-router/src/styles/globals.css +27 -0
  241. package/examples/ts/nextjs-page-router/tailwind.config.ts +20 -0
  242. package/examples/ts/nextjs-page-router/tsconfig.json +22 -0
  243. package/examples/ts/phemex-create-order-position-with-takeprofit-stoploss.ts +62 -0
  244. package/examples/ts/proxy-usage.ts +41 -0
  245. package/examples/ts/sample-local-proxy-server-with-cors.ts +15 -0
  246. package/examples/ts/watch-OHLCV-For-Symbols.ts +17 -0
  247. package/examples/ts/watch-OHLCV.ts +14 -0
  248. package/examples/ts/watch-OrderBook-For-Symbols.ts +13 -0
  249. package/examples/ts/watch-Trades-For-Symbols.ts +13 -0
  250. package/examples/ts/watch-tickers.ts +13 -0
  251. package/examples/ts/watchPositions-many-exchanges-continuosly.ts +53 -0
  252. package/examples/ts/watchPositions.ts +15 -0
  253. package/examples/ts/watchPositionsForSymbols.ts +16 -0
  254. package/examples/tsconfig.json +27 -0
  255. package/js/ccxt.d.ts +1 -1
  256. package/js/ccxt.js +1 -1
  257. package/js/src/base/Exchange.d.ts +2 -2
  258. package/js/src/base/Exchange.js +1 -1
  259. package/js/src/bitget.js +62 -50
  260. package/js/src/bybit.d.ts +3 -1
  261. package/js/src/bybit.js +90 -30
  262. package/js/src/coinbaseinternational.js +1 -1
  263. package/js/src/htx.js +16 -9
  264. package/js/src/hyperliquid.js +2 -1
  265. package/js/src/pro/krakenfutures.js +8 -7
  266. package/package.json +4 -1
  267. package/skip-tests.json +214 -424
package/README.md CHANGED
@@ -42,7 +42,7 @@ Current feature list:
42
42
  | [![bitmart](https://user-images.githubusercontent.com/1294454/129991357-8f47464b-d0f4-41d6-8a82-34122f0d1398.jpg)](http://www.bitmart.com/?r=rQCFLh) | bitmart | [BitMart](http://www.bitmart.com/?r=rQCFLh) | [![API Version 2](https://img.shields.io/badge/2-lightgray)](https://developer-pro.bitmart.com/) | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://ccxt.pro) | [![Sign up with BitMart using CCXT's referral link for a 30% discount!](https://img.shields.io/static/v1?label=Fee&message=%2d30%25&color=orange)](http://www.bitmart.com/?r=rQCFLh) |
43
43
  | [![bitmex](https://github.com/ccxt/ccxt/assets/43336371/cea9cfe5-c57e-4b84-b2ac-77b960b04445)](https://www.bitmex.com/app/register/NZTR1q) | bitmex | [BitMEX](https://www.bitmex.com/app/register/NZTR1q) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://www.bitmex.com/app/apiOverview) | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://ccxt.pro) | [![Sign up with BitMEX using CCXT's referral link for a 10% discount!](https://img.shields.io/static/v1?label=Fee&message=%2d10%25&color=orange)](https://www.bitmex.com/app/register/NZTR1q) |
44
44
  | [![bybit](https://user-images.githubusercontent.com/51840849/76547799-daff5b80-649e-11ea-87fb-3be9bac08954.jpg)](https://www.bybit.com/register?affiliate_id=35953) | bybit | [Bybit](https://www.bybit.com/register?affiliate_id=35953) | [![API Version 5](https://img.shields.io/badge/5-lightgray)](https://bybit-exchange.github.io/docs/inverse/) | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://ccxt.pro) | |
45
- | [![coinbaseinternational](https://github.com/ccxt/ccxt/assets/43336371/866ae638-6ab5-4ebf-ab2c-cdcce9545625)](https://www.coinbaseinternational.com/international-exchange) | coinbaseinternational | [coinbase International](https://www.coinbaseinternational.com/international-exchange) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://docs.cloud.coinbaseinternational.com/intx/docs) | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://ccxt.pro) | |
45
+ | [![coinbaseinternational](https://github.com/ccxt/ccxt/assets/43336371/866ae638-6ab5-4ebf-ab2c-cdcce9545625)](https://international.coinbase.com) | coinbaseinternational | [coinbase International](https://international.coinbase.com) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://docs.cloud.coinbaseinternational.com/intx/docs) | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://ccxt.pro) | |
46
46
  | [![coinex](https://user-images.githubusercontent.com/51840849/87182089-1e05fa00-c2ec-11ea-8da9-cc73b45abbbc.jpg)](https://www.coinex.com/register?refer_code=yw5fz) | coinex | [CoinEx](https://www.coinex.com/register?refer_code=yw5fz) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://github.com/coinexcom/coinex_exchange_api/wiki) | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://ccxt.pro) | |
47
47
  | [![cryptocom](https://user-images.githubusercontent.com/1294454/147792121-38ed5e36-c229-48d6-b49a-48d05fc19ed4.jpeg)](https://crypto.com/exch/kdacthrnxt) | cryptocom | [Crypto.com](https://crypto.com/exch/kdacthrnxt) | [![API Version 2](https://img.shields.io/badge/2-lightgray)](https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html) | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://ccxt.pro) | [![Sign up with Crypto.com using CCXT's referral link for a 15% discount!](https://img.shields.io/static/v1?label=Fee&message=%2d15%25&color=orange)](https://crypto.com/exch/kdacthrnxt) |
48
48
  | [![gate](https://user-images.githubusercontent.com/1294454/31784029-0313c702-b509-11e7-9ccc-bc0da6a0e435.jpg)](https://www.gate.io/signup/2436035) | gate | [Gate.io](https://www.gate.io/signup/2436035) | [![API Version 4](https://img.shields.io/badge/4-lightgray)](https://www.gate.io/docs/developers/apiv4/en/) | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://ccxt.pro) | [![Sign up with Gate.io using CCXT's referral link for a 20% discount!](https://img.shields.io/static/v1?label=Fee&message=%2d20%25&color=orange)](https://www.gate.io/signup/2436035) |
@@ -95,7 +95,7 @@ The CCXT library currently supports the following 96 cryptocurrency exchange mar
95
95
  | [![bybit](https://user-images.githubusercontent.com/51840849/76547799-daff5b80-649e-11ea-87fb-3be9bac08954.jpg)](https://www.bybit.com/register?affiliate_id=35953) | bybit | [Bybit](https://www.bybit.com/register?affiliate_id=35953) | [![API Version 5](https://img.shields.io/badge/5-lightgray)](https://bybit-exchange.github.io/docs/inverse/) | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://ccxt.pro) |
96
96
  | [![cex](https://user-images.githubusercontent.com/1294454/27766442-8ddc33b0-5ed8-11e7-8b98-f786aef0f3c9.jpg)](https://cex.io/r/0/up105393824/0/) | cex | [CEX.IO](https://cex.io/r/0/up105393824/0/) | [![API Version *](https://img.shields.io/badge/*-lightgray)](https://cex.io/cex-api) | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://ccxt.pro) |
97
97
  | [![coinbase](https://user-images.githubusercontent.com/1294454/40811661-b6eceae2-653a-11e8-829e-10bfadb078cf.jpg)](https://www.coinbase.com/join/58cbe25a355148797479dbd2) | coinbase | [Coinbase](https://www.coinbase.com/join/58cbe25a355148797479dbd2) | [![API Version 2](https://img.shields.io/badge/2-lightgray)](https://developers.coinbase.com/api/v2) | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://ccxt.pro) |
98
- | [![coinbaseinternational](https://github.com/ccxt/ccxt/assets/43336371/866ae638-6ab5-4ebf-ab2c-cdcce9545625)](https://www.coinbaseinternational.com/international-exchange) | coinbaseinternational | [coinbase International](https://www.coinbaseinternational.com/international-exchange) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://docs.cloud.coinbaseinternational.com/intx/docs) | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://ccxt.pro) |
98
+ | [![coinbaseinternational](https://github.com/ccxt/ccxt/assets/43336371/866ae638-6ab5-4ebf-ab2c-cdcce9545625)](https://international.coinbase.com) | coinbaseinternational | [coinbase International](https://international.coinbase.com) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://docs.cloud.coinbaseinternational.com/intx/docs) | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://ccxt.pro) |
99
99
  | [![coinbasepro](https://user-images.githubusercontent.com/1294454/41764625-63b7ffde-760a-11e8-996d-a6328fa9347a.jpg)](https://pro.coinbase.com/) | coinbasepro | [Coinbase Pro](https://pro.coinbase.com/) | [![API Version *](https://img.shields.io/badge/*-lightgray)](https://docs.pro.coinbase.com) | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://ccxt.pro) |
100
100
  | [![coincheck](https://user-images.githubusercontent.com/51840849/87182088-1d6d6380-c2ec-11ea-9c64-8ab9f9b289f5.jpg)](https://coincheck.com) | coincheck | [coincheck](https://coincheck.com) | [![API Version *](https://img.shields.io/badge/*-lightgray)](https://coincheck.com/documents/exchange/api) | | |
101
101
  | [![coinex](https://user-images.githubusercontent.com/51840849/87182089-1e05fa00-c2ec-11ea-8da9-cc73b45abbbc.jpg)](https://www.coinex.com/register?refer_code=yw5fz) | coinex | [CoinEx](https://www.coinex.com/register?refer_code=yw5fz) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://github.com/coinexcom/coinex_exchange_api/wiki) | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://ccxt.pro) |
@@ -212,13 +212,13 @@ console.log(version, Object.keys(exchanges));
212
212
 
213
213
  All-in-one browser bundle (dependencies included), served from a CDN of your choice:
214
214
 
215
- * jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.2.73/dist/ccxt.browser.js
216
- * unpkg: https://unpkg.com/ccxt@4.2.73/dist/ccxt.browser.js
215
+ * jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.2.74/dist/ccxt.browser.js
216
+ * unpkg: https://unpkg.com/ccxt@4.2.74/dist/ccxt.browser.js
217
217
 
218
218
  CDNs are not updated in real-time and may have delays. Defaulting to the most recent version without specifying the version number is not recommended. Please, keep in mind that we are not responsible for the correct operation of those CDN servers.
219
219
 
220
220
  ```HTML
221
- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.2.73/dist/ccxt.browser.js"></script>
221
+ <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.2.74/dist/ccxt.browser.js"></script>
222
222
  ```
223
223
 
224
224
  Creates a global `ccxt` object:
package/build.sh CHANGED
@@ -76,7 +76,7 @@ build_and_test_all () {
76
76
  # cd python
77
77
  # if ! tox run-parallel; then
78
78
  # exit 1
79
- # fi
79
+ # fi
80
80
  # cd ..
81
81
  # fi
82
82
  fi
@@ -7279,7 +7279,7 @@ class Exchange {
7279
7279
  this.last_request_body = undefined;
7280
7280
  this.last_request_url = undefined;
7281
7281
  this.last_request_path = undefined;
7282
- this.id = undefined;
7282
+ this.id = 'Exchange';
7283
7283
  this.markets = undefined;
7284
7284
  this.status = undefined;
7285
7285
  this.rateLimit = undefined; // milliseconds
@@ -46436,10 +46436,10 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
46436
46436
  },
46437
46437
  'fetchOHLCV': {
46438
46438
  'spot': {
46439
- 'method': 'publicSpotGetV2SpotMarketCandles', // or publicSpotGetV2SpotMarketHistoryCandles
46439
+ 'method': 'publicSpotGetV2SpotMarketCandles', // publicSpotGetV2SpotMarketCandles or publicSpotGetV2SpotMarketHistoryCandles
46440
46440
  },
46441
46441
  'swap': {
46442
- 'method': 'publicMixGetV2MixMarketCandles', // or publicMixGetV2MixMarketHistoryCandles or publicMixGetV2MixMarketHistoryIndexCandles or publicMixGetV2MixMarketHistoryMarkCandles
46442
+ 'method': 'publicMixGetV2MixMarketCandles', // publicMixGetV2MixMarketCandles or publicMixGetV2MixMarketHistoryCandles or publicMixGetV2MixMarketHistoryIndexCandles or publicMixGetV2MixMarketHistoryMarkCandles
46443
46443
  },
46444
46444
  'maxDaysPerTimeframe': {
46445
46445
  '1m': 30,
@@ -48409,11 +48409,13 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
48409
48409
  * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
48410
48410
  */
48411
48411
  await this.loadMarkets();
48412
- const maxLimit = 1000; // max 1000
48412
+ const defaultLimit = 100; // default 100, max 1000
48413
+ const maxLimitForRecentEndpoint = 1000;
48414
+ const maxLimitForHistoryEndpoint = 200; // note, max 1000 bars are supported for "recent-candles" endpoint, but "historical-candles" support only max 200
48413
48415
  let paginate = false;
48414
48416
  [paginate, params] = this.handleOptionAndParams(params, 'fetchOHLCV', 'paginate');
48415
48417
  if (paginate) {
48416
- return await this.fetchPaginatedCallDeterministic('fetchOHLCV', symbol, since, limit, timeframe, params, maxLimit);
48418
+ return await this.fetchPaginatedCallDeterministic('fetchOHLCV', symbol, since, limit, timeframe, params, maxLimitForHistoryEndpoint);
48417
48419
  }
48418
48420
  const sandboxMode = this.safeBool(this.options, 'sandboxMode', false);
48419
48421
  let market = undefined;
@@ -48426,32 +48428,17 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
48426
48428
  }
48427
48429
  const marketType = market['spot'] ? 'spot' : 'swap';
48428
48430
  const timeframes = this.options['timeframes'][marketType];
48429
- const selectedTimeframe = this.safeString(timeframes, timeframe, timeframe);
48431
+ const msInDay = 86400000;
48430
48432
  const duration = this.parseTimeframe(timeframe) * 1000;
48431
48433
  const request = {
48432
48434
  'symbol': market['id'],
48433
- 'granularity': selectedTimeframe,
48435
+ 'granularity': this.safeString(timeframes, timeframe, timeframe),
48434
48436
  };
48435
- const defaultLimit = 100; // by default, exchange returns 100 items
48436
- const msInDay = 1000 * 60 * 60 * 24;
48437
- if (limit !== undefined) {
48438
- limit = Math.min(limit, maxLimit);
48439
- request['limit'] = limit;
48440
- }
48441
48437
  const until = this.safeInteger2(params, 'until', 'till');
48438
+ const limitDefined = limit !== undefined;
48439
+ const sinceDefined = since !== undefined;
48440
+ const untilDefined = until !== undefined;
48442
48441
  params = this.omit(params, ['until', 'till']);
48443
- if (until !== undefined) {
48444
- request['endTime'] = until;
48445
- }
48446
- if (since !== undefined) {
48447
- request['startTime'] = since;
48448
- if (market['spot'] && (until === undefined)) {
48449
- // for spot we need to send "entTime" too
48450
- const limitForEnd = (limit !== undefined) ? limit : defaultLimit;
48451
- const calculatedEnd = this.sum(since, duration * limitForEnd);
48452
- request['endTime'] = calculatedEnd;
48453
- }
48454
- }
48455
48442
  let response = undefined;
48456
48443
  const now = this.milliseconds();
48457
48444
  // retrievable periods listed here:
@@ -48459,21 +48446,47 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
48459
48446
  // - https://www.bitget.com/api-doc/contract/market/Get-Candle-Data#description
48460
48447
  const ohlcOptions = this.safeDict(this.options, 'fetchOHLCV', {});
48461
48448
  const retrievableDaysMap = this.safeDict(ohlcOptions, 'maxDaysPerTimeframe', {});
48462
- const maxRetrievableDaysForNonHistory = this.safeInteger(retrievableDaysMap, timeframe, 30); // default to safe minimum
48463
- const endpointTsBoundary = now - maxRetrievableDaysForNonHistory * msInDay;
48464
- // checks if we need history endpoint
48465
- let needsHistoryEndpoint = false;
48466
- const displaceByLimit = (limit === undefined) ? 0 : limit * duration;
48467
- if (since !== undefined && since < endpointTsBoundary) {
48468
- // if since it earlier than the allowed diapason
48469
- needsHistoryEndpoint = true;
48470
- }
48471
- else if (until !== undefined && until - displaceByLimit < endpointTsBoundary) {
48472
- // if until is earlier than the allowed diapason
48473
- needsHistoryEndpoint = true;
48449
+ const maxRetrievableDaysForRecent = this.safeInteger(retrievableDaysMap, timeframe, 30); // default to safe minimum
48450
+ const endpointTsBoundary = now - maxRetrievableDaysForRecent * msInDay;
48451
+ if (limitDefined) {
48452
+ limit = Math.min(limit, maxLimitForRecentEndpoint);
48453
+ request['limit'] = limit;
48454
+ }
48455
+ else {
48456
+ limit = defaultLimit;
48474
48457
  }
48458
+ const limitMultipliedDuration = limit * duration;
48459
+ // exchange aligns from endTime, so it's important, not startTime
48460
+ // startTime is supported only on "recent" endpoint, not on "historical" endpoint
48461
+ let calculatedStartTime = undefined;
48462
+ let calculatedEndTime = undefined;
48463
+ if (sinceDefined) {
48464
+ calculatedStartTime = since;
48465
+ request['startTime'] = since;
48466
+ if (!untilDefined) {
48467
+ calculatedEndTime = this.sum(calculatedStartTime, limitMultipliedDuration);
48468
+ request['endTime'] = calculatedEndTime;
48469
+ }
48470
+ }
48471
+ if (untilDefined) {
48472
+ calculatedEndTime = until;
48473
+ request['endTime'] = calculatedEndTime;
48474
+ if (!sinceDefined) {
48475
+ calculatedStartTime = calculatedEndTime - limitMultipliedDuration;
48476
+ // we do not need to set "startTime" here
48477
+ }
48478
+ }
48479
+ const historicalEndpointNeeded = (calculatedStartTime !== undefined) && (calculatedStartTime <= endpointTsBoundary);
48480
+ if (historicalEndpointNeeded) {
48481
+ // only for "historical-candles" - ensure we use correct max limit
48482
+ if (limitDefined) {
48483
+ request['limit'] = Math.min(limit, maxLimitForHistoryEndpoint);
48484
+ }
48485
+ }
48486
+ // make request
48475
48487
  if (market['spot']) {
48476
- if (needsHistoryEndpoint) {
48488
+ // checks if we need history endpoint
48489
+ if (historicalEndpointNeeded) {
48477
48490
  response = await this.publicSpotGetV2SpotMarketHistoryCandles(this.extend(request, params));
48478
48491
  }
48479
48492
  else {
@@ -48481,19 +48494,18 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
48481
48494
  }
48482
48495
  }
48483
48496
  else {
48484
- const maxDistanceDaysForContracts = 90; // maximum 90 days allowed between start-end times
48485
- let distanceError = false;
48486
- if (limit !== undefined && limit * duration > maxDistanceDaysForContracts * msInDay) {
48487
- distanceError = true;
48488
- }
48489
- else if (since !== undefined && until !== undefined && until - since > maxDistanceDaysForContracts * msInDay) {
48490
- distanceError = true;
48491
- }
48492
- if (distanceError) {
48493
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadRequest(this.id + ' fetchOHLCV() between start and end must be less than ' + maxDistanceDaysForContracts.toString() + ' days');
48497
+ const maxDistanceDaysForContracts = 90; // for contract, maximum 90 days allowed between start-end times
48498
+ // only correct the request to fix 90 days if until was auto-calculated
48499
+ if (sinceDefined) {
48500
+ if (!untilDefined) {
48501
+ request['endTime'] = Math.min(calculatedEndTime, this.sum(since, maxDistanceDaysForContracts * msInDay));
48502
+ }
48503
+ else if (calculatedEndTime - calculatedStartTime > maxDistanceDaysForContracts * msInDay) {
48504
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadRequest(this.id + ' fetchOHLCV() between start and end must be less than ' + maxDistanceDaysForContracts.toString() + ' days');
48505
+ }
48494
48506
  }
48495
- const priceType = this.safeString(params, 'price');
48496
- params = this.omit(params, ['price']);
48507
+ let priceType = undefined;
48508
+ [priceType, params] = this.handleParamString(params, 'price');
48497
48509
  let productType = undefined;
48498
48510
  [productType, params] = this.handleProductTypeAndParams(market, params);
48499
48511
  request['productType'] = productType;
@@ -48506,7 +48518,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
48506
48518
  response = await this.publicMixGetV2MixMarketHistoryIndexCandles(extended);
48507
48519
  }
48508
48520
  else {
48509
- if (needsHistoryEndpoint) {
48521
+ if (historicalEndpointNeeded) {
48510
48522
  response = await this.publicMixGetV2MixMarketHistoryCandles(extended);
48511
48523
  }
48512
48524
  else {
@@ -83448,6 +83460,7 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
83448
83460
  'fetchIsolatedBorrowRates': false,
83449
83461
  'fetchLedger': true,
83450
83462
  'fetchLeverage': true,
83463
+ 'fetchLeverageTiers': true,
83451
83464
  'fetchMarketLeverageTiers': true,
83452
83465
  'fetchMarkets': true,
83453
83466
  'fetchMarkOHLCV': true,
@@ -90638,36 +90651,6 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
90638
90651
  request['symbol'] = market['id'];
90639
90652
  return await this.fetchDerivativesMarketLeverageTiers(symbol, params);
90640
90653
  }
90641
- parseMarketLeverageTiers(info, market = undefined) {
90642
- //
90643
- // {
90644
- // "id": 1,
90645
- // "symbol": "BTCUSD",
90646
- // "riskLimitValue": "150",
90647
- // "maintenanceMargin": "0.5",
90648
- // "initialMargin": "1",
90649
- // "isLowestRisk": 1,
90650
- // "maxLeverage": "100.00"
90651
- // }
90652
- //
90653
- let minNotional = 0;
90654
- const tiers = [];
90655
- for (let i = 0; i < info.length; i++) {
90656
- const item = info[i];
90657
- const maxNotional = this.safeNumber(item, 'riskLimitValue');
90658
- tiers.push({
90659
- 'tier': this.sum(i, 1),
90660
- 'currency': market['base'],
90661
- 'minNotional': minNotional,
90662
- 'maxNotional': maxNotional,
90663
- 'maintenanceMarginRate': this.safeNumber(item, 'maintenanceMargin'),
90664
- 'maxLeverage': this.safeNumber(item, 'maxLeverage'),
90665
- 'info': item,
90666
- });
90667
- minNotional = maxNotional;
90668
- }
90669
- return tiers;
90670
- }
90671
90654
  parseTradingFee(fee, market = undefined) {
90672
90655
  //
90673
90656
  // {
@@ -91372,6 +91355,95 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
91372
91355
  'datetime': this.iso8601(timestamp),
91373
91356
  });
91374
91357
  }
91358
+ async fetchLeverageTiers(symbols = undefined, params = {}) {
91359
+ /**
91360
+ * @method
91361
+ * @name bybit#fetchLeverageTiers
91362
+ * @see https://bybit-exchange.github.io/docs/v5/market/risk-limit
91363
+ * @description retrieve information on the maximum leverage, for different trade sizes
91364
+ * @param {string[]} [symbols] a list of unified market symbols
91365
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
91366
+ * @param {string} [params.subType] market subType, ['linear', 'inverse'], default is 'linear'
91367
+ * @returns {object} a dictionary of [leverage tiers structures]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}, indexed by market symbols
91368
+ */
91369
+ await this.loadMarkets();
91370
+ let market = undefined;
91371
+ if (symbols !== undefined) {
91372
+ market = this.market(symbols[0]);
91373
+ if (market['spot']) {
91374
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.NotSupported(this.id + ' fetchLeverageTiers() is not supported for spot market');
91375
+ }
91376
+ }
91377
+ let subType = undefined;
91378
+ [subType, params] = this.handleSubTypeAndParams('fetchTickers', market, params, 'linear');
91379
+ const request = {
91380
+ 'category': subType,
91381
+ };
91382
+ const response = await this.publicGetV5MarketRiskLimit(this.extend(request, params));
91383
+ const result = this.safeDict(response, 'result', {});
91384
+ const data = this.safeList(result, 'list', []);
91385
+ symbols = this.marketSymbols(symbols);
91386
+ return this.parseLeverageTiers(data, symbols, 'symbol');
91387
+ }
91388
+ parseLeverageTiers(response, symbols = undefined, marketIdKey = undefined) {
91389
+ //
91390
+ // [
91391
+ // {
91392
+ // "id": 1,
91393
+ // "symbol": "BTCUSD",
91394
+ // "riskLimitValue": "150",
91395
+ // "maintenanceMargin": "0.5",
91396
+ // "initialMargin": "1",
91397
+ // "isLowestRisk": 1,
91398
+ // "maxLeverage": "100.00"
91399
+ // }
91400
+ // ]
91401
+ //
91402
+ const tiers = {};
91403
+ const marketIds = this.marketIds(symbols);
91404
+ const filteredResults = this.filterByArray(response, marketIdKey, marketIds, false);
91405
+ const grouped = this.groupBy(filteredResults, marketIdKey);
91406
+ const keys = Object.keys(grouped);
91407
+ for (let i = 0; i < keys.length; i++) {
91408
+ const marketId = keys[i];
91409
+ const entry = grouped[marketId];
91410
+ const market = this.safeMarket(marketId, undefined, undefined, 'contract');
91411
+ const symbol = market['symbol'];
91412
+ tiers[symbol] = this.parseMarketLeverageTiers(entry, market);
91413
+ }
91414
+ return tiers;
91415
+ }
91416
+ parseMarketLeverageTiers(info, market = undefined) {
91417
+ //
91418
+ // [
91419
+ // {
91420
+ // "id": 1,
91421
+ // "symbol": "BTCUSD",
91422
+ // "riskLimitValue": "150",
91423
+ // "maintenanceMargin": "0.5",
91424
+ // "initialMargin": "1",
91425
+ // "isLowestRisk": 1,
91426
+ // "maxLeverage": "100.00"
91427
+ // }
91428
+ // ]
91429
+ //
91430
+ const tiers = [];
91431
+ for (let i = 0; i < info.length; i++) {
91432
+ const tier = info[i];
91433
+ const marketId = this.safeString(info, 'symbol');
91434
+ market = this.safeMarket(marketId);
91435
+ tiers.push({
91436
+ 'tier': this.safeInteger(tier, 'id'),
91437
+ 'currency': market['settle'],
91438
+ 'minNotional': undefined,
91439
+ 'maxNotional': undefined,
91440
+ 'maintenanceMarginRate': this.safeNumber(tier, 'maintenanceMargin'),
91441
+ 'maxLeverage': this.safeNumber(tier, 'maxLeverage'),
91442
+ 'info': tier,
91443
+ });
91444
+ }
91445
+ return tiers;
91446
+ }
91375
91447
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
91376
91448
  let url = this.implodeHostname(this.urls['api'][api]) + '/' + path;
91377
91449
  if (api === 'public') {
@@ -97231,7 +97303,7 @@ class coinbaseinternational extends _abstract_coinbaseinternational_js__WEBPACK_
97231
97303
  'test': {
97232
97304
  'rest': 'https://api-n5e1.coinbase.com/api',
97233
97305
  },
97234
- 'www': 'https://www.coinbaseinternational.com/international-exchange',
97306
+ 'www': 'https://international.coinbase.com',
97235
97307
  'doc': [
97236
97308
  'https://docs.cloud.coinbaseinternational.com/intx/docs',
97237
97309
  ],
@@ -151311,6 +151383,9 @@ class htx extends _abstract_htx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
151311
151383
  },
151312
151384
  },
151313
151385
  },
151386
+ 'fetchOHLCV': {
151387
+ 'useHistoricalEndpointForSpot': true,
151388
+ },
151314
151389
  'withdraw': {
151315
151390
  'includeFee': false,
151316
151391
  },
@@ -153318,6 +153393,7 @@ class htx extends _abstract_htx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
153318
153393
  * @param {int} [limit] the maximum amount of candles to fetch
153319
153394
  * @param {object} [params] extra parameters specific to the exchange API endpoint
153320
153395
  * @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)
153396
+ * @param {string} [params.useHistoricalEndpointForSpot] true/false - whether use the historical candles endpoint for spot markets or default klines endpoint
153321
153397
  * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
153322
153398
  */
153323
153399
  await this.loadMarkets();
@@ -153424,19 +153500,22 @@ class htx extends _abstract_htx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
153424
153500
  }
153425
153501
  }
153426
153502
  else {
153427
- if (since !== undefined) {
153428
- request['from'] = this.parseToInt(since / 1000);
153429
- }
153430
- if (limit !== undefined) {
153431
- request['size'] = limit; // max 2000
153432
- }
153433
153503
  request['symbol'] = market['id'];
153434
- if (timeframe === '1M' || timeframe === '1y') {
153435
- // for some reason 1M and 1Y does not work with the regular endpoint
153436
- // https://github.com/ccxt/ccxt/issues/18006
153504
+ let useHistorical = undefined;
153505
+ [useHistorical, params] = this.handleOptionAndParams(params, 'fetchOHLCV', 'useHistoricalEndpointForSpot', true);
153506
+ if (!useHistorical) {
153507
+ // `limit` only available for the this endpoint
153508
+ if (limit !== undefined) {
153509
+ request['size'] = limit; // max 2000
153510
+ }
153437
153511
  response = await this.spotPublicGetMarketHistoryKline(this.extend(request, params));
153438
153512
  }
153439
153513
  else {
153514
+ // `since` only available for the this endpoint
153515
+ if (since !== undefined) {
153516
+ // default 150 bars
153517
+ request['from'] = this.parseToInt(since / 1000);
153518
+ }
153440
153519
  response = await this.spotPublicGetMarketHistoryCandles(this.extend(request, params));
153441
153520
  }
153442
153521
  }
@@ -161876,7 +161955,7 @@ class hyperliquid extends _abstract_hyperliquid_js__WEBPACK_IMPORTED_MODULE_0__/
161876
161955
  'optionType': undefined,
161877
161956
  'precision': {
161878
161957
  'amount': this.parseNumber(this.parsePrecision(this.safeString(market, 'szDecimals'))),
161879
- 'price': this.parseNumber('5'), // significant digits
161958
+ 'price': 5, // significant digits
161880
161959
  },
161881
161960
  'limits': {
161882
161961
  'leverage': {
@@ -162358,6 +162437,7 @@ class hyperliquid extends _abstract_hyperliquid_js__WEBPACK_IMPORTED_MODULE_0__/
162358
162437
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' market orders require price to calculate the max slippage price. Default slippage can be set in options (default is 5%).');
162359
162438
  }
162360
162439
  px = (isBuy) ? _base_Precise_js__WEBPACK_IMPORTED_MODULE_6__/* .Precise */ .O.stringMul(price, _base_Precise_js__WEBPACK_IMPORTED_MODULE_6__/* .Precise */ .O.stringAdd('1', slippage)) : _base_Precise_js__WEBPACK_IMPORTED_MODULE_6__/* .Precise */ .O.stringMul(price, _base_Precise_js__WEBPACK_IMPORTED_MODULE_6__/* .Precise */ .O.stringSub('1', slippage));
162440
+ px = this.priceToPrecision(symbol, px); // round after adding slippage
162361
162441
  }
162362
162442
  else {
162363
162443
  px = this.priceToPrecision(symbol, price);
@@ -262149,16 +262229,17 @@ class krakenfutures extends _krakenfutures_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
262149
262229
  const market = this.market(marketId);
262150
262230
  const symbol = market['symbol'];
262151
262231
  const messageHash = 'trade:' + symbol;
262152
- let tradesArray = this.safeValue(this.trades, symbol);
262153
- if (tradesArray === undefined) {
262232
+ if (this.safeList(this.trades, symbol) === undefined) {
262154
262233
  const tradesLimit = this.safeInteger(this.options, 'tradesLimit', 1000);
262155
- tradesArray = new _base_ws_Cache_js__WEBPACK_IMPORTED_MODULE_1__/* .ArrayCache */ .ZL(tradesLimit);
262156
- this.trades[symbol] = tradesArray;
262234
+ this.trades[symbol] = new _base_ws_Cache_js__WEBPACK_IMPORTED_MODULE_1__/* .ArrayCache */ .ZL(tradesLimit);
262157
262235
  }
262236
+ const tradesArray = this.trades[symbol];
262158
262237
  if (channel === 'trade_snapshot') {
262159
- const trades = this.safeValue(message, 'trades', []);
262160
- for (let i = 0; i < trades.length; i++) {
262161
- const item = trades[i];
262238
+ const trades = this.safeList(message, 'trades', []);
262239
+ const length = trades.length;
262240
+ for (let i = 0; i < length; i++) {
262241
+ const index = length - 1 - i; // need reverse to correct chronology
262242
+ const item = trades[index];
262162
262243
  const trade = this.parseWsTrade(item);
262163
262244
  tradesArray.append(trade);
262164
262245
  }
@@ -320790,7 +320871,7 @@ SOFTWARE.
320790
320871
 
320791
320872
  //-----------------------------------------------------------------------------
320792
320873
  // this is updated by vss.js when building
320793
- const version = '4.2.73';
320874
+ const version = '4.2.74';
320794
320875
  _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e.ccxtVersion = version;
320795
320876
  //-----------------------------------------------------------------------------
320796
320877