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.
- package/README.md +5 -5
- package/build.sh +1 -1
- package/dist/ccxt.browser.js +181 -100
- package/dist/ccxt.browser.min.js +2 -2
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/base/Exchange.js +1 -1
- package/dist/cjs/src/bitget.js +62 -50
- package/dist/cjs/src/bybit.js +90 -30
- package/dist/cjs/src/coinbaseinternational.js +1 -1
- package/dist/cjs/src/htx.js +16 -9
- package/dist/cjs/src/hyperliquid.js +2 -1
- package/dist/cjs/src/pro/krakenfutures.js +8 -7
- package/examples/README.md +308 -0
- package/examples/ccxt.pro/html/watchTicker.html +51 -0
- package/examples/ccxt.pro/js/binance-fetch-balance-snapshot-watch-balance-updates.js +55 -0
- package/examples/ccxt.pro/js/binance-https-proxy.js +48 -0
- package/examples/ccxt.pro/js/binance-watch-ohlcv-many-symbols-continuously.js +38 -0
- package/examples/ccxt.pro/js/binance-watch-ohlcv-many-symbols.js +64 -0
- package/examples/ccxt.pro/js/binance-watch-ticker-many-symbols.js +62 -0
- package/examples/ccxt.pro/js/build-ohlcv-many-symbols.js +68 -0
- package/examples/ccxt.pro/js/calculate-ohlcvs-from-trades-warmup.js +82 -0
- package/examples/ccxt.pro/js/calculate-ohlcvs-from-trades.js +59 -0
- package/examples/ccxt.pro/js/exchange-capabitities.js +72 -0
- package/examples/ccxt.pro/js/exchange-close.js +46 -0
- package/examples/ccxt.pro/js/gateio-swap-watch-many-orderbooks.js +30 -0
- package/examples/ccxt.pro/js/gateio-watch-balance.js +23 -0
- package/examples/ccxt.pro/js/gateio-watch-order-book.js +71 -0
- package/examples/ccxt.pro/js/graceful-shutdown.js +43 -0
- package/examples/ccxt.pro/js/many-exchanges-many-streams.js +37 -0
- package/examples/ccxt.pro/js/okex-create-futures-order.js +48 -0
- package/examples/ccxt.pro/js/okex-watch-balance-and-create-order.js +54 -0
- package/examples/ccxt.pro/js/okx-watch-tickers.js +31 -0
- package/examples/ccxt.pro/js/one-exchange-many-different-streams.js +46 -0
- package/examples/ccxt.pro/js/one-exchange-many-streams-2.js +26 -0
- package/examples/ccxt.pro/js/one-exchange-many-streams.js +28 -0
- package/examples/ccxt.pro/js/socks-binance-watch-orderbook.js +30 -0
- package/examples/ccxt.pro/js/watch-fetch-many-exchanges-many-ordersbooks.js +40 -0
- package/examples/ccxt.pro/js/watch-many-exchanges-many-ordersbooks.js +38 -0
- package/examples/ccxt.pro/js/watch-many-exchanges-many-symbols.js +40 -0
- package/examples/ccxt.pro/js/watch-many-orderbooks.js +27 -0
- package/examples/ccxt.pro/js/watch-new-trades-only.js +43 -0
- package/examples/ccxt.pro/js/watch-new-trades.js +42 -0
- package/examples/ccxt.pro/js/watch-trades-many-symbols.js +29 -0
- package/examples/ccxt.pro/js/watch-vs-fetch.js +29 -0
- package/examples/cs/Examples.sln +22 -0
- package/examples/cs/c#.csproj +19 -0
- package/examples/html/basic-cors-proxy.html +46 -0
- package/examples/html/basic-inheritance.html +47 -0
- package/examples/html/basic-poller.html +52 -0
- package/examples/html/basic-rate-limiting.html +49 -0
- package/examples/html/basic.html +43 -0
- package/examples/html/binance-cors-proxy.html +28 -0
- package/examples/html/bitmex-browser-cors-proxy.js +7 -0
- package/examples/html/bitmex-cors.html +46 -0
- package/examples/html/tradingview-charts.html +61 -0
- package/examples/html/webworker/index.html +97 -0
- package/examples/html/webworker/worker.js +43 -0
- package/examples/js/README.md +15 -0
- package/examples/js/advanced-error-handling.js +39 -0
- package/examples/js/aggregate-orderbook.js +54 -0
- package/examples/js/arbitrage-pairs.js +130 -0
- package/examples/js/basic-chart.js +29 -0
- package/examples/js/basic-orderbook-polling.js +13 -0
- package/examples/js/bcc-vs-bch.js +115 -0
- package/examples/js/binance-fetch-all-deposits.js +45 -0
- package/examples/js/binance-fetch-ohlcv-many-symbols-async-await.js +34 -0
- package/examples/js/binance-fetch-ohlcv-many-symbols-promise-then-callbacks.js +33 -0
- package/examples/js/binance-fetchTicker-delivery-vs-future.js +31 -0
- package/examples/js/binance-futures-transfer-from-sub-account-to-master.js +41 -0
- package/examples/js/binance-margin-stop-order.js +39 -0
- package/examples/js/binance-server-time.js +34 -0
- package/examples/js/binance-universal-transfer.js +16 -0
- package/examples/js/bitfinex-fetch-trades.js +35 -0
- package/examples/js/bitfinex2-fetch-trades.js +35 -0
- package/examples/js/bitmex-browser-cors-proxy.js +7 -0
- package/examples/js/bitpanda-fetchMyTrades-reduce.js +36 -0
- package/examples/js/bitrue-fetch-balance.js +28 -0
- package/examples/js/bitstamp-private-api.js +115 -0
- package/examples/js/bitstamp-public-api.js +39 -0
- package/examples/js/bittrex-balance.js +50 -0
- package/examples/js/bittrex-fetch-closed-orders-history.js +69 -0
- package/examples/js/blockchaincom-withdrawal.js +59 -0
- package/examples/js/build-ohlcv-bars.js +48 -0
- package/examples/js/builtin-rate-limiting-rest-poller.js +25 -0
- package/examples/js/bybit-trailing.js +62 -0
- package/examples/js/bybit-updated.cjs +154 -0
- package/examples/js/cli.js +405 -0
- package/examples/js/coinbase-fetch-all-balances.js +36 -0
- package/examples/js/coinex-fetch-all-deposit-addresses-using-fetchDepositAddress.js +47 -0
- package/examples/js/coinex-futures.js +75 -0
- package/examples/js/coinone-fetch-tickers.js +54 -0
- package/examples/js/coinone-markets.js +16 -0
- package/examples/js/compare-two-exchanges-capabilities.js +36 -0
- package/examples/js/cors-proxy.js +5 -0
- package/examples/js/create-order-handle-errors.js +55 -0
- package/examples/js/create-order-position-with-takeprofit-stoploss.js +71 -0
- package/examples/js/create-order-with-retry.js +65 -0
- package/examples/js/create-order-ws-example.js +25 -0
- package/examples/js/create-orders-example.js +17 -0
- package/examples/js/create-trailing-amount-order.js +36 -0
- package/examples/js/create-trailing-percent-order.js +36 -0
- package/examples/js/credentials.json +5 -0
- package/examples/js/custom-proxy-agent-for-js.js +10 -0
- package/examples/js/custom-proxy-url.js +23 -0
- package/examples/js/delta-maintenance-margin-rate-max-leverage.js +60 -0
- package/examples/js/env-variables.js +26 -0
- package/examples/js/error-handling.js +89 -0
- package/examples/js/exchange-capabilities.js +135 -0
- package/examples/js/exchanges-by-volume.js +60 -0
- package/examples/js/exchanges.js +40 -0
- package/examples/js/fetch-all-balances.js +219 -0
- package/examples/js/fetch-all-tickers-to-files-2.js +53 -0
- package/examples/js/fetch-all-tickers-to-files.js +77 -0
- package/examples/js/fetch-balance.js +28 -0
- package/examples/js/fetch-create-deposit-address.js +101 -0
- package/examples/js/fetch-from-many-exchanges-simultaneously.js +21 -0
- package/examples/js/fetch-funding-rate-history.js +25 -0
- package/examples/js/fetch-futures/prettier.config.js +5 -0
- package/examples/js/fetch-futures/src/index.js +25 -0
- package/examples/js/fetch-ohlcv-from-to-mark-index-premium.js +72 -0
- package/examples/js/fetch-ohlcv-many-exchanges-continuosly.js +39 -0
- package/examples/js/fetch-ohlcv.js +16 -0
- package/examples/js/fetch-okex-futures.js +22 -0
- package/examples/js/fetch-orders.js +27 -0
- package/examples/js/fetch-ticker-from-multiple-exchanges.js +35 -0
- package/examples/js/fetch-ticker-where-available.js +75 -0
- package/examples/js/fetch-tickers/build/index.js +19 -0
- package/examples/js/fetch-tickers/prettier.config.js +5 -0
- package/examples/js/fetch-tickers/src/index.js +17 -0
- package/examples/js/gateio-create-batch-order.js +43 -0
- package/examples/js/gateio-futures.js +49 -0
- package/examples/js/gateio-open-close-contract.js +49 -0
- package/examples/js/gateio-swaps.js +74 -0
- package/examples/js/gdax-fetch-trades-pagination.js +29 -0
- package/examples/js/hitbtc2-withdraw.js +61 -0
- package/examples/js/how-to-import-one-exchange-esm.js +10 -0
- package/examples/js/huobi-futures.js +71 -0
- package/examples/js/huobi-open-close-contract.js +63 -0
- package/examples/js/huobi-swaps.js +70 -0
- package/examples/js/huobipro-market-buy-sell-fetch-trading-limits.js +98 -0
- package/examples/js/hybridCJSExample.cjs +19 -0
- package/examples/js/hybridESMExample.js +19 -0
- package/examples/js/idex-fetch-balance.js +13 -0
- package/examples/js/instantiate-all-at-once.js +46 -0
- package/examples/js/instantiate-all-from-json.js +31 -0
- package/examples/js/kraken-create-and-close-position.js +54 -0
- package/examples/js/kraken-fetch-order-trades.js +33 -0
- package/examples/js/kraken-margin-trading.js +89 -0
- package/examples/js/kucoin-rate-limit.js +38 -0
- package/examples/js/latoken-example.js +108 -0
- package/examples/js/live-orderbook.js +106 -0
- package/examples/js/live-ticker.js +80 -0
- package/examples/js/live-tickers.js +74 -0
- package/examples/js/load-all-contracts.js +41 -0
- package/examples/js/load-all-symbols-at-once.js +69 -0
- package/examples/js/load-all-tickers-at-once.js +91 -0
- package/examples/js/load-markets-to-files.js +57 -0
- package/examples/js/looping-over-all-symbols-of-specific-exchanges.js +61 -0
- package/examples/js/looping-over-specific-symbols-of-all-exchanges.js +91 -0
- package/examples/js/margin-loan-borrow-buy-sell-repay.js +70 -0
- package/examples/js/market-status-and-currency-status.js +29 -0
- package/examples/js/ohlcv-console-chart.js +29 -0
- package/examples/js/okex-fetch-closed-orders-archive.js +31 -0
- package/examples/js/okex-transfer.js +51 -0
- package/examples/js/okx-poll-fetch-my-trades.js +37 -0
- package/examples/js/okx-poll-rate-limit.js +48 -0
- package/examples/js/order-book-extra-level-depth-param.js +20 -0
- package/examples/js/phemex-create-order-position-with-takeprofit-stoploss.js +49 -0
- package/examples/js/poll-ohlcv.js +43 -0
- package/examples/js/poloniex-fetch-order-books.js +35 -0
- package/examples/js/poloniex-limits-amount-min.js +62 -0
- package/examples/js/proxy-round-robin.js +98 -0
- package/examples/js/proxy-usage.js +32 -0
- package/examples/js/sample-local-proxy-server-with-cors.js +12 -0
- package/examples/js/search-all-exchanges.js +159 -0
- package/examples/js/shared-load-markets.js +80 -0
- package/examples/js/sort-swap-markets-by-hourly-price-change.js +55 -0
- package/examples/js/symbols.js +110 -0
- package/examples/js/theocean.js +41 -0
- package/examples/js/tickers.js +106 -0
- package/examples/js/validate-paginated-data.js +61 -0
- package/examples/js/watch-OHLCV-For-Symbols.js +15 -0
- package/examples/js/watch-OHLCV.js +12 -0
- package/examples/js/watch-OrderBook-For-Symbols.js +11 -0
- package/examples/js/watch-Trades-For-Symbols.js +11 -0
- package/examples/js/watch-tickers.js +11 -0
- package/examples/js/watchOHLCVForSymbols.js +15 -0
- package/examples/js/watchOrderBookForSymbols.js +11 -0
- package/examples/js/watchPositions-many-exchanges-continuosly.d.ts +2 -0
- package/examples/js/watchPositions-many-exchanges-continuosly.d.ts.map +1 -0
- package/examples/js/watchPositions-many-exchanges-continuosly.js +49 -0
- package/examples/js/watchPositions.d.ts +2 -0
- package/examples/js/watchPositions.d.ts.map +1 -0
- package/examples/js/watchPositions.js +13 -0
- package/examples/js/watchPositionsForSymbols.d.ts +2 -0
- package/examples/js/watchPositionsForSymbols.d.ts.map +1 -0
- package/examples/js/watchPositionsForSymbols.js +14 -0
- package/examples/js/watchTradesForSymbols.js +11 -0
- package/examples/js/withdraw-from-one-exchange-to-another.js +50 -0
- package/examples/php/README.md +7 -0
- package/examples/py/README.md +15 -0
- package/examples/py/playing_with_ccxt_example.ipynb +222 -0
- package/examples/ts/.eslintrc +111 -0
- package/examples/ts/build-ohlcv-bars.ts +53 -0
- package/examples/ts/cli.ts +397 -0
- package/examples/ts/compare-two-exchanges-capabilities.ts +36 -0
- package/examples/ts/create-order-position-with-takeprofit-stoploss.ts +89 -0
- package/examples/ts/create-order-ws-example.ts +33 -0
- package/examples/ts/create-orders-example.ts +21 -0
- package/examples/ts/create-trailing-amount-order.ts +37 -0
- package/examples/ts/create-trailing-percent-order.ts +37 -0
- package/examples/ts/custom-proxy-agent-for-js.ts +14 -0
- package/examples/ts/fetch-futures/package-lock.json +116 -0
- package/examples/ts/fetch-futures/package.json +34 -0
- package/examples/ts/fetch-futures/prettier.config.js +4 -0
- package/examples/ts/fetch-futures/src/index.ts +28 -0
- package/examples/ts/fetch-futures/tsconfig.json +28 -0
- package/examples/ts/fetch-ohlcv-many-exchanges-continuosly.ts +44 -0
- package/examples/ts/fetch-ohlcv.ts +17 -0
- package/examples/ts/fetch-tickers/package-lock.json +116 -0
- package/examples/ts/fetch-tickers/package.json +34 -0
- package/examples/ts/fetch-tickers/prettier.config.js +4 -0
- package/examples/ts/fetch-tickers/src/index.ts +21 -0
- package/examples/ts/fetch-tickers/tsconfig.json +28 -0
- package/examples/ts/how-to-import-one-exchange-esm.ts +11 -0
- package/examples/ts/kraken-create-and-close-position.ts +69 -0
- package/examples/ts/margin-loan-borrow-buy-sell-repay.ts +72 -0
- package/examples/ts/nextjs-page-router/.eslintrc.json +3 -0
- package/examples/ts/nextjs-page-router/README.md +43 -0
- package/examples/ts/nextjs-page-router/next.config.js +6 -0
- package/examples/ts/nextjs-page-router/package-lock.json +7425 -0
- package/examples/ts/nextjs-page-router/package.json +28 -0
- package/examples/ts/nextjs-page-router/postcss.config.js +6 -0
- package/examples/ts/nextjs-page-router/public/favicon.ico +0 -0
- package/examples/ts/nextjs-page-router/src/pages/_app.tsx +6 -0
- package/examples/ts/nextjs-page-router/src/pages/_document.tsx +13 -0
- package/examples/ts/nextjs-page-router/src/pages/balance.tsx +46 -0
- package/examples/ts/nextjs-page-router/src/pages/index.tsx +8 -0
- package/examples/ts/nextjs-page-router/src/pages/tickers.tsx +61 -0
- package/examples/ts/nextjs-page-router/src/styles/globals.css +27 -0
- package/examples/ts/nextjs-page-router/tailwind.config.ts +20 -0
- package/examples/ts/nextjs-page-router/tsconfig.json +22 -0
- package/examples/ts/phemex-create-order-position-with-takeprofit-stoploss.ts +62 -0
- package/examples/ts/proxy-usage.ts +41 -0
- package/examples/ts/sample-local-proxy-server-with-cors.ts +15 -0
- package/examples/ts/watch-OHLCV-For-Symbols.ts +17 -0
- package/examples/ts/watch-OHLCV.ts +14 -0
- package/examples/ts/watch-OrderBook-For-Symbols.ts +13 -0
- package/examples/ts/watch-Trades-For-Symbols.ts +13 -0
- package/examples/ts/watch-tickers.ts +13 -0
- package/examples/ts/watchPositions-many-exchanges-continuosly.ts +53 -0
- package/examples/ts/watchPositions.ts +15 -0
- package/examples/ts/watchPositionsForSymbols.ts +16 -0
- package/examples/tsconfig.json +27 -0
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/base/Exchange.d.ts +2 -2
- package/js/src/base/Exchange.js +1 -1
- package/js/src/bitget.js +62 -50
- package/js/src/bybit.d.ts +3 -1
- package/js/src/bybit.js +90 -30
- package/js/src/coinbaseinternational.js +1 -1
- package/js/src/htx.js +16 -9
- package/js/src/hyperliquid.js +2 -1
- package/js/src/pro/krakenfutures.js +8 -7
- package/package.json +4 -1
- package/skip-tests.json +214 -424
package/README.md
CHANGED
|
@@ -42,7 +42,7 @@ Current feature list:
|
|
|
42
42
|
| [](http://www.bitmart.com/?r=rQCFLh) | bitmart | [BitMart](http://www.bitmart.com/?r=rQCFLh) | [](https://developer-pro.bitmart.com/) | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | [](http://www.bitmart.com/?r=rQCFLh) |
|
|
43
43
|
| [](https://www.bitmex.com/app/register/NZTR1q) | bitmex | [BitMEX](https://www.bitmex.com/app/register/NZTR1q) | [](https://www.bitmex.com/app/apiOverview) | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | [](https://www.bitmex.com/app/register/NZTR1q) |
|
|
44
44
|
| [](https://www.bybit.com/register?affiliate_id=35953) | bybit | [Bybit](https://www.bybit.com/register?affiliate_id=35953) | [](https://bybit-exchange.github.io/docs/inverse/) | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | |
|
|
45
|
-
| [](https://
|
|
45
|
+
| [](https://international.coinbase.com) | coinbaseinternational | [coinbase International](https://international.coinbase.com) | [](https://docs.cloud.coinbaseinternational.com/intx/docs) | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | |
|
|
46
46
|
| [](https://www.coinex.com/register?refer_code=yw5fz) | coinex | [CoinEx](https://www.coinex.com/register?refer_code=yw5fz) | [](https://github.com/coinexcom/coinex_exchange_api/wiki) | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | |
|
|
47
47
|
| [](https://crypto.com/exch/kdacthrnxt) | cryptocom | [Crypto.com](https://crypto.com/exch/kdacthrnxt) | [](https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html) | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | [](https://crypto.com/exch/kdacthrnxt) |
|
|
48
48
|
| [](https://www.gate.io/signup/2436035) | gate | [Gate.io](https://www.gate.io/signup/2436035) | [](https://www.gate.io/docs/developers/apiv4/en/) | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | [](https://www.gate.io/signup/2436035) |
|
|
@@ -95,7 +95,7 @@ The CCXT library currently supports the following 96 cryptocurrency exchange mar
|
|
|
95
95
|
| [](https://www.bybit.com/register?affiliate_id=35953) | bybit | [Bybit](https://www.bybit.com/register?affiliate_id=35953) | [](https://bybit-exchange.github.io/docs/inverse/) | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) |
|
|
96
96
|
| [](https://cex.io/r/0/up105393824/0/) | cex | [CEX.IO](https://cex.io/r/0/up105393824/0/) | [](https://cex.io/cex-api) | | [](https://ccxt.pro) |
|
|
97
97
|
| [](https://www.coinbase.com/join/58cbe25a355148797479dbd2) | coinbase | [Coinbase](https://www.coinbase.com/join/58cbe25a355148797479dbd2) | [](https://developers.coinbase.com/api/v2) | | [](https://ccxt.pro) |
|
|
98
|
-
| [](https://
|
|
98
|
+
| [](https://international.coinbase.com) | coinbaseinternational | [coinbase International](https://international.coinbase.com) | [](https://docs.cloud.coinbaseinternational.com/intx/docs) | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) |
|
|
99
99
|
| [](https://pro.coinbase.com/) | coinbasepro | [Coinbase Pro](https://pro.coinbase.com/) | [](https://docs.pro.coinbase.com) | | [](https://ccxt.pro) |
|
|
100
100
|
| [](https://coincheck.com) | coincheck | [coincheck](https://coincheck.com) | [](https://coincheck.com/documents/exchange/api) | | |
|
|
101
101
|
| [](https://www.coinex.com/register?refer_code=yw5fz) | coinex | [CoinEx](https://www.coinex.com/register?refer_code=yw5fz) | [](https://github.com/coinexcom/coinex_exchange_api/wiki) | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](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.
|
|
216
|
-
* unpkg: https://unpkg.com/ccxt@4.2.
|
|
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.
|
|
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
package/dist/ccxt.browser.js
CHANGED
|
@@ -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 =
|
|
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
|
|
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,
|
|
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
|
|
48431
|
+
const msInDay = 86400000;
|
|
48430
48432
|
const duration = this.parseTimeframe(timeframe) * 1000;
|
|
48431
48433
|
const request = {
|
|
48432
48434
|
'symbol': market['id'],
|
|
48433
|
-
'granularity':
|
|
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
|
|
48463
|
-
const endpointTsBoundary = now -
|
|
48464
|
-
|
|
48465
|
-
|
|
48466
|
-
|
|
48467
|
-
|
|
48468
|
-
|
|
48469
|
-
|
|
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
|
|
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
|
-
|
|
48486
|
-
if (
|
|
48487
|
-
|
|
48488
|
-
|
|
48489
|
-
|
|
48490
|
-
|
|
48491
|
-
|
|
48492
|
-
|
|
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
|
-
|
|
48496
|
-
params = this.
|
|
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 (
|
|
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://
|
|
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
|
-
|
|
153435
|
-
|
|
153436
|
-
|
|
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':
|
|
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
|
-
|
|
262153
|
-
if (tradesArray === undefined) {
|
|
262232
|
+
if (this.safeList(this.trades, symbol) === undefined) {
|
|
262154
262233
|
const tradesLimit = this.safeInteger(this.options, 'tradesLimit', 1000);
|
|
262155
|
-
|
|
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.
|
|
262160
|
-
|
|
262161
|
-
|
|
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.
|
|
320874
|
+
const version = '4.2.74';
|
|
320794
320875
|
_src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e.ccxtVersion = version;
|
|
320795
320876
|
//-----------------------------------------------------------------------------
|
|
320796
320877
|
|