ccxt 4.2.72 → 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 +124 -122
- package/build.sh +2 -2
- package/dist/ccxt.browser.js +3277 -460
- package/dist/ccxt.browser.min.js +4 -4
- package/dist/cjs/ccxt.js +6 -1
- package/dist/cjs/src/abstract/coinbaseinternational.js +9 -0
- package/dist/cjs/src/base/Exchange.js +31 -7
- package/dist/cjs/src/bitget.js +62 -50
- package/dist/cjs/src/btcturk.js +3 -3
- package/dist/cjs/src/bybit.js +90 -30
- package/dist/cjs/src/coinbaseinternational.js +2019 -0
- package/dist/cjs/src/gate.js +1 -1
- package/dist/cjs/src/htx.js +16 -9
- package/dist/cjs/src/hyperliquid.js +9 -2
- package/dist/cjs/src/mexc.js +1 -1
- package/dist/cjs/src/okx.js +1 -1
- package/dist/cjs/src/pro/coinbaseinternational.js +645 -0
- 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 +8 -2
- package/js/ccxt.js +6 -2
- package/js/src/abstract/coinbaseinternational.d.ts +42 -0
- package/js/src/abstract/coinbaseinternational.js +11 -0
- package/js/src/ace.d.ts +2 -2
- package/js/src/alpaca.d.ts +2 -2
- package/js/src/ascendex.d.ts +3 -3
- package/js/src/base/Exchange.d.ts +27 -24
- package/js/src/base/Exchange.js +31 -7
- package/js/src/bigone.d.ts +2 -2
- package/js/src/binance.d.ts +7 -7
- package/js/src/bingx.d.ts +4 -4
- package/js/src/bit2c.d.ts +2 -2
- package/js/src/bitbank.d.ts +2 -2
- package/js/src/bitbns.d.ts +2 -2
- package/js/src/bitfinex.d.ts +3 -3
- package/js/src/bitfinex2.d.ts +4 -4
- package/js/src/bitflyer.d.ts +2 -2
- package/js/src/bitget.d.ts +4 -4
- package/js/src/bitget.js +62 -50
- package/js/src/bithumb.d.ts +2 -2
- package/js/src/bitmart.d.ts +4 -4
- package/js/src/bitmex.d.ts +3 -3
- package/js/src/bitopro.d.ts +2 -2
- package/js/src/bitrue.d.ts +2 -2
- package/js/src/bitso.d.ts +2 -2
- package/js/src/bitstamp.d.ts +2 -2
- package/js/src/bitteam.d.ts +2 -2
- package/js/src/bitvavo.d.ts +4 -4
- package/js/src/bl3p.d.ts +2 -2
- package/js/src/blockchaincom.d.ts +2 -2
- package/js/src/blofin.d.ts +4 -4
- package/js/src/btcalpha.d.ts +2 -2
- package/js/src/btcbox.d.ts +2 -2
- package/js/src/btcmarkets.d.ts +2 -2
- package/js/src/btcturk.d.ts +2 -2
- package/js/src/btcturk.js +3 -3
- package/js/src/bybit.d.ts +8 -6
- package/js/src/bybit.js +90 -30
- package/js/src/cex.d.ts +3 -3
- package/js/src/coinbase.d.ts +3 -3
- package/js/src/coinbaseinternational.d.ts +146 -0
- package/js/src/coinbaseinternational.js +2020 -0
- package/js/src/coinbasepro.d.ts +2 -2
- package/js/src/coincheck.d.ts +2 -2
- package/js/src/coinex.d.ts +4 -4
- package/js/src/coinlist.d.ts +3 -3
- package/js/src/coinmate.d.ts +2 -2
- package/js/src/coinmetro.d.ts +2 -2
- package/js/src/coinone.d.ts +2 -2
- package/js/src/coinsph.d.ts +2 -2
- package/js/src/coinspot.d.ts +2 -2
- package/js/src/cryptocom.d.ts +4 -4
- package/js/src/currencycom.d.ts +2 -2
- package/js/src/delta.d.ts +3 -3
- package/js/src/deribit.d.ts +3 -3
- package/js/src/digifinex.d.ts +3 -3
- package/js/src/exmo.d.ts +3 -3
- package/js/src/gate.d.ts +4 -4
- package/js/src/gate.js +1 -1
- package/js/src/gemini.d.ts +2 -2
- package/js/src/hitbtc.d.ts +4 -4
- package/js/src/hollaex.d.ts +2 -2
- package/js/src/htx.d.ts +5 -5
- package/js/src/htx.js +16 -9
- package/js/src/huobijp.d.ts +2 -2
- package/js/src/hyperliquid.d.ts +4 -3
- package/js/src/hyperliquid.js +10 -3
- package/js/src/idex.d.ts +2 -2
- package/js/src/independentreserve.d.ts +2 -2
- package/js/src/indodax.d.ts +2 -2
- package/js/src/kraken.d.ts +3 -3
- package/js/src/krakenfutures.d.ts +4 -4
- package/js/src/kucoin.d.ts +4 -4
- package/js/src/kucoinfutures.d.ts +3 -3
- package/js/src/kuna.d.ts +2 -2
- package/js/src/latoken.d.ts +2 -2
- package/js/src/lbank.d.ts +2 -2
- package/js/src/luno.d.ts +2 -2
- package/js/src/lykke.d.ts +2 -2
- package/js/src/mercado.d.ts +2 -2
- package/js/src/mexc.d.ts +2 -2
- package/js/src/mexc.js +1 -1
- package/js/src/ndax.d.ts +3 -3
- package/js/src/novadax.d.ts +2 -2
- package/js/src/oceanex.d.ts +2 -2
- package/js/src/okcoin.d.ts +3 -3
- package/js/src/okx.d.ts +4 -4
- package/js/src/okx.js +1 -1
- package/js/src/onetrading.d.ts +2 -2
- package/js/src/p2b.d.ts +2 -2
- package/js/src/paymium.d.ts +2 -2
- package/js/src/phemex.d.ts +3 -3
- package/js/src/poloniex.d.ts +3 -3
- package/js/src/poloniexfutures.d.ts +2 -2
- package/js/src/pro/binance.d.ts +3 -3
- package/js/src/pro/bitvavo.d.ts +3 -3
- package/js/src/pro/cex.d.ts +3 -3
- package/js/src/pro/coinbaseinternational.d.ts +28 -0
- package/js/src/pro/coinbaseinternational.js +646 -0
- package/js/src/pro/cryptocom.d.ts +2 -2
- package/js/src/pro/hitbtc.d.ts +2 -2
- package/js/src/pro/kraken.d.ts +3 -3
- package/js/src/pro/krakenfutures.js +8 -7
- package/js/src/pro/okx.d.ts +3 -3
- package/js/src/pro/poloniex.d.ts +2 -2
- package/js/src/probit.d.ts +2 -2
- package/js/src/timex.d.ts +3 -3
- package/js/src/tokocrypto.d.ts +2 -2
- package/js/src/upbit.d.ts +2 -2
- package/js/src/wavesexchange.d.ts +2 -2
- package/js/src/wazirx.d.ts +2 -2
- package/js/src/whitebit.d.ts +2 -2
- package/js/src/woo.d.ts +5 -5
- package/js/src/yobit.d.ts +2 -2
- package/js/src/zaif.d.ts +2 -2
- package/js/src/zonda.d.ts +2 -2
- package/package.json +4 -1
- package/skip-tests.json +227 -424
package/dist/ccxt.browser.js
CHANGED
|
@@ -512,6 +512,22 @@ class Exchange extends _base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchang
|
|
|
512
512
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Exchange);
|
|
513
513
|
|
|
514
514
|
|
|
515
|
+
/***/ }),
|
|
516
|
+
|
|
517
|
+
/***/ 931:
|
|
518
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
519
|
+
|
|
520
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
521
|
+
/* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
522
|
+
/* harmony export */ });
|
|
523
|
+
/* harmony import */ var _base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3043);
|
|
524
|
+
// -------------------------------------------------------------------------------
|
|
525
|
+
|
|
526
|
+
class Exchange extends _base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e {
|
|
527
|
+
}
|
|
528
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Exchange);
|
|
529
|
+
|
|
530
|
+
|
|
515
531
|
/***/ }),
|
|
516
532
|
|
|
517
533
|
/***/ 2925:
|
|
@@ -7263,7 +7279,7 @@ class Exchange {
|
|
|
7263
7279
|
this.last_request_body = undefined;
|
|
7264
7280
|
this.last_request_url = undefined;
|
|
7265
7281
|
this.last_request_path = undefined;
|
|
7266
|
-
this.id =
|
|
7282
|
+
this.id = 'Exchange';
|
|
7267
7283
|
this.markets = undefined;
|
|
7268
7284
|
this.status = undefined;
|
|
7269
7285
|
this.rateLimit = undefined; // milliseconds
|
|
@@ -9171,6 +9187,15 @@ class Exchange {
|
|
|
9171
9187
|
async fetchFundingRates(symbols = undefined, params = {}) {
|
|
9172
9188
|
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchFundingRates() is not supported yet');
|
|
9173
9189
|
}
|
|
9190
|
+
async watchFundingRate(symbol, params = {}) {
|
|
9191
|
+
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' watchFundingRate() is not supported yet');
|
|
9192
|
+
}
|
|
9193
|
+
async watchFundingRates(symbols, params = {}) {
|
|
9194
|
+
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' watchFundingRates() is not supported yet');
|
|
9195
|
+
}
|
|
9196
|
+
async watchFundingRatesForSymbols(symbols, params = {}) {
|
|
9197
|
+
return await this.watchFundingRates(symbols, params);
|
|
9198
|
+
}
|
|
9174
9199
|
async transfer(code, amount, fromAccount, toAccount, params = {}) {
|
|
9175
9200
|
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' transfer() is not supported yet');
|
|
9176
9201
|
}
|
|
@@ -10421,11 +10446,19 @@ class Exchange {
|
|
|
10421
10446
|
// for example, if 'ETH' is passed for networkCode, but 'ETH' key not defined in `options->networks` object
|
|
10422
10447
|
if (networkId === undefined) {
|
|
10423
10448
|
if (currencyCode === undefined) {
|
|
10424
|
-
|
|
10425
|
-
|
|
10449
|
+
const currencies = Object.values(this.currencies);
|
|
10450
|
+
for (let i = 0; i < currencies.length; i++) {
|
|
10451
|
+
const currency = [i];
|
|
10452
|
+
const networks = this.safeDict(currency, 'networks');
|
|
10453
|
+
const network = this.safeDict(networks, networkCode);
|
|
10454
|
+
networkId = this.safeString(network, 'id');
|
|
10455
|
+
if (networkId !== undefined) {
|
|
10456
|
+
break;
|
|
10457
|
+
}
|
|
10458
|
+
}
|
|
10426
10459
|
}
|
|
10427
10460
|
else {
|
|
10428
|
-
// if currencyCode was provided, then we try to find if that currencyCode has a replacement (i.e. ERC20 for ETH)
|
|
10461
|
+
// if currencyCode was provided, then we try to find if that currencyCode has a replacement (i.e. ERC20 for ETH) or is in the currency
|
|
10429
10462
|
const defaultNetworkCodeReplacements = this.safeValue(this.options, 'defaultNetworkCodeReplacements', {});
|
|
10430
10463
|
if (currencyCode in defaultNetworkCodeReplacements) {
|
|
10431
10464
|
// if there is a replacement for the passed networkCode, then we use it to find network-id in `options->networks` object
|
|
@@ -10441,11 +10474,18 @@ class Exchange {
|
|
|
10441
10474
|
}
|
|
10442
10475
|
}
|
|
10443
10476
|
}
|
|
10444
|
-
|
|
10445
|
-
|
|
10446
|
-
|
|
10477
|
+
else {
|
|
10478
|
+
// serach for network inside currency
|
|
10479
|
+
const currency = this.safeDict(this.currencies, currencyCode);
|
|
10480
|
+
const networks = this.safeDict(currency, 'networks');
|
|
10481
|
+
const network = this.safeDict(networks, networkCode);
|
|
10482
|
+
networkId = this.safeString(network, 'id');
|
|
10447
10483
|
}
|
|
10448
10484
|
}
|
|
10485
|
+
// if it wasn't found, we just set the provided value to network-id
|
|
10486
|
+
if (networkId === undefined) {
|
|
10487
|
+
networkId = networkCode;
|
|
10488
|
+
}
|
|
10449
10489
|
}
|
|
10450
10490
|
return networkId;
|
|
10451
10491
|
}
|
|
@@ -46396,10 +46436,10 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
46396
46436
|
},
|
|
46397
46437
|
'fetchOHLCV': {
|
|
46398
46438
|
'spot': {
|
|
46399
|
-
'method': 'publicSpotGetV2SpotMarketCandles', // or publicSpotGetV2SpotMarketHistoryCandles
|
|
46439
|
+
'method': 'publicSpotGetV2SpotMarketCandles', // publicSpotGetV2SpotMarketCandles or publicSpotGetV2SpotMarketHistoryCandles
|
|
46400
46440
|
},
|
|
46401
46441
|
'swap': {
|
|
46402
|
-
'method': 'publicMixGetV2MixMarketCandles', // or publicMixGetV2MixMarketHistoryCandles or publicMixGetV2MixMarketHistoryIndexCandles or publicMixGetV2MixMarketHistoryMarkCandles
|
|
46442
|
+
'method': 'publicMixGetV2MixMarketCandles', // publicMixGetV2MixMarketCandles or publicMixGetV2MixMarketHistoryCandles or publicMixGetV2MixMarketHistoryIndexCandles or publicMixGetV2MixMarketHistoryMarkCandles
|
|
46403
46443
|
},
|
|
46404
46444
|
'maxDaysPerTimeframe': {
|
|
46405
46445
|
'1m': 30,
|
|
@@ -48369,11 +48409,13 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
48369
48409
|
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
48370
48410
|
*/
|
|
48371
48411
|
await this.loadMarkets();
|
|
48372
|
-
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
|
|
48373
48415
|
let paginate = false;
|
|
48374
48416
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchOHLCV', 'paginate');
|
|
48375
48417
|
if (paginate) {
|
|
48376
|
-
return await this.fetchPaginatedCallDeterministic('fetchOHLCV', symbol, since, limit, timeframe, params,
|
|
48418
|
+
return await this.fetchPaginatedCallDeterministic('fetchOHLCV', symbol, since, limit, timeframe, params, maxLimitForHistoryEndpoint);
|
|
48377
48419
|
}
|
|
48378
48420
|
const sandboxMode = this.safeBool(this.options, 'sandboxMode', false);
|
|
48379
48421
|
let market = undefined;
|
|
@@ -48386,32 +48428,17 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
48386
48428
|
}
|
|
48387
48429
|
const marketType = market['spot'] ? 'spot' : 'swap';
|
|
48388
48430
|
const timeframes = this.options['timeframes'][marketType];
|
|
48389
|
-
const
|
|
48431
|
+
const msInDay = 86400000;
|
|
48390
48432
|
const duration = this.parseTimeframe(timeframe) * 1000;
|
|
48391
48433
|
const request = {
|
|
48392
48434
|
'symbol': market['id'],
|
|
48393
|
-
'granularity':
|
|
48435
|
+
'granularity': this.safeString(timeframes, timeframe, timeframe),
|
|
48394
48436
|
};
|
|
48395
|
-
const defaultLimit = 100; // by default, exchange returns 100 items
|
|
48396
|
-
const msInDay = 1000 * 60 * 60 * 24;
|
|
48397
|
-
if (limit !== undefined) {
|
|
48398
|
-
limit = Math.min(limit, maxLimit);
|
|
48399
|
-
request['limit'] = limit;
|
|
48400
|
-
}
|
|
48401
48437
|
const until = this.safeInteger2(params, 'until', 'till');
|
|
48438
|
+
const limitDefined = limit !== undefined;
|
|
48439
|
+
const sinceDefined = since !== undefined;
|
|
48440
|
+
const untilDefined = until !== undefined;
|
|
48402
48441
|
params = this.omit(params, ['until', 'till']);
|
|
48403
|
-
if (until !== undefined) {
|
|
48404
|
-
request['endTime'] = until;
|
|
48405
|
-
}
|
|
48406
|
-
if (since !== undefined) {
|
|
48407
|
-
request['startTime'] = since;
|
|
48408
|
-
if (market['spot'] && (until === undefined)) {
|
|
48409
|
-
// for spot we need to send "entTime" too
|
|
48410
|
-
const limitForEnd = (limit !== undefined) ? limit : defaultLimit;
|
|
48411
|
-
const calculatedEnd = this.sum(since, duration * limitForEnd);
|
|
48412
|
-
request['endTime'] = calculatedEnd;
|
|
48413
|
-
}
|
|
48414
|
-
}
|
|
48415
48442
|
let response = undefined;
|
|
48416
48443
|
const now = this.milliseconds();
|
|
48417
48444
|
// retrievable periods listed here:
|
|
@@ -48419,21 +48446,47 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
48419
48446
|
// - https://www.bitget.com/api-doc/contract/market/Get-Candle-Data#description
|
|
48420
48447
|
const ohlcOptions = this.safeDict(this.options, 'fetchOHLCV', {});
|
|
48421
48448
|
const retrievableDaysMap = this.safeDict(ohlcOptions, 'maxDaysPerTimeframe', {});
|
|
48422
|
-
const
|
|
48423
|
-
const endpointTsBoundary = now -
|
|
48424
|
-
|
|
48425
|
-
|
|
48426
|
-
|
|
48427
|
-
|
|
48428
|
-
|
|
48429
|
-
|
|
48430
|
-
}
|
|
48431
|
-
|
|
48432
|
-
|
|
48433
|
-
|
|
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;
|
|
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
|
+
}
|
|
48434
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
|
|
48435
48487
|
if (market['spot']) {
|
|
48436
|
-
if
|
|
48488
|
+
// checks if we need history endpoint
|
|
48489
|
+
if (historicalEndpointNeeded) {
|
|
48437
48490
|
response = await this.publicSpotGetV2SpotMarketHistoryCandles(this.extend(request, params));
|
|
48438
48491
|
}
|
|
48439
48492
|
else {
|
|
@@ -48441,19 +48494,18 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
48441
48494
|
}
|
|
48442
48495
|
}
|
|
48443
48496
|
else {
|
|
48444
|
-
const maxDistanceDaysForContracts = 90; // maximum 90 days allowed between start-end times
|
|
48445
|
-
|
|
48446
|
-
if (
|
|
48447
|
-
|
|
48448
|
-
|
|
48449
|
-
|
|
48450
|
-
|
|
48451
|
-
|
|
48452
|
-
|
|
48453
|
-
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
|
+
}
|
|
48454
48506
|
}
|
|
48455
|
-
|
|
48456
|
-
params = this.
|
|
48507
|
+
let priceType = undefined;
|
|
48508
|
+
[priceType, params] = this.handleParamString(params, 'price');
|
|
48457
48509
|
let productType = undefined;
|
|
48458
48510
|
[productType, params] = this.handleProductTypeAndParams(market, params);
|
|
48459
48511
|
request['productType'] = productType;
|
|
@@ -48466,7 +48518,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
48466
48518
|
response = await this.publicMixGetV2MixMarketHistoryIndexCandles(extended);
|
|
48467
48519
|
}
|
|
48468
48520
|
else {
|
|
48469
|
-
if (
|
|
48521
|
+
if (historicalEndpointNeeded) {
|
|
48470
48522
|
response = await this.publicMixGetV2MixMarketHistoryCandles(extended);
|
|
48471
48523
|
}
|
|
48472
48524
|
else {
|
|
@@ -82453,9 +82505,9 @@ class btcturk extends _abstract_btcturk_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
82453
82505
|
'30m': 30,
|
|
82454
82506
|
'1h': 60,
|
|
82455
82507
|
'4h': 240,
|
|
82456
|
-
'1d': '1
|
|
82457
|
-
'1w': '1
|
|
82458
|
-
'1y': '1
|
|
82508
|
+
'1d': '1 d',
|
|
82509
|
+
'1w': '1 w',
|
|
82510
|
+
'1y': '1 y',
|
|
82459
82511
|
},
|
|
82460
82512
|
'urls': {
|
|
82461
82513
|
'logo': 'https://user-images.githubusercontent.com/51840849/87153926-efbef500-c2c0-11ea-9842-05b63612c4b9.jpg',
|
|
@@ -83408,6 +83460,7 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
83408
83460
|
'fetchIsolatedBorrowRates': false,
|
|
83409
83461
|
'fetchLedger': true,
|
|
83410
83462
|
'fetchLeverage': true,
|
|
83463
|
+
'fetchLeverageTiers': true,
|
|
83411
83464
|
'fetchMarketLeverageTiers': true,
|
|
83412
83465
|
'fetchMarkets': true,
|
|
83413
83466
|
'fetchMarkOHLCV': true,
|
|
@@ -90598,36 +90651,6 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
90598
90651
|
request['symbol'] = market['id'];
|
|
90599
90652
|
return await this.fetchDerivativesMarketLeverageTiers(symbol, params);
|
|
90600
90653
|
}
|
|
90601
|
-
parseMarketLeverageTiers(info, market = undefined) {
|
|
90602
|
-
//
|
|
90603
|
-
// {
|
|
90604
|
-
// "id": 1,
|
|
90605
|
-
// "symbol": "BTCUSD",
|
|
90606
|
-
// "riskLimitValue": "150",
|
|
90607
|
-
// "maintenanceMargin": "0.5",
|
|
90608
|
-
// "initialMargin": "1",
|
|
90609
|
-
// "isLowestRisk": 1,
|
|
90610
|
-
// "maxLeverage": "100.00"
|
|
90611
|
-
// }
|
|
90612
|
-
//
|
|
90613
|
-
let minNotional = 0;
|
|
90614
|
-
const tiers = [];
|
|
90615
|
-
for (let i = 0; i < info.length; i++) {
|
|
90616
|
-
const item = info[i];
|
|
90617
|
-
const maxNotional = this.safeNumber(item, 'riskLimitValue');
|
|
90618
|
-
tiers.push({
|
|
90619
|
-
'tier': this.sum(i, 1),
|
|
90620
|
-
'currency': market['base'],
|
|
90621
|
-
'minNotional': minNotional,
|
|
90622
|
-
'maxNotional': maxNotional,
|
|
90623
|
-
'maintenanceMarginRate': this.safeNumber(item, 'maintenanceMargin'),
|
|
90624
|
-
'maxLeverage': this.safeNumber(item, 'maxLeverage'),
|
|
90625
|
-
'info': item,
|
|
90626
|
-
});
|
|
90627
|
-
minNotional = maxNotional;
|
|
90628
|
-
}
|
|
90629
|
-
return tiers;
|
|
90630
|
-
}
|
|
90631
90654
|
parseTradingFee(fee, market = undefined) {
|
|
90632
90655
|
//
|
|
90633
90656
|
// {
|
|
@@ -91332,6 +91355,95 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
91332
91355
|
'datetime': this.iso8601(timestamp),
|
|
91333
91356
|
});
|
|
91334
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
|
+
}
|
|
91335
91447
|
sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
91336
91448
|
let url = this.implodeHostname(this.urls['api'][api]) + '/' + path;
|
|
91337
91449
|
if (api === 'public') {
|
|
@@ -97064,6 +97176,2035 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
97064
97176
|
}
|
|
97065
97177
|
|
|
97066
97178
|
|
|
97179
|
+
/***/ }),
|
|
97180
|
+
|
|
97181
|
+
/***/ 9339:
|
|
97182
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
97183
|
+
|
|
97184
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
97185
|
+
/* harmony export */ Z: () => (/* binding */ coinbaseinternational)
|
|
97186
|
+
/* harmony export */ });
|
|
97187
|
+
/* harmony import */ var _abstract_coinbaseinternational_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(931);
|
|
97188
|
+
/* harmony import */ var _base_errors_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6689);
|
|
97189
|
+
/* harmony import */ var _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2194);
|
|
97190
|
+
/* harmony import */ var _base_functions_number_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9292);
|
|
97191
|
+
/* harmony import */ var _static_dependencies_noble_hashes_sha256_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1372);
|
|
97192
|
+
// ----------------------------------------------------------------------------
|
|
97193
|
+
|
|
97194
|
+
|
|
97195
|
+
|
|
97196
|
+
|
|
97197
|
+
|
|
97198
|
+
// ----------------------------------------------------------------------------
|
|
97199
|
+
/**
|
|
97200
|
+
* @class coinbaseinternational
|
|
97201
|
+
* @augments Exchange
|
|
97202
|
+
*/
|
|
97203
|
+
class coinbaseinternational extends _abstract_coinbaseinternational_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
97204
|
+
describe() {
|
|
97205
|
+
return this.deepExtend(super.describe(), {
|
|
97206
|
+
'id': 'coinbaseinternational',
|
|
97207
|
+
'name': 'coinbase International',
|
|
97208
|
+
'countries': ['US'],
|
|
97209
|
+
'certified': true,
|
|
97210
|
+
'pro': true,
|
|
97211
|
+
'rateLimit': 100,
|
|
97212
|
+
'version': 'v1',
|
|
97213
|
+
'userAgent': this.userAgents['chrome'],
|
|
97214
|
+
'headers': {
|
|
97215
|
+
'CB-VERSION': '2018-05-30',
|
|
97216
|
+
},
|
|
97217
|
+
'has': {
|
|
97218
|
+
'CORS': true,
|
|
97219
|
+
'spot': true,
|
|
97220
|
+
'margin': true,
|
|
97221
|
+
'swap': true,
|
|
97222
|
+
'future': true,
|
|
97223
|
+
'option': false,
|
|
97224
|
+
'addMargin': false,
|
|
97225
|
+
'cancelAllOrders': true,
|
|
97226
|
+
'cancelOrder': true,
|
|
97227
|
+
'cancelOrders': false,
|
|
97228
|
+
'closeAllPositions': false,
|
|
97229
|
+
'closePosition': false,
|
|
97230
|
+
'createDepositAddress': true,
|
|
97231
|
+
'createLimitBuyOrder': true,
|
|
97232
|
+
'createLimitSellOrder': true,
|
|
97233
|
+
'createMarketBuyOrder': true,
|
|
97234
|
+
'createMarketBuyOrderWithCost': false,
|
|
97235
|
+
'createMarketOrderWithCost': false,
|
|
97236
|
+
'createMarketSellOrder': true,
|
|
97237
|
+
'createMarketSellOrderWithCost': false,
|
|
97238
|
+
'createOrder': true,
|
|
97239
|
+
'createPostOnlyOrder': true,
|
|
97240
|
+
'createReduceOnlyOrder': false,
|
|
97241
|
+
'createStopLimitOrder': true,
|
|
97242
|
+
'createStopMarketOrder': true,
|
|
97243
|
+
'createStopOrder': true,
|
|
97244
|
+
'editOrder': true,
|
|
97245
|
+
'fetchAccounts': true,
|
|
97246
|
+
'fetchBalance': true,
|
|
97247
|
+
'fetchBidsAsks': false,
|
|
97248
|
+
'fetchBorrowRateHistories': false,
|
|
97249
|
+
'fetchBorrowRateHistory': false,
|
|
97250
|
+
'fetchCanceledOrders': false,
|
|
97251
|
+
'fetchClosedOrders': false,
|
|
97252
|
+
'fetchCrossBorrowRate': false,
|
|
97253
|
+
'fetchCrossBorrowRates': false,
|
|
97254
|
+
'fetchCurrencies': true,
|
|
97255
|
+
'fetchDeposits': true,
|
|
97256
|
+
'fetchFundingHistory': false,
|
|
97257
|
+
'fetchFundingRate': false,
|
|
97258
|
+
'fetchFundingRateHistory': true,
|
|
97259
|
+
'fetchFundingRates': false,
|
|
97260
|
+
'fetchIndexOHLCV': false,
|
|
97261
|
+
'fetchIsolatedBorrowRate': false,
|
|
97262
|
+
'fetchIsolatedBorrowRates': false,
|
|
97263
|
+
'fetchL2OrderBook': false,
|
|
97264
|
+
'fetchLedger': false,
|
|
97265
|
+
'fetchLeverage': false,
|
|
97266
|
+
'fetchLeverageTiers': false,
|
|
97267
|
+
'fetchMarginMode': false,
|
|
97268
|
+
'fetchMarkets': true,
|
|
97269
|
+
'fetchMarkOHLCV': false,
|
|
97270
|
+
'fetchMyBuys': true,
|
|
97271
|
+
'fetchMySells': true,
|
|
97272
|
+
'fetchMyTrades': true,
|
|
97273
|
+
'fetchOHLCV': false,
|
|
97274
|
+
'fetchOpenInterestHistory': false,
|
|
97275
|
+
'fetchOpenOrders': true,
|
|
97276
|
+
'fetchOrder': true,
|
|
97277
|
+
'fetchOrderBook': false,
|
|
97278
|
+
'fetchOrders': false,
|
|
97279
|
+
'fetchPosition': true,
|
|
97280
|
+
'fetchPositionMode': false,
|
|
97281
|
+
'fetchPositions': true,
|
|
97282
|
+
'fetchPositionsRisk': false,
|
|
97283
|
+
'fetchPremiumIndexOHLCV': false,
|
|
97284
|
+
'fetchTicker': true,
|
|
97285
|
+
'fetchTickers': true,
|
|
97286
|
+
'fetchTime': false,
|
|
97287
|
+
'fetchTrades': false,
|
|
97288
|
+
'fetchTradingFee': false,
|
|
97289
|
+
'fetchTradingFees': false,
|
|
97290
|
+
'fetchWithdrawals': true,
|
|
97291
|
+
'reduceMargin': false,
|
|
97292
|
+
'setLeverage': false,
|
|
97293
|
+
'setMargin': true,
|
|
97294
|
+
'setMarginMode': false,
|
|
97295
|
+
'setPositionMode': false,
|
|
97296
|
+
'withdraw': true,
|
|
97297
|
+
},
|
|
97298
|
+
'urls': {
|
|
97299
|
+
'logo': 'https://github.com/ccxt/ccxt/assets/43336371/866ae638-6ab5-4ebf-ab2c-cdcce9545625',
|
|
97300
|
+
'api': {
|
|
97301
|
+
'rest': 'https://api.international.coinbase.com/api',
|
|
97302
|
+
},
|
|
97303
|
+
'test': {
|
|
97304
|
+
'rest': 'https://api-n5e1.coinbase.com/api',
|
|
97305
|
+
},
|
|
97306
|
+
'www': 'https://international.coinbase.com',
|
|
97307
|
+
'doc': [
|
|
97308
|
+
'https://docs.cloud.coinbaseinternational.com/intx/docs',
|
|
97309
|
+
],
|
|
97310
|
+
'fees': [
|
|
97311
|
+
'https://help.coinbaseinternational.com/en/international-exchange/trading-deposits-withdrawals/international-exchange-fees',
|
|
97312
|
+
],
|
|
97313
|
+
'referral': '',
|
|
97314
|
+
},
|
|
97315
|
+
'requiredCredentials': {
|
|
97316
|
+
'apiKey': true,
|
|
97317
|
+
'secret': true,
|
|
97318
|
+
'password': true,
|
|
97319
|
+
},
|
|
97320
|
+
'api': {
|
|
97321
|
+
'v1': {
|
|
97322
|
+
'public': {
|
|
97323
|
+
'get': [
|
|
97324
|
+
'assets',
|
|
97325
|
+
'assets/{assets}',
|
|
97326
|
+
'assets/{asset}/networks',
|
|
97327
|
+
'instruments',
|
|
97328
|
+
'instruments/{instrument}',
|
|
97329
|
+
'instruments/{instrument}/quote',
|
|
97330
|
+
'instruments/{instrument}/funding',
|
|
97331
|
+
'',
|
|
97332
|
+
],
|
|
97333
|
+
},
|
|
97334
|
+
'private': {
|
|
97335
|
+
'get': [
|
|
97336
|
+
'orders',
|
|
97337
|
+
'orders/{id}',
|
|
97338
|
+
'portfolios',
|
|
97339
|
+
'portfolios/{portfolio}',
|
|
97340
|
+
'portfolios/{portfolio}/detail',
|
|
97341
|
+
'portfolios/{portfolio}/summary',
|
|
97342
|
+
'portfolios/{portfolio}/balances',
|
|
97343
|
+
'portfolios/{portfolio}/balances/{asset}',
|
|
97344
|
+
'portfolios/{portfolio}/positions',
|
|
97345
|
+
'portfolios/{portfolio}/positions/{instrument}',
|
|
97346
|
+
'portfolios/fills',
|
|
97347
|
+
'portfolios/{portfolio}/fills',
|
|
97348
|
+
'transfers',
|
|
97349
|
+
'transfers/{transfer_uuid}',
|
|
97350
|
+
],
|
|
97351
|
+
'post': [
|
|
97352
|
+
'orders',
|
|
97353
|
+
'portfolios',
|
|
97354
|
+
'portfolios/margin',
|
|
97355
|
+
'portfolios/transfer',
|
|
97356
|
+
'transfers/withdraw',
|
|
97357
|
+
'transfers/address',
|
|
97358
|
+
'transfers/create-counterparty-id',
|
|
97359
|
+
'transfers/validate-counterparty-id',
|
|
97360
|
+
'transfers/withdraw/counterparty',
|
|
97361
|
+
],
|
|
97362
|
+
'put': [
|
|
97363
|
+
'orders/{id}',
|
|
97364
|
+
'portfolios/{portfolio}',
|
|
97365
|
+
],
|
|
97366
|
+
'delete': [
|
|
97367
|
+
'orders',
|
|
97368
|
+
'orders/{id}',
|
|
97369
|
+
],
|
|
97370
|
+
},
|
|
97371
|
+
},
|
|
97372
|
+
},
|
|
97373
|
+
'fees': {
|
|
97374
|
+
'trading': {
|
|
97375
|
+
'taker': this.parseNumber('0.004'),
|
|
97376
|
+
'maker': this.parseNumber('0.002'),
|
|
97377
|
+
'tierBased': true,
|
|
97378
|
+
'percentage': true,
|
|
97379
|
+
'tiers': {
|
|
97380
|
+
'taker': [
|
|
97381
|
+
[this.parseNumber('0'), this.parseNumber('0.004')],
|
|
97382
|
+
[this.parseNumber('1000000'), this.parseNumber('0.004')],
|
|
97383
|
+
[this.parseNumber('5000000'), this.parseNumber('0.0035')],
|
|
97384
|
+
[this.parseNumber('10000000'), this.parseNumber('0.0035')],
|
|
97385
|
+
[this.parseNumber('50000000'), this.parseNumber('0.003')],
|
|
97386
|
+
[this.parseNumber('250000000'), this.parseNumber('0.0025')],
|
|
97387
|
+
],
|
|
97388
|
+
'maker': [
|
|
97389
|
+
[this.parseNumber('0'), this.parseNumber('0.002')],
|
|
97390
|
+
[this.parseNumber('1000000'), this.parseNumber('0.0016')],
|
|
97391
|
+
[this.parseNumber('5000000'), this.parseNumber('0.001')],
|
|
97392
|
+
[this.parseNumber('10000000'), this.parseNumber('0.0008')],
|
|
97393
|
+
[this.parseNumber('50000000'), this.parseNumber('0.0005')],
|
|
97394
|
+
[this.parseNumber('250000000'), this.parseNumber('0')],
|
|
97395
|
+
],
|
|
97396
|
+
},
|
|
97397
|
+
},
|
|
97398
|
+
},
|
|
97399
|
+
'precisionMode': _base_functions_number_js__WEBPACK_IMPORTED_MODULE_1__/* .TICK_SIZE */ .sh,
|
|
97400
|
+
'exceptions': {
|
|
97401
|
+
'exact': {},
|
|
97402
|
+
'broad': {
|
|
97403
|
+
'DUPLICATE_CLIENT_ORDER_ID': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.DuplicateOrderId,
|
|
97404
|
+
'Order rejected': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
|
|
97405
|
+
'market orders must be IoC': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
|
|
97406
|
+
'tif is required': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
|
|
97407
|
+
'Invalid replace order request': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
|
|
97408
|
+
'Unauthorized': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.PermissionDenied,
|
|
97409
|
+
'invalid result_limit': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
97410
|
+
'is a required field': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
97411
|
+
'Not Found': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
97412
|
+
'ip not allowed': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.AuthenticationError,
|
|
97413
|
+
},
|
|
97414
|
+
},
|
|
97415
|
+
'timeframes': {
|
|
97416
|
+
'1m': 'ONE_MINUTE',
|
|
97417
|
+
'5m': 'FIVE_MINUTE',
|
|
97418
|
+
'15m': 'FIFTEEN_MINUTE',
|
|
97419
|
+
'30m': 'THIRTY_MINUTE',
|
|
97420
|
+
'1h': 'ONE_HOUR',
|
|
97421
|
+
'2h': 'TWO_HOUR',
|
|
97422
|
+
'6h': 'SIX_HOUR',
|
|
97423
|
+
'1d': 'ONE_DAY',
|
|
97424
|
+
},
|
|
97425
|
+
'options': {
|
|
97426
|
+
'brokerId': 'nfqkvdjp',
|
|
97427
|
+
'portfolio': '',
|
|
97428
|
+
'withdraw': {
|
|
97429
|
+
'method': 'v1PrivatePostTransfersWithdraw', // use v1PrivatePostTransfersWithdrawCounterparty for counterparty withdrawals
|
|
97430
|
+
},
|
|
97431
|
+
'networksById': {
|
|
97432
|
+
'ethereum': 'ETH',
|
|
97433
|
+
'arbitrum': 'ARBITRUM',
|
|
97434
|
+
'avacchain': 'AVAX',
|
|
97435
|
+
'optimism': 'OPTIMISM',
|
|
97436
|
+
'polygon': 'MATIC',
|
|
97437
|
+
'solana': 'SOL',
|
|
97438
|
+
'bitcoin': 'BTC',
|
|
97439
|
+
},
|
|
97440
|
+
},
|
|
97441
|
+
});
|
|
97442
|
+
}
|
|
97443
|
+
async handlePortfolioAndParams(methodName, params = {}) {
|
|
97444
|
+
let portfolio = undefined;
|
|
97445
|
+
[portfolio, params] = this.handleOptionAndParams(params, methodName, 'portfolio');
|
|
97446
|
+
if ((portfolio !== undefined) && (portfolio !== '')) {
|
|
97447
|
+
return [portfolio, params];
|
|
97448
|
+
}
|
|
97449
|
+
const defaultPortfolio = this.safeString(this.options, 'portfolio');
|
|
97450
|
+
if ((defaultPortfolio !== undefined) && (defaultPortfolio !== '')) {
|
|
97451
|
+
return [defaultPortfolio, params];
|
|
97452
|
+
}
|
|
97453
|
+
const accounts = await this.fetchAccounts();
|
|
97454
|
+
for (let i = 0; i < accounts.length; i++) {
|
|
97455
|
+
const account = accounts[i];
|
|
97456
|
+
const info = this.safeDict(account, 'info', {});
|
|
97457
|
+
if (this.safeBool(info, 'is_default')) {
|
|
97458
|
+
const portfolioId = this.safeString(info, 'portfolio_id');
|
|
97459
|
+
this.options['portfolio'] = portfolioId;
|
|
97460
|
+
return [portfolioId, params];
|
|
97461
|
+
}
|
|
97462
|
+
}
|
|
97463
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' ' + methodName + '() requires a portfolio parameter or set the default portfolio with this.options["portfolio"]');
|
|
97464
|
+
}
|
|
97465
|
+
async handleNetworkIdAndParams(currencyCode, methodName, params) {
|
|
97466
|
+
let networkId = undefined;
|
|
97467
|
+
[networkId, params] = this.handleOptionAndParams(params, methodName, 'network_arn_id');
|
|
97468
|
+
if (networkId === undefined) {
|
|
97469
|
+
await this.loadCurrencyNetworks(currencyCode);
|
|
97470
|
+
const networks = this.currencies[currencyCode]['networks'];
|
|
97471
|
+
const network = this.safeString2(params, 'networkCode', 'network');
|
|
97472
|
+
if (network === undefined) {
|
|
97473
|
+
// find default network
|
|
97474
|
+
if (this.isEmpty(networks)) {
|
|
97475
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest(this.id + ' createDepositAddress network not found for currency ' + currencyCode + ' please specify networkId in params');
|
|
97476
|
+
}
|
|
97477
|
+
const defaultNetwork = this.findDefaultNetwork(networks);
|
|
97478
|
+
networkId = defaultNetwork['id'];
|
|
97479
|
+
}
|
|
97480
|
+
else {
|
|
97481
|
+
networkId = this.networkCodeToId(network, currencyCode);
|
|
97482
|
+
}
|
|
97483
|
+
}
|
|
97484
|
+
return [networkId, params];
|
|
97485
|
+
}
|
|
97486
|
+
async fetchAccounts(params = {}) {
|
|
97487
|
+
/**
|
|
97488
|
+
* @method
|
|
97489
|
+
* @name coinbaseinternational#fetchAccounts
|
|
97490
|
+
* @description fetch all the accounts associated with a profile
|
|
97491
|
+
* @see https://docs.cloud.coinbase.com/intx/reference/getportfolios
|
|
97492
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
97493
|
+
* @returns {object} a dictionary of [account structures]{@link https://docs.ccxt.com/#/?id=account-structure} indexed by the account type
|
|
97494
|
+
*/
|
|
97495
|
+
await this.loadMarkets();
|
|
97496
|
+
const response = await this.v1PrivateGetPortfolios(params);
|
|
97497
|
+
//
|
|
97498
|
+
// [
|
|
97499
|
+
// {
|
|
97500
|
+
// "portfolio_id":"1ap32qsc-1-0",
|
|
97501
|
+
// "portfolio_uuid":"028d7f6c-b92c-7361-8b7e-2932711e5a22",
|
|
97502
|
+
// "name":"CCXT Portfolio 030624-17:16",
|
|
97503
|
+
// "user_uuid":"e6cf46b6-a32f-5fa7-addb-3324d4526fbd",
|
|
97504
|
+
// "maker_fee_rate":"0",
|
|
97505
|
+
// "taker_fee_rate":"0.0002",
|
|
97506
|
+
// "trading_lock":false,
|
|
97507
|
+
// "borrow_disabled":false,
|
|
97508
|
+
// "is_lsp":false,
|
|
97509
|
+
// "is_default":true,
|
|
97510
|
+
// "cross_collateral_enabled":false
|
|
97511
|
+
// }
|
|
97512
|
+
// ]
|
|
97513
|
+
//
|
|
97514
|
+
return this.parseAccounts(response, params);
|
|
97515
|
+
}
|
|
97516
|
+
parseAccount(account) {
|
|
97517
|
+
//
|
|
97518
|
+
// {
|
|
97519
|
+
// "portfolio_id":"1ap32qsc-1-0",
|
|
97520
|
+
// "portfolio_uuid":"028d7f6c-b92c-7361-8b7e-2932711e5a22",
|
|
97521
|
+
// "name":"CCXT Portfolio 030624-17:16",
|
|
97522
|
+
// "user_uuid":"e6cf46b6-a32f-5fa7-addb-3324d4526fbd",
|
|
97523
|
+
// "maker_fee_rate":"0",
|
|
97524
|
+
// "taker_fee_rate":"0.0002",
|
|
97525
|
+
// "trading_lock":false,
|
|
97526
|
+
// "borrow_disabled":false,
|
|
97527
|
+
// "is_lsp":false,
|
|
97528
|
+
// "is_default":true,
|
|
97529
|
+
// "cross_collateral_enabled":false
|
|
97530
|
+
// }
|
|
97531
|
+
//
|
|
97532
|
+
return {
|
|
97533
|
+
'id': this.safeString2(account, 'portfolio_id', 'portfolio_uuid'),
|
|
97534
|
+
'type': undefined,
|
|
97535
|
+
'code': undefined,
|
|
97536
|
+
'info': account,
|
|
97537
|
+
};
|
|
97538
|
+
}
|
|
97539
|
+
async fetchFundingRateHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
97540
|
+
/**
|
|
97541
|
+
* @method
|
|
97542
|
+
* @name coinbaseinternational#fetchFundingRateHistory
|
|
97543
|
+
* @description fetches historical funding rate prices
|
|
97544
|
+
* @see https://docs.cloud.coinbase.com/intx/reference/getinstrumentfunding
|
|
97545
|
+
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
97546
|
+
* @param {int} [since] timestamp in ms of the earliest funding rate to fetch
|
|
97547
|
+
* @param {int} [limit] the maximum amount of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure} to fetch
|
|
97548
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
97549
|
+
* @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)
|
|
97550
|
+
*/
|
|
97551
|
+
if (symbol === undefined) {
|
|
97552
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchFundingRateHistory() requires a symbol argument');
|
|
97553
|
+
}
|
|
97554
|
+
await this.loadMarkets();
|
|
97555
|
+
let paginate = false;
|
|
97556
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchFundingRateHistory', 'paginate');
|
|
97557
|
+
let maxEntriesPerRequest = undefined;
|
|
97558
|
+
[maxEntriesPerRequest, params] = this.handleOptionAndParams(params, 'fetchFundingRateHistory', 'maxEntriesPerRequest', 100);
|
|
97559
|
+
const pageKey = 'ccxtPageKey';
|
|
97560
|
+
if (paginate) {
|
|
97561
|
+
return await this.fetchPaginatedCallIncremental('fetchFundingRateHistory', symbol, since, limit, params, pageKey, maxEntriesPerRequest);
|
|
97562
|
+
}
|
|
97563
|
+
const market = this.market(symbol);
|
|
97564
|
+
const page = this.safeInteger(params, pageKey, 1) - 1;
|
|
97565
|
+
const request = {
|
|
97566
|
+
'instrument': market['id'],
|
|
97567
|
+
'result_offset': this.safeInteger2(params, 'offset', 'result_offset', page * maxEntriesPerRequest),
|
|
97568
|
+
};
|
|
97569
|
+
if (limit !== undefined) {
|
|
97570
|
+
request['result_limit'] = limit;
|
|
97571
|
+
}
|
|
97572
|
+
const response = await this.v1PublicGetInstrumentsInstrumentFunding(this.extend(request, params));
|
|
97573
|
+
//
|
|
97574
|
+
// {
|
|
97575
|
+
// "pagination":{
|
|
97576
|
+
// "result_limit":"25",
|
|
97577
|
+
// "result_offset":"0"
|
|
97578
|
+
// },
|
|
97579
|
+
// "results":[
|
|
97580
|
+
// {
|
|
97581
|
+
// "instrument_id":"149264167780483072",
|
|
97582
|
+
// "funding_rate":"0.000011",
|
|
97583
|
+
// "mark_price":"47388.1",
|
|
97584
|
+
// "event_time":"2024-02-10T16:00:00Z"
|
|
97585
|
+
// },
|
|
97586
|
+
// ...
|
|
97587
|
+
// ]
|
|
97588
|
+
// }
|
|
97589
|
+
//
|
|
97590
|
+
const rawRates = this.safeList(response, 'results', []);
|
|
97591
|
+
return this.parseFundingRateHistories(rawRates, market, since, limit);
|
|
97592
|
+
}
|
|
97593
|
+
parseFundingRateHistory(info, market = undefined) {
|
|
97594
|
+
return this.parseFundingRate(info, market);
|
|
97595
|
+
}
|
|
97596
|
+
parseFundingRate(contract, market = undefined) {
|
|
97597
|
+
//
|
|
97598
|
+
// {
|
|
97599
|
+
// "instrument_id":"149264167780483072",
|
|
97600
|
+
// "funding_rate":"0.000011",
|
|
97601
|
+
// "mark_price":"47388.1",
|
|
97602
|
+
// "event_time":"2024-02-10T16:00:00Z"
|
|
97603
|
+
// }
|
|
97604
|
+
//
|
|
97605
|
+
const fundingDatetime = this.safeString2(contract, 'event_time', 'time');
|
|
97606
|
+
return {
|
|
97607
|
+
'info': contract,
|
|
97608
|
+
'symbol': this.safeSymbol(undefined, market),
|
|
97609
|
+
'markPrice': this.safeNumber(contract, 'mark_price'),
|
|
97610
|
+
'indexPrice': undefined,
|
|
97611
|
+
'interestRate': undefined,
|
|
97612
|
+
'estimatedSettlePrice': undefined,
|
|
97613
|
+
'timestamp': this.parse8601(fundingDatetime),
|
|
97614
|
+
'datetime': fundingDatetime,
|
|
97615
|
+
'fundingRate': this.safeNumber(contract, 'funding_rate'),
|
|
97616
|
+
'fundingTimestamp': this.parse8601(fundingDatetime),
|
|
97617
|
+
'fundingDatetime': fundingDatetime,
|
|
97618
|
+
'nextFundingRate': undefined,
|
|
97619
|
+
'nextFundingTimestamp': undefined,
|
|
97620
|
+
'nextFundingDatetime': undefined,
|
|
97621
|
+
'previousFundingRate': undefined,
|
|
97622
|
+
'previousFundingTimestamp': undefined,
|
|
97623
|
+
'previousFundingDatetime': undefined,
|
|
97624
|
+
};
|
|
97625
|
+
}
|
|
97626
|
+
async createDepositAddress(code, params = {}) {
|
|
97627
|
+
/**
|
|
97628
|
+
* @method
|
|
97629
|
+
* @name coinbaseinternational#createDepositAddress
|
|
97630
|
+
* @description create a currency deposit address
|
|
97631
|
+
* @see https://docs.cloud.coinbase.com/intx/reference/createaddress
|
|
97632
|
+
* @see https://docs.cloud.coinbase.com/intx/reference/createcounterpartyid
|
|
97633
|
+
* @param {string} code unified currency code of the currency for the deposit address
|
|
97634
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
97635
|
+
* @param {string} [params.network_arn_id] Identifies the blockchain network (e.g., networks/ethereum-mainnet/assets/313ef8a9-ae5a-5f2f-8a56-572c0e2a4d5a) if not provided will pick default
|
|
97636
|
+
* @param {string} [params.network] unified network code to identify the blockchain network
|
|
97637
|
+
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
97638
|
+
*/
|
|
97639
|
+
await this.loadMarkets();
|
|
97640
|
+
let method = undefined;
|
|
97641
|
+
[method, params] = this.handleOptionAndParams(params, 'createDepositAddress', 'method', 'v1PrivatePostTransfersAddress');
|
|
97642
|
+
let portfolio = undefined;
|
|
97643
|
+
[portfolio, params] = await this.handlePortfolioAndParams('createDepositAddress', params);
|
|
97644
|
+
const request = {
|
|
97645
|
+
'portfolio': portfolio,
|
|
97646
|
+
};
|
|
97647
|
+
if (method === 'v1PrivatePostTransfersAddress') {
|
|
97648
|
+
const currency = this.currency(code);
|
|
97649
|
+
request['asset'] = currency['id'];
|
|
97650
|
+
let networkId = undefined;
|
|
97651
|
+
[networkId, params] = await this.handleNetworkIdAndParams(code, 'createDepositAddress', params);
|
|
97652
|
+
request['network_arn_id'] = networkId;
|
|
97653
|
+
}
|
|
97654
|
+
const response = await this[method](this.extend(request, params));
|
|
97655
|
+
//
|
|
97656
|
+
// v1PrivatePostTransfersAddress
|
|
97657
|
+
// {
|
|
97658
|
+
// address: "3LkwYscRyh6tUR1XTqXSJQoJnK7ucC1F4n",
|
|
97659
|
+
// network_arn_id: "networks/bitcoin-mainnet/assets/6ecc0dcc-10a2-500e-b315-a3b9abae19ce",
|
|
97660
|
+
// destination_tag: "",
|
|
97661
|
+
// }
|
|
97662
|
+
// v1PrivatePostTransfersCreateCounterpartyId
|
|
97663
|
+
// {
|
|
97664
|
+
// "portfolio_uuid":"018e0a8b-6b6b-70e0-9689-1e7926c2c8bc",
|
|
97665
|
+
// "counterparty_id":"CB2ZPUCZBE"
|
|
97666
|
+
// }
|
|
97667
|
+
//
|
|
97668
|
+
const tag = this.safeString(response, 'destination_tag');
|
|
97669
|
+
const address = this.safeString2(response, 'address', 'counterparty_id');
|
|
97670
|
+
return {
|
|
97671
|
+
'currency': code,
|
|
97672
|
+
'tag': tag,
|
|
97673
|
+
'address': address,
|
|
97674
|
+
'info': response,
|
|
97675
|
+
};
|
|
97676
|
+
}
|
|
97677
|
+
findDefaultNetwork(networks) {
|
|
97678
|
+
const networksArray = this.toArray(networks);
|
|
97679
|
+
for (let i = 0; i < networksArray.length; i++) {
|
|
97680
|
+
const info = networksArray[i]['info'];
|
|
97681
|
+
const is_default = this.safeBool(info, 'is_default', false);
|
|
97682
|
+
if (is_default === true) {
|
|
97683
|
+
return networksArray[i];
|
|
97684
|
+
}
|
|
97685
|
+
}
|
|
97686
|
+
return networksArray[0];
|
|
97687
|
+
}
|
|
97688
|
+
async loadCurrencyNetworks(code, params = {}) {
|
|
97689
|
+
const currency = this.currency(code);
|
|
97690
|
+
const networks = this.safeDict(currency, 'networks');
|
|
97691
|
+
if (networks !== undefined) {
|
|
97692
|
+
return;
|
|
97693
|
+
}
|
|
97694
|
+
const request = {
|
|
97695
|
+
'asset': currency['id'],
|
|
97696
|
+
};
|
|
97697
|
+
const rawNetworks = await this.v1PublicGetAssetsAssetNetworks(request);
|
|
97698
|
+
//
|
|
97699
|
+
// [
|
|
97700
|
+
// {
|
|
97701
|
+
// "asset_id":"1",
|
|
97702
|
+
// "asset_uuid":"2b92315d-eab7-5bef-84fa-089a131333f5",
|
|
97703
|
+
// "asset_name":"USDC",
|
|
97704
|
+
// "network_arn_id":"networks/ethereum-mainnet/assets/9bc140b4-69c3-5fc9-bd0d-b041bcf40039",
|
|
97705
|
+
// "min_withdrawal_amt":"1",
|
|
97706
|
+
// "max_withdrawal_amt":"100000000",
|
|
97707
|
+
// "network_confirms":35,
|
|
97708
|
+
// "processing_time":485,
|
|
97709
|
+
// "is_default":true,
|
|
97710
|
+
// "network_name":"ethereum",
|
|
97711
|
+
// "display_name":"Ethereum"
|
|
97712
|
+
// },
|
|
97713
|
+
// ....
|
|
97714
|
+
// ]
|
|
97715
|
+
//
|
|
97716
|
+
currency['networks'] = this.parseNetworks(rawNetworks);
|
|
97717
|
+
}
|
|
97718
|
+
parseNetworks(networks, params = {}) {
|
|
97719
|
+
const result = {};
|
|
97720
|
+
for (let i = 0; i < networks.length; i++) {
|
|
97721
|
+
const network = this.extend(this.parseNetwork(networks[i]), params);
|
|
97722
|
+
result[network['network']] = network;
|
|
97723
|
+
}
|
|
97724
|
+
return result;
|
|
97725
|
+
}
|
|
97726
|
+
parseNetwork(network, params = {}) {
|
|
97727
|
+
//
|
|
97728
|
+
// {
|
|
97729
|
+
// "asset_id":"1",
|
|
97730
|
+
// "asset_uuid":"2b92315d-eab7-5bef-84fa-089a131333f5",
|
|
97731
|
+
// "asset_name":"USDC",
|
|
97732
|
+
// "network_arn_id":"networks/ethereum-mainnet/assets/9bc140b4-69c3-5fc9-bd0d-b041bcf40039",
|
|
97733
|
+
// "min_withdrawal_amt":"1",
|
|
97734
|
+
// "max_withdrawal_amt":"100000000",
|
|
97735
|
+
// "network_confirms":35,
|
|
97736
|
+
// "processing_time":485,
|
|
97737
|
+
// "is_default":true,
|
|
97738
|
+
// "network_name":"ethereum",
|
|
97739
|
+
// "display_name":"Ethereum"
|
|
97740
|
+
// }
|
|
97741
|
+
//
|
|
97742
|
+
const currencyId = this.safeString(network, 'asset_name');
|
|
97743
|
+
const currencyCode = this.safeCurrencyCode(currencyId);
|
|
97744
|
+
const networkId = this.safeString(network, 'network_arn_id');
|
|
97745
|
+
return this.safeNetwork({
|
|
97746
|
+
'info': network,
|
|
97747
|
+
'id': networkId,
|
|
97748
|
+
'name': this.safeString(network, 'display_name'),
|
|
97749
|
+
'network': this.networkIdToCode(this.safeStringN(network, ['network_name', 'display_name', 'network_arn_id'], ''), currencyCode),
|
|
97750
|
+
'active': undefined,
|
|
97751
|
+
'deposit': undefined,
|
|
97752
|
+
'withdraw': undefined,
|
|
97753
|
+
'precision': undefined,
|
|
97754
|
+
'fee': undefined,
|
|
97755
|
+
'limits': {
|
|
97756
|
+
'withdraw': {
|
|
97757
|
+
'min': this.safeNumber(network, 'min_withdrawal_amt'),
|
|
97758
|
+
'max': this.safeNumber(network, 'max_withdrawal_amt'),
|
|
97759
|
+
},
|
|
97760
|
+
'deposit': {
|
|
97761
|
+
'min': undefined,
|
|
97762
|
+
'max': undefined,
|
|
97763
|
+
},
|
|
97764
|
+
},
|
|
97765
|
+
});
|
|
97766
|
+
}
|
|
97767
|
+
async setMargin(symbol, amount, params = {}) {
|
|
97768
|
+
/**
|
|
97769
|
+
* @method
|
|
97770
|
+
* @name coinbaseinternational#setMargin
|
|
97771
|
+
* @description Either adds or reduces margin in order to set the margin to a specific value
|
|
97772
|
+
* @see https://docs.cloud.coinbase.com/intx/reference/setportfoliomarginoverride
|
|
97773
|
+
* @param {string} symbol unified market symbol of the market to set margin in
|
|
97774
|
+
* @param {float} amount the amount to set the margin to
|
|
97775
|
+
* @param {object} [params] parameters specific to the exchange API endpoint
|
|
97776
|
+
* @returns {object} A [margin structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#add-margin-structure}
|
|
97777
|
+
*/
|
|
97778
|
+
let portfolio = undefined;
|
|
97779
|
+
[portfolio, params] = await this.handlePortfolioAndParams('setMargin', params);
|
|
97780
|
+
if (symbol !== undefined) {
|
|
97781
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest(this.id + ' setMargin() only allows setting margin to full portfolio');
|
|
97782
|
+
}
|
|
97783
|
+
const request = {
|
|
97784
|
+
'portfolio': portfolio,
|
|
97785
|
+
'margin_override': amount,
|
|
97786
|
+
};
|
|
97787
|
+
return await this.v1PrivatePostPortfoliosMargin(this.extend(request, params));
|
|
97788
|
+
}
|
|
97789
|
+
async fetchDepositsWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
97790
|
+
/**
|
|
97791
|
+
* @method
|
|
97792
|
+
* @name exchange#fetchDepositsWithdrawals
|
|
97793
|
+
* @description fetch history of deposits and withdrawals
|
|
97794
|
+
* @see https://docs.cloud.coinbase.com/intx/reference/gettransfers
|
|
97795
|
+
* @param {string} [code] unified currency code for the currency of the deposit/withdrawals, default is undefined
|
|
97796
|
+
* @param {int} [since] timestamp in ms of the earliest deposit/withdrawal, default is undefined
|
|
97797
|
+
* @param {int} [limit] max number of deposit/withdrawals to return, default is undefined
|
|
97798
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
97799
|
+
* @param {string} [params.portfolios] Identifies the portfolios by UUID (e.g., 892e8c7c-e979-4cad-b61b-55a197932cf1) or portfolio ID (e.g., 5189861793641175). Can provide single or multiple portfolios to filter by or fetches transfers for all portfolios if none are provided.
|
|
97800
|
+
* @param {int} [params.until] Only find transfers updated before this time. Use timestamp format
|
|
97801
|
+
* @param {string} [params.status] The current status of transfer. Possible values: [PROCESSED, NEW, FAILED, STARTED]
|
|
97802
|
+
* @param {string} [params.type] The type of transfer Possible values: [DEPOSIT, WITHDRAW, REBATE, STIPEND, INTERNAL, FUNDING]
|
|
97803
|
+
* @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)
|
|
97804
|
+
* @returns {object} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
97805
|
+
*/
|
|
97806
|
+
await this.loadMarkets();
|
|
97807
|
+
let paginate = undefined;
|
|
97808
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchDepositsWithdrawals', 'paginate');
|
|
97809
|
+
let maxEntriesPerRequest = undefined;
|
|
97810
|
+
[maxEntriesPerRequest, params] = this.handleOptionAndParams(params, 'fetchDepositsWithdrawals', 'maxEntriesPerRequest', 100);
|
|
97811
|
+
const pageKey = 'ccxtPageKey';
|
|
97812
|
+
if (paginate) {
|
|
97813
|
+
return await this.fetchPaginatedCallIncremental('fetchDepositsWithdrawals', code, since, limit, params, pageKey, maxEntriesPerRequest);
|
|
97814
|
+
}
|
|
97815
|
+
const page = this.safeInteger(params, pageKey, 1) - 1;
|
|
97816
|
+
const request = {
|
|
97817
|
+
'result_offset': this.safeInteger2(params, 'offset', 'result_offset', page * maxEntriesPerRequest),
|
|
97818
|
+
};
|
|
97819
|
+
if (since !== undefined) {
|
|
97820
|
+
request['time_from'] = this.iso8601(since);
|
|
97821
|
+
}
|
|
97822
|
+
if (limit !== undefined) {
|
|
97823
|
+
const newLimit = Math.min(limit, 100);
|
|
97824
|
+
request['result_limit'] = newLimit;
|
|
97825
|
+
}
|
|
97826
|
+
let portfolios = undefined;
|
|
97827
|
+
[portfolios, params] = this.handleOptionAndParams(params, 'fetchDepositsWithdrawals', 'portfolios');
|
|
97828
|
+
if (portfolios !== undefined) {
|
|
97829
|
+
request['portfolios'] = portfolios;
|
|
97830
|
+
}
|
|
97831
|
+
let until = undefined;
|
|
97832
|
+
[until, params] = this.handleOptionAndParams(params, 'fetchDepositsWithdrawals', 'until');
|
|
97833
|
+
if (until !== undefined) {
|
|
97834
|
+
request['time_to'] = this.iso8601(until);
|
|
97835
|
+
}
|
|
97836
|
+
const response = await this.v1PrivateGetTransfers(this.extend(request, params));
|
|
97837
|
+
//
|
|
97838
|
+
// {
|
|
97839
|
+
// "pagination":{
|
|
97840
|
+
// "result_limit":25,
|
|
97841
|
+
// "result_offset":0
|
|
97842
|
+
// },
|
|
97843
|
+
// "results":[
|
|
97844
|
+
// {
|
|
97845
|
+
// "transfer_uuid":"8e471d77-4208-45a8-9e5b-f3bd8a2c1fc3",
|
|
97846
|
+
// "transfer_type":"WITHDRAW",
|
|
97847
|
+
// "amount":"1.000000",
|
|
97848
|
+
// "asset":"USDC",
|
|
97849
|
+
// "status":"PROCESSED",
|
|
97850
|
+
// "network_name":"ethereum",
|
|
97851
|
+
// "created_at":"2024-03-14T02:32:18.497795Z",
|
|
97852
|
+
// "updated_at":"2024-03-14T02:35:38.514588Z",
|
|
97853
|
+
// "from_portfolio":{
|
|
97854
|
+
// "id":"1yun54bb-1-6",
|
|
97855
|
+
// "uuid":"018e0a8b-6b6b-70e0-9689-1e7926c2c8bc",
|
|
97856
|
+
// "name":"fungus technology o?Portfolio"
|
|
97857
|
+
// },
|
|
97858
|
+
// "to_address":"0xcdcE79F820BE9d6C5033db5c31d1AE3A8c2399bB"
|
|
97859
|
+
// }
|
|
97860
|
+
// ]
|
|
97861
|
+
// }
|
|
97862
|
+
//
|
|
97863
|
+
const rawTransactions = this.safeList(response, 'results', []);
|
|
97864
|
+
return this.parseTransactions(rawTransactions);
|
|
97865
|
+
}
|
|
97866
|
+
async fetchPosition(symbol, params = {}) {
|
|
97867
|
+
/**
|
|
97868
|
+
* @method
|
|
97869
|
+
* @name coinbaseinternational#fetchPosition
|
|
97870
|
+
* @see https://docs.cloud.coinbase.com/intx/reference/getportfolioposition
|
|
97871
|
+
* @description fetch data on an open position
|
|
97872
|
+
* @param {string} symbol unified market symbol of the market the position is held in
|
|
97873
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
97874
|
+
* @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
97875
|
+
*/
|
|
97876
|
+
await this.loadMarkets();
|
|
97877
|
+
symbol = this.symbol(symbol);
|
|
97878
|
+
let portfolio = undefined;
|
|
97879
|
+
[portfolio, params] = await this.handlePortfolioAndParams('fetchPosition', params);
|
|
97880
|
+
const request = {
|
|
97881
|
+
'portfolio': portfolio,
|
|
97882
|
+
'instrument': this.marketId(symbol),
|
|
97883
|
+
};
|
|
97884
|
+
const position = await this.v1PrivateGetPortfoliosPortfolioPositionsInstrument(this.extend(request, params));
|
|
97885
|
+
//
|
|
97886
|
+
// {
|
|
97887
|
+
// "symbol":"BTC-PERP",
|
|
97888
|
+
// "instrument_id":"114jqr89-0-0",
|
|
97889
|
+
// "instrument_uuid":"b3469e0b-222c-4f8a-9f68-1f9e44d7e5e0",
|
|
97890
|
+
// "vwap":"52482.3",
|
|
97891
|
+
// "net_size":"0",
|
|
97892
|
+
// "buy_order_size":"0.001",
|
|
97893
|
+
// "sell_order_size":"0",
|
|
97894
|
+
// "im_contribution":"0.2",
|
|
97895
|
+
// "unrealized_pnl":"0",
|
|
97896
|
+
// "mark_price":"52406.8",
|
|
97897
|
+
// "entry_vwap":"52472.9"
|
|
97898
|
+
// }
|
|
97899
|
+
//
|
|
97900
|
+
return this.parsePosition(position);
|
|
97901
|
+
}
|
|
97902
|
+
parsePosition(position, market = undefined) {
|
|
97903
|
+
//
|
|
97904
|
+
// {
|
|
97905
|
+
// "symbol":"BTC-PERP",
|
|
97906
|
+
// "instrument_id":"114jqr89-0-0",
|
|
97907
|
+
// "instrument_uuid":"b3469e0b-222c-4f8a-9f68-1f9e44d7e5e0",
|
|
97908
|
+
// "vwap":"52482.3",
|
|
97909
|
+
// "net_size":"0",
|
|
97910
|
+
// "buy_order_size":"0.001",
|
|
97911
|
+
// "sell_order_size":"0",
|
|
97912
|
+
// "im_contribution":"0.2",
|
|
97913
|
+
// "unrealized_pnl":"0",
|
|
97914
|
+
// "mark_price":"52406.8",
|
|
97915
|
+
// "entry_vwap":"52472.9"
|
|
97916
|
+
// }
|
|
97917
|
+
//
|
|
97918
|
+
const marketId = this.safeString(position, 'symbol');
|
|
97919
|
+
let quantity = this.safeString(position, 'net_size');
|
|
97920
|
+
market = this.safeMarket(marketId, market, '-');
|
|
97921
|
+
let side = 'long';
|
|
97922
|
+
if (_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringLe(quantity, '0')) {
|
|
97923
|
+
side = 'short';
|
|
97924
|
+
quantity = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringMul('-1', quantity);
|
|
97925
|
+
}
|
|
97926
|
+
return this.safePosition({
|
|
97927
|
+
'info': position,
|
|
97928
|
+
'id': this.safeString(position, 'id'),
|
|
97929
|
+
'symbol': market['symbol'],
|
|
97930
|
+
'entryPrice': undefined,
|
|
97931
|
+
'markPrice': this.safeNumber(position, 'mark_price'),
|
|
97932
|
+
'notional': undefined,
|
|
97933
|
+
'collateral': undefined,
|
|
97934
|
+
'unrealizedPnl': this.safeNumber(position, 'unrealized_pnl'),
|
|
97935
|
+
'side': side,
|
|
97936
|
+
'contracts': this.parseNumber(quantity),
|
|
97937
|
+
'contractSize': this.safeNumber(market, 'contractSize'),
|
|
97938
|
+
'timestamp': undefined,
|
|
97939
|
+
'datetime': undefined,
|
|
97940
|
+
'hedged': undefined,
|
|
97941
|
+
'maintenanceMargin': undefined,
|
|
97942
|
+
'maintenanceMarginPercentage': undefined,
|
|
97943
|
+
'initialMargin': this.safeNumber(position, 'im_contribution'),
|
|
97944
|
+
'initialMarginPercentage': undefined,
|
|
97945
|
+
'leverage': undefined,
|
|
97946
|
+
'liquidationPrice': undefined,
|
|
97947
|
+
'marginRatio': undefined,
|
|
97948
|
+
'marginMode': undefined,
|
|
97949
|
+
'percentage': undefined,
|
|
97950
|
+
});
|
|
97951
|
+
}
|
|
97952
|
+
async fetchPositions(symbols = undefined, params = {}) {
|
|
97953
|
+
/**
|
|
97954
|
+
* @method
|
|
97955
|
+
* @name coinbaseinternational#fetchPositions
|
|
97956
|
+
* @see https://docs.cloud.coinbase.com/intx/reference/getportfoliopositions
|
|
97957
|
+
* @description fetch all open positions
|
|
97958
|
+
* @param {string[]} [symbols] list of unified market symbols
|
|
97959
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
97960
|
+
* @param {string} [method] method name to call, "positionRisk", "account" or "option", default is "positionRisk"
|
|
97961
|
+
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
97962
|
+
*/
|
|
97963
|
+
await this.loadMarkets();
|
|
97964
|
+
let portfolio = undefined;
|
|
97965
|
+
[portfolio, params] = await this.handlePortfolioAndParams('fetchPositions', params);
|
|
97966
|
+
const request = {
|
|
97967
|
+
'portfolio': portfolio,
|
|
97968
|
+
};
|
|
97969
|
+
const response = await this.v1PrivateGetPortfoliosPortfolioPositions(this.extend(request, params));
|
|
97970
|
+
//
|
|
97971
|
+
// [
|
|
97972
|
+
// {
|
|
97973
|
+
// "symbol":"BTC-PERP",
|
|
97974
|
+
// "instrument_id":"114jqr89-0-0",
|
|
97975
|
+
// "instrument_uuid":"b3469e0b-222c-4f8a-9f68-1f9e44d7e5e0",
|
|
97976
|
+
// "vwap":"52482.3",
|
|
97977
|
+
// "net_size":"0",
|
|
97978
|
+
// "buy_order_size":"0.001",
|
|
97979
|
+
// "sell_order_size":"0",
|
|
97980
|
+
// "im_contribution":"0.2",
|
|
97981
|
+
// "unrealized_pnl":"0",
|
|
97982
|
+
// "mark_price":"52406.8",
|
|
97983
|
+
// "entry_vwap":"52472.9"
|
|
97984
|
+
// }
|
|
97985
|
+
// ]
|
|
97986
|
+
//
|
|
97987
|
+
const positions = this.parsePositions(response);
|
|
97988
|
+
if (this.isEmpty(symbols)) {
|
|
97989
|
+
return positions;
|
|
97990
|
+
}
|
|
97991
|
+
symbols = this.marketSymbols(symbols);
|
|
97992
|
+
return this.filterByArrayPositions(positions, 'symbol', symbols, false);
|
|
97993
|
+
}
|
|
97994
|
+
async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
97995
|
+
/**
|
|
97996
|
+
* @method
|
|
97997
|
+
* @name coinbaseinternational#fetchWithdrawals
|
|
97998
|
+
* @description fetch all withdrawals made from an account
|
|
97999
|
+
* @see https://docs.cloud.coinbase.com/intx/reference/gettransfers
|
|
98000
|
+
* @param {string} code unified currency code
|
|
98001
|
+
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
98002
|
+
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
98003
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
98004
|
+
* @param {string} [params.portfolios] Identifies the portfolios by UUID (e.g., 892e8c7c-e979-4cad-b61b-55a197932cf1) or portfolio ID (e.g., 5189861793641175). Can provide single or multiple portfolios to filter by or fetches transfers for all portfolios if none are provided.
|
|
98005
|
+
* @param {int} [params.until] Only find transfers updated before this time. Use timestamp format
|
|
98006
|
+
* @param {string} [params.status] The current status of transfer. Possible values: [PROCESSED, NEW, FAILED, STARTED]
|
|
98007
|
+
* @param {string} [params.type] The type of transfer Possible values: [DEPOSIT, WITHDRAW, REBATE, STIPEND, INTERNAL, FUNDING]
|
|
98008
|
+
* @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)
|
|
98009
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
98010
|
+
*/
|
|
98011
|
+
await this.loadMarkets();
|
|
98012
|
+
params['type'] = 'WITHDRAW';
|
|
98013
|
+
return await this.fetchDepositsWithdrawals(code, since, limit, params);
|
|
98014
|
+
}
|
|
98015
|
+
async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
98016
|
+
/**
|
|
98017
|
+
* @method
|
|
98018
|
+
* @name coinbaseinternational#fetchDeposits
|
|
98019
|
+
* @description fetch all deposits made to an account
|
|
98020
|
+
* @param {string} code unified currency code
|
|
98021
|
+
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
98022
|
+
* @param {int} [limit] the maximum number of deposits structures to retrieve
|
|
98023
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
98024
|
+
* @param {string} [params.portfolios] Identifies the portfolios by UUID (e.g., 892e8c7c-e979-4cad-b61b-55a197932cf1) or portfolio ID (e.g., 5189861793641175). Can provide single or multiple portfolios to filter by or fetches transfers for all portfolios if none are provided.
|
|
98025
|
+
* @param {int} [params.until] Only find transfers updated before this time. Use timestamp format
|
|
98026
|
+
* @param {string} [params.status] The current status of transfer. Possible values: [PROCESSED, NEW, FAILED, STARTED]
|
|
98027
|
+
* @param {string} [params.type] The type of transfer Possible values: [DEPOSIT, WITHDRAW, REBATE, STIPEND, INTERNAL, FUNDING]
|
|
98028
|
+
* @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)
|
|
98029
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
98030
|
+
*/
|
|
98031
|
+
await this.loadMarkets();
|
|
98032
|
+
params['type'] = 'DEPOSIT';
|
|
98033
|
+
return await this.fetchDepositsWithdrawals(code, since, limit, params);
|
|
98034
|
+
}
|
|
98035
|
+
parseTransactionStatus(status) {
|
|
98036
|
+
const statuses = {
|
|
98037
|
+
'PROCESSED': 'ok',
|
|
98038
|
+
'NEW': 'pending',
|
|
98039
|
+
'STARTED': 'pending',
|
|
98040
|
+
'FAILED': 'canceled',
|
|
98041
|
+
};
|
|
98042
|
+
return this.safeString(statuses, status, status);
|
|
98043
|
+
}
|
|
98044
|
+
parseTransaction(transaction, currency = undefined) {
|
|
98045
|
+
//
|
|
98046
|
+
// {
|
|
98047
|
+
// "idem":"8e471d77-4208-45a8-9e5b-f3bd8a2c1fc3"
|
|
98048
|
+
// }
|
|
98049
|
+
// const transactionType = this.safeString (transaction, 'type');
|
|
98050
|
+
const datetime = this.safeString(transaction, 'updated_at');
|
|
98051
|
+
const fromPorfolio = this.safeDict(transaction, 'from_portfolio', {});
|
|
98052
|
+
const addressFrom = this.safeStringN(transaction, ['from_address', 'from_cb_account', this.safeStringN(fromPorfolio, ['id', 'uuid', 'name']), 'from_counterparty_id']);
|
|
98053
|
+
const toPorfolio = this.safeDict(transaction, 'from_portfolio', {});
|
|
98054
|
+
const addressTo = this.safeStringN(transaction, ['to_address', 'to_cb_account', this.safeStringN(toPorfolio, ['id', 'uuid', 'name']), 'to_counterparty_id']);
|
|
98055
|
+
return {
|
|
98056
|
+
'info': transaction,
|
|
98057
|
+
'id': this.safeString(transaction, 'transfer_uuid'),
|
|
98058
|
+
'txid': this.safeString(transaction, 'transaction_uuid'),
|
|
98059
|
+
'timestamp': this.parse8601(datetime),
|
|
98060
|
+
'datetime': datetime,
|
|
98061
|
+
'network': this.networkIdToCode(this.safeString(transaction, 'network_name')),
|
|
98062
|
+
'address': undefined,
|
|
98063
|
+
'addressTo': addressTo,
|
|
98064
|
+
'addressFrom': addressFrom,
|
|
98065
|
+
'tag': undefined,
|
|
98066
|
+
'tagTo': undefined,
|
|
98067
|
+
'tagFrom': undefined,
|
|
98068
|
+
'type': this.safeString(transaction, 'resource'),
|
|
98069
|
+
'amount': this.safeNumber(transaction, 'amount'),
|
|
98070
|
+
'currency': this.safeCurrencyCode(this.safeString(transaction, 'asset'), currency),
|
|
98071
|
+
'status': this.parseTransactionStatus(this.safeString(transaction, 'status')),
|
|
98072
|
+
'updated': this.parse8601(datetime),
|
|
98073
|
+
'fee': {
|
|
98074
|
+
'cost': undefined,
|
|
98075
|
+
'currency': undefined,
|
|
98076
|
+
},
|
|
98077
|
+
};
|
|
98078
|
+
}
|
|
98079
|
+
parseTrade(trade, market = undefined) {
|
|
98080
|
+
//
|
|
98081
|
+
// {
|
|
98082
|
+
// "portfolio_id":"1wp37qsc-1-0",
|
|
98083
|
+
// "portfolio_uuid":"018d7f6c-b92c-7361-8b7e-2932711e5a22",
|
|
98084
|
+
// "portfolio_name":"CCXT Portfolio 020624-17:16",
|
|
98085
|
+
// "fill_id":"1xbfy19y-1-184",
|
|
98086
|
+
// "exec_id":"280841526207070392",
|
|
98087
|
+
// "order_id":"1xbfv8yw-1-0",
|
|
98088
|
+
// "instrument_id":"114jqr89-0-0",
|
|
98089
|
+
// "instrument_uuid":"b3469e0b-222c-4f8a-9f68-1f9e44d7e5e0",
|
|
98090
|
+
// "symbol":"BTC-PERP",
|
|
98091
|
+
// "match_id":"280841526207053840",
|
|
98092
|
+
// "fill_price":"52500",
|
|
98093
|
+
// "fill_qty":"0.01",
|
|
98094
|
+
// "client_id":"1x59ctku-1-1",
|
|
98095
|
+
// "client_order_id":"ccxt3e4e2a5f-4a89-",
|
|
98096
|
+
// "order_qty":"0.01",
|
|
98097
|
+
// "limit_price":"52500",
|
|
98098
|
+
// "total_filled":"0.01",
|
|
98099
|
+
// "filled_vwap":"52500",
|
|
98100
|
+
// "expire_time":"",
|
|
98101
|
+
// "stop_price":"",
|
|
98102
|
+
// "side":"BUY",
|
|
98103
|
+
// "tif":"GTC",
|
|
98104
|
+
// "stp_mode":"BOTH",
|
|
98105
|
+
// "flags":"",
|
|
98106
|
+
// "fee":"0.105",
|
|
98107
|
+
// "fee_asset":"USDC",
|
|
98108
|
+
// "order_status":"DONE",
|
|
98109
|
+
// "event_time":"2024-02-15T00:43:57.631Z"
|
|
98110
|
+
// }
|
|
98111
|
+
//
|
|
98112
|
+
const marketId = this.safeString(trade, 'symbol');
|
|
98113
|
+
const datetime = this.safeString(trade, 'event_time');
|
|
98114
|
+
return this.safeTrade({
|
|
98115
|
+
'info': trade,
|
|
98116
|
+
'id': this.safeString2(trade, 'fill_id', 'exec_id'),
|
|
98117
|
+
'order': this.safeString(trade, 'order_id'),
|
|
98118
|
+
'timestamp': this.parse8601(datetime),
|
|
98119
|
+
'datetime': datetime,
|
|
98120
|
+
'symbol': this.safeSymbol(marketId, market),
|
|
98121
|
+
'type': undefined,
|
|
98122
|
+
'side': this.safeStringLower(trade, 'side'),
|
|
98123
|
+
'takerOrMaker': undefined,
|
|
98124
|
+
'price': this.safeNumber(trade, 'fill_price'),
|
|
98125
|
+
'amount': this.safeNumber(trade, 'fill_qty'),
|
|
98126
|
+
'cost': undefined,
|
|
98127
|
+
'fee': {
|
|
98128
|
+
'cost': this.safeNumber(trade, 'fee'),
|
|
98129
|
+
'currency': this.safeCurrencyCode(this.safeString(trade, 'fee_asset')),
|
|
98130
|
+
},
|
|
98131
|
+
});
|
|
98132
|
+
}
|
|
98133
|
+
async fetchMarkets(params = {}) {
|
|
98134
|
+
/**
|
|
98135
|
+
* @method
|
|
98136
|
+
* @name coinbaseinternational#fetchMarkets
|
|
98137
|
+
* @see https://docs.cloud.coinbase.com/intx/reference/getinstruments
|
|
98138
|
+
* @description retrieves data on all markets for coinbaseinternational
|
|
98139
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
98140
|
+
* @returns {object[]} an array of objects representing market data
|
|
98141
|
+
*/
|
|
98142
|
+
const response = await this.v1PublicGetInstruments(params);
|
|
98143
|
+
//
|
|
98144
|
+
// [
|
|
98145
|
+
// {
|
|
98146
|
+
// "instrument_id":"149264164756389888",
|
|
98147
|
+
// "instrument_uuid":"e9360798-6a10-45d6-af05-67c30eb91e2d",
|
|
98148
|
+
// "symbol":"ETH-PERP",
|
|
98149
|
+
// "type":"PERP",
|
|
98150
|
+
// "base_asset_id":"118059611793145856",
|
|
98151
|
+
// "base_asset_uuid":"d85dce9b-5b73-5c3c-8978-522ce1d1c1b4",
|
|
98152
|
+
// "base_asset_name":"ETH",
|
|
98153
|
+
// "quote_asset_id":"1",
|
|
98154
|
+
// "quote_asset_uuid":"2b92315d-eab7-5bef-84fa-089a131333f5",
|
|
98155
|
+
// "quote_asset_name":"USDC",
|
|
98156
|
+
// "base_increment":"0.0001",
|
|
98157
|
+
// "quote_increment":"0.01",
|
|
98158
|
+
// "price_band_percent":"0.02",
|
|
98159
|
+
// "market_order_percent":"0.0075",
|
|
98160
|
+
// "qty_24hr":"44434.8131",
|
|
98161
|
+
// "notional_24hr":"110943454.279785",
|
|
98162
|
+
// "avg_daily_qty":"1099171.6025",
|
|
98163
|
+
// "avg_daily_notional":"2637240145.456987",
|
|
98164
|
+
// "previous_day_qty":"78909.3939",
|
|
98165
|
+
// "open_interest":"1270.749",
|
|
98166
|
+
// "position_limit_qty":"1831.9527",
|
|
98167
|
+
// "position_limit_adq_pct":"0.05",
|
|
98168
|
+
// "replacement_cost":"0.23",
|
|
98169
|
+
// "base_imf":"0.1",
|
|
98170
|
+
// "min_notional_value":"10",
|
|
98171
|
+
// "funding_interval":"3600000000000",
|
|
98172
|
+
// "trading_state":"TRADING",
|
|
98173
|
+
// "quote":{
|
|
98174
|
+
// "best_bid_price":"2490.8",
|
|
98175
|
+
// "best_bid_size":"9.0515",
|
|
98176
|
+
// "best_ask_price":"2490.81",
|
|
98177
|
+
// "best_ask_size":"4.8486",
|
|
98178
|
+
// "trade_price":"2490.39",
|
|
98179
|
+
// "trade_qty":"0.9508",
|
|
98180
|
+
// "index_price":"2490.5",
|
|
98181
|
+
// "mark_price":"2490.8",
|
|
98182
|
+
// "settlement_price":"2490.81",
|
|
98183
|
+
// "limit_up":"2615.42",
|
|
98184
|
+
// "limit_down":"2366.34",
|
|
98185
|
+
// "predicted_funding":"0.000009",
|
|
98186
|
+
// "timestamp":"2024-02-10T16:07:39.454Z"
|
|
98187
|
+
// }
|
|
98188
|
+
// },
|
|
98189
|
+
// ...
|
|
98190
|
+
// ]
|
|
98191
|
+
//
|
|
98192
|
+
return this.parseMarkets(response);
|
|
98193
|
+
}
|
|
98194
|
+
parseMarket(market) {
|
|
98195
|
+
//
|
|
98196
|
+
// {
|
|
98197
|
+
// "instrument_id":"149264164756389888",
|
|
98198
|
+
// "instrument_uuid":"e9360798-6a10-45d6-af05-67c30eb91e2d",
|
|
98199
|
+
// "symbol":"ETH-PERP",
|
|
98200
|
+
// "type":"PERP",
|
|
98201
|
+
// "base_asset_id":"118059611793145856",
|
|
98202
|
+
// "base_asset_uuid":"d85dce9b-5b73-5c3c-8978-522ce1d1c1b4",
|
|
98203
|
+
// "base_asset_name":"ETH",
|
|
98204
|
+
// "quote_asset_id":"1",
|
|
98205
|
+
// "quote_asset_uuid":"2b92315d-eab7-5bef-84fa-089a131333f5",
|
|
98206
|
+
// "quote_asset_name":"USDC",
|
|
98207
|
+
// "base_increment":"0.0001",
|
|
98208
|
+
// "quote_increment":"0.01",
|
|
98209
|
+
// "price_band_percent":"0.02",
|
|
98210
|
+
// "market_order_percent":"0.0075",
|
|
98211
|
+
// "qty_24hr":"44434.8131",
|
|
98212
|
+
// "notional_24hr":"110943454.279785",
|
|
98213
|
+
// "avg_daily_qty":"1099171.6025",
|
|
98214
|
+
// "avg_daily_notional":"2637240145.456987",
|
|
98215
|
+
// "previous_day_qty":"78909.3939",
|
|
98216
|
+
// "open_interest":"1270.749",
|
|
98217
|
+
// "position_limit_qty":"1831.9527",
|
|
98218
|
+
// "position_limit_adq_pct":"0.05",
|
|
98219
|
+
// "replacement_cost":"0.23",
|
|
98220
|
+
// "base_imf":"0.1",
|
|
98221
|
+
// "min_notional_value":"10",
|
|
98222
|
+
// "funding_interval":"3600000000000",
|
|
98223
|
+
// "trading_state":"TRADING",
|
|
98224
|
+
// "quote":{
|
|
98225
|
+
// "best_bid_price":"2490.8",
|
|
98226
|
+
// "best_bid_size":"9.0515",
|
|
98227
|
+
// "best_ask_price":"2490.81",
|
|
98228
|
+
// "best_ask_size":"4.8486",
|
|
98229
|
+
// "trade_price":"2490.39",
|
|
98230
|
+
// "trade_qty":"0.9508",
|
|
98231
|
+
// "index_price":"2490.5",
|
|
98232
|
+
// "mark_price":"2490.8",
|
|
98233
|
+
// "settlement_price":"2490.81",
|
|
98234
|
+
// "limit_up":"2615.42",
|
|
98235
|
+
// "limit_down":"2366.34",
|
|
98236
|
+
// "predicted_funding":"0.000009",
|
|
98237
|
+
// "timestamp":"2024-02-10T16:07:39.454Z"
|
|
98238
|
+
// }
|
|
98239
|
+
// }
|
|
98240
|
+
//
|
|
98241
|
+
const marketId = this.safeString(market, 'symbol');
|
|
98242
|
+
const baseId = this.safeString(market, 'base_asset_name');
|
|
98243
|
+
const quoteId = this.safeString(market, 'quote_asset_name');
|
|
98244
|
+
const typeId = this.safeString(market, 'type'); // 'SPOT', 'PERP'
|
|
98245
|
+
const isSpot = (typeId === 'SPOT');
|
|
98246
|
+
const fees = this.fees;
|
|
98247
|
+
let symbol = baseId + '/' + quoteId;
|
|
98248
|
+
let settleId = undefined;
|
|
98249
|
+
if (!isSpot) {
|
|
98250
|
+
settleId = quoteId;
|
|
98251
|
+
symbol += ':' + quoteId;
|
|
98252
|
+
}
|
|
98253
|
+
return {
|
|
98254
|
+
'id': marketId,
|
|
98255
|
+
'lowercaseId': marketId.toLowerCase(),
|
|
98256
|
+
'symbol': symbol,
|
|
98257
|
+
'base': baseId,
|
|
98258
|
+
'quote': quoteId,
|
|
98259
|
+
'settle': settleId ? settleId : undefined,
|
|
98260
|
+
'baseId': baseId,
|
|
98261
|
+
'quoteId': quoteId,
|
|
98262
|
+
'settleId': settleId ? settleId : undefined,
|
|
98263
|
+
'type': isSpot ? 'spot' : 'swap',
|
|
98264
|
+
'spot': isSpot,
|
|
98265
|
+
'margin': false,
|
|
98266
|
+
'swap': !isSpot,
|
|
98267
|
+
'future': false,
|
|
98268
|
+
'option': false,
|
|
98269
|
+
'active': this.safeString(market, 'trading_state') === 'TRADING',
|
|
98270
|
+
'contract': !isSpot,
|
|
98271
|
+
'linear': isSpot ? undefined : (settleId === quoteId),
|
|
98272
|
+
'inverse': isSpot ? undefined : (settleId !== quoteId),
|
|
98273
|
+
'taker': fees['trading']['taker'],
|
|
98274
|
+
'maker': fees['trading']['maker'],
|
|
98275
|
+
'contractSize': isSpot ? undefined : 1,
|
|
98276
|
+
'expiry': undefined,
|
|
98277
|
+
'expiryDatetime': undefined,
|
|
98278
|
+
'strike': undefined,
|
|
98279
|
+
'optionType': undefined,
|
|
98280
|
+
'precision': {
|
|
98281
|
+
'amount': this.safeNumber(market, 'base_increment'),
|
|
98282
|
+
'price': this.safeNumber(market, 'quote_increment'),
|
|
98283
|
+
'cost': this.safeNumber(market, 'quote_increment'),
|
|
98284
|
+
},
|
|
98285
|
+
'limits': {
|
|
98286
|
+
'leverage': {
|
|
98287
|
+
'min': undefined,
|
|
98288
|
+
'max': this.safeNumber(market, 'base_imf'),
|
|
98289
|
+
},
|
|
98290
|
+
'amount': {
|
|
98291
|
+
'min': undefined,
|
|
98292
|
+
'max': isSpot ? undefined : this.safeNumber(market, 'position_limit_qty'),
|
|
98293
|
+
},
|
|
98294
|
+
'price': {
|
|
98295
|
+
'min': undefined,
|
|
98296
|
+
'max': undefined,
|
|
98297
|
+
},
|
|
98298
|
+
'cost': {
|
|
98299
|
+
'min': this.safeNumber(market, 'min_notional_value'),
|
|
98300
|
+
'max': undefined,
|
|
98301
|
+
},
|
|
98302
|
+
},
|
|
98303
|
+
'info': market,
|
|
98304
|
+
'created': undefined,
|
|
98305
|
+
};
|
|
98306
|
+
}
|
|
98307
|
+
async fetchCurrencies(params = {}) {
|
|
98308
|
+
/**
|
|
98309
|
+
* @method
|
|
98310
|
+
* @name coinbaseinternational#fetchCurrencies
|
|
98311
|
+
* @description fetches all available currencies on an exchange
|
|
98312
|
+
* @see https://docs.cloud.coinbase.com/intx/reference/getassets
|
|
98313
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
98314
|
+
* @returns {object} an associative dictionary of currencies
|
|
98315
|
+
*/
|
|
98316
|
+
const currencies = await this.v1PublicGetAssets(params);
|
|
98317
|
+
//
|
|
98318
|
+
// [
|
|
98319
|
+
// {
|
|
98320
|
+
// "asset_id":"1",
|
|
98321
|
+
// "asset_uuid":"2b92315d-eab7-5bef-84fa-089a131333f5",
|
|
98322
|
+
// "asset_name":"USDC",
|
|
98323
|
+
// "status":"ACTIVE",
|
|
98324
|
+
// "collateral_weight":1.0,
|
|
98325
|
+
// "supported_networks_enabled":true
|
|
98326
|
+
// },
|
|
98327
|
+
// ...
|
|
98328
|
+
// ]
|
|
98329
|
+
//
|
|
98330
|
+
const result = {};
|
|
98331
|
+
for (let i = 0; i < currencies.length; i++) {
|
|
98332
|
+
const currency = this.parseCurrency(currencies[i]);
|
|
98333
|
+
result[currency['code']] = currency;
|
|
98334
|
+
}
|
|
98335
|
+
return result;
|
|
98336
|
+
}
|
|
98337
|
+
parseCurrency(currency) {
|
|
98338
|
+
//
|
|
98339
|
+
// {
|
|
98340
|
+
// "asset_id":"1",
|
|
98341
|
+
// "asset_uuid":"2b92315d-eab7-5bef-84fa-089a131333f5",
|
|
98342
|
+
// "asset_name":"USDC",
|
|
98343
|
+
// "status":"ACTIVE",
|
|
98344
|
+
// "collateral_weight":1.0,
|
|
98345
|
+
// "supported_networks_enabled":true
|
|
98346
|
+
// }
|
|
98347
|
+
//
|
|
98348
|
+
const id = this.safeString(currency, 'asset_name');
|
|
98349
|
+
const code = this.safeCurrencyCode(id);
|
|
98350
|
+
const statusId = this.safeString(currency, 'status');
|
|
98351
|
+
return {
|
|
98352
|
+
'id': id,
|
|
98353
|
+
'name': code,
|
|
98354
|
+
'code': code,
|
|
98355
|
+
'precision': undefined,
|
|
98356
|
+
'info': currency,
|
|
98357
|
+
'active': (statusId === 'ACTIVE'),
|
|
98358
|
+
'deposit': undefined,
|
|
98359
|
+
'withdraw': undefined,
|
|
98360
|
+
'networks': undefined,
|
|
98361
|
+
'fee': undefined,
|
|
98362
|
+
'fees': undefined,
|
|
98363
|
+
'limits': this.limits,
|
|
98364
|
+
};
|
|
98365
|
+
}
|
|
98366
|
+
async fetchTickers(symbols = undefined, params = {}) {
|
|
98367
|
+
/**
|
|
98368
|
+
* @method
|
|
98369
|
+
* @name coinbaseinternational#fetchTickers
|
|
98370
|
+
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
98371
|
+
* @see https://docs.cloud.coinbase.com/intx/reference/getinstruments
|
|
98372
|
+
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
98373
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
98374
|
+
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
98375
|
+
*/
|
|
98376
|
+
await this.loadMarkets();
|
|
98377
|
+
symbols = this.marketSymbols(symbols);
|
|
98378
|
+
const instruments = await this.v1PublicGetInstruments(params);
|
|
98379
|
+
const tickers = {};
|
|
98380
|
+
for (let i = 0; i < instruments.length; i++) {
|
|
98381
|
+
const instrument = instruments[i];
|
|
98382
|
+
const marketId = this.safeString(instrument, 'symbol');
|
|
98383
|
+
const symbol = this.safeSymbol(marketId);
|
|
98384
|
+
const quote = this.safeDict(instrument, 'quote', {});
|
|
98385
|
+
tickers[symbol] = this.parseTicker(quote, this.safeMarket(marketId));
|
|
98386
|
+
}
|
|
98387
|
+
return this.filterByArray(tickers, 'symbol', symbols, true);
|
|
98388
|
+
}
|
|
98389
|
+
async fetchTicker(symbol, params = {}) {
|
|
98390
|
+
/**
|
|
98391
|
+
* @method
|
|
98392
|
+
* @name coinbaseinternational#fetchTicker
|
|
98393
|
+
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
98394
|
+
* @see https://docs.cloud.coinbase.com/intx/reference/getinstrumentquote
|
|
98395
|
+
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
98396
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
98397
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
98398
|
+
*/
|
|
98399
|
+
await this.loadMarkets();
|
|
98400
|
+
const market = this.market(symbol);
|
|
98401
|
+
const request = {
|
|
98402
|
+
'instrument': this.marketId(symbol),
|
|
98403
|
+
};
|
|
98404
|
+
const ticker = await this.v1PublicGetInstrumentsInstrumentQuote(this.extend(request, params));
|
|
98405
|
+
return this.parseTicker(ticker, market);
|
|
98406
|
+
}
|
|
98407
|
+
parseTicker(ticker, market = undefined) {
|
|
98408
|
+
//
|
|
98409
|
+
// {
|
|
98410
|
+
// "best_bid_price":"2490.8",
|
|
98411
|
+
// "best_bid_size":"9.0515",
|
|
98412
|
+
// "best_ask_price":"2490.81",
|
|
98413
|
+
// "best_ask_size":"4.8486",
|
|
98414
|
+
// "trade_price":"2490.39",
|
|
98415
|
+
// "trade_qty":"0.9508",
|
|
98416
|
+
// "index_price":"2490.5",
|
|
98417
|
+
// "mark_price":"2490.8",
|
|
98418
|
+
// "settlement_price":"2490.81",
|
|
98419
|
+
// "limit_up":"2615.42",
|
|
98420
|
+
// "limit_down":"2366.34",
|
|
98421
|
+
// "predicted_funding":"0.000009",
|
|
98422
|
+
// "timestamp":"2024-02-10T16:07:39.454Z"
|
|
98423
|
+
// }
|
|
98424
|
+
//
|
|
98425
|
+
const datetime = this.safeString(ticker, 'timestamp');
|
|
98426
|
+
return this.safeTicker({
|
|
98427
|
+
'info': ticker,
|
|
98428
|
+
'symbol': this.safeSymbol(undefined, market),
|
|
98429
|
+
'timestamp': this.parse8601(datetime),
|
|
98430
|
+
'datetime': datetime,
|
|
98431
|
+
'bid': this.safeNumber(ticker, 'best_bid_price'),
|
|
98432
|
+
'bidVolume': this.safeNumber(ticker, 'best_bid_size'),
|
|
98433
|
+
'ask': this.safeNumber(ticker, 'best_ask_price'),
|
|
98434
|
+
'askVolume': this.safeNumber(ticker, 'best_ask_size'),
|
|
98435
|
+
'high': undefined,
|
|
98436
|
+
'low': undefined,
|
|
98437
|
+
'open': undefined,
|
|
98438
|
+
'close': undefined,
|
|
98439
|
+
'last': undefined,
|
|
98440
|
+
'change': undefined,
|
|
98441
|
+
'percentage': undefined,
|
|
98442
|
+
'average': undefined,
|
|
98443
|
+
'vwap': undefined,
|
|
98444
|
+
'baseVolume': undefined,
|
|
98445
|
+
'quoteVolume': undefined,
|
|
98446
|
+
'previousClose': undefined,
|
|
98447
|
+
});
|
|
98448
|
+
}
|
|
98449
|
+
async fetchBalance(params = {}) {
|
|
98450
|
+
/**
|
|
98451
|
+
* @method
|
|
98452
|
+
* @name coinbaseinternational#fetchBalance
|
|
98453
|
+
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
98454
|
+
* @see https://docs.cloud.coinbase.com/intx/reference/getportfoliobalances
|
|
98455
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
98456
|
+
* @param {boolean} [params.v3] default false, set true to use v3 api endpoint
|
|
98457
|
+
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
98458
|
+
*/
|
|
98459
|
+
await this.loadMarkets();
|
|
98460
|
+
let portfolio = undefined;
|
|
98461
|
+
[portfolio, params] = await this.handlePortfolioAndParams('fetchBalance', params);
|
|
98462
|
+
const request = {
|
|
98463
|
+
'portfolio': portfolio,
|
|
98464
|
+
};
|
|
98465
|
+
const balances = await this.v1PrivateGetPortfoliosPortfolioBalances(this.extend(request, params));
|
|
98466
|
+
//
|
|
98467
|
+
// [
|
|
98468
|
+
// {
|
|
98469
|
+
// "asset_id":"0-0-1",
|
|
98470
|
+
// "asset_name":"USDC",
|
|
98471
|
+
// "asset_uuid":"2b92315d-eab7-5bef-84fa-089a131333f5",
|
|
98472
|
+
// "quantity":"500000.0000000000",
|
|
98473
|
+
// "hold":"0",
|
|
98474
|
+
// "hold_available_for_collateral":"0",
|
|
98475
|
+
// "transfer_hold":"0",
|
|
98476
|
+
// "collateral_value":"500000.0",
|
|
98477
|
+
// "max_withdraw_amount":"500000.0000000000",
|
|
98478
|
+
// "loan":"0",
|
|
98479
|
+
// "loan_collateral_requirement":"0.0"
|
|
98480
|
+
// }
|
|
98481
|
+
// ]
|
|
98482
|
+
//
|
|
98483
|
+
return this.parseBalance(balances);
|
|
98484
|
+
}
|
|
98485
|
+
parseBalance(response) {
|
|
98486
|
+
//
|
|
98487
|
+
// {
|
|
98488
|
+
// "asset_id":"0-0-1",
|
|
98489
|
+
// "asset_name":"USDC",
|
|
98490
|
+
// "asset_uuid":"2b92315d-eab7-5bef-84fa-089a131333f5",
|
|
98491
|
+
// "quantity":"500000.0000000000",
|
|
98492
|
+
// "hold":"0",
|
|
98493
|
+
// "hold_available_for_collateral":"0",
|
|
98494
|
+
// "transfer_hold":"0",
|
|
98495
|
+
// "collateral_value":"500000.0",
|
|
98496
|
+
// "max_withdraw_amount":"500000.0000000000",
|
|
98497
|
+
// "loan":"0",
|
|
98498
|
+
// "loan_collateral_requirement":"0.0"
|
|
98499
|
+
// }
|
|
98500
|
+
//
|
|
98501
|
+
const result = {
|
|
98502
|
+
'info': response,
|
|
98503
|
+
};
|
|
98504
|
+
for (let i = 0; i < response.length; i++) {
|
|
98505
|
+
const rawBalance = response[i];
|
|
98506
|
+
const currencyId = this.safeString(rawBalance, 'asset_name');
|
|
98507
|
+
const code = this.safeCurrencyCode(currencyId);
|
|
98508
|
+
const account = this.account();
|
|
98509
|
+
account['total'] = this.safeString(rawBalance, 'quantity');
|
|
98510
|
+
account['used'] = this.safeString(rawBalance, 'hold');
|
|
98511
|
+
result[code] = account;
|
|
98512
|
+
}
|
|
98513
|
+
return this.safeBalance(result);
|
|
98514
|
+
}
|
|
98515
|
+
async transfer(code, amount, fromAccount, toAccount, params = {}) {
|
|
98516
|
+
/**
|
|
98517
|
+
* @method
|
|
98518
|
+
* @name coinbaseinternational#transfer
|
|
98519
|
+
* @description Transfer an amount of asset from one portfolio to another.
|
|
98520
|
+
* @see https://docs.cloud.coinbase.com/intx/reference/createportfolioassettransfer
|
|
98521
|
+
* @param {string} code unified currency code
|
|
98522
|
+
* @param {float} amount amount to transfer
|
|
98523
|
+
* @param {string} fromAccount account to transfer from
|
|
98524
|
+
* @param {string} toAccount account to transfer to
|
|
98525
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
98526
|
+
* @returns {object} a [transfer structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#transfer-structure}
|
|
98527
|
+
*/
|
|
98528
|
+
await this.loadMarkets();
|
|
98529
|
+
const currency = this.currency(code);
|
|
98530
|
+
const request = {
|
|
98531
|
+
'asset': currency['id'],
|
|
98532
|
+
'ammount': amount,
|
|
98533
|
+
'from': fromAccount,
|
|
98534
|
+
'to': toAccount,
|
|
98535
|
+
};
|
|
98536
|
+
const response = await this.v1PrivatePostPortfoliosTransfer(this.extend(request, params));
|
|
98537
|
+
const success = this.safeBool(response, 'success');
|
|
98538
|
+
return {
|
|
98539
|
+
'info': response,
|
|
98540
|
+
'id': undefined,
|
|
98541
|
+
'timestamp': undefined,
|
|
98542
|
+
'datetime': undefined,
|
|
98543
|
+
'currency': code,
|
|
98544
|
+
'amount': amount,
|
|
98545
|
+
'fromAccount': fromAccount,
|
|
98546
|
+
'toAccount': toAccount,
|
|
98547
|
+
'status': success ? 'ok' : 'failed',
|
|
98548
|
+
};
|
|
98549
|
+
}
|
|
98550
|
+
async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
98551
|
+
/**
|
|
98552
|
+
* @method
|
|
98553
|
+
* @name coinbaseinternational#createOrder
|
|
98554
|
+
* @description create a trade order
|
|
98555
|
+
* @see https://docs.cloud.coinbase.com/intx/reference/createorder
|
|
98556
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
98557
|
+
* @param {string} type 'market' or 'limit'
|
|
98558
|
+
* @param {string} side 'buy' or 'sell'
|
|
98559
|
+
* @param {float} amount how much you want to trade in units of the base currency, quote currency for 'market' 'buy' orders
|
|
98560
|
+
* @param {float} [price] the price to fulfill the order, in units of the quote currency, ignored in market orders
|
|
98561
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
98562
|
+
* @param {float} [params.stopPrice] price to trigger stop orders
|
|
98563
|
+
* @param {float} [params.triggerPrice] price to trigger stop orders
|
|
98564
|
+
* @param {float} [params.stopLossPrice] price to trigger stop-loss orders
|
|
98565
|
+
* @param {bool} [params.postOnly] true or false
|
|
98566
|
+
* @param {string} [params.tif] 'GTC', 'IOC', 'GTD' default is 'GTC' for limit orders and 'IOC' for market orders
|
|
98567
|
+
* @param {string} [params.expire_time] The expiration time required for orders with the time in force set to GTT. Must not go beyond 30 days of the current time. Uses ISO-8601 format (e.g., 2023-03-16T23:59:53Z)
|
|
98568
|
+
* @param {string} [params.stp_mode] Possible values: [NONE, AGGRESSING, BOTH] Specifies the behavior for self match handling. None disables the functionality, new cancels the newest order, and both cancels both orders.
|
|
98569
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
98570
|
+
*/
|
|
98571
|
+
await this.loadMarkets();
|
|
98572
|
+
const market = this.market(symbol);
|
|
98573
|
+
let typeId = type.toUpperCase();
|
|
98574
|
+
const stopPrice = this.safeNumberN(params, ['triggerPrice', 'stopPrice', 'stop_price']);
|
|
98575
|
+
const clientOrderIdprefix = this.safeString(this.options, 'brokerId', 'nfqkvdjp');
|
|
98576
|
+
let clientOrderId = clientOrderIdprefix + '-' + this.uuid();
|
|
98577
|
+
clientOrderId = clientOrderId.slice(0, 17);
|
|
98578
|
+
const request = {
|
|
98579
|
+
'client_order_id': clientOrderId,
|
|
98580
|
+
'side': side.toUpperCase(),
|
|
98581
|
+
'instrument': market['id'],
|
|
98582
|
+
'size': this.amountToPrecision(market['symbol'], amount),
|
|
98583
|
+
};
|
|
98584
|
+
if (stopPrice !== undefined) {
|
|
98585
|
+
if (type === 'limit') {
|
|
98586
|
+
typeId = 'STOP_LIMIT';
|
|
98587
|
+
}
|
|
98588
|
+
else {
|
|
98589
|
+
typeId = 'STOP';
|
|
98590
|
+
}
|
|
98591
|
+
request['stop_price'] = stopPrice;
|
|
98592
|
+
}
|
|
98593
|
+
request['type'] = typeId;
|
|
98594
|
+
if (type === 'limit') {
|
|
98595
|
+
if (price === undefined) {
|
|
98596
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder(this.id + 'createOrder() requires a price parameter for a limit order types');
|
|
98597
|
+
}
|
|
98598
|
+
request['price'] = price;
|
|
98599
|
+
}
|
|
98600
|
+
let portfolio = undefined;
|
|
98601
|
+
[portfolio, params] = await this.handlePortfolioAndParams('createOrder', params);
|
|
98602
|
+
if (portfolio !== undefined) {
|
|
98603
|
+
request['portfolio'] = portfolio;
|
|
98604
|
+
}
|
|
98605
|
+
const postOnly = this.safeBool2(params, 'postOnly', 'post_only');
|
|
98606
|
+
let tif = this.safeString2(params, 'tif', 'timeInForce');
|
|
98607
|
+
// market orders must be IOC
|
|
98608
|
+
if (typeId === 'MARKET') {
|
|
98609
|
+
if (tif !== undefined && tif !== 'IOC') {
|
|
98610
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder(this.id + 'createOrder() market orders must have tif set to "IOC"');
|
|
98611
|
+
}
|
|
98612
|
+
tif = 'IOC';
|
|
98613
|
+
}
|
|
98614
|
+
else {
|
|
98615
|
+
tif = (tif === undefined) ? 'GTC' : tif;
|
|
98616
|
+
}
|
|
98617
|
+
if (postOnly !== undefined) {
|
|
98618
|
+
request['post_only'] = postOnly;
|
|
98619
|
+
}
|
|
98620
|
+
request['tif'] = tif;
|
|
98621
|
+
params = this.omit(params, ['client_order_id', 'user', 'postOnly', 'timeInForce']);
|
|
98622
|
+
const response = await this.v1PrivatePostOrders(this.extend(request, params));
|
|
98623
|
+
//
|
|
98624
|
+
// {
|
|
98625
|
+
// "order_id":"1x96skvg-1-0",
|
|
98626
|
+
// "client_order_id":"ccxt",
|
|
98627
|
+
// "side":"BUY",
|
|
98628
|
+
// "instrument_id":"114jqr89-0-0",
|
|
98629
|
+
// "instrument_uuid":"b3469e0b-222c-4f8a-9f68-1f9e44d7e5e0",
|
|
98630
|
+
// "symbol":"BTC-PERP",
|
|
98631
|
+
// "portfolio_id":"1wp37qsc-1-0",
|
|
98632
|
+
// "portfolio_uuid":"018d7f6c-b92c-7361-8b7e-2932711e5a22",
|
|
98633
|
+
// "type":"LIMIT",
|
|
98634
|
+
// "price":"10000",
|
|
98635
|
+
// "size":"0.001",
|
|
98636
|
+
// "tif":"GTC",
|
|
98637
|
+
// "stp_mode":"BOTH",
|
|
98638
|
+
// "event_type":"NEW",
|
|
98639
|
+
// "order_status":"WORKING",
|
|
98640
|
+
// "leaves_qty":"0.001",
|
|
98641
|
+
// "exec_qty":"0",
|
|
98642
|
+
// "avg_price":"0",
|
|
98643
|
+
// "fee":"0"
|
|
98644
|
+
// }
|
|
98645
|
+
//
|
|
98646
|
+
return this.parseOrder(response, market);
|
|
98647
|
+
}
|
|
98648
|
+
parseOrder(order, market = undefined) {
|
|
98649
|
+
//
|
|
98650
|
+
// {
|
|
98651
|
+
// "order_id":"1x96skvg-1-0",
|
|
98652
|
+
// "client_order_id":"ccxt",
|
|
98653
|
+
// "side":"BUY",
|
|
98654
|
+
// "instrument_id":"114jqr89-0-0",
|
|
98655
|
+
// "instrument_uuid":"b3469e0b-222c-4f8a-9f68-1f9e44d7e5e0",
|
|
98656
|
+
// "symbol":"BTC-PERP",
|
|
98657
|
+
// "portfolio_id":"1wp37qsc-1-0",
|
|
98658
|
+
// "portfolio_uuid":"018d7f6c-b92c-7361-8b7e-2932711e5a22",
|
|
98659
|
+
// "type":"LIMIT",
|
|
98660
|
+
// "price":"10000",
|
|
98661
|
+
// "size":"0.001",
|
|
98662
|
+
// "tif":"GTC",
|
|
98663
|
+
// "stp_mode":"BOTH",
|
|
98664
|
+
// "event_type":"NEW",
|
|
98665
|
+
// "order_status":"WORKING",
|
|
98666
|
+
// "leaves_qty":"0.001",
|
|
98667
|
+
// "exec_qty":"0",
|
|
98668
|
+
// "avg_price":"0",
|
|
98669
|
+
// "fee":"0"
|
|
98670
|
+
// }
|
|
98671
|
+
//
|
|
98672
|
+
const marketId = this.safeString(order, 'symbol');
|
|
98673
|
+
const feeCost = this.safeNumber(order, 'fee');
|
|
98674
|
+
let fee = undefined;
|
|
98675
|
+
if (feeCost !== undefined) {
|
|
98676
|
+
fee = {
|
|
98677
|
+
'cost': feeCost,
|
|
98678
|
+
};
|
|
98679
|
+
}
|
|
98680
|
+
const datetime = this.safeString2(order, 'submit_time', 'event_time');
|
|
98681
|
+
return this.safeOrder({
|
|
98682
|
+
'info': order,
|
|
98683
|
+
'id': this.safeString(order, 'order_id'),
|
|
98684
|
+
'clientOrderId': this.safeString(order, 'client_order_id'),
|
|
98685
|
+
'timestamp': this.parse8601(datetime),
|
|
98686
|
+
'datetime': datetime,
|
|
98687
|
+
'lastTradeTimestamp': undefined,
|
|
98688
|
+
'symbol': this.safeSymbol(marketId, market),
|
|
98689
|
+
'type': this.parseOrderType(this.safeString(order, 'type')),
|
|
98690
|
+
'timeInForce': this.safeString(order, 'tif'),
|
|
98691
|
+
'postOnly': undefined,
|
|
98692
|
+
'side': this.safeStringLower(order, 'side'),
|
|
98693
|
+
'price': this.safeString(order, 'price'),
|
|
98694
|
+
'stopPrice': this.safeString(order, 'stop_price'),
|
|
98695
|
+
'triggerPrice': this.safeString(order, 'stop_price'),
|
|
98696
|
+
'amount': this.safeString(order, 'size'),
|
|
98697
|
+
'filled': this.safeString(order, 'exec_qty'),
|
|
98698
|
+
'remaining': this.safeString(order, 'leaves_qty'),
|
|
98699
|
+
'cost': undefined,
|
|
98700
|
+
'average': this.safeString(order, 'avg_price'),
|
|
98701
|
+
'status': this.parseOrderStatus(this.safeString(order, 'order_status')),
|
|
98702
|
+
'fee': fee,
|
|
98703
|
+
'trades': undefined,
|
|
98704
|
+
}, market);
|
|
98705
|
+
}
|
|
98706
|
+
parseOrderStatus(status) {
|
|
98707
|
+
const statuses = {
|
|
98708
|
+
'NEW': 'open',
|
|
98709
|
+
'PARTIAL_FILLED': 'open',
|
|
98710
|
+
'FILLED': 'closed',
|
|
98711
|
+
'CANCELED': 'canceled',
|
|
98712
|
+
'REPLACED': 'canceled',
|
|
98713
|
+
'PENDING_CANCEL': 'open',
|
|
98714
|
+
'REJECTED': 'rejected',
|
|
98715
|
+
'PENDING_NEW': 'open',
|
|
98716
|
+
'EXPIRED': 'expired',
|
|
98717
|
+
'PENDING_REPLACE': 'open',
|
|
98718
|
+
};
|
|
98719
|
+
return this.safeString(statuses, status, status);
|
|
98720
|
+
}
|
|
98721
|
+
parseOrderType(type) {
|
|
98722
|
+
if (type === 'UNKNOWN_ORDER_TYPE') {
|
|
98723
|
+
return undefined;
|
|
98724
|
+
}
|
|
98725
|
+
const types = {
|
|
98726
|
+
'MARKET': 'market',
|
|
98727
|
+
'LIMIT': 'limit',
|
|
98728
|
+
'STOP': 'limit',
|
|
98729
|
+
'STOP_LIMIT': 'limit',
|
|
98730
|
+
};
|
|
98731
|
+
return this.safeString(types, type, type);
|
|
98732
|
+
}
|
|
98733
|
+
async cancelOrder(id, symbol = undefined, params = {}) {
|
|
98734
|
+
/**
|
|
98735
|
+
* @method
|
|
98736
|
+
* @name coinbaseinternational#cancelOrder
|
|
98737
|
+
* @description cancels an open order
|
|
98738
|
+
* @see https://docs.cloud.coinbase.com/intx/reference/cancelorder
|
|
98739
|
+
* @param {string} id order id
|
|
98740
|
+
* @param {string} symbol not used by coinbaseinternational cancelOrder()
|
|
98741
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
98742
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
98743
|
+
*/
|
|
98744
|
+
await this.loadMarkets();
|
|
98745
|
+
let portfolio = undefined;
|
|
98746
|
+
[portfolio, params] = await this.handlePortfolioAndParams('cancelOrder', params);
|
|
98747
|
+
const request = {
|
|
98748
|
+
'portfolio': portfolio,
|
|
98749
|
+
'id': id,
|
|
98750
|
+
};
|
|
98751
|
+
let market = undefined;
|
|
98752
|
+
if (symbol !== undefined) {
|
|
98753
|
+
market = this.market(symbol);
|
|
98754
|
+
}
|
|
98755
|
+
const orders = await this.v1PrivateDeleteOrdersId(this.extend(request, params));
|
|
98756
|
+
//
|
|
98757
|
+
// {
|
|
98758
|
+
// "order_id":"1x96skvg-1-0",
|
|
98759
|
+
// "client_order_id":"ccxt",
|
|
98760
|
+
// "side":"BUY",
|
|
98761
|
+
// "instrument_id":"114jqr89-0-0",
|
|
98762
|
+
// "instrument_uuid":"b3469e0b-222c-4f8a-9f68-1f9e44d7e5e0",
|
|
98763
|
+
// "symbol":"BTC-PERP",
|
|
98764
|
+
// "portfolio_id":"1wp37qsc-1-0",
|
|
98765
|
+
// "portfolio_uuid":"018d7f6c-b92c-7361-8b7e-2932711e5a22",
|
|
98766
|
+
// "type":"LIMIT",
|
|
98767
|
+
// "price":"10000",
|
|
98768
|
+
// "size":"0.001",
|
|
98769
|
+
// "tif":"GTC",
|
|
98770
|
+
// "stp_mode":"BOTH",
|
|
98771
|
+
// "event_type":"CANCELED",
|
|
98772
|
+
// "order_status":"DONE",
|
|
98773
|
+
// "leaves_qty":"0.001",
|
|
98774
|
+
// "exec_qty":"0",
|
|
98775
|
+
// "avg_price":"0",
|
|
98776
|
+
// "fee":"0"
|
|
98777
|
+
// }
|
|
98778
|
+
//
|
|
98779
|
+
return this.parseOrder(orders, market);
|
|
98780
|
+
}
|
|
98781
|
+
async cancelAllOrders(symbol = undefined, params = {}) {
|
|
98782
|
+
/**
|
|
98783
|
+
* @method
|
|
98784
|
+
* @name coinbaseinternational#cancelAllOrders
|
|
98785
|
+
* @description cancel all open orders
|
|
98786
|
+
* @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
98787
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
98788
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
98789
|
+
*/
|
|
98790
|
+
await this.loadMarkets();
|
|
98791
|
+
let portfolio = undefined;
|
|
98792
|
+
[portfolio, params] = await this.handlePortfolioAndParams('cancelAllOrders', params);
|
|
98793
|
+
const request = {
|
|
98794
|
+
'portfolio': portfolio,
|
|
98795
|
+
};
|
|
98796
|
+
let market = undefined;
|
|
98797
|
+
if (symbol) {
|
|
98798
|
+
market = this.market(symbol);
|
|
98799
|
+
request['instrument'] = market['id'];
|
|
98800
|
+
}
|
|
98801
|
+
const orders = await this.v1PrivateDeleteOrders(this.extend(request, params));
|
|
98802
|
+
return this.parseOrders(orders, market);
|
|
98803
|
+
}
|
|
98804
|
+
async editOrder(id, symbol, type, side, amount = undefined, price = undefined, params = {}) {
|
|
98805
|
+
/**
|
|
98806
|
+
* @method
|
|
98807
|
+
* @name coinbaseinternational#editOrder
|
|
98808
|
+
* @description edit a trade order
|
|
98809
|
+
* @see https://docs.cloud.coinbase.com/intx/reference/modifyorder
|
|
98810
|
+
* @param {string} id cancel order id
|
|
98811
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
98812
|
+
* @param {string} type 'market' or 'limit'
|
|
98813
|
+
* @param {string} side 'buy' or 'sell'
|
|
98814
|
+
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
98815
|
+
* @param {float} [price] the price at which the order is to be fullfilled, in units of the base currency, ignored in market orders
|
|
98816
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
98817
|
+
* @param {string} params.clientOrderId client order id
|
|
98818
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
98819
|
+
*/
|
|
98820
|
+
await this.loadMarkets();
|
|
98821
|
+
const market = this.market(symbol);
|
|
98822
|
+
const request = {
|
|
98823
|
+
'id': id,
|
|
98824
|
+
};
|
|
98825
|
+
let portfolio = undefined;
|
|
98826
|
+
[portfolio, params] = await this.handlePortfolioAndParams('editOrder', params);
|
|
98827
|
+
if (portfolio !== undefined) {
|
|
98828
|
+
request['portfolio'] = portfolio;
|
|
98829
|
+
}
|
|
98830
|
+
if (amount !== undefined) {
|
|
98831
|
+
request['size'] = this.amountToPrecision(symbol, amount);
|
|
98832
|
+
}
|
|
98833
|
+
if (price !== undefined) {
|
|
98834
|
+
request['price'] = this.priceToPrecision(symbol, price);
|
|
98835
|
+
}
|
|
98836
|
+
const stopPrice = this.safeNumberN(params, ['stopPrice', 'stop_price', 'triggerPrice']);
|
|
98837
|
+
if (stopPrice !== undefined) {
|
|
98838
|
+
request['stop_price'] = stopPrice;
|
|
98839
|
+
}
|
|
98840
|
+
const clientOrderId = this.safeString2(params, 'client_order_id', 'clientOrderId');
|
|
98841
|
+
if (clientOrderId === undefined) {
|
|
98842
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest(this.id + ' editOrder() requires a clientOrderId parameter');
|
|
98843
|
+
}
|
|
98844
|
+
request['client_order_id'] = clientOrderId;
|
|
98845
|
+
const order = await this.v1PrivatePutOrdersId(this.extend(request, params));
|
|
98846
|
+
return this.parseOrder(order, market);
|
|
98847
|
+
}
|
|
98848
|
+
async fetchOrder(id, symbol = undefined, params = {}) {
|
|
98849
|
+
/**
|
|
98850
|
+
* @method
|
|
98851
|
+
* @name coinbaseinternational#fetchOrder
|
|
98852
|
+
* @description fetches information on an order made by the user
|
|
98853
|
+
* @see https://docs.cloud.coinbase.com/intx/reference/modifyorder
|
|
98854
|
+
* @param {string} id the order id
|
|
98855
|
+
* @param {string} symbol unified market symbol that the order was made in
|
|
98856
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
98857
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
98858
|
+
*/
|
|
98859
|
+
await this.loadMarkets();
|
|
98860
|
+
let market = undefined;
|
|
98861
|
+
if (symbol !== undefined) {
|
|
98862
|
+
market = this.market(symbol);
|
|
98863
|
+
}
|
|
98864
|
+
let portfolio = undefined;
|
|
98865
|
+
[portfolio, params] = await this.handlePortfolioAndParams('fetchOrder', params);
|
|
98866
|
+
const request = {
|
|
98867
|
+
'id': id,
|
|
98868
|
+
'portfolio': portfolio,
|
|
98869
|
+
};
|
|
98870
|
+
const order = await this.v1PrivateGetOrdersId(this.extend(request, params));
|
|
98871
|
+
//
|
|
98872
|
+
// {
|
|
98873
|
+
// "order_id":"1x96skvg-1-0",
|
|
98874
|
+
// "client_order_id":"ccxt",
|
|
98875
|
+
// "side":"BUY",
|
|
98876
|
+
// "instrument_id":"114jqr89-0-0",
|
|
98877
|
+
// "instrument_uuid":"b3469e0b-222c-4f8a-9f68-1f9e44d7e5e0",
|
|
98878
|
+
// "symbol":"BTC-PERP",
|
|
98879
|
+
// "portfolio_id":"1wp37qsc-1-0",
|
|
98880
|
+
// "portfolio_uuid":"018d7f6c-b92c-7361-8b7e-2932711e5a22",
|
|
98881
|
+
// "type":"LIMIT",
|
|
98882
|
+
// "price":"10000",
|
|
98883
|
+
// "size":"0.001",
|
|
98884
|
+
// "tif":"GTC",
|
|
98885
|
+
// "stp_mode":"BOTH",
|
|
98886
|
+
// "event_type":"NEW",
|
|
98887
|
+
// "event_time":"2024-02-14T03:25:14Z",
|
|
98888
|
+
// "submit_time":"2024-02-14T03:25:13.999Z",
|
|
98889
|
+
// "order_status":"WORKING",
|
|
98890
|
+
// "leaves_qty":"0.001",
|
|
98891
|
+
// "exec_qty":"0",
|
|
98892
|
+
// "avg_price":"0",
|
|
98893
|
+
// "fee":"0"
|
|
98894
|
+
// }
|
|
98895
|
+
//
|
|
98896
|
+
return this.parseOrder(order, market);
|
|
98897
|
+
}
|
|
98898
|
+
async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
98899
|
+
/**
|
|
98900
|
+
* @method
|
|
98901
|
+
* @name coinbaseinternational#fetchOpenOrders
|
|
98902
|
+
* @description fetches information on all currently open orders
|
|
98903
|
+
* @see https://docs.cloud.coinbase.com/intx/reference/getorders
|
|
98904
|
+
* @param {string} symbol unified market symbol of the orders
|
|
98905
|
+
* @param {int} [since] timestamp in ms of the earliest order, default is undefined
|
|
98906
|
+
* @param {int} [limit] the maximum number of open order structures to retrieve
|
|
98907
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
98908
|
+
* @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)
|
|
98909
|
+
* @param {int} [params.offset] offset
|
|
98910
|
+
* @param {string} [params.event_type] The most recent type of event that happened to the order. Allowed values: NEW, TRADE, REPLACED
|
|
98911
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
98912
|
+
*/
|
|
98913
|
+
await this.loadMarkets();
|
|
98914
|
+
let portfolio = undefined;
|
|
98915
|
+
[portfolio, params] = await this.handlePortfolioAndParams('fetchOpenOrders', params);
|
|
98916
|
+
let paginate = false;
|
|
98917
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchOpenOrders', 'paginate');
|
|
98918
|
+
let maxEntriesPerRequest = undefined;
|
|
98919
|
+
[maxEntriesPerRequest, params] = this.handleOptionAndParams(params, 'fetchOpenOrders', 'maxEntriesPerRequest', 100);
|
|
98920
|
+
const pageKey = 'ccxtPageKey';
|
|
98921
|
+
if (paginate) {
|
|
98922
|
+
return await this.fetchPaginatedCallIncremental('fetchOpenOrders', symbol, since, limit, params, pageKey, maxEntriesPerRequest);
|
|
98923
|
+
}
|
|
98924
|
+
const page = this.safeInteger(params, pageKey, 1) - 1;
|
|
98925
|
+
const request = {
|
|
98926
|
+
'portfolio': portfolio,
|
|
98927
|
+
'result_offset': this.safeInteger2(params, 'offset', 'result_offset', page * maxEntriesPerRequest),
|
|
98928
|
+
};
|
|
98929
|
+
let market = undefined;
|
|
98930
|
+
if (symbol) {
|
|
98931
|
+
market = this.market(symbol);
|
|
98932
|
+
request['instrument'] = symbol;
|
|
98933
|
+
}
|
|
98934
|
+
if (limit !== undefined) {
|
|
98935
|
+
if (limit > 100) {
|
|
98936
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest(this.id + ' fetchOpenOrders() maximum limit is 100');
|
|
98937
|
+
}
|
|
98938
|
+
request['result_limit'] = limit;
|
|
98939
|
+
}
|
|
98940
|
+
if (since !== undefined) {
|
|
98941
|
+
request['ref_datetime'] = this.iso8601(since);
|
|
98942
|
+
}
|
|
98943
|
+
const response = await this.v1PrivateGetOrders(this.extend(request, params));
|
|
98944
|
+
//
|
|
98945
|
+
// {
|
|
98946
|
+
// "pagination":{
|
|
98947
|
+
// "result_limit":25,
|
|
98948
|
+
// "result_offset":0
|
|
98949
|
+
// },
|
|
98950
|
+
// "results":[
|
|
98951
|
+
// {
|
|
98952
|
+
// "order_id":"1y4cm6b4-1-0",
|
|
98953
|
+
// "client_order_id":"ccxtd0dd4b5d-8e5f-",
|
|
98954
|
+
// "side":"SELL",
|
|
98955
|
+
// "instrument_id":"114jqr89-0-0",
|
|
98956
|
+
// "instrument_uuid":"b3469e0b-222c-4f8a-9f68-1f9e44d7e5e0",
|
|
98957
|
+
// "symbol":"BTC-PERP",
|
|
98958
|
+
// "portfolio_id":"1wp37qsc-1-0",
|
|
98959
|
+
// "portfolio_uuid":"018d7f6c-b92c-7361-8b7e-2932711e5a22",
|
|
98960
|
+
// "type":"LIMIT",
|
|
98961
|
+
// "price":"54000",
|
|
98962
|
+
// "size":"0.01",
|
|
98963
|
+
// "tif":"GTC",
|
|
98964
|
+
// "stp_mode":"BOTH",
|
|
98965
|
+
// "event_type":"NEW",
|
|
98966
|
+
// "event_time":"2024-02-24T16:46:37.413Z",
|
|
98967
|
+
// "submit_time":"2024-02-24T16:46:37.412Z",
|
|
98968
|
+
// "order_status":"WORKING",
|
|
98969
|
+
// "leaves_qty":"0.01",
|
|
98970
|
+
// "exec_qty":"0",
|
|
98971
|
+
// "avg_price":"0",
|
|
98972
|
+
// "fee":"0"
|
|
98973
|
+
// },
|
|
98974
|
+
// ...
|
|
98975
|
+
// ]
|
|
98976
|
+
// }
|
|
98977
|
+
//
|
|
98978
|
+
const rawOrders = this.safeList(response, 'results', []);
|
|
98979
|
+
return this.parseOrders(rawOrders, market, since, limit);
|
|
98980
|
+
}
|
|
98981
|
+
async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
98982
|
+
/**
|
|
98983
|
+
* @method
|
|
98984
|
+
* @name coinbaseinternational#fetchMyTrades
|
|
98985
|
+
* @description fetch all trades made by the user
|
|
98986
|
+
* @see https://docs.cloud.coinbase.com/intx/reference/getmultiportfoliofills
|
|
98987
|
+
* @param {string} symbol unified market symbol of the trades
|
|
98988
|
+
* @param {int} [since] timestamp in ms of the earliest order, default is undefined
|
|
98989
|
+
* @param {int} [limit] the maximum number of trade structures to fetch
|
|
98990
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
98991
|
+
* @param {int} [params.until] the latest time in ms to fetch trades for
|
|
98992
|
+
* @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)
|
|
98993
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
98994
|
+
*/
|
|
98995
|
+
await this.loadMarkets();
|
|
98996
|
+
let paginate = false;
|
|
98997
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchMyTrades', 'paginate');
|
|
98998
|
+
const pageKey = 'ccxtPageKey';
|
|
98999
|
+
let maxEntriesPerRequest = undefined;
|
|
99000
|
+
[maxEntriesPerRequest, params] = this.handleOptionAndParams(params, 'fetchMyTrades', 'maxEntriesPerRequest', 100);
|
|
99001
|
+
if (paginate) {
|
|
99002
|
+
return await this.fetchPaginatedCallIncremental('fetchMyTrades', symbol, since, limit, params, pageKey, maxEntriesPerRequest);
|
|
99003
|
+
}
|
|
99004
|
+
let market = undefined;
|
|
99005
|
+
if (symbol !== undefined) {
|
|
99006
|
+
market = this.market(symbol);
|
|
99007
|
+
}
|
|
99008
|
+
const page = this.safeInteger(params, pageKey, 1) - 1;
|
|
99009
|
+
const request = {
|
|
99010
|
+
'result_offset': this.safeInteger2(params, 'offset', 'result_offset', page * maxEntriesPerRequest),
|
|
99011
|
+
};
|
|
99012
|
+
if (limit !== undefined) {
|
|
99013
|
+
if (limit > 100) {
|
|
99014
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest(this.id + ' fetchMyTrades() maximum limit is 100. Consider setting paginate to true to fetch more trades.');
|
|
99015
|
+
}
|
|
99016
|
+
request['result_limit'] = limit;
|
|
99017
|
+
}
|
|
99018
|
+
if (since !== undefined) {
|
|
99019
|
+
request['time_from'] = this.iso8601(since);
|
|
99020
|
+
}
|
|
99021
|
+
const until = this.safeStringN(params, ['until', 'till']);
|
|
99022
|
+
if (until !== undefined) {
|
|
99023
|
+
params = this.omit(params, ['until', 'till']);
|
|
99024
|
+
request['ref_datetime'] = this.iso8601(until);
|
|
99025
|
+
}
|
|
99026
|
+
const response = await this.v1PrivateGetPortfoliosFills(this.extend(request, params));
|
|
99027
|
+
//
|
|
99028
|
+
// {
|
|
99029
|
+
// "pagination":{
|
|
99030
|
+
// "result_limit":25,
|
|
99031
|
+
// "result_offset":0
|
|
99032
|
+
// },
|
|
99033
|
+
// "results":[
|
|
99034
|
+
// {
|
|
99035
|
+
// "portfolio_id":"1wp37qsc-1-0",
|
|
99036
|
+
// "portfolio_uuid":"018d7f6c-b92c-7361-8b7e-2932711e5a22",
|
|
99037
|
+
// "portfolio_name":"CCXT Portfolio 020624-17:16",
|
|
99038
|
+
// "fill_id":"1xbfy19y-1-184",
|
|
99039
|
+
// "exec_id":"280841526207070392",
|
|
99040
|
+
// "order_id":"1xbfv8yw-1-0",
|
|
99041
|
+
// "instrument_id":"114jqr89-0-0",
|
|
99042
|
+
// "instrument_uuid":"b3469e0b-222c-4f8a-9f68-1f9e44d7e5e0",
|
|
99043
|
+
// "symbol":"BTC-PERP",
|
|
99044
|
+
// "match_id":"280841526207053840",
|
|
99045
|
+
// "fill_price":"52500",
|
|
99046
|
+
// "fill_qty":"0.01",
|
|
99047
|
+
// "client_id":"1x59ctku-1-1",
|
|
99048
|
+
// "client_order_id":"ccxt3e4e2a5f-4a89-",
|
|
99049
|
+
// "order_qty":"0.01",
|
|
99050
|
+
// "limit_price":"52500",
|
|
99051
|
+
// "total_filled":"0.01",
|
|
99052
|
+
// "filled_vwap":"52500",
|
|
99053
|
+
// "expire_time":"",
|
|
99054
|
+
// "stop_price":"",
|
|
99055
|
+
// "side":"BUY",
|
|
99056
|
+
// "tif":"GTC",
|
|
99057
|
+
// "stp_mode":"BOTH",
|
|
99058
|
+
// "flags":"",
|
|
99059
|
+
// "fee":"0.105",
|
|
99060
|
+
// "fee_asset":"USDC",
|
|
99061
|
+
// "order_status":"DONE",
|
|
99062
|
+
// "event_time":"2024-02-15T00:43:57.631Z"
|
|
99063
|
+
// },
|
|
99064
|
+
// ]
|
|
99065
|
+
// }
|
|
99066
|
+
//
|
|
99067
|
+
const trades = this.safeList(response, 'results', []);
|
|
99068
|
+
return this.parseTrades(trades, market, since, limit);
|
|
99069
|
+
}
|
|
99070
|
+
async withdraw(code, amount, address, tag = undefined, params = {}) {
|
|
99071
|
+
/**
|
|
99072
|
+
* @method
|
|
99073
|
+
* @name coinbaseinternational#withdraw
|
|
99074
|
+
* @description make a withdrawal
|
|
99075
|
+
* @see https://docs.cloud.coinbase.com/intx/reference/withdraw
|
|
99076
|
+
* @see https://docs.cloud.coinbase.com/intx/reference/counterpartywithdraw
|
|
99077
|
+
* @param {string} code unified currency code
|
|
99078
|
+
* @param {float} amount the amount to withdraw
|
|
99079
|
+
* @param {string} address the address to withdraw to
|
|
99080
|
+
* @param {string} [tag] an optional tag for the withdrawal
|
|
99081
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
99082
|
+
* @param {boolean} [params.add_network_fee_to_total] if true, deducts network fee from the portfolio, otherwise deduct fee from the withdrawal
|
|
99083
|
+
* @param {string} [params.network_arn_id] Identifies the blockchain network (e.g., networks/ethereum-mainnet/assets/313ef8a9-ae5a-5f2f-8a56-572c0e2a4d5a)
|
|
99084
|
+
* @param {string} [params.nonce] a unique integer representing the withdrawal request
|
|
99085
|
+
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
99086
|
+
*/
|
|
99087
|
+
[tag, params] = this.handleWithdrawTagAndParams(tag, params);
|
|
99088
|
+
this.checkAddress(address);
|
|
99089
|
+
await this.loadMarkets();
|
|
99090
|
+
const currency = this.currency(code);
|
|
99091
|
+
let portfolio = undefined;
|
|
99092
|
+
[portfolio, params] = await this.handlePortfolioAndParams('withdraw', params);
|
|
99093
|
+
let method = undefined;
|
|
99094
|
+
[method, params] = this.handleOptionAndParams(params, 'withdraw', 'method', 'v1PrivatePostTransfersWithdraw');
|
|
99095
|
+
let networkId = undefined;
|
|
99096
|
+
[networkId, params] = await this.handleNetworkIdAndParams(code, 'withdraw', params);
|
|
99097
|
+
const request = {
|
|
99098
|
+
'portfolio': portfolio,
|
|
99099
|
+
'type': 'send',
|
|
99100
|
+
'asset': currency['id'],
|
|
99101
|
+
'address': address,
|
|
99102
|
+
'amount': amount,
|
|
99103
|
+
'currency': currency['id'],
|
|
99104
|
+
'network_arn_id': networkId,
|
|
99105
|
+
'nonce': this.nonce(),
|
|
99106
|
+
};
|
|
99107
|
+
const response = await this[method](this.extend(request, params));
|
|
99108
|
+
//
|
|
99109
|
+
// {
|
|
99110
|
+
// "idem":"8e471d77-4208-45a8-9e5b-f3bd8a2c1fc3"
|
|
99111
|
+
// }
|
|
99112
|
+
//
|
|
99113
|
+
return this.parseTransaction(response, currency);
|
|
99114
|
+
}
|
|
99115
|
+
safeNetwork(network) {
|
|
99116
|
+
let withdrawEnabled = this.safeBool(network, 'withdraw');
|
|
99117
|
+
let depositEnabled = this.safeBool(network, 'deposit');
|
|
99118
|
+
const limits = this.safeDict(network, 'limits');
|
|
99119
|
+
const withdraw = this.safeDict(limits, 'withdraw');
|
|
99120
|
+
const withdrawMax = this.safeNumber(withdraw, 'max');
|
|
99121
|
+
const deposit = this.safeDict(limits, 'deposit');
|
|
99122
|
+
const depositMax = this.safeNumber(deposit, 'max');
|
|
99123
|
+
if (withdrawEnabled === undefined && withdrawMax !== undefined) {
|
|
99124
|
+
withdrawEnabled = (withdrawMax > 0);
|
|
99125
|
+
}
|
|
99126
|
+
if (depositEnabled === undefined && depositMax !== undefined) {
|
|
99127
|
+
depositEnabled = (depositMax > 0);
|
|
99128
|
+
}
|
|
99129
|
+
const networkId = this.safeString(network, 'id');
|
|
99130
|
+
const isEnabled = (withdrawEnabled && depositEnabled);
|
|
99131
|
+
return {
|
|
99132
|
+
'info': network['info'],
|
|
99133
|
+
'id': networkId,
|
|
99134
|
+
'name': this.safeString(network, 'name'),
|
|
99135
|
+
'network': this.safeString(network, 'network'),
|
|
99136
|
+
'active': this.safeBool(network, 'active', isEnabled),
|
|
99137
|
+
'deposit': depositEnabled,
|
|
99138
|
+
'withdraw': withdrawEnabled,
|
|
99139
|
+
'fee': this.safeNumber(network, 'fee'),
|
|
99140
|
+
'precision': this.safeNumber(network, 'precision'),
|
|
99141
|
+
'limits': {
|
|
99142
|
+
'withdraw': {
|
|
99143
|
+
'min': this.safeNumber(withdraw, 'min'),
|
|
99144
|
+
'max': withdrawMax,
|
|
99145
|
+
},
|
|
99146
|
+
'deposit': {
|
|
99147
|
+
'min': this.safeNumber(deposit, 'min'),
|
|
99148
|
+
'max': depositMax,
|
|
99149
|
+
},
|
|
99150
|
+
},
|
|
99151
|
+
};
|
|
99152
|
+
}
|
|
99153
|
+
sign(path, api = [], method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
99154
|
+
const version = api[0];
|
|
99155
|
+
const signed = api[1] === 'private';
|
|
99156
|
+
let fullPath = '/' + version + '/' + this.implodeParams(path, params);
|
|
99157
|
+
const query = this.omit(params, this.extractParams(path));
|
|
99158
|
+
const savedPath = '/api' + fullPath;
|
|
99159
|
+
if (method === 'GET' || method === 'DELETE') {
|
|
99160
|
+
if (Object.keys(query).length) {
|
|
99161
|
+
fullPath += '?' + this.urlencodeWithArrayRepeat(query);
|
|
99162
|
+
}
|
|
99163
|
+
}
|
|
99164
|
+
const url = this.urls['api']['rest'] + fullPath;
|
|
99165
|
+
if (signed) {
|
|
99166
|
+
this.checkRequiredCredentials();
|
|
99167
|
+
const nonce = this.nonce().toString();
|
|
99168
|
+
let payload = '';
|
|
99169
|
+
if (method !== 'GET') {
|
|
99170
|
+
if (Object.keys(query).length) {
|
|
99171
|
+
body = this.json(query);
|
|
99172
|
+
payload = body;
|
|
99173
|
+
}
|
|
99174
|
+
}
|
|
99175
|
+
const auth = nonce + method + savedPath + payload;
|
|
99176
|
+
const signature = this.hmac(this.encode(auth), this.base64ToBinary(this.secret), _static_dependencies_noble_hashes_sha256_js__WEBPACK_IMPORTED_MODULE_4__/* .sha256 */ .J, 'base64');
|
|
99177
|
+
headers = {
|
|
99178
|
+
'CB-ACCESS-TIMESTAMP': nonce,
|
|
99179
|
+
'CB-ACCESS-SIGN': signature,
|
|
99180
|
+
'CB-ACCESS-PASSPHRASE': this.password,
|
|
99181
|
+
'CB-ACCESS-KEY': this.apiKey,
|
|
99182
|
+
};
|
|
99183
|
+
}
|
|
99184
|
+
return { 'url': url, 'method': method, 'body': body, 'headers': headers };
|
|
99185
|
+
}
|
|
99186
|
+
handleErrors(code, reason, url, method, headers, body, response, requestHeaders, requestBody) {
|
|
99187
|
+
//
|
|
99188
|
+
// {
|
|
99189
|
+
// "title":"io.javalin.http.BadRequestResponse: Order rejected (DUPLICATE_CLIENT_ORDER_ID - duplicate client order id detected)",
|
|
99190
|
+
// "status":400
|
|
99191
|
+
// }
|
|
99192
|
+
//
|
|
99193
|
+
if (response === undefined) {
|
|
99194
|
+
return undefined; // fallback to default error handler
|
|
99195
|
+
}
|
|
99196
|
+
const feedback = this.id + ' ' + body;
|
|
99197
|
+
const errMsg = this.safeString(response, 'title');
|
|
99198
|
+
if (errMsg !== undefined) {
|
|
99199
|
+
this.throwExactlyMatchedException(this.exceptions['exact'], errMsg, feedback);
|
|
99200
|
+
this.throwBroadlyMatchedException(this.exceptions['broad'], errMsg, feedback);
|
|
99201
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError(feedback);
|
|
99202
|
+
}
|
|
99203
|
+
return undefined;
|
|
99204
|
+
}
|
|
99205
|
+
}
|
|
99206
|
+
|
|
99207
|
+
|
|
97067
99208
|
/***/ }),
|
|
97068
99209
|
|
|
97069
99210
|
/***/ 8856:
|
|
@@ -136410,7 +138551,7 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
136410
138551
|
let request = {};
|
|
136411
138552
|
[request, params] = this.prepareRequest(market, undefined, params);
|
|
136412
138553
|
request['interval'] = this.safeString(this.timeframes, timeframe, timeframe);
|
|
136413
|
-
let maxLimit = 1000;
|
|
138554
|
+
let maxLimit = market['contract'] ? 1999 : 1000;
|
|
136414
138555
|
limit = (limit === undefined) ? maxLimit : Math.min(limit, maxLimit);
|
|
136415
138556
|
let until = this.safeInteger(params, 'until');
|
|
136416
138557
|
if (until !== undefined) {
|
|
@@ -149242,6 +151383,9 @@ class htx extends _abstract_htx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
149242
151383
|
},
|
|
149243
151384
|
},
|
|
149244
151385
|
},
|
|
151386
|
+
'fetchOHLCV': {
|
|
151387
|
+
'useHistoricalEndpointForSpot': true,
|
|
151388
|
+
},
|
|
149245
151389
|
'withdraw': {
|
|
149246
151390
|
'includeFee': false,
|
|
149247
151391
|
},
|
|
@@ -151249,6 +153393,7 @@ class htx extends _abstract_htx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
151249
153393
|
* @param {int} [limit] the maximum amount of candles to fetch
|
|
151250
153394
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
151251
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
|
|
151252
153397
|
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
151253
153398
|
*/
|
|
151254
153399
|
await this.loadMarkets();
|
|
@@ -151355,19 +153500,22 @@ class htx extends _abstract_htx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
151355
153500
|
}
|
|
151356
153501
|
}
|
|
151357
153502
|
else {
|
|
151358
|
-
if (since !== undefined) {
|
|
151359
|
-
request['from'] = this.parseToInt(since / 1000);
|
|
151360
|
-
}
|
|
151361
|
-
if (limit !== undefined) {
|
|
151362
|
-
request['size'] = limit; // max 2000
|
|
151363
|
-
}
|
|
151364
153503
|
request['symbol'] = market['id'];
|
|
151365
|
-
|
|
151366
|
-
|
|
151367
|
-
|
|
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
|
+
}
|
|
151368
153511
|
response = await this.spotPublicGetMarketHistoryKline(this.extend(request, params));
|
|
151369
153512
|
}
|
|
151370
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
|
+
}
|
|
151371
153519
|
response = await this.spotPublicGetMarketHistoryCandles(this.extend(request, params));
|
|
151372
153520
|
}
|
|
151373
153521
|
}
|
|
@@ -159806,8 +161954,8 @@ class hyperliquid extends _abstract_hyperliquid_js__WEBPACK_IMPORTED_MODULE_0__/
|
|
|
159806
161954
|
'strike': undefined,
|
|
159807
161955
|
'optionType': undefined,
|
|
159808
161956
|
'precision': {
|
|
159809
|
-
'amount':
|
|
159810
|
-
'price':
|
|
161957
|
+
'amount': this.parseNumber(this.parsePrecision(this.safeString(market, 'szDecimals'))),
|
|
161958
|
+
'price': 5, // significant digits
|
|
159811
161959
|
},
|
|
159812
161960
|
'limits': {
|
|
159813
161961
|
'leverage': {
|
|
@@ -160066,6 +162214,12 @@ class hyperliquid extends _abstract_hyperliquid_js__WEBPACK_IMPORTED_MODULE_0__/
|
|
|
160066
162214
|
amountToPrecision(symbol, amount) {
|
|
160067
162215
|
return this.decimalToPrecision(amount, _base_functions_number_js__WEBPACK_IMPORTED_MODULE_2__/* .ROUND */ .oU, this.markets[symbol]['precision']['amount'], this.precisionMode);
|
|
160068
162216
|
}
|
|
162217
|
+
priceToPrecision(symbol, price) {
|
|
162218
|
+
const market = this.market(symbol);
|
|
162219
|
+
const result = this.decimalToPrecision(price, _base_functions_number_js__WEBPACK_IMPORTED_MODULE_2__/* .ROUND */ .oU, market['precision']['price'], _base_functions_number_js__WEBPACK_IMPORTED_MODULE_2__/* .SIGNIFICANT_DIGITS */ .tV, this.paddingMode);
|
|
162220
|
+
const decimalParsedResult = this.decimalToPrecision(result, _base_functions_number_js__WEBPACK_IMPORTED_MODULE_2__/* .ROUND */ .oU, 6, _base_functions_number_js__WEBPACK_IMPORTED_MODULE_2__/* .DECIMAL_PLACES */ .nr, this.paddingMode);
|
|
162221
|
+
return decimalParsedResult;
|
|
162222
|
+
}
|
|
160069
162223
|
hashMessage(message) {
|
|
160070
162224
|
return '0x' + this.hash(message, _static_dependencies_noble_hashes_sha3_js__WEBPACK_IMPORTED_MODULE_3__/* .keccak_256 */ .fr, 'hex');
|
|
160071
162225
|
}
|
|
@@ -160283,6 +162437,7 @@ class hyperliquid extends _abstract_hyperliquid_js__WEBPACK_IMPORTED_MODULE_0__/
|
|
|
160283
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%).');
|
|
160284
162438
|
}
|
|
160285
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
|
|
160286
162441
|
}
|
|
160287
162442
|
else {
|
|
160288
162443
|
px = this.priceToPrecision(symbol, price);
|
|
@@ -189122,7 +191277,7 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
189122
191277
|
'Combination of optional parameters invalid': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
189123
191278
|
'api market order is disabled': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
189124
191279
|
'Contract not allow place order!': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
|
|
189125
|
-
'Oversold': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.
|
|
191280
|
+
'Oversold': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InsufficientFunds,
|
|
189126
191281
|
'Insufficient position': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InsufficientFunds,
|
|
189127
191282
|
'Insufficient balance!': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InsufficientFunds,
|
|
189128
191283
|
'Bid price is great than max allow price': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
|
|
@@ -204181,7 +206336,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
204181
206336
|
let paginate = false;
|
|
204182
206337
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchFundingRateHistory', 'paginate');
|
|
204183
206338
|
if (paginate) {
|
|
204184
|
-
return await this.fetchPaginatedCallDeterministic('fetchFundingRateHistory', symbol, since, limit, '8h', params);
|
|
206339
|
+
return await this.fetchPaginatedCallDeterministic('fetchFundingRateHistory', symbol, since, limit, '8h', params, 100);
|
|
204185
206340
|
}
|
|
204186
206341
|
const market = this.market(symbol);
|
|
204187
206342
|
const request = {
|
|
@@ -242783,6 +244938,660 @@ class coinbase extends _coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
|
|
|
242783
244938
|
}
|
|
242784
244939
|
|
|
242785
244940
|
|
|
244941
|
+
/***/ }),
|
|
244942
|
+
|
|
244943
|
+
/***/ 6541:
|
|
244944
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
244945
|
+
|
|
244946
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
244947
|
+
/* harmony export */ Z: () => (/* binding */ coinbaseinternational)
|
|
244948
|
+
/* harmony export */ });
|
|
244949
|
+
/* harmony import */ var _coinbaseinternational_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9339);
|
|
244950
|
+
/* harmony import */ var _base_errors_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6689);
|
|
244951
|
+
/* harmony import */ var _static_dependencies_noble_hashes_sha256_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1372);
|
|
244952
|
+
/* harmony import */ var _base_ws_Cache_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3020);
|
|
244953
|
+
// ---------------------------------------------------------------------------
|
|
244954
|
+
|
|
244955
|
+
|
|
244956
|
+
|
|
244957
|
+
|
|
244958
|
+
// ---------------------------------------------------------------------------
|
|
244959
|
+
class coinbaseinternational extends _coinbaseinternational_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
244960
|
+
describe() {
|
|
244961
|
+
return this.deepExtend(super.describe(), {
|
|
244962
|
+
'has': {
|
|
244963
|
+
'ws': true,
|
|
244964
|
+
'watchTrades': true,
|
|
244965
|
+
'watchTradesForSymbols': true,
|
|
244966
|
+
'watchOrderBook': true,
|
|
244967
|
+
'watchOrderBookForSymbols': true,
|
|
244968
|
+
'watchTicker': true,
|
|
244969
|
+
'watchBalance': false,
|
|
244970
|
+
'watchMyTrades': false,
|
|
244971
|
+
'watchOHLCV': false,
|
|
244972
|
+
'watchOHLCVForSymbols': false,
|
|
244973
|
+
'watchOrders': false,
|
|
244974
|
+
'watchOrdersForSymbols': false,
|
|
244975
|
+
'watchPositions': false,
|
|
244976
|
+
'watchTickers': false,
|
|
244977
|
+
'createOrderWs': false,
|
|
244978
|
+
'editOrderWs': false,
|
|
244979
|
+
'cancelOrderWs': false,
|
|
244980
|
+
'cancelOrdersWs': false,
|
|
244981
|
+
'cancelAllOrdersWs': false,
|
|
244982
|
+
'fetchOrderWs': false,
|
|
244983
|
+
'fetchOrdersWs': false,
|
|
244984
|
+
'fetchBalanceWs': false,
|
|
244985
|
+
'fetchMyTradesWs': false,
|
|
244986
|
+
},
|
|
244987
|
+
'urls': {
|
|
244988
|
+
'api': {
|
|
244989
|
+
'ws': 'wss://ws-md.international.coinbase.com',
|
|
244990
|
+
},
|
|
244991
|
+
'test': {
|
|
244992
|
+
'ws': 'wss://ws-md.n5e2.coinbase.com',
|
|
244993
|
+
},
|
|
244994
|
+
},
|
|
244995
|
+
'options': {
|
|
244996
|
+
'watchTicker': {
|
|
244997
|
+
'channel': 'LEVEL1', // 'INSTRUMENTS' or 'RISK'
|
|
244998
|
+
},
|
|
244999
|
+
'tradesLimit': 1000,
|
|
245000
|
+
'ordersLimit': 1000,
|
|
245001
|
+
'myTradesLimit': 1000,
|
|
245002
|
+
},
|
|
245003
|
+
'errors': {
|
|
245004
|
+
'exact': {
|
|
245005
|
+
'Unable to authenticate': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.AuthenticationError,
|
|
245006
|
+
},
|
|
245007
|
+
},
|
|
245008
|
+
});
|
|
245009
|
+
}
|
|
245010
|
+
async subscribe(name, symbols = undefined, params = {}) {
|
|
245011
|
+
/**
|
|
245012
|
+
* @ignore
|
|
245013
|
+
* @method
|
|
245014
|
+
* @description subscribes to a websocket channel
|
|
245015
|
+
* @see https://docs.cloud.coinbase.com/intx/docs/websocket-overview#subscribe
|
|
245016
|
+
* @param {string} name the name of the channel
|
|
245017
|
+
* @param {string[]} [symbols] unified market symbol
|
|
245018
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
245019
|
+
* @returns {object} subscription to a websocket channel
|
|
245020
|
+
*/
|
|
245021
|
+
this.checkRequiredCredentials();
|
|
245022
|
+
let market = undefined;
|
|
245023
|
+
let messageHash = name;
|
|
245024
|
+
let productIds = [];
|
|
245025
|
+
if (symbols === undefined) {
|
|
245026
|
+
symbols = this.symbols;
|
|
245027
|
+
}
|
|
245028
|
+
const symbolsLength = symbols.length;
|
|
245029
|
+
if (symbolsLength > 1) {
|
|
245030
|
+
const parsedSymbols = this.marketSymbols(symbols);
|
|
245031
|
+
const marketIds = this.marketIds(parsedSymbols);
|
|
245032
|
+
productIds = marketIds;
|
|
245033
|
+
messageHash = messageHash + '::' + parsedSymbols.join(',');
|
|
245034
|
+
}
|
|
245035
|
+
else if (symbolsLength === 1) {
|
|
245036
|
+
market = this.market(symbols[0]);
|
|
245037
|
+
messageHash = name + '::' + market['symbol'];
|
|
245038
|
+
productIds = [market['id']];
|
|
245039
|
+
}
|
|
245040
|
+
const url = this.urls['api']['ws'];
|
|
245041
|
+
if (url === undefined) {
|
|
245042
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.NotSupported(this.id + ' is not supported in sandbox environment');
|
|
245043
|
+
}
|
|
245044
|
+
const timestamp = this.nonce().toString();
|
|
245045
|
+
const auth = timestamp + this.apiKey + 'CBINTLMD' + this.password;
|
|
245046
|
+
const signature = this.hmac(this.encode(auth), this.base64ToBinary(this.secret), _static_dependencies_noble_hashes_sha256_js__WEBPACK_IMPORTED_MODULE_2__/* .sha256 */ .J, 'base64');
|
|
245047
|
+
const subscribe = {
|
|
245048
|
+
'type': 'SUBSCRIBE',
|
|
245049
|
+
'product_ids': productIds,
|
|
245050
|
+
'channels': [name],
|
|
245051
|
+
'time': timestamp,
|
|
245052
|
+
'key': this.apiKey,
|
|
245053
|
+
'passphrase': this.password,
|
|
245054
|
+
'signature': signature,
|
|
245055
|
+
};
|
|
245056
|
+
return await this.watch(url, messageHash, this.extend(subscribe, params), messageHash);
|
|
245057
|
+
}
|
|
245058
|
+
async subscribeMultiple(name, symbols = undefined, params = {}) {
|
|
245059
|
+
/**
|
|
245060
|
+
* @ignore
|
|
245061
|
+
* @method
|
|
245062
|
+
* @description subscribes to a websocket channel using watchMultiple
|
|
245063
|
+
* @see https://docs.cloud.coinbase.com/intx/docs/websocket-overview#subscribe
|
|
245064
|
+
* @param {string} name the name of the channel
|
|
245065
|
+
* @param {string|string[]} [symbol] unified market symbol
|
|
245066
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
245067
|
+
* @returns {object} subscription to a websocket channel
|
|
245068
|
+
*/
|
|
245069
|
+
this.checkRequiredCredentials();
|
|
245070
|
+
if (this.isEmpty(symbols)) {
|
|
245071
|
+
symbols = this.symbols;
|
|
245072
|
+
}
|
|
245073
|
+
else {
|
|
245074
|
+
symbols = this.marketSymbols(symbols);
|
|
245075
|
+
}
|
|
245076
|
+
const messageHashes = [];
|
|
245077
|
+
const productIds = [];
|
|
245078
|
+
for (let i = 0; i < symbols.length; i++) {
|
|
245079
|
+
const marketId = this.marketId(symbols[i]);
|
|
245080
|
+
const symbol = this.symbol(marketId);
|
|
245081
|
+
productIds.push(marketId);
|
|
245082
|
+
messageHashes.push(name + '::' + symbol);
|
|
245083
|
+
}
|
|
245084
|
+
const url = this.urls['api']['ws'];
|
|
245085
|
+
if (url === undefined) {
|
|
245086
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.NotSupported(this.id + ' is not supported in sandbox environment');
|
|
245087
|
+
}
|
|
245088
|
+
const timestamp = this.numberToString(this.seconds());
|
|
245089
|
+
const auth = timestamp + this.apiKey + 'CBINTLMD' + this.password;
|
|
245090
|
+
const signature = this.hmac(this.encode(auth), this.base64ToBinary(this.secret), _static_dependencies_noble_hashes_sha256_js__WEBPACK_IMPORTED_MODULE_2__/* .sha256 */ .J, 'base64');
|
|
245091
|
+
const subscribe = {
|
|
245092
|
+
'type': 'SUBSCRIBE',
|
|
245093
|
+
'time': timestamp,
|
|
245094
|
+
'product_ids': productIds,
|
|
245095
|
+
'channels': [name],
|
|
245096
|
+
'key': this.apiKey,
|
|
245097
|
+
'passphrase': this.password,
|
|
245098
|
+
'signature': signature,
|
|
245099
|
+
};
|
|
245100
|
+
return await this.watchMultiple(url, messageHashes, this.extend(subscribe, params), messageHashes);
|
|
245101
|
+
}
|
|
245102
|
+
async watchFundingRate(symbol, params = {}) {
|
|
245103
|
+
/**
|
|
245104
|
+
* @method
|
|
245105
|
+
* @name coinbaseinternational#watchFundingRate
|
|
245106
|
+
* @description watch the current funding rate
|
|
245107
|
+
* @see https://docs.cloud.coinbase.com/intx/docs/websocket-channels#funding-channel
|
|
245108
|
+
* @param {string} symbol unified market symbol
|
|
245109
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
245110
|
+
* @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
|
|
245111
|
+
*/
|
|
245112
|
+
return await this.subscribe('RISK', [symbol], params);
|
|
245113
|
+
}
|
|
245114
|
+
async watchFundingRates(symbols, params = {}) {
|
|
245115
|
+
/**
|
|
245116
|
+
* @method
|
|
245117
|
+
* @name coinbaseinternational#watchFundingRates
|
|
245118
|
+
* @description watch the funding rate for multiple markets
|
|
245119
|
+
* @see https://docs.cloud.coinbase.com/intx/docs/websocket-channels#funding-channel
|
|
245120
|
+
* @param {string[]|undefined} symbols list of unified market symbols
|
|
245121
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
245122
|
+
* @returns {object} a dictionary of [funding rates structures]{@link https://docs.ccxt.com/#/?id=funding-rates-structure}, indexe by market symbols
|
|
245123
|
+
*/
|
|
245124
|
+
return await this.subscribeMultiple('RISK', symbols, params);
|
|
245125
|
+
}
|
|
245126
|
+
async watchTicker(symbol, params = {}) {
|
|
245127
|
+
/**
|
|
245128
|
+
* @method
|
|
245129
|
+
* @name coinbaseinternational#watchTicker
|
|
245130
|
+
* @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
245131
|
+
* @see https://docs.cloud.coinbase.com/intx/docs/websocket-channels#instruments-channel
|
|
245132
|
+
* @param {string} [symbol] unified symbol of the market to fetch the ticker for
|
|
245133
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
245134
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
245135
|
+
*/
|
|
245136
|
+
let channel = undefined;
|
|
245137
|
+
[channel, params] = this.handleOptionAndParams(params, 'watchTicker', 'channel', 'LEVEL1');
|
|
245138
|
+
return await this.subscribe(channel, [symbol], params);
|
|
245139
|
+
}
|
|
245140
|
+
handleInstrument(client, message) {
|
|
245141
|
+
//
|
|
245142
|
+
// {
|
|
245143
|
+
// "sequence": 1,
|
|
245144
|
+
// "product_id": "ETH-PERP",
|
|
245145
|
+
// "instrument_type": "PERP",
|
|
245146
|
+
// "base_asset_name": "ETH",
|
|
245147
|
+
// "quote_asset_name": "USDC",
|
|
245148
|
+
// "base_increment": "0.0001",
|
|
245149
|
+
// "quote_increment": "0.01",
|
|
245150
|
+
// "avg_daily_quantity": "43.0",
|
|
245151
|
+
// "avg_daily_volume": "80245.2",
|
|
245152
|
+
// "total_30_day_quantity":"1443.0",
|
|
245153
|
+
// "total_30_day_volume":"3040449.0",
|
|
245154
|
+
// "total_24_hour_quantity":"48.1",
|
|
245155
|
+
// "total_24_hour_volume":"101348.3",
|
|
245156
|
+
// "base_imf": "0.2",
|
|
245157
|
+
// "min_quantity": "0.0001",
|
|
245158
|
+
// "position_size_limit": "500",
|
|
245159
|
+
// "funding_interval": "60000000000",
|
|
245160
|
+
// "trading_state": "trading",
|
|
245161
|
+
// "last_update_time": "2023-05-04T11:16:33.016Z",
|
|
245162
|
+
// "time": "2023-05-10T14:58:47.000Z",
|
|
245163
|
+
// "channel":"INSTRUMENTS",
|
|
245164
|
+
// "type":"SNAPSHOT"
|
|
245165
|
+
// }
|
|
245166
|
+
const ticker = this.parseWsInstrument(message);
|
|
245167
|
+
const channel = this.safeString(message, 'channel');
|
|
245168
|
+
client.resolve(ticker, channel);
|
|
245169
|
+
client.resolve(ticker, channel + '::' + ticker['symbol']);
|
|
245170
|
+
}
|
|
245171
|
+
parseWsInstrument(ticker, market = undefined) {
|
|
245172
|
+
//
|
|
245173
|
+
// {
|
|
245174
|
+
// "sequence": 1,
|
|
245175
|
+
// "product_id": "ETH-PERP",
|
|
245176
|
+
// "instrument_type": "PERP",
|
|
245177
|
+
// "base_asset_name": "ETH",
|
|
245178
|
+
// "quote_asset_name": "USDC",
|
|
245179
|
+
// "base_increment": "0.0001",
|
|
245180
|
+
// "quote_increment": "0.01",
|
|
245181
|
+
// "avg_daily_quantity": "43.0",
|
|
245182
|
+
// "avg_daily_volume": "80245.2",
|
|
245183
|
+
// "total_30_day_quantity":"1443.0",
|
|
245184
|
+
// "total_30_day_volume":"3040449.0",
|
|
245185
|
+
// "total_24_hour_quantity":"48.1",
|
|
245186
|
+
// "total_24_hour_volume":"101348.3",
|
|
245187
|
+
// "base_imf": "0.2",
|
|
245188
|
+
// "min_quantity": "0.0001",
|
|
245189
|
+
// "position_size_limit": "500",
|
|
245190
|
+
// "funding_interval": "60000000000",
|
|
245191
|
+
// "trading_state": "trading",
|
|
245192
|
+
// "last_update_time": "2023-05-04T11:16:33.016Z",
|
|
245193
|
+
// "time": "2023-05-10T14:58:47.000Z",
|
|
245194
|
+
// "channel":"INSTRUMENTS",
|
|
245195
|
+
// "type":"SNAPSHOT"
|
|
245196
|
+
// }
|
|
245197
|
+
//
|
|
245198
|
+
const marketId = this.safeString(ticker, 'product_id');
|
|
245199
|
+
const datetime = this.safeString(ticker, 'time');
|
|
245200
|
+
return this.safeTicker({
|
|
245201
|
+
'info': ticker,
|
|
245202
|
+
'symbol': this.safeSymbol(marketId, market, '-'),
|
|
245203
|
+
'timestamp': this.parse8601(datetime),
|
|
245204
|
+
'datetime': datetime,
|
|
245205
|
+
'high': undefined,
|
|
245206
|
+
'low': undefined,
|
|
245207
|
+
'bid': undefined,
|
|
245208
|
+
'bidVolume': undefined,
|
|
245209
|
+
'ask': undefined,
|
|
245210
|
+
'askVolume': undefined,
|
|
245211
|
+
'vwap': undefined,
|
|
245212
|
+
'open': undefined,
|
|
245213
|
+
'close': undefined,
|
|
245214
|
+
'last': undefined,
|
|
245215
|
+
'previousClose': undefined,
|
|
245216
|
+
'change': undefined,
|
|
245217
|
+
'percentage': undefined,
|
|
245218
|
+
'average': undefined,
|
|
245219
|
+
'baseVolume': this.safeString(ticker, 'total_24_hour_quantity'),
|
|
245220
|
+
'quoteVolume': this.safeString(ticker, 'total_24_hour_volume'),
|
|
245221
|
+
});
|
|
245222
|
+
}
|
|
245223
|
+
handleTicker(client, message) {
|
|
245224
|
+
//
|
|
245225
|
+
// snapshot
|
|
245226
|
+
// {
|
|
245227
|
+
// "sequence": 0,
|
|
245228
|
+
// "product_id": "BTC-PERP",
|
|
245229
|
+
// "time": "2023-05-10T14:58:47.000Z",
|
|
245230
|
+
// "bid_price": "28787.8",
|
|
245231
|
+
// "bid_qty": "0.466", // One side book
|
|
245232
|
+
// "channel": "LEVEL1",
|
|
245233
|
+
// "type": "SNAPSHOT"
|
|
245234
|
+
// }
|
|
245235
|
+
// update
|
|
245236
|
+
// {
|
|
245237
|
+
// "sequence": 1,
|
|
245238
|
+
// "product_id": "BTC-PERP",
|
|
245239
|
+
// "time": "2023-05-10T14:58:47.547Z",
|
|
245240
|
+
// "bid_price": "28787.8",
|
|
245241
|
+
// "bid_qty": "0.466",
|
|
245242
|
+
// "ask_price": "28788.8",
|
|
245243
|
+
// "ask_qty": "1.566",
|
|
245244
|
+
// "channel": "LEVEL1",
|
|
245245
|
+
// "type": "UPDATE"
|
|
245246
|
+
// }
|
|
245247
|
+
//
|
|
245248
|
+
const ticker = this.parseWsTicker(message);
|
|
245249
|
+
const channel = this.safeString(message, 'channel');
|
|
245250
|
+
client.resolve(ticker, channel);
|
|
245251
|
+
client.resolve(ticker, channel + '::' + ticker['symbol']);
|
|
245252
|
+
}
|
|
245253
|
+
parseWsTicker(ticker, market = undefined) {
|
|
245254
|
+
//
|
|
245255
|
+
// {
|
|
245256
|
+
// "sequence": 1,
|
|
245257
|
+
// "product_id": "BTC-PERP",
|
|
245258
|
+
// "time": "2023-05-10T14:58:47.547Z",
|
|
245259
|
+
// "bid_price": "28787.8",
|
|
245260
|
+
// "bid_qty": "0.466",
|
|
245261
|
+
// "ask_price": "28788.8",
|
|
245262
|
+
// "ask_qty": "1.566",
|
|
245263
|
+
// "channel": "LEVEL1",
|
|
245264
|
+
// "type": "UPDATE"
|
|
245265
|
+
// }
|
|
245266
|
+
//
|
|
245267
|
+
const datetime = this.safeString(ticker, 'time');
|
|
245268
|
+
const marketId = this.safeString(ticker, 'product_id');
|
|
245269
|
+
return this.safeTicker({
|
|
245270
|
+
'info': ticker,
|
|
245271
|
+
'symbol': this.safeSymbol(marketId, market),
|
|
245272
|
+
'timestamp': this.parse8601(datetime),
|
|
245273
|
+
'datetime': datetime,
|
|
245274
|
+
'bid': this.safeNumber(ticker, 'bid_price'),
|
|
245275
|
+
'bidVolume': this.safeNumber(ticker, 'bid_qty'),
|
|
245276
|
+
'ask': this.safeNumber(ticker, 'ask_price'),
|
|
245277
|
+
'askVolume': this.safeNumber(ticker, 'ask_qty'),
|
|
245278
|
+
'high': undefined,
|
|
245279
|
+
'low': undefined,
|
|
245280
|
+
'open': undefined,
|
|
245281
|
+
'close': undefined,
|
|
245282
|
+
'last': undefined,
|
|
245283
|
+
'change': undefined,
|
|
245284
|
+
'percentage': undefined,
|
|
245285
|
+
'average': undefined,
|
|
245286
|
+
'vwap': undefined,
|
|
245287
|
+
'baseVolume': undefined,
|
|
245288
|
+
'quoteVolume': undefined,
|
|
245289
|
+
'previousClose': undefined,
|
|
245290
|
+
});
|
|
245291
|
+
}
|
|
245292
|
+
async watchTrades(symbol, since = undefined, limit = undefined, params = {}) {
|
|
245293
|
+
/**
|
|
245294
|
+
* @method
|
|
245295
|
+
* @name coinbaseinternational#watchTrades
|
|
245296
|
+
* @description get the list of most recent trades for a particular symbol
|
|
245297
|
+
* @see https://docs.cloud.coinbase.com/intx/docs/websocket-channels#match-channel
|
|
245298
|
+
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
245299
|
+
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
245300
|
+
* @param {int} [limit] the maximum amount of trades to fetch
|
|
245301
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
245302
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
245303
|
+
*/
|
|
245304
|
+
return await this.watchTradesForSymbols([symbol], since, limit, params);
|
|
245305
|
+
}
|
|
245306
|
+
async watchTradesForSymbols(symbols, since = undefined, limit = undefined, params = {}) {
|
|
245307
|
+
/**
|
|
245308
|
+
* @method
|
|
245309
|
+
* @name coinbaseinternational#watchTradesForSymbols
|
|
245310
|
+
* @description get the list of most recent trades for a list of symbols
|
|
245311
|
+
* @param {string[]} symbols unified symbol of the market to fetch trades for
|
|
245312
|
+
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
245313
|
+
* @param {int} [limit] the maximum amount of trades to fetch
|
|
245314
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
245315
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
245316
|
+
*/
|
|
245317
|
+
await this.loadMarkets();
|
|
245318
|
+
symbols = this.marketSymbols(symbols, undefined, false, true, true);
|
|
245319
|
+
const trades = await this.subscribeMultiple('MATCH', symbols, params);
|
|
245320
|
+
if (this.newUpdates) {
|
|
245321
|
+
const first = this.safeDict(trades, 0);
|
|
245322
|
+
const tradeSymbol = this.safeString(first, 'symbol');
|
|
245323
|
+
limit = trades.getLimit(tradeSymbol, limit);
|
|
245324
|
+
}
|
|
245325
|
+
return this.filterBySinceLimit(trades, since, limit, 'timestamp', true);
|
|
245326
|
+
}
|
|
245327
|
+
handleTrade(client, message) {
|
|
245328
|
+
//
|
|
245329
|
+
// {
|
|
245330
|
+
// "sequence": 0,
|
|
245331
|
+
// "product_id": "BTC-PERP",
|
|
245332
|
+
// "time": "2023-05-10T14:58:47.002Z",
|
|
245333
|
+
// "match_id": "177101110052388865",
|
|
245334
|
+
// "trade_qty": "0.006",
|
|
245335
|
+
// "aggressor_side": "BUY",
|
|
245336
|
+
// "trade_price": "28833.1",
|
|
245337
|
+
// "channel": "MATCH",
|
|
245338
|
+
// "type": "UPDATE"
|
|
245339
|
+
// }
|
|
245340
|
+
//
|
|
245341
|
+
const trade = this.parseWsTrade(message);
|
|
245342
|
+
const symbol = trade['symbol'];
|
|
245343
|
+
const channel = this.safeString(message, 'channel');
|
|
245344
|
+
if (!(symbol in this.trades)) {
|
|
245345
|
+
const limit = this.safeInteger(this.options, 'tradesLimit', 1000);
|
|
245346
|
+
const tradesArrayCache = new _base_ws_Cache_js__WEBPACK_IMPORTED_MODULE_3__/* .ArrayCache */ .ZL(limit);
|
|
245347
|
+
this.trades[symbol] = tradesArrayCache;
|
|
245348
|
+
}
|
|
245349
|
+
const tradesArray = this.trades[symbol];
|
|
245350
|
+
tradesArray.append(trade);
|
|
245351
|
+
this.trades[symbol] = tradesArray;
|
|
245352
|
+
client.resolve(tradesArray, channel);
|
|
245353
|
+
client.resolve(tradesArray, channel + '::' + trade['symbol']);
|
|
245354
|
+
return message;
|
|
245355
|
+
}
|
|
245356
|
+
parseWsTrade(trade, market = undefined) {
|
|
245357
|
+
//
|
|
245358
|
+
// {
|
|
245359
|
+
// "sequence": 0,
|
|
245360
|
+
// "product_id": "BTC-PERP",
|
|
245361
|
+
// "time": "2023-05-10T14:58:47.002Z",
|
|
245362
|
+
// "match_id": "177101110052388865",
|
|
245363
|
+
// "trade_qty": "0.006",
|
|
245364
|
+
// "aggressor_side": "BUY",
|
|
245365
|
+
// "trade_price": "28833.1",
|
|
245366
|
+
// "channel": "MATCH",
|
|
245367
|
+
// "type": "UPDATE"
|
|
245368
|
+
// }
|
|
245369
|
+
const marketId = this.safeString2(trade, 'symbol', 'product_id');
|
|
245370
|
+
const datetime = this.safeString(trade, 'time');
|
|
245371
|
+
return this.safeTrade({
|
|
245372
|
+
'info': trade,
|
|
245373
|
+
'id': this.safeString(trade, 'match_id'),
|
|
245374
|
+
'order': undefined,
|
|
245375
|
+
'timestamp': this.parse8601(datetime),
|
|
245376
|
+
'datetime': datetime,
|
|
245377
|
+
'symbol': this.safeSymbol(marketId, market),
|
|
245378
|
+
'type': undefined,
|
|
245379
|
+
'side': this.safeStringLower(trade, 'agressor_side'),
|
|
245380
|
+
'takerOrMaker': undefined,
|
|
245381
|
+
'price': this.safeString(trade, 'trade_price'),
|
|
245382
|
+
'amount': this.safeString(trade, 'trade_qty'),
|
|
245383
|
+
'cost': undefined,
|
|
245384
|
+
'fee': undefined,
|
|
245385
|
+
});
|
|
245386
|
+
}
|
|
245387
|
+
async watchOrderBook(symbol, limit = undefined, params = {}) {
|
|
245388
|
+
/**
|
|
245389
|
+
* @method
|
|
245390
|
+
* @name coinbaseinternational#watchOrderBook
|
|
245391
|
+
* @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
245392
|
+
* @see https://docs.cloud.coinbase.com/intx/docs/websocket-channels#level2-channel
|
|
245393
|
+
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
245394
|
+
* @param {int} [limit] the maximum amount of order book entries to return
|
|
245395
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
245396
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
245397
|
+
*/
|
|
245398
|
+
return await this.watchOrderBookForSymbols([symbol], limit, params);
|
|
245399
|
+
}
|
|
245400
|
+
async watchOrderBookForSymbols(symbols, limit = undefined, params = {}) {
|
|
245401
|
+
/**
|
|
245402
|
+
* @method
|
|
245403
|
+
* @name coinbaseinternational#watchOrderBook
|
|
245404
|
+
* @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
245405
|
+
* @see https://docs.cloud.coinbase.com/intx/docs/websocket-channels#level2-channel
|
|
245406
|
+
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
245407
|
+
* @param {int} [limit] the maximum amount of order book entries to return
|
|
245408
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
245409
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
245410
|
+
*/
|
|
245411
|
+
await this.loadMarkets();
|
|
245412
|
+
return await this.subscribeMultiple('LEVEL2', symbols, params);
|
|
245413
|
+
}
|
|
245414
|
+
handleOrderBook(client, message) {
|
|
245415
|
+
//
|
|
245416
|
+
// snapshot
|
|
245417
|
+
// {
|
|
245418
|
+
// "sequence": 0,
|
|
245419
|
+
// "product_id": "BTC-PERP",
|
|
245420
|
+
// "time": "2023-05-10T14:58:47.000Z",
|
|
245421
|
+
// "bids": [
|
|
245422
|
+
// ["29100", "0.02"],
|
|
245423
|
+
// ["28950", "0.01"],
|
|
245424
|
+
// ["28900", "0.01"]
|
|
245425
|
+
// ],
|
|
245426
|
+
// "asks": [
|
|
245427
|
+
// ["29267.8", "18"],
|
|
245428
|
+
// ["29747.6", "18"],
|
|
245429
|
+
// ["30227.4", "9"]
|
|
245430
|
+
// ],
|
|
245431
|
+
// "channel": "LEVEL2",
|
|
245432
|
+
// "type": "SNAPSHOT",
|
|
245433
|
+
// }
|
|
245434
|
+
// update
|
|
245435
|
+
// {
|
|
245436
|
+
// "sequence": 1,
|
|
245437
|
+
// "product_id": "BTC-PERP",
|
|
245438
|
+
// "time": "2023-05-10T14:58:47.375Z",
|
|
245439
|
+
// "changes": [
|
|
245440
|
+
// [
|
|
245441
|
+
// "BUY",
|
|
245442
|
+
// "28787.7",
|
|
245443
|
+
// "6"
|
|
245444
|
+
// ]
|
|
245445
|
+
// ],
|
|
245446
|
+
// "channel": "LEVEL2",
|
|
245447
|
+
// "type": "UPDATE"
|
|
245448
|
+
// }
|
|
245449
|
+
//
|
|
245450
|
+
const type = this.safeString(message, 'type');
|
|
245451
|
+
const marketId = this.safeString(message, 'product_id');
|
|
245452
|
+
const symbol = this.safeSymbol(marketId);
|
|
245453
|
+
const datetime = this.safeString(message, 'time');
|
|
245454
|
+
const channel = this.safeString(message, 'channel');
|
|
245455
|
+
if (!(symbol in this.orderbooks)) {
|
|
245456
|
+
const limit = this.safeInteger(this.options, 'watchOrderBookLimit', 1000);
|
|
245457
|
+
this.orderbooks[symbol] = this.orderBook({}, limit);
|
|
245458
|
+
}
|
|
245459
|
+
const orderbook = this.orderbooks[symbol];
|
|
245460
|
+
if (type === 'SNAPSHOT') {
|
|
245461
|
+
const parsedSnapshot = this.parseOrderBook(message, symbol, undefined, 'bids', 'asks');
|
|
245462
|
+
orderbook.reset(parsedSnapshot);
|
|
245463
|
+
orderbook['symbol'] = symbol;
|
|
245464
|
+
}
|
|
245465
|
+
else {
|
|
245466
|
+
const changes = this.safeList(message, 'changes', []);
|
|
245467
|
+
this.handleDeltas(orderbook, changes);
|
|
245468
|
+
}
|
|
245469
|
+
orderbook['nonce'] = this.safeInteger(message, 'sequence');
|
|
245470
|
+
orderbook['datetime'] = datetime;
|
|
245471
|
+
orderbook['timestamp'] = this.parse8601(datetime);
|
|
245472
|
+
this.orderbooks[symbol] = orderbook;
|
|
245473
|
+
client.resolve(orderbook, channel + '::' + symbol);
|
|
245474
|
+
}
|
|
245475
|
+
handleDelta(orderbook, delta) {
|
|
245476
|
+
const rawSide = this.safeStringLower(delta, 0);
|
|
245477
|
+
const side = (rawSide === 'buy') ? 'bids' : 'asks';
|
|
245478
|
+
const price = this.safeFloat(delta, 1);
|
|
245479
|
+
const amount = this.safeFloat(delta, 2);
|
|
245480
|
+
const bookside = orderbook[side];
|
|
245481
|
+
bookside.store(price, amount);
|
|
245482
|
+
}
|
|
245483
|
+
handleDeltas(orderbook, deltas) {
|
|
245484
|
+
for (let i = 0; i < deltas.length; i++) {
|
|
245485
|
+
this.handleDelta(orderbook, deltas[i]);
|
|
245486
|
+
}
|
|
245487
|
+
}
|
|
245488
|
+
handleSubscriptionStatus(client, message) {
|
|
245489
|
+
//
|
|
245490
|
+
// {
|
|
245491
|
+
// "channels": [
|
|
245492
|
+
// {
|
|
245493
|
+
// "name": "MATCH",
|
|
245494
|
+
// "product_ids": [
|
|
245495
|
+
// "BTC-PERP",
|
|
245496
|
+
// "ETH-PERP"
|
|
245497
|
+
// ]
|
|
245498
|
+
// },
|
|
245499
|
+
// {
|
|
245500
|
+
// "name": "INSTRUMENTS",
|
|
245501
|
+
// "product_ids": [
|
|
245502
|
+
// "BTC-PERP",
|
|
245503
|
+
// "ETH-PERP"
|
|
245504
|
+
// ]
|
|
245505
|
+
// }
|
|
245506
|
+
// ],
|
|
245507
|
+
// "authenticated": true,
|
|
245508
|
+
// "channel": "SUBSCRIPTIONS",
|
|
245509
|
+
// "type": "SNAPSHOT",
|
|
245510
|
+
// "time": "2023-05-30T16:53:46.847Z"
|
|
245511
|
+
// }
|
|
245512
|
+
//
|
|
245513
|
+
return message;
|
|
245514
|
+
}
|
|
245515
|
+
handleFundingRate(client, message) {
|
|
245516
|
+
//
|
|
245517
|
+
// snapshot
|
|
245518
|
+
// {
|
|
245519
|
+
// "sequence": 0,
|
|
245520
|
+
// "product_id": "BTC-PERP",
|
|
245521
|
+
// "time": "2023-05-10T14:58:47.000Z",
|
|
245522
|
+
// "funding_rate": "0.001387",
|
|
245523
|
+
// "is_final": true,
|
|
245524
|
+
// "channel": "FUNDING",
|
|
245525
|
+
// "type": "SNAPSHOT"
|
|
245526
|
+
// }
|
|
245527
|
+
// update
|
|
245528
|
+
// {
|
|
245529
|
+
// "sequence": 1,
|
|
245530
|
+
// "product_id": "BTC-PERP",
|
|
245531
|
+
// "time": "2023-05-10T15:00:00.000Z",
|
|
245532
|
+
// "funding_rate": "0.001487",
|
|
245533
|
+
// "is_final": false,
|
|
245534
|
+
// "channel": "FUNDING",
|
|
245535
|
+
// "type": "UPDATE"
|
|
245536
|
+
// }
|
|
245537
|
+
//
|
|
245538
|
+
const channel = this.safeString(message, 'channel');
|
|
245539
|
+
const fundingRate = this.parseFundingRate(message);
|
|
245540
|
+
client.resolve(fundingRate, channel + '::' + fundingRate['symbol']);
|
|
245541
|
+
}
|
|
245542
|
+
handleErrorMessage(client, message) {
|
|
245543
|
+
//
|
|
245544
|
+
// {
|
|
245545
|
+
// message: 'Failed to subscribe',
|
|
245546
|
+
// reason: 'Unable to authenticate',
|
|
245547
|
+
// channel: 'SUBSCRIPTIONS',
|
|
245548
|
+
// type: 'REJECT'
|
|
245549
|
+
// }
|
|
245550
|
+
//
|
|
245551
|
+
const type = this.safeString(message, 'type');
|
|
245552
|
+
if (type !== 'REJECT') {
|
|
245553
|
+
return false;
|
|
245554
|
+
}
|
|
245555
|
+
const reason = this.safeString(message, 'reason');
|
|
245556
|
+
const errMsg = this.safeString(message, 'message');
|
|
245557
|
+
try {
|
|
245558
|
+
const feedback = this.id + ' ' + errMsg + reason;
|
|
245559
|
+
this.throwExactlyMatchedException(this.exceptions['exact'], reason, feedback);
|
|
245560
|
+
this.throwBroadlyMatchedException(this.exceptions['broad'], reason, feedback);
|
|
245561
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ExchangeError(feedback);
|
|
245562
|
+
}
|
|
245563
|
+
catch (e) {
|
|
245564
|
+
client.reject(e);
|
|
245565
|
+
}
|
|
245566
|
+
return true;
|
|
245567
|
+
}
|
|
245568
|
+
handleMessage(client, message) {
|
|
245569
|
+
if (this.handleErrorMessage(client, message)) {
|
|
245570
|
+
return;
|
|
245571
|
+
}
|
|
245572
|
+
const channel = this.safeString(message, 'channel');
|
|
245573
|
+
const methods = {
|
|
245574
|
+
'SUBSCRIPTIONS': this.handleSubscriptionStatus,
|
|
245575
|
+
'INSTRUMENTS': this.handleInstrument,
|
|
245576
|
+
'LEVEL1': this.handleTicker,
|
|
245577
|
+
'MATCH': this.handleTrade,
|
|
245578
|
+
'LEVEL2': this.handleOrderBook,
|
|
245579
|
+
'FUNDING': this.handleFundingRate,
|
|
245580
|
+
'RISK': this.handleTicker,
|
|
245581
|
+
};
|
|
245582
|
+
const type = this.safeString(message, 'type');
|
|
245583
|
+
if (type === 'error') {
|
|
245584
|
+
const errorMessage = this.safeString(message, 'message');
|
|
245585
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ExchangeError(errorMessage);
|
|
245586
|
+
}
|
|
245587
|
+
const method = this.safeValue(methods, channel);
|
|
245588
|
+
if (method !== undefined) {
|
|
245589
|
+
method.call(this, client, message);
|
|
245590
|
+
}
|
|
245591
|
+
}
|
|
245592
|
+
}
|
|
245593
|
+
|
|
245594
|
+
|
|
242786
245595
|
/***/ }),
|
|
242787
245596
|
|
|
242788
245597
|
/***/ 8368:
|
|
@@ -259420,16 +262229,17 @@ class krakenfutures extends _krakenfutures_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
|
|
|
259420
262229
|
const market = this.market(marketId);
|
|
259421
262230
|
const symbol = market['symbol'];
|
|
259422
262231
|
const messageHash = 'trade:' + symbol;
|
|
259423
|
-
|
|
259424
|
-
if (tradesArray === undefined) {
|
|
262232
|
+
if (this.safeList(this.trades, symbol) === undefined) {
|
|
259425
262233
|
const tradesLimit = this.safeInteger(this.options, 'tradesLimit', 1000);
|
|
259426
|
-
|
|
259427
|
-
this.trades[symbol] = tradesArray;
|
|
262234
|
+
this.trades[symbol] = new _base_ws_Cache_js__WEBPACK_IMPORTED_MODULE_1__/* .ArrayCache */ .ZL(tradesLimit);
|
|
259428
262235
|
}
|
|
262236
|
+
const tradesArray = this.trades[symbol];
|
|
259429
262237
|
if (channel === 'trade_snapshot') {
|
|
259430
|
-
const trades = this.
|
|
259431
|
-
|
|
259432
|
-
|
|
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];
|
|
259433
262243
|
const trade = this.parseWsTrade(item);
|
|
259434
262244
|
tradesArray.append(trade);
|
|
259435
262245
|
}
|
|
@@ -317716,39 +320526,39 @@ var __webpack_exports__ = {};
|
|
|
317716
320526
|
(() => {
|
|
317717
320527
|
__webpack_require__.r(__webpack_exports__);
|
|
317718
320528
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
317719
|
-
/* harmony export */ AccountNotEnabled: () => (/* reexport safe */
|
|
317720
|
-
/* harmony export */ AccountSuspended: () => (/* reexport safe */
|
|
317721
|
-
/* harmony export */ AddressPending: () => (/* reexport safe */
|
|
317722
|
-
/* harmony export */ ArgumentsRequired: () => (/* reexport safe */
|
|
317723
|
-
/* harmony export */ AuthenticationError: () => (/* reexport safe */
|
|
317724
|
-
/* harmony export */ BadRequest: () => (/* reexport safe */
|
|
317725
|
-
/* harmony export */ BadResponse: () => (/* reexport safe */
|
|
317726
|
-
/* harmony export */ BadSymbol: () => (/* reexport safe */
|
|
317727
|
-
/* harmony export */ BaseError: () => (/* reexport safe */
|
|
317728
|
-
/* harmony export */ CancelPending: () => (/* reexport safe */
|
|
317729
|
-
/* harmony export */ DDoSProtection: () => (/* reexport safe */
|
|
317730
|
-
/* harmony export */ DuplicateOrderId: () => (/* reexport safe */
|
|
320529
|
+
/* harmony export */ AccountNotEnabled: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.AccountNotEnabled),
|
|
320530
|
+
/* harmony export */ AccountSuspended: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.AccountSuspended),
|
|
320531
|
+
/* harmony export */ AddressPending: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.AddressPending),
|
|
320532
|
+
/* harmony export */ ArgumentsRequired: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.ArgumentsRequired),
|
|
320533
|
+
/* harmony export */ AuthenticationError: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.AuthenticationError),
|
|
320534
|
+
/* harmony export */ BadRequest: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.BadRequest),
|
|
320535
|
+
/* harmony export */ BadResponse: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.BadResponse),
|
|
320536
|
+
/* harmony export */ BadSymbol: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.BadSymbol),
|
|
320537
|
+
/* harmony export */ BaseError: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.BaseError),
|
|
320538
|
+
/* harmony export */ CancelPending: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.CancelPending),
|
|
320539
|
+
/* harmony export */ DDoSProtection: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.DDoSProtection),
|
|
320540
|
+
/* harmony export */ DuplicateOrderId: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.DuplicateOrderId),
|
|
317731
320541
|
/* harmony export */ Exchange: () => (/* reexport safe */ _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__.e),
|
|
317732
|
-
/* harmony export */ ExchangeError: () => (/* reexport safe */
|
|
317733
|
-
/* harmony export */ ExchangeNotAvailable: () => (/* reexport safe */
|
|
317734
|
-
/* harmony export */ InsufficientFunds: () => (/* reexport safe */
|
|
317735
|
-
/* harmony export */ InvalidAddress: () => (/* reexport safe */
|
|
317736
|
-
/* harmony export */ InvalidNonce: () => (/* reexport safe */
|
|
317737
|
-
/* harmony export */ InvalidOrder: () => (/* reexport safe */
|
|
317738
|
-
/* harmony export */ MarginModeAlreadySet: () => (/* reexport safe */
|
|
317739
|
-
/* harmony export */ NetworkError: () => (/* reexport safe */
|
|
317740
|
-
/* harmony export */ NoChange: () => (/* reexport safe */
|
|
317741
|
-
/* harmony export */ NotSupported: () => (/* reexport safe */
|
|
317742
|
-
/* harmony export */ NullResponse: () => (/* reexport safe */
|
|
317743
|
-
/* harmony export */ OnMaintenance: () => (/* reexport safe */
|
|
317744
|
-
/* harmony export */ OrderImmediatelyFillable: () => (/* reexport safe */
|
|
317745
|
-
/* harmony export */ OrderNotCached: () => (/* reexport safe */
|
|
317746
|
-
/* harmony export */ OrderNotFillable: () => (/* reexport safe */
|
|
317747
|
-
/* harmony export */ OrderNotFound: () => (/* reexport safe */
|
|
317748
|
-
/* harmony export */ PermissionDenied: () => (/* reexport safe */
|
|
317749
|
-
/* harmony export */ Precise: () => (/* reexport safe */
|
|
317750
|
-
/* harmony export */ RateLimitExceeded: () => (/* reexport safe */
|
|
317751
|
-
/* harmony export */ RequestTimeout: () => (/* reexport safe */
|
|
320542
|
+
/* harmony export */ ExchangeError: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.ExchangeError),
|
|
320543
|
+
/* harmony export */ ExchangeNotAvailable: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.ExchangeNotAvailable),
|
|
320544
|
+
/* harmony export */ InsufficientFunds: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.InsufficientFunds),
|
|
320545
|
+
/* harmony export */ InvalidAddress: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.InvalidAddress),
|
|
320546
|
+
/* harmony export */ InvalidNonce: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.InvalidNonce),
|
|
320547
|
+
/* harmony export */ InvalidOrder: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.InvalidOrder),
|
|
320548
|
+
/* harmony export */ MarginModeAlreadySet: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.MarginModeAlreadySet),
|
|
320549
|
+
/* harmony export */ NetworkError: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.NetworkError),
|
|
320550
|
+
/* harmony export */ NoChange: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.NoChange),
|
|
320551
|
+
/* harmony export */ NotSupported: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.NotSupported),
|
|
320552
|
+
/* harmony export */ NullResponse: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.NullResponse),
|
|
320553
|
+
/* harmony export */ OnMaintenance: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.OnMaintenance),
|
|
320554
|
+
/* harmony export */ OrderImmediatelyFillable: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.OrderImmediatelyFillable),
|
|
320555
|
+
/* harmony export */ OrderNotCached: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.OrderNotCached),
|
|
320556
|
+
/* harmony export */ OrderNotFillable: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.OrderNotFillable),
|
|
320557
|
+
/* harmony export */ OrderNotFound: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.OrderNotFound),
|
|
320558
|
+
/* harmony export */ PermissionDenied: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.PermissionDenied),
|
|
320559
|
+
/* harmony export */ Precise: () => (/* reexport safe */ _src_base_Precise_js__WEBPACK_IMPORTED_MODULE_166__.O),
|
|
320560
|
+
/* harmony export */ RateLimitExceeded: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.RateLimitExceeded),
|
|
320561
|
+
/* harmony export */ RequestTimeout: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.RequestTimeout),
|
|
317752
320562
|
/* harmony export */ ace: () => (/* reexport safe */ _src_ace_js__WEBPACK_IMPORTED_MODULE_1__.Z),
|
|
317753
320563
|
/* harmony export */ alpaca: () => (/* reexport safe */ _src_alpaca_js__WEBPACK_IMPORTED_MODULE_2__.Z),
|
|
317754
320564
|
/* harmony export */ ascendex: () => (/* reexport safe */ _src_ascendex_js__WEBPACK_IMPORTED_MODULE_3__.Z),
|
|
@@ -317788,79 +320598,80 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
317788
320598
|
/* harmony export */ bybit: () => (/* reexport safe */ _src_bybit_js__WEBPACK_IMPORTED_MODULE_37__.Z),
|
|
317789
320599
|
/* harmony export */ cex: () => (/* reexport safe */ _src_cex_js__WEBPACK_IMPORTED_MODULE_38__.Z),
|
|
317790
320600
|
/* harmony export */ coinbase: () => (/* reexport safe */ _src_coinbase_js__WEBPACK_IMPORTED_MODULE_39__.Z),
|
|
317791
|
-
/* harmony export */
|
|
317792
|
-
/* harmony export */
|
|
317793
|
-
/* harmony export */
|
|
317794
|
-
/* harmony export */
|
|
317795
|
-
/* harmony export */
|
|
317796
|
-
/* harmony export */
|
|
317797
|
-
/* harmony export */
|
|
317798
|
-
/* harmony export */
|
|
317799
|
-
/* harmony export */
|
|
317800
|
-
/* harmony export */
|
|
317801
|
-
/* harmony export */
|
|
320601
|
+
/* harmony export */ coinbaseinternational: () => (/* reexport safe */ _src_coinbaseinternational_js__WEBPACK_IMPORTED_MODULE_40__.Z),
|
|
320602
|
+
/* harmony export */ coinbasepro: () => (/* reexport safe */ _src_coinbasepro_js__WEBPACK_IMPORTED_MODULE_41__.Z),
|
|
320603
|
+
/* harmony export */ coincheck: () => (/* reexport safe */ _src_coincheck_js__WEBPACK_IMPORTED_MODULE_42__.Z),
|
|
320604
|
+
/* harmony export */ coinex: () => (/* reexport safe */ _src_coinex_js__WEBPACK_IMPORTED_MODULE_43__.Z),
|
|
320605
|
+
/* harmony export */ coinlist: () => (/* reexport safe */ _src_coinlist_js__WEBPACK_IMPORTED_MODULE_44__.Z),
|
|
320606
|
+
/* harmony export */ coinmate: () => (/* reexport safe */ _src_coinmate_js__WEBPACK_IMPORTED_MODULE_45__.Z),
|
|
320607
|
+
/* harmony export */ coinmetro: () => (/* reexport safe */ _src_coinmetro_js__WEBPACK_IMPORTED_MODULE_46__.Z),
|
|
320608
|
+
/* harmony export */ coinone: () => (/* reexport safe */ _src_coinone_js__WEBPACK_IMPORTED_MODULE_47__.Z),
|
|
320609
|
+
/* harmony export */ coinsph: () => (/* reexport safe */ _src_coinsph_js__WEBPACK_IMPORTED_MODULE_48__.Z),
|
|
320610
|
+
/* harmony export */ coinspot: () => (/* reexport safe */ _src_coinspot_js__WEBPACK_IMPORTED_MODULE_49__.Z),
|
|
320611
|
+
/* harmony export */ cryptocom: () => (/* reexport safe */ _src_cryptocom_js__WEBPACK_IMPORTED_MODULE_50__.Z),
|
|
320612
|
+
/* harmony export */ currencycom: () => (/* reexport safe */ _src_currencycom_js__WEBPACK_IMPORTED_MODULE_51__.Z),
|
|
317802
320613
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
|
|
317803
|
-
/* harmony export */ delta: () => (/* reexport safe */
|
|
317804
|
-
/* harmony export */ deribit: () => (/* reexport safe */
|
|
317805
|
-
/* harmony export */ digifinex: () => (/* reexport safe */
|
|
317806
|
-
/* harmony export */ errors: () => (/* reexport module object */
|
|
320614
|
+
/* harmony export */ delta: () => (/* reexport safe */ _src_delta_js__WEBPACK_IMPORTED_MODULE_52__.Z),
|
|
320615
|
+
/* harmony export */ deribit: () => (/* reexport safe */ _src_deribit_js__WEBPACK_IMPORTED_MODULE_53__.Z),
|
|
320616
|
+
/* harmony export */ digifinex: () => (/* reexport safe */ _src_digifinex_js__WEBPACK_IMPORTED_MODULE_54__.Z),
|
|
320617
|
+
/* harmony export */ errors: () => (/* reexport module object */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__),
|
|
317807
320618
|
/* harmony export */ exchanges: () => (/* binding */ exchanges),
|
|
317808
|
-
/* harmony export */ exmo: () => (/* reexport safe */
|
|
317809
|
-
/* harmony export */ fmfwio: () => (/* reexport safe */
|
|
317810
|
-
/* harmony export */ functions: () => (/* reexport module object */
|
|
317811
|
-
/* harmony export */ gate: () => (/* reexport safe */
|
|
317812
|
-
/* harmony export */ gateio: () => (/* reexport safe */
|
|
317813
|
-
/* harmony export */ gemini: () => (/* reexport safe */
|
|
317814
|
-
/* harmony export */ hitbtc: () => (/* reexport safe */
|
|
317815
|
-
/* harmony export */ hitbtc3: () => (/* reexport safe */
|
|
317816
|
-
/* harmony export */ hollaex: () => (/* reexport safe */
|
|
317817
|
-
/* harmony export */ htx: () => (/* reexport safe */
|
|
317818
|
-
/* harmony export */ huobi: () => (/* reexport safe */
|
|
317819
|
-
/* harmony export */ huobijp: () => (/* reexport safe */
|
|
317820
|
-
/* harmony export */ hyperliquid: () => (/* reexport safe */
|
|
317821
|
-
/* harmony export */ idex: () => (/* reexport safe */
|
|
317822
|
-
/* harmony export */ independentreserve: () => (/* reexport safe */
|
|
317823
|
-
/* harmony export */ indodax: () => (/* reexport safe */
|
|
317824
|
-
/* harmony export */ kraken: () => (/* reexport safe */
|
|
317825
|
-
/* harmony export */ krakenfutures: () => (/* reexport safe */
|
|
317826
|
-
/* harmony export */ kucoin: () => (/* reexport safe */
|
|
317827
|
-
/* harmony export */ kucoinfutures: () => (/* reexport safe */
|
|
317828
|
-
/* harmony export */ kuna: () => (/* reexport safe */
|
|
317829
|
-
/* harmony export */ latoken: () => (/* reexport safe */
|
|
317830
|
-
/* harmony export */ lbank: () => (/* reexport safe */
|
|
317831
|
-
/* harmony export */ luno: () => (/* reexport safe */
|
|
317832
|
-
/* harmony export */ lykke: () => (/* reexport safe */
|
|
317833
|
-
/* harmony export */ mercado: () => (/* reexport safe */
|
|
317834
|
-
/* harmony export */ mexc: () => (/* reexport safe */
|
|
317835
|
-
/* harmony export */ ndax: () => (/* reexport safe */
|
|
317836
|
-
/* harmony export */ novadax: () => (/* reexport safe */
|
|
317837
|
-
/* harmony export */ oceanex: () => (/* reexport safe */
|
|
317838
|
-
/* harmony export */ okcoin: () => (/* reexport safe */
|
|
317839
|
-
/* harmony export */ okx: () => (/* reexport safe */
|
|
317840
|
-
/* harmony export */ onetrading: () => (/* reexport safe */
|
|
317841
|
-
/* harmony export */ p2b: () => (/* reexport safe */
|
|
317842
|
-
/* harmony export */ paymium: () => (/* reexport safe */
|
|
317843
|
-
/* harmony export */ phemex: () => (/* reexport safe */
|
|
317844
|
-
/* harmony export */ poloniex: () => (/* reexport safe */
|
|
317845
|
-
/* harmony export */ poloniexfutures: () => (/* reexport safe */
|
|
320619
|
+
/* harmony export */ exmo: () => (/* reexport safe */ _src_exmo_js__WEBPACK_IMPORTED_MODULE_55__.Z),
|
|
320620
|
+
/* harmony export */ fmfwio: () => (/* reexport safe */ _src_fmfwio_js__WEBPACK_IMPORTED_MODULE_56__.Z),
|
|
320621
|
+
/* harmony export */ functions: () => (/* reexport module object */ _src_base_functions_js__WEBPACK_IMPORTED_MODULE_167__),
|
|
320622
|
+
/* harmony export */ gate: () => (/* reexport safe */ _src_gate_js__WEBPACK_IMPORTED_MODULE_57__.Z),
|
|
320623
|
+
/* harmony export */ gateio: () => (/* reexport safe */ _src_gateio_js__WEBPACK_IMPORTED_MODULE_58__.Z),
|
|
320624
|
+
/* harmony export */ gemini: () => (/* reexport safe */ _src_gemini_js__WEBPACK_IMPORTED_MODULE_59__.Z),
|
|
320625
|
+
/* harmony export */ hitbtc: () => (/* reexport safe */ _src_hitbtc_js__WEBPACK_IMPORTED_MODULE_60__.Z),
|
|
320626
|
+
/* harmony export */ hitbtc3: () => (/* reexport safe */ _src_hitbtc3_js__WEBPACK_IMPORTED_MODULE_61__.Z),
|
|
320627
|
+
/* harmony export */ hollaex: () => (/* reexport safe */ _src_hollaex_js__WEBPACK_IMPORTED_MODULE_62__.Z),
|
|
320628
|
+
/* harmony export */ htx: () => (/* reexport safe */ _src_htx_js__WEBPACK_IMPORTED_MODULE_63__.Z),
|
|
320629
|
+
/* harmony export */ huobi: () => (/* reexport safe */ _src_huobi_js__WEBPACK_IMPORTED_MODULE_64__.Z),
|
|
320630
|
+
/* harmony export */ huobijp: () => (/* reexport safe */ _src_huobijp_js__WEBPACK_IMPORTED_MODULE_65__.Z),
|
|
320631
|
+
/* harmony export */ hyperliquid: () => (/* reexport safe */ _src_hyperliquid_js__WEBPACK_IMPORTED_MODULE_66__.Z),
|
|
320632
|
+
/* harmony export */ idex: () => (/* reexport safe */ _src_idex_js__WEBPACK_IMPORTED_MODULE_67__.Z),
|
|
320633
|
+
/* harmony export */ independentreserve: () => (/* reexport safe */ _src_independentreserve_js__WEBPACK_IMPORTED_MODULE_68__.Z),
|
|
320634
|
+
/* harmony export */ indodax: () => (/* reexport safe */ _src_indodax_js__WEBPACK_IMPORTED_MODULE_69__.Z),
|
|
320635
|
+
/* harmony export */ kraken: () => (/* reexport safe */ _src_kraken_js__WEBPACK_IMPORTED_MODULE_70__.Z),
|
|
320636
|
+
/* harmony export */ krakenfutures: () => (/* reexport safe */ _src_krakenfutures_js__WEBPACK_IMPORTED_MODULE_71__.Z),
|
|
320637
|
+
/* harmony export */ kucoin: () => (/* reexport safe */ _src_kucoin_js__WEBPACK_IMPORTED_MODULE_72__.Z),
|
|
320638
|
+
/* harmony export */ kucoinfutures: () => (/* reexport safe */ _src_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_73__.Z),
|
|
320639
|
+
/* harmony export */ kuna: () => (/* reexport safe */ _src_kuna_js__WEBPACK_IMPORTED_MODULE_74__.Z),
|
|
320640
|
+
/* harmony export */ latoken: () => (/* reexport safe */ _src_latoken_js__WEBPACK_IMPORTED_MODULE_75__.Z),
|
|
320641
|
+
/* harmony export */ lbank: () => (/* reexport safe */ _src_lbank_js__WEBPACK_IMPORTED_MODULE_76__.Z),
|
|
320642
|
+
/* harmony export */ luno: () => (/* reexport safe */ _src_luno_js__WEBPACK_IMPORTED_MODULE_77__.Z),
|
|
320643
|
+
/* harmony export */ lykke: () => (/* reexport safe */ _src_lykke_js__WEBPACK_IMPORTED_MODULE_78__.Z),
|
|
320644
|
+
/* harmony export */ mercado: () => (/* reexport safe */ _src_mercado_js__WEBPACK_IMPORTED_MODULE_79__.Z),
|
|
320645
|
+
/* harmony export */ mexc: () => (/* reexport safe */ _src_mexc_js__WEBPACK_IMPORTED_MODULE_80__.Z),
|
|
320646
|
+
/* harmony export */ ndax: () => (/* reexport safe */ _src_ndax_js__WEBPACK_IMPORTED_MODULE_81__.Z),
|
|
320647
|
+
/* harmony export */ novadax: () => (/* reexport safe */ _src_novadax_js__WEBPACK_IMPORTED_MODULE_82__.Z),
|
|
320648
|
+
/* harmony export */ oceanex: () => (/* reexport safe */ _src_oceanex_js__WEBPACK_IMPORTED_MODULE_83__.Z),
|
|
320649
|
+
/* harmony export */ okcoin: () => (/* reexport safe */ _src_okcoin_js__WEBPACK_IMPORTED_MODULE_84__.Z),
|
|
320650
|
+
/* harmony export */ okx: () => (/* reexport safe */ _src_okx_js__WEBPACK_IMPORTED_MODULE_85__.Z),
|
|
320651
|
+
/* harmony export */ onetrading: () => (/* reexport safe */ _src_onetrading_js__WEBPACK_IMPORTED_MODULE_86__.Z),
|
|
320652
|
+
/* harmony export */ p2b: () => (/* reexport safe */ _src_p2b_js__WEBPACK_IMPORTED_MODULE_87__.Z),
|
|
320653
|
+
/* harmony export */ paymium: () => (/* reexport safe */ _src_paymium_js__WEBPACK_IMPORTED_MODULE_88__.Z),
|
|
320654
|
+
/* harmony export */ phemex: () => (/* reexport safe */ _src_phemex_js__WEBPACK_IMPORTED_MODULE_89__.Z),
|
|
320655
|
+
/* harmony export */ poloniex: () => (/* reexport safe */ _src_poloniex_js__WEBPACK_IMPORTED_MODULE_90__.Z),
|
|
320656
|
+
/* harmony export */ poloniexfutures: () => (/* reexport safe */ _src_poloniexfutures_js__WEBPACK_IMPORTED_MODULE_91__.Z),
|
|
317846
320657
|
/* harmony export */ pro: () => (/* binding */ pro),
|
|
317847
|
-
/* harmony export */ probit: () => (/* reexport safe */
|
|
317848
|
-
/* harmony export */ timex: () => (/* reexport safe */
|
|
317849
|
-
/* harmony export */ tokocrypto: () => (/* reexport safe */
|
|
317850
|
-
/* harmony export */ upbit: () => (/* reexport safe */
|
|
320658
|
+
/* harmony export */ probit: () => (/* reexport safe */ _src_probit_js__WEBPACK_IMPORTED_MODULE_92__.Z),
|
|
320659
|
+
/* harmony export */ timex: () => (/* reexport safe */ _src_timex_js__WEBPACK_IMPORTED_MODULE_93__.Z),
|
|
320660
|
+
/* harmony export */ tokocrypto: () => (/* reexport safe */ _src_tokocrypto_js__WEBPACK_IMPORTED_MODULE_94__.Z),
|
|
320661
|
+
/* harmony export */ upbit: () => (/* reexport safe */ _src_upbit_js__WEBPACK_IMPORTED_MODULE_95__.Z),
|
|
317851
320662
|
/* harmony export */ version: () => (/* binding */ version),
|
|
317852
|
-
/* harmony export */ wavesexchange: () => (/* reexport safe */
|
|
317853
|
-
/* harmony export */ wazirx: () => (/* reexport safe */
|
|
317854
|
-
/* harmony export */ whitebit: () => (/* reexport safe */
|
|
317855
|
-
/* harmony export */ woo: () => (/* reexport safe */
|
|
317856
|
-
/* harmony export */ yobit: () => (/* reexport safe */
|
|
317857
|
-
/* harmony export */ zaif: () => (/* reexport safe */
|
|
317858
|
-
/* harmony export */ zonda: () => (/* reexport safe */
|
|
320663
|
+
/* harmony export */ wavesexchange: () => (/* reexport safe */ _src_wavesexchange_js__WEBPACK_IMPORTED_MODULE_96__.Z),
|
|
320664
|
+
/* harmony export */ wazirx: () => (/* reexport safe */ _src_wazirx_js__WEBPACK_IMPORTED_MODULE_97__.Z),
|
|
320665
|
+
/* harmony export */ whitebit: () => (/* reexport safe */ _src_whitebit_js__WEBPACK_IMPORTED_MODULE_98__.Z),
|
|
320666
|
+
/* harmony export */ woo: () => (/* reexport safe */ _src_woo_js__WEBPACK_IMPORTED_MODULE_99__.Z),
|
|
320667
|
+
/* harmony export */ yobit: () => (/* reexport safe */ _src_yobit_js__WEBPACK_IMPORTED_MODULE_100__.Z),
|
|
320668
|
+
/* harmony export */ zaif: () => (/* reexport safe */ _src_zaif_js__WEBPACK_IMPORTED_MODULE_101__.Z),
|
|
320669
|
+
/* harmony export */ zonda: () => (/* reexport safe */ _src_zonda_js__WEBPACK_IMPORTED_MODULE_102__.Z)
|
|
317859
320670
|
/* harmony export */ });
|
|
317860
320671
|
/* harmony import */ var _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3043);
|
|
317861
|
-
/* harmony import */ var
|
|
317862
|
-
/* harmony import */ var
|
|
317863
|
-
/* harmony import */ var
|
|
320672
|
+
/* harmony import */ var _src_base_Precise_js__WEBPACK_IMPORTED_MODULE_166__ = __webpack_require__(2194);
|
|
320673
|
+
/* harmony import */ var _src_base_functions_js__WEBPACK_IMPORTED_MODULE_167__ = __webpack_require__(7100);
|
|
320674
|
+
/* harmony import */ var _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__ = __webpack_require__(6689);
|
|
317864
320675
|
/* harmony import */ var _src_ace_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9869);
|
|
317865
320676
|
/* harmony import */ var _src_alpaca_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5660);
|
|
317866
320677
|
/* harmony import */ var _src_ascendex_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9612);
|
|
@@ -317900,130 +320711,132 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
317900
320711
|
/* harmony import */ var _src_bybit_js__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(3527);
|
|
317901
320712
|
/* harmony import */ var _src_cex_js__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(6445);
|
|
317902
320713
|
/* harmony import */ var _src_coinbase_js__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(437);
|
|
317903
|
-
/* harmony import */ var
|
|
317904
|
-
/* harmony import */ var
|
|
317905
|
-
/* harmony import */ var
|
|
317906
|
-
/* harmony import */ var
|
|
317907
|
-
/* harmony import */ var
|
|
317908
|
-
/* harmony import */ var
|
|
317909
|
-
/* harmony import */ var
|
|
317910
|
-
/* harmony import */ var
|
|
317911
|
-
/* harmony import */ var
|
|
317912
|
-
/* harmony import */ var
|
|
317913
|
-
/* harmony import */ var
|
|
317914
|
-
/* harmony import */ var
|
|
317915
|
-
/* harmony import */ var
|
|
317916
|
-
/* harmony import */ var
|
|
317917
|
-
/* harmony import */ var
|
|
317918
|
-
/* harmony import */ var
|
|
317919
|
-
/* harmony import */ var
|
|
317920
|
-
/* harmony import */ var
|
|
317921
|
-
/* harmony import */ var
|
|
317922
|
-
/* harmony import */ var
|
|
317923
|
-
/* harmony import */ var
|
|
317924
|
-
/* harmony import */ var
|
|
317925
|
-
/* harmony import */ var
|
|
317926
|
-
/* harmony import */ var
|
|
317927
|
-
/* harmony import */ var
|
|
317928
|
-
/* harmony import */ var
|
|
317929
|
-
/* harmony import */ var
|
|
317930
|
-
/* harmony import */ var
|
|
317931
|
-
/* harmony import */ var
|
|
317932
|
-
/* harmony import */ var
|
|
317933
|
-
/* harmony import */ var
|
|
317934
|
-
/* harmony import */ var
|
|
317935
|
-
/* harmony import */ var
|
|
317936
|
-
/* harmony import */ var
|
|
317937
|
-
/* harmony import */ var
|
|
317938
|
-
/* harmony import */ var
|
|
317939
|
-
/* harmony import */ var
|
|
317940
|
-
/* harmony import */ var
|
|
317941
|
-
/* harmony import */ var
|
|
317942
|
-
/* harmony import */ var
|
|
317943
|
-
/* harmony import */ var
|
|
317944
|
-
/* harmony import */ var
|
|
317945
|
-
/* harmony import */ var
|
|
317946
|
-
/* harmony import */ var
|
|
317947
|
-
/* harmony import */ var
|
|
317948
|
-
/* harmony import */ var
|
|
317949
|
-
/* harmony import */ var
|
|
317950
|
-
/* harmony import */ var
|
|
317951
|
-
/* harmony import */ var
|
|
317952
|
-
/* harmony import */ var
|
|
317953
|
-
/* harmony import */ var
|
|
317954
|
-
/* harmony import */ var
|
|
317955
|
-
/* harmony import */ var
|
|
317956
|
-
/* harmony import */ var
|
|
317957
|
-
/* harmony import */ var
|
|
317958
|
-
/* harmony import */ var
|
|
317959
|
-
/* harmony import */ var
|
|
317960
|
-
/* harmony import */ var
|
|
317961
|
-
/* harmony import */ var
|
|
317962
|
-
/* harmony import */ var
|
|
317963
|
-
/* harmony import */ var
|
|
317964
|
-
/* harmony import */ var
|
|
317965
|
-
/* harmony import */ var
|
|
317966
|
-
/* harmony import */ var
|
|
317967
|
-
/* harmony import */ var
|
|
317968
|
-
/* harmony import */ var
|
|
317969
|
-
/* harmony import */ var
|
|
317970
|
-
/* harmony import */ var
|
|
317971
|
-
/* harmony import */ var
|
|
317972
|
-
/* harmony import */ var
|
|
317973
|
-
/* harmony import */ var
|
|
317974
|
-
/* harmony import */ var
|
|
317975
|
-
/* harmony import */ var
|
|
317976
|
-
/* harmony import */ var
|
|
317977
|
-
/* harmony import */ var
|
|
317978
|
-
/* harmony import */ var
|
|
317979
|
-
/* harmony import */ var
|
|
317980
|
-
/* harmony import */ var
|
|
317981
|
-
/* harmony import */ var
|
|
317982
|
-
/* harmony import */ var
|
|
317983
|
-
/* harmony import */ var
|
|
317984
|
-
/* harmony import */ var
|
|
317985
|
-
/* harmony import */ var
|
|
317986
|
-
/* harmony import */ var
|
|
317987
|
-
/* harmony import */ var
|
|
317988
|
-
/* harmony import */ var
|
|
317989
|
-
/* harmony import */ var
|
|
317990
|
-
/* harmony import */ var
|
|
317991
|
-
/* harmony import */ var
|
|
317992
|
-
/* harmony import */ var
|
|
317993
|
-
/* harmony import */ var
|
|
317994
|
-
/* harmony import */ var
|
|
317995
|
-
/* harmony import */ var
|
|
317996
|
-
/* harmony import */ var
|
|
317997
|
-
/* harmony import */ var
|
|
317998
|
-
/* harmony import */ var
|
|
317999
|
-
/* harmony import */ var
|
|
318000
|
-
/* harmony import */ var
|
|
318001
|
-
/* harmony import */ var
|
|
318002
|
-
/* harmony import */ var
|
|
318003
|
-
/* harmony import */ var
|
|
318004
|
-
/* harmony import */ var
|
|
318005
|
-
/* harmony import */ var
|
|
318006
|
-
/* harmony import */ var
|
|
318007
|
-
/* harmony import */ var
|
|
318008
|
-
/* harmony import */ var
|
|
318009
|
-
/* harmony import */ var
|
|
318010
|
-
/* harmony import */ var
|
|
318011
|
-
/* harmony import */ var
|
|
318012
|
-
/* harmony import */ var
|
|
318013
|
-
/* harmony import */ var
|
|
318014
|
-
/* harmony import */ var
|
|
318015
|
-
/* harmony import */ var
|
|
318016
|
-
/* harmony import */ var
|
|
318017
|
-
/* harmony import */ var
|
|
318018
|
-
/* harmony import */ var
|
|
318019
|
-
/* harmony import */ var
|
|
318020
|
-
/* harmony import */ var
|
|
318021
|
-
/* harmony import */ var
|
|
318022
|
-
/* harmony import */ var
|
|
318023
|
-
/* harmony import */ var
|
|
318024
|
-
/* harmony import */ var
|
|
318025
|
-
/* harmony import */ var
|
|
318026
|
-
/* harmony import */ var
|
|
320714
|
+
/* harmony import */ var _src_coinbaseinternational_js__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(9339);
|
|
320715
|
+
/* harmony import */ var _src_coinbasepro_js__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(8856);
|
|
320716
|
+
/* harmony import */ var _src_coincheck_js__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(2117);
|
|
320717
|
+
/* harmony import */ var _src_coinex_js__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(332);
|
|
320718
|
+
/* harmony import */ var _src_coinlist_js__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(3623);
|
|
320719
|
+
/* harmony import */ var _src_coinmate_js__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(9816);
|
|
320720
|
+
/* harmony import */ var _src_coinmetro_js__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(4759);
|
|
320721
|
+
/* harmony import */ var _src_coinone_js__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(7811);
|
|
320722
|
+
/* harmony import */ var _src_coinsph_js__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(5782);
|
|
320723
|
+
/* harmony import */ var _src_coinspot_js__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(7794);
|
|
320724
|
+
/* harmony import */ var _src_cryptocom_js__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(9129);
|
|
320725
|
+
/* harmony import */ var _src_currencycom_js__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(3214);
|
|
320726
|
+
/* harmony import */ var _src_delta_js__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(1753);
|
|
320727
|
+
/* harmony import */ var _src_deribit_js__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(24);
|
|
320728
|
+
/* harmony import */ var _src_digifinex_js__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(8846);
|
|
320729
|
+
/* harmony import */ var _src_exmo_js__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(1729);
|
|
320730
|
+
/* harmony import */ var _src_fmfwio_js__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(5788);
|
|
320731
|
+
/* harmony import */ var _src_gate_js__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(7290);
|
|
320732
|
+
/* harmony import */ var _src_gateio_js__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(7036);
|
|
320733
|
+
/* harmony import */ var _src_gemini_js__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(6743);
|
|
320734
|
+
/* harmony import */ var _src_hitbtc_js__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(4714);
|
|
320735
|
+
/* harmony import */ var _src_hitbtc3_js__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(4815);
|
|
320736
|
+
/* harmony import */ var _src_hollaex_js__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(8422);
|
|
320737
|
+
/* harmony import */ var _src_htx_js__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(5939);
|
|
320738
|
+
/* harmony import */ var _src_huobi_js__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(8146);
|
|
320739
|
+
/* harmony import */ var _src_huobijp_js__WEBPACK_IMPORTED_MODULE_65__ = __webpack_require__(7034);
|
|
320740
|
+
/* harmony import */ var _src_hyperliquid_js__WEBPACK_IMPORTED_MODULE_66__ = __webpack_require__(5959);
|
|
320741
|
+
/* harmony import */ var _src_idex_js__WEBPACK_IMPORTED_MODULE_67__ = __webpack_require__(8232);
|
|
320742
|
+
/* harmony import */ var _src_independentreserve_js__WEBPACK_IMPORTED_MODULE_68__ = __webpack_require__(9570);
|
|
320743
|
+
/* harmony import */ var _src_indodax_js__WEBPACK_IMPORTED_MODULE_69__ = __webpack_require__(1605);
|
|
320744
|
+
/* harmony import */ var _src_kraken_js__WEBPACK_IMPORTED_MODULE_70__ = __webpack_require__(9922);
|
|
320745
|
+
/* harmony import */ var _src_krakenfutures_js__WEBPACK_IMPORTED_MODULE_71__ = __webpack_require__(4470);
|
|
320746
|
+
/* harmony import */ var _src_kucoin_js__WEBPACK_IMPORTED_MODULE_72__ = __webpack_require__(3583);
|
|
320747
|
+
/* harmony import */ var _src_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_73__ = __webpack_require__(1924);
|
|
320748
|
+
/* harmony import */ var _src_kuna_js__WEBPACK_IMPORTED_MODULE_74__ = __webpack_require__(7732);
|
|
320749
|
+
/* harmony import */ var _src_latoken_js__WEBPACK_IMPORTED_MODULE_75__ = __webpack_require__(2545);
|
|
320750
|
+
/* harmony import */ var _src_lbank_js__WEBPACK_IMPORTED_MODULE_76__ = __webpack_require__(3944);
|
|
320751
|
+
/* harmony import */ var _src_luno_js__WEBPACK_IMPORTED_MODULE_77__ = __webpack_require__(1758);
|
|
320752
|
+
/* harmony import */ var _src_lykke_js__WEBPACK_IMPORTED_MODULE_78__ = __webpack_require__(3803);
|
|
320753
|
+
/* harmony import */ var _src_mercado_js__WEBPACK_IMPORTED_MODULE_79__ = __webpack_require__(9013);
|
|
320754
|
+
/* harmony import */ var _src_mexc_js__WEBPACK_IMPORTED_MODULE_80__ = __webpack_require__(6641);
|
|
320755
|
+
/* harmony import */ var _src_ndax_js__WEBPACK_IMPORTED_MODULE_81__ = __webpack_require__(4531);
|
|
320756
|
+
/* harmony import */ var _src_novadax_js__WEBPACK_IMPORTED_MODULE_82__ = __webpack_require__(2449);
|
|
320757
|
+
/* harmony import */ var _src_oceanex_js__WEBPACK_IMPORTED_MODULE_83__ = __webpack_require__(6749);
|
|
320758
|
+
/* harmony import */ var _src_okcoin_js__WEBPACK_IMPORTED_MODULE_84__ = __webpack_require__(3007);
|
|
320759
|
+
/* harmony import */ var _src_okx_js__WEBPACK_IMPORTED_MODULE_85__ = __webpack_require__(4042);
|
|
320760
|
+
/* harmony import */ var _src_onetrading_js__WEBPACK_IMPORTED_MODULE_86__ = __webpack_require__(6481);
|
|
320761
|
+
/* harmony import */ var _src_p2b_js__WEBPACK_IMPORTED_MODULE_87__ = __webpack_require__(2466);
|
|
320762
|
+
/* harmony import */ var _src_paymium_js__WEBPACK_IMPORTED_MODULE_88__ = __webpack_require__(7082);
|
|
320763
|
+
/* harmony import */ var _src_phemex_js__WEBPACK_IMPORTED_MODULE_89__ = __webpack_require__(79);
|
|
320764
|
+
/* harmony import */ var _src_poloniex_js__WEBPACK_IMPORTED_MODULE_90__ = __webpack_require__(8891);
|
|
320765
|
+
/* harmony import */ var _src_poloniexfutures_js__WEBPACK_IMPORTED_MODULE_91__ = __webpack_require__(6877);
|
|
320766
|
+
/* harmony import */ var _src_probit_js__WEBPACK_IMPORTED_MODULE_92__ = __webpack_require__(3657);
|
|
320767
|
+
/* harmony import */ var _src_timex_js__WEBPACK_IMPORTED_MODULE_93__ = __webpack_require__(1067);
|
|
320768
|
+
/* harmony import */ var _src_tokocrypto_js__WEBPACK_IMPORTED_MODULE_94__ = __webpack_require__(5261);
|
|
320769
|
+
/* harmony import */ var _src_upbit_js__WEBPACK_IMPORTED_MODULE_95__ = __webpack_require__(7584);
|
|
320770
|
+
/* harmony import */ var _src_wavesexchange_js__WEBPACK_IMPORTED_MODULE_96__ = __webpack_require__(3853);
|
|
320771
|
+
/* harmony import */ var _src_wazirx_js__WEBPACK_IMPORTED_MODULE_97__ = __webpack_require__(6536);
|
|
320772
|
+
/* harmony import */ var _src_whitebit_js__WEBPACK_IMPORTED_MODULE_98__ = __webpack_require__(5467);
|
|
320773
|
+
/* harmony import */ var _src_woo_js__WEBPACK_IMPORTED_MODULE_99__ = __webpack_require__(517);
|
|
320774
|
+
/* harmony import */ var _src_yobit_js__WEBPACK_IMPORTED_MODULE_100__ = __webpack_require__(3850);
|
|
320775
|
+
/* harmony import */ var _src_zaif_js__WEBPACK_IMPORTED_MODULE_101__ = __webpack_require__(5934);
|
|
320776
|
+
/* harmony import */ var _src_zonda_js__WEBPACK_IMPORTED_MODULE_102__ = __webpack_require__(5140);
|
|
320777
|
+
/* harmony import */ var _src_pro_alpaca_js__WEBPACK_IMPORTED_MODULE_103__ = __webpack_require__(2467);
|
|
320778
|
+
/* harmony import */ var _src_pro_ascendex_js__WEBPACK_IMPORTED_MODULE_104__ = __webpack_require__(2383);
|
|
320779
|
+
/* harmony import */ var _src_pro_bequant_js__WEBPACK_IMPORTED_MODULE_105__ = __webpack_require__(8848);
|
|
320780
|
+
/* harmony import */ var _src_pro_binance_js__WEBPACK_IMPORTED_MODULE_106__ = __webpack_require__(8764);
|
|
320781
|
+
/* harmony import */ var _src_pro_binancecoinm_js__WEBPACK_IMPORTED_MODULE_107__ = __webpack_require__(5078);
|
|
320782
|
+
/* harmony import */ var _src_pro_binanceus_js__WEBPACK_IMPORTED_MODULE_108__ = __webpack_require__(1326);
|
|
320783
|
+
/* harmony import */ var _src_pro_binanceusdm_js__WEBPACK_IMPORTED_MODULE_109__ = __webpack_require__(1230);
|
|
320784
|
+
/* harmony import */ var _src_pro_bingx_js__WEBPACK_IMPORTED_MODULE_110__ = __webpack_require__(6955);
|
|
320785
|
+
/* harmony import */ var _src_pro_bitcoincom_js__WEBPACK_IMPORTED_MODULE_111__ = __webpack_require__(453);
|
|
320786
|
+
/* harmony import */ var _src_pro_bitfinex_js__WEBPACK_IMPORTED_MODULE_112__ = __webpack_require__(9772);
|
|
320787
|
+
/* harmony import */ var _src_pro_bitfinex2_js__WEBPACK_IMPORTED_MODULE_113__ = __webpack_require__(588);
|
|
320788
|
+
/* harmony import */ var _src_pro_bitget_js__WEBPACK_IMPORTED_MODULE_114__ = __webpack_require__(1885);
|
|
320789
|
+
/* harmony import */ var _src_pro_bitmart_js__WEBPACK_IMPORTED_MODULE_115__ = __webpack_require__(7504);
|
|
320790
|
+
/* harmony import */ var _src_pro_bitmex_js__WEBPACK_IMPORTED_MODULE_116__ = __webpack_require__(2302);
|
|
320791
|
+
/* harmony import */ var _src_pro_bitopro_js__WEBPACK_IMPORTED_MODULE_117__ = __webpack_require__(2191);
|
|
320792
|
+
/* harmony import */ var _src_pro_bitpanda_js__WEBPACK_IMPORTED_MODULE_118__ = __webpack_require__(1297);
|
|
320793
|
+
/* harmony import */ var _src_pro_bitrue_js__WEBPACK_IMPORTED_MODULE_119__ = __webpack_require__(3005);
|
|
320794
|
+
/* harmony import */ var _src_pro_bitstamp_js__WEBPACK_IMPORTED_MODULE_120__ = __webpack_require__(2317);
|
|
320795
|
+
/* harmony import */ var _src_pro_bitvavo_js__WEBPACK_IMPORTED_MODULE_121__ = __webpack_require__(6977);
|
|
320796
|
+
/* harmony import */ var _src_pro_blockchaincom_js__WEBPACK_IMPORTED_MODULE_122__ = __webpack_require__(2519);
|
|
320797
|
+
/* harmony import */ var _src_pro_bybit_js__WEBPACK_IMPORTED_MODULE_123__ = __webpack_require__(5030);
|
|
320798
|
+
/* harmony import */ var _src_pro_cex_js__WEBPACK_IMPORTED_MODULE_124__ = __webpack_require__(5272);
|
|
320799
|
+
/* harmony import */ var _src_pro_coinbase_js__WEBPACK_IMPORTED_MODULE_125__ = __webpack_require__(3414);
|
|
320800
|
+
/* harmony import */ var _src_pro_coinbaseinternational_js__WEBPACK_IMPORTED_MODULE_126__ = __webpack_require__(6541);
|
|
320801
|
+
/* harmony import */ var _src_pro_coinbasepro_js__WEBPACK_IMPORTED_MODULE_127__ = __webpack_require__(8368);
|
|
320802
|
+
/* harmony import */ var _src_pro_coincheck_js__WEBPACK_IMPORTED_MODULE_128__ = __webpack_require__(7891);
|
|
320803
|
+
/* harmony import */ var _src_pro_coinex_js__WEBPACK_IMPORTED_MODULE_129__ = __webpack_require__(204);
|
|
320804
|
+
/* harmony import */ var _src_pro_coinone_js__WEBPACK_IMPORTED_MODULE_130__ = __webpack_require__(5208);
|
|
320805
|
+
/* harmony import */ var _src_pro_cryptocom_js__WEBPACK_IMPORTED_MODULE_131__ = __webpack_require__(6820);
|
|
320806
|
+
/* harmony import */ var _src_pro_currencycom_js__WEBPACK_IMPORTED_MODULE_132__ = __webpack_require__(2952);
|
|
320807
|
+
/* harmony import */ var _src_pro_deribit_js__WEBPACK_IMPORTED_MODULE_133__ = __webpack_require__(1788);
|
|
320808
|
+
/* harmony import */ var _src_pro_exmo_js__WEBPACK_IMPORTED_MODULE_134__ = __webpack_require__(9004);
|
|
320809
|
+
/* harmony import */ var _src_pro_gate_js__WEBPACK_IMPORTED_MODULE_135__ = __webpack_require__(8335);
|
|
320810
|
+
/* harmony import */ var _src_pro_gateio_js__WEBPACK_IMPORTED_MODULE_136__ = __webpack_require__(1465);
|
|
320811
|
+
/* harmony import */ var _src_pro_gemini_js__WEBPACK_IMPORTED_MODULE_137__ = __webpack_require__(9488);
|
|
320812
|
+
/* harmony import */ var _src_pro_hitbtc_js__WEBPACK_IMPORTED_MODULE_138__ = __webpack_require__(5189);
|
|
320813
|
+
/* harmony import */ var _src_pro_hollaex_js__WEBPACK_IMPORTED_MODULE_139__ = __webpack_require__(8559);
|
|
320814
|
+
/* harmony import */ var _src_pro_htx_js__WEBPACK_IMPORTED_MODULE_140__ = __webpack_require__(7474);
|
|
320815
|
+
/* harmony import */ var _src_pro_huobi_js__WEBPACK_IMPORTED_MODULE_141__ = __webpack_require__(8384);
|
|
320816
|
+
/* harmony import */ var _src_pro_huobijp_js__WEBPACK_IMPORTED_MODULE_142__ = __webpack_require__(9021);
|
|
320817
|
+
/* harmony import */ var _src_pro_hyperliquid_js__WEBPACK_IMPORTED_MODULE_143__ = __webpack_require__(8354);
|
|
320818
|
+
/* harmony import */ var _src_pro_idex_js__WEBPACK_IMPORTED_MODULE_144__ = __webpack_require__(3484);
|
|
320819
|
+
/* harmony import */ var _src_pro_independentreserve_js__WEBPACK_IMPORTED_MODULE_145__ = __webpack_require__(1311);
|
|
320820
|
+
/* harmony import */ var _src_pro_kraken_js__WEBPACK_IMPORTED_MODULE_146__ = __webpack_require__(736);
|
|
320821
|
+
/* harmony import */ var _src_pro_krakenfutures_js__WEBPACK_IMPORTED_MODULE_147__ = __webpack_require__(449);
|
|
320822
|
+
/* harmony import */ var _src_pro_kucoin_js__WEBPACK_IMPORTED_MODULE_148__ = __webpack_require__(2387);
|
|
320823
|
+
/* harmony import */ var _src_pro_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_149__ = __webpack_require__(7181);
|
|
320824
|
+
/* harmony import */ var _src_pro_lbank_js__WEBPACK_IMPORTED_MODULE_150__ = __webpack_require__(1267);
|
|
320825
|
+
/* harmony import */ var _src_pro_luno_js__WEBPACK_IMPORTED_MODULE_151__ = __webpack_require__(627);
|
|
320826
|
+
/* harmony import */ var _src_pro_mexc_js__WEBPACK_IMPORTED_MODULE_152__ = __webpack_require__(6484);
|
|
320827
|
+
/* harmony import */ var _src_pro_ndax_js__WEBPACK_IMPORTED_MODULE_153__ = __webpack_require__(8080);
|
|
320828
|
+
/* harmony import */ var _src_pro_okcoin_js__WEBPACK_IMPORTED_MODULE_154__ = __webpack_require__(7105);
|
|
320829
|
+
/* harmony import */ var _src_pro_okx_js__WEBPACK_IMPORTED_MODULE_155__ = __webpack_require__(2214);
|
|
320830
|
+
/* harmony import */ var _src_pro_onetrading_js__WEBPACK_IMPORTED_MODULE_156__ = __webpack_require__(9419);
|
|
320831
|
+
/* harmony import */ var _src_pro_p2b_js__WEBPACK_IMPORTED_MODULE_157__ = __webpack_require__(8516);
|
|
320832
|
+
/* harmony import */ var _src_pro_phemex_js__WEBPACK_IMPORTED_MODULE_158__ = __webpack_require__(4360);
|
|
320833
|
+
/* harmony import */ var _src_pro_poloniex_js__WEBPACK_IMPORTED_MODULE_159__ = __webpack_require__(7924);
|
|
320834
|
+
/* harmony import */ var _src_pro_poloniexfutures_js__WEBPACK_IMPORTED_MODULE_160__ = __webpack_require__(3541);
|
|
320835
|
+
/* harmony import */ var _src_pro_probit_js__WEBPACK_IMPORTED_MODULE_161__ = __webpack_require__(9782);
|
|
320836
|
+
/* harmony import */ var _src_pro_upbit_js__WEBPACK_IMPORTED_MODULE_162__ = __webpack_require__(7614);
|
|
320837
|
+
/* harmony import */ var _src_pro_wazirx_js__WEBPACK_IMPORTED_MODULE_163__ = __webpack_require__(4828);
|
|
320838
|
+
/* harmony import */ var _src_pro_whitebit_js__WEBPACK_IMPORTED_MODULE_164__ = __webpack_require__(5630);
|
|
320839
|
+
/* harmony import */ var _src_pro_woo_js__WEBPACK_IMPORTED_MODULE_165__ = __webpack_require__(3910);
|
|
318027
320840
|
/*
|
|
318028
320841
|
|
|
318029
320842
|
MIT License
|
|
@@ -318058,7 +320871,7 @@ SOFTWARE.
|
|
|
318058
320871
|
|
|
318059
320872
|
//-----------------------------------------------------------------------------
|
|
318060
320873
|
// this is updated by vss.js when building
|
|
318061
|
-
const version = '4.2.
|
|
320874
|
+
const version = '4.2.74';
|
|
318062
320875
|
_src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e.ccxtVersion = version;
|
|
318063
320876
|
//-----------------------------------------------------------------------------
|
|
318064
320877
|
|
|
@@ -318160,6 +320973,7 @@ _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e.ccxtVersion
|
|
|
318160
320973
|
|
|
318161
320974
|
|
|
318162
320975
|
|
|
320976
|
+
|
|
318163
320977
|
|
|
318164
320978
|
|
|
318165
320979
|
// pro exchanges
|
|
@@ -318223,6 +321037,7 @@ _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e.ccxtVersion
|
|
|
318223
321037
|
|
|
318224
321038
|
|
|
318225
321039
|
|
|
321040
|
+
|
|
318226
321041
|
|
|
318227
321042
|
|
|
318228
321043
|
const exchanges = {
|
|
@@ -318265,132 +321080,134 @@ const exchanges = {
|
|
|
318265
321080
|
'bybit': _src_bybit_js__WEBPACK_IMPORTED_MODULE_37__/* ["default"] */ .Z,
|
|
318266
321081
|
'cex': _src_cex_js__WEBPACK_IMPORTED_MODULE_38__/* ["default"] */ .Z,
|
|
318267
321082
|
'coinbase': _src_coinbase_js__WEBPACK_IMPORTED_MODULE_39__/* ["default"] */ .Z,
|
|
318268
|
-
'
|
|
318269
|
-
'
|
|
318270
|
-
'
|
|
318271
|
-
'
|
|
318272
|
-
'
|
|
318273
|
-
'
|
|
318274
|
-
'
|
|
318275
|
-
'
|
|
318276
|
-
'
|
|
318277
|
-
'
|
|
318278
|
-
'
|
|
318279
|
-
'
|
|
318280
|
-
'
|
|
318281
|
-
'
|
|
318282
|
-
'
|
|
318283
|
-
'
|
|
318284
|
-
'
|
|
318285
|
-
'
|
|
318286
|
-
'
|
|
318287
|
-
'
|
|
318288
|
-
'
|
|
318289
|
-
'
|
|
318290
|
-
'
|
|
318291
|
-
'
|
|
318292
|
-
'
|
|
318293
|
-
'
|
|
318294
|
-
'
|
|
318295
|
-
'
|
|
318296
|
-
'
|
|
318297
|
-
'
|
|
318298
|
-
'
|
|
318299
|
-
'
|
|
318300
|
-
'
|
|
318301
|
-
'
|
|
318302
|
-
'
|
|
318303
|
-
'
|
|
318304
|
-
'
|
|
318305
|
-
'
|
|
318306
|
-
'
|
|
318307
|
-
'
|
|
318308
|
-
'
|
|
318309
|
-
'
|
|
318310
|
-
'
|
|
318311
|
-
'
|
|
318312
|
-
'
|
|
318313
|
-
'
|
|
318314
|
-
'
|
|
318315
|
-
'
|
|
318316
|
-
'
|
|
318317
|
-
'
|
|
318318
|
-
'
|
|
318319
|
-
'
|
|
318320
|
-
'
|
|
318321
|
-
'
|
|
318322
|
-
'
|
|
318323
|
-
'
|
|
318324
|
-
'
|
|
318325
|
-
'
|
|
318326
|
-
'
|
|
318327
|
-
'
|
|
318328
|
-
'
|
|
318329
|
-
'
|
|
321083
|
+
'coinbaseinternational': _src_coinbaseinternational_js__WEBPACK_IMPORTED_MODULE_40__/* ["default"] */ .Z,
|
|
321084
|
+
'coinbasepro': _src_coinbasepro_js__WEBPACK_IMPORTED_MODULE_41__/* ["default"] */ .Z,
|
|
321085
|
+
'coincheck': _src_coincheck_js__WEBPACK_IMPORTED_MODULE_42__/* ["default"] */ .Z,
|
|
321086
|
+
'coinex': _src_coinex_js__WEBPACK_IMPORTED_MODULE_43__/* ["default"] */ .Z,
|
|
321087
|
+
'coinlist': _src_coinlist_js__WEBPACK_IMPORTED_MODULE_44__/* ["default"] */ .Z,
|
|
321088
|
+
'coinmate': _src_coinmate_js__WEBPACK_IMPORTED_MODULE_45__/* ["default"] */ .Z,
|
|
321089
|
+
'coinmetro': _src_coinmetro_js__WEBPACK_IMPORTED_MODULE_46__/* ["default"] */ .Z,
|
|
321090
|
+
'coinone': _src_coinone_js__WEBPACK_IMPORTED_MODULE_47__/* ["default"] */ .Z,
|
|
321091
|
+
'coinsph': _src_coinsph_js__WEBPACK_IMPORTED_MODULE_48__/* ["default"] */ .Z,
|
|
321092
|
+
'coinspot': _src_coinspot_js__WEBPACK_IMPORTED_MODULE_49__/* ["default"] */ .Z,
|
|
321093
|
+
'cryptocom': _src_cryptocom_js__WEBPACK_IMPORTED_MODULE_50__/* ["default"] */ .Z,
|
|
321094
|
+
'currencycom': _src_currencycom_js__WEBPACK_IMPORTED_MODULE_51__/* ["default"] */ .Z,
|
|
321095
|
+
'delta': _src_delta_js__WEBPACK_IMPORTED_MODULE_52__/* ["default"] */ .Z,
|
|
321096
|
+
'deribit': _src_deribit_js__WEBPACK_IMPORTED_MODULE_53__/* ["default"] */ .Z,
|
|
321097
|
+
'digifinex': _src_digifinex_js__WEBPACK_IMPORTED_MODULE_54__/* ["default"] */ .Z,
|
|
321098
|
+
'exmo': _src_exmo_js__WEBPACK_IMPORTED_MODULE_55__/* ["default"] */ .Z,
|
|
321099
|
+
'fmfwio': _src_fmfwio_js__WEBPACK_IMPORTED_MODULE_56__/* ["default"] */ .Z,
|
|
321100
|
+
'gate': _src_gate_js__WEBPACK_IMPORTED_MODULE_57__/* ["default"] */ .Z,
|
|
321101
|
+
'gateio': _src_gateio_js__WEBPACK_IMPORTED_MODULE_58__/* ["default"] */ .Z,
|
|
321102
|
+
'gemini': _src_gemini_js__WEBPACK_IMPORTED_MODULE_59__/* ["default"] */ .Z,
|
|
321103
|
+
'hitbtc': _src_hitbtc_js__WEBPACK_IMPORTED_MODULE_60__/* ["default"] */ .Z,
|
|
321104
|
+
'hitbtc3': _src_hitbtc3_js__WEBPACK_IMPORTED_MODULE_61__/* ["default"] */ .Z,
|
|
321105
|
+
'hollaex': _src_hollaex_js__WEBPACK_IMPORTED_MODULE_62__/* ["default"] */ .Z,
|
|
321106
|
+
'htx': _src_htx_js__WEBPACK_IMPORTED_MODULE_63__/* ["default"] */ .Z,
|
|
321107
|
+
'huobi': _src_huobi_js__WEBPACK_IMPORTED_MODULE_64__/* ["default"] */ .Z,
|
|
321108
|
+
'huobijp': _src_huobijp_js__WEBPACK_IMPORTED_MODULE_65__/* ["default"] */ .Z,
|
|
321109
|
+
'hyperliquid': _src_hyperliquid_js__WEBPACK_IMPORTED_MODULE_66__/* ["default"] */ .Z,
|
|
321110
|
+
'idex': _src_idex_js__WEBPACK_IMPORTED_MODULE_67__/* ["default"] */ .Z,
|
|
321111
|
+
'independentreserve': _src_independentreserve_js__WEBPACK_IMPORTED_MODULE_68__/* ["default"] */ .Z,
|
|
321112
|
+
'indodax': _src_indodax_js__WEBPACK_IMPORTED_MODULE_69__/* ["default"] */ .Z,
|
|
321113
|
+
'kraken': _src_kraken_js__WEBPACK_IMPORTED_MODULE_70__/* ["default"] */ .Z,
|
|
321114
|
+
'krakenfutures': _src_krakenfutures_js__WEBPACK_IMPORTED_MODULE_71__/* ["default"] */ .Z,
|
|
321115
|
+
'kucoin': _src_kucoin_js__WEBPACK_IMPORTED_MODULE_72__/* ["default"] */ .Z,
|
|
321116
|
+
'kucoinfutures': _src_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_73__/* ["default"] */ .Z,
|
|
321117
|
+
'kuna': _src_kuna_js__WEBPACK_IMPORTED_MODULE_74__/* ["default"] */ .Z,
|
|
321118
|
+
'latoken': _src_latoken_js__WEBPACK_IMPORTED_MODULE_75__/* ["default"] */ .Z,
|
|
321119
|
+
'lbank': _src_lbank_js__WEBPACK_IMPORTED_MODULE_76__/* ["default"] */ .Z,
|
|
321120
|
+
'luno': _src_luno_js__WEBPACK_IMPORTED_MODULE_77__/* ["default"] */ .Z,
|
|
321121
|
+
'lykke': _src_lykke_js__WEBPACK_IMPORTED_MODULE_78__/* ["default"] */ .Z,
|
|
321122
|
+
'mercado': _src_mercado_js__WEBPACK_IMPORTED_MODULE_79__/* ["default"] */ .Z,
|
|
321123
|
+
'mexc': _src_mexc_js__WEBPACK_IMPORTED_MODULE_80__/* ["default"] */ .Z,
|
|
321124
|
+
'ndax': _src_ndax_js__WEBPACK_IMPORTED_MODULE_81__/* ["default"] */ .Z,
|
|
321125
|
+
'novadax': _src_novadax_js__WEBPACK_IMPORTED_MODULE_82__/* ["default"] */ .Z,
|
|
321126
|
+
'oceanex': _src_oceanex_js__WEBPACK_IMPORTED_MODULE_83__/* ["default"] */ .Z,
|
|
321127
|
+
'okcoin': _src_okcoin_js__WEBPACK_IMPORTED_MODULE_84__/* ["default"] */ .Z,
|
|
321128
|
+
'okx': _src_okx_js__WEBPACK_IMPORTED_MODULE_85__/* ["default"] */ .Z,
|
|
321129
|
+
'onetrading': _src_onetrading_js__WEBPACK_IMPORTED_MODULE_86__/* ["default"] */ .Z,
|
|
321130
|
+
'p2b': _src_p2b_js__WEBPACK_IMPORTED_MODULE_87__/* ["default"] */ .Z,
|
|
321131
|
+
'paymium': _src_paymium_js__WEBPACK_IMPORTED_MODULE_88__/* ["default"] */ .Z,
|
|
321132
|
+
'phemex': _src_phemex_js__WEBPACK_IMPORTED_MODULE_89__/* ["default"] */ .Z,
|
|
321133
|
+
'poloniex': _src_poloniex_js__WEBPACK_IMPORTED_MODULE_90__/* ["default"] */ .Z,
|
|
321134
|
+
'poloniexfutures': _src_poloniexfutures_js__WEBPACK_IMPORTED_MODULE_91__/* ["default"] */ .Z,
|
|
321135
|
+
'probit': _src_probit_js__WEBPACK_IMPORTED_MODULE_92__/* ["default"] */ .Z,
|
|
321136
|
+
'timex': _src_timex_js__WEBPACK_IMPORTED_MODULE_93__/* ["default"] */ .Z,
|
|
321137
|
+
'tokocrypto': _src_tokocrypto_js__WEBPACK_IMPORTED_MODULE_94__/* ["default"] */ .Z,
|
|
321138
|
+
'upbit': _src_upbit_js__WEBPACK_IMPORTED_MODULE_95__/* ["default"] */ .Z,
|
|
321139
|
+
'wavesexchange': _src_wavesexchange_js__WEBPACK_IMPORTED_MODULE_96__/* ["default"] */ .Z,
|
|
321140
|
+
'wazirx': _src_wazirx_js__WEBPACK_IMPORTED_MODULE_97__/* ["default"] */ .Z,
|
|
321141
|
+
'whitebit': _src_whitebit_js__WEBPACK_IMPORTED_MODULE_98__/* ["default"] */ .Z,
|
|
321142
|
+
'woo': _src_woo_js__WEBPACK_IMPORTED_MODULE_99__/* ["default"] */ .Z,
|
|
321143
|
+
'yobit': _src_yobit_js__WEBPACK_IMPORTED_MODULE_100__/* ["default"] */ .Z,
|
|
321144
|
+
'zaif': _src_zaif_js__WEBPACK_IMPORTED_MODULE_101__/* ["default"] */ .Z,
|
|
321145
|
+
'zonda': _src_zonda_js__WEBPACK_IMPORTED_MODULE_102__/* ["default"] */ .Z,
|
|
318330
321146
|
};
|
|
318331
321147
|
const pro = {
|
|
318332
|
-
'alpaca':
|
|
318333
|
-
'ascendex':
|
|
318334
|
-
'bequant':
|
|
318335
|
-
'binance':
|
|
318336
|
-
'binancecoinm':
|
|
318337
|
-
'binanceus':
|
|
318338
|
-
'binanceusdm':
|
|
318339
|
-
'bingx':
|
|
318340
|
-
'bitcoincom':
|
|
318341
|
-
'bitfinex':
|
|
318342
|
-
'bitfinex2':
|
|
318343
|
-
'bitget':
|
|
318344
|
-
'bitmart':
|
|
318345
|
-
'bitmex':
|
|
318346
|
-
'bitopro':
|
|
318347
|
-
'bitpanda':
|
|
318348
|
-
'bitrue':
|
|
318349
|
-
'bitstamp':
|
|
318350
|
-
'bitvavo':
|
|
318351
|
-
'blockchaincom':
|
|
318352
|
-
'bybit':
|
|
318353
|
-
'cex':
|
|
318354
|
-
'coinbase':
|
|
318355
|
-
'
|
|
318356
|
-
'
|
|
318357
|
-
'
|
|
318358
|
-
'
|
|
318359
|
-
'
|
|
318360
|
-
'
|
|
318361
|
-
'
|
|
318362
|
-
'
|
|
318363
|
-
'
|
|
318364
|
-
'
|
|
318365
|
-
'
|
|
318366
|
-
'
|
|
318367
|
-
'
|
|
318368
|
-
'
|
|
318369
|
-
'
|
|
318370
|
-
'
|
|
318371
|
-
'
|
|
318372
|
-
'
|
|
318373
|
-
'
|
|
318374
|
-
'
|
|
318375
|
-
'
|
|
318376
|
-
'
|
|
318377
|
-
'
|
|
318378
|
-
'
|
|
318379
|
-
'
|
|
318380
|
-
'
|
|
318381
|
-
'
|
|
318382
|
-
'
|
|
318383
|
-
'
|
|
318384
|
-
'
|
|
318385
|
-
'
|
|
318386
|
-
'
|
|
318387
|
-
'
|
|
318388
|
-
'
|
|
318389
|
-
'
|
|
318390
|
-
'
|
|
318391
|
-
'
|
|
318392
|
-
'
|
|
318393
|
-
'
|
|
321148
|
+
'alpaca': _src_pro_alpaca_js__WEBPACK_IMPORTED_MODULE_103__/* ["default"] */ .Z,
|
|
321149
|
+
'ascendex': _src_pro_ascendex_js__WEBPACK_IMPORTED_MODULE_104__/* ["default"] */ .Z,
|
|
321150
|
+
'bequant': _src_pro_bequant_js__WEBPACK_IMPORTED_MODULE_105__/* ["default"] */ .Z,
|
|
321151
|
+
'binance': _src_pro_binance_js__WEBPACK_IMPORTED_MODULE_106__/* ["default"] */ .Z,
|
|
321152
|
+
'binancecoinm': _src_pro_binancecoinm_js__WEBPACK_IMPORTED_MODULE_107__/* ["default"] */ .Z,
|
|
321153
|
+
'binanceus': _src_pro_binanceus_js__WEBPACK_IMPORTED_MODULE_108__/* ["default"] */ .Z,
|
|
321154
|
+
'binanceusdm': _src_pro_binanceusdm_js__WEBPACK_IMPORTED_MODULE_109__/* ["default"] */ .Z,
|
|
321155
|
+
'bingx': _src_pro_bingx_js__WEBPACK_IMPORTED_MODULE_110__/* ["default"] */ .Z,
|
|
321156
|
+
'bitcoincom': _src_pro_bitcoincom_js__WEBPACK_IMPORTED_MODULE_111__/* ["default"] */ .Z,
|
|
321157
|
+
'bitfinex': _src_pro_bitfinex_js__WEBPACK_IMPORTED_MODULE_112__/* ["default"] */ .Z,
|
|
321158
|
+
'bitfinex2': _src_pro_bitfinex2_js__WEBPACK_IMPORTED_MODULE_113__/* ["default"] */ .Z,
|
|
321159
|
+
'bitget': _src_pro_bitget_js__WEBPACK_IMPORTED_MODULE_114__/* ["default"] */ .Z,
|
|
321160
|
+
'bitmart': _src_pro_bitmart_js__WEBPACK_IMPORTED_MODULE_115__/* ["default"] */ .Z,
|
|
321161
|
+
'bitmex': _src_pro_bitmex_js__WEBPACK_IMPORTED_MODULE_116__/* ["default"] */ .Z,
|
|
321162
|
+
'bitopro': _src_pro_bitopro_js__WEBPACK_IMPORTED_MODULE_117__/* ["default"] */ .Z,
|
|
321163
|
+
'bitpanda': _src_pro_bitpanda_js__WEBPACK_IMPORTED_MODULE_118__/* ["default"] */ .Z,
|
|
321164
|
+
'bitrue': _src_pro_bitrue_js__WEBPACK_IMPORTED_MODULE_119__/* ["default"] */ .Z,
|
|
321165
|
+
'bitstamp': _src_pro_bitstamp_js__WEBPACK_IMPORTED_MODULE_120__/* ["default"] */ .Z,
|
|
321166
|
+
'bitvavo': _src_pro_bitvavo_js__WEBPACK_IMPORTED_MODULE_121__/* ["default"] */ .Z,
|
|
321167
|
+
'blockchaincom': _src_pro_blockchaincom_js__WEBPACK_IMPORTED_MODULE_122__/* ["default"] */ .Z,
|
|
321168
|
+
'bybit': _src_pro_bybit_js__WEBPACK_IMPORTED_MODULE_123__/* ["default"] */ .Z,
|
|
321169
|
+
'cex': _src_pro_cex_js__WEBPACK_IMPORTED_MODULE_124__/* ["default"] */ .Z,
|
|
321170
|
+
'coinbase': _src_pro_coinbase_js__WEBPACK_IMPORTED_MODULE_125__/* ["default"] */ .Z,
|
|
321171
|
+
'coinbaseinternational': _src_pro_coinbaseinternational_js__WEBPACK_IMPORTED_MODULE_126__/* ["default"] */ .Z,
|
|
321172
|
+
'coinbasepro': _src_pro_coinbasepro_js__WEBPACK_IMPORTED_MODULE_127__/* ["default"] */ .Z,
|
|
321173
|
+
'coincheck': _src_pro_coincheck_js__WEBPACK_IMPORTED_MODULE_128__/* ["default"] */ .Z,
|
|
321174
|
+
'coinex': _src_pro_coinex_js__WEBPACK_IMPORTED_MODULE_129__/* ["default"] */ .Z,
|
|
321175
|
+
'coinone': _src_pro_coinone_js__WEBPACK_IMPORTED_MODULE_130__/* ["default"] */ .Z,
|
|
321176
|
+
'cryptocom': _src_pro_cryptocom_js__WEBPACK_IMPORTED_MODULE_131__/* ["default"] */ .Z,
|
|
321177
|
+
'currencycom': _src_pro_currencycom_js__WEBPACK_IMPORTED_MODULE_132__/* ["default"] */ .Z,
|
|
321178
|
+
'deribit': _src_pro_deribit_js__WEBPACK_IMPORTED_MODULE_133__/* ["default"] */ .Z,
|
|
321179
|
+
'exmo': _src_pro_exmo_js__WEBPACK_IMPORTED_MODULE_134__/* ["default"] */ .Z,
|
|
321180
|
+
'gate': _src_pro_gate_js__WEBPACK_IMPORTED_MODULE_135__/* ["default"] */ .Z,
|
|
321181
|
+
'gateio': _src_pro_gateio_js__WEBPACK_IMPORTED_MODULE_136__/* ["default"] */ .Z,
|
|
321182
|
+
'gemini': _src_pro_gemini_js__WEBPACK_IMPORTED_MODULE_137__/* ["default"] */ .Z,
|
|
321183
|
+
'hitbtc': _src_pro_hitbtc_js__WEBPACK_IMPORTED_MODULE_138__/* ["default"] */ .Z,
|
|
321184
|
+
'hollaex': _src_pro_hollaex_js__WEBPACK_IMPORTED_MODULE_139__/* ["default"] */ .Z,
|
|
321185
|
+
'htx': _src_pro_htx_js__WEBPACK_IMPORTED_MODULE_140__/* ["default"] */ .Z,
|
|
321186
|
+
'huobi': _src_pro_huobi_js__WEBPACK_IMPORTED_MODULE_141__/* ["default"] */ .Z,
|
|
321187
|
+
'huobijp': _src_pro_huobijp_js__WEBPACK_IMPORTED_MODULE_142__/* ["default"] */ .Z,
|
|
321188
|
+
'hyperliquid': _src_pro_hyperliquid_js__WEBPACK_IMPORTED_MODULE_143__/* ["default"] */ .Z,
|
|
321189
|
+
'idex': _src_pro_idex_js__WEBPACK_IMPORTED_MODULE_144__/* ["default"] */ .Z,
|
|
321190
|
+
'independentreserve': _src_pro_independentreserve_js__WEBPACK_IMPORTED_MODULE_145__/* ["default"] */ .Z,
|
|
321191
|
+
'kraken': _src_pro_kraken_js__WEBPACK_IMPORTED_MODULE_146__/* ["default"] */ .Z,
|
|
321192
|
+
'krakenfutures': _src_pro_krakenfutures_js__WEBPACK_IMPORTED_MODULE_147__/* ["default"] */ .Z,
|
|
321193
|
+
'kucoin': _src_pro_kucoin_js__WEBPACK_IMPORTED_MODULE_148__/* ["default"] */ .Z,
|
|
321194
|
+
'kucoinfutures': _src_pro_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_149__/* ["default"] */ .Z,
|
|
321195
|
+
'lbank': _src_pro_lbank_js__WEBPACK_IMPORTED_MODULE_150__/* ["default"] */ .Z,
|
|
321196
|
+
'luno': _src_pro_luno_js__WEBPACK_IMPORTED_MODULE_151__/* ["default"] */ .Z,
|
|
321197
|
+
'mexc': _src_pro_mexc_js__WEBPACK_IMPORTED_MODULE_152__/* ["default"] */ .Z,
|
|
321198
|
+
'ndax': _src_pro_ndax_js__WEBPACK_IMPORTED_MODULE_153__/* ["default"] */ .Z,
|
|
321199
|
+
'okcoin': _src_pro_okcoin_js__WEBPACK_IMPORTED_MODULE_154__/* ["default"] */ .Z,
|
|
321200
|
+
'okx': _src_pro_okx_js__WEBPACK_IMPORTED_MODULE_155__/* ["default"] */ .Z,
|
|
321201
|
+
'onetrading': _src_pro_onetrading_js__WEBPACK_IMPORTED_MODULE_156__/* ["default"] */ .Z,
|
|
321202
|
+
'p2b': _src_pro_p2b_js__WEBPACK_IMPORTED_MODULE_157__/* ["default"] */ .Z,
|
|
321203
|
+
'phemex': _src_pro_phemex_js__WEBPACK_IMPORTED_MODULE_158__/* ["default"] */ .Z,
|
|
321204
|
+
'poloniex': _src_pro_poloniex_js__WEBPACK_IMPORTED_MODULE_159__/* ["default"] */ .Z,
|
|
321205
|
+
'poloniexfutures': _src_pro_poloniexfutures_js__WEBPACK_IMPORTED_MODULE_160__/* ["default"] */ .Z,
|
|
321206
|
+
'probit': _src_pro_probit_js__WEBPACK_IMPORTED_MODULE_161__/* ["default"] */ .Z,
|
|
321207
|
+
'upbit': _src_pro_upbit_js__WEBPACK_IMPORTED_MODULE_162__/* ["default"] */ .Z,
|
|
321208
|
+
'wazirx': _src_pro_wazirx_js__WEBPACK_IMPORTED_MODULE_163__/* ["default"] */ .Z,
|
|
321209
|
+
'whitebit': _src_pro_whitebit_js__WEBPACK_IMPORTED_MODULE_164__/* ["default"] */ .Z,
|
|
321210
|
+
'woo': _src_pro_woo_js__WEBPACK_IMPORTED_MODULE_165__/* ["default"] */ .Z,
|
|
318394
321211
|
};
|
|
318395
321212
|
for (const exchange in pro) {
|
|
318396
321213
|
// const ccxtExchange = exchanges[exchange]
|
|
@@ -318403,7 +321220,7 @@ for (const exchange in pro) {
|
|
|
318403
321220
|
pro.exchanges = Object.keys(pro);
|
|
318404
321221
|
pro['Exchange'] = _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e; // now the same for rest and ts
|
|
318405
321222
|
//-----------------------------------------------------------------------------
|
|
318406
|
-
const ccxt = Object.assign({ version, Exchange: _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e, Precise:
|
|
321223
|
+
const ccxt = Object.assign({ version, Exchange: _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e, Precise: _src_base_Precise_js__WEBPACK_IMPORTED_MODULE_166__/* .Precise */ .O, 'exchanges': Object.keys(exchanges), 'pro': pro }, exchanges, _src_base_functions_js__WEBPACK_IMPORTED_MODULE_167__, _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__);
|
|
318407
321224
|
|
|
318408
321225
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ccxt);
|
|
318409
321226
|
//-----------------------------------------------------------------------------
|