diff --git a/CHANGELOG.md b/CHANGELOG.md index d38b785fd0f88..27cbb3b1125a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,193 @@ # Changelog +## v4.9.10 - 2025-10-13 + +### Added + +**Pingi Exchange Integration**: Complete OTC trading support for Pingi exchange + +- Initial implementation with abstract class and public API endpoints +- OTC market data fetching capabilities (`fetchMarkets`) + - Parses market data from prices endpoint with real-time trading statistics + - Supports multiple quote currencies including IRT (Iranian Toman) and USDT + - Extracts market volume, price ranges (min/max), and current price data + - Handles market identification via underscore-separated format (BASE_QUOTE) +- Real-time ticker price endpoints (`fetchTicker`, `fetchTickers`) + - Fetches 24h market statistics for all available symbols + - Includes price change tracking (absolute and percentage calculated from start/current price) + - Provides high/low prices, open/close prices, and volume data + - Returns current market price with 24h price movement +- OHLCV candlestick data (`fetchOHLCV`) supporting multiple timeframes + - Timeframes: 1m, 5m, 15m, 30m, 1h, 4h, 1d, 1w + - Fetches historical price data with open, high, low, close, and volume + - Uses UDF (Universal Data Feed) format for chart data + - Supports custom time ranges via from and to parameters + - Returns properly formatted OHLCV arrays for charting +- Type definitions and parsing logic for OTC markets +- Integration with Pingi API v5: + - Markets/Tickers: https://api5.pingi.co/trading/market/prices/ + - OHLCV: https://api5.pingi.co/trading/udf/history/ + +**Mazdax Exchange Integration**: Complete OTC trading support for Mazdax exchange + +- Initial implementation with abstract class and public API endpoints +- OTC market data fetching capabilities (`fetchMarkets`) + - Parses market data from symbols endpoint with detailed trading parameters + - Supports IRR (Iranian Rial) as quote currency + - Extracts market precision, fees (taker/maker), and order size limits + - Handles active/tradable market status filtering +- Real-time ticker price endpoints (`fetchTicker`, `fetchTickers`) + - Fetches 24h rolling price statistics for all available symbols + - Includes price change tracking (absolute and percentage) + - Provides bid/ask prices, open/high/low prices, and volume data + - Supports timestamp-based data freshness +- OHLCV candlestick data (`fetchOHLCV`) supporting multiple timeframes + - Timeframes: 1m, 5m, 15m, 30m, 1h, 4h, 1d, 1w + - Fetches historical price data with open, high, low, close, and volume + - Supports custom time ranges via starttime and endtime parameters + - Configurable limit for number of candles returned (up to 1000) +- Order book depth (`fetchOrderBook`) + - Fetches bid/ask levels with price and quantity information + - Configurable depth limit for order book entries + - Real-time order book snapshots +- Type definitions and parsing logic for OTC markets +- Integration with Mazdax API: + - Markets: https://api.mazdax.ir/market/symbols + - Tickers: https://api.mazdax.ir/market/rollingprice + - OHLCV: https://api.mazdax.ir/market/candle + - Order Book: https://api.mazdax.ir/market/order + +## v4.9.8 - 2025-10-13 + +### Added + +**Pooleno Exchange Integration**: Complete spot trading support for Pooleno exchange + +- Initial implementation with abstract class and public API endpoint +- Spot market data fetching capabilities (`fetchMarkets`) + - Parses market data from payload array with baseAsset/quoteAsset pairs + - Supports multiple quote currencies including TMN (Toman) and USDT + - Creates markets based on API-provided asset pairs + - Supports retrieving all available trading pairs +- Real-time ticker price endpoints (`fetchTicker`, `fetchTickers`) + - Fetches current prices for all available symbols + - Supports filtering by specific symbols or fetching all tickers + - Parses price data with separate handling for TMN and USDT pairs + - Includes 24h price change (absolute and percentage) from sparkline data + - Provides market data including 24h high/low, volume, and market cap +- Type definitions and parsing logic for spot markets +- Integration with Pooleno API v1: + - Markets/Tickers: https://api-beta.pooleno.ir/api/v1/tokens/public +- Comprehensive price data parsing: + - For TMN pairs: Uses `priceTMN` field + - For USDT pairs: Uses `price` field with `volume24h` + - Extracts sparkline data for change tracking + - Parses market metadata including high24h, low24h, volume24h, and marketCap + +## v4.9.7 - 2025-10-13 + +### Fixed + +**Twox Exchange**: Enhanced ticker data parsing with complete price information + +- Fixed `parseTicker` to properly extract and map `sellPrice`, `buyPrice`, and `latestPrice` fields +- Added proper bid/ask price population based on quote currency type +- Implemented correct last price logic (uses `sellPrice` for IRT pairs, `latestPrice` for USDT pairs) +- Added price change tracking with separate `sellPriceChange` and `buyPriceChange` handling +- Populated percentage field with `priceChangePercent` from API response +- Updated example comment to reflect actual API response structure + +**Afratether Exchange**: Updated market and ticker parsing for USDT/IRR pairs + +- Changed market type from `spot` to `otc` to reflect OTC trading model +- Updated `parseMarket` to use fixed quote currency (IRR) instead of dynamic quote from API +- Modified `parseTicker` to extract bid/ask prices from `prices.IRR` object structure +- Implemented proper price parsing with `price_sell` and `price_buy` fields +- Added 24h change rate tracking with `changeRate24h` field +- Fixed symbol construction to use proper format (base/quote) +- Updated example comments to reflect new API response structure with IRR pricing + +## v4.9.6 - 2025-10-12 + +### Added + +**Kifpool Exchange Integration**: Complete spot trading support for Kifpool exchange + +- Initial implementation with abstract class and public API endpoint +- Spot market data fetching capabilities (`fetchMarkets`) + - Parses market data for multiple quote currencies (USDT and IRT) + - Creates separate markets for each base/quote pair combination + - Support for retrieving all available trading pairs +- Real-time ticker price endpoints (`fetchTicker`, `fetchTickers`) + - Fetches buy and sell prices for specified symbols + - Supports filtering by specific symbols or fetching all tickers + - Parses bid/ask prices from market data +- OHLCV candlestick data (`fetchOHLCV`) supporting multiple timeframes + - Timeframes: 1m, 5m, 15m, 30m, 1h, 4h, 1d, 1w + - Fetches historical price data with open, high, low, close, and volume + - Supports custom time ranges via fromTs and toTs parameters + - Configurable limit for number of candles returned +- Type definitions and parsing logic for spot markets +- Integration with Kifpool API: + - Markets/Tickers: https://api.kifpool.app/api/spot/price + - OHLCV: https://api.kifpool.app/api/spot/tickers/1m + +### Fixed + +**Tetherland Exchange**: Critical fixes for API endpoint and data parsing + +- Updated public API endpoint from `api.teterlands.com` to `service.tetherland.com` +- Fixed market data parsing by replacing `safeDict` with `safeList` for array responses +- Improved number parsing robustness using `asFloat` with comma removal for price data +- Enhanced ticker price parsing to handle formatted number strings correctly + +## v4.9.5 - 2025-10-10 + +### Added + +**Cafearz Exchange Integration**: Complete support for Cafearz exchange + +- Initial implementation with abstract class and public API endpoint +- Market data fetching capabilities (`fetchMarkets`) +- Ticker price endpoints (`fetchTicker`, `fetchTickers`) +- Type definitions and parsing logic for market data +- Support for retrieving real-time trading pair information + +**Bitbarg Exchange Integration**: Complete support for Bitbarg exchange + +- Initial implementation with abstract class and public API endpoint +- Market data fetching capabilities (`fetchMarkets`) +- Ticker price endpoints (`fetchTicker`, `fetchTickers`) +- Type definitions and parsing logic for market data +- Support for retrieving real-time trading pair information with IRT quote +- Integration with Bitbarg API v1 (https://api.bitbarg.com/api/v1/currencies) + +**Bydfi Exchange Integration**: Complete spot trading support for Bydfi exchange + +- Initial implementation with abstract class and dual API endpoints architecture + - `public` API endpoint: https://www.bydfi.com + - `quote` API endpoint: https://quote.bydfi.pro +- Spot market data fetching capabilities (`fetchMarkets`) + - Parses market metadata including base/quote coins, precision settings, trading limits + - Supports active market filtering based on visibility and trading permissions +- CSV-formatted ticker parsing with comprehensive price data (`fetchTicker`, `fetchTickers`) + - Parses semicolon-separated ticker data with 11 fields per market + - Includes last price, 24h high/low, volume, bid/ask prices, price change percentage +- Order book depth data (`fetchOrderBook`) with bid/ask information + - Supports configurable depth limit + - Returns price and amount for each order level +- OHLCV candlestick data (`fetchOHLCV`) supporting multiple timeframes + - Timeframes: 1m, 5m, 15m, 30m, 1h, 4h, 1d, 1w, 1M + - TradingView-compatible historical data format + - Returns open, high, low, close, volume, and timestamp arrays +- Type definitions and parsing logic for spot markets +- Proper API method routing using `quoteGetTickers` and `quoteGetMkpaiDepthV2` for quote endpoint +- Integration with Bydfi API v1: + - Markets: https://www.bydfi.com/api/spot/product/list + - Tickers: https://quote.bydfi.pro/tickers + - Order Book: https://quote.bydfi.pro/mkpai/depth-v2 + - OHLCV: https://www.bydfi.com/api/tv/tradingView/history + ## v4.9.4 - 2025-10-08 ### Added diff --git a/README.md b/README.md index 8e5a5ecdf9549..c3bb79b4f0a9e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # CCXT – CryptoCurrency eXchange Trading Library -[![NPM Downloads](https://img.shields.io/npm/dy/ccxt.svg)](https://www.npmjs.com/package/ccxt) [![npm](https://img.shields.io/npm/v/ccxt.svg)](https://npmjs.com/package/ccxt) [![PyPI](https://img.shields.io/pypi/v/ccxt.svg)](https://pypi.python.org/pypi/ccxt) [![NuGet version](https://img.shields.io/nuget/v/ccxt)](https://www.nuget.org/packages/ccxt) [![GoDoc](https://pkg.go.dev/badge/github.com/ccxt/ccxt/go/v4?utm_source=godoc)](https://godoc.org/github.com/ccxt/ccxt/go/v4) [![Discord](https://img.shields.io/discord/690203284119617602?logo=discord&logoColor=white)](https://discord.gg/ccxt) [![Supported Exchanges](https://img.shields.io/badge/exchanges-137-blue.svg)](https://github.com/ccxt/ccxt/wiki/Exchange-Markets) [![Follow CCXT at x.com](https://img.shields.io/twitter/follow/ccxt_official.svg?style=social&label=CCXT)](https://x.com/ccxt_official) +[![NPM Downloads](https://img.shields.io/npm/dy/ccxt.svg)](https://www.npmjs.com/package/ccxt) [![npm](https://img.shields.io/npm/v/ccxt.svg)](https://npmjs.com/package/ccxt) [![PyPI](https://img.shields.io/pypi/v/ccxt.svg)](https://pypi.python.org/pypi/ccxt) [![NuGet version](https://img.shields.io/nuget/v/ccxt)](https://www.nuget.org/packages/ccxt) [![GoDoc](https://pkg.go.dev/badge/github.com/ccxt/ccxt/go/v4?utm_source=godoc)](https://godoc.org/github.com/ccxt/ccxt/go/v4) [![Discord](https://img.shields.io/discord/690203284119617602?logo=discord&logoColor=white)](https://discord.gg/ccxt) [![Supported Exchanges](https://img.shields.io/badge/exchanges-144-blue.svg)](https://github.com/ccxt/ccxt/wiki/Exchange-Markets) [![Follow CCXT at x.com](https://img.shields.io/twitter/follow/ccxt_official.svg?style=social&label=CCXT)](https://x.com/ccxt_official) A `JavaScript` / `Python` / `PHP` / `C#` / `Go` library for cryptocurrency trading and e-commerce with support for many bitcoin/ether/altcoin exchange markets and merchant APIs. @@ -243,20 +243,20 @@ console.log(version, Object.keys(exchanges)); All-in-one browser bundle (dependencies included), served from a CDN of your choice: <<<<<<< HEAD -* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.9.4/dist/ccxt.browser.min.js -* unpkg: https://unpkg.com/ccxt@4.9.4/dist/ccxt.browser.min.js +* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.9.10/dist/ccxt.browser.min.js +* unpkg: https://unpkg.com/ccxt@4.9.10/dist/ccxt.browser.min.js ======= -* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.9.4/dist/ccxt.browser.min.js -* unpkg: https://unpkg.com/ccxt@4.9.4/dist/ccxt.browser.min.js +* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.9.10/dist/ccxt.browser.min.js +* unpkg: https://unpkg.com/ccxt@4.9.10/dist/ccxt.browser.min.js >>>>>>> master CDNs are not updated in real-time and may have delays. Defaulting to the most recent version without specifying the version number is not recommended. Please, keep in mind that we are not responsible for the correct operation of those CDN servers. ```HTML <<<<<<< HEAD - + ======= - + >>>>>>> master console.log (ccxt.exchanges) // print all available exchanges ``` diff --git a/cs/ccxt/api/abantether.cs b/cs/ccxt/api/abantether.cs index 50c4e99edad77..c79e688a11575 100644 --- a/cs/ccxt/api/abantether.cs +++ b/cs/ccxt/api/abantether.cs @@ -11,9 +11,9 @@ public partial class abantether : Exchange { public abantether (object args = null): base(args) {} - public async Task publicGetManagementAllCoins (object parameters = null) + public async Task publicGetManagerCoinsData (object parameters = null) { - return await this.callAsync ("publicGetManagementAllCoins",parameters); + return await this.callAsync ("publicGetManagerCoinsData",parameters); } } \ No newline at end of file diff --git a/cs/ccxt/api/bitbarg.cs b/cs/ccxt/api/bitbarg.cs new file mode 100644 index 0000000000000..a3268ceb7f1fe --- /dev/null +++ b/cs/ccxt/api/bitbarg.cs @@ -0,0 +1,19 @@ +// ------------------------------------------------------------------------------- + +// PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN: +// https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code + +// ------------------------------------------------------------------------------- + +namespace ccxt; + +public partial class bitbarg : Exchange +{ + public bitbarg (object args = null): base(args) {} + + public async Task publicGetApiV1Currencies (object parameters = null) + { + return await this.callAsync ("publicGetApiV1Currencies",parameters); + } + +} \ No newline at end of file diff --git a/cs/ccxt/api/bydfi.cs b/cs/ccxt/api/bydfi.cs new file mode 100644 index 0000000000000..703437b725d98 --- /dev/null +++ b/cs/ccxt/api/bydfi.cs @@ -0,0 +1,34 @@ +// ------------------------------------------------------------------------------- + +// PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN: +// https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code + +// ------------------------------------------------------------------------------- + +namespace ccxt; + +public partial class bydfi : Exchange +{ + public bydfi (object args = null): base(args) {} + + public async Task publicGetApiSpotProductList (object parameters = null) + { + return await this.callAsync ("publicGetApiSpotProductList",parameters); + } + + public async Task publicGetApiTvTradingViewHistory (object parameters = null) + { + return await this.callAsync ("publicGetApiTvTradingViewHistory",parameters); + } + + public async Task quoteGetTickers (object parameters = null) + { + return await this.callAsync ("quoteGetTickers",parameters); + } + + public async Task quoteGetMkpaiDepthV2 (object parameters = null) + { + return await this.callAsync ("quoteGetMkpaiDepthV2",parameters); + } + +} \ No newline at end of file diff --git a/cs/ccxt/api/cafearz.cs b/cs/ccxt/api/cafearz.cs new file mode 100644 index 0000000000000..8da9d2cf115db --- /dev/null +++ b/cs/ccxt/api/cafearz.cs @@ -0,0 +1,19 @@ +// ------------------------------------------------------------------------------- + +// PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN: +// https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code + +// ------------------------------------------------------------------------------- + +namespace ccxt; + +public partial class cafearz : Exchange +{ + public cafearz (object args = null): base(args) {} + + public async Task publicGetApiClientV1CurrenciesPricesDigital (object parameters = null) + { + return await this.callAsync ("publicGetApiClientV1CurrenciesPricesDigital",parameters); + } + +} \ No newline at end of file diff --git a/cs/ccxt/api/kifpoolme.cs b/cs/ccxt/api/kifpoolme.cs new file mode 100644 index 0000000000000..db2c63d66ae65 --- /dev/null +++ b/cs/ccxt/api/kifpoolme.cs @@ -0,0 +1,24 @@ +// ------------------------------------------------------------------------------- + +// PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN: +// https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code + +// ------------------------------------------------------------------------------- + +namespace ccxt; + +public partial class kifpoolme : Exchange +{ + public kifpoolme (object args = null): base(args) {} + + public async Task publicGetApiSpotPrice (object parameters = null) + { + return await this.callAsync ("publicGetApiSpotPrice",parameters); + } + + public async Task publicGetApiSpotTickers1m (object parameters = null) + { + return await this.callAsync ("publicGetApiSpotTickers1m",parameters); + } + +} \ No newline at end of file diff --git a/cs/ccxt/api/mazdax.cs b/cs/ccxt/api/mazdax.cs new file mode 100644 index 0000000000000..3798ed7bab336 --- /dev/null +++ b/cs/ccxt/api/mazdax.cs @@ -0,0 +1,34 @@ +// ------------------------------------------------------------------------------- + +// PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN: +// https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code + +// ------------------------------------------------------------------------------- + +namespace ccxt; + +public partial class mazdax : Exchange +{ + public mazdax (object args = null): base(args) {} + + public async Task publicGetMarketSymbols (object parameters = null) + { + return await this.callAsync ("publicGetMarketSymbols",parameters); + } + + public async Task publicGetMarketRollingprice (object parameters = null) + { + return await this.callAsync ("publicGetMarketRollingprice",parameters); + } + + public async Task publicGetMarketCandle (object parameters = null) + { + return await this.callAsync ("publicGetMarketCandle",parameters); + } + + public async Task publicGetMarketOrder (object parameters = null) + { + return await this.callAsync ("publicGetMarketOrder",parameters); + } + +} \ No newline at end of file diff --git a/cs/ccxt/api/pingi.cs b/cs/ccxt/api/pingi.cs new file mode 100644 index 0000000000000..35852a50a4918 --- /dev/null +++ b/cs/ccxt/api/pingi.cs @@ -0,0 +1,24 @@ +// ------------------------------------------------------------------------------- + +// PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN: +// https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code + +// ------------------------------------------------------------------------------- + +namespace ccxt; + +public partial class pingi : Exchange +{ + public pingi (object args = null): base(args) {} + + public async Task publicGetMarketPrices (object parameters = null) + { + return await this.callAsync ("publicGetMarketPrices",parameters); + } + + public async Task publicGetUdfHistory (object parameters = null) + { + return await this.callAsync ("publicGetUdfHistory",parameters); + } + +} \ No newline at end of file diff --git a/cs/ccxt/api/pooleno.cs b/cs/ccxt/api/pooleno.cs new file mode 100644 index 0000000000000..cffd14cd051b1 --- /dev/null +++ b/cs/ccxt/api/pooleno.cs @@ -0,0 +1,19 @@ +// ------------------------------------------------------------------------------- + +// PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN: +// https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code + +// ------------------------------------------------------------------------------- + +namespace ccxt; + +public partial class pooleno : Exchange +{ + public pooleno (object args = null): base(args) {} + + public async Task publicGetApiV1TokensPublic (object parameters = null) + { + return await this.callAsync ("publicGetApiV1TokensPublic",parameters); + } + +} \ No newline at end of file diff --git a/cs/ccxt/base/Exchange.MetaData.cs b/cs/ccxt/base/Exchange.MetaData.cs index 38c3be7ee2d6e..13ef53dee48d6 100644 --- a/cs/ccxt/base/Exchange.MetaData.cs +++ b/cs/ccxt/base/Exchange.MetaData.cs @@ -4,12 +4,12 @@ namespace ccxt; public partial class Exchange { <<<<<<< HEAD - public static string ccxtVersion = "4.9.4"; + public static string ccxtVersion = "4.9.10"; ======= public static string ccxtVersion = "4.6.2"; >>>>>>> master -public static List exchanges = new List { "abantether", "afratether", "alpaca", "apex", "arzinja", "arzplus", "ascendex", "bequant", "bigone", "binance", "binancecoinm", "binanceus", "binanceusdm", "bingx", "bit24", "bit2c", "bitbank", "bitbns", "bitfinex", "bitflyer", "bitget", "bithumb", "bitimen", "bitir", "bitmart", "bitmex", "bitopro", "bitpin", "bitrue", "bitso", "bitstamp", "bitteam", "bittrade", "bitunix", "bitvavo", "blockchaincom", "blofin", "btcalpha", "btcbox", "btcmarkets", "btcturk", "bybit", "cex", "coinbase", "coinbaseadvanced", "coinbaseexchange", "coinbaseinternational", "coincatch", "coincheck", "coinex", "coinmate", "coinmetro", "coinone", "coinsph", "coinspot", "cryptocom", "cryptomus", "defx", "delta", "deribit", "derive", "digifinex", "ellipx", "eterex", "excoino", "exir", "exmo", "exnovin", "farhadexchange", "fmfwio", "foxbit", "gate", "gateio", "gemini", "hamtapay", "hashkey", "hibachi", "hitbtc", "hitobit", "hollaex", "htx", "huobi", "hyperliquid", "independentreserve", "indodax", "jibitex", "kcex", "kraken", "krakenfutures", "kucoin", "kucoinfutures", "latoken", "lbank", "luno", "mercado", "mexc", "modetrade", "myokx", "ndax", "nobitex", "novadax", "oceanex", "okcoin", "okexchange", "okx", "okxus", "ompfinex", "onetrading", "oxfun", "p2b", "paradex", "paymium", "phemex", "poloniex", "probit", "ramzinex", "sarmayex", "sarrafex", "tabdeal", "tetherland", "timex", "tokocrypto", "toobit", "tradeogre", "twox", "ubitex", "upbit", "vertex", "wallex", "wavesexchange", "whitebit", "woo", "woofipro", "xt", "yobit", "zaif", "zonda" }; +public static List exchanges = new List { "abantether", "afratether", "alpaca", "apex", "arzinja", "arzplus", "ascendex", "bequant", "bigone", "binance", "binancecoinm", "binanceus", "binanceusdm", "bingx", "bit24", "bit2c", "bitbank", "bitbarg", "bitbns", "bitfinex", "bitflyer", "bitget", "bithumb", "bitimen", "bitir", "bitmart", "bitmex", "bitopro", "bitpin", "bitrue", "bitso", "bitstamp", "bitteam", "bittrade", "bitunix", "bitvavo", "blockchaincom", "blofin", "btcalpha", "btcbox", "btcmarkets", "btcturk", "bybit", "bydfi", "cafearz", "cex", "coinbase", "coinbaseadvanced", "coinbaseexchange", "coinbaseinternational", "coincatch", "coincheck", "coinex", "coinmate", "coinmetro", "coinone", "coinsph", "coinspot", "cryptocom", "cryptomus", "defx", "delta", "deribit", "derive", "digifinex", "ellipx", "eterex", "excoino", "exir", "exmo", "exnovin", "farhadexchange", "fmfwio", "foxbit", "gate", "gateio", "gemini", "hamtapay", "hashkey", "hibachi", "hitbtc", "hitobit", "hollaex", "htx", "huobi", "hyperliquid", "independentreserve", "indodax", "jibitex", "kcex", "kifpoolme", "kraken", "krakenfutures", "kucoin", "kucoinfutures", "latoken", "lbank", "luno", "mazdax", "mercado", "mexc", "modetrade", "myokx", "ndax", "nobitex", "novadax", "oceanex", "okcoin", "okexchange", "okx", "okxus", "ompfinex", "onetrading", "oxfun", "p2b", "paradex", "paymium", "phemex", "pingi", "poloniex", "pooleno", "probit", "ramzinex", "sarmayex", "sarrafex", "tabdeal", "tetherland", "timex", "tokocrypto", "toobit", "tradeogre", "twox", "ubitex", "upbit", "vertex", "wallex", "wavesexchange", "whitebit", "woo", "woofipro", "xt", "yobit", "zaif", "zonda" }; }; diff --git a/cs/ccxt/ccxt.csproj b/cs/ccxt/ccxt.csproj index cb9d04c73d7dd..f765ddfacf0be 100644 --- a/cs/ccxt/ccxt.csproj +++ b/cs/ccxt/ccxt.csproj @@ -10,9 +10,9 @@ ccxt Carlos, Kroitor, Carlo - 4.9.4 - 4.9.4 - 4.9.4 + 4.9.10 + 4.9.10 + 4.9.10 README.md Cryptocurrency trading API with support for more than 100 bitcoin/altcoin exchanges false diff --git a/dist/ccxt.browser.js b/dist/ccxt.browser.js index 23b5a383240bc..a14cabddfa5c3 100644 --- a/dist/ccxt.browser.js +++ b/dist/ccxt.browser.js @@ -29,7 +29,8 @@ class abantether extends _abstract_abantether_js__WEBPACK_IMPORTED_MODULE_0__/* 'pro': false, 'has': { 'CORS': undefined, - 'spot': true, + 'spot': false, + 'otc': true, 'margin': false, 'swap': false, 'future': false, @@ -94,7 +95,7 @@ class abantether extends _abstract_abantether_js__WEBPACK_IMPORTED_MODULE_0__/* 'urls': { 'logo': 'https://cdn.arz.digital/cr-odin/img/exchanges/abantether/64x64.png', 'api': { - 'public': 'https://abantether.com', + 'public': 'https://api.abantether.com', }, 'www': 'https://abantether.com', 'doc': [ @@ -104,7 +105,7 @@ class abantether extends _abstract_abantether_js__WEBPACK_IMPORTED_MODULE_0__/* 'api': { 'public': { 'get': { - 'management/all-coins/': 1, + 'manager/coins/data': 1, }, }, }, @@ -123,23 +124,24 @@ class abantether extends _abstract_abantether_js__WEBPACK_IMPORTED_MODULE_0__/* * @method * @name abantether#fetchMarkets * @description retrieves data on all markets for abantether - * @see https://abantether.com/management/all-coins/?format=json + * @see https://api.abantether.com/manager/coins/data * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object[]} an array of objects representing market data */ - const response = await this.publicGetManagementAllCoins(params); + const response = await this.publicGetManagerCoinsData(params); + const data = this.safeList(response, 'data', []); const result = []; const quotes = ['IRT', 'USDT']; - for (let i = 0; i < response.length; i++) { - const base = this.safeString(response[i], 'symbol'); + for (let i = 0; i < data.length; i++) { + const base = this.safeString(data[i], 'symbol'); for (let index = 0; index < quotes.length; index++) { const quote = quotes[index]; - response[i]['base'] = base; - response[i]['quote'] = quote; + data[i]['base'] = base; + data[i]['quote'] = quote; if (base === quote) { continue; } - const market = this.parseMarket(response[i]); + const market = this.parseMarket(data[i]); result.push(market); } } @@ -147,29 +149,38 @@ class abantether extends _abstract_abantether_js__WEBPACK_IMPORTED_MODULE_0__/* } parseMarket(market) { // { - // 'symbol': 'USDT', - // 'name': 'Tether', - // 'categories': [], - // 'tetherPrice': '1', - // 'priceBuy': '59200.0', - // 'priceSell': '58800.0', - // 'persianName': '\u062a\u062a\u0631', - // 'past24': '0', - // 'marketVolume': '1', - // 'id': '1', - // 'active': true, - // 'irtDecimalPoint': '2', - // 'tetherDecimalPoint': '6', - // 'amountDecimalPoint': '6', - // 'past24volume': '767287.60530837810210936763', - // 'operationStatus': { - // 'buyActive': true, - // 'sellActive': true, - // 'withdrawalActive': true, - // 'depositActive': true, - // 'transferActive': true, - // }, - // }; + // "id": 1, + // "name": "Tether USDt", + // "symbol": "USDT", + // "persian_name": "تتر", + // "is_active": true, + // "is_withdrawal_active": true, + // "is_deposit_active": true, + // "is_mid_wallet_transfer_active": true, + // "is_buy_active": true, + // "is_sell_active": true, + // "is_credit_active": true, + // "min_trade": "1.00", + // "max_trade": "100000.00", + // "tether_price": "1", + // "price_buy": "113540.0", + // "price_sell": "112630.0", + // "volume24h": "225163179366.25", + // "percent_change_1h": "0.00", + // "percent_change_24h": "0.00", + // "percent_change_7d": "0.04", + // "market_cap": "179884960573.99", + // "coin_type": "COIN", + // "exchange_type": "fake", + // "icon": "f71021586005413ea6f3a0bd1f7d8a55", + // "fund_tether_buy": "0", + // "fund_tether_sell": "0", + // "irt_decimal_point": 2, + // "tether_decimal_point": 6, + // "amount_decimal_point": 6, + // "base": "BTC", + // "qoute": "USDT", + // }, let baseId = this.safeString(market, 'base'); let quoteId = this.safeString(market, 'quote'); const base = this.safeCurrencyCode(baseId); @@ -232,7 +243,7 @@ class abantether extends _abstract_abantether_js__WEBPACK_IMPORTED_MODULE_0__/* * @method * @name abantether#fetchTickers * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market - * @see https://abantether.com/management/all-coins/?format=json + * @see https://api.abantether.com/manager/coins/data * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure} @@ -241,20 +252,21 @@ class abantether extends _abstract_abantether_js__WEBPACK_IMPORTED_MODULE_0__/* if (symbols !== undefined) { symbols = this.marketSymbols(symbols); } - const response = await this.publicGetManagementAllCoins(params); + const response = await this.publicGetManagerCoinsData(params); + const data = this.safeList(response, 'data', []); const result = {}; const quotes = ['IRT', 'USDT']; - for (let i = 0; i < response.length; i++) { - const base = this.safeString(response[i], 'symbol'); + for (let i = 0; i < data.length; i++) { + const base = this.safeString(data[i], 'symbol'); for (let index = 0; index < quotes.length; index++) { const quote = quotes[index]; if (base === quote) { continue; } - response[i]['base'] = base; - response[i]['quote'] = quote; - response[i]['symbol'] = base + quote; - const ticker = this.parseTicker(response[i]); + data[i]['base'] = base; + data[i]['quote'] = quote; + data[i]['symbol'] = base + quote; + const ticker = this.parseTicker(data[i]); const symbol = ticker['symbol']; result[symbol] = ticker; } @@ -266,7 +278,7 @@ class abantether extends _abstract_abantether_js__WEBPACK_IMPORTED_MODULE_0__/* * @method * @name abantether#fetchTicker * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market - * @see https://abantether.com/management/all-coins/?format=json + * @see https://api.abantether.com/manager/coins/data * @param {string} symbol unified symbol of the market to fetch the ticker for * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure} @@ -276,38 +288,45 @@ class abantether extends _abstract_abantether_js__WEBPACK_IMPORTED_MODULE_0__/* } parseTicker(ticker, market = undefined) { // { - // 'symbol': 'USDT', - // 'name': 'Tether', - // 'categories': [], - // 'tetherPrice': '1', - // 'priceBuy': '59200.0', - // 'priceSell': '58800.0', - // 'persianName': '\u062a\u062a\u0631', - // 'past24': '0', - // 'marketVolume': '1', - // 'id': '1', - // 'active': true, - // 'irtDecimalPoint': '2', - // 'tetherDecimalPoint': '6', - // 'amountDecimalPoint': '6', - // 'past24volume': '767287.60530837810210936763', - // 'operationStatus': { - // 'buyActive': true, - // 'sellActive': true, - // 'withdrawalActive': true, - // 'depositActive': true, - // 'transferActive': true, - // }, - // }; + // "id": 2, + // "name": "Bitcoin", + // "symbol": "BTC", + // "persian_name": "بیت کوین", + // "is_active": true, + // "is_withdrawal_active": true, + // "is_deposit_active": true, + // "is_mid_wallet_transfer_active": true, + // "is_buy_active": true, + // "is_sell_active": true, + // "is_credit_active": true, + // "min_trade": "1.00", + // "max_trade": "65000.00", + // "tether_price": "114909.43000000", + // "price_buy": "13049114870.800000000", + // "price_sell": "12944547289.500000000", + // "volume24h": "93585526493.26", + // "percent_change_1h": "-0.29", + // "percent_change_24h": "3.22", + // "percent_change_7d": "-7.19", + // "market_cap": "2292874615411.72", + // "coin_type": "COIN", + // "exchange_type": "binance", + // "icon": "561aa10abc0c45f7aa4499f48d618c80", + // "fund_tether_buy": "0", + // "fund_tether_sell": "0", + // "irt_decimal_point": 0, + // "tether_decimal_point": 2, + // "amount_decimal_point": 9 + // }, const marketType = 'otc'; const marketId = this.safeString(ticker, 'symbol'); const symbol = this.safeSymbol(marketId, market, undefined, marketType); - let last = this.safeFloat(ticker, 'tetherPrice', 0); + let last = this.safeFloat(ticker, 'tether_price', 0); if (ticker['quote'] === 'IRT') { - last = this.safeFloat(ticker, 'priceSell', 0); + last = this.safeFloat(ticker, 'price_buy', 0); } - const change = this.safeFloat(ticker, 'past24', 0); - const baseVolume = this.safeFloat(ticker, 'past24volume', 0); + const change = this.safeFloat(ticker, 'percent_change_24h', 0); + const baseVolume = this.safeFloat(ticker, 'volume24h', 0); return this.safeTicker({ 'symbol': symbol, 'timestamp': undefined, @@ -547,6 +566,22 @@ class Exchange extends _base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchang /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Exchange); +/***/ }), + +/***/ 108: +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2961); +// ------------------------------------------------------------------------------- + +class Exchange extends _base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .k { +} +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Exchange); + + /***/ }), /***/ 5625: @@ -947,6 +982,38 @@ class Exchange extends _base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchang /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Exchange); +/***/ }), + +/***/ 5439: +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2961); +// ------------------------------------------------------------------------------- + +class Exchange extends _base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .k { +} +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Exchange); + + +/***/ }), + +/***/ 5925: +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2961); +// ------------------------------------------------------------------------------- + +class Exchange extends _base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .k { +} +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Exchange); + + /***/ }), /***/ 5465: @@ -1603,6 +1670,22 @@ class Exchange extends _base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchang /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Exchange); +/***/ }), + +/***/ 8931: +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2961); +// ------------------------------------------------------------------------------- + +class Exchange extends _base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .k { +} +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Exchange); + + /***/ }), /***/ 2459: @@ -1715,6 +1798,22 @@ class Exchange extends _base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchang /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Exchange); +/***/ }), + +/***/ 2208: +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2961); +// ------------------------------------------------------------------------------- + +class Exchange extends _base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .k { +} +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Exchange); + + /***/ }), /***/ 6928: @@ -1987,6 +2086,22 @@ class Exchange extends _base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchang /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Exchange); +/***/ }), + +/***/ 8310: +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2961); +// ------------------------------------------------------------------------------- + +class Exchange extends _base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .k { +} +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Exchange); + + /***/ }), /***/ 7733: @@ -2003,6 +2118,22 @@ class Exchange extends _base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchang /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Exchange); +/***/ }), + +/***/ 5003: +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2961); +// ------------------------------------------------------------------------------- + +class Exchange extends _base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .k { +} +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Exchange); + + /***/ }), /***/ 995: @@ -2400,7 +2531,8 @@ class afratether extends _abstract_afratether_js__WEBPACK_IMPORTED_MODULE_0__/* 'pro': false, 'has': { 'CORS': undefined, - 'spot': true, + 'spot': false, + 'otc': true, 'margin': false, 'swap': false, 'future': false, @@ -2515,21 +2647,43 @@ class afratether extends _abstract_afratether_js__WEBPACK_IMPORTED_MODULE_0__/* } parseMarket(market) { // { - // "currencyAbb": "BTC", - // "nameEn": "Bitcoin", - // "nameFa": "بیت کوین", - // "icon": "/assets/crypto/BTC.png", - // "currency": "BTC", - // "prices": [ - // { - // "currency": "USDT", - // "price": "67797.1" + // "currencyAbb": "USDT", + // "nameEn": "Tether", + // "nameFa": "تتر", + // "icon": "/assets/crypto/usdt.png", + // "round": 1000000, + // "currency": "USDT", + // "changeRate24h": "-0.0065", + // "Klines": [ + // [ + // "1760227200000", + // "1147500", + // "1140000", + // "1145500", + // "1125000", + // "0", + // "0" + // ], + // ], + // "info": { + // "birth_date": 1412553600000, + // "open_24h": 1, + // "open_1w": 1, + // "open_3M": 1, + // "open_1y": 1 + // }, + // "prices": { + // "USDT": { + // "price": "1" + // }, + // "IRR": { + // "price_sell": 1135000, + // "price_buy": 1123000 // } - // ] - // }, - const details = this.safeList(market, 'prices'); + // } + // } let baseId = this.safeString(market, 'currency'); - let quoteId = this.safeString(details[0], 'currency'); + let quoteId = 'IRR'; const base = this.safeCurrencyCode(baseId); const quote = this.safeCurrencyCode(quoteId); const id = base + quote; @@ -2544,8 +2698,8 @@ class afratether extends _abstract_afratether_js__WEBPACK_IMPORTED_MODULE_0__/* 'baseId': baseId, 'quoteId': quoteId, 'settleId': undefined, - 'type': 'spot', - 'spot': true, + 'type': 'otc', + 'spot': false, 'margin': false, 'swap': false, 'future': false, @@ -2628,41 +2782,66 @@ class afratether extends _abstract_afratether_js__WEBPACK_IMPORTED_MODULE_0__/* } parseTicker(ticker, market = undefined) { // { - // "currencyAbb": "BTC", - // "nameEn": "Bitcoin", - // "nameFa": "بیت کوین", - // "icon": "/assets/crypto/BTC.png", - // "currency": "BTC", - // "prices": [ - // { - // "currency": "USDT", - // "price": "67797.1" + // "currencyAbb": "USDT", + // "nameEn": "Tether", + // "nameFa": "تتر", + // "icon": "/assets/crypto/usdt.png", + // "round": 1000000, + // "currency": "USDT", + // "changeRate24h": "-0.0065", + // "Klines": [ + // [ + // "1760227200000", + // "1147500", + // "1140000", + // "1145500", + // "1125000", + // "0", + // "0" + // ], + // ], + // "info": { + // "birth_date": 1412553600000, + // "open_24h": 1, + // "open_1w": 1, + // "open_3M": 1, + // "open_1y": 1 + // }, + // "prices": { + // "USDT": { + // "price": "1" + // }, + // "IRR": { + // "price_sell": 1135000, + // "price_buy": 1123000 // } - // ] - // }, + // } + // } const marketType = 'otc'; - const details = this.safeList(ticker, 'prices'); const base = this.safeString(ticker, 'currency'); - const quote = this.safeString(details[0], 'currency'); - const marketId = base + quote; + const quote = 'IRR'; + const marketId = base + '/' + quote; const symbol = this.safeSymbol(marketId, market, undefined, marketType); - const last = this.safeFloat(details[0], 'price', 0); + const prices = this.safeDict(ticker, 'prices', {}); + const irrPrices = this.safeDict(prices, 'IRR', {}); + const sell = this.safeFloat(irrPrices, 'price_sell', 0); + const buy = this.safeFloat(irrPrices, 'price_buy', 0); return this.safeTicker({ 'symbol': symbol, 'timestamp': undefined, 'datetime': undefined, 'high': undefined, 'low': undefined, - 'bid': undefined, + 'bid': sell, 'bidVolume': undefined, - 'ask': undefined, + 'ask': buy, 'askVolume': undefined, 'vwap': undefined, 'open': undefined, - 'close': last, - 'last': last, + 'close': buy, + 'last': buy, 'previousClose': undefined, - 'change': undefined, + 'change': this.safeFloat(ticker, 'changeRate24h', undefined), 'percentage': undefined, 'average': undefined, 'baseVolume': undefined, @@ -6991,8 +7170,15 @@ class arzplus extends _abstract_arzplus_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa 'stats': '1', 'enable': 'true', }; - const response = await this.publicGetApiV1MarketSymbols(request); - const otcMarkets = await this.publicGetApiV1MarketIrtInfo(request); + const typedRequest = this.safeString(params, 'type', 'spot'); + let response = []; + let otcMarkets = []; + if (typedRequest === 'otc') { + otcMarkets = await this.publicGetApiV1MarketIrtInfo(request); + } + else { + response = await this.publicGetApiV1MarketSymbols(request); + } const result = []; for (let i = 0; i < response.length; i++) { const market = this.parseMarket(response[i]); @@ -7005,230 +7191,240 @@ class arzplus extends _abstract_arzplus_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa const parsedMarket = this.parseOTCMarkets(marketdata); result.push(parsedMarket); } - if (params['type']) { - return this.filterByArray(result, 'type', params['type'], false); - } return result; } - parseMarket(market) { - // { - // 'name': 'USDTIRT', - // 'asset': { - // 'id': 2, - // 'symbol': 'USDT', - // 'precision': 8, - // 'step_size': 8, - // 'name': 'tether', - // 'name_fa': 'تتر', - // 'logo': 'https://cdn.arzplus.net/core-static/coins/USDT.png', - // 'original_symbol': 'USDT', - // 'original_name_fa': 'تتر', - // 'trading_view_symbol': '', - // }, - // 'base_asset': { - // 'id': 1, - // 'symbol': 'IRT', - // 'precision': 0, - // 'step_size': 8, - // 'name': 'toman', - // 'name_fa': 'تومان', - // 'logo': 'https://cdn.arzplus.net/core-static/coins/IRT.png', - // 'original_symbol': 'IRT', - // 'original_name_fa': 'تومان', - // 'trading_view_symbol': '', - // }, - // 'enable': true, - // 'price': '59165', - // 'change': '-246', - // 'change_percent': '-0.41', - // 'high': '59619', - // 'low': '58750', - // 'volume': '215768.82', - // 'base_volume': '12757163742', - // 'bookmark': true, - // }; - const id = this.safeString(market, 'name'); - const baseAsset = this.safeDict(market, 'asset'); - const quoteAsset = this.safeDict(market, 'base_asset'); - let baseId = this.safeString(baseAsset, 'symbol'); - let quoteId = this.safeString(quoteAsset, 'symbol'); - const base = this.safeCurrencyCode(baseId); - const quote = this.safeCurrencyCode(quoteId); - baseId = baseId.toLowerCase(); - quoteId = quoteId.toLowerCase(); - return { - 'id': id, - 'symbol': base + '/' + quote, - 'base': base, - 'quote': quote, - 'settle': undefined, - 'baseId': baseId, - 'quoteId': quoteId, - 'settleId': undefined, - 'type': 'spot', - 'spot': true, - 'margin': false, - 'swap': false, - 'future': false, - 'option': false, - 'active': true, - 'contract': false, - 'linear': undefined, - 'inverse': undefined, - 'contractSize': undefined, - 'expiry': undefined, - 'expiryDatetime': undefined, - 'strike': undefined, - 'optionType': undefined, - 'precision': { - 'amount': undefined, - 'price': undefined, - }, - 'limits': { - 'leverage': { - 'min': undefined, - 'max': undefined, - }, - 'amount': { - 'min': undefined, - 'max': undefined, - }, - 'price': { - 'min': undefined, - 'max': undefined, - }, - 'cost': { - 'min': undefined, - 'max': undefined, - }, - }, - 'created': undefined, - 'info': market, - }; - } - parseOTCMarkets(market) { - // { - // symbol: "BTC", - // ask: "13877900000", - // bid: "13860999995", - // name: "bitcoin" - // }, - const baseAsset = this.safeString(market, 'symbol'); - const quoteAsset = this.safeString(market, 'quote'); - const baseId = baseAsset; - const quoteId = quoteAsset; - const base = this.safeCurrencyCode(baseId); - const quote = this.safeCurrencyCode(quoteId); - const id = this.safeString(market, 'id'); - return { - 'id': id, - 'symbol': base + '/' + quote, - 'base': base, - 'quote': quote, - 'settle': undefined, - 'baseId': baseId, - 'quoteId': quoteId, - 'settleId': undefined, - 'type': 'otc', - 'spot': false, - 'margin': false, - 'swap': false, - 'future': false, - 'option': false, - 'active': true, - 'contract': false, - 'linear': undefined, - 'inverse': undefined, - 'contractSize': undefined, - 'expiry': undefined, - 'expiryDatetime': undefined, - 'strike': undefined, - 'optionType': undefined, - 'precision': { - 'amount': undefined, - 'price': undefined, - }, - 'limits': { - 'leverage': { - 'min': undefined, - 'max': undefined, - }, - 'amount': { - 'min': undefined, - 'max': undefined, - }, - 'price': { - 'min': undefined, - 'max': undefined, - }, - 'cost': { - 'min': undefined, - 'max': undefined, - }, - }, - 'created': undefined, - 'info': market, - }; - } - async fetchTickers(symbols = undefined, params = {}) { - /** - * @method - * @name arzplus#fetchTickers - * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market - * @see https://api.arzplus.net/ - * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned - * @param {object} [params] extra parameters specific to the exchange API endpoint - * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure} - */ - await this.loadMarkets(); - if (symbols !== undefined) { - symbols = this.marketSymbols(symbols); + parseMarket(market, type = 'spot') { + if (type === 'otc') { + return this.parseOTCMarkets(market); } - const result = {}; - if (params['type'] === 'otc') { - const otcMarkets = await this.publicGetApiV1MarketIrtInfo(params); - for (let i = 0; i < otcMarkets.length; i++) { - const marketdata = otcMarkets[i]; - marketdata['quote'] = 'IRT'; - marketdata['id'] = 'OTC_' + marketdata['symbol'] + marketdata['quote']; - const parsedMarket = this.parseOTCTicker(marketdata); - const symbol = parsedMarket['symbol']; - result[symbol] = parsedMarket; - } - return this.filterByArrayTickers(result, 'symbol', symbols); - } - const response = await this.publicGetApiV1MarketSymbols(params); - for (let i = 0; i < response.length; i++) { - const request = { - 'symbol': response[i]['name'], - }; - const assetDetails = await this.publicGetApiV1MarketSymbols(request); - const ticker = this.parseTicker(assetDetails); - const symbol = ticker['symbol']; - result[symbol] = ticker; - } - return this.filterByArrayTickers(result, 'symbol', symbols); - } - async fetchTicker(symbol, params = {}) { - /** - * @method - * @name arzplus#fetchTicker - * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market - * @see https://api.arzplus.net/ - * @param {string} symbol unified symbol of the market to fetch the ticker for - * @param {object} [params] extra parameters specific to the exchange API endpoint - * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure} - */ - await this.loadMarkets(); - const market = this.market(symbol); - const request = { - 'symbol': market['id'], - }; - const response = await this.publicGetApiV1MarketSymbols(request); - const ticker = this.parseTicker(response); - return ticker; + return this.parseSpotMarket(market); } - parseTicker(ticker, market = undefined) { + parseSpotMarket(market) { + // { + // 'name': 'USDTIRT', + // 'asset': { + // 'id': 2, + // 'symbol': 'USDT', + // 'precision': 8, + // 'step_size': 8, + // 'name': 'tether', + // 'name_fa': 'تتر', + // 'logo': 'https://cdn.arzplus.net/core-static/coins/USDT.png', + // 'original_symbol': 'USDT', + // 'original_name_fa': 'تتر', + // 'trading_view_symbol': '', + // }, + // 'base_asset': { + // 'id': 1, + // 'symbol': 'IRT', + // 'precision': 0, + // 'step_size': 8, + // 'name': 'toman', + // 'name_fa': 'تومان', + // 'logo': 'https://cdn.arzplus.net/core-static/coins/IRT.png', + // 'original_symbol': 'IRT', + // 'original_name_fa': 'تومان', + // 'trading_view_symbol': '', + // }, + // 'enable': true, + // 'price': '59165', + // 'change': '-246', + // 'change_percent': '-0.41', + // 'high': '59619', + // 'low': '58750', + // 'volume': '215768.82', + // 'base_volume': '12757163742', + // 'bookmark': true, + // }; + const id = this.safeString(market, 'name'); + const baseAsset = this.safeDict(market, 'asset'); + const quoteAsset = this.safeDict(market, 'base_asset'); + let baseId = this.safeString(baseAsset, 'symbol'); + let quoteId = this.safeString(quoteAsset, 'symbol'); + const base = this.safeCurrencyCode(baseId); + const quote = this.safeCurrencyCode(quoteId); + baseId = baseId.toLowerCase(); + quoteId = quoteId.toLowerCase(); + return { + 'id': id, + 'symbol': base + '/' + quote, + 'base': base, + 'quote': quote, + 'settle': undefined, + 'baseId': baseId, + 'quoteId': quoteId, + 'settleId': undefined, + 'type': 'spot', + 'spot': true, + 'margin': false, + 'swap': false, + 'future': false, + 'option': false, + 'active': true, + 'contract': false, + 'linear': undefined, + 'inverse': undefined, + 'contractSize': undefined, + 'expiry': undefined, + 'expiryDatetime': undefined, + 'strike': undefined, + 'optionType': undefined, + 'precision': { + 'amount': undefined, + 'price': undefined, + }, + 'limits': { + 'leverage': { + 'min': undefined, + 'max': undefined, + }, + 'amount': { + 'min': undefined, + 'max': undefined, + }, + 'price': { + 'min': undefined, + 'max': undefined, + }, + 'cost': { + 'min': undefined, + 'max': undefined, + }, + }, + 'created': undefined, + 'info': market, + }; + } + parseOTCMarkets(market) { + // { + // symbol: "BTC", + // ask: "13877900000", + // bid: "13860999995", + // name: "bitcoin" + // qoute: "IRT", + // id: "OTC_BTCIRT" + // }, + const baseAsset = this.safeString(market, 'symbol'); + const quoteAsset = this.safeString(market, 'quote'); + const baseId = baseAsset; + const quoteId = quoteAsset; + const base = this.safeCurrencyCode(baseId); + const quote = this.safeCurrencyCode(quoteId); + const id = this.safeString(market, 'id'); + return { + 'id': id, + 'symbol': base + '/' + quote, + 'base': base, + 'quote': quote, + 'settle': undefined, + 'baseId': baseId, + 'quoteId': quoteId, + 'settleId': undefined, + 'type': 'otc', + 'spot': false, + 'margin': false, + 'swap': false, + 'future': false, + 'option': false, + 'active': true, + 'contract': false, + 'linear': undefined, + 'inverse': undefined, + 'contractSize': undefined, + 'expiry': undefined, + 'expiryDatetime': undefined, + 'strike': undefined, + 'optionType': undefined, + 'precision': { + 'amount': undefined, + 'price': undefined, + }, + 'limits': { + 'leverage': { + 'min': undefined, + 'max': undefined, + }, + 'amount': { + 'min': undefined, + 'max': undefined, + }, + 'price': { + 'min': undefined, + 'max': undefined, + }, + 'cost': { + 'min': undefined, + 'max': undefined, + }, + }, + 'created': undefined, + 'info': market, + }; + } + async fetchTickers(symbols = undefined, params = {}) { + /** + * @method + * @name arzplus#fetchTickers + * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market + * @see https://api.arzplus.net/ + * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned + * @param {object} [params] extra parameters specific to the exchange API endpoint + * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure} + */ + const marketType = this.safeString(params, 'type', 'spot'); + await this.loadMarkets(false, { 'type': marketType }); + if (symbols !== undefined) { + symbols = this.marketSymbols(symbols); + } + const result = {}; + if (marketType === 'otc') { + const otcMarkets = await this.publicGetApiV1MarketIrtInfo(params); + for (let i = 0; i < otcMarkets.length; i++) { + const marketdata = otcMarkets[i]; + marketdata['quote'] = 'IRT'; + marketdata['id'] = 'OTC_' + marketdata['symbol'] + marketdata['quote']; + const parsedMarket = this.parseOTCTicker(marketdata); + const symbol = parsedMarket['symbol']; + result[symbol] = parsedMarket; + } + return this.filterByArrayTickers(result, 'symbol', symbols); + } + const response = await this.publicGetApiV1MarketSymbols(params); + for (let i = 0; i < response.length; i++) { + const request = { + 'symbol': response[i]['name'], + }; + const assetDetails = await this.publicGetApiV1MarketSymbols(request); + const ticker = this.parseTicker(assetDetails); + const symbol = ticker['symbol']; + result[symbol] = ticker; + } + return this.filterByArrayTickers(result, 'symbol', symbols); + } + async fetchTicker(symbol, params = {}) { + /** + * @method + * @name arzplus#fetchTicker + * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market + * @see https://api.arzplus.net/ + * @param {string} symbol unified symbol of the market to fetch the ticker for + * @param {object} [params] extra parameters specific to the exchange API endpoint + * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure} + */ + const marketType = this.safeString(params, 'type', 'spot'); + if (marketType === 'otc') { + throw new Error('OTC markets are not supported'); + } + await this.loadMarkets(false, { 'type': marketType }); + const market = this.market(symbol); + const request = { + 'symbol': market['id'], + }; + const response = await this.publicGetApiV1MarketSymbols(request); + const ticker = this.parseTicker(response); + return ticker; + } + parseTicker(ticker, market = undefined) { // { // 'name': 'USDTIRT', // 'asset': { @@ -7348,7 +7544,7 @@ class arzplus extends _abstract_arzplus_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume */ - await this.loadMarkets(); + await this.loadMarkets(false, { 'type': 'otc' }); const market = this.market(symbol); const endTime = Date.now(); const request = { @@ -7394,7 +7590,7 @@ class arzplus extends _abstract_arzplus_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} a dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbol */ - await this.loadMarkets(); + await this.loadMarkets(false, { 'type': 'otc' }); const market = this.market(symbol); const request = { 'symbol': market['id'], @@ -48413,6 +48609,323 @@ class bitbank extends _abstract_bitbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa } +/***/ }), + +/***/ 2799: +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ A: () => (/* binding */ bitbarg) +/* harmony export */ }); +/* harmony import */ var _abstract_bitbarg_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(108); +// --------------------------------------------------------------------------- + +// --------------------------------------------------------------------------- +/** + * @class bitbarg + * @augments Exchange + * @description Set rateLimit to 1000 if fully verified + */ +class bitbarg extends _abstract_bitbarg_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A { + describe() { + return this.deepExtend(super.describe(), { + 'id': 'bitbarg', + 'name': 'Bitbarg', + 'countries': ['IR'], + 'rateLimit': 1000, + 'version': '1', + 'certified': false, + 'pro': false, + 'has': { + 'CORS': undefined, + 'spot': true, + 'margin': false, + 'swap': false, + 'future': false, + 'option': false, + 'addMargin': false, + 'cancelAllOrders': false, + 'cancelOrder': false, + 'cancelOrders': false, + 'createDepositAddress': false, + 'createOrder': false, + 'createStopLimitOrder': false, + 'createStopMarketOrder': false, + 'createStopOrder': false, + 'editOrder': false, + 'fetchBalance': false, + 'fetchBorrowInterest': false, + 'fetchBorrowRateHistories': false, + 'fetchBorrowRateHistory': false, + 'fetchClosedOrders': false, + 'fetchCrossBorrowRate': false, + 'fetchCrossBorrowRates': false, + 'fetchCurrencies': false, + 'fetchDepositAddress': false, + 'fetchDeposits': false, + 'fetchFundingHistory': false, + 'fetchFundingRate': false, + 'fetchFundingRateHistory': false, + 'fetchFundingRates': false, + 'fetchIndexOHLCV': false, + 'fetchIsolatedBorrowRate': false, + 'fetchIsolatedBorrowRates': false, + 'fetchL2OrderBook': false, + 'fetchL3OrderBook': false, + 'fetchLedger': false, + 'fetchLedgerEntry': false, + 'fetchLeverageTiers': false, + 'fetchMarkets': true, + 'fetchMarkOHLCV': false, + 'fetchMyTrades': false, + 'fetchOHLCV': false, + 'fetchOpenInterestHistory': false, + 'fetchOpenOrders': false, + 'fetchOrder': false, + 'fetchOrderBook': false, + 'fetchOrders': false, + 'fetchOrderTrades': 'emulated', + 'fetchPositions': false, + 'fetchPremiumIndexOHLCV': false, + 'fetchTicker': true, + 'fetchTickers': true, + 'fetchTime': false, + 'fetchTrades': false, + 'fetchTradingFee': false, + 'fetchTradingFees': false, + 'fetchWithdrawals': false, + 'setLeverage': false, + 'setMarginMode': false, + 'transfer': false, + 'withdraw': false, + }, + 'comment': 'This comment is optional', + 'urls': { + 'logo': 'https://cdn.arz.digital/cr-odin/img/exchanges/bitbarg/64x64.png', + 'api': { + 'public': 'https://api.bitbarg.com', + }, + 'www': 'https://bitbarg.com/', + 'doc': [ + 'https://bitbarg.com/', + ], + }, + 'api': { + 'public': { + 'get': { + '/api/v1/currencies': 1, + }, + }, + }, + 'fees': { + 'trading': { + 'tierBased': false, + 'percentage': true, + 'maker': this.parseNumber('0.001'), + 'taker': this.parseNumber('0.001'), + }, + }, + }); + } + parseMarket(market) { + // "id": 53, + // "icon": "https://s3.bitbarg.com/currencies/btc.webp", + // "tradeActive": true, + // "faName": "بیت کوین", + // "enName": "Bitcoin", + // "coin": "BTC", + // "path": "bitcoin", + // "price": 112192, + // "quote": "813430226.5004", + // "percent": -5.735, + // "decimal": 8, + // "isFavorite": false, + const baseId = this.safeString(market, 'coin'); + const quoteId = 'USDT'; + const base = this.safeCurrencyCode(baseId); + const quote = this.safeCurrencyCode(quoteId); + const id = baseId + '/' + quoteId; + return { + 'id': id, + 'symbol': id, + 'base': base, + 'quote': quote, + 'settle': undefined, + 'baseId': baseId, + 'quoteId': quoteId, + 'settleId': undefined, + 'type': 'otc', + 'spot': false, + 'margin': false, + 'swap': false, + 'future': false, + 'option': false, + 'active': true, + 'contract': false, + 'linear': undefined, + 'inverse': undefined, + 'contractSize': undefined, + 'expiry': undefined, + 'expiryDatetime': undefined, + 'strike': undefined, + 'optionType': undefined, + 'precision': { + 'amount': undefined, + 'price': undefined, + }, + 'limits': { + 'leverage': { + 'min': undefined, + 'max': undefined, + }, + 'amount': { + 'min': undefined, + 'max': undefined, + }, + 'price': { + 'min': undefined, + 'max': undefined, + }, + 'cost': { + 'min': undefined, + 'max': undefined, + }, + }, + 'created': undefined, + 'info': market, + }; + } + async fetchMarkets(params = {}) { + /** + * @method + * @name bitbarg#fetchMarkets + * @description retrieves data on all markets for bitbarg + * @see https://api.bitbarg.com/api/v1/currencies?pageSize=-1 + * @param {object} [params] extra parameters specific to the exchange API endpoint + * @returns {object[]} an array of objects representing market data + */ + const request = { + 'pageSize': -1, + }; + const response = await this.publicGetApiV1Currencies(this.extend(request, params)); + const result = []; + const data = this.safeDict(response, 'result', {}); + const items = this.safeList(data, 'items', []); + // Create markets for each currency with IRT quote + for (let i = 0; i < items.length; i++) { + const market = this.parseMarket(items[i]); + result.push(market); + } + return result; + } + async fetchTickers(symbols = undefined, params = {}) { + /** + * @method + * @name bitbarg#fetchTickers + * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market + * @see https://api.bitbarg.com/api/v1/currencies?pageSize=-1 + * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned + * @param {object} [params] extra parameters specific to the exchange API endpoint + * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure} + */ + await this.loadMarkets(); + if (symbols !== undefined) { + symbols = this.marketSymbols(symbols); + } + const request = { + 'pageSize': -1, + }; + const response = await this.publicGetApiV1Currencies(this.extend(request, params)); + const data = this.safeDict(response, 'result', {}); + const items = this.safeList(data, 'items', []); + const result = {}; + for (let i = 0; i < items.length; i++) { + const coinData = items[i]; + const baseId = this.safeString(coinData, 'coin'); + // Create ticker for USDT quote + const quoteId = 'USDT'; + const base = this.safeCurrencyCode(baseId); + const quote = this.safeCurrencyCode(quoteId); + const symbol = base + '/' + quote; + const ticker = this.extend({ + 'symbol': symbol, + 'baseId': baseId, + 'quoteId': quoteId, + 'id': baseId + '/' + quoteId, + }, coinData); + result[symbol] = this.parseTicker(ticker); + } + return this.filterByArrayTickers(result, 'symbol', symbols); + } + async fetchTicker(symbol, params = {}) { + /** + * @method + * @name bitbarg#fetchTicker + * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market + * @see https://api.bitbarg.com/api/v1/currencies?pageSize=-1 + * @param {string} symbol unified symbol of the market to fetch the ticker for + * @param {object} [params] extra parameters specific to the exchange API endpoint + * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure} + */ + const ticker = await this.fetchTickers([symbol]); + return ticker[symbol]; + } + parseTicker(ticker, market = undefined) { + // { + // "id": 1, + // "icon": "https://...", + // "tradeActive": true, + // "faName": "بیت کوین", + // "enName": "Bitcoin", + // "coin": "BTC", + // "path": "bitcoin", + // "price": 110387.56, + // "quote": "57479298399.76", + // "percent": -3.01, + // "decimal": 5, + // "isFavorite": false, + // "chart": [...] + // } + const marketType = 'otc'; + const marketId = this.safeString(ticker, 'coin') + '/' + 'USDT'; + const symbol = this.safeSymbol(marketId, market, undefined, marketType); + const last = this.safeFloat(ticker, 'price', 0); + const percentage = this.safeFloat(ticker, 'percent', 0); + const baseVolume = this.safeFloat(ticker, 'quote'); + return this.safeTicker({ + 'symbol': symbol, + 'timestamp': undefined, + 'datetime': undefined, + 'high': undefined, + 'low': undefined, + 'bid': last, + 'bidVolume': undefined, + 'ask': last, + 'askVolume': undefined, + 'vwap': undefined, + 'open': undefined, + 'close': last, + 'last': last, + 'previousClose': undefined, + 'change': undefined, + 'percentage': percentage, + 'average': undefined, + 'baseVolume': baseVolume, + 'quoteVolume': undefined, + 'info': ticker, + }, market); + } + sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) { + let url = this.urls['api']['public'] + path; + if (Object.keys(params).length) { + url += '?' + this.urlencode(params); + } + headers = { 'Content-Type': 'application/json' }; + return { 'url': url, 'method': method, 'body': body, 'headers': headers }; + } +} + + /***/ }), /***/ 6328: @@ -111694,6 +112207,796 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default" } +/***/ }), + +/***/ 5000: +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ A: () => (/* binding */ bydfi) +/* harmony export */ }); +/* harmony import */ var _abstract_bydfi_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5439); +// --------------------------------------------------------------------------- + +// --------------------------------------------------------------------------- +/** + * @class bydfi + * @augments Exchange + * @description Set rateLimit to 1000 if fully verified + */ +class bydfi extends _abstract_bydfi_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A { + describe() { + return this.deepExtend(super.describe(), { + 'id': 'bydfi', + 'name': 'Bydfi', + 'countries': ['SC'], + 'rateLimit': 1000, + 'version': '1', + 'certified': false, + 'pro': false, + 'has': { + 'CORS': undefined, + 'spot': true, + 'margin': false, + 'swap': false, + 'future': false, + 'option': false, + 'addMargin': false, + 'cancelAllOrders': false, + 'cancelOrder': false, + 'cancelOrders': false, + 'createDepositAddress': false, + 'createOrder': false, + 'createStopLimitOrder': false, + 'createStopMarketOrder': false, + 'createStopOrder': false, + 'editOrder': false, + 'fetchBalance': false, + 'fetchBorrowInterest': false, + 'fetchBorrowRateHistories': false, + 'fetchBorrowRateHistory': false, + 'fetchClosedOrders': false, + 'fetchCrossBorrowRate': false, + 'fetchCrossBorrowRates': false, + 'fetchCurrencies': false, + 'fetchDepositAddress': false, + 'fetchDeposits': false, + 'fetchFundingHistory': false, + 'fetchFundingRate': false, + 'fetchFundingRateHistory': false, + 'fetchFundingRates': false, + 'fetchIndexOHLCV': false, + 'fetchIsolatedBorrowRate': false, + 'fetchIsolatedBorrowRates': false, + 'fetchL2OrderBook': false, + 'fetchL3OrderBook': false, + 'fetchLedger': false, + 'fetchLedgerEntry': false, + 'fetchLeverageTiers': false, + 'fetchMarkets': true, + 'fetchMarkOHLCV': false, + 'fetchMyTrades': false, + 'fetchOHLCV': true, + 'fetchOpenInterestHistory': false, + 'fetchOpenOrders': false, + 'fetchOrder': false, + 'fetchOrderBook': true, + 'fetchOrders': false, + 'fetchOrderTrades': 'emulated', + 'fetchPositions': false, + 'fetchPremiumIndexOHLCV': false, + 'fetchTicker': true, + 'fetchTickers': true, + 'fetchTime': false, + 'fetchTrades': false, + 'fetchTradingFee': false, + 'fetchTradingFees': false, + 'fetchWithdrawals': false, + 'setLeverage': false, + 'setMarginMode': false, + 'transfer': false, + 'withdraw': false, + }, + 'comment': 'This comment is optional', + 'urls': { + 'logo': 'https://cdn.arz.digital/cr-odin/img/exchanges/bydfi/64x64.png', + 'api': { + 'public': 'https://www.bydfi.com', + 'quote': 'https://quote.bydfi.pro', + }, + 'www': 'https://www.bydfi.com/', + 'doc': [ + 'https://www.bydfi.com/', + ], + }, + 'timeframes': { + '1m': '1', + '5m': '5', + '15m': '15', + '30m': '30', + '1h': '60', + '4h': '240', + '1d': 'D', + '1w': 'W', + '1M': 'M', + }, + 'api': { + 'public': { + 'get': { + 'api/spot/product/list': 1, + 'api/tv/tradingView/history': 1, + }, + }, + 'quote': { + 'get': { + 'tickers': 1, + 'mkpai/depth-v2': 1, + }, + }, + }, + 'fees': { + 'trading': { + 'tierBased': false, + 'percentage': true, + 'maker': this.parseNumber('0.001'), + 'taker': this.parseNumber('0.001'), + }, + }, + }); + } + async fetchMarkets(params = {}) { + /** + * @method + * @name bydfi#fetchMarkets + * @description retrieves data on all markets for bydfi + * @see https://www.bydfi.com/api/spot/product/list + * @param {object} [params] extra parameters specific to the exchange API endpoint + * @returns {object[]} an array of objects representing market data + */ + const response = await this.publicGetApiSpotProductList(params); + const data = this.safeList(response, 'data', []); + const result = []; + for (let i = 0; i < data.length; i++) { + const market = this.parseMarket(data[i]); + result.push(market); + } + return result; + } + parseMarket(market) { + // { + // "symbol": "BTC_USDT", + // "alias": "BTC/USDT", + // "baseCoin": "BTC", + // "quoteCoin": "USDT", + // "icon": "https://...", + // "type": 1, + // "tags": "hot", + // "visible": true, + // "anonymous": false, + // "canBuy": true, + // "canSell": true, + // "canGrid": true, + // "depth": "0.01,0.1,1", + // "matchMode": 1, + // "priceScale": 2, + // "volumeScale": 6, + // "amountScale": 2, + // "makerRate": 0.001, + // "takerRate": 0.001, + // "feeCoin": "USDT", + // "volumeMin": 0.000001, + // "amountMin": 5 + // } + const id = this.safeString(market, 'symbol'); + const baseId = this.safeString(market, 'baseCoin'); + const quoteId = this.safeString(market, 'quoteCoin'); + const base = this.safeCurrencyCode(baseId); + const quote = this.safeCurrencyCode(quoteId); + const visible = this.safeBool(market, 'visible', true); + const canBuy = this.safeBool(market, 'canBuy', true); + const canSell = this.safeBool(market, 'canSell', true); + const active = visible && canBuy && canSell; + return { + 'id': id, + 'symbol': base + '/' + quote, + 'base': base, + 'quote': quote, + 'settle': undefined, + 'baseId': baseId, + 'quoteId': quoteId, + 'settleId': undefined, + 'type': 'spot', + 'spot': true, + 'margin': false, + 'swap': false, + 'future': false, + 'option': false, + 'active': active, + 'contract': false, + 'linear': undefined, + 'inverse': undefined, + 'contractSize': undefined, + 'expiry': undefined, + 'expiryDatetime': undefined, + 'strike': undefined, + 'optionType': undefined, + 'precision': { + 'amount': this.safeInteger(market, 'volumeScale'), + 'price': this.safeInteger(market, 'priceScale'), + }, + 'limits': { + 'leverage': { + 'min': undefined, + 'max': undefined, + }, + 'amount': { + 'min': this.safeNumber(market, 'volumeMin'), + 'max': undefined, + }, + 'price': { + 'min': undefined, + 'max': undefined, + }, + 'cost': { + 'min': this.safeNumber(market, 'amountMin'), + 'max': undefined, + }, + }, + 'created': undefined, + 'info': market, + }; + } + async fetchTickers(symbols = undefined, params = {}) { + /** + * @method + * @name bydfi#fetchTickers + * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market + * @see https://quote.bydfi.pro/tickers?preHour=24 + * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned + * @param {object} [params] extra parameters specific to the exchange API endpoint + * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure} + */ + await this.loadMarkets(); + if (symbols !== undefined) { + symbols = this.marketSymbols(symbols); + } + const request = { + 'preHour': 24, + }; + const response = await this.quoteGetTickers(this.extend(request, params)); + const data = this.safeString(response, 'data', ''); + // Parse the CSV-like response (cast to string for safety) + const tickers = String(data).split(';'); + const result = {}; + for (let i = 0; i < tickers.length; i++) { + const tickerStr = tickers[i].trim(); + if (tickerStr.length === 0) { + continue; + } + const ticker = this.parseTicker(tickerStr); + const symbol = ticker['symbol']; + result[symbol] = ticker; + } + return this.filterByArrayTickers(result, 'symbol', symbols); + } + async fetchTicker(symbol, params = {}) { + /** + * @method + * @name bydfi#fetchTicker + * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market + * @see https://quote.bydfi.pro/tickers?preHour=24 + * @param {string} symbol unified symbol of the market to fetch the ticker for + * @param {object} [params] extra parameters specific to the exchange API endpoint + * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure} + */ + await this.loadMarkets(); + const tickers = await this.fetchTickers([symbol], params); + return tickers[symbol]; + } + parseTicker(ticker, market = undefined) { + // BTC_USDT, -1, 112148.56000, 121452.59000, 0.00000, 0.00000, 0.00000, 0.0000, 122518.22000, 102403.50000, 2935.7203 + // Fields: + // 0: symbol (BTC_USDT) + // 1: trend indicator (-1 = down, 0 = neutral, 1 = up) + // 2: last price + // 3: 24h high + // 4: 24h low + // 5: price change + // 6: base volume (BTC) + // 7: price change percentage + // 8: bid price + // 9: ask price + // 10: 24h quote volume (USDT) + let parts = []; + if (typeof ticker === 'string') { + parts = ticker.split(','); + } + else { + return this.safeTicker({}, market); + } + if (parts.length < 11) { + return this.safeTicker({}, market); + } + const marketType = 'spot'; + const marketId = parts[0].trim(); + const symbol = this.safeSymbol(marketId, market, '_', marketType); + const last = this.safeFloat(parts, 2); + const high = this.safeFloat(parts, 3); + const low = this.safeFloat(parts, 4); + const change = this.safeFloat(parts, 5); + const baseVolume = this.safeFloat(parts, 6); + const percentage = this.safeFloat(parts, 7); + const bid = this.safeFloat(parts, 8); + const ask = this.safeFloat(parts, 9); + const quoteVolume = this.safeFloat(parts, 10); + return this.safeTicker({ + 'symbol': symbol, + 'timestamp': undefined, + 'datetime': undefined, + 'high': high, + 'low': low, + 'bid': bid, + 'bidVolume': undefined, + 'ask': ask, + 'askVolume': undefined, + 'vwap': undefined, + 'open': undefined, + 'close': last, + 'last': last, + 'previousClose': undefined, + 'change': change, + 'percentage': percentage, + 'average': undefined, + 'baseVolume': baseVolume, + 'quoteVolume': quoteVolume, + 'info': ticker, + }, market); + } + async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) { + /** + * @method + * @name bydfi#fetchOHLCV + * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market + * @see https://www.bydfi.com/api/tv/tradingView/history + * @param {string} symbol unified symbol of the market to fetch OHLCV data for + * @param {string} timeframe the length of time each candle represents + * @param {int} [since] timestamp in ms of the earliest candle to fetch + * @param {int} [limit] the maximum amount of candles to fetch + * @param {object} [params] extra parameters specific to the exchange API endpoint + * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume + */ + await this.loadMarkets(); + const market = this.market(symbol); + const endTime = Date.now(); + const request = { + 'symbol': market['id'], + 'from': (endTime / 1000) - (24 * 60 * 60), + 'to': endTime / 1000, + 'resolution': this.safeString(this.timeframes, timeframe, timeframe), + }; + if (since !== undefined) { + request['from'] = since / 1000; + } + request['from'] = this.safeInteger(request, 'from'); + request['to'] = this.safeInteger(request, 'to'); + if (timeframe !== undefined) { + request['resolution'] = this.safeString(this.timeframes, timeframe, timeframe); + } + const response = await this.publicGetApiTvTradingViewHistory(request); + const openList = this.safeList(response, 'o', []); + const highList = this.safeList(response, 'h', []); + const lowList = this.safeList(response, 'l', []); + const closeList = this.safeList(response, 'c', []); + const volumeList = this.safeList(response, 'v', []); + const timestampList = this.safeList(response, 't', []); + const ohlcvs = []; + for (let i = 0; i < openList.length; i++) { + ohlcvs.push([ + this.safeInteger(timestampList, i), + this.safeFloat(openList, i), + this.safeFloat(highList, i), + this.safeFloat(lowList, i), + this.safeFloat(closeList, i), + this.safeFloat(volumeList, i), + ]); + } + return this.parseOHLCVs(ohlcvs, market, timeframe, since, limit); + } + async fetchOrderBook(symbol, limit = 1, params = {}) { + /** + * @method + * @name bydfi#fetchOrderBook + * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data + * @see https://quote.bydfi.pro/mkpai/depth-v2 + * @param {string} symbol unified symbol of the market to fetch the order book for + * @param {int} [limit] the maximum amount of order book entries to return + * @param {object} [params] extra parameters specific to the exchange API endpoint + * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols + */ + await this.loadMarkets(); + const market = this.market(symbol); + const request = { + 'businessType': market['id'], + 'dType': 0, + }; + if (limit !== undefined) { + request['size'] = limit; + } + const response = await this.quoteGetMkpaiDepthV2(request); + const data = this.safeDict(response, 'data', {}); + const timestamp = Date.now(); + const orderbook = this.parseOrderBook(data, symbol, timestamp, 'bids', 'asks', 'price', 'amount'); + return orderbook; + } + sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) { + const query = this.omit(params, this.extractParams(path)); + let url = ''; + if (api === 'quote') { + url = this.urls['api']['quote'] + '/' + path; + } + else { + url = this.urls['api']['public'] + '/' + path; + } + if (Object.keys(query).length) { + url += '?' + this.urlencode(query); + } + headers = { 'Content-Type': 'application/json' }; + return { 'url': url, 'method': method, 'body': body, 'headers': headers }; + } +} + + +/***/ }), + +/***/ 5226: +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ A: () => (/* binding */ cafearz) +/* harmony export */ }); +/* harmony import */ var _abstract_cafearz_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5925); +// --------------------------------------------------------------------------- + +// --------------------------------------------------------------------------- +/** + * @class cafearz + * @augments Exchange + * @description Set rateLimit to 1000 if fully verified + */ +class cafearz extends _abstract_cafearz_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A { + describe() { + return this.deepExtend(super.describe(), { + 'id': 'cafearz', + 'name': 'Cafearz', + 'countries': ['IR'], + 'rateLimit': 1000, + 'version': '1', + 'certified': false, + 'pro': false, + 'has': { + 'CORS': undefined, + 'spot': false, + 'margin': false, + 'swap': false, + 'future': false, + 'option': false, + 'addMargin': false, + 'cancelAllOrders': false, + 'cancelOrder': false, + 'cancelOrders': false, + 'createDepositAddress': false, + 'createOrder': false, + 'createStopLimitOrder': false, + 'createStopMarketOrder': false, + 'createStopOrder': false, + 'editOrder': false, + 'fetchBalance': false, + 'fetchBorrowInterest': false, + 'fetchBorrowRateHistories': false, + 'fetchBorrowRateHistory': false, + 'fetchClosedOrders': false, + 'fetchCrossBorrowRate': false, + 'fetchCrossBorrowRates': false, + 'fetchCurrencies': false, + 'fetchDepositAddress': false, + 'fetchDeposits': false, + 'fetchFundingHistory': false, + 'fetchFundingRate': false, + 'fetchFundingRateHistory': false, + 'fetchFundingRates': false, + 'fetchIndexOHLCV': false, + 'fetchIsolatedBorrowRate': false, + 'fetchIsolatedBorrowRates': false, + 'fetchL2OrderBook': false, + 'fetchL3OrderBook': false, + 'fetchLedger': false, + 'fetchLedgerEntry': false, + 'fetchLeverageTiers': false, + 'fetchMarkets': true, + 'fetchMarkOHLCV': false, + 'fetchMyTrades': false, + 'fetchOHLCV': false, + 'fetchOpenInterestHistory': false, + 'fetchOpenOrders': false, + 'fetchOrder': false, + 'fetchOrderBook': false, + 'fetchOrders': false, + 'fetchOrderTrades': 'emulated', + 'fetchPositions': false, + 'fetchPremiumIndexOHLCV': false, + 'fetchTicker': true, + 'fetchTickers': true, + 'fetchTime': false, + 'fetchTrades': false, + 'fetchTradingFee': false, + 'fetchTradingFees': false, + 'fetchWithdrawals': false, + 'otc': true, + 'setLeverage': false, + 'setMarginMode': false, + 'transfer': false, + 'withdraw': false, + }, + 'comment': 'This comment is optional', + 'urls': { + 'logo': 'https://cdn.arz.digital/cr-odin/img/exchanges/cafearz/64x64.png', + 'api': { + 'public': 'https://api2.cafearz.com', + }, + 'www': 'https://cafearz.com/', + 'doc': [ + 'https://cafearz.com/', + ], + }, + 'api': { + 'public': { + 'get': { + '/api/client/v1/currencies/prices/digital': 1, + }, + }, + }, + 'fees': { + 'trading': { + 'tierBased': false, + 'percentage': true, + 'maker': this.parseNumber('0.001'), + 'taker': this.parseNumber('0.001'), + }, + }, + }); + } + parseMarket(market) { + // { + // "symbol": "BTC", + // "name": "Bitcoin", + // "title": "بیت کوین", + // "service_id": 14, + // "rank": 1, + // "price": { + // "buy": 12726581792.3999996185302734375, + // "sell": 12571941095.936672210693359375, + // "dollar": 110387.5599999999976716935634613037109375 + // }, + // "chart": { + // "changes": "down", + // "changes_percentage": 107.0799999999999982946974341757595539093017578125, + // "data": { + // "1404/07/05": "109643.46000000", + // "1404/07/06": "109635.85000000", + // "1404/07/07": "112163.95000000", + // "1404/07/08": "114311.96000000", + // "1404/07/09": "114048.93000000", + // "1404/07/10": "118594.99000000", + // "1404/07/11": "120529.35000000", + // "1404/07/12": "122232.00000000", + // "1404/07/13": "122391.00000000", + // "1404/07/14": "123482.31000000", + // "1404/07/15": "124658.54000000", + // "1404/07/16": "121332.95000000", + // "1404/07/17": "123306.00000000", + // "1404/07/18": "121662.40000000", + // "1404/07/19": "113613.18000000" + // } + // }, + // "decimal_digit": "5", + // "market_cap": 2018807729876.182861328125, + // "volume_24h": 57479298399.76000213623046875, + // "percent_change_1h": 0.00643466000000000003244959856374407536350190639495849609375, + // "percent_change_24h": -3.013435680000000171929741554777137935161590576171875, + // "percent_change_7d": -3.848675339999999778228811919689178466796875, + // "base_icon": "https://api2.cafearz.com/assets/images/coins/1.png", + // "icon": "https://storage.cafearz.com/wp-content/uploads/coins/BTC.png" + // }, + const baseId = this.safeString(market, 'symbol'); + const quoteId = 'IRT'; + const base = this.safeCurrencyCode(baseId); + const quote = this.safeCurrencyCode(quoteId); + const id = baseId + '/' + quoteId; + return { + 'id': id, + 'symbol': base + '/' + quote, + 'base': base, + 'quote': quote, + 'settle': undefined, + 'baseId': baseId, + 'quoteId': quoteId, + 'settleId': undefined, + 'type': 'otc', + 'spot': false, + 'margin': false, + 'swap': false, + 'future': false, + 'option': false, + 'active': true, + 'contract': false, + 'linear': undefined, + 'inverse': undefined, + 'contractSize': undefined, + 'expiry': undefined, + 'expiryDatetime': undefined, + 'strike': undefined, + 'optionType': undefined, + 'precision': { + 'amount': undefined, + 'price': undefined, + }, + 'limits': { + 'leverage': { + 'min': undefined, + 'max': undefined, + }, + 'amount': { + 'min': undefined, + 'max': undefined, + }, + 'price': { + 'min': undefined, + 'max': undefined, + }, + 'cost': { + 'min': undefined, + 'max': undefined, + }, + }, + 'created': undefined, + 'info': market, + }; + } + async fetchMarkets(params = {}) { + /** + * @method + * @name cafearz#fetchMarkets + * @description retrieves data on all markets for cafearz + * @see https://api2.cafearz.com/api/client/v1/currencies/prices/digital + * @param {object} [params] extra parameters specific to the exchange API endpoint + * @returns {object[]} an array of objects representing market data + */ + const response = await this.publicGetApiClientV1CurrenciesPricesDigital(params); + const result = []; + const prices = this.safeDict(response, 'prices', {}); + const symbols = Object.keys(prices); + // Create markets for each symbol with IRT quote + for (let i = 0; i < symbols.length; i++) { + const market = this.parseMarket(prices[symbols[i]]); + result.push(market); + } + return result; + } + async fetchTickers(symbols = undefined, params = {}) { + /** + * @method + * @name cafearz#fetchTickers + * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market + * @see https://api2.cafearz.com/api/client/v1/currencies/prices/digital + * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned + * @param {object} [params] extra parameters specific to the exchange API endpoint + * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure} + */ + await this.loadMarkets(); + if (symbols !== undefined) { + symbols = this.marketSymbols(symbols); + } + const response = await this.publicGetApiClientV1CurrenciesPricesDigital(params); + const prices = this.safeDict(response, 'prices', {}); + const result = {}; + const coinSymbols = Object.keys(prices); + for (let i = 0; i < coinSymbols.length; i++) { + const baseId = coinSymbols[i]; + const coinData = prices[baseId]; + // Create ticker for IRT quote + const quoteId = 'IRT'; + const base = this.safeCurrencyCode(baseId); + const quote = this.safeCurrencyCode(quoteId); + const symbol = base + '/' + quote; + const ticker = this.extend({ + 'symbol': symbol, + 'baseId': baseId, + 'quoteId': quoteId, + 'id': baseId + '/' + quoteId, + }, coinData); + result[symbol] = this.parseTicker(ticker); + } + return this.filterByArrayTickers(result, 'symbol', symbols); + } + async fetchTicker(symbol, params = {}) { + /** + * @method + * @name cafearz#fetchTicker + * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market + * @see https://api2.cafearz.com/api/client/v1/currencies/prices/digital + * @param {string} symbol unified symbol of the market to fetch the ticker for + * @param {object} [params] extra parameters specific to the exchange API endpoint + * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure} + */ + const ticker = await this.fetchTickers([symbol]); + return ticker[symbol]; + } + parseTicker(ticker, market = undefined) { + // { + // "symbol": "BTC", + // "name": "Bitcoin", + // "title": "بیت کوین", + // "service_id": 14, + // "rank": 1, + // "price": { + // "buy": 13462469875.799999, + // "sell": 13298881860, + // "dollar": 117689.22 + // }, + // "chart": { + // "changes": "down", + // "changes_percentage": 101.33, + // "data": {...} + // }, + // "decimal_digit": "5", + // "market_cap": 2018807729876.182861, + // "volume_24h": 57479298399.76, + // "percent_change_1h": 0.00643466, + // "percent_change_24h": -3.013435, + // "percent_change_7d": -3.848675, + // "base_icon": "...", + // "icon": "..." + // } + const marketType = 'otc'; + const marketId = this.safeString(ticker, 'id'); + const symbol = this.safeSymbol(marketId, market, undefined, marketType); + const priceData = this.safeDict(ticker, 'price', {}); + const last = this.safeFloat(priceData, 'buy', 0); + const bid = this.safeFloat(priceData, 'sell', 0); + const ask = this.safeFloat(priceData, 'buy', 0); + const percentage = this.safeFloat(ticker, 'percent_change_24h', 0); + const baseVolume = this.safeFloat(ticker, 'volume_24h'); + return this.safeTicker({ + 'symbol': symbol, + 'timestamp': undefined, + 'datetime': undefined, + 'high': undefined, + 'low': undefined, + 'bid': bid, + 'bidVolume': undefined, + 'ask': ask, + 'askVolume': undefined, + 'vwap': undefined, + 'open': undefined, + 'close': last, + 'last': last, + 'previousClose': undefined, + 'change': undefined, + 'percentage': percentage, + 'average': undefined, + 'baseVolume': baseVolume, + 'quoteVolume': undefined, + 'info': ticker, + }, market); + } + sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) { + const url = this.urls['api']['public'] + path; + headers = { 'Content-Type': 'application/json' }; + return { 'url': url, 'method': method, 'body': body, 'headers': headers }; + } +} + + /***/ }), /***/ 8846: @@ -214042,6 +215345,421 @@ class kcex extends _abstract_kcex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] } +/***/ }), + +/***/ 3644: +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ A: () => (/* binding */ kifpoolme) +/* harmony export */ }); +/* harmony import */ var _abstract_kifpoolme_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8931); +// --------------------------------------------------------------------------- + +// --------------------------------------------------------------------------- +/** + * @class kifpoolme + * @augments Exchange + * @description Set rateLimit to 1000 if fully verified + */ +class kifpoolme extends _abstract_kifpoolme_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A { + describe() { + return this.deepExtend(super.describe(), { + 'id': 'kifpoolme', + 'name': 'Kifpool', + 'countries': ['IR'], + 'rateLimit': 1000, + 'version': '1', + 'certified': false, + 'pro': false, + 'has': { + 'CORS': undefined, + 'spot': true, + 'margin': false, + 'swap': false, + 'future': false, + 'option': false, + 'addMargin': false, + 'cancelAllOrders': false, + 'cancelOrder': false, + 'cancelOrders': false, + 'createDepositAddress': false, + 'createOrder': false, + 'createStopLimitOrder': false, + 'createStopMarketOrder': false, + 'createStopOrder': false, + 'editOrder': false, + 'fetchBalance': false, + 'fetchBorrowInterest': false, + 'fetchBorrowRateHistories': false, + 'fetchBorrowRateHistory': false, + 'fetchClosedOrders': false, + 'fetchCrossBorrowRate': false, + 'fetchCrossBorrowRates': false, + 'fetchCurrencies': false, + 'fetchDepositAddress': false, + 'fetchDeposits': false, + 'fetchFundingHistory': false, + 'fetchFundingRate': false, + 'fetchFundingRateHistory': false, + 'fetchFundingRates': false, + 'fetchIndexOHLCV': false, + 'fetchIsolatedBorrowRate': false, + 'fetchIsolatedBorrowRates': false, + 'fetchL2OrderBook': false, + 'fetchL3OrderBook': false, + 'fetchLedger': false, + 'fetchLedgerEntry': false, + 'fetchLeverageTiers': false, + 'fetchMarkets': true, + 'fetchMarkOHLCV': false, + 'fetchMyTrades': false, + 'fetchOHLCV': true, + 'fetchOpenInterestHistory': false, + 'fetchOpenOrders': false, + 'fetchOrder': false, + 'fetchOrderBook': false, + 'fetchOrders': false, + 'fetchOrderTrades': 'emulated', + 'fetchPositions': false, + 'fetchPremiumIndexOHLCV': false, + 'fetchTicker': true, + 'fetchTickers': true, + 'fetchTime': false, + 'fetchTrades': false, + 'fetchTradingFee': false, + 'fetchTradingFees': false, + 'fetchWithdrawals': false, + 'setLeverage': false, + 'setMarginMode': false, + 'transfer': false, + 'withdraw': false, + }, + 'comment': 'This comment is optional', + 'urls': { + 'logo': 'https://cdn.arz.digital/cr-odin/img/exchanges/kifpoolme/64x64.png', + 'api': { + 'public': 'https://api.kifpool.app', + }, + 'www': 'https://kifpool.me/', + 'doc': [ + 'https://kifpool.me/', + ], + }, + 'timeframes': { + '1m': '1m', + '5m': '5m', + '15m': '15m', + '30m': '30m', + '1h': '1h', + '4h': '4h', + '1d': '1d', + '1w': '1w', + }, + 'api': { + 'public': { + 'get': { + 'api/spot/price': 1, + 'api/spot/tickers/1m': 1, + }, + }, + }, + 'fees': { + 'trading': { + 'tierBased': false, + 'percentage': true, + 'maker': this.parseNumber('0.001'), + 'taker': this.parseNumber('0.001'), + }, + }, + }); + } + parseMarket(market) { + // { + // "symbol": "BTC", + // "faName": "بیت کوین", + // "name": "Bitcoin", + // "smallImage": "https://kifpool.me/uploads/coin-new-images/bitcoin.png", + // "price": 115430, + // "priceBuyIRT": 13043590000, + // "priceSellIRT": 13135934000, + // "volume": 1700068128.9919832, + // "priceChangePercent": 3.4799999999999995, + // "high": 115968.8, + // "low": 111145.4, + // "slug": "bitcoin-BTC" + // } + const baseId = this.safeString(market, 'symbol'); + const quoteId = this.safeString(market, 'quoteId', 'USDT'); + const base = this.safeCurrencyCode(baseId); + const quote = this.safeCurrencyCode(quoteId); + const id = baseId + '/' + quoteId; + return { + 'id': id, + 'symbol': base + '/' + quote, + 'base': base, + 'quote': quote, + 'settle': undefined, + 'baseId': baseId, + 'quoteId': quoteId, + 'settleId': undefined, + 'type': 'spot', + 'spot': true, + 'margin': false, + 'swap': false, + 'future': false, + 'option': false, + 'active': true, + 'contract': false, + 'linear': undefined, + 'inverse': undefined, + 'contractSize': undefined, + 'expiry': undefined, + 'expiryDatetime': undefined, + 'strike': undefined, + 'optionType': undefined, + 'precision': { + 'amount': undefined, + 'price': undefined, + }, + 'limits': { + 'leverage': { + 'min': undefined, + 'max': undefined, + }, + 'amount': { + 'min': undefined, + 'max': undefined, + }, + 'price': { + 'min': undefined, + 'max': undefined, + }, + 'cost': { + 'min': undefined, + 'max': undefined, + }, + }, + 'created': undefined, + 'info': market, + }; + } + async fetchMarkets(params = {}) { + /** + * @method + * @name kifpoolme#fetchMarkets + * @description retrieves data on all markets for kifpoolme + * @see https://api.kifpool.app/api/spot/price + * @param {object} [params] extra parameters specific to the exchange API endpoint + * @returns {object[]} an array of objects representing market data + */ + const response = await this.publicGetApiSpotPrice(params); + const result = []; + // Response is an array of coin objects + for (let i = 0; i < response.length; i++) { + const item = response[i]; + // Create markets for both USDT and IRT quotes + const quotes = ['USDT', 'IRT']; + for (let j = 0; j < quotes.length; j++) { + const quoteId = quotes[j]; + const marketData = this.extend(item, { + 'quoteId': quoteId, + }); + const market = this.parseMarket(marketData); + result.push(market); + } + } + return result; + } + async fetchTickers(symbols = undefined, params = {}) { + /** + * @method + * @name kifpoolme#fetchTickers + * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market + * @see https://api.kifpool.app/api/spot/price + * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned + * @param {object} [params] extra parameters specific to the exchange API endpoint + * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure} + */ + await this.loadMarkets(); + if (symbols !== undefined) { + symbols = this.marketSymbols(symbols); + } + // Extract base symbols from the requested symbols + let symbolsParam = undefined; + if (symbols !== undefined && symbols.length > 0) { + const baseSymbols = []; + for (let i = 0; i < symbols.length; i++) { + const market = this.market(symbols[i]); + if (baseSymbols.indexOf(market['baseId']) === -1) { + baseSymbols.push(market['baseId']); + } + } + symbolsParam = baseSymbols.join(','); + } + const request = {}; + if (symbolsParam !== undefined) { + request['symbol'] = symbolsParam; + } + const response = await this.publicGetApiSpotPrice(this.extend(request, params)); + const result = {}; + for (let i = 0; i < response.length; i++) { + const item = response[i]; + const baseId = this.safeString(item, 'symbol'); + // Create tickers for both USDT and IRT quotes + const quotes = ['USDT', 'IRT']; + for (let j = 0; j < quotes.length; j++) { + const quoteId = quotes[j]; + const base = this.safeCurrencyCode(baseId); + const quote = this.safeCurrencyCode(quoteId); + const symbol = base + '/' + quote; + const ticker = this.extend(item, { + 'quoteId': quoteId, + 'marketId': baseId + '/' + quoteId, + }); + result[symbol] = this.parseTicker(ticker); + } + } + return this.filterByArrayTickers(result, 'symbol', symbols); + } + async fetchTicker(symbol, params = {}) { + /** + * @method + * @name kifpoolme#fetchTicker + * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market + * @see https://api.kifpool.app/api/spot/price + * @param {string} symbol unified symbol of the market to fetch the ticker for + * @param {object} [params] extra parameters specific to the exchange API endpoint + * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure} + */ + const ticker = await this.fetchTickers([symbol], params); + return ticker[symbol]; + } + parseTicker(ticker, market = undefined) { + // { + // "symbol": "BTC", + // "faName": "بیت کوین", + // "name": "Bitcoin", + // "smallImage": "https://kifpool.me/uploads/coin-new-images/bitcoin.png", + // "price": 115430, // USDT price + // "priceBuyIRT": 13043590000, // IRT buy price + // "priceSellIRT": 13135934000, // IRT sell price + // "volume": 1700068128.9919832, + // "priceChangePercent": 3.48, + // "high": 115968.8, + // "low": 111145.4, + // "slug": "bitcoin-BTC", + // "quoteId": "USDT" or "IRT" + // } + const marketType = 'spot'; + const marketId = this.safeString(ticker, 'marketId'); + const symbol = this.safeSymbol(marketId, market, undefined, marketType); + const quoteId = this.safeString(ticker, 'quoteId', 'USDT'); + let last = undefined; + let bid = undefined; + let ask = undefined; + if (quoteId === 'IRT') { + // For IRT: priceSellIRT is the sell price (bid), priceBuyIRT is the buy price (ask) + bid = this.safeNumber(ticker, 'priceSellIRT'); + ask = this.safeNumber(ticker, 'priceBuyIRT'); + last = ask; + } + else { + // For USDT: price is in USDT + const price = this.safeNumber(ticker, 'price'); + last = price; + bid = price; + ask = price; + } + const high = this.safeNumber(ticker, 'high'); + const low = this.safeNumber(ticker, 'low'); + const percentage = this.safeNumber(ticker, 'priceChangePercent'); + const baseVolume = this.safeNumber(ticker, 'volume'); + return this.safeTicker({ + 'symbol': symbol, + 'timestamp': undefined, + 'datetime': undefined, + 'high': high, + 'low': low, + 'bid': bid, + 'bidVolume': undefined, + 'ask': ask, + 'askVolume': undefined, + 'vwap': undefined, + 'open': undefined, + 'close': last, + 'last': last, + 'previousClose': undefined, + 'change': undefined, + 'percentage': percentage, + 'average': undefined, + 'baseVolume': baseVolume, + 'quoteVolume': undefined, + 'info': ticker, + }, market); + } + async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) { + /** + * @method + * @name kifpoolme#fetchOHLCV + * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market + * @see https://api.kifpool.app/api/spot/tickers/1m + * @param {string} symbol unified symbol of the market to fetch OHLCV data for + * @param {string} timeframe the length of time each candle represents + * @param {int} [since] timestamp in ms of the earliest candle to fetch + * @param {int} [limit] the maximum amount of candles to fetch + * @param {object} [params] extra parameters specific to the exchange API endpoint + * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume + */ + await this.loadMarkets(); + const market = this.market(symbol); + const endTime = Date.now(); + const request = { + 'symbol': market['baseId'], + 'currency': market['quoteId'], + 'fromTs': Math.floor((endTime / 1000) - (24 * 60 * 60)), + 'toTs': Math.floor(endTime / 1000), + }; + if (since !== undefined) { + request['fromTs'] = Math.floor(since / 1000); + } + if (limit !== undefined) { + request['limit'] = limit; + } + const response = await this.publicGetApiSpotTickers1m(request); + return this.parseOHLCVs(response, market, timeframe, since, limit); + } + parseOHLCV(ohlcv, market = undefined) { + // { + // "data_captured_datetime": 1760169720, + // "open": 110419.9, + // "high": 110468.4, + // "low": 110330.7, + // "close": 110330.7, + // "volume": 3356941116.288925, + // "changePercentage": -0.0808 + // } + return [ + this.safeTimestamp(ohlcv, 'data_captured_datetime'), + this.safeNumber(ohlcv, 'open'), + this.safeNumber(ohlcv, 'high'), + this.safeNumber(ohlcv, 'low'), + this.safeNumber(ohlcv, 'close'), + this.safeNumber(ohlcv, 'volume'), + ]; + } + sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) { + const query = this.omit(params, this.extractParams(path)); + let url = this.urls['api']['public'] + '/' + path; + if (Object.keys(query).length) { + url += '?' + this.urlencode(query); + } + headers = { 'Content-Type': 'application/json' }; + return { 'url': url, 'method': method, 'body': body, 'headers': headers }; + } +} + + /***/ }), /***/ 8042: @@ -235492,6 +237210,546 @@ class luno extends _abstract_luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] } +/***/ }), + +/***/ 509: +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ A: () => (/* binding */ mazdax) +/* harmony export */ }); +/* harmony import */ var _abstract_mazdax_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2208); +// --------------------------------------------------------------------------- + +// --------------------------------------------------------------------------- +/** + * @class mazdax + * @augments Exchange + * @description Mazdax OTC exchange implementation + */ +class mazdax extends _abstract_mazdax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A { + describe() { + return this.deepExtend(super.describe(), { + 'id': 'mazdax', + 'name': 'Mazdax', + 'countries': ['IR'], + 'rateLimit': 1000, + 'version': '1', + 'certified': false, + 'pro': false, + 'has': { + 'CORS': undefined, + 'spot': false, + 'otc': true, + 'margin': false, + 'swap': false, + 'future': false, + 'option': false, + 'addMargin': false, + 'cancelAllOrders': false, + 'cancelOrder': false, + 'cancelOrders': false, + 'createDepositAddress': false, + 'createOrder': false, + 'createStopLimitOrder': false, + 'createStopMarketOrder': false, + 'createStopOrder': false, + 'editOrder': false, + 'fetchBalance': false, + 'fetchBorrowInterest': false, + 'fetchBorrowRateHistories': false, + 'fetchBorrowRateHistory': false, + 'fetchClosedOrders': false, + 'fetchCrossBorrowRate': false, + 'fetchCrossBorrowRates': false, + 'fetchCurrencies': false, + 'fetchDepositAddress': false, + 'fetchDeposits': false, + 'fetchFundingHistory': false, + 'fetchFundingRate': false, + 'fetchFundingRateHistory': false, + 'fetchFundingRates': false, + 'fetchIndexOHLCV': false, + 'fetchIsolatedBorrowRate': false, + 'fetchIsolatedBorrowRates': false, + 'fetchL2OrderBook': false, + 'fetchL3OrderBook': false, + 'fetchLedger': false, + 'fetchLedgerEntry': false, + 'fetchLeverageTiers': false, + 'fetchMarkets': true, + 'fetchMarkOHLCV': false, + 'fetchMyTrades': false, + 'fetchOHLCV': true, + 'fetchOpenInterestHistory': false, + 'fetchOpenOrders': false, + 'fetchOrder': false, + 'fetchOrderBook': true, + 'fetchOrders': false, + 'fetchOrderTrades': 'emulated', + 'fetchPositions': false, + 'fetchPremiumIndexOHLCV': false, + 'fetchTicker': true, + 'fetchTickers': true, + 'fetchTime': false, + 'fetchTrades': false, + 'fetchTradingFee': false, + 'fetchTradingFees': false, + 'fetchWithdrawals': false, + 'setLeverage': false, + 'setMarginMode': false, + 'transfer': false, + 'withdraw': false, + }, + 'comment': 'Mazdax OTC Exchange', + 'urls': { + 'logo': 'https://cdn.arz.digital/cr-odin/img/exchanges/mazdax/64x64.png', + 'api': { + 'public': 'https://api.mazdax.ir', + }, + 'www': 'https://mazdax.ir', + 'doc': [ + 'https://api.mazdax.ir', + ], + }, + 'timeframes': { + '1m': '1m', + '5m': '5m', + '15m': '15m', + '30m': '30m', + '1h': '1h', + '4h': '4h', + '1d': '1d', + '1w': '1w', + }, + 'api': { + 'public': { + 'get': { + 'market/symbols': 1, + 'market/rollingprice': 1, + 'market/candle': 1, + 'market/order': 1, + }, + }, + }, + 'fees': { + 'trading': { + 'tierBased': false, + 'percentage': true, + 'maker': this.parseNumber('0.001'), + 'taker': this.parseNumber('0.001'), + }, + }, + }); + } + async fetchMarkets(params = {}) { + /** + * @method + * @name mazdax#fetchMarkets + * @description retrieves data on all markets for mazdax + * @see https://api.mazdax.ir/market/symbols + * @param {object} [params] extra parameters specific to the exchange API endpoint + * @returns {object[]} an array of objects representing market data + */ + const response = await this.publicGetMarketSymbols(params); + // Response is an array of market objects: + // [ + // { + // "id": 67, + // "createdAt": "2022-12-26T07:33:25Z", + // "updatedAt": "2025-07-04T16:18:57Z", + // "order": 2, + // "symbol": "AHRM1IRR", + // "baseAsset": "AHRM1", + // "baseAssetTranslate": "AHRM1", + // "baseAssetPrecision": 0, + // "quoteAsset": "IRR", + // "quoteAssetTranslate": "IRR", + // "takerFee": "0.00116", + // "makerFee": "0.001044", + // "quoteAssetPrecision": 0, + // "isTradable": true, + // "isActive": true, + // "isPublic": true, + // "minimumOrderSize": "100000", + // "maximumOrderSize": "0", + // "minimumPrice": "0", + // "maximumPrice": "0", + // "marketCOV": "0.01", + // "marketCap": "10", + // "tickSize": "1", + // "stepSize": "1", + // ... + // } + // ] + const result = []; + for (let i = 0; i < response.length; i++) { + const market = this.parseMarket(response[i]); + result.push(market); + } + return result; + } + parseMarket(market) { + // { + // "id": 67, + // "createdAt": "2022-12-26T07:33:25Z", + // "updatedAt": "2025-07-04T16:18:57Z", + // "order": 2, + // "symbol": "AHRM1IRR", + // "baseAsset": "AHRM1", + // "baseAssetTranslate": "AHRM1", + // "baseAssetPrecision": 0, + // "quoteAsset": "IRR", + // "quoteAssetTranslate": "IRR", + // "takerFee": "0.00116", + // "makerFee": "0.001044", + // "quoteAssetPrecision": 0, + // "isTradable": true, + // "isActive": true, + // "isPublic": true, + // "minimumOrderSize": "100000", + // "maximumOrderSize": "0", + // "minimumPrice": "0", + // "maximumPrice": "0", + // "marketCOV": "0.01", + // "marketCap": "10", + // "tickSize": "1", + // "stepSize": "1", + // ... + // } + const id = this.safeString(market, 'symbol'); + let baseId = this.safeString(market, 'baseAsset'); + let quoteId = this.safeString(market, 'quoteAsset'); + const base = this.safeCurrencyCode(baseId); + const quote = this.safeCurrencyCode(quoteId); + baseId = baseId.toLowerCase(); + quoteId = quoteId.toLowerCase(); + const isActive = this.safeBool(market, 'isActive', false); + const isTradable = this.safeBool(market, 'isTradable', false); + const active = isActive && isTradable; + return { + 'id': id, + 'symbol': base + '/' + quote, + 'base': base, + 'quote': quote, + 'settle': undefined, + 'baseId': baseId, + 'quoteId': quoteId, + 'settleId': undefined, + 'type': 'otc', + 'spot': false, + 'margin': false, + 'swap': false, + 'future': false, + 'option': false, + 'active': active, + 'contract': false, + 'linear': undefined, + 'inverse': undefined, + 'contractSize': undefined, + 'expiry': undefined, + 'expiryDatetime': undefined, + 'strike': undefined, + 'optionType': undefined, + 'precision': { + 'amount': this.parseNumber(this.parsePrecision(this.safeString(market, 'baseAssetPrecision'))), + 'price': this.parseNumber(this.parsePrecision(this.safeString(market, 'quoteAssetPrecision'))), + }, + 'limits': { + 'leverage': { + 'min': undefined, + 'max': undefined, + }, + 'amount': { + 'min': this.safeNumber(market, 'minimumOrderSize'), + 'max': this.safeNumber(market, 'maximumOrderSize'), + }, + 'price': { + 'min': this.safeNumber(market, 'minimumPrice'), + 'max': this.safeNumber(market, 'maximumPrice'), + }, + 'cost': { + 'min': undefined, + 'max': undefined, + }, + }, + 'created': this.parse8601(this.safeString(market, 'createdAt')), + 'info': market, + }; + } + async fetchTickers(symbols = undefined, params = {}) { + /** + * @method + * @name mazdax#fetchTickers + * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market + * @see https://api.mazdax.ir/market/rollingprice + * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned + * @param {object} [params] extra parameters specific to the exchange API endpoint + * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure} + */ + await this.loadMarkets(); + if (symbols !== undefined) { + symbols = this.marketSymbols(symbols); + } + const markets = await this.fetchMarkets(); + const result = {}; + for (let i = 0; i < markets.length; i++) { + const market = markets[i]; + const marketId = market['id']; + const request = { + 'from': 'mazdax', + 'symbol': marketId, + }; + try { + const response = await this.publicGetMarketRollingprice(request); + // { + // "AHRM1IRR": { + // "symbol": "AHRM1IRR", + // "priceChange": "525", + // "priceChangePercent": "2.077", + // "weightedAvgPrice": "0", + // "prevClosePrice": "0", + // "lastPrice": "25800", + // "lastQty": "14050", + // "bidPrice": "0", + // "askPrice": "0", + // "openPrice": "25275", + // "highPrice": "26200", + // "lowPrice": "25274", + // "volume": "1076873", + // "valueIrr": "55104642690", + // "openTime": 1760271737577, + // "closeTime": 1760351215075, + // "count": 348 + // } + // } + const tickerData = this.safeDict(response, marketId); + if (tickerData !== undefined) { + const ticker = this.parseTicker(tickerData, market); + const symbol = ticker['symbol']; + result[symbol] = ticker; + } + } + catch (e) { + // Skip markets that fail + continue; + } + } + return this.filterByArrayTickers(result, 'symbol', symbols); + } + async fetchTicker(symbol, params = {}) { + /** + * @method + * @name mazdax#fetchTicker + * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market + * @see https://api.mazdax.ir/market/rollingprice + * @param {string} symbol unified symbol of the market to fetch the ticker for + * @param {object} [params] extra parameters specific to the exchange API endpoint + * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure} + */ + await this.loadMarkets(); + const market = this.market(symbol); + const request = { + 'from': 'mazdax', + 'symbol': market['id'], + }; + const response = await this.publicGetMarketRollingprice(request); + // { + // "AHRM1IRR": { + // "symbol": "AHRM1IRR", + // "priceChange": "525", + // "priceChangePercent": "2.077", + // "weightedAvgPrice": "0", + // "prevClosePrice": "0", + // "lastPrice": "25800", + // "lastQty": "14050", + // "bidPrice": "0", + // "askPrice": "0", + // "openPrice": "25275", + // "highPrice": "26200", + // "lowPrice": "25274", + // "volume": "1076873", + // "valueIrr": "55104642690", + // "openTime": 1760271737577, + // "closeTime": 1760351215075, + // "count": 348 + // } + // } + const tickerData = this.safeDict(response, market['id']); + return this.parseTicker(tickerData, market); + } + parseTicker(ticker, market = undefined) { + // { + // "symbol": "AHRM1IRR", + // "priceChange": "525", + // "priceChangePercent": "2.077", + // "weightedAvgPrice": "0", + // "prevClosePrice": "0", + // "lastPrice": "25800", + // "lastQty": "14050", + // "bidPrice": "0", + // "askPrice": "0", + // "openPrice": "25275", + // "highPrice": "26200", + // "lowPrice": "25274", + // "volume": "1076873", + // "valueIrr": "55104642690", + // "openTime": 1760271737577, + // "closeTime": 1760351215075, + // "count": 348 + // } + const marketType = 'otc'; + const marketId = this.safeString(ticker, 'symbol'); + const symbol = this.safeSymbol(marketId, market, undefined, marketType); + const timestamp = this.safeInteger(ticker, 'closeTime'); + const high = this.safeString(ticker, 'highPrice'); + const low = this.safeString(ticker, 'lowPrice'); + const bid = this.safeString(ticker, 'bidPrice'); + const ask = this.safeString(ticker, 'askPrice'); + const last = this.safeString(ticker, 'lastPrice'); + const open = this.safeString(ticker, 'openPrice'); + const baseVolume = this.safeString(ticker, 'volume'); + const quoteVolume = this.safeString(ticker, 'valueIrr'); + const priceChange = this.safeString(ticker, 'priceChange'); + const percentage = this.safeString(ticker, 'priceChangePercent'); + return this.safeTicker({ + 'symbol': symbol, + 'timestamp': timestamp, + 'datetime': this.iso8601(timestamp), + 'high': high, + 'low': low, + 'bid': bid, + 'bidVolume': undefined, + 'ask': ask, + 'askVolume': undefined, + 'vwap': undefined, + 'open': open, + 'close': last, + 'last': last, + 'previousClose': undefined, + 'change': priceChange, + 'percentage': percentage, + 'average': undefined, + 'baseVolume': baseVolume, + 'quoteVolume': quoteVolume, + 'info': ticker, + }, market); + } + async fetchOHLCV(symbol, timeframe = '1d', since = undefined, limit = undefined, params = {}) { + /** + * @method + * @name mazdax#fetchOHLCV + * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market + * @see https://api.mazdax.ir/market/candle + * @param {string} symbol unified symbol of the market to fetch OHLCV data for + * @param {string} timeframe the length of time each candle represents + * @param {int} [since] timestamp in ms of the earliest candle to fetch + * @param {int} [limit] the maximum amount of candles to fetch + * @param {object} [params] extra parameters specific to the exchange API endpoint + * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume + */ + await this.loadMarkets(); + const market = this.market(symbol); + const endTime = Date.now(); + const request = { + 'from': 'binance', + 'symbol': market['id'], + 'interval': this.safeString(this.timeframes, timeframe, timeframe), + 'limit': limit !== undefined ? limit : 1000, + 'starttime': (endTime) - (30 * 24 * 60 * 60 * 1000), + 'endtime': endTime, + }; + if (since !== undefined) { + request['starttime'] = since / 1000; + } + const response = await this.publicGetMarketCandle(request); + // { + // "Candles": [ + // { + // "openTime": "2021-12-20T03:30:00+03:30", + // "openPrice": "10000", + // "highPrice": "10000", + // "lowPrice": "10000", + // "closePrice": "10000", + // "volume": "490000000", + // "closeTime": "2021-12-20T03:30:00+03:30", + // "quoteAssetVolume": "0", + // "numberOfTrades": 0, + // "takerBuyBaseAssetVolume": "0", + // "takerBuyQuoteAssetVolume": "0", + // "ignore": "0" + // }, + // ... + // ] + // } + const candles = this.safeList(response, 'Candles', []); + const ohlcvs = []; + for (let i = 0; i < candles.length; i++) { + const candle = candles[i]; + const timestamp = this.parse8601(this.safeString(candle, 'openTime')); + const open = this.safeString(candle, 'openPrice'); + const high = this.safeString(candle, 'highPrice'); + const low = this.safeString(candle, 'lowPrice'); + const close = this.safeString(candle, 'closePrice'); + const volume = this.safeString(candle, 'volume'); + ohlcvs.push([ + timestamp, + open, + high, + low, + close, + volume, + ]); + } + return this.parseOHLCVs(ohlcvs, market, timeframe, since, limit); + } + async fetchOrderBook(symbol, limit = undefined, params = {}) { + /** + * @method + * @name mazdax#fetchOrderBook + * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data + * @see https://api.mazdax.ir/market/order + * @param {string} symbol unified symbol of the market to fetch the order book for + * @param {int} [limit] the maximum amount of order book entries to return + * @param {object} [params] extra parameters specific to the exchange API endpoint + * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols + */ + await this.loadMarkets(); + const market = this.market(symbol); + const request = { + 'from': 'mazdax', + 'symbol': market['id'], + 'limit': limit !== undefined ? limit : 25, + }; + const response = await this.publicGetMarketOrder(request); + // { + // "timestamp": "0001-01-01T00:00:00Z", + // "bids": [ + // ["25321", "9344"], + // ["25320", "15000"], + // ... + // ], + // "asks": [ + // ["26190", "5341"], + // ["26195", "2310"], + // ... + // ] + // } + const timestamp = this.parse8601(this.safeString(response, 'timestamp')); + return this.parseOrderBook(response, symbol, timestamp, 'bids', 'asks', 0, 1); + } + sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) { + const query = this.omit(params, this.extractParams(path)); + let url = this.urls['api']['public'] + '/' + path; + if (Object.keys(query).length) { + url = url + '?' + this.urlencode(query); + } + headers = { 'Content-Type': 'application/json' }; + return { 'url': url, 'method': method, 'body': body, 'headers': headers }; + } +} + + /***/ }), /***/ 6419: @@ -279372,6 +281630,458 @@ class phemex extends _abstract_phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul } +/***/ }), + +/***/ 8785: +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ A: () => (/* binding */ pingi) +/* harmony export */ }); +/* harmony import */ var _abstract_pingi_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8310); +// --------------------------------------------------------------------------- + +// --------------------------------------------------------------------------- +/** + * @class pingi + * @augments Exchange + * @description Pingi OTC exchange implementation + */ +class pingi extends _abstract_pingi_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A { + describe() { + return this.deepExtend(super.describe(), { + 'id': 'pingi', + 'name': 'Pingi', + 'countries': ['IR'], + 'rateLimit': 1000, + 'version': '1', + 'certified': false, + 'pro': false, + 'has': { + 'CORS': undefined, + 'spot': false, + 'otc': true, + 'margin': false, + 'swap': false, + 'future': false, + 'option': false, + 'addMargin': false, + 'cancelAllOrders': false, + 'cancelOrder': false, + 'cancelOrders': false, + 'createDepositAddress': false, + 'createOrder': false, + 'createStopLimitOrder': false, + 'createStopMarketOrder': false, + 'createStopOrder': false, + 'editOrder': false, + 'fetchBalance': false, + 'fetchBorrowInterest': false, + 'fetchBorrowRateHistories': false, + 'fetchBorrowRateHistory': false, + 'fetchClosedOrders': false, + 'fetchCrossBorrowRate': false, + 'fetchCrossBorrowRates': false, + 'fetchCurrencies': false, + 'fetchDepositAddress': false, + 'fetchDeposits': false, + 'fetchFundingHistory': false, + 'fetchFundingRate': false, + 'fetchFundingRateHistory': false, + 'fetchFundingRates': false, + 'fetchIndexOHLCV': false, + 'fetchIsolatedBorrowRate': false, + 'fetchIsolatedBorrowRates': false, + 'fetchL2OrderBook': false, + 'fetchL3OrderBook': false, + 'fetchLedger': false, + 'fetchLedgerEntry': false, + 'fetchLeverageTiers': false, + 'fetchMarkets': true, + 'fetchMarkOHLCV': false, + 'fetchMyTrades': false, + 'fetchOHLCV': true, + 'fetchOpenInterestHistory': false, + 'fetchOpenOrders': false, + 'fetchOrder': false, + 'fetchOrderBook': false, + 'fetchOrders': false, + 'fetchOrderTrades': 'emulated', + 'fetchPositions': false, + 'fetchPremiumIndexOHLCV': false, + 'fetchTicker': true, + 'fetchTickers': true, + 'fetchTime': false, + 'fetchTrades': false, + 'fetchTradingFee': false, + 'fetchTradingFees': false, + 'fetchWithdrawals': false, + 'setLeverage': false, + 'setMarginMode': false, + 'transfer': false, + 'withdraw': false, + }, + 'comment': 'Pingi OTC Exchange', + 'urls': { + 'logo': 'https://cdn.arz.digital/cr-odin/img/exchanges/pingi/64x64.png', + 'api': { + 'public': 'https://api5.pingi.co/trading', + }, + 'www': 'https://pingi.co', + 'doc': [ + 'https://pingi.co', + ], + }, + 'timeframes': { + '1m': '1', + '5m': '5', + '15m': '15', + '30m': '30', + '1h': '60', + '4h': '240', + '1d': '1D', + '1w': '1W', + }, + 'api': { + 'public': { + 'get': { + 'market/prices': 1, + 'udf/history': 1, + }, + }, + }, + 'fees': { + 'trading': { + 'tierBased': false, + 'percentage': true, + 'maker': this.parseNumber('0.001'), + 'taker': this.parseNumber('0.001'), + }, + }, + }); + } + async fetchMarkets(params = {}) { + /** + * @method + * @name pingi#fetchMarkets + * @description retrieves data on all markets for pingi + * @see https://api5.pingi.co/trading/market/prices/ + * @param {object} [params] extra parameters specific to the exchange API endpoint + * @returns {object[]} an array of objects representing market data + */ + const response = await this.publicGetMarketPrices(params); + // Response structure: + // { + // "statusCode": 200, + // "ok": true, + // "data": { + // "ETH_USDT": { + // "market": "ETH_USDT", + // "marketId": 6, + // "marketVolume": "128889.02937760774364521500000000", + // "currentPrice": "4083.7744580000000", + // "maxPrice": "4218.0241700000000", + // "minPrice": "3786.9124050000000", + // "startPrice": "3830.5800220000000", + // "marketPlatform": 0 + // }, + // "BTC_IRT": { + // "market": "BTC_IRT", + // "marketId": 8, + // "marketVolume": "27140908320.17800246693400000000000000", + // "currentPrice": "12909088630.0000000000000", + // "maxPrice": "13213902170.0000000000000", + // "minPrice": "12000000000.0000000000000", + // "startPrice": "12752332240.0000000000000", + // "marketPlatform": 0 + // }, + // ... + // } + // } + const data = this.safeDict(response, 'data', {}); + const marketKeys = Object.keys(data); + const result = []; + for (let i = 0; i < marketKeys.length; i++) { + const marketId = marketKeys[i]; + const marketData = data[marketId]; + const market = this.parseMarket(marketData); + result.push(market); + } + return result; + } + parseMarket(market) { + // { + // "market": "BTC_IRT", + // "marketId": 8, + // "marketVolume": "27140908320.17800246693400000000000000", + // "currentPrice": "12909088630.0000000000000", + // "maxPrice": "13213902170.0000000000000", + // "minPrice": "12000000000.0000000000000", + // "startPrice": "12752332240.0000000000000", + // "marketPlatform": 0 + // } + const id = this.safeString(market, 'market'); + const parts = id.split('_'); + let baseId = this.safeString(parts, 0); + let quoteId = this.safeString(parts, 1); + const base = this.safeCurrencyCode(baseId); + const quote = this.safeCurrencyCode(quoteId); + baseId = baseId.toLowerCase(); + quoteId = quoteId.toLowerCase(); + return { + 'id': id, + 'symbol': base + '/' + quote, + 'base': base, + 'quote': quote, + 'settle': undefined, + 'baseId': baseId, + 'quoteId': quoteId, + 'settleId': undefined, + 'type': 'otc', + 'spot': false, + 'margin': false, + 'swap': false, + 'future': false, + 'option': false, + 'active': true, + 'contract': false, + 'linear': undefined, + 'inverse': undefined, + 'contractSize': undefined, + 'expiry': undefined, + 'expiryDatetime': undefined, + 'strike': undefined, + 'optionType': undefined, + 'precision': { + 'amount': undefined, + 'price': undefined, + }, + 'limits': { + 'leverage': { + 'min': undefined, + 'max': undefined, + }, + 'amount': { + 'min': undefined, + 'max': undefined, + }, + 'price': { + 'min': undefined, + 'max': undefined, + }, + 'cost': { + 'min': undefined, + 'max': undefined, + }, + }, + 'created': undefined, + 'info': market, + }; + } + async fetchTickers(symbols = undefined, params = {}) { + /** + * @method + * @name pingi#fetchTickers + * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market + * @see https://api5.pingi.co/trading/market/prices/ + * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned + * @param {object} [params] extra parameters specific to the exchange API endpoint + * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure} + */ + await this.loadMarkets(); + if (symbols !== undefined) { + symbols = this.marketSymbols(symbols); + } + const response = await this.publicGetMarketPrices(params); + // Response structure: + // { + // "statusCode": 200, + // "ok": true, + // "data": { + // "ETH_USDT": { + // "market": "ETH_USDT", + // "marketId": 6, + // "marketVolume": "128889.02937760774364521500000000", + // "currentPrice": "4083.7744580000000", + // "maxPrice": "4218.0241700000000", + // "minPrice": "3786.9124050000000", + // "startPrice": "3830.5800220000000", + // "marketPlatform": 0 + // }, + // ... + // } + // } + const data = this.safeDict(response, 'data', {}); + const marketKeys = Object.keys(data); + const result = {}; + for (let i = 0; i < marketKeys.length; i++) { + const marketId = marketKeys[i]; + const marketData = data[marketId]; + const ticker = this.parseTicker(marketData); + const symbol = ticker['symbol']; + result[symbol] = ticker; + } + return this.filterByArrayTickers(result, 'symbol', symbols); + } + async fetchTicker(symbol, params = {}) { + /** + * @method + * @name pingi#fetchTicker + * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market + * @see https://api5.pingi.co/trading/market/prices/ + * @param {string} symbol unified symbol of the market to fetch the ticker for + * @param {object} [params] extra parameters specific to the exchange API endpoint + * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure} + */ + await this.loadMarkets(); + const market = this.market(symbol); + const response = await this.publicGetMarketPrices(params); + // Response structure: + // { + // "statusCode": 200, + // "ok": true, + // "data": { + // "BTC_IRT": { + // "market": "BTC_IRT", + // "marketId": 8, + // "marketVolume": "27140908320.17800246693400000000000000", + // "currentPrice": "12909088630.0000000000000", + // "maxPrice": "13213902170.0000000000000", + // "minPrice": "12000000000.0000000000000", + // "startPrice": "12752332240.0000000000000", + // "marketPlatform": 0 + // }, + // ... + // } + // } + const data = this.safeDict(response, 'data', {}); + const tickerData = this.safeDict(data, market['id']); + return this.parseTicker(tickerData, market); + } + parseTicker(ticker, market = undefined) { + // { + // "market": "BTC_IRT", + // "marketId": 8, + // "marketVolume": "27140908320.17800246693400000000000000", + // "currentPrice": "12909088630.0000000000000", + // "maxPrice": "13213902170.0000000000000", + // "minPrice": "12000000000.0000000000000", + // "startPrice": "12752332240.0000000000000", + // "marketPlatform": 0 + // } + const marketType = 'otc'; + const marketId = this.safeString(ticker, 'market'); + const symbol = this.safeSymbol(marketId, market, '_', marketType); + const last = this.safeString(ticker, 'currentPrice'); + const high = this.safeString(ticker, 'maxPrice'); + const low = this.safeString(ticker, 'minPrice'); + const open = this.safeString(ticker, 'startPrice'); + const baseVolume = this.safeString(ticker, 'marketVolume'); + // Calculate change and percentage + let change = undefined; + let percentage = undefined; + if (open !== undefined && last !== undefined) { + const openNum = this.parseNumber(open); + const lastNum = this.parseNumber(last); + if (openNum !== undefined && lastNum !== undefined && openNum > 0) { + change = this.parseNumber(this.numberToString(lastNum - openNum)); + percentage = this.parseNumber(this.numberToString((lastNum - openNum) / openNum * 100)); + } + } + return this.safeTicker({ + 'symbol': symbol, + 'timestamp': undefined, + 'datetime': undefined, + 'high': high, + 'low': low, + 'bid': undefined, + 'bidVolume': undefined, + 'ask': undefined, + 'askVolume': undefined, + 'vwap': undefined, + 'open': open, + 'close': last, + 'last': last, + 'previousClose': undefined, + 'change': change, + 'percentage': percentage, + 'average': undefined, + 'baseVolume': baseVolume, + 'quoteVolume': undefined, + 'info': ticker, + }, market); + } + async fetchOHLCV(symbol, timeframe = '1d', since = undefined, limit = undefined, params = {}) { + /** + * @method + * @name pingi#fetchOHLCV + * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market + * @see https://api5.pingi.co/trading/udf/history/ + * @param {string} symbol unified symbol of the market to fetch OHLCV data for + * @param {string} timeframe the length of time each candle represents + * @param {int} [since] timestamp in ms of the earliest candle to fetch + * @param {int} [limit] the maximum amount of candles to fetch + * @param {object} [params] extra parameters specific to the exchange API endpoint + * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume + */ + await this.loadMarkets(); + const market = this.market(symbol); + const endTime = Date.now(); + const request = { + 'symbol': market['base'] + '/' + market['quote'], + 'resolution': this.safeString(this.timeframes, timeframe, timeframe), + 'from': (endTime / 1000) - (30 * 24 * 60 * 60), + 'to': endTime / 1000, + }; + if (since !== undefined) { + request['from'] = since / 1000; + } + request['from'] = this.safeInteger(request, 'from'); + request['to'] = this.safeInteger(request, 'to'); + const response = await this.publicGetUdfHistory(request); + // Response structure: + // { + // "c": [12710726290.0, 12732737270.0, ...], // close prices + // "v": [0.015461630724, 0.024055443184, ...], // volumes + // "l": [12702815580.0, 12689256670.0, ...], // low prices + // "h": [12723701120.0, 12752332240.0, ...], // high prices + // "o": [12752332240.0, 12710726290.0, ...], // open prices + // "t": [1760271600, 1760272500, ...] // timestamps + // } + const closeList = this.safeList(response, 'c', []); + const volumeList = this.safeList(response, 'v', []); + const lowList = this.safeList(response, 'l', []); + const highList = this.safeList(response, 'h', []); + const openList = this.safeList(response, 'o', []); + const timestampList = this.safeList(response, 't', []); + const ohlcvs = []; + for (let i = 0; i < openList.length; i++) { + ohlcvs.push([ + this.safeTimestamp(timestampList, i), + this.safeNumber(openList, i), + this.safeNumber(highList, i), + this.safeNumber(lowList, i), + this.safeNumber(closeList, i), + this.safeNumber(volumeList, i), + ]); + } + return this.parseOHLCVs(ohlcvs, market, timeframe, since, limit); + } + sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) { + const query = this.omit(params, this.extractParams(path)); + let url = this.urls['api']['public'] + '/' + path; + if (path === 'market/prices') { + url = url + '/'; + } + if (path === 'udf/history') { + url = url + '/?' + this.urlencode(query); + } + headers = { 'Content-Type': 'application/json' }; + return { 'url': url, 'method': method, 'body': body, 'headers': headers }; + } +} + + /***/ }), /***/ 288: @@ -283062,6 +285772,358 @@ class poloniex extends _abstract_poloniex_js__WEBPACK_IMPORTED_MODULE_0__/* ["de } +/***/ }), + +/***/ 8920: +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ A: () => (/* binding */ pooleno) +/* harmony export */ }); +/* harmony import */ var _abstract_pooleno_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5003); +// --------------------------------------------------------------------------- + +// --------------------------------------------------------------------------- +/** + * @class pooleno + * @augments Exchange + * @description Set rateLimit to 1000 if fully verified + */ +class pooleno extends _abstract_pooleno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A { + describe() { + return this.deepExtend(super.describe(), { + 'id': 'pooleno', + 'name': 'Pooleno', + 'countries': ['IR'], + 'rateLimit': 1000, + 'version': '1', + 'certified': false, + 'pro': false, + 'has': { + 'CORS': undefined, + 'spot': true, + 'margin': false, + 'swap': false, + 'future': false, + 'option': false, + 'addMargin': false, + 'cancelAllOrders': false, + 'cancelOrder': false, + 'cancelOrders': false, + 'createDepositAddress': false, + 'createOrder': false, + 'createStopLimitOrder': false, + 'createStopMarketOrder': false, + 'createStopOrder': false, + 'editOrder': false, + 'fetchBalance': false, + 'fetchBorrowInterest': false, + 'fetchBorrowRateHistories': false, + 'fetchBorrowRateHistory': false, + 'fetchClosedOrders': false, + 'fetchCrossBorrowRate': false, + 'fetchCrossBorrowRates': false, + 'fetchCurrencies': false, + 'fetchDepositAddress': false, + 'fetchDeposits': false, + 'fetchFundingHistory': false, + 'fetchFundingRate': false, + 'fetchFundingRateHistory': false, + 'fetchFundingRates': false, + 'fetchIndexOHLCV': false, + 'fetchIsolatedBorrowRate': false, + 'fetchIsolatedBorrowRates': false, + 'fetchL2OrderBook': false, + 'fetchL3OrderBook': false, + 'fetchLedger': false, + 'fetchLedgerEntry': false, + 'fetchLeverageTiers': false, + 'fetchMarkets': true, + 'fetchMarkOHLCV': false, + 'fetchMyTrades': false, + 'fetchOHLCV': false, + 'fetchOpenInterestHistory': false, + 'fetchOpenOrders': false, + 'fetchOrder': false, + 'fetchOrderBook': false, + 'fetchOrders': false, + 'fetchOrderTrades': 'emulated', + 'fetchPositions': false, + 'fetchPremiumIndexOHLCV': false, + 'fetchTicker': true, + 'fetchTickers': true, + 'fetchTime': false, + 'fetchTrades': false, + 'fetchTradingFee': false, + 'fetchTradingFees': false, + 'fetchWithdrawals': false, + 'setLeverage': false, + 'setMarginMode': false, + 'transfer': false, + 'withdraw': false, + }, + 'comment': 'This comment is optional', + 'urls': { + 'logo': 'https://cdn.arz.digital/cr-odin/img/exchanges/pooleno/64x64.png', + 'api': { + 'public': 'https://api-beta.pooleno.ir', + }, + 'www': 'https://pooleno.ir', + 'doc': [ + 'https://pooleno.ir', + ], + }, + 'api': { + 'public': { + 'get': { + 'api/v1/tokens/public': 1, + }, + }, + }, + 'fees': { + 'trading': { + 'tierBased': false, + 'percentage': true, + 'maker': this.parseNumber('0.001'), + 'taker': this.parseNumber('0.001'), + }, + }, + }); + } + async fetchMarkets(params = {}) { + /** + * @method + * @name pooleno#fetchMarkets + * @description retrieves data on all markets for pooleno + * @see https://api-beta.pooleno.ir/api/v1/tokens/public + * @param {object} [params] extra parameters specific to the exchange API endpoint + * @returns {object[]} an array of objects representing market data + */ + const response = await this.publicGetApiV1TokensPublic(params); + const payload = this.safeList(response, 'payload', []); + const result = []; + for (let i = 0; i < payload.length; i++) { + const token = payload[i]; + const baseAsset = this.safeString(token, 'baseAsset'); + const quoteAsset = this.safeString(token, 'quoteAsset'); + // Skip if base equals quote + if (baseAsset === quoteAsset) { + continue; + } + const market = this.parseMarket(token); + result.push(market); + } + return result; + } + parseMarket(market) { + // { + // "baseAsset": "USDT", + // "quoteAsset": "TMN", + // "symbolName": "USDT", + // "longEnName": "Tether", + // "longFaName": "تتر", + // "createdAt": "2025-02-25T13:47:27.102Z", + // "id": "cm43t74jo00000hrm8tw9aspo", + // "price": "1", + // "priceTMN": "112950", + // "sparkline": { + // "data": [...], + // "change": -538, + // "percentage": -0.48, + // "isPositive": false + // }, + // "market": { + // "totalSupply": null, + // "maxSupply": null, + // "circulatingSupply": null, + // "volume24hBase": null, + // "high24h": null, + // "low24h": null, + // "volume24h": null, + // "marketCap": null + // }, + // "blockchains": [...] + // } + let baseId = this.safeString(market, 'baseAsset'); + let quoteId = this.safeString(market, 'quoteAsset'); + const base = this.safeCurrencyCode(baseId); + const quote = this.safeCurrencyCode(quoteId); + const id = base + quote; + baseId = baseId.toLowerCase(); + quoteId = quoteId.toLowerCase(); + return { + 'id': id, + 'symbol': base + '/' + quote, + 'base': base, + 'quote': quote, + 'settle': undefined, + 'baseId': baseId, + 'quoteId': quoteId, + 'settleId': undefined, + 'type': 'spot', + 'spot': true, + 'margin': false, + 'swap': false, + 'future': false, + 'option': false, + 'active': true, + 'contract': false, + 'linear': undefined, + 'inverse': undefined, + 'contractSize': undefined, + 'expiry': undefined, + 'expiryDatetime': undefined, + 'strike': undefined, + 'optionType': undefined, + 'precision': { + 'amount': undefined, + 'price': undefined, + }, + 'limits': { + 'leverage': { + 'min': undefined, + 'max': undefined, + }, + 'amount': { + 'min': undefined, + 'max': undefined, + }, + 'price': { + 'min': undefined, + 'max': undefined, + }, + 'cost': { + 'min': undefined, + 'max': undefined, + }, + }, + 'created': undefined, + 'info': market, + }; + } + async fetchTickers(symbols = undefined, params = {}) { + /** + * @method + * @name pooleno#fetchTickers + * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market + * @see https://api-beta.pooleno.ir/api/v1/tokens/public + * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned + * @param {object} [params] extra parameters specific to the exchange API endpoint + * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure} + */ + await this.loadMarkets(); + if (symbols !== undefined) { + symbols = this.marketSymbols(symbols); + } + const response = await this.publicGetApiV1TokensPublic(params); + const payload = this.safeList(response, 'payload', []); + const result = {}; + for (let i = 0; i < payload.length; i++) { + const token = payload[i]; + const ticker = this.parseTicker(token); + const symbol = ticker['symbol']; + result[symbol] = ticker; + } + return this.filterByArrayTickers(result, 'symbol', symbols); + } + async fetchTicker(symbol, params = {}) { + /** + * @method + * @name pooleno#fetchTicker + * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market + * @see https://api-beta.pooleno.ir/api/v1/tokens/public + * @param {string} symbol unified symbol of the market to fetch the ticker for + * @param {object} [params] extra parameters specific to the exchange API endpoint + * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure} + */ + const ticker = await this.fetchTickers([symbol]); + return ticker[symbol]; + } + parseTicker(ticker, market = undefined) { + // { + // "baseAsset": "BTC", + // "quoteAsset": "USDT", + // "symbolName": "BTC", + // "longEnName": "Bitcoin", + // "longFaName": "بیتکوین", + // "createdAt": "2025-02-25T13:47:27.103Z", + // "id": "cm43t74jp00010hrmed9i7l76", + // "price": "115024.7", + // "priceTMN": "12980537395", + // "sparkline": { + // "data": [...], + // "change": -538, + // "percentage": -0.48, + // "isPositive": false + // }, + // "market": { + // "totalSupply": null, + // "maxSupply": null, + // "circulatingSupply": null, + // "volume24hBase": null, + // "high24h": null, + // "low24h": null, + // "volume24h": null, + // "marketCap": null + // }, + // "blockchains": [...] + // } + const marketType = 'spot'; + const baseAsset = this.safeString(ticker, 'baseAsset'); + const quoteAsset = this.safeString(ticker, 'quoteAsset'); + const marketId = baseAsset + '/' + quoteAsset; + const symbol = this.safeSymbol(marketId, market, undefined, marketType); + const price = this.safeFloat(ticker, 'price'); + const priceTMN = this.safeFloat(ticker, 'priceTMN'); + const sparkline = this.safeDict(ticker, 'sparkline', {}); + const change = this.safeFloat(sparkline, 'change'); + const percentage = this.safeFloat(sparkline, 'percentage'); + const marketData = this.safeDict(ticker, 'market', {}); + const high24h = this.safeFloat(marketData, 'high24h'); + const low24h = this.safeFloat(marketData, 'low24h'); + const volume24h = this.safeFloat(marketData, 'volume24h'); + let last = undefined; + let baseVolume = undefined; + if (quoteAsset === 'TMN' || quoteAsset === 'IRT') { + // For TMN/IRT pairs, use priceTMN + last = priceTMN; + } + else { + // For other pairs (like USDT), use price + last = price; + baseVolume = volume24h; + } + return this.safeTicker({ + 'symbol': symbol, + 'timestamp': undefined, + 'datetime': undefined, + 'high': high24h, + 'low': low24h, + 'bid': last, + 'bidVolume': undefined, + 'ask': last, + 'askVolume': undefined, + 'vwap': undefined, + 'open': undefined, + 'close': last, + 'last': last, + 'previousClose': undefined, + 'change': change, + 'percentage': percentage, + 'average': undefined, + 'baseVolume': baseVolume, + 'quoteVolume': undefined, + 'info': ticker, + }, market); + } + sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) { + const url = this.urls['api']['public'] + '/' + path; + headers = { 'Content-Type': 'application/json' }; + return { 'url': url, 'method': method, 'body': body, 'headers': headers }; + } +} + + /***/ }), /***/ 6810: @@ -336774,7 +339836,7 @@ class lbank extends _lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A { /***/ }), -/***/ 2208: +/***/ 9827: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { /* harmony export */ __webpack_require__.d(__webpack_exports__, { @@ -381908,8 +384970,10 @@ class tabdeal extends _abstract_tabdeal_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa /* harmony export */ A: () => (/* binding */ tetherland) /* harmony export */ }); /* harmony import */ var _abstract_tetherland_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9012); +/* harmony import */ var _base_functions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6834); // --------------------------------------------------------------------------- + // --------------------------------------------------------------------------- /** * @class tetherland @@ -381993,7 +385057,7 @@ class tetherland extends _abstract_tetherland_js__WEBPACK_IMPORTED_MODULE_0__/* 'urls': { 'logo': 'https://cdn.arz.digital/cr-odin/img/exchanges/tetherland/64x64.png', 'api': { - 'public': 'https://api.teterlands.com', + 'public': 'https://service.tetherland.com', }, 'www': 'https://tetherland.org', 'doc': [ @@ -382027,7 +385091,7 @@ class tetherland extends _abstract_tetherland_js__WEBPACK_IMPORTED_MODULE_0__/* * @returns {object[]} an array of objects representing market data */ const response = await this.publicGetApiV5Currencies(params); - const markets = this.safeDict(response, 'data'); + const markets = this.safeList(response, 'data'); const result = []; const quotes = ['USDT', 'IRT']; for (let i = 0; i < markets.length; i++) { @@ -382157,7 +385221,7 @@ class tetherland extends _abstract_tetherland_js__WEBPACK_IMPORTED_MODULE_0__/* symbols = this.marketSymbols(symbols); } const response = await this.publicGetApiV5Currencies(params); - const markets = this.safeDict(response, 'data'); + const markets = this.safeList(response, 'data'); const result = []; const quotes = ['USDT', 'IRT']; for (let i = 0; i < markets.length; i++) { @@ -382235,7 +385299,7 @@ class tetherland extends _abstract_tetherland_js__WEBPACK_IMPORTED_MODULE_0__/* const marketId = this.safeString(ticker, 'id'); const quote = this.safeString(ticker, 'quote'); const symbol = this.safeSymbol(marketId, market, undefined, marketType); - let last = this.safeFloat(ticker, 'price', 0); + let last = (0,_base_functions_js__WEBPACK_IMPORTED_MODULE_1__/* .asFloat */ .Pf)(this.safeString(ticker, 'price', '').replace(',', '')); if (quote === 'IRT') { last = this.safeFloat(ticker, 'toman_amount', 0); } @@ -388031,7 +391095,8 @@ class twox extends _abstract_twox_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] 'pro': false, 'has': { 'CORS': undefined, - 'spot': true, + 'spot': false, + 'otc': true, 'margin': false, 'swap': false, 'future': false, @@ -388284,51 +391349,77 @@ class twox extends _abstract_twox_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] } parseTicker(ticker, market = undefined) { // { - // sellPrice: 0, - // buyPrice: 0, - // latestPrice: 0, - // weeklyChart: "https://cdn.twox.trade/currencies/charts/7d/irt_toman.svg?v=2024061017", - // priceChangePercent: 0, - // minAmount: 10000, + // sellPrice: 113201.0, + // buyPrice: 112151.0, + // latestPrice: 1.0, + // weeklyChart: "https://cdn.twox.info/resource/w/tether.webp?v=101313", + // priceChangePercent: 0.0, + // sellPriceChange: 0.00, + // buyPriceChange: 0.00, + // minAmount: 2.0, // tags: [ ], // marketCategories: [ ], - // id: 1, - // symbol: "IRT", - // name: "Toman", - // icon: "https://cdn.twox.trade/currencies/icons/128x128/irt_toman.png", - // persianName: "تومان", - // isStableCoin: false, + // id: 2, + // symbol: "USDT", + // name: "Tether USDt", + // icon: "https://cdn.twox.info/resource/c/tether.webp", + // persianName: "تتر", + // isStableCoin: true, // isActive: true, - // colorCode: null, - // type: 0, + // type: 2, // isNeedRiskWarning: false, - // assetPrecision: 0, - // isLeveragedToken: false, - // commissionPrecision: 0, + // assetPrecision: 2, // isDepositAllEnable: true, - // isTrading: true, + // tradeStatus: 1, // isWithdrawAllEnable: true, - // currencySlug: "IRT_Toman", - // marketCurrencyId: 0, - // order: 0 + // currencySlug: "tether", + // marketCurrencyId: 825, + // order: 1, + // isTrading: true, + // commissionPrecision: 8, + // isDepositNeedManualConfirm: false, + // supportedBy: [ ] // }, const marketType = 'otc'; const marketId = this.safeString(ticker, 'symbol'); const symbol = this.safeSymbol(marketId, market, undefined, marketType); - let last = this.safeFloat(ticker, 'latestPrice', 0); + const sellPrice = this.safeFloat(ticker, 'sellPrice'); + const buyPrice = this.safeFloat(ticker, 'buyPrice'); + const latestPrice = this.safeFloat(ticker, 'latestPrice'); + let last = undefined; + let bid = undefined; + let ask = undefined; if (ticker['quote'] === 'IRT') { - last = this.safeFloat(ticker, 'sell_price', 0); + // For IRT pairs, sellPrice is what user pays (ask), buyPrice is what user receives (bid) + last = sellPrice; + bid = buyPrice; + ask = sellPrice; + } + else { + // For USDT pairs, use latestPrice + last = latestPrice; + bid = buyPrice; + ask = sellPrice; + } + const percentage = this.safeFloat(ticker, 'priceChangePercent'); + const sellPriceChange = this.safeFloat(ticker, 'sellPriceChange'); + const buyPriceChange = this.safeFloat(ticker, 'buyPriceChange'); + let change = undefined; + if (ticker['quote'] === 'IRT') { + change = sellPriceChange; + } + else { + change = buyPriceChange; } - const change = this.safeFloat(ticker, 'priceChangePercent', 0); return this.safeTicker({ 'symbol': symbol, 'timestamp': undefined, 'datetime': undefined, 'high': undefined, 'low': undefined, - 'bid': undefined, + 'bid': bid, 'bidVolume': undefined, - 'ask': undefined, + 'ask': ask, 'askVolume': undefined, 'vwap': undefined, 'open': undefined, @@ -388336,7 +391427,7 @@ class twox extends _abstract_twox_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] 'last': last, 'previousClose': undefined, 'change': change, - 'percentage': undefined, + 'percentage': percentage, 'average': undefined, 'baseVolume': undefined, 'quoteVolume': undefined, @@ -426666,49 +429757,49 @@ async function __wbg_init(input) { var __webpack_exports__ = {}; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ AccountNotEnabled: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_213_.AccountNotEnabled), -/* harmony export */ AccountSuspended: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_213_.AccountSuspended), -/* harmony export */ AddressPending: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_213_.AddressPending), -/* harmony export */ ArgumentsRequired: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_213_.ArgumentsRequired), -/* harmony export */ AuthenticationError: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_213_.AuthenticationError), -/* harmony export */ BadRequest: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_213_.BadRequest), -/* harmony export */ BadResponse: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_213_.BadResponse), -/* harmony export */ BadSymbol: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_213_.BadSymbol), -/* harmony export */ BaseError: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_213_.BaseError), -/* harmony export */ CancelPending: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_213_.CancelPending), -/* harmony export */ ChecksumError: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_213_.ChecksumError), -/* harmony export */ ContractUnavailable: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_213_.ContractUnavailable), -/* harmony export */ DDoSProtection: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_213_.DDoSProtection), -/* harmony export */ DuplicateOrderId: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_213_.DuplicateOrderId), +/* harmony export */ AccountNotEnabled: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_220_.AccountNotEnabled), +/* harmony export */ AccountSuspended: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_220_.AccountSuspended), +/* harmony export */ AddressPending: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_220_.AddressPending), +/* harmony export */ ArgumentsRequired: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_220_.ArgumentsRequired), +/* harmony export */ AuthenticationError: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_220_.AuthenticationError), +/* harmony export */ BadRequest: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_220_.BadRequest), +/* harmony export */ BadResponse: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_220_.BadResponse), +/* harmony export */ BadSymbol: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_220_.BadSymbol), +/* harmony export */ BaseError: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_220_.BaseError), +/* harmony export */ CancelPending: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_220_.CancelPending), +/* harmony export */ ChecksumError: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_220_.ChecksumError), +/* harmony export */ ContractUnavailable: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_220_.ContractUnavailable), +/* harmony export */ DDoSProtection: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_220_.DDoSProtection), +/* harmony export */ DuplicateOrderId: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_220_.DuplicateOrderId), /* harmony export */ Exchange: () => (/* reexport safe */ ccxt_src_base_Exchange_js_WEBPACK_IMPORTED_MODULE_0_.k), -/* harmony export */ ExchangeClosedByUser: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_213_.ExchangeClosedByUser), -/* harmony export */ ExchangeError: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_213_.ExchangeError), -/* harmony export */ ExchangeNotAvailable: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_213_.ExchangeNotAvailable), -/* harmony export */ InsufficientFunds: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_213_.InsufficientFunds), -/* harmony export */ InvalidAddress: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_213_.InvalidAddress), -/* harmony export */ InvalidNonce: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_213_.InvalidNonce), -/* harmony export */ InvalidOrder: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_213_.InvalidOrder), -/* harmony export */ InvalidProxySettings: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_213_.InvalidProxySettings), -/* harmony export */ ManualInteractionNeeded: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_213_.ManualInteractionNeeded), -/* harmony export */ MarginModeAlreadySet: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_213_.MarginModeAlreadySet), -/* harmony export */ MarketClosed: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_213_.MarketClosed), -/* harmony export */ NetworkError: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_213_.NetworkError), -/* harmony export */ NoChange: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_213_.NoChange), -/* harmony export */ NotSupported: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_213_.NotSupported), -/* harmony export */ NullResponse: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_213_.NullResponse), -/* harmony export */ OnMaintenance: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_213_.OnMaintenance), -/* harmony export */ OperationFailed: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_213_.OperationFailed), -/* harmony export */ OperationRejected: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_213_.OperationRejected), -/* harmony export */ OrderImmediatelyFillable: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_213_.OrderImmediatelyFillable), -/* harmony export */ OrderNotCached: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_213_.OrderNotCached), -/* harmony export */ OrderNotFillable: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_213_.OrderNotFillable), -/* harmony export */ OrderNotFound: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_213_.OrderNotFound), -/* harmony export */ PermissionDenied: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_213_.PermissionDenied), -/* harmony export */ Precise: () => (/* reexport safe */ ccxt_src_base_Precise_js_WEBPACK_IMPORTED_MODULE_211_.Y), -/* harmony export */ RateLimitExceeded: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_213_.RateLimitExceeded), -/* harmony export */ RequestTimeout: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_213_.RequestTimeout), -/* harmony export */ RestrictedLocation: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_213_.RestrictedLocation), -/* harmony export */ UnsubscribeError: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_213_.UnsubscribeError), +/* harmony export */ ExchangeClosedByUser: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_220_.ExchangeClosedByUser), +/* harmony export */ ExchangeError: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_220_.ExchangeError), +/* harmony export */ ExchangeNotAvailable: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_220_.ExchangeNotAvailable), +/* harmony export */ InsufficientFunds: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_220_.InsufficientFunds), +/* harmony export */ InvalidAddress: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_220_.InvalidAddress), +/* harmony export */ InvalidNonce: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_220_.InvalidNonce), +/* harmony export */ InvalidOrder: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_220_.InvalidOrder), +/* harmony export */ InvalidProxySettings: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_220_.InvalidProxySettings), +/* harmony export */ ManualInteractionNeeded: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_220_.ManualInteractionNeeded), +/* harmony export */ MarginModeAlreadySet: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_220_.MarginModeAlreadySet), +/* harmony export */ MarketClosed: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_220_.MarketClosed), +/* harmony export */ NetworkError: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_220_.NetworkError), +/* harmony export */ NoChange: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_220_.NoChange), +/* harmony export */ NotSupported: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_220_.NotSupported), +/* harmony export */ NullResponse: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_220_.NullResponse), +/* harmony export */ OnMaintenance: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_220_.OnMaintenance), +/* harmony export */ OperationFailed: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_220_.OperationFailed), +/* harmony export */ OperationRejected: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_220_.OperationRejected), +/* harmony export */ OrderImmediatelyFillable: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_220_.OrderImmediatelyFillable), +/* harmony export */ OrderNotCached: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_220_.OrderNotCached), +/* harmony export */ OrderNotFillable: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_220_.OrderNotFillable), +/* harmony export */ OrderNotFound: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_220_.OrderNotFound), +/* harmony export */ PermissionDenied: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_220_.PermissionDenied), +/* harmony export */ Precise: () => (/* reexport safe */ ccxt_src_base_Precise_js_WEBPACK_IMPORTED_MODULE_218_.Y), +/* harmony export */ RateLimitExceeded: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_220_.RateLimitExceeded), +/* harmony export */ RequestTimeout: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_220_.RequestTimeout), +/* harmony export */ RestrictedLocation: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_220_.RestrictedLocation), +/* harmony export */ UnsubscribeError: () => (/* reexport safe */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_220_.UnsubscribeError), /* harmony export */ abantether: () => (/* reexport safe */ ccxt_src_abantether_js_WEBPACK_IMPORTED_MODULE_1_.A), /* harmony export */ afratether: () => (/* reexport safe */ ccxt_src_afratether_js_WEBPACK_IMPORTED_MODULE_2_.A), /* harmony export */ alpaca: () => (/* reexport safe */ ccxt_src_alpaca_js_WEBPACK_IMPORTED_MODULE_3_.A), @@ -426726,137 +429817,144 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ bit24: () => (/* reexport safe */ ccxt_src_bit24_js_WEBPACK_IMPORTED_MODULE_15_.A), /* harmony export */ bit2c: () => (/* reexport safe */ ccxt_src_bit2c_js_WEBPACK_IMPORTED_MODULE_16_.A), /* harmony export */ bitbank: () => (/* reexport safe */ ccxt_src_bitbank_js_WEBPACK_IMPORTED_MODULE_17_.A), -/* harmony export */ bitbns: () => (/* reexport safe */ ccxt_src_bitbns_js_WEBPACK_IMPORTED_MODULE_18_.A), -/* harmony export */ bitfinex: () => (/* reexport safe */ ccxt_src_bitfinex_js_WEBPACK_IMPORTED_MODULE_19_.A), -/* harmony export */ bitflyer: () => (/* reexport safe */ ccxt_src_bitflyer_js_WEBPACK_IMPORTED_MODULE_20_.A), -/* harmony export */ bitget: () => (/* reexport safe */ ccxt_src_bitget_js_WEBPACK_IMPORTED_MODULE_21_.A), -/* harmony export */ bithumb: () => (/* reexport safe */ ccxt_src_bithumb_js_WEBPACK_IMPORTED_MODULE_22_.A), -/* harmony export */ bitimen: () => (/* reexport safe */ ccxt_src_bitimen_js_WEBPACK_IMPORTED_MODULE_23_.A), -/* harmony export */ bitir: () => (/* reexport safe */ ccxt_src_bitir_js_WEBPACK_IMPORTED_MODULE_24_.A), -/* harmony export */ bitmart: () => (/* reexport safe */ ccxt_src_bitmart_js_WEBPACK_IMPORTED_MODULE_25_.A), -/* harmony export */ bitmex: () => (/* reexport safe */ ccxt_src_bitmex_js_WEBPACK_IMPORTED_MODULE_26_.A), -/* harmony export */ bitopro: () => (/* reexport safe */ ccxt_src_bitopro_js_WEBPACK_IMPORTED_MODULE_27_.A), -/* harmony export */ bitpin: () => (/* reexport safe */ ccxt_src_bitpin_js_WEBPACK_IMPORTED_MODULE_28_.A), -/* harmony export */ bitrue: () => (/* reexport safe */ ccxt_src_bitrue_js_WEBPACK_IMPORTED_MODULE_29_.A), -/* harmony export */ bitso: () => (/* reexport safe */ ccxt_src_bitso_js_WEBPACK_IMPORTED_MODULE_30_.A), -/* harmony export */ bitstamp: () => (/* reexport safe */ ccxt_src_bitstamp_js_WEBPACK_IMPORTED_MODULE_31_.A), -/* harmony export */ bitteam: () => (/* reexport safe */ ccxt_src_bitteam_js_WEBPACK_IMPORTED_MODULE_32_.A), -/* harmony export */ bittrade: () => (/* reexport safe */ ccxt_src_bittrade_js_WEBPACK_IMPORTED_MODULE_33_.A), -/* harmony export */ bitunix: () => (/* reexport safe */ ccxt_src_bitunix_js_WEBPACK_IMPORTED_MODULE_34_.A), -/* harmony export */ bitvavo: () => (/* reexport safe */ ccxt_src_bitvavo_js_WEBPACK_IMPORTED_MODULE_35_.A), -/* harmony export */ blockchaincom: () => (/* reexport safe */ ccxt_src_blockchaincom_js_WEBPACK_IMPORTED_MODULE_36_.A), -/* harmony export */ blofin: () => (/* reexport safe */ ccxt_src_blofin_js_WEBPACK_IMPORTED_MODULE_37_.A), -/* harmony export */ btcalpha: () => (/* reexport safe */ ccxt_src_btcalpha_js_WEBPACK_IMPORTED_MODULE_38_.A), -/* harmony export */ btcbox: () => (/* reexport safe */ ccxt_src_btcbox_js_WEBPACK_IMPORTED_MODULE_39_.A), -/* harmony export */ btcmarkets: () => (/* reexport safe */ ccxt_src_btcmarkets_js_WEBPACK_IMPORTED_MODULE_40_.A), -/* harmony export */ btcturk: () => (/* reexport safe */ ccxt_src_btcturk_js_WEBPACK_IMPORTED_MODULE_41_.A), -/* harmony export */ bybit: () => (/* reexport safe */ ccxt_src_bybit_js_WEBPACK_IMPORTED_MODULE_42_.A), -/* harmony export */ cex: () => (/* reexport safe */ ccxt_src_cex_js_WEBPACK_IMPORTED_MODULE_43_.A), -/* harmony export */ coinbase: () => (/* reexport safe */ ccxt_src_coinbase_js_WEBPACK_IMPORTED_MODULE_44_.A), -/* harmony export */ coinbaseadvanced: () => (/* reexport safe */ ccxt_src_coinbaseadvanced_js_WEBPACK_IMPORTED_MODULE_45_.A), -/* harmony export */ coinbaseexchange: () => (/* reexport safe */ ccxt_src_coinbaseexchange_js_WEBPACK_IMPORTED_MODULE_46_.A), -/* harmony export */ coinbaseinternational: () => (/* reexport safe */ ccxt_src_coinbaseinternational_js_WEBPACK_IMPORTED_MODULE_47_.A), -/* harmony export */ coincatch: () => (/* reexport safe */ ccxt_src_coincatch_js_WEBPACK_IMPORTED_MODULE_48_.A), -/* harmony export */ coincheck: () => (/* reexport safe */ ccxt_src_coincheck_js_WEBPACK_IMPORTED_MODULE_49_.A), -/* harmony export */ coinex: () => (/* reexport safe */ ccxt_src_coinex_js_WEBPACK_IMPORTED_MODULE_50_.A), -/* harmony export */ coinmate: () => (/* reexport safe */ ccxt_src_coinmate_js_WEBPACK_IMPORTED_MODULE_51_.A), -/* harmony export */ coinmetro: () => (/* reexport safe */ ccxt_src_coinmetro_js_WEBPACK_IMPORTED_MODULE_52_.A), -/* harmony export */ coinone: () => (/* reexport safe */ ccxt_src_coinone_js_WEBPACK_IMPORTED_MODULE_53_.A), -/* harmony export */ coinsph: () => (/* reexport safe */ ccxt_src_coinsph_js_WEBPACK_IMPORTED_MODULE_54_.A), -/* harmony export */ coinspot: () => (/* reexport safe */ ccxt_src_coinspot_js_WEBPACK_IMPORTED_MODULE_55_.A), -/* harmony export */ cryptocom: () => (/* reexport safe */ ccxt_src_cryptocom_js_WEBPACK_IMPORTED_MODULE_56_.A), -/* harmony export */ cryptomus: () => (/* reexport safe */ ccxt_src_cryptomus_js_WEBPACK_IMPORTED_MODULE_57_.A), +/* harmony export */ bitbarg: () => (/* reexport safe */ ccxt_src_bitbarg_js_WEBPACK_IMPORTED_MODULE_18_.A), +/* harmony export */ bitbns: () => (/* reexport safe */ ccxt_src_bitbns_js_WEBPACK_IMPORTED_MODULE_19_.A), +/* harmony export */ bitfinex: () => (/* reexport safe */ ccxt_src_bitfinex_js_WEBPACK_IMPORTED_MODULE_20_.A), +/* harmony export */ bitflyer: () => (/* reexport safe */ ccxt_src_bitflyer_js_WEBPACK_IMPORTED_MODULE_21_.A), +/* harmony export */ bitget: () => (/* reexport safe */ ccxt_src_bitget_js_WEBPACK_IMPORTED_MODULE_22_.A), +/* harmony export */ bithumb: () => (/* reexport safe */ ccxt_src_bithumb_js_WEBPACK_IMPORTED_MODULE_23_.A), +/* harmony export */ bitimen: () => (/* reexport safe */ ccxt_src_bitimen_js_WEBPACK_IMPORTED_MODULE_24_.A), +/* harmony export */ bitir: () => (/* reexport safe */ ccxt_src_bitir_js_WEBPACK_IMPORTED_MODULE_25_.A), +/* harmony export */ bitmart: () => (/* reexport safe */ ccxt_src_bitmart_js_WEBPACK_IMPORTED_MODULE_26_.A), +/* harmony export */ bitmex: () => (/* reexport safe */ ccxt_src_bitmex_js_WEBPACK_IMPORTED_MODULE_27_.A), +/* harmony export */ bitopro: () => (/* reexport safe */ ccxt_src_bitopro_js_WEBPACK_IMPORTED_MODULE_28_.A), +/* harmony export */ bitpin: () => (/* reexport safe */ ccxt_src_bitpin_js_WEBPACK_IMPORTED_MODULE_29_.A), +/* harmony export */ bitrue: () => (/* reexport safe */ ccxt_src_bitrue_js_WEBPACK_IMPORTED_MODULE_30_.A), +/* harmony export */ bitso: () => (/* reexport safe */ ccxt_src_bitso_js_WEBPACK_IMPORTED_MODULE_31_.A), +/* harmony export */ bitstamp: () => (/* reexport safe */ ccxt_src_bitstamp_js_WEBPACK_IMPORTED_MODULE_32_.A), +/* harmony export */ bitteam: () => (/* reexport safe */ ccxt_src_bitteam_js_WEBPACK_IMPORTED_MODULE_33_.A), +/* harmony export */ bittrade: () => (/* reexport safe */ ccxt_src_bittrade_js_WEBPACK_IMPORTED_MODULE_34_.A), +/* harmony export */ bitunix: () => (/* reexport safe */ ccxt_src_bitunix_js_WEBPACK_IMPORTED_MODULE_35_.A), +/* harmony export */ bitvavo: () => (/* reexport safe */ ccxt_src_bitvavo_js_WEBPACK_IMPORTED_MODULE_36_.A), +/* harmony export */ blockchaincom: () => (/* reexport safe */ ccxt_src_blockchaincom_js_WEBPACK_IMPORTED_MODULE_37_.A), +/* harmony export */ blofin: () => (/* reexport safe */ ccxt_src_blofin_js_WEBPACK_IMPORTED_MODULE_38_.A), +/* harmony export */ btcalpha: () => (/* reexport safe */ ccxt_src_btcalpha_js_WEBPACK_IMPORTED_MODULE_39_.A), +/* harmony export */ btcbox: () => (/* reexport safe */ ccxt_src_btcbox_js_WEBPACK_IMPORTED_MODULE_40_.A), +/* harmony export */ btcmarkets: () => (/* reexport safe */ ccxt_src_btcmarkets_js_WEBPACK_IMPORTED_MODULE_41_.A), +/* harmony export */ btcturk: () => (/* reexport safe */ ccxt_src_btcturk_js_WEBPACK_IMPORTED_MODULE_42_.A), +/* harmony export */ bybit: () => (/* reexport safe */ ccxt_src_bybit_js_WEBPACK_IMPORTED_MODULE_43_.A), +/* harmony export */ bydfi: () => (/* reexport safe */ ccxt_src_bydfi_js_WEBPACK_IMPORTED_MODULE_44_.A), +/* harmony export */ cafearz: () => (/* reexport safe */ ccxt_src_cafearz_js_WEBPACK_IMPORTED_MODULE_45_.A), +/* harmony export */ cex: () => (/* reexport safe */ ccxt_src_cex_js_WEBPACK_IMPORTED_MODULE_46_.A), +/* harmony export */ coinbase: () => (/* reexport safe */ ccxt_src_coinbase_js_WEBPACK_IMPORTED_MODULE_47_.A), +/* harmony export */ coinbaseadvanced: () => (/* reexport safe */ ccxt_src_coinbaseadvanced_js_WEBPACK_IMPORTED_MODULE_48_.A), +/* harmony export */ coinbaseexchange: () => (/* reexport safe */ ccxt_src_coinbaseexchange_js_WEBPACK_IMPORTED_MODULE_49_.A), +/* harmony export */ coinbaseinternational: () => (/* reexport safe */ ccxt_src_coinbaseinternational_js_WEBPACK_IMPORTED_MODULE_50_.A), +/* harmony export */ coincatch: () => (/* reexport safe */ ccxt_src_coincatch_js_WEBPACK_IMPORTED_MODULE_51_.A), +/* harmony export */ coincheck: () => (/* reexport safe */ ccxt_src_coincheck_js_WEBPACK_IMPORTED_MODULE_52_.A), +/* harmony export */ coinex: () => (/* reexport safe */ ccxt_src_coinex_js_WEBPACK_IMPORTED_MODULE_53_.A), +/* harmony export */ coinmate: () => (/* reexport safe */ ccxt_src_coinmate_js_WEBPACK_IMPORTED_MODULE_54_.A), +/* harmony export */ coinmetro: () => (/* reexport safe */ ccxt_src_coinmetro_js_WEBPACK_IMPORTED_MODULE_55_.A), +/* harmony export */ coinone: () => (/* reexport safe */ ccxt_src_coinone_js_WEBPACK_IMPORTED_MODULE_56_.A), +/* harmony export */ coinsph: () => (/* reexport safe */ ccxt_src_coinsph_js_WEBPACK_IMPORTED_MODULE_57_.A), +/* harmony export */ coinspot: () => (/* reexport safe */ ccxt_src_coinspot_js_WEBPACK_IMPORTED_MODULE_58_.A), +/* harmony export */ cryptocom: () => (/* reexport safe */ ccxt_src_cryptocom_js_WEBPACK_IMPORTED_MODULE_59_.A), +/* harmony export */ cryptomus: () => (/* reexport safe */ ccxt_src_cryptomus_js_WEBPACK_IMPORTED_MODULE_60_.A), /* harmony export */ "default": () => (ts_ccxt), -/* harmony export */ defx: () => (/* reexport safe */ ccxt_src_defx_js_WEBPACK_IMPORTED_MODULE_58_.A), -/* harmony export */ delta: () => (/* reexport safe */ ccxt_src_delta_js_WEBPACK_IMPORTED_MODULE_59_.A), -/* harmony export */ deribit: () => (/* reexport safe */ ccxt_src_deribit_js_WEBPACK_IMPORTED_MODULE_60_.A), -/* harmony export */ derive: () => (/* reexport safe */ ccxt_src_derive_js_WEBPACK_IMPORTED_MODULE_61_.A), -/* harmony export */ digifinex: () => (/* reexport safe */ ccxt_src_digifinex_js_WEBPACK_IMPORTED_MODULE_62_.A), -/* harmony export */ ellipx: () => (/* reexport safe */ ccxt_src_ellipx_js_WEBPACK_IMPORTED_MODULE_63_.A), -/* harmony export */ errors: () => (/* reexport module object */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_213_), -/* harmony export */ eterex: () => (/* reexport safe */ ccxt_src_eterex_js_WEBPACK_IMPORTED_MODULE_64_.A), +/* harmony export */ defx: () => (/* reexport safe */ ccxt_src_defx_js_WEBPACK_IMPORTED_MODULE_61_.A), +/* harmony export */ delta: () => (/* reexport safe */ ccxt_src_delta_js_WEBPACK_IMPORTED_MODULE_62_.A), +/* harmony export */ deribit: () => (/* reexport safe */ ccxt_src_deribit_js_WEBPACK_IMPORTED_MODULE_63_.A), +/* harmony export */ derive: () => (/* reexport safe */ ccxt_src_derive_js_WEBPACK_IMPORTED_MODULE_64_.A), +/* harmony export */ digifinex: () => (/* reexport safe */ ccxt_src_digifinex_js_WEBPACK_IMPORTED_MODULE_65_.A), +/* harmony export */ ellipx: () => (/* reexport safe */ ccxt_src_ellipx_js_WEBPACK_IMPORTED_MODULE_66_.A), +/* harmony export */ errors: () => (/* reexport module object */ ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_220_), +/* harmony export */ eterex: () => (/* reexport safe */ ccxt_src_eterex_js_WEBPACK_IMPORTED_MODULE_67_.A), /* harmony export */ exchanges: () => (/* binding */ ccxt_exchanges), -/* harmony export */ excoino: () => (/* reexport safe */ ccxt_src_excoino_js_WEBPACK_IMPORTED_MODULE_65_.A), -/* harmony export */ exir: () => (/* reexport safe */ ccxt_src_exir_js_WEBPACK_IMPORTED_MODULE_66_.A), -/* harmony export */ exmo: () => (/* reexport safe */ ccxt_src_exmo_js_WEBPACK_IMPORTED_MODULE_67_.A), -/* harmony export */ exnovin: () => (/* reexport safe */ ccxt_src_exnovin_js_WEBPACK_IMPORTED_MODULE_68_.A), -/* harmony export */ farhadexchange: () => (/* reexport safe */ ccxt_src_farhadexchange_js_WEBPACK_IMPORTED_MODULE_69_.A), -/* harmony export */ fmfwio: () => (/* reexport safe */ ccxt_src_fmfwio_js_WEBPACK_IMPORTED_MODULE_70_.A), -/* harmony export */ foxbit: () => (/* reexport safe */ ccxt_src_foxbit_js_WEBPACK_IMPORTED_MODULE_71_.A), -/* harmony export */ functions: () => (/* reexport module object */ ccxt_src_base_functions_js_WEBPACK_IMPORTED_MODULE_212_), -/* harmony export */ gate: () => (/* reexport safe */ ccxt_src_gate_js_WEBPACK_IMPORTED_MODULE_72_.A), -/* harmony export */ gateio: () => (/* reexport safe */ ccxt_src_gateio_js_WEBPACK_IMPORTED_MODULE_73_.A), -/* harmony export */ gemini: () => (/* reexport safe */ ccxt_src_gemini_js_WEBPACK_IMPORTED_MODULE_74_.A), -/* harmony export */ hamtapay: () => (/* reexport safe */ ccxt_src_hamtapay_js_WEBPACK_IMPORTED_MODULE_75_.A), -/* harmony export */ hashkey: () => (/* reexport safe */ ccxt_src_hashkey_js_WEBPACK_IMPORTED_MODULE_76_.A), -/* harmony export */ hibachi: () => (/* reexport safe */ ccxt_src_hibachi_js_WEBPACK_IMPORTED_MODULE_77_.A), -/* harmony export */ hitbtc: () => (/* reexport safe */ ccxt_src_hitbtc_js_WEBPACK_IMPORTED_MODULE_78_.A), -/* harmony export */ hitobit: () => (/* reexport safe */ ccxt_src_hitobit_js_WEBPACK_IMPORTED_MODULE_79_.A), -/* harmony export */ hollaex: () => (/* reexport safe */ ccxt_src_hollaex_js_WEBPACK_IMPORTED_MODULE_80_.A), -/* harmony export */ htx: () => (/* reexport safe */ ccxt_src_htx_js_WEBPACK_IMPORTED_MODULE_81_.A), -/* harmony export */ huobi: () => (/* reexport safe */ ccxt_src_huobi_js_WEBPACK_IMPORTED_MODULE_82_.A), -/* harmony export */ hyperliquid: () => (/* reexport safe */ ccxt_src_hyperliquid_js_WEBPACK_IMPORTED_MODULE_83_.A), -/* harmony export */ independentreserve: () => (/* reexport safe */ ccxt_src_independentreserve_js_WEBPACK_IMPORTED_MODULE_84_.A), -/* harmony export */ indodax: () => (/* reexport safe */ ccxt_src_indodax_js_WEBPACK_IMPORTED_MODULE_85_.A), -/* harmony export */ jibitex: () => (/* reexport safe */ ccxt_src_jibitex_js_WEBPACK_IMPORTED_MODULE_86_.A), -/* harmony export */ kcex: () => (/* reexport safe */ ccxt_src_kcex_js_WEBPACK_IMPORTED_MODULE_87_.A), -/* harmony export */ kraken: () => (/* reexport safe */ ccxt_src_kraken_js_WEBPACK_IMPORTED_MODULE_88_.A), -/* harmony export */ krakenfutures: () => (/* reexport safe */ ccxt_src_krakenfutures_js_WEBPACK_IMPORTED_MODULE_89_.A), -/* harmony export */ kucoin: () => (/* reexport safe */ ccxt_src_kucoin_js_WEBPACK_IMPORTED_MODULE_90_.A), -/* harmony export */ kucoinfutures: () => (/* reexport safe */ ccxt_src_kucoinfutures_js_WEBPACK_IMPORTED_MODULE_91_.A), -/* harmony export */ latoken: () => (/* reexport safe */ ccxt_src_latoken_js_WEBPACK_IMPORTED_MODULE_92_.A), -/* harmony export */ lbank: () => (/* reexport safe */ ccxt_src_lbank_js_WEBPACK_IMPORTED_MODULE_93_.A), -/* harmony export */ luno: () => (/* reexport safe */ ccxt_src_luno_js_WEBPACK_IMPORTED_MODULE_94_.A), -/* harmony export */ mercado: () => (/* reexport safe */ ccxt_src_mercado_js_WEBPACK_IMPORTED_MODULE_95_.A), -/* harmony export */ mexc: () => (/* reexport safe */ ccxt_src_mexc_js_WEBPACK_IMPORTED_MODULE_96_.A), -/* harmony export */ modetrade: () => (/* reexport safe */ ccxt_src_modetrade_js_WEBPACK_IMPORTED_MODULE_97_.A), -/* harmony export */ myokx: () => (/* reexport safe */ ccxt_src_myokx_js_WEBPACK_IMPORTED_MODULE_98_.A), -/* harmony export */ ndax: () => (/* reexport safe */ ccxt_src_ndax_js_WEBPACK_IMPORTED_MODULE_99_.A), -/* harmony export */ nobitex: () => (/* reexport safe */ ccxt_src_nobitex_js_WEBPACK_IMPORTED_MODULE_100_.A), -/* harmony export */ novadax: () => (/* reexport safe */ ccxt_src_novadax_js_WEBPACK_IMPORTED_MODULE_101_.A), -/* harmony export */ oceanex: () => (/* reexport safe */ ccxt_src_oceanex_js_WEBPACK_IMPORTED_MODULE_102_.A), -/* harmony export */ okcoin: () => (/* reexport safe */ ccxt_src_okcoin_js_WEBPACK_IMPORTED_MODULE_103_.A), -/* harmony export */ okexchange: () => (/* reexport safe */ ccxt_src_okexchange_js_WEBPACK_IMPORTED_MODULE_104_.A), -/* harmony export */ okx: () => (/* reexport safe */ ccxt_src_okx_js_WEBPACK_IMPORTED_MODULE_105_.A), -/* harmony export */ okxus: () => (/* reexport safe */ ccxt_src_okxus_js_WEBPACK_IMPORTED_MODULE_106_.A), -/* harmony export */ ompfinex: () => (/* reexport safe */ ccxt_src_ompfinex_js_WEBPACK_IMPORTED_MODULE_107_.A), -/* harmony export */ onetrading: () => (/* reexport safe */ ccxt_src_onetrading_js_WEBPACK_IMPORTED_MODULE_108_.A), -/* harmony export */ oxfun: () => (/* reexport safe */ ccxt_src_oxfun_js_WEBPACK_IMPORTED_MODULE_109_.A), -/* harmony export */ p2b: () => (/* reexport safe */ ccxt_src_p2b_js_WEBPACK_IMPORTED_MODULE_110_.A), -/* harmony export */ paradex: () => (/* reexport safe */ ccxt_src_paradex_js_WEBPACK_IMPORTED_MODULE_111_.A), -/* harmony export */ paymium: () => (/* reexport safe */ ccxt_src_paymium_js_WEBPACK_IMPORTED_MODULE_112_.A), -/* harmony export */ phemex: () => (/* reexport safe */ ccxt_src_phemex_js_WEBPACK_IMPORTED_MODULE_113_.A), -/* harmony export */ poloniex: () => (/* reexport safe */ ccxt_src_poloniex_js_WEBPACK_IMPORTED_MODULE_114_.A), +/* harmony export */ excoino: () => (/* reexport safe */ ccxt_src_excoino_js_WEBPACK_IMPORTED_MODULE_68_.A), +/* harmony export */ exir: () => (/* reexport safe */ ccxt_src_exir_js_WEBPACK_IMPORTED_MODULE_69_.A), +/* harmony export */ exmo: () => (/* reexport safe */ ccxt_src_exmo_js_WEBPACK_IMPORTED_MODULE_70_.A), +/* harmony export */ exnovin: () => (/* reexport safe */ ccxt_src_exnovin_js_WEBPACK_IMPORTED_MODULE_71_.A), +/* harmony export */ farhadexchange: () => (/* reexport safe */ ccxt_src_farhadexchange_js_WEBPACK_IMPORTED_MODULE_72_.A), +/* harmony export */ fmfwio: () => (/* reexport safe */ ccxt_src_fmfwio_js_WEBPACK_IMPORTED_MODULE_73_.A), +/* harmony export */ foxbit: () => (/* reexport safe */ ccxt_src_foxbit_js_WEBPACK_IMPORTED_MODULE_74_.A), +/* harmony export */ functions: () => (/* reexport module object */ ccxt_src_base_functions_js_WEBPACK_IMPORTED_MODULE_219_), +/* harmony export */ gate: () => (/* reexport safe */ ccxt_src_gate_js_WEBPACK_IMPORTED_MODULE_75_.A), +/* harmony export */ gateio: () => (/* reexport safe */ ccxt_src_gateio_js_WEBPACK_IMPORTED_MODULE_76_.A), +/* harmony export */ gemini: () => (/* reexport safe */ ccxt_src_gemini_js_WEBPACK_IMPORTED_MODULE_77_.A), +/* harmony export */ hamtapay: () => (/* reexport safe */ ccxt_src_hamtapay_js_WEBPACK_IMPORTED_MODULE_78_.A), +/* harmony export */ hashkey: () => (/* reexport safe */ ccxt_src_hashkey_js_WEBPACK_IMPORTED_MODULE_79_.A), +/* harmony export */ hibachi: () => (/* reexport safe */ ccxt_src_hibachi_js_WEBPACK_IMPORTED_MODULE_80_.A), +/* harmony export */ hitbtc: () => (/* reexport safe */ ccxt_src_hitbtc_js_WEBPACK_IMPORTED_MODULE_81_.A), +/* harmony export */ hitobit: () => (/* reexport safe */ ccxt_src_hitobit_js_WEBPACK_IMPORTED_MODULE_82_.A), +/* harmony export */ hollaex: () => (/* reexport safe */ ccxt_src_hollaex_js_WEBPACK_IMPORTED_MODULE_83_.A), +/* harmony export */ htx: () => (/* reexport safe */ ccxt_src_htx_js_WEBPACK_IMPORTED_MODULE_84_.A), +/* harmony export */ huobi: () => (/* reexport safe */ ccxt_src_huobi_js_WEBPACK_IMPORTED_MODULE_85_.A), +/* harmony export */ hyperliquid: () => (/* reexport safe */ ccxt_src_hyperliquid_js_WEBPACK_IMPORTED_MODULE_86_.A), +/* harmony export */ independentreserve: () => (/* reexport safe */ ccxt_src_independentreserve_js_WEBPACK_IMPORTED_MODULE_87_.A), +/* harmony export */ indodax: () => (/* reexport safe */ ccxt_src_indodax_js_WEBPACK_IMPORTED_MODULE_88_.A), +/* harmony export */ jibitex: () => (/* reexport safe */ ccxt_src_jibitex_js_WEBPACK_IMPORTED_MODULE_89_.A), +/* harmony export */ kcex: () => (/* reexport safe */ ccxt_src_kcex_js_WEBPACK_IMPORTED_MODULE_90_.A), +/* harmony export */ kifpoolme: () => (/* reexport safe */ ccxt_src_kifpoolme_js_WEBPACK_IMPORTED_MODULE_91_.A), +/* harmony export */ kraken: () => (/* reexport safe */ ccxt_src_kraken_js_WEBPACK_IMPORTED_MODULE_92_.A), +/* harmony export */ krakenfutures: () => (/* reexport safe */ ccxt_src_krakenfutures_js_WEBPACK_IMPORTED_MODULE_93_.A), +/* harmony export */ kucoin: () => (/* reexport safe */ ccxt_src_kucoin_js_WEBPACK_IMPORTED_MODULE_94_.A), +/* harmony export */ kucoinfutures: () => (/* reexport safe */ ccxt_src_kucoinfutures_js_WEBPACK_IMPORTED_MODULE_95_.A), +/* harmony export */ latoken: () => (/* reexport safe */ ccxt_src_latoken_js_WEBPACK_IMPORTED_MODULE_96_.A), +/* harmony export */ lbank: () => (/* reexport safe */ ccxt_src_lbank_js_WEBPACK_IMPORTED_MODULE_97_.A), +/* harmony export */ luno: () => (/* reexport safe */ ccxt_src_luno_js_WEBPACK_IMPORTED_MODULE_98_.A), +/* harmony export */ mazdax: () => (/* reexport safe */ ccxt_src_mazdax_js_WEBPACK_IMPORTED_MODULE_99_.A), +/* harmony export */ mercado: () => (/* reexport safe */ ccxt_src_mercado_js_WEBPACK_IMPORTED_MODULE_100_.A), +/* harmony export */ mexc: () => (/* reexport safe */ ccxt_src_mexc_js_WEBPACK_IMPORTED_MODULE_101_.A), +/* harmony export */ modetrade: () => (/* reexport safe */ ccxt_src_modetrade_js_WEBPACK_IMPORTED_MODULE_102_.A), +/* harmony export */ myokx: () => (/* reexport safe */ ccxt_src_myokx_js_WEBPACK_IMPORTED_MODULE_103_.A), +/* harmony export */ ndax: () => (/* reexport safe */ ccxt_src_ndax_js_WEBPACK_IMPORTED_MODULE_104_.A), +/* harmony export */ nobitex: () => (/* reexport safe */ ccxt_src_nobitex_js_WEBPACK_IMPORTED_MODULE_105_.A), +/* harmony export */ novadax: () => (/* reexport safe */ ccxt_src_novadax_js_WEBPACK_IMPORTED_MODULE_106_.A), +/* harmony export */ oceanex: () => (/* reexport safe */ ccxt_src_oceanex_js_WEBPACK_IMPORTED_MODULE_107_.A), +/* harmony export */ okcoin: () => (/* reexport safe */ ccxt_src_okcoin_js_WEBPACK_IMPORTED_MODULE_108_.A), +/* harmony export */ okexchange: () => (/* reexport safe */ ccxt_src_okexchange_js_WEBPACK_IMPORTED_MODULE_109_.A), +/* harmony export */ okx: () => (/* reexport safe */ ccxt_src_okx_js_WEBPACK_IMPORTED_MODULE_110_.A), +/* harmony export */ okxus: () => (/* reexport safe */ ccxt_src_okxus_js_WEBPACK_IMPORTED_MODULE_111_.A), +/* harmony export */ ompfinex: () => (/* reexport safe */ ccxt_src_ompfinex_js_WEBPACK_IMPORTED_MODULE_112_.A), +/* harmony export */ onetrading: () => (/* reexport safe */ ccxt_src_onetrading_js_WEBPACK_IMPORTED_MODULE_113_.A), +/* harmony export */ oxfun: () => (/* reexport safe */ ccxt_src_oxfun_js_WEBPACK_IMPORTED_MODULE_114_.A), +/* harmony export */ p2b: () => (/* reexport safe */ ccxt_src_p2b_js_WEBPACK_IMPORTED_MODULE_115_.A), +/* harmony export */ paradex: () => (/* reexport safe */ ccxt_src_paradex_js_WEBPACK_IMPORTED_MODULE_116_.A), +/* harmony export */ paymium: () => (/* reexport safe */ ccxt_src_paymium_js_WEBPACK_IMPORTED_MODULE_117_.A), +/* harmony export */ phemex: () => (/* reexport safe */ ccxt_src_phemex_js_WEBPACK_IMPORTED_MODULE_118_.A), +/* harmony export */ pingi: () => (/* reexport safe */ ccxt_src_pingi_js_WEBPACK_IMPORTED_MODULE_119_.A), +/* harmony export */ poloniex: () => (/* reexport safe */ ccxt_src_poloniex_js_WEBPACK_IMPORTED_MODULE_120_.A), +/* harmony export */ pooleno: () => (/* reexport safe */ ccxt_src_pooleno_js_WEBPACK_IMPORTED_MODULE_121_.A), /* harmony export */ pro: () => (/* binding */ ccxt_pro), -/* harmony export */ probit: () => (/* reexport safe */ ccxt_src_probit_js_WEBPACK_IMPORTED_MODULE_115_.A), -/* harmony export */ ramzinex: () => (/* reexport safe */ ccxt_src_ramzinex_js_WEBPACK_IMPORTED_MODULE_116_.A), -/* harmony export */ sarmayex: () => (/* reexport safe */ ccxt_src_sarmayex_js_WEBPACK_IMPORTED_MODULE_117_.A), -/* harmony export */ sarrafex: () => (/* reexport safe */ ccxt_src_sarrafex_js_WEBPACK_IMPORTED_MODULE_118_.A), -/* harmony export */ tabdeal: () => (/* reexport safe */ ccxt_src_tabdeal_js_WEBPACK_IMPORTED_MODULE_119_.A), -/* harmony export */ tetherland: () => (/* reexport safe */ ccxt_src_tetherland_js_WEBPACK_IMPORTED_MODULE_120_.A), -/* harmony export */ timex: () => (/* reexport safe */ ccxt_src_timex_js_WEBPACK_IMPORTED_MODULE_121_.A), -/* harmony export */ tokocrypto: () => (/* reexport safe */ ccxt_src_tokocrypto_js_WEBPACK_IMPORTED_MODULE_122_.A), -/* harmony export */ toobit: () => (/* reexport safe */ ccxt_src_toobit_js_WEBPACK_IMPORTED_MODULE_123_.A), -/* harmony export */ tradeogre: () => (/* reexport safe */ ccxt_src_tradeogre_js_WEBPACK_IMPORTED_MODULE_124_.A), -/* harmony export */ twox: () => (/* reexport safe */ ccxt_src_twox_js_WEBPACK_IMPORTED_MODULE_125_.A), -/* harmony export */ ubitex: () => (/* reexport safe */ ccxt_src_ubitex_js_WEBPACK_IMPORTED_MODULE_126_.A), -/* harmony export */ upbit: () => (/* reexport safe */ ccxt_src_upbit_js_WEBPACK_IMPORTED_MODULE_127_.A), +/* harmony export */ probit: () => (/* reexport safe */ ccxt_src_probit_js_WEBPACK_IMPORTED_MODULE_122_.A), +/* harmony export */ ramzinex: () => (/* reexport safe */ ccxt_src_ramzinex_js_WEBPACK_IMPORTED_MODULE_123_.A), +/* harmony export */ sarmayex: () => (/* reexport safe */ ccxt_src_sarmayex_js_WEBPACK_IMPORTED_MODULE_124_.A), +/* harmony export */ sarrafex: () => (/* reexport safe */ ccxt_src_sarrafex_js_WEBPACK_IMPORTED_MODULE_125_.A), +/* harmony export */ tabdeal: () => (/* reexport safe */ ccxt_src_tabdeal_js_WEBPACK_IMPORTED_MODULE_126_.A), +/* harmony export */ tetherland: () => (/* reexport safe */ ccxt_src_tetherland_js_WEBPACK_IMPORTED_MODULE_127_.A), +/* harmony export */ timex: () => (/* reexport safe */ ccxt_src_timex_js_WEBPACK_IMPORTED_MODULE_128_.A), +/* harmony export */ tokocrypto: () => (/* reexport safe */ ccxt_src_tokocrypto_js_WEBPACK_IMPORTED_MODULE_129_.A), +/* harmony export */ toobit: () => (/* reexport safe */ ccxt_src_toobit_js_WEBPACK_IMPORTED_MODULE_130_.A), +/* harmony export */ tradeogre: () => (/* reexport safe */ ccxt_src_tradeogre_js_WEBPACK_IMPORTED_MODULE_131_.A), +/* harmony export */ twox: () => (/* reexport safe */ ccxt_src_twox_js_WEBPACK_IMPORTED_MODULE_132_.A), +/* harmony export */ ubitex: () => (/* reexport safe */ ccxt_src_ubitex_js_WEBPACK_IMPORTED_MODULE_133_.A), +/* harmony export */ upbit: () => (/* reexport safe */ ccxt_src_upbit_js_WEBPACK_IMPORTED_MODULE_134_.A), /* harmony export */ version: () => (/* binding */ ccxt_version), -/* harmony export */ vertex: () => (/* reexport safe */ ccxt_src_vertex_js_WEBPACK_IMPORTED_MODULE_128_.A), -/* harmony export */ wallex: () => (/* reexport safe */ ccxt_src_wallex_js_WEBPACK_IMPORTED_MODULE_129_.A), -/* harmony export */ wavesexchange: () => (/* reexport safe */ ccxt_src_wavesexchange_js_WEBPACK_IMPORTED_MODULE_130_.A), -/* harmony export */ whitebit: () => (/* reexport safe */ ccxt_src_whitebit_js_WEBPACK_IMPORTED_MODULE_131_.A), -/* harmony export */ woo: () => (/* reexport safe */ ccxt_src_woo_js_WEBPACK_IMPORTED_MODULE_132_.A), -/* harmony export */ woofipro: () => (/* reexport safe */ ccxt_src_woofipro_js_WEBPACK_IMPORTED_MODULE_133_.A), -/* harmony export */ xt: () => (/* reexport safe */ ccxt_src_xt_js_WEBPACK_IMPORTED_MODULE_134_.A), -/* harmony export */ yobit: () => (/* reexport safe */ ccxt_src_yobit_js_WEBPACK_IMPORTED_MODULE_135_.A), -/* harmony export */ zaif: () => (/* reexport safe */ ccxt_src_zaif_js_WEBPACK_IMPORTED_MODULE_136_.A), -/* harmony export */ zonda: () => (/* reexport safe */ ccxt_src_zonda_js_WEBPACK_IMPORTED_MODULE_137_.A) +/* harmony export */ vertex: () => (/* reexport safe */ ccxt_src_vertex_js_WEBPACK_IMPORTED_MODULE_135_.A), +/* harmony export */ wallex: () => (/* reexport safe */ ccxt_src_wallex_js_WEBPACK_IMPORTED_MODULE_136_.A), +/* harmony export */ wavesexchange: () => (/* reexport safe */ ccxt_src_wavesexchange_js_WEBPACK_IMPORTED_MODULE_137_.A), +/* harmony export */ whitebit: () => (/* reexport safe */ ccxt_src_whitebit_js_WEBPACK_IMPORTED_MODULE_138_.A), +/* harmony export */ woo: () => (/* reexport safe */ ccxt_src_woo_js_WEBPACK_IMPORTED_MODULE_139_.A), +/* harmony export */ woofipro: () => (/* reexport safe */ ccxt_src_woofipro_js_WEBPACK_IMPORTED_MODULE_140_.A), +/* harmony export */ xt: () => (/* reexport safe */ ccxt_src_xt_js_WEBPACK_IMPORTED_MODULE_141_.A), +/* harmony export */ yobit: () => (/* reexport safe */ ccxt_src_yobit_js_WEBPACK_IMPORTED_MODULE_142_.A), +/* harmony export */ zaif: () => (/* reexport safe */ ccxt_src_zaif_js_WEBPACK_IMPORTED_MODULE_143_.A), +/* harmony export */ zonda: () => (/* reexport safe */ ccxt_src_zonda_js_WEBPACK_IMPORTED_MODULE_144_.A) /* harmony export */ }); /* harmony import */ var ccxt_src_base_Exchange_js_WEBPACK_IMPORTED_MODULE_0_ = __webpack_require__(2961); -/* harmony import */ var ccxt_src_base_Precise_js_WEBPACK_IMPORTED_MODULE_211_ = __webpack_require__(5147); -/* harmony import */ var ccxt_src_base_functions_js_WEBPACK_IMPORTED_MODULE_212_ = __webpack_require__(5095); -/* harmony import */ var ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_213_ = __webpack_require__(2079); +/* harmony import */ var ccxt_src_base_Precise_js_WEBPACK_IMPORTED_MODULE_218_ = __webpack_require__(5147); +/* harmony import */ var ccxt_src_base_functions_js_WEBPACK_IMPORTED_MODULE_219_ = __webpack_require__(5095); +/* harmony import */ var ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_220_ = __webpack_require__(2079); /* harmony import */ var ccxt_src_abantether_js_WEBPACK_IMPORTED_MODULE_1_ = __webpack_require__(1656); /* harmony import */ var ccxt_src_afratether_js_WEBPACK_IMPORTED_MODULE_2_ = __webpack_require__(5566); /* harmony import */ var ccxt_src_alpaca_js_WEBPACK_IMPORTED_MODULE_3_ = __webpack_require__(7930); @@ -426874,199 +429972,206 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var ccxt_src_bit24_js_WEBPACK_IMPORTED_MODULE_15_ = __webpack_require__(1183); /* harmony import */ var ccxt_src_bit2c_js_WEBPACK_IMPORTED_MODULE_16_ = __webpack_require__(2342); /* harmony import */ var ccxt_src_bitbank_js_WEBPACK_IMPORTED_MODULE_17_ = __webpack_require__(7399); -/* harmony import */ var ccxt_src_bitbns_js_WEBPACK_IMPORTED_MODULE_18_ = __webpack_require__(6328); -/* harmony import */ var ccxt_src_bitfinex_js_WEBPACK_IMPORTED_MODULE_19_ = __webpack_require__(8657); -/* harmony import */ var ccxt_src_bitflyer_js_WEBPACK_IMPORTED_MODULE_20_ = __webpack_require__(1787); -/* harmony import */ var ccxt_src_bitget_js_WEBPACK_IMPORTED_MODULE_21_ = __webpack_require__(7757); -/* harmony import */ var ccxt_src_bithumb_js_WEBPACK_IMPORTED_MODULE_22_ = __webpack_require__(357); -/* harmony import */ var ccxt_src_bitimen_js_WEBPACK_IMPORTED_MODULE_23_ = __webpack_require__(4456); -/* harmony import */ var ccxt_src_bitir_js_WEBPACK_IMPORTED_MODULE_24_ = __webpack_require__(9314); -/* harmony import */ var ccxt_src_bitmart_js_WEBPACK_IMPORTED_MODULE_25_ = __webpack_require__(1837); -/* harmony import */ var ccxt_src_bitmex_js_WEBPACK_IMPORTED_MODULE_26_ = __webpack_require__(9523); -/* harmony import */ var ccxt_src_bitopro_js_WEBPACK_IMPORTED_MODULE_27_ = __webpack_require__(2753); -/* harmony import */ var ccxt_src_bitpin_js_WEBPACK_IMPORTED_MODULE_28_ = __webpack_require__(9558); -/* harmony import */ var ccxt_src_bitrue_js_WEBPACK_IMPORTED_MODULE_29_ = __webpack_require__(9061); -/* harmony import */ var ccxt_src_bitso_js_WEBPACK_IMPORTED_MODULE_30_ = __webpack_require__(3019); -/* harmony import */ var ccxt_src_bitstamp_js_WEBPACK_IMPORTED_MODULE_31_ = __webpack_require__(382); -/* harmony import */ var ccxt_src_bitteam_js_WEBPACK_IMPORTED_MODULE_32_ = __webpack_require__(112); -/* harmony import */ var ccxt_src_bittrade_js_WEBPACK_IMPORTED_MODULE_33_ = __webpack_require__(2263); -/* harmony import */ var ccxt_src_bitunix_js_WEBPACK_IMPORTED_MODULE_34_ = __webpack_require__(587); -/* harmony import */ var ccxt_src_bitvavo_js_WEBPACK_IMPORTED_MODULE_35_ = __webpack_require__(3727); -/* harmony import */ var ccxt_src_blockchaincom_js_WEBPACK_IMPORTED_MODULE_36_ = __webpack_require__(3205); -/* harmony import */ var ccxt_src_blofin_js_WEBPACK_IMPORTED_MODULE_37_ = __webpack_require__(2520); -/* harmony import */ var ccxt_src_btcalpha_js_WEBPACK_IMPORTED_MODULE_38_ = __webpack_require__(3413); -/* harmony import */ var ccxt_src_btcbox_js_WEBPACK_IMPORTED_MODULE_39_ = __webpack_require__(5376); -/* harmony import */ var ccxt_src_btcmarkets_js_WEBPACK_IMPORTED_MODULE_40_ = __webpack_require__(4936); -/* harmony import */ var ccxt_src_btcturk_js_WEBPACK_IMPORTED_MODULE_41_ = __webpack_require__(9265); -/* harmony import */ var ccxt_src_bybit_js_WEBPACK_IMPORTED_MODULE_42_ = __webpack_require__(5462); -/* harmony import */ var ccxt_src_cex_js_WEBPACK_IMPORTED_MODULE_43_ = __webpack_require__(8846); -/* harmony import */ var ccxt_src_coinbase_js_WEBPACK_IMPORTED_MODULE_44_ = __webpack_require__(7504); -/* harmony import */ var ccxt_src_coinbaseadvanced_js_WEBPACK_IMPORTED_MODULE_45_ = __webpack_require__(3278); -/* harmony import */ var ccxt_src_coinbaseexchange_js_WEBPACK_IMPORTED_MODULE_46_ = __webpack_require__(4293); -/* harmony import */ var ccxt_src_coinbaseinternational_js_WEBPACK_IMPORTED_MODULE_47_ = __webpack_require__(1558); -/* harmony import */ var ccxt_src_coincatch_js_WEBPACK_IMPORTED_MODULE_48_ = __webpack_require__(570); -/* harmony import */ var ccxt_src_coincheck_js_WEBPACK_IMPORTED_MODULE_49_ = __webpack_require__(2741); -/* harmony import */ var ccxt_src_coinex_js_WEBPACK_IMPORTED_MODULE_50_ = __webpack_require__(9344); -/* harmony import */ var ccxt_src_coinmate_js_WEBPACK_IMPORTED_MODULE_51_ = __webpack_require__(6016); -/* harmony import */ var ccxt_src_coinmetro_js_WEBPACK_IMPORTED_MODULE_52_ = __webpack_require__(8692); -/* harmony import */ var ccxt_src_coinone_js_WEBPACK_IMPORTED_MODULE_53_ = __webpack_require__(5377); -/* harmony import */ var ccxt_src_coinsph_js_WEBPACK_IMPORTED_MODULE_54_ = __webpack_require__(2692); -/* harmony import */ var ccxt_src_coinspot_js_WEBPACK_IMPORTED_MODULE_55_ = __webpack_require__(1669); -/* harmony import */ var ccxt_src_cryptocom_js_WEBPACK_IMPORTED_MODULE_56_ = __webpack_require__(6068); -/* harmony import */ var ccxt_src_cryptomus_js_WEBPACK_IMPORTED_MODULE_57_ = __webpack_require__(870); -/* harmony import */ var ccxt_src_defx_js_WEBPACK_IMPORTED_MODULE_58_ = __webpack_require__(6077); -/* harmony import */ var ccxt_src_delta_js_WEBPACK_IMPORTED_MODULE_59_ = __webpack_require__(1080); -/* harmony import */ var ccxt_src_deribit_js_WEBPACK_IMPORTED_MODULE_60_ = __webpack_require__(2591); -/* harmony import */ var ccxt_src_derive_js_WEBPACK_IMPORTED_MODULE_61_ = __webpack_require__(1839); -/* harmony import */ var ccxt_src_digifinex_js_WEBPACK_IMPORTED_MODULE_62_ = __webpack_require__(779); -/* harmony import */ var ccxt_src_ellipx_js_WEBPACK_IMPORTED_MODULE_63_ = __webpack_require__(1962); -/* harmony import */ var ccxt_src_eterex_js_WEBPACK_IMPORTED_MODULE_64_ = __webpack_require__(6415); -/* harmony import */ var ccxt_src_excoino_js_WEBPACK_IMPORTED_MODULE_65_ = __webpack_require__(9335); -/* harmony import */ var ccxt_src_exir_js_WEBPACK_IMPORTED_MODULE_66_ = __webpack_require__(9098); -/* harmony import */ var ccxt_src_exmo_js_WEBPACK_IMPORTED_MODULE_67_ = __webpack_require__(7057); -/* harmony import */ var ccxt_src_exnovin_js_WEBPACK_IMPORTED_MODULE_68_ = __webpack_require__(9169); -/* harmony import */ var ccxt_src_farhadexchange_js_WEBPACK_IMPORTED_MODULE_69_ = __webpack_require__(6711); -/* harmony import */ var ccxt_src_fmfwio_js_WEBPACK_IMPORTED_MODULE_70_ = __webpack_require__(3042); -/* harmony import */ var ccxt_src_foxbit_js_WEBPACK_IMPORTED_MODULE_71_ = __webpack_require__(448); -/* harmony import */ var ccxt_src_gate_js_WEBPACK_IMPORTED_MODULE_72_ = __webpack_require__(9403); -/* harmony import */ var ccxt_src_gateio_js_WEBPACK_IMPORTED_MODULE_73_ = __webpack_require__(784); -/* harmony import */ var ccxt_src_gemini_js_WEBPACK_IMPORTED_MODULE_74_ = __webpack_require__(8823); -/* harmony import */ var ccxt_src_hamtapay_js_WEBPACK_IMPORTED_MODULE_75_ = __webpack_require__(9369); -/* harmony import */ var ccxt_src_hashkey_js_WEBPACK_IMPORTED_MODULE_76_ = __webpack_require__(2937); -/* harmony import */ var ccxt_src_hibachi_js_WEBPACK_IMPORTED_MODULE_77_ = __webpack_require__(5106); -/* harmony import */ var ccxt_src_hitbtc_js_WEBPACK_IMPORTED_MODULE_78_ = __webpack_require__(7996); -/* harmony import */ var ccxt_src_hitobit_js_WEBPACK_IMPORTED_MODULE_79_ = __webpack_require__(675); -/* harmony import */ var ccxt_src_hollaex_js_WEBPACK_IMPORTED_MODULE_80_ = __webpack_require__(4455); -/* harmony import */ var ccxt_src_htx_js_WEBPACK_IMPORTED_MODULE_81_ = __webpack_require__(9946); -/* harmony import */ var ccxt_src_huobi_js_WEBPACK_IMPORTED_MODULE_82_ = __webpack_require__(63); -/* harmony import */ var ccxt_src_hyperliquid_js_WEBPACK_IMPORTED_MODULE_83_ = __webpack_require__(1936); -/* harmony import */ var ccxt_src_independentreserve_js_WEBPACK_IMPORTED_MODULE_84_ = __webpack_require__(4162); -/* harmony import */ var ccxt_src_indodax_js_WEBPACK_IMPORTED_MODULE_85_ = __webpack_require__(7325); -/* harmony import */ var ccxt_src_jibitex_js_WEBPACK_IMPORTED_MODULE_86_ = __webpack_require__(835); -/* harmony import */ var ccxt_src_kcex_js_WEBPACK_IMPORTED_MODULE_87_ = __webpack_require__(1199); -/* harmony import */ var ccxt_src_kraken_js_WEBPACK_IMPORTED_MODULE_88_ = __webpack_require__(8042); -/* harmony import */ var ccxt_src_krakenfutures_js_WEBPACK_IMPORTED_MODULE_89_ = __webpack_require__(2300); -/* harmony import */ var ccxt_src_kucoin_js_WEBPACK_IMPORTED_MODULE_90_ = __webpack_require__(1397); -/* harmony import */ var ccxt_src_kucoinfutures_js_WEBPACK_IMPORTED_MODULE_91_ = __webpack_require__(6217); -/* harmony import */ var ccxt_src_latoken_js_WEBPACK_IMPORTED_MODULE_92_ = __webpack_require__(8146); -/* harmony import */ var ccxt_src_lbank_js_WEBPACK_IMPORTED_MODULE_93_ = __webpack_require__(3144); -/* harmony import */ var ccxt_src_luno_js_WEBPACK_IMPORTED_MODULE_94_ = __webpack_require__(9248); -/* harmony import */ var ccxt_src_mercado_js_WEBPACK_IMPORTED_MODULE_95_ = __webpack_require__(6419); -/* harmony import */ var ccxt_src_mexc_js_WEBPACK_IMPORTED_MODULE_96_ = __webpack_require__(2403); -/* harmony import */ var ccxt_src_modetrade_js_WEBPACK_IMPORTED_MODULE_97_ = __webpack_require__(5345); -/* harmony import */ var ccxt_src_myokx_js_WEBPACK_IMPORTED_MODULE_98_ = __webpack_require__(8982); -/* harmony import */ var ccxt_src_ndax_js_WEBPACK_IMPORTED_MODULE_99_ = __webpack_require__(4460); -/* harmony import */ var ccxt_src_nobitex_js_WEBPACK_IMPORTED_MODULE_100_ = __webpack_require__(1561); -/* harmony import */ var ccxt_src_novadax_js_WEBPACK_IMPORTED_MODULE_101_ = __webpack_require__(8473); -/* harmony import */ var ccxt_src_oceanex_js_WEBPACK_IMPORTED_MODULE_102_ = __webpack_require__(3805); -/* harmony import */ var ccxt_src_okcoin_js_WEBPACK_IMPORTED_MODULE_103_ = __webpack_require__(7915); -/* harmony import */ var ccxt_src_okexchange_js_WEBPACK_IMPORTED_MODULE_104_ = __webpack_require__(79); -/* harmony import */ var ccxt_src_okx_js_WEBPACK_IMPORTED_MODULE_105_ = __webpack_require__(3660); -/* harmony import */ var ccxt_src_okxus_js_WEBPACK_IMPORTED_MODULE_106_ = __webpack_require__(3536); -/* harmony import */ var ccxt_src_ompfinex_js_WEBPACK_IMPORTED_MODULE_107_ = __webpack_require__(848); -/* harmony import */ var ccxt_src_onetrading_js_WEBPACK_IMPORTED_MODULE_108_ = __webpack_require__(3573); -/* harmony import */ var ccxt_src_oxfun_js_WEBPACK_IMPORTED_MODULE_109_ = __webpack_require__(6358); -/* harmony import */ var ccxt_src_p2b_js_WEBPACK_IMPORTED_MODULE_110_ = __webpack_require__(4998); -/* harmony import */ var ccxt_src_paradex_js_WEBPACK_IMPORTED_MODULE_111_ = __webpack_require__(6993); -/* harmony import */ var ccxt_src_paymium_js_WEBPACK_IMPORTED_MODULE_112_ = __webpack_require__(3280); -/* harmony import */ var ccxt_src_phemex_js_WEBPACK_IMPORTED_MODULE_113_ = __webpack_require__(9075); -/* harmony import */ var ccxt_src_poloniex_js_WEBPACK_IMPORTED_MODULE_114_ = __webpack_require__(288); -/* harmony import */ var ccxt_src_probit_js_WEBPACK_IMPORTED_MODULE_115_ = __webpack_require__(5037); -/* harmony import */ var ccxt_src_ramzinex_js_WEBPACK_IMPORTED_MODULE_116_ = __webpack_require__(676); -/* harmony import */ var ccxt_src_sarmayex_js_WEBPACK_IMPORTED_MODULE_117_ = __webpack_require__(5822); -/* harmony import */ var ccxt_src_sarrafex_js_WEBPACK_IMPORTED_MODULE_118_ = __webpack_require__(9702); -/* harmony import */ var ccxt_src_tabdeal_js_WEBPACK_IMPORTED_MODULE_119_ = __webpack_require__(5619); -/* harmony import */ var ccxt_src_tetherland_js_WEBPACK_IMPORTED_MODULE_120_ = __webpack_require__(7497); -/* harmony import */ var ccxt_src_timex_js_WEBPACK_IMPORTED_MODULE_121_ = __webpack_require__(6213); -/* harmony import */ var ccxt_src_tokocrypto_js_WEBPACK_IMPORTED_MODULE_122_ = __webpack_require__(2490); -/* harmony import */ var ccxt_src_toobit_js_WEBPACK_IMPORTED_MODULE_123_ = __webpack_require__(237); -/* harmony import */ var ccxt_src_tradeogre_js_WEBPACK_IMPORTED_MODULE_124_ = __webpack_require__(5887); -/* harmony import */ var ccxt_src_twox_js_WEBPACK_IMPORTED_MODULE_125_ = __webpack_require__(8586); -/* harmony import */ var ccxt_src_ubitex_js_WEBPACK_IMPORTED_MODULE_126_ = __webpack_require__(3551); -/* harmony import */ var ccxt_src_upbit_js_WEBPACK_IMPORTED_MODULE_127_ = __webpack_require__(930); -/* harmony import */ var ccxt_src_vertex_js_WEBPACK_IMPORTED_MODULE_128_ = __webpack_require__(4910); -/* harmony import */ var ccxt_src_wallex_js_WEBPACK_IMPORTED_MODULE_129_ = __webpack_require__(8633); -/* harmony import */ var ccxt_src_wavesexchange_js_WEBPACK_IMPORTED_MODULE_130_ = __webpack_require__(7073); -/* harmony import */ var ccxt_src_whitebit_js_WEBPACK_IMPORTED_MODULE_131_ = __webpack_require__(5336); -/* harmony import */ var ccxt_src_woo_js_WEBPACK_IMPORTED_MODULE_132_ = __webpack_require__(669); -/* harmony import */ var ccxt_src_woofipro_js_WEBPACK_IMPORTED_MODULE_133_ = __webpack_require__(9641); -/* harmony import */ var ccxt_src_xt_js_WEBPACK_IMPORTED_MODULE_134_ = __webpack_require__(5344); -/* harmony import */ var ccxt_src_yobit_js_WEBPACK_IMPORTED_MODULE_135_ = __webpack_require__(7469); -/* harmony import */ var ccxt_src_zaif_js_WEBPACK_IMPORTED_MODULE_136_ = __webpack_require__(1530); -/* harmony import */ var ccxt_src_zonda_js_WEBPACK_IMPORTED_MODULE_137_ = __webpack_require__(6022); -/* harmony import */ var ccxt_src_pro_alpaca_js_WEBPACK_IMPORTED_MODULE_138_ = __webpack_require__(6810); -/* harmony import */ var ccxt_src_pro_apex_js_WEBPACK_IMPORTED_MODULE_139_ = __webpack_require__(136); -/* harmony import */ var ccxt_src_pro_ascendex_js_WEBPACK_IMPORTED_MODULE_140_ = __webpack_require__(1657); -/* harmony import */ var ccxt_src_pro_bequant_js_WEBPACK_IMPORTED_MODULE_141_ = __webpack_require__(9338); -/* harmony import */ var ccxt_src_pro_binance_js_WEBPACK_IMPORTED_MODULE_142_ = __webpack_require__(9544); -/* harmony import */ var ccxt_src_pro_binancecoinm_js_WEBPACK_IMPORTED_MODULE_143_ = __webpack_require__(902); -/* harmony import */ var ccxt_src_pro_binanceus_js_WEBPACK_IMPORTED_MODULE_144_ = __webpack_require__(8788); -/* harmony import */ var ccxt_src_pro_binanceusdm_js_WEBPACK_IMPORTED_MODULE_145_ = __webpack_require__(8251); -/* harmony import */ var ccxt_src_pro_bingx_js_WEBPACK_IMPORTED_MODULE_146_ = __webpack_require__(9456); -/* harmony import */ var ccxt_src_pro_bitfinex_js_WEBPACK_IMPORTED_MODULE_147_ = __webpack_require__(1038); -/* harmony import */ var ccxt_src_pro_bitget_js_WEBPACK_IMPORTED_MODULE_148_ = __webpack_require__(205); -/* harmony import */ var ccxt_src_pro_bithumb_js_WEBPACK_IMPORTED_MODULE_149_ = __webpack_require__(6181); -/* harmony import */ var ccxt_src_pro_bitmart_js_WEBPACK_IMPORTED_MODULE_150_ = __webpack_require__(3069); -/* harmony import */ var ccxt_src_pro_bitmex_js_WEBPACK_IMPORTED_MODULE_151_ = __webpack_require__(3731); -/* harmony import */ var ccxt_src_pro_bitopro_js_WEBPACK_IMPORTED_MODULE_152_ = __webpack_require__(4401); -/* harmony import */ var ccxt_src_pro_bitrue_js_WEBPACK_IMPORTED_MODULE_153_ = __webpack_require__(3333); -/* harmony import */ var ccxt_src_pro_bitstamp_js_WEBPACK_IMPORTED_MODULE_154_ = __webpack_require__(3326); -/* harmony import */ var ccxt_src_pro_bittrade_js_WEBPACK_IMPORTED_MODULE_155_ = __webpack_require__(2391); -/* harmony import */ var ccxt_src_pro_bitvavo_js_WEBPACK_IMPORTED_MODULE_156_ = __webpack_require__(1327); -/* harmony import */ var ccxt_src_pro_blockchaincom_js_WEBPACK_IMPORTED_MODULE_157_ = __webpack_require__(8693); -/* harmony import */ var ccxt_src_pro_blofin_js_WEBPACK_IMPORTED_MODULE_158_ = __webpack_require__(1672); -/* harmony import */ var ccxt_src_pro_bybit_js_WEBPACK_IMPORTED_MODULE_159_ = __webpack_require__(8518); -/* harmony import */ var ccxt_src_pro_cex_js_WEBPACK_IMPORTED_MODULE_160_ = __webpack_require__(3774); -/* harmony import */ var ccxt_src_pro_coinbase_js_WEBPACK_IMPORTED_MODULE_161_ = __webpack_require__(8160); -/* harmony import */ var ccxt_src_pro_coinbaseadvanced_js_WEBPACK_IMPORTED_MODULE_162_ = __webpack_require__(5918); -/* harmony import */ var ccxt_src_pro_coinbaseexchange_js_WEBPACK_IMPORTED_MODULE_163_ = __webpack_require__(1925); -/* harmony import */ var ccxt_src_pro_coinbaseinternational_js_WEBPACK_IMPORTED_MODULE_164_ = __webpack_require__(998); -/* harmony import */ var ccxt_src_pro_coincatch_js_WEBPACK_IMPORTED_MODULE_165_ = __webpack_require__(3242); -/* harmony import */ var ccxt_src_pro_coincheck_js_WEBPACK_IMPORTED_MODULE_166_ = __webpack_require__(5317); -/* harmony import */ var ccxt_src_pro_coinex_js_WEBPACK_IMPORTED_MODULE_167_ = __webpack_require__(9088); -/* harmony import */ var ccxt_src_pro_coinone_js_WEBPACK_IMPORTED_MODULE_168_ = __webpack_require__(8673); -/* harmony import */ var ccxt_src_pro_cryptocom_js_WEBPACK_IMPORTED_MODULE_169_ = __webpack_require__(6292); -/* harmony import */ var ccxt_src_pro_defx_js_WEBPACK_IMPORTED_MODULE_170_ = __webpack_require__(8717); -/* harmony import */ var ccxt_src_pro_deribit_js_WEBPACK_IMPORTED_MODULE_171_ = __webpack_require__(7791); -/* harmony import */ var ccxt_src_pro_derive_js_WEBPACK_IMPORTED_MODULE_172_ = __webpack_require__(2127); -/* harmony import */ var ccxt_src_pro_exmo_js_WEBPACK_IMPORTED_MODULE_173_ = __webpack_require__(5233); -/* harmony import */ var ccxt_src_pro_gate_js_WEBPACK_IMPORTED_MODULE_174_ = __webpack_require__(9195); -/* harmony import */ var ccxt_src_pro_gateio_js_WEBPACK_IMPORTED_MODULE_175_ = __webpack_require__(5843); -/* harmony import */ var ccxt_src_pro_gemini_js_WEBPACK_IMPORTED_MODULE_176_ = __webpack_require__(375); -/* harmony import */ var ccxt_src_pro_hashkey_js_WEBPACK_IMPORTED_MODULE_177_ = __webpack_require__(1481); -/* harmony import */ var ccxt_src_pro_hitbtc_js_WEBPACK_IMPORTED_MODULE_178_ = __webpack_require__(4524); -/* harmony import */ var ccxt_src_pro_hollaex_js_WEBPACK_IMPORTED_MODULE_179_ = __webpack_require__(8247); -/* harmony import */ var ccxt_src_pro_htx_js_WEBPACK_IMPORTED_MODULE_180_ = __webpack_require__(3898); -/* harmony import */ var ccxt_src_pro_huobi_js_WEBPACK_IMPORTED_MODULE_181_ = __webpack_require__(6335); -/* harmony import */ var ccxt_src_pro_hyperliquid_js_WEBPACK_IMPORTED_MODULE_182_ = __webpack_require__(3984); -/* harmony import */ var ccxt_src_pro_independentreserve_js_WEBPACK_IMPORTED_MODULE_183_ = __webpack_require__(98); -/* harmony import */ var ccxt_src_pro_kraken_js_WEBPACK_IMPORTED_MODULE_184_ = __webpack_require__(9050); -/* harmony import */ var ccxt_src_pro_krakenfutures_js_WEBPACK_IMPORTED_MODULE_185_ = __webpack_require__(6396); -/* harmony import */ var ccxt_src_pro_kucoin_js_WEBPACK_IMPORTED_MODULE_186_ = __webpack_require__(4965); -/* harmony import */ var ccxt_src_pro_kucoinfutures_js_WEBPACK_IMPORTED_MODULE_187_ = __webpack_require__(905); -/* harmony import */ var ccxt_src_pro_lbank_js_WEBPACK_IMPORTED_MODULE_188_ = __webpack_require__(1736); -/* harmony import */ var ccxt_src_pro_luno_js_WEBPACK_IMPORTED_MODULE_189_ = __webpack_require__(2208); -/* harmony import */ var ccxt_src_pro_mexc_js_WEBPACK_IMPORTED_MODULE_190_ = __webpack_require__(9219); -/* harmony import */ var ccxt_src_pro_modetrade_js_WEBPACK_IMPORTED_MODULE_191_ = __webpack_require__(49); -/* harmony import */ var ccxt_src_pro_myokx_js_WEBPACK_IMPORTED_MODULE_192_ = __webpack_require__(3062); -/* harmony import */ var ccxt_src_pro_ndax_js_WEBPACK_IMPORTED_MODULE_193_ = __webpack_require__(3887); -/* harmony import */ var ccxt_src_pro_okcoin_js_WEBPACK_IMPORTED_MODULE_194_ = __webpack_require__(6187); -/* harmony import */ var ccxt_src_pro_okx_js_WEBPACK_IMPORTED_MODULE_195_ = __webpack_require__(8588); -/* harmony import */ var ccxt_src_pro_okxus_js_WEBPACK_IMPORTED_MODULE_196_ = __webpack_require__(3296); -/* harmony import */ var ccxt_src_pro_onetrading_js_WEBPACK_IMPORTED_MODULE_197_ = __webpack_require__(4357); -/* harmony import */ var ccxt_src_pro_oxfun_js_WEBPACK_IMPORTED_MODULE_198_ = __webpack_require__(550); -/* harmony import */ var ccxt_src_pro_p2b_js_WEBPACK_IMPORTED_MODULE_199_ = __webpack_require__(4934); -/* harmony import */ var ccxt_src_pro_paradex_js_WEBPACK_IMPORTED_MODULE_200_ = __webpack_require__(1057); -/* harmony import */ var ccxt_src_pro_phemex_js_WEBPACK_IMPORTED_MODULE_201_ = __webpack_require__(1619); -/* harmony import */ var ccxt_src_pro_poloniex_js_WEBPACK_IMPORTED_MODULE_202_ = __webpack_require__(3456); -/* harmony import */ var ccxt_src_pro_probit_js_WEBPACK_IMPORTED_MODULE_203_ = __webpack_require__(5738); -/* harmony import */ var ccxt_src_pro_tradeogre_js_WEBPACK_IMPORTED_MODULE_204_ = __webpack_require__(8719); -/* harmony import */ var ccxt_src_pro_upbit_js_WEBPACK_IMPORTED_MODULE_205_ = __webpack_require__(5794); -/* harmony import */ var ccxt_src_pro_vertex_js_WEBPACK_IMPORTED_MODULE_206_ = __webpack_require__(910); -/* harmony import */ var ccxt_src_pro_whitebit_js_WEBPACK_IMPORTED_MODULE_207_ = __webpack_require__(4712); -/* harmony import */ var ccxt_src_pro_woo_js_WEBPACK_IMPORTED_MODULE_208_ = __webpack_require__(5869); -/* harmony import */ var ccxt_src_pro_woofipro_js_WEBPACK_IMPORTED_MODULE_209_ = __webpack_require__(8713); -/* harmony import */ var ccxt_src_pro_xt_js_WEBPACK_IMPORTED_MODULE_210_ = __webpack_require__(2368); +/* harmony import */ var ccxt_src_bitbarg_js_WEBPACK_IMPORTED_MODULE_18_ = __webpack_require__(2799); +/* harmony import */ var ccxt_src_bitbns_js_WEBPACK_IMPORTED_MODULE_19_ = __webpack_require__(6328); +/* harmony import */ var ccxt_src_bitfinex_js_WEBPACK_IMPORTED_MODULE_20_ = __webpack_require__(8657); +/* harmony import */ var ccxt_src_bitflyer_js_WEBPACK_IMPORTED_MODULE_21_ = __webpack_require__(1787); +/* harmony import */ var ccxt_src_bitget_js_WEBPACK_IMPORTED_MODULE_22_ = __webpack_require__(7757); +/* harmony import */ var ccxt_src_bithumb_js_WEBPACK_IMPORTED_MODULE_23_ = __webpack_require__(357); +/* harmony import */ var ccxt_src_bitimen_js_WEBPACK_IMPORTED_MODULE_24_ = __webpack_require__(4456); +/* harmony import */ var ccxt_src_bitir_js_WEBPACK_IMPORTED_MODULE_25_ = __webpack_require__(9314); +/* harmony import */ var ccxt_src_bitmart_js_WEBPACK_IMPORTED_MODULE_26_ = __webpack_require__(1837); +/* harmony import */ var ccxt_src_bitmex_js_WEBPACK_IMPORTED_MODULE_27_ = __webpack_require__(9523); +/* harmony import */ var ccxt_src_bitopro_js_WEBPACK_IMPORTED_MODULE_28_ = __webpack_require__(2753); +/* harmony import */ var ccxt_src_bitpin_js_WEBPACK_IMPORTED_MODULE_29_ = __webpack_require__(9558); +/* harmony import */ var ccxt_src_bitrue_js_WEBPACK_IMPORTED_MODULE_30_ = __webpack_require__(9061); +/* harmony import */ var ccxt_src_bitso_js_WEBPACK_IMPORTED_MODULE_31_ = __webpack_require__(3019); +/* harmony import */ var ccxt_src_bitstamp_js_WEBPACK_IMPORTED_MODULE_32_ = __webpack_require__(382); +/* harmony import */ var ccxt_src_bitteam_js_WEBPACK_IMPORTED_MODULE_33_ = __webpack_require__(112); +/* harmony import */ var ccxt_src_bittrade_js_WEBPACK_IMPORTED_MODULE_34_ = __webpack_require__(2263); +/* harmony import */ var ccxt_src_bitunix_js_WEBPACK_IMPORTED_MODULE_35_ = __webpack_require__(587); +/* harmony import */ var ccxt_src_bitvavo_js_WEBPACK_IMPORTED_MODULE_36_ = __webpack_require__(3727); +/* harmony import */ var ccxt_src_blockchaincom_js_WEBPACK_IMPORTED_MODULE_37_ = __webpack_require__(3205); +/* harmony import */ var ccxt_src_blofin_js_WEBPACK_IMPORTED_MODULE_38_ = __webpack_require__(2520); +/* harmony import */ var ccxt_src_btcalpha_js_WEBPACK_IMPORTED_MODULE_39_ = __webpack_require__(3413); +/* harmony import */ var ccxt_src_btcbox_js_WEBPACK_IMPORTED_MODULE_40_ = __webpack_require__(5376); +/* harmony import */ var ccxt_src_btcmarkets_js_WEBPACK_IMPORTED_MODULE_41_ = __webpack_require__(4936); +/* harmony import */ var ccxt_src_btcturk_js_WEBPACK_IMPORTED_MODULE_42_ = __webpack_require__(9265); +/* harmony import */ var ccxt_src_bybit_js_WEBPACK_IMPORTED_MODULE_43_ = __webpack_require__(5462); +/* harmony import */ var ccxt_src_bydfi_js_WEBPACK_IMPORTED_MODULE_44_ = __webpack_require__(5000); +/* harmony import */ var ccxt_src_cafearz_js_WEBPACK_IMPORTED_MODULE_45_ = __webpack_require__(5226); +/* harmony import */ var ccxt_src_cex_js_WEBPACK_IMPORTED_MODULE_46_ = __webpack_require__(8846); +/* harmony import */ var ccxt_src_coinbase_js_WEBPACK_IMPORTED_MODULE_47_ = __webpack_require__(7504); +/* harmony import */ var ccxt_src_coinbaseadvanced_js_WEBPACK_IMPORTED_MODULE_48_ = __webpack_require__(3278); +/* harmony import */ var ccxt_src_coinbaseexchange_js_WEBPACK_IMPORTED_MODULE_49_ = __webpack_require__(4293); +/* harmony import */ var ccxt_src_coinbaseinternational_js_WEBPACK_IMPORTED_MODULE_50_ = __webpack_require__(1558); +/* harmony import */ var ccxt_src_coincatch_js_WEBPACK_IMPORTED_MODULE_51_ = __webpack_require__(570); +/* harmony import */ var ccxt_src_coincheck_js_WEBPACK_IMPORTED_MODULE_52_ = __webpack_require__(2741); +/* harmony import */ var ccxt_src_coinex_js_WEBPACK_IMPORTED_MODULE_53_ = __webpack_require__(9344); +/* harmony import */ var ccxt_src_coinmate_js_WEBPACK_IMPORTED_MODULE_54_ = __webpack_require__(6016); +/* harmony import */ var ccxt_src_coinmetro_js_WEBPACK_IMPORTED_MODULE_55_ = __webpack_require__(8692); +/* harmony import */ var ccxt_src_coinone_js_WEBPACK_IMPORTED_MODULE_56_ = __webpack_require__(5377); +/* harmony import */ var ccxt_src_coinsph_js_WEBPACK_IMPORTED_MODULE_57_ = __webpack_require__(2692); +/* harmony import */ var ccxt_src_coinspot_js_WEBPACK_IMPORTED_MODULE_58_ = __webpack_require__(1669); +/* harmony import */ var ccxt_src_cryptocom_js_WEBPACK_IMPORTED_MODULE_59_ = __webpack_require__(6068); +/* harmony import */ var ccxt_src_cryptomus_js_WEBPACK_IMPORTED_MODULE_60_ = __webpack_require__(870); +/* harmony import */ var ccxt_src_defx_js_WEBPACK_IMPORTED_MODULE_61_ = __webpack_require__(6077); +/* harmony import */ var ccxt_src_delta_js_WEBPACK_IMPORTED_MODULE_62_ = __webpack_require__(1080); +/* harmony import */ var ccxt_src_deribit_js_WEBPACK_IMPORTED_MODULE_63_ = __webpack_require__(2591); +/* harmony import */ var ccxt_src_derive_js_WEBPACK_IMPORTED_MODULE_64_ = __webpack_require__(1839); +/* harmony import */ var ccxt_src_digifinex_js_WEBPACK_IMPORTED_MODULE_65_ = __webpack_require__(779); +/* harmony import */ var ccxt_src_ellipx_js_WEBPACK_IMPORTED_MODULE_66_ = __webpack_require__(1962); +/* harmony import */ var ccxt_src_eterex_js_WEBPACK_IMPORTED_MODULE_67_ = __webpack_require__(6415); +/* harmony import */ var ccxt_src_excoino_js_WEBPACK_IMPORTED_MODULE_68_ = __webpack_require__(9335); +/* harmony import */ var ccxt_src_exir_js_WEBPACK_IMPORTED_MODULE_69_ = __webpack_require__(9098); +/* harmony import */ var ccxt_src_exmo_js_WEBPACK_IMPORTED_MODULE_70_ = __webpack_require__(7057); +/* harmony import */ var ccxt_src_exnovin_js_WEBPACK_IMPORTED_MODULE_71_ = __webpack_require__(9169); +/* harmony import */ var ccxt_src_farhadexchange_js_WEBPACK_IMPORTED_MODULE_72_ = __webpack_require__(6711); +/* harmony import */ var ccxt_src_fmfwio_js_WEBPACK_IMPORTED_MODULE_73_ = __webpack_require__(3042); +/* harmony import */ var ccxt_src_foxbit_js_WEBPACK_IMPORTED_MODULE_74_ = __webpack_require__(448); +/* harmony import */ var ccxt_src_gate_js_WEBPACK_IMPORTED_MODULE_75_ = __webpack_require__(9403); +/* harmony import */ var ccxt_src_gateio_js_WEBPACK_IMPORTED_MODULE_76_ = __webpack_require__(784); +/* harmony import */ var ccxt_src_gemini_js_WEBPACK_IMPORTED_MODULE_77_ = __webpack_require__(8823); +/* harmony import */ var ccxt_src_hamtapay_js_WEBPACK_IMPORTED_MODULE_78_ = __webpack_require__(9369); +/* harmony import */ var ccxt_src_hashkey_js_WEBPACK_IMPORTED_MODULE_79_ = __webpack_require__(2937); +/* harmony import */ var ccxt_src_hibachi_js_WEBPACK_IMPORTED_MODULE_80_ = __webpack_require__(5106); +/* harmony import */ var ccxt_src_hitbtc_js_WEBPACK_IMPORTED_MODULE_81_ = __webpack_require__(7996); +/* harmony import */ var ccxt_src_hitobit_js_WEBPACK_IMPORTED_MODULE_82_ = __webpack_require__(675); +/* harmony import */ var ccxt_src_hollaex_js_WEBPACK_IMPORTED_MODULE_83_ = __webpack_require__(4455); +/* harmony import */ var ccxt_src_htx_js_WEBPACK_IMPORTED_MODULE_84_ = __webpack_require__(9946); +/* harmony import */ var ccxt_src_huobi_js_WEBPACK_IMPORTED_MODULE_85_ = __webpack_require__(63); +/* harmony import */ var ccxt_src_hyperliquid_js_WEBPACK_IMPORTED_MODULE_86_ = __webpack_require__(1936); +/* harmony import */ var ccxt_src_independentreserve_js_WEBPACK_IMPORTED_MODULE_87_ = __webpack_require__(4162); +/* harmony import */ var ccxt_src_indodax_js_WEBPACK_IMPORTED_MODULE_88_ = __webpack_require__(7325); +/* harmony import */ var ccxt_src_jibitex_js_WEBPACK_IMPORTED_MODULE_89_ = __webpack_require__(835); +/* harmony import */ var ccxt_src_kcex_js_WEBPACK_IMPORTED_MODULE_90_ = __webpack_require__(1199); +/* harmony import */ var ccxt_src_kifpoolme_js_WEBPACK_IMPORTED_MODULE_91_ = __webpack_require__(3644); +/* harmony import */ var ccxt_src_kraken_js_WEBPACK_IMPORTED_MODULE_92_ = __webpack_require__(8042); +/* harmony import */ var ccxt_src_krakenfutures_js_WEBPACK_IMPORTED_MODULE_93_ = __webpack_require__(2300); +/* harmony import */ var ccxt_src_kucoin_js_WEBPACK_IMPORTED_MODULE_94_ = __webpack_require__(1397); +/* harmony import */ var ccxt_src_kucoinfutures_js_WEBPACK_IMPORTED_MODULE_95_ = __webpack_require__(6217); +/* harmony import */ var ccxt_src_latoken_js_WEBPACK_IMPORTED_MODULE_96_ = __webpack_require__(8146); +/* harmony import */ var ccxt_src_lbank_js_WEBPACK_IMPORTED_MODULE_97_ = __webpack_require__(3144); +/* harmony import */ var ccxt_src_luno_js_WEBPACK_IMPORTED_MODULE_98_ = __webpack_require__(9248); +/* harmony import */ var ccxt_src_mazdax_js_WEBPACK_IMPORTED_MODULE_99_ = __webpack_require__(509); +/* harmony import */ var ccxt_src_mercado_js_WEBPACK_IMPORTED_MODULE_100_ = __webpack_require__(6419); +/* harmony import */ var ccxt_src_mexc_js_WEBPACK_IMPORTED_MODULE_101_ = __webpack_require__(2403); +/* harmony import */ var ccxt_src_modetrade_js_WEBPACK_IMPORTED_MODULE_102_ = __webpack_require__(5345); +/* harmony import */ var ccxt_src_myokx_js_WEBPACK_IMPORTED_MODULE_103_ = __webpack_require__(8982); +/* harmony import */ var ccxt_src_ndax_js_WEBPACK_IMPORTED_MODULE_104_ = __webpack_require__(4460); +/* harmony import */ var ccxt_src_nobitex_js_WEBPACK_IMPORTED_MODULE_105_ = __webpack_require__(1561); +/* harmony import */ var ccxt_src_novadax_js_WEBPACK_IMPORTED_MODULE_106_ = __webpack_require__(8473); +/* harmony import */ var ccxt_src_oceanex_js_WEBPACK_IMPORTED_MODULE_107_ = __webpack_require__(3805); +/* harmony import */ var ccxt_src_okcoin_js_WEBPACK_IMPORTED_MODULE_108_ = __webpack_require__(7915); +/* harmony import */ var ccxt_src_okexchange_js_WEBPACK_IMPORTED_MODULE_109_ = __webpack_require__(79); +/* harmony import */ var ccxt_src_okx_js_WEBPACK_IMPORTED_MODULE_110_ = __webpack_require__(3660); +/* harmony import */ var ccxt_src_okxus_js_WEBPACK_IMPORTED_MODULE_111_ = __webpack_require__(3536); +/* harmony import */ var ccxt_src_ompfinex_js_WEBPACK_IMPORTED_MODULE_112_ = __webpack_require__(848); +/* harmony import */ var ccxt_src_onetrading_js_WEBPACK_IMPORTED_MODULE_113_ = __webpack_require__(3573); +/* harmony import */ var ccxt_src_oxfun_js_WEBPACK_IMPORTED_MODULE_114_ = __webpack_require__(6358); +/* harmony import */ var ccxt_src_p2b_js_WEBPACK_IMPORTED_MODULE_115_ = __webpack_require__(4998); +/* harmony import */ var ccxt_src_paradex_js_WEBPACK_IMPORTED_MODULE_116_ = __webpack_require__(6993); +/* harmony import */ var ccxt_src_paymium_js_WEBPACK_IMPORTED_MODULE_117_ = __webpack_require__(3280); +/* harmony import */ var ccxt_src_phemex_js_WEBPACK_IMPORTED_MODULE_118_ = __webpack_require__(9075); +/* harmony import */ var ccxt_src_pingi_js_WEBPACK_IMPORTED_MODULE_119_ = __webpack_require__(8785); +/* harmony import */ var ccxt_src_poloniex_js_WEBPACK_IMPORTED_MODULE_120_ = __webpack_require__(288); +/* harmony import */ var ccxt_src_pooleno_js_WEBPACK_IMPORTED_MODULE_121_ = __webpack_require__(8920); +/* harmony import */ var ccxt_src_probit_js_WEBPACK_IMPORTED_MODULE_122_ = __webpack_require__(5037); +/* harmony import */ var ccxt_src_ramzinex_js_WEBPACK_IMPORTED_MODULE_123_ = __webpack_require__(676); +/* harmony import */ var ccxt_src_sarmayex_js_WEBPACK_IMPORTED_MODULE_124_ = __webpack_require__(5822); +/* harmony import */ var ccxt_src_sarrafex_js_WEBPACK_IMPORTED_MODULE_125_ = __webpack_require__(9702); +/* harmony import */ var ccxt_src_tabdeal_js_WEBPACK_IMPORTED_MODULE_126_ = __webpack_require__(5619); +/* harmony import */ var ccxt_src_tetherland_js_WEBPACK_IMPORTED_MODULE_127_ = __webpack_require__(7497); +/* harmony import */ var ccxt_src_timex_js_WEBPACK_IMPORTED_MODULE_128_ = __webpack_require__(6213); +/* harmony import */ var ccxt_src_tokocrypto_js_WEBPACK_IMPORTED_MODULE_129_ = __webpack_require__(2490); +/* harmony import */ var ccxt_src_toobit_js_WEBPACK_IMPORTED_MODULE_130_ = __webpack_require__(237); +/* harmony import */ var ccxt_src_tradeogre_js_WEBPACK_IMPORTED_MODULE_131_ = __webpack_require__(5887); +/* harmony import */ var ccxt_src_twox_js_WEBPACK_IMPORTED_MODULE_132_ = __webpack_require__(8586); +/* harmony import */ var ccxt_src_ubitex_js_WEBPACK_IMPORTED_MODULE_133_ = __webpack_require__(3551); +/* harmony import */ var ccxt_src_upbit_js_WEBPACK_IMPORTED_MODULE_134_ = __webpack_require__(930); +/* harmony import */ var ccxt_src_vertex_js_WEBPACK_IMPORTED_MODULE_135_ = __webpack_require__(4910); +/* harmony import */ var ccxt_src_wallex_js_WEBPACK_IMPORTED_MODULE_136_ = __webpack_require__(8633); +/* harmony import */ var ccxt_src_wavesexchange_js_WEBPACK_IMPORTED_MODULE_137_ = __webpack_require__(7073); +/* harmony import */ var ccxt_src_whitebit_js_WEBPACK_IMPORTED_MODULE_138_ = __webpack_require__(5336); +/* harmony import */ var ccxt_src_woo_js_WEBPACK_IMPORTED_MODULE_139_ = __webpack_require__(669); +/* harmony import */ var ccxt_src_woofipro_js_WEBPACK_IMPORTED_MODULE_140_ = __webpack_require__(9641); +/* harmony import */ var ccxt_src_xt_js_WEBPACK_IMPORTED_MODULE_141_ = __webpack_require__(5344); +/* harmony import */ var ccxt_src_yobit_js_WEBPACK_IMPORTED_MODULE_142_ = __webpack_require__(7469); +/* harmony import */ var ccxt_src_zaif_js_WEBPACK_IMPORTED_MODULE_143_ = __webpack_require__(1530); +/* harmony import */ var ccxt_src_zonda_js_WEBPACK_IMPORTED_MODULE_144_ = __webpack_require__(6022); +/* harmony import */ var ccxt_src_pro_alpaca_js_WEBPACK_IMPORTED_MODULE_145_ = __webpack_require__(6810); +/* harmony import */ var ccxt_src_pro_apex_js_WEBPACK_IMPORTED_MODULE_146_ = __webpack_require__(136); +/* harmony import */ var ccxt_src_pro_ascendex_js_WEBPACK_IMPORTED_MODULE_147_ = __webpack_require__(1657); +/* harmony import */ var ccxt_src_pro_bequant_js_WEBPACK_IMPORTED_MODULE_148_ = __webpack_require__(9338); +/* harmony import */ var ccxt_src_pro_binance_js_WEBPACK_IMPORTED_MODULE_149_ = __webpack_require__(9544); +/* harmony import */ var ccxt_src_pro_binancecoinm_js_WEBPACK_IMPORTED_MODULE_150_ = __webpack_require__(902); +/* harmony import */ var ccxt_src_pro_binanceus_js_WEBPACK_IMPORTED_MODULE_151_ = __webpack_require__(8788); +/* harmony import */ var ccxt_src_pro_binanceusdm_js_WEBPACK_IMPORTED_MODULE_152_ = __webpack_require__(8251); +/* harmony import */ var ccxt_src_pro_bingx_js_WEBPACK_IMPORTED_MODULE_153_ = __webpack_require__(9456); +/* harmony import */ var ccxt_src_pro_bitfinex_js_WEBPACK_IMPORTED_MODULE_154_ = __webpack_require__(1038); +/* harmony import */ var ccxt_src_pro_bitget_js_WEBPACK_IMPORTED_MODULE_155_ = __webpack_require__(205); +/* harmony import */ var ccxt_src_pro_bithumb_js_WEBPACK_IMPORTED_MODULE_156_ = __webpack_require__(6181); +/* harmony import */ var ccxt_src_pro_bitmart_js_WEBPACK_IMPORTED_MODULE_157_ = __webpack_require__(3069); +/* harmony import */ var ccxt_src_pro_bitmex_js_WEBPACK_IMPORTED_MODULE_158_ = __webpack_require__(3731); +/* harmony import */ var ccxt_src_pro_bitopro_js_WEBPACK_IMPORTED_MODULE_159_ = __webpack_require__(4401); +/* harmony import */ var ccxt_src_pro_bitrue_js_WEBPACK_IMPORTED_MODULE_160_ = __webpack_require__(3333); +/* harmony import */ var ccxt_src_pro_bitstamp_js_WEBPACK_IMPORTED_MODULE_161_ = __webpack_require__(3326); +/* harmony import */ var ccxt_src_pro_bittrade_js_WEBPACK_IMPORTED_MODULE_162_ = __webpack_require__(2391); +/* harmony import */ var ccxt_src_pro_bitvavo_js_WEBPACK_IMPORTED_MODULE_163_ = __webpack_require__(1327); +/* harmony import */ var ccxt_src_pro_blockchaincom_js_WEBPACK_IMPORTED_MODULE_164_ = __webpack_require__(8693); +/* harmony import */ var ccxt_src_pro_blofin_js_WEBPACK_IMPORTED_MODULE_165_ = __webpack_require__(1672); +/* harmony import */ var ccxt_src_pro_bybit_js_WEBPACK_IMPORTED_MODULE_166_ = __webpack_require__(8518); +/* harmony import */ var ccxt_src_pro_cex_js_WEBPACK_IMPORTED_MODULE_167_ = __webpack_require__(3774); +/* harmony import */ var ccxt_src_pro_coinbase_js_WEBPACK_IMPORTED_MODULE_168_ = __webpack_require__(8160); +/* harmony import */ var ccxt_src_pro_coinbaseadvanced_js_WEBPACK_IMPORTED_MODULE_169_ = __webpack_require__(5918); +/* harmony import */ var ccxt_src_pro_coinbaseexchange_js_WEBPACK_IMPORTED_MODULE_170_ = __webpack_require__(1925); +/* harmony import */ var ccxt_src_pro_coinbaseinternational_js_WEBPACK_IMPORTED_MODULE_171_ = __webpack_require__(998); +/* harmony import */ var ccxt_src_pro_coincatch_js_WEBPACK_IMPORTED_MODULE_172_ = __webpack_require__(3242); +/* harmony import */ var ccxt_src_pro_coincheck_js_WEBPACK_IMPORTED_MODULE_173_ = __webpack_require__(5317); +/* harmony import */ var ccxt_src_pro_coinex_js_WEBPACK_IMPORTED_MODULE_174_ = __webpack_require__(9088); +/* harmony import */ var ccxt_src_pro_coinone_js_WEBPACK_IMPORTED_MODULE_175_ = __webpack_require__(8673); +/* harmony import */ var ccxt_src_pro_cryptocom_js_WEBPACK_IMPORTED_MODULE_176_ = __webpack_require__(6292); +/* harmony import */ var ccxt_src_pro_defx_js_WEBPACK_IMPORTED_MODULE_177_ = __webpack_require__(8717); +/* harmony import */ var ccxt_src_pro_deribit_js_WEBPACK_IMPORTED_MODULE_178_ = __webpack_require__(7791); +/* harmony import */ var ccxt_src_pro_derive_js_WEBPACK_IMPORTED_MODULE_179_ = __webpack_require__(2127); +/* harmony import */ var ccxt_src_pro_exmo_js_WEBPACK_IMPORTED_MODULE_180_ = __webpack_require__(5233); +/* harmony import */ var ccxt_src_pro_gate_js_WEBPACK_IMPORTED_MODULE_181_ = __webpack_require__(9195); +/* harmony import */ var ccxt_src_pro_gateio_js_WEBPACK_IMPORTED_MODULE_182_ = __webpack_require__(5843); +/* harmony import */ var ccxt_src_pro_gemini_js_WEBPACK_IMPORTED_MODULE_183_ = __webpack_require__(375); +/* harmony import */ var ccxt_src_pro_hashkey_js_WEBPACK_IMPORTED_MODULE_184_ = __webpack_require__(1481); +/* harmony import */ var ccxt_src_pro_hitbtc_js_WEBPACK_IMPORTED_MODULE_185_ = __webpack_require__(4524); +/* harmony import */ var ccxt_src_pro_hollaex_js_WEBPACK_IMPORTED_MODULE_186_ = __webpack_require__(8247); +/* harmony import */ var ccxt_src_pro_htx_js_WEBPACK_IMPORTED_MODULE_187_ = __webpack_require__(3898); +/* harmony import */ var ccxt_src_pro_huobi_js_WEBPACK_IMPORTED_MODULE_188_ = __webpack_require__(6335); +/* harmony import */ var ccxt_src_pro_hyperliquid_js_WEBPACK_IMPORTED_MODULE_189_ = __webpack_require__(3984); +/* harmony import */ var ccxt_src_pro_independentreserve_js_WEBPACK_IMPORTED_MODULE_190_ = __webpack_require__(98); +/* harmony import */ var ccxt_src_pro_kraken_js_WEBPACK_IMPORTED_MODULE_191_ = __webpack_require__(9050); +/* harmony import */ var ccxt_src_pro_krakenfutures_js_WEBPACK_IMPORTED_MODULE_192_ = __webpack_require__(6396); +/* harmony import */ var ccxt_src_pro_kucoin_js_WEBPACK_IMPORTED_MODULE_193_ = __webpack_require__(4965); +/* harmony import */ var ccxt_src_pro_kucoinfutures_js_WEBPACK_IMPORTED_MODULE_194_ = __webpack_require__(905); +/* harmony import */ var ccxt_src_pro_lbank_js_WEBPACK_IMPORTED_MODULE_195_ = __webpack_require__(1736); +/* harmony import */ var ccxt_src_pro_luno_js_WEBPACK_IMPORTED_MODULE_196_ = __webpack_require__(9827); +/* harmony import */ var ccxt_src_pro_mexc_js_WEBPACK_IMPORTED_MODULE_197_ = __webpack_require__(9219); +/* harmony import */ var ccxt_src_pro_modetrade_js_WEBPACK_IMPORTED_MODULE_198_ = __webpack_require__(49); +/* harmony import */ var ccxt_src_pro_myokx_js_WEBPACK_IMPORTED_MODULE_199_ = __webpack_require__(3062); +/* harmony import */ var ccxt_src_pro_ndax_js_WEBPACK_IMPORTED_MODULE_200_ = __webpack_require__(3887); +/* harmony import */ var ccxt_src_pro_okcoin_js_WEBPACK_IMPORTED_MODULE_201_ = __webpack_require__(6187); +/* harmony import */ var ccxt_src_pro_okx_js_WEBPACK_IMPORTED_MODULE_202_ = __webpack_require__(8588); +/* harmony import */ var ccxt_src_pro_okxus_js_WEBPACK_IMPORTED_MODULE_203_ = __webpack_require__(3296); +/* harmony import */ var ccxt_src_pro_onetrading_js_WEBPACK_IMPORTED_MODULE_204_ = __webpack_require__(4357); +/* harmony import */ var ccxt_src_pro_oxfun_js_WEBPACK_IMPORTED_MODULE_205_ = __webpack_require__(550); +/* harmony import */ var ccxt_src_pro_p2b_js_WEBPACK_IMPORTED_MODULE_206_ = __webpack_require__(4934); +/* harmony import */ var ccxt_src_pro_paradex_js_WEBPACK_IMPORTED_MODULE_207_ = __webpack_require__(1057); +/* harmony import */ var ccxt_src_pro_phemex_js_WEBPACK_IMPORTED_MODULE_208_ = __webpack_require__(1619); +/* harmony import */ var ccxt_src_pro_poloniex_js_WEBPACK_IMPORTED_MODULE_209_ = __webpack_require__(3456); +/* harmony import */ var ccxt_src_pro_probit_js_WEBPACK_IMPORTED_MODULE_210_ = __webpack_require__(5738); +/* harmony import */ var ccxt_src_pro_tradeogre_js_WEBPACK_IMPORTED_MODULE_211_ = __webpack_require__(8719); +/* harmony import */ var ccxt_src_pro_upbit_js_WEBPACK_IMPORTED_MODULE_212_ = __webpack_require__(5794); +/* harmony import */ var ccxt_src_pro_vertex_js_WEBPACK_IMPORTED_MODULE_213_ = __webpack_require__(910); +/* harmony import */ var ccxt_src_pro_whitebit_js_WEBPACK_IMPORTED_MODULE_214_ = __webpack_require__(4712); +/* harmony import */ var ccxt_src_pro_woo_js_WEBPACK_IMPORTED_MODULE_215_ = __webpack_require__(5869); +/* harmony import */ var ccxt_src_pro_woofipro_js_WEBPACK_IMPORTED_MODULE_216_ = __webpack_require__(8713); +/* harmony import */ var ccxt_src_pro_xt_js_WEBPACK_IMPORTED_MODULE_217_ = __webpack_require__(2368); /* MIT License @@ -427101,7 +430206,7 @@ SOFTWARE. //----------------------------------------------------------------------------- // this is updated by vss.js when building -const ccxt_version = '4.9.4'; +const ccxt_version = '4.9.10'; ccxt_src_base_Exchange_js_WEBPACK_IMPORTED_MODULE_0_/* .Exchange */ .k.ccxtVersion = ccxt_version; //----------------------------------------------------------------------------- @@ -427233,6 +430338,13 @@ ccxt_src_base_Exchange_js_WEBPACK_IMPORTED_MODULE_0_/* .Exchange */ .k.ccxtVersi + + + + + + + @@ -427333,201 +430445,208 @@ const ccxt_exchanges = { 'bit24': ccxt_src_bit24_js_WEBPACK_IMPORTED_MODULE_15_/* ["default"] */ .A, 'bit2c': ccxt_src_bit2c_js_WEBPACK_IMPORTED_MODULE_16_/* ["default"] */ .A, 'bitbank': ccxt_src_bitbank_js_WEBPACK_IMPORTED_MODULE_17_/* ["default"] */ .A, - 'bitbns': ccxt_src_bitbns_js_WEBPACK_IMPORTED_MODULE_18_/* ["default"] */ .A, - 'bitfinex': ccxt_src_bitfinex_js_WEBPACK_IMPORTED_MODULE_19_/* ["default"] */ .A, - 'bitflyer': ccxt_src_bitflyer_js_WEBPACK_IMPORTED_MODULE_20_/* ["default"] */ .A, - 'bitget': ccxt_src_bitget_js_WEBPACK_IMPORTED_MODULE_21_/* ["default"] */ .A, - 'bithumb': ccxt_src_bithumb_js_WEBPACK_IMPORTED_MODULE_22_/* ["default"] */ .A, - 'bitimen': ccxt_src_bitimen_js_WEBPACK_IMPORTED_MODULE_23_/* ["default"] */ .A, - 'bitir': ccxt_src_bitir_js_WEBPACK_IMPORTED_MODULE_24_/* ["default"] */ .A, - 'bitmart': ccxt_src_bitmart_js_WEBPACK_IMPORTED_MODULE_25_/* ["default"] */ .A, - 'bitmex': ccxt_src_bitmex_js_WEBPACK_IMPORTED_MODULE_26_/* ["default"] */ .A, - 'bitopro': ccxt_src_bitopro_js_WEBPACK_IMPORTED_MODULE_27_/* ["default"] */ .A, - 'bitpin': ccxt_src_bitpin_js_WEBPACK_IMPORTED_MODULE_28_/* ["default"] */ .A, - 'bitrue': ccxt_src_bitrue_js_WEBPACK_IMPORTED_MODULE_29_/* ["default"] */ .A, - 'bitso': ccxt_src_bitso_js_WEBPACK_IMPORTED_MODULE_30_/* ["default"] */ .A, - 'bitstamp': ccxt_src_bitstamp_js_WEBPACK_IMPORTED_MODULE_31_/* ["default"] */ .A, - 'bitteam': ccxt_src_bitteam_js_WEBPACK_IMPORTED_MODULE_32_/* ["default"] */ .A, - 'bittrade': ccxt_src_bittrade_js_WEBPACK_IMPORTED_MODULE_33_/* ["default"] */ .A, - 'bitunix': ccxt_src_bitunix_js_WEBPACK_IMPORTED_MODULE_34_/* ["default"] */ .A, - 'bitvavo': ccxt_src_bitvavo_js_WEBPACK_IMPORTED_MODULE_35_/* ["default"] */ .A, - 'blockchaincom': ccxt_src_blockchaincom_js_WEBPACK_IMPORTED_MODULE_36_/* ["default"] */ .A, - 'blofin': ccxt_src_blofin_js_WEBPACK_IMPORTED_MODULE_37_/* ["default"] */ .A, - 'btcalpha': ccxt_src_btcalpha_js_WEBPACK_IMPORTED_MODULE_38_/* ["default"] */ .A, - 'btcbox': ccxt_src_btcbox_js_WEBPACK_IMPORTED_MODULE_39_/* ["default"] */ .A, - 'btcmarkets': ccxt_src_btcmarkets_js_WEBPACK_IMPORTED_MODULE_40_/* ["default"] */ .A, - 'btcturk': ccxt_src_btcturk_js_WEBPACK_IMPORTED_MODULE_41_/* ["default"] */ .A, - 'bybit': ccxt_src_bybit_js_WEBPACK_IMPORTED_MODULE_42_/* ["default"] */ .A, - 'cex': ccxt_src_cex_js_WEBPACK_IMPORTED_MODULE_43_/* ["default"] */ .A, - 'coinbase': ccxt_src_coinbase_js_WEBPACK_IMPORTED_MODULE_44_/* ["default"] */ .A, - 'coinbaseadvanced': ccxt_src_coinbaseadvanced_js_WEBPACK_IMPORTED_MODULE_45_/* ["default"] */ .A, - 'coinbaseexchange': ccxt_src_coinbaseexchange_js_WEBPACK_IMPORTED_MODULE_46_/* ["default"] */ .A, - 'coinbaseinternational': ccxt_src_coinbaseinternational_js_WEBPACK_IMPORTED_MODULE_47_/* ["default"] */ .A, - 'coincatch': ccxt_src_coincatch_js_WEBPACK_IMPORTED_MODULE_48_/* ["default"] */ .A, - 'coincheck': ccxt_src_coincheck_js_WEBPACK_IMPORTED_MODULE_49_/* ["default"] */ .A, - 'coinex': ccxt_src_coinex_js_WEBPACK_IMPORTED_MODULE_50_/* ["default"] */ .A, - 'coinmate': ccxt_src_coinmate_js_WEBPACK_IMPORTED_MODULE_51_/* ["default"] */ .A, - 'coinmetro': ccxt_src_coinmetro_js_WEBPACK_IMPORTED_MODULE_52_/* ["default"] */ .A, - 'coinone': ccxt_src_coinone_js_WEBPACK_IMPORTED_MODULE_53_/* ["default"] */ .A, - 'coinsph': ccxt_src_coinsph_js_WEBPACK_IMPORTED_MODULE_54_/* ["default"] */ .A, - 'coinspot': ccxt_src_coinspot_js_WEBPACK_IMPORTED_MODULE_55_/* ["default"] */ .A, - 'cryptocom': ccxt_src_cryptocom_js_WEBPACK_IMPORTED_MODULE_56_/* ["default"] */ .A, - 'cryptomus': ccxt_src_cryptomus_js_WEBPACK_IMPORTED_MODULE_57_/* ["default"] */ .A, - 'defx': ccxt_src_defx_js_WEBPACK_IMPORTED_MODULE_58_/* ["default"] */ .A, - 'delta': ccxt_src_delta_js_WEBPACK_IMPORTED_MODULE_59_/* ["default"] */ .A, - 'deribit': ccxt_src_deribit_js_WEBPACK_IMPORTED_MODULE_60_/* ["default"] */ .A, - 'derive': ccxt_src_derive_js_WEBPACK_IMPORTED_MODULE_61_/* ["default"] */ .A, - 'digifinex': ccxt_src_digifinex_js_WEBPACK_IMPORTED_MODULE_62_/* ["default"] */ .A, - 'ellipx': ccxt_src_ellipx_js_WEBPACK_IMPORTED_MODULE_63_/* ["default"] */ .A, - 'eterex': ccxt_src_eterex_js_WEBPACK_IMPORTED_MODULE_64_/* ["default"] */ .A, - 'excoino': ccxt_src_excoino_js_WEBPACK_IMPORTED_MODULE_65_/* ["default"] */ .A, - 'exir': ccxt_src_exir_js_WEBPACK_IMPORTED_MODULE_66_/* ["default"] */ .A, - 'exmo': ccxt_src_exmo_js_WEBPACK_IMPORTED_MODULE_67_/* ["default"] */ .A, - 'exnovin': ccxt_src_exnovin_js_WEBPACK_IMPORTED_MODULE_68_/* ["default"] */ .A, - 'farhadexchange': ccxt_src_farhadexchange_js_WEBPACK_IMPORTED_MODULE_69_/* ["default"] */ .A, - 'fmfwio': ccxt_src_fmfwio_js_WEBPACK_IMPORTED_MODULE_70_/* ["default"] */ .A, - 'foxbit': ccxt_src_foxbit_js_WEBPACK_IMPORTED_MODULE_71_/* ["default"] */ .A, - 'gate': ccxt_src_gate_js_WEBPACK_IMPORTED_MODULE_72_/* ["default"] */ .A, - 'gateio': ccxt_src_gateio_js_WEBPACK_IMPORTED_MODULE_73_/* ["default"] */ .A, - 'gemini': ccxt_src_gemini_js_WEBPACK_IMPORTED_MODULE_74_/* ["default"] */ .A, - 'hamtapay': ccxt_src_hamtapay_js_WEBPACK_IMPORTED_MODULE_75_/* ["default"] */ .A, - 'hashkey': ccxt_src_hashkey_js_WEBPACK_IMPORTED_MODULE_76_/* ["default"] */ .A, - 'hibachi': ccxt_src_hibachi_js_WEBPACK_IMPORTED_MODULE_77_/* ["default"] */ .A, - 'hitbtc': ccxt_src_hitbtc_js_WEBPACK_IMPORTED_MODULE_78_/* ["default"] */ .A, - 'hitobit': ccxt_src_hitobit_js_WEBPACK_IMPORTED_MODULE_79_/* ["default"] */ .A, - 'hollaex': ccxt_src_hollaex_js_WEBPACK_IMPORTED_MODULE_80_/* ["default"] */ .A, - 'htx': ccxt_src_htx_js_WEBPACK_IMPORTED_MODULE_81_/* ["default"] */ .A, - 'huobi': ccxt_src_huobi_js_WEBPACK_IMPORTED_MODULE_82_/* ["default"] */ .A, - 'hyperliquid': ccxt_src_hyperliquid_js_WEBPACK_IMPORTED_MODULE_83_/* ["default"] */ .A, - 'independentreserve': ccxt_src_independentreserve_js_WEBPACK_IMPORTED_MODULE_84_/* ["default"] */ .A, - 'indodax': ccxt_src_indodax_js_WEBPACK_IMPORTED_MODULE_85_/* ["default"] */ .A, - 'jibitex': ccxt_src_jibitex_js_WEBPACK_IMPORTED_MODULE_86_/* ["default"] */ .A, - 'kcex': ccxt_src_kcex_js_WEBPACK_IMPORTED_MODULE_87_/* ["default"] */ .A, - 'kraken': ccxt_src_kraken_js_WEBPACK_IMPORTED_MODULE_88_/* ["default"] */ .A, - 'krakenfutures': ccxt_src_krakenfutures_js_WEBPACK_IMPORTED_MODULE_89_/* ["default"] */ .A, - 'kucoin': ccxt_src_kucoin_js_WEBPACK_IMPORTED_MODULE_90_/* ["default"] */ .A, - 'kucoinfutures': ccxt_src_kucoinfutures_js_WEBPACK_IMPORTED_MODULE_91_/* ["default"] */ .A, - 'latoken': ccxt_src_latoken_js_WEBPACK_IMPORTED_MODULE_92_/* ["default"] */ .A, - 'lbank': ccxt_src_lbank_js_WEBPACK_IMPORTED_MODULE_93_/* ["default"] */ .A, - 'luno': ccxt_src_luno_js_WEBPACK_IMPORTED_MODULE_94_/* ["default"] */ .A, - 'mercado': ccxt_src_mercado_js_WEBPACK_IMPORTED_MODULE_95_/* ["default"] */ .A, - 'mexc': ccxt_src_mexc_js_WEBPACK_IMPORTED_MODULE_96_/* ["default"] */ .A, - 'modetrade': ccxt_src_modetrade_js_WEBPACK_IMPORTED_MODULE_97_/* ["default"] */ .A, - 'myokx': ccxt_src_myokx_js_WEBPACK_IMPORTED_MODULE_98_/* ["default"] */ .A, - 'ndax': ccxt_src_ndax_js_WEBPACK_IMPORTED_MODULE_99_/* ["default"] */ .A, - 'nobitex': ccxt_src_nobitex_js_WEBPACK_IMPORTED_MODULE_100_/* ["default"] */ .A, - 'novadax': ccxt_src_novadax_js_WEBPACK_IMPORTED_MODULE_101_/* ["default"] */ .A, - 'oceanex': ccxt_src_oceanex_js_WEBPACK_IMPORTED_MODULE_102_/* ["default"] */ .A, - 'okcoin': ccxt_src_okcoin_js_WEBPACK_IMPORTED_MODULE_103_/* ["default"] */ .A, - 'okexchange': ccxt_src_okexchange_js_WEBPACK_IMPORTED_MODULE_104_/* ["default"] */ .A, - 'okx': ccxt_src_okx_js_WEBPACK_IMPORTED_MODULE_105_/* ["default"] */ .A, - 'okxus': ccxt_src_okxus_js_WEBPACK_IMPORTED_MODULE_106_/* ["default"] */ .A, - 'ompfinex': ccxt_src_ompfinex_js_WEBPACK_IMPORTED_MODULE_107_/* ["default"] */ .A, - 'onetrading': ccxt_src_onetrading_js_WEBPACK_IMPORTED_MODULE_108_/* ["default"] */ .A, - 'oxfun': ccxt_src_oxfun_js_WEBPACK_IMPORTED_MODULE_109_/* ["default"] */ .A, - 'p2b': ccxt_src_p2b_js_WEBPACK_IMPORTED_MODULE_110_/* ["default"] */ .A, - 'paradex': ccxt_src_paradex_js_WEBPACK_IMPORTED_MODULE_111_/* ["default"] */ .A, - 'paymium': ccxt_src_paymium_js_WEBPACK_IMPORTED_MODULE_112_/* ["default"] */ .A, - 'phemex': ccxt_src_phemex_js_WEBPACK_IMPORTED_MODULE_113_/* ["default"] */ .A, - 'poloniex': ccxt_src_poloniex_js_WEBPACK_IMPORTED_MODULE_114_/* ["default"] */ .A, - 'probit': ccxt_src_probit_js_WEBPACK_IMPORTED_MODULE_115_/* ["default"] */ .A, - 'ramzinex': ccxt_src_ramzinex_js_WEBPACK_IMPORTED_MODULE_116_/* ["default"] */ .A, - 'sarmayex': ccxt_src_sarmayex_js_WEBPACK_IMPORTED_MODULE_117_/* ["default"] */ .A, - 'sarrafex': ccxt_src_sarrafex_js_WEBPACK_IMPORTED_MODULE_118_/* ["default"] */ .A, - 'tabdeal': ccxt_src_tabdeal_js_WEBPACK_IMPORTED_MODULE_119_/* ["default"] */ .A, - 'tetherland': ccxt_src_tetherland_js_WEBPACK_IMPORTED_MODULE_120_/* ["default"] */ .A, - 'timex': ccxt_src_timex_js_WEBPACK_IMPORTED_MODULE_121_/* ["default"] */ .A, - 'tokocrypto': ccxt_src_tokocrypto_js_WEBPACK_IMPORTED_MODULE_122_/* ["default"] */ .A, - 'toobit': ccxt_src_toobit_js_WEBPACK_IMPORTED_MODULE_123_/* ["default"] */ .A, - 'tradeogre': ccxt_src_tradeogre_js_WEBPACK_IMPORTED_MODULE_124_/* ["default"] */ .A, - 'twox': ccxt_src_twox_js_WEBPACK_IMPORTED_MODULE_125_/* ["default"] */ .A, - 'ubitex': ccxt_src_ubitex_js_WEBPACK_IMPORTED_MODULE_126_/* ["default"] */ .A, - 'upbit': ccxt_src_upbit_js_WEBPACK_IMPORTED_MODULE_127_/* ["default"] */ .A, - 'vertex': ccxt_src_vertex_js_WEBPACK_IMPORTED_MODULE_128_/* ["default"] */ .A, - 'wallex': ccxt_src_wallex_js_WEBPACK_IMPORTED_MODULE_129_/* ["default"] */ .A, - 'wavesexchange': ccxt_src_wavesexchange_js_WEBPACK_IMPORTED_MODULE_130_/* ["default"] */ .A, - 'whitebit': ccxt_src_whitebit_js_WEBPACK_IMPORTED_MODULE_131_/* ["default"] */ .A, - 'woo': ccxt_src_woo_js_WEBPACK_IMPORTED_MODULE_132_/* ["default"] */ .A, - 'woofipro': ccxt_src_woofipro_js_WEBPACK_IMPORTED_MODULE_133_/* ["default"] */ .A, - 'xt': ccxt_src_xt_js_WEBPACK_IMPORTED_MODULE_134_/* ["default"] */ .A, - 'yobit': ccxt_src_yobit_js_WEBPACK_IMPORTED_MODULE_135_/* ["default"] */ .A, - 'zaif': ccxt_src_zaif_js_WEBPACK_IMPORTED_MODULE_136_/* ["default"] */ .A, - 'zonda': ccxt_src_zonda_js_WEBPACK_IMPORTED_MODULE_137_/* ["default"] */ .A, + 'bitbarg': ccxt_src_bitbarg_js_WEBPACK_IMPORTED_MODULE_18_/* ["default"] */ .A, + 'bitbns': ccxt_src_bitbns_js_WEBPACK_IMPORTED_MODULE_19_/* ["default"] */ .A, + 'bitfinex': ccxt_src_bitfinex_js_WEBPACK_IMPORTED_MODULE_20_/* ["default"] */ .A, + 'bitflyer': ccxt_src_bitflyer_js_WEBPACK_IMPORTED_MODULE_21_/* ["default"] */ .A, + 'bitget': ccxt_src_bitget_js_WEBPACK_IMPORTED_MODULE_22_/* ["default"] */ .A, + 'bithumb': ccxt_src_bithumb_js_WEBPACK_IMPORTED_MODULE_23_/* ["default"] */ .A, + 'bitimen': ccxt_src_bitimen_js_WEBPACK_IMPORTED_MODULE_24_/* ["default"] */ .A, + 'bitir': ccxt_src_bitir_js_WEBPACK_IMPORTED_MODULE_25_/* ["default"] */ .A, + 'bitmart': ccxt_src_bitmart_js_WEBPACK_IMPORTED_MODULE_26_/* ["default"] */ .A, + 'bitmex': ccxt_src_bitmex_js_WEBPACK_IMPORTED_MODULE_27_/* ["default"] */ .A, + 'bitopro': ccxt_src_bitopro_js_WEBPACK_IMPORTED_MODULE_28_/* ["default"] */ .A, + 'bitpin': ccxt_src_bitpin_js_WEBPACK_IMPORTED_MODULE_29_/* ["default"] */ .A, + 'bitrue': ccxt_src_bitrue_js_WEBPACK_IMPORTED_MODULE_30_/* ["default"] */ .A, + 'bitso': ccxt_src_bitso_js_WEBPACK_IMPORTED_MODULE_31_/* ["default"] */ .A, + 'bitstamp': ccxt_src_bitstamp_js_WEBPACK_IMPORTED_MODULE_32_/* ["default"] */ .A, + 'bitteam': ccxt_src_bitteam_js_WEBPACK_IMPORTED_MODULE_33_/* ["default"] */ .A, + 'bittrade': ccxt_src_bittrade_js_WEBPACK_IMPORTED_MODULE_34_/* ["default"] */ .A, + 'bitunix': ccxt_src_bitunix_js_WEBPACK_IMPORTED_MODULE_35_/* ["default"] */ .A, + 'bitvavo': ccxt_src_bitvavo_js_WEBPACK_IMPORTED_MODULE_36_/* ["default"] */ .A, + 'blockchaincom': ccxt_src_blockchaincom_js_WEBPACK_IMPORTED_MODULE_37_/* ["default"] */ .A, + 'blofin': ccxt_src_blofin_js_WEBPACK_IMPORTED_MODULE_38_/* ["default"] */ .A, + 'btcalpha': ccxt_src_btcalpha_js_WEBPACK_IMPORTED_MODULE_39_/* ["default"] */ .A, + 'btcbox': ccxt_src_btcbox_js_WEBPACK_IMPORTED_MODULE_40_/* ["default"] */ .A, + 'btcmarkets': ccxt_src_btcmarkets_js_WEBPACK_IMPORTED_MODULE_41_/* ["default"] */ .A, + 'btcturk': ccxt_src_btcturk_js_WEBPACK_IMPORTED_MODULE_42_/* ["default"] */ .A, + 'bybit': ccxt_src_bybit_js_WEBPACK_IMPORTED_MODULE_43_/* ["default"] */ .A, + 'bydfi': ccxt_src_bydfi_js_WEBPACK_IMPORTED_MODULE_44_/* ["default"] */ .A, + 'cafearz': ccxt_src_cafearz_js_WEBPACK_IMPORTED_MODULE_45_/* ["default"] */ .A, + 'cex': ccxt_src_cex_js_WEBPACK_IMPORTED_MODULE_46_/* ["default"] */ .A, + 'coinbase': ccxt_src_coinbase_js_WEBPACK_IMPORTED_MODULE_47_/* ["default"] */ .A, + 'coinbaseadvanced': ccxt_src_coinbaseadvanced_js_WEBPACK_IMPORTED_MODULE_48_/* ["default"] */ .A, + 'coinbaseexchange': ccxt_src_coinbaseexchange_js_WEBPACK_IMPORTED_MODULE_49_/* ["default"] */ .A, + 'coinbaseinternational': ccxt_src_coinbaseinternational_js_WEBPACK_IMPORTED_MODULE_50_/* ["default"] */ .A, + 'coincatch': ccxt_src_coincatch_js_WEBPACK_IMPORTED_MODULE_51_/* ["default"] */ .A, + 'coincheck': ccxt_src_coincheck_js_WEBPACK_IMPORTED_MODULE_52_/* ["default"] */ .A, + 'coinex': ccxt_src_coinex_js_WEBPACK_IMPORTED_MODULE_53_/* ["default"] */ .A, + 'coinmate': ccxt_src_coinmate_js_WEBPACK_IMPORTED_MODULE_54_/* ["default"] */ .A, + 'coinmetro': ccxt_src_coinmetro_js_WEBPACK_IMPORTED_MODULE_55_/* ["default"] */ .A, + 'coinone': ccxt_src_coinone_js_WEBPACK_IMPORTED_MODULE_56_/* ["default"] */ .A, + 'coinsph': ccxt_src_coinsph_js_WEBPACK_IMPORTED_MODULE_57_/* ["default"] */ .A, + 'coinspot': ccxt_src_coinspot_js_WEBPACK_IMPORTED_MODULE_58_/* ["default"] */ .A, + 'cryptocom': ccxt_src_cryptocom_js_WEBPACK_IMPORTED_MODULE_59_/* ["default"] */ .A, + 'cryptomus': ccxt_src_cryptomus_js_WEBPACK_IMPORTED_MODULE_60_/* ["default"] */ .A, + 'defx': ccxt_src_defx_js_WEBPACK_IMPORTED_MODULE_61_/* ["default"] */ .A, + 'delta': ccxt_src_delta_js_WEBPACK_IMPORTED_MODULE_62_/* ["default"] */ .A, + 'deribit': ccxt_src_deribit_js_WEBPACK_IMPORTED_MODULE_63_/* ["default"] */ .A, + 'derive': ccxt_src_derive_js_WEBPACK_IMPORTED_MODULE_64_/* ["default"] */ .A, + 'digifinex': ccxt_src_digifinex_js_WEBPACK_IMPORTED_MODULE_65_/* ["default"] */ .A, + 'ellipx': ccxt_src_ellipx_js_WEBPACK_IMPORTED_MODULE_66_/* ["default"] */ .A, + 'eterex': ccxt_src_eterex_js_WEBPACK_IMPORTED_MODULE_67_/* ["default"] */ .A, + 'excoino': ccxt_src_excoino_js_WEBPACK_IMPORTED_MODULE_68_/* ["default"] */ .A, + 'exir': ccxt_src_exir_js_WEBPACK_IMPORTED_MODULE_69_/* ["default"] */ .A, + 'exmo': ccxt_src_exmo_js_WEBPACK_IMPORTED_MODULE_70_/* ["default"] */ .A, + 'exnovin': ccxt_src_exnovin_js_WEBPACK_IMPORTED_MODULE_71_/* ["default"] */ .A, + 'farhadexchange': ccxt_src_farhadexchange_js_WEBPACK_IMPORTED_MODULE_72_/* ["default"] */ .A, + 'fmfwio': ccxt_src_fmfwio_js_WEBPACK_IMPORTED_MODULE_73_/* ["default"] */ .A, + 'foxbit': ccxt_src_foxbit_js_WEBPACK_IMPORTED_MODULE_74_/* ["default"] */ .A, + 'gate': ccxt_src_gate_js_WEBPACK_IMPORTED_MODULE_75_/* ["default"] */ .A, + 'gateio': ccxt_src_gateio_js_WEBPACK_IMPORTED_MODULE_76_/* ["default"] */ .A, + 'gemini': ccxt_src_gemini_js_WEBPACK_IMPORTED_MODULE_77_/* ["default"] */ .A, + 'hamtapay': ccxt_src_hamtapay_js_WEBPACK_IMPORTED_MODULE_78_/* ["default"] */ .A, + 'hashkey': ccxt_src_hashkey_js_WEBPACK_IMPORTED_MODULE_79_/* ["default"] */ .A, + 'hibachi': ccxt_src_hibachi_js_WEBPACK_IMPORTED_MODULE_80_/* ["default"] */ .A, + 'hitbtc': ccxt_src_hitbtc_js_WEBPACK_IMPORTED_MODULE_81_/* ["default"] */ .A, + 'hitobit': ccxt_src_hitobit_js_WEBPACK_IMPORTED_MODULE_82_/* ["default"] */ .A, + 'hollaex': ccxt_src_hollaex_js_WEBPACK_IMPORTED_MODULE_83_/* ["default"] */ .A, + 'htx': ccxt_src_htx_js_WEBPACK_IMPORTED_MODULE_84_/* ["default"] */ .A, + 'huobi': ccxt_src_huobi_js_WEBPACK_IMPORTED_MODULE_85_/* ["default"] */ .A, + 'hyperliquid': ccxt_src_hyperliquid_js_WEBPACK_IMPORTED_MODULE_86_/* ["default"] */ .A, + 'independentreserve': ccxt_src_independentreserve_js_WEBPACK_IMPORTED_MODULE_87_/* ["default"] */ .A, + 'indodax': ccxt_src_indodax_js_WEBPACK_IMPORTED_MODULE_88_/* ["default"] */ .A, + 'jibitex': ccxt_src_jibitex_js_WEBPACK_IMPORTED_MODULE_89_/* ["default"] */ .A, + 'kcex': ccxt_src_kcex_js_WEBPACK_IMPORTED_MODULE_90_/* ["default"] */ .A, + 'kifpoolme': ccxt_src_kifpoolme_js_WEBPACK_IMPORTED_MODULE_91_/* ["default"] */ .A, + 'kraken': ccxt_src_kraken_js_WEBPACK_IMPORTED_MODULE_92_/* ["default"] */ .A, + 'krakenfutures': ccxt_src_krakenfutures_js_WEBPACK_IMPORTED_MODULE_93_/* ["default"] */ .A, + 'kucoin': ccxt_src_kucoin_js_WEBPACK_IMPORTED_MODULE_94_/* ["default"] */ .A, + 'kucoinfutures': ccxt_src_kucoinfutures_js_WEBPACK_IMPORTED_MODULE_95_/* ["default"] */ .A, + 'latoken': ccxt_src_latoken_js_WEBPACK_IMPORTED_MODULE_96_/* ["default"] */ .A, + 'lbank': ccxt_src_lbank_js_WEBPACK_IMPORTED_MODULE_97_/* ["default"] */ .A, + 'luno': ccxt_src_luno_js_WEBPACK_IMPORTED_MODULE_98_/* ["default"] */ .A, + 'mazdax': ccxt_src_mazdax_js_WEBPACK_IMPORTED_MODULE_99_/* ["default"] */ .A, + 'mercado': ccxt_src_mercado_js_WEBPACK_IMPORTED_MODULE_100_/* ["default"] */ .A, + 'mexc': ccxt_src_mexc_js_WEBPACK_IMPORTED_MODULE_101_/* ["default"] */ .A, + 'modetrade': ccxt_src_modetrade_js_WEBPACK_IMPORTED_MODULE_102_/* ["default"] */ .A, + 'myokx': ccxt_src_myokx_js_WEBPACK_IMPORTED_MODULE_103_/* ["default"] */ .A, + 'ndax': ccxt_src_ndax_js_WEBPACK_IMPORTED_MODULE_104_/* ["default"] */ .A, + 'nobitex': ccxt_src_nobitex_js_WEBPACK_IMPORTED_MODULE_105_/* ["default"] */ .A, + 'novadax': ccxt_src_novadax_js_WEBPACK_IMPORTED_MODULE_106_/* ["default"] */ .A, + 'oceanex': ccxt_src_oceanex_js_WEBPACK_IMPORTED_MODULE_107_/* ["default"] */ .A, + 'okcoin': ccxt_src_okcoin_js_WEBPACK_IMPORTED_MODULE_108_/* ["default"] */ .A, + 'okexchange': ccxt_src_okexchange_js_WEBPACK_IMPORTED_MODULE_109_/* ["default"] */ .A, + 'okx': ccxt_src_okx_js_WEBPACK_IMPORTED_MODULE_110_/* ["default"] */ .A, + 'okxus': ccxt_src_okxus_js_WEBPACK_IMPORTED_MODULE_111_/* ["default"] */ .A, + 'ompfinex': ccxt_src_ompfinex_js_WEBPACK_IMPORTED_MODULE_112_/* ["default"] */ .A, + 'onetrading': ccxt_src_onetrading_js_WEBPACK_IMPORTED_MODULE_113_/* ["default"] */ .A, + 'oxfun': ccxt_src_oxfun_js_WEBPACK_IMPORTED_MODULE_114_/* ["default"] */ .A, + 'p2b': ccxt_src_p2b_js_WEBPACK_IMPORTED_MODULE_115_/* ["default"] */ .A, + 'paradex': ccxt_src_paradex_js_WEBPACK_IMPORTED_MODULE_116_/* ["default"] */ .A, + 'paymium': ccxt_src_paymium_js_WEBPACK_IMPORTED_MODULE_117_/* ["default"] */ .A, + 'phemex': ccxt_src_phemex_js_WEBPACK_IMPORTED_MODULE_118_/* ["default"] */ .A, + 'pingi': ccxt_src_pingi_js_WEBPACK_IMPORTED_MODULE_119_/* ["default"] */ .A, + 'poloniex': ccxt_src_poloniex_js_WEBPACK_IMPORTED_MODULE_120_/* ["default"] */ .A, + 'pooleno': ccxt_src_pooleno_js_WEBPACK_IMPORTED_MODULE_121_/* ["default"] */ .A, + 'probit': ccxt_src_probit_js_WEBPACK_IMPORTED_MODULE_122_/* ["default"] */ .A, + 'ramzinex': ccxt_src_ramzinex_js_WEBPACK_IMPORTED_MODULE_123_/* ["default"] */ .A, + 'sarmayex': ccxt_src_sarmayex_js_WEBPACK_IMPORTED_MODULE_124_/* ["default"] */ .A, + 'sarrafex': ccxt_src_sarrafex_js_WEBPACK_IMPORTED_MODULE_125_/* ["default"] */ .A, + 'tabdeal': ccxt_src_tabdeal_js_WEBPACK_IMPORTED_MODULE_126_/* ["default"] */ .A, + 'tetherland': ccxt_src_tetherland_js_WEBPACK_IMPORTED_MODULE_127_/* ["default"] */ .A, + 'timex': ccxt_src_timex_js_WEBPACK_IMPORTED_MODULE_128_/* ["default"] */ .A, + 'tokocrypto': ccxt_src_tokocrypto_js_WEBPACK_IMPORTED_MODULE_129_/* ["default"] */ .A, + 'toobit': ccxt_src_toobit_js_WEBPACK_IMPORTED_MODULE_130_/* ["default"] */ .A, + 'tradeogre': ccxt_src_tradeogre_js_WEBPACK_IMPORTED_MODULE_131_/* ["default"] */ .A, + 'twox': ccxt_src_twox_js_WEBPACK_IMPORTED_MODULE_132_/* ["default"] */ .A, + 'ubitex': ccxt_src_ubitex_js_WEBPACK_IMPORTED_MODULE_133_/* ["default"] */ .A, + 'upbit': ccxt_src_upbit_js_WEBPACK_IMPORTED_MODULE_134_/* ["default"] */ .A, + 'vertex': ccxt_src_vertex_js_WEBPACK_IMPORTED_MODULE_135_/* ["default"] */ .A, + 'wallex': ccxt_src_wallex_js_WEBPACK_IMPORTED_MODULE_136_/* ["default"] */ .A, + 'wavesexchange': ccxt_src_wavesexchange_js_WEBPACK_IMPORTED_MODULE_137_/* ["default"] */ .A, + 'whitebit': ccxt_src_whitebit_js_WEBPACK_IMPORTED_MODULE_138_/* ["default"] */ .A, + 'woo': ccxt_src_woo_js_WEBPACK_IMPORTED_MODULE_139_/* ["default"] */ .A, + 'woofipro': ccxt_src_woofipro_js_WEBPACK_IMPORTED_MODULE_140_/* ["default"] */ .A, + 'xt': ccxt_src_xt_js_WEBPACK_IMPORTED_MODULE_141_/* ["default"] */ .A, + 'yobit': ccxt_src_yobit_js_WEBPACK_IMPORTED_MODULE_142_/* ["default"] */ .A, + 'zaif': ccxt_src_zaif_js_WEBPACK_IMPORTED_MODULE_143_/* ["default"] */ .A, + 'zonda': ccxt_src_zonda_js_WEBPACK_IMPORTED_MODULE_144_/* ["default"] */ .A, }; const ccxt_pro = { - 'alpaca': ccxt_src_pro_alpaca_js_WEBPACK_IMPORTED_MODULE_138_/* ["default"] */ .A, - 'apex': ccxt_src_pro_apex_js_WEBPACK_IMPORTED_MODULE_139_/* ["default"] */ .A, - 'ascendex': ccxt_src_pro_ascendex_js_WEBPACK_IMPORTED_MODULE_140_/* ["default"] */ .A, - 'bequant': ccxt_src_pro_bequant_js_WEBPACK_IMPORTED_MODULE_141_/* ["default"] */ .A, - 'binance': ccxt_src_pro_binance_js_WEBPACK_IMPORTED_MODULE_142_/* ["default"] */ .A, - 'binancecoinm': ccxt_src_pro_binancecoinm_js_WEBPACK_IMPORTED_MODULE_143_/* ["default"] */ .A, - 'binanceus': ccxt_src_pro_binanceus_js_WEBPACK_IMPORTED_MODULE_144_/* ["default"] */ .A, - 'binanceusdm': ccxt_src_pro_binanceusdm_js_WEBPACK_IMPORTED_MODULE_145_/* ["default"] */ .A, - 'bingx': ccxt_src_pro_bingx_js_WEBPACK_IMPORTED_MODULE_146_/* ["default"] */ .A, - 'bitfinex': ccxt_src_pro_bitfinex_js_WEBPACK_IMPORTED_MODULE_147_/* ["default"] */ .A, - 'bitget': ccxt_src_pro_bitget_js_WEBPACK_IMPORTED_MODULE_148_/* ["default"] */ .A, - 'bithumb': ccxt_src_pro_bithumb_js_WEBPACK_IMPORTED_MODULE_149_/* ["default"] */ .A, - 'bitmart': ccxt_src_pro_bitmart_js_WEBPACK_IMPORTED_MODULE_150_/* ["default"] */ .A, - 'bitmex': ccxt_src_pro_bitmex_js_WEBPACK_IMPORTED_MODULE_151_/* ["default"] */ .A, - 'bitopro': ccxt_src_pro_bitopro_js_WEBPACK_IMPORTED_MODULE_152_/* ["default"] */ .A, - 'bitrue': ccxt_src_pro_bitrue_js_WEBPACK_IMPORTED_MODULE_153_/* ["default"] */ .A, - 'bitstamp': ccxt_src_pro_bitstamp_js_WEBPACK_IMPORTED_MODULE_154_/* ["default"] */ .A, - 'bittrade': ccxt_src_pro_bittrade_js_WEBPACK_IMPORTED_MODULE_155_/* ["default"] */ .A, - 'bitvavo': ccxt_src_pro_bitvavo_js_WEBPACK_IMPORTED_MODULE_156_/* ["default"] */ .A, - 'blockchaincom': ccxt_src_pro_blockchaincom_js_WEBPACK_IMPORTED_MODULE_157_/* ["default"] */ .A, - 'blofin': ccxt_src_pro_blofin_js_WEBPACK_IMPORTED_MODULE_158_/* ["default"] */ .A, - 'bybit': ccxt_src_pro_bybit_js_WEBPACK_IMPORTED_MODULE_159_/* ["default"] */ .A, - 'cex': ccxt_src_pro_cex_js_WEBPACK_IMPORTED_MODULE_160_/* ["default"] */ .A, - 'coinbase': ccxt_src_pro_coinbase_js_WEBPACK_IMPORTED_MODULE_161_/* ["default"] */ .A, - 'coinbaseadvanced': ccxt_src_pro_coinbaseadvanced_js_WEBPACK_IMPORTED_MODULE_162_/* ["default"] */ .A, - 'coinbaseexchange': ccxt_src_pro_coinbaseexchange_js_WEBPACK_IMPORTED_MODULE_163_/* ["default"] */ .A, - 'coinbaseinternational': ccxt_src_pro_coinbaseinternational_js_WEBPACK_IMPORTED_MODULE_164_/* ["default"] */ .A, - 'coincatch': ccxt_src_pro_coincatch_js_WEBPACK_IMPORTED_MODULE_165_/* ["default"] */ .A, - 'coincheck': ccxt_src_pro_coincheck_js_WEBPACK_IMPORTED_MODULE_166_/* ["default"] */ .A, - 'coinex': ccxt_src_pro_coinex_js_WEBPACK_IMPORTED_MODULE_167_/* ["default"] */ .A, - 'coinone': ccxt_src_pro_coinone_js_WEBPACK_IMPORTED_MODULE_168_/* ["default"] */ .A, - 'cryptocom': ccxt_src_pro_cryptocom_js_WEBPACK_IMPORTED_MODULE_169_/* ["default"] */ .A, - 'defx': ccxt_src_pro_defx_js_WEBPACK_IMPORTED_MODULE_170_/* ["default"] */ .A, - 'deribit': ccxt_src_pro_deribit_js_WEBPACK_IMPORTED_MODULE_171_/* ["default"] */ .A, - 'derive': ccxt_src_pro_derive_js_WEBPACK_IMPORTED_MODULE_172_/* ["default"] */ .A, - 'exmo': ccxt_src_pro_exmo_js_WEBPACK_IMPORTED_MODULE_173_/* ["default"] */ .A, - 'gate': ccxt_src_pro_gate_js_WEBPACK_IMPORTED_MODULE_174_/* ["default"] */ .A, - 'gateio': ccxt_src_pro_gateio_js_WEBPACK_IMPORTED_MODULE_175_/* ["default"] */ .A, - 'gemini': ccxt_src_pro_gemini_js_WEBPACK_IMPORTED_MODULE_176_/* ["default"] */ .A, - 'hashkey': ccxt_src_pro_hashkey_js_WEBPACK_IMPORTED_MODULE_177_/* ["default"] */ .A, - 'hitbtc': ccxt_src_pro_hitbtc_js_WEBPACK_IMPORTED_MODULE_178_/* ["default"] */ .A, - 'hollaex': ccxt_src_pro_hollaex_js_WEBPACK_IMPORTED_MODULE_179_/* ["default"] */ .A, - 'htx': ccxt_src_pro_htx_js_WEBPACK_IMPORTED_MODULE_180_/* ["default"] */ .A, - 'huobi': ccxt_src_pro_huobi_js_WEBPACK_IMPORTED_MODULE_181_/* ["default"] */ .A, - 'hyperliquid': ccxt_src_pro_hyperliquid_js_WEBPACK_IMPORTED_MODULE_182_/* ["default"] */ .A, - 'independentreserve': ccxt_src_pro_independentreserve_js_WEBPACK_IMPORTED_MODULE_183_/* ["default"] */ .A, - 'kraken': ccxt_src_pro_kraken_js_WEBPACK_IMPORTED_MODULE_184_/* ["default"] */ .A, - 'krakenfutures': ccxt_src_pro_krakenfutures_js_WEBPACK_IMPORTED_MODULE_185_/* ["default"] */ .A, - 'kucoin': ccxt_src_pro_kucoin_js_WEBPACK_IMPORTED_MODULE_186_/* ["default"] */ .A, - 'kucoinfutures': ccxt_src_pro_kucoinfutures_js_WEBPACK_IMPORTED_MODULE_187_/* ["default"] */ .A, - 'lbank': ccxt_src_pro_lbank_js_WEBPACK_IMPORTED_MODULE_188_/* ["default"] */ .A, - 'luno': ccxt_src_pro_luno_js_WEBPACK_IMPORTED_MODULE_189_/* ["default"] */ .A, - 'mexc': ccxt_src_pro_mexc_js_WEBPACK_IMPORTED_MODULE_190_/* ["default"] */ .A, - 'modetrade': ccxt_src_pro_modetrade_js_WEBPACK_IMPORTED_MODULE_191_/* ["default"] */ .A, - 'myokx': ccxt_src_pro_myokx_js_WEBPACK_IMPORTED_MODULE_192_/* ["default"] */ .A, - 'ndax': ccxt_src_pro_ndax_js_WEBPACK_IMPORTED_MODULE_193_/* ["default"] */ .A, - 'okcoin': ccxt_src_pro_okcoin_js_WEBPACK_IMPORTED_MODULE_194_/* ["default"] */ .A, - 'okx': ccxt_src_pro_okx_js_WEBPACK_IMPORTED_MODULE_195_/* ["default"] */ .A, - 'okxus': ccxt_src_pro_okxus_js_WEBPACK_IMPORTED_MODULE_196_/* ["default"] */ .A, - 'onetrading': ccxt_src_pro_onetrading_js_WEBPACK_IMPORTED_MODULE_197_/* ["default"] */ .A, - 'oxfun': ccxt_src_pro_oxfun_js_WEBPACK_IMPORTED_MODULE_198_/* ["default"] */ .A, - 'p2b': ccxt_src_pro_p2b_js_WEBPACK_IMPORTED_MODULE_199_/* ["default"] */ .A, - 'paradex': ccxt_src_pro_paradex_js_WEBPACK_IMPORTED_MODULE_200_/* ["default"] */ .A, - 'phemex': ccxt_src_pro_phemex_js_WEBPACK_IMPORTED_MODULE_201_/* ["default"] */ .A, - 'poloniex': ccxt_src_pro_poloniex_js_WEBPACK_IMPORTED_MODULE_202_/* ["default"] */ .A, - 'probit': ccxt_src_pro_probit_js_WEBPACK_IMPORTED_MODULE_203_/* ["default"] */ .A, - 'tradeogre': ccxt_src_pro_tradeogre_js_WEBPACK_IMPORTED_MODULE_204_/* ["default"] */ .A, - 'upbit': ccxt_src_pro_upbit_js_WEBPACK_IMPORTED_MODULE_205_/* ["default"] */ .A, - 'vertex': ccxt_src_pro_vertex_js_WEBPACK_IMPORTED_MODULE_206_/* ["default"] */ .A, - 'whitebit': ccxt_src_pro_whitebit_js_WEBPACK_IMPORTED_MODULE_207_/* ["default"] */ .A, - 'woo': ccxt_src_pro_woo_js_WEBPACK_IMPORTED_MODULE_208_/* ["default"] */ .A, - 'woofipro': ccxt_src_pro_woofipro_js_WEBPACK_IMPORTED_MODULE_209_/* ["default"] */ .A, - 'xt': ccxt_src_pro_xt_js_WEBPACK_IMPORTED_MODULE_210_/* ["default"] */ .A, + 'alpaca': ccxt_src_pro_alpaca_js_WEBPACK_IMPORTED_MODULE_145_/* ["default"] */ .A, + 'apex': ccxt_src_pro_apex_js_WEBPACK_IMPORTED_MODULE_146_/* ["default"] */ .A, + 'ascendex': ccxt_src_pro_ascendex_js_WEBPACK_IMPORTED_MODULE_147_/* ["default"] */ .A, + 'bequant': ccxt_src_pro_bequant_js_WEBPACK_IMPORTED_MODULE_148_/* ["default"] */ .A, + 'binance': ccxt_src_pro_binance_js_WEBPACK_IMPORTED_MODULE_149_/* ["default"] */ .A, + 'binancecoinm': ccxt_src_pro_binancecoinm_js_WEBPACK_IMPORTED_MODULE_150_/* ["default"] */ .A, + 'binanceus': ccxt_src_pro_binanceus_js_WEBPACK_IMPORTED_MODULE_151_/* ["default"] */ .A, + 'binanceusdm': ccxt_src_pro_binanceusdm_js_WEBPACK_IMPORTED_MODULE_152_/* ["default"] */ .A, + 'bingx': ccxt_src_pro_bingx_js_WEBPACK_IMPORTED_MODULE_153_/* ["default"] */ .A, + 'bitfinex': ccxt_src_pro_bitfinex_js_WEBPACK_IMPORTED_MODULE_154_/* ["default"] */ .A, + 'bitget': ccxt_src_pro_bitget_js_WEBPACK_IMPORTED_MODULE_155_/* ["default"] */ .A, + 'bithumb': ccxt_src_pro_bithumb_js_WEBPACK_IMPORTED_MODULE_156_/* ["default"] */ .A, + 'bitmart': ccxt_src_pro_bitmart_js_WEBPACK_IMPORTED_MODULE_157_/* ["default"] */ .A, + 'bitmex': ccxt_src_pro_bitmex_js_WEBPACK_IMPORTED_MODULE_158_/* ["default"] */ .A, + 'bitopro': ccxt_src_pro_bitopro_js_WEBPACK_IMPORTED_MODULE_159_/* ["default"] */ .A, + 'bitrue': ccxt_src_pro_bitrue_js_WEBPACK_IMPORTED_MODULE_160_/* ["default"] */ .A, + 'bitstamp': ccxt_src_pro_bitstamp_js_WEBPACK_IMPORTED_MODULE_161_/* ["default"] */ .A, + 'bittrade': ccxt_src_pro_bittrade_js_WEBPACK_IMPORTED_MODULE_162_/* ["default"] */ .A, + 'bitvavo': ccxt_src_pro_bitvavo_js_WEBPACK_IMPORTED_MODULE_163_/* ["default"] */ .A, + 'blockchaincom': ccxt_src_pro_blockchaincom_js_WEBPACK_IMPORTED_MODULE_164_/* ["default"] */ .A, + 'blofin': ccxt_src_pro_blofin_js_WEBPACK_IMPORTED_MODULE_165_/* ["default"] */ .A, + 'bybit': ccxt_src_pro_bybit_js_WEBPACK_IMPORTED_MODULE_166_/* ["default"] */ .A, + 'cex': ccxt_src_pro_cex_js_WEBPACK_IMPORTED_MODULE_167_/* ["default"] */ .A, + 'coinbase': ccxt_src_pro_coinbase_js_WEBPACK_IMPORTED_MODULE_168_/* ["default"] */ .A, + 'coinbaseadvanced': ccxt_src_pro_coinbaseadvanced_js_WEBPACK_IMPORTED_MODULE_169_/* ["default"] */ .A, + 'coinbaseexchange': ccxt_src_pro_coinbaseexchange_js_WEBPACK_IMPORTED_MODULE_170_/* ["default"] */ .A, + 'coinbaseinternational': ccxt_src_pro_coinbaseinternational_js_WEBPACK_IMPORTED_MODULE_171_/* ["default"] */ .A, + 'coincatch': ccxt_src_pro_coincatch_js_WEBPACK_IMPORTED_MODULE_172_/* ["default"] */ .A, + 'coincheck': ccxt_src_pro_coincheck_js_WEBPACK_IMPORTED_MODULE_173_/* ["default"] */ .A, + 'coinex': ccxt_src_pro_coinex_js_WEBPACK_IMPORTED_MODULE_174_/* ["default"] */ .A, + 'coinone': ccxt_src_pro_coinone_js_WEBPACK_IMPORTED_MODULE_175_/* ["default"] */ .A, + 'cryptocom': ccxt_src_pro_cryptocom_js_WEBPACK_IMPORTED_MODULE_176_/* ["default"] */ .A, + 'defx': ccxt_src_pro_defx_js_WEBPACK_IMPORTED_MODULE_177_/* ["default"] */ .A, + 'deribit': ccxt_src_pro_deribit_js_WEBPACK_IMPORTED_MODULE_178_/* ["default"] */ .A, + 'derive': ccxt_src_pro_derive_js_WEBPACK_IMPORTED_MODULE_179_/* ["default"] */ .A, + 'exmo': ccxt_src_pro_exmo_js_WEBPACK_IMPORTED_MODULE_180_/* ["default"] */ .A, + 'gate': ccxt_src_pro_gate_js_WEBPACK_IMPORTED_MODULE_181_/* ["default"] */ .A, + 'gateio': ccxt_src_pro_gateio_js_WEBPACK_IMPORTED_MODULE_182_/* ["default"] */ .A, + 'gemini': ccxt_src_pro_gemini_js_WEBPACK_IMPORTED_MODULE_183_/* ["default"] */ .A, + 'hashkey': ccxt_src_pro_hashkey_js_WEBPACK_IMPORTED_MODULE_184_/* ["default"] */ .A, + 'hitbtc': ccxt_src_pro_hitbtc_js_WEBPACK_IMPORTED_MODULE_185_/* ["default"] */ .A, + 'hollaex': ccxt_src_pro_hollaex_js_WEBPACK_IMPORTED_MODULE_186_/* ["default"] */ .A, + 'htx': ccxt_src_pro_htx_js_WEBPACK_IMPORTED_MODULE_187_/* ["default"] */ .A, + 'huobi': ccxt_src_pro_huobi_js_WEBPACK_IMPORTED_MODULE_188_/* ["default"] */ .A, + 'hyperliquid': ccxt_src_pro_hyperliquid_js_WEBPACK_IMPORTED_MODULE_189_/* ["default"] */ .A, + 'independentreserve': ccxt_src_pro_independentreserve_js_WEBPACK_IMPORTED_MODULE_190_/* ["default"] */ .A, + 'kraken': ccxt_src_pro_kraken_js_WEBPACK_IMPORTED_MODULE_191_/* ["default"] */ .A, + 'krakenfutures': ccxt_src_pro_krakenfutures_js_WEBPACK_IMPORTED_MODULE_192_/* ["default"] */ .A, + 'kucoin': ccxt_src_pro_kucoin_js_WEBPACK_IMPORTED_MODULE_193_/* ["default"] */ .A, + 'kucoinfutures': ccxt_src_pro_kucoinfutures_js_WEBPACK_IMPORTED_MODULE_194_/* ["default"] */ .A, + 'lbank': ccxt_src_pro_lbank_js_WEBPACK_IMPORTED_MODULE_195_/* ["default"] */ .A, + 'luno': ccxt_src_pro_luno_js_WEBPACK_IMPORTED_MODULE_196_/* ["default"] */ .A, + 'mexc': ccxt_src_pro_mexc_js_WEBPACK_IMPORTED_MODULE_197_/* ["default"] */ .A, + 'modetrade': ccxt_src_pro_modetrade_js_WEBPACK_IMPORTED_MODULE_198_/* ["default"] */ .A, + 'myokx': ccxt_src_pro_myokx_js_WEBPACK_IMPORTED_MODULE_199_/* ["default"] */ .A, + 'ndax': ccxt_src_pro_ndax_js_WEBPACK_IMPORTED_MODULE_200_/* ["default"] */ .A, + 'okcoin': ccxt_src_pro_okcoin_js_WEBPACK_IMPORTED_MODULE_201_/* ["default"] */ .A, + 'okx': ccxt_src_pro_okx_js_WEBPACK_IMPORTED_MODULE_202_/* ["default"] */ .A, + 'okxus': ccxt_src_pro_okxus_js_WEBPACK_IMPORTED_MODULE_203_/* ["default"] */ .A, + 'onetrading': ccxt_src_pro_onetrading_js_WEBPACK_IMPORTED_MODULE_204_/* ["default"] */ .A, + 'oxfun': ccxt_src_pro_oxfun_js_WEBPACK_IMPORTED_MODULE_205_/* ["default"] */ .A, + 'p2b': ccxt_src_pro_p2b_js_WEBPACK_IMPORTED_MODULE_206_/* ["default"] */ .A, + 'paradex': ccxt_src_pro_paradex_js_WEBPACK_IMPORTED_MODULE_207_/* ["default"] */ .A, + 'phemex': ccxt_src_pro_phemex_js_WEBPACK_IMPORTED_MODULE_208_/* ["default"] */ .A, + 'poloniex': ccxt_src_pro_poloniex_js_WEBPACK_IMPORTED_MODULE_209_/* ["default"] */ .A, + 'probit': ccxt_src_pro_probit_js_WEBPACK_IMPORTED_MODULE_210_/* ["default"] */ .A, + 'tradeogre': ccxt_src_pro_tradeogre_js_WEBPACK_IMPORTED_MODULE_211_/* ["default"] */ .A, + 'upbit': ccxt_src_pro_upbit_js_WEBPACK_IMPORTED_MODULE_212_/* ["default"] */ .A, + 'vertex': ccxt_src_pro_vertex_js_WEBPACK_IMPORTED_MODULE_213_/* ["default"] */ .A, + 'whitebit': ccxt_src_pro_whitebit_js_WEBPACK_IMPORTED_MODULE_214_/* ["default"] */ .A, + 'woo': ccxt_src_pro_woo_js_WEBPACK_IMPORTED_MODULE_215_/* ["default"] */ .A, + 'woofipro': ccxt_src_pro_woofipro_js_WEBPACK_IMPORTED_MODULE_216_/* ["default"] */ .A, + 'xt': ccxt_src_pro_xt_js_WEBPACK_IMPORTED_MODULE_217_/* ["default"] */ .A, }; for (const exchange in ccxt_pro) { // const ccxtExchange = exchanges[exchange] @@ -427540,7 +430659,7 @@ for (const exchange in ccxt_pro) { ccxt_pro.exchanges = Object.keys(ccxt_pro); ccxt_pro['Exchange'] = ccxt_src_base_Exchange_js_WEBPACK_IMPORTED_MODULE_0_/* .Exchange */ .k; // now the same for rest and ts //----------------------------------------------------------------------------- -const ccxt_ccxt = Object.assign({ version: ccxt_version, Exchange: ccxt_src_base_Exchange_js_WEBPACK_IMPORTED_MODULE_0_/* .Exchange */ .k, Precise: ccxt_src_base_Precise_js_WEBPACK_IMPORTED_MODULE_211_/* .Precise */ .Y, 'exchanges': Object.keys(ccxt_exchanges), 'pro': ccxt_pro }, ccxt_exchanges, ccxt_src_base_functions_js_WEBPACK_IMPORTED_MODULE_212_, ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_213_); +const ccxt_ccxt = Object.assign({ version: ccxt_version, Exchange: ccxt_src_base_Exchange_js_WEBPACK_IMPORTED_MODULE_0_/* .Exchange */ .k, Precise: ccxt_src_base_Precise_js_WEBPACK_IMPORTED_MODULE_218_/* .Precise */ .Y, 'exchanges': Object.keys(ccxt_exchanges), 'pro': ccxt_pro }, ccxt_exchanges, ccxt_src_base_functions_js_WEBPACK_IMPORTED_MODULE_219_, ccxt_src_base_errors_js_WEBPACK_IMPORTED_MODULE_220_); /* harmony default export */ const ts_ccxt = (ccxt_ccxt); //----------------------------------------------------------------------------- diff --git a/dist/ccxt.browser.min.js b/dist/ccxt.browser.min.js index 8018cf724d137..c29e1956ac0c8 100644 --- a/dist/ccxt.browser.min.js +++ b/dist/ccxt.browser.min.js @@ -1,4 +1,4 @@ -(()=>{"use strict";var e,t,i,s,r={1656:(e,t,i)=>{i.d(t,{A:()=>r});var s=i(9273);class r extends s.A{describe(){return this.deepExtend(super.describe(),{id:"abantether",name:"Aban tether",countries:["IR"],rateLimit:1e3,version:"1",certified:!1,pro:!1,has:{CORS:void 0,spot:!0,margin:!1,swap:!1,future:!1,option:!1,addMargin:!1,cancelAllOrders:!1,cancelOrder:!1,cancelOrders:!1,createDepositAddress:!1,createOrder:!1,createStopLimitOrder:!1,createStopMarketOrder:!1,createStopOrder:!1,editOrder:!1,fetchBalance:!1,fetchBorrowInterest:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchClosedOrders:!1,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!1,fetchDepositAddress:!1,fetchDeposits:!1,fetchFundingHistory:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchL2OrderBook:!1,fetchL3OrderBook:!1,fetchLedger:!1,fetchLedgerEntry:!1,fetchLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMyTrades:!1,fetchOHLCV:!1,fetchOpenInterestHistory:!1,fetchOpenOrders:!1,fetchOrder:!1,fetchOrderBook:!1,fetchOrders:!1,fetchOrderTrades:"emulated",fetchPositions:!1,fetchPremiumIndexOHLCV:!1,fetchTicker:!0,fetchTickers:!0,fetchTime:!1,fetchTrades:!1,fetchTradingFee:!1,fetchTradingFees:!1,fetchWithdrawals:!1,setLeverage:!1,setMarginMode:!1,transfer:!1,withdraw:!1},comment:"This comment is optional",urls:{logo:"https://cdn.arz.digital/cr-odin/img/exchanges/abantether/64x64.png",api:{public:"https://abantether.com"},www:"https://abantether.com",doc:["https://abantether.com"]},api:{public:{get:{"management/all-coins/":1}}},fees:{trading:{tierBased:!1,percentage:!0,maker:this.parseNumber("0.001"),taker:this.parseNumber("0.001")}}})}async fetchMarkets(e={}){const t=await this.publicGetManagementAllCoins(e),i=[],s=["IRT","USDT"];for(let e=0;e{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},4911:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},4523:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},1185:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},9312:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},5042:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},566:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},3971:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},335:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},4619:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},5408:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},3885:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},2308:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},5625:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},9332:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},1578:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},9152:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},3974:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},6555:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},5537:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},1466:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},8186:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},7202:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},6607:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},8800:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},9656:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},5223:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},8535:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},7754:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},7584:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},8716:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},5254:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},1769:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},9644:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},3829:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},2317:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},8430:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},1293:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},5465:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},5661:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},1552:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},2609:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},5769:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},2938:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},5277:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},8109:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},1671:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},6658:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},4935:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},9360:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},4295:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},3037:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},9872:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},7227:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},4012:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},970:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},9420:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},6351:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},6042:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},9884:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},5079:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},1352:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},2278:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},1706:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},2597:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},7418:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},3434:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},7648:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},9722:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},5825:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},706:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},4372:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},1180:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},8617:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},9023:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},359:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},4558:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},1688:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},7478:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},2459:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},1359:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},3548:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},3942:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(1397);class r extends s.A{}const a=r},121:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},575:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},7533:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},6928:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},9174:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},5362:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},3414:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},2994:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},1426:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},7774:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},9886:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},3142:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},5531:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},9341:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},3800:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},9401:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},7849:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},2134:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},8563:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},4158:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},7733:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},995:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},9089:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},907:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},7539:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},5156:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},9012:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},334:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},7999:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},3016:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},4352:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},1419:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},786:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},6405:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},8139:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},6140:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},7698:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},3965:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},7246:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},5308:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},3521:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},3578:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},8291:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},5517:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(2961);class r extends s.k{}const a=r},5566:(e,t,i)=>{i.d(t,{A:()=>r});var s=i(4911);class r extends s.A{describe(){return this.deepExtend(super.describe(),{id:"afratether",name:"Afratether",countries:["IR"],rateLimit:1e3,version:"1",certified:!1,pro:!1,has:{CORS:void 0,spot:!0,margin:!1,swap:!1,future:!1,option:!1,addMargin:!1,cancelAllOrders:!1,cancelOrder:!1,cancelOrders:!1,createDepositAddress:!1,createOrder:!1,createStopLimitOrder:!1,createStopMarketOrder:!1,createStopOrder:!1,editOrder:!1,fetchBalance:!1,fetchBorrowInterest:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchClosedOrders:!1,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!1,fetchDepositAddress:!1,fetchDeposits:!1,fetchFundingHistory:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchL2OrderBook:!1,fetchL3OrderBook:!1,fetchLedger:!1,fetchLedgerEntry:!1,fetchLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMyTrades:!1,fetchOHLCV:!1,fetchOpenInterestHistory:!1,fetchOpenOrders:!1,fetchOrder:!1,fetchOrderBook:!1,fetchOrders:!1,fetchOrderTrades:"emulated",fetchPositions:!1,fetchPremiumIndexOHLCV:!1,fetchTicker:!0,fetchTickers:!0,fetchTime:!1,fetchTrades:!1,fetchTradingFee:!1,fetchTradingFees:!1,fetchWithdrawals:!1,setLeverage:!1,setMarginMode:!1,transfer:!1,withdraw:!1},comment:"This comment is optional",urls:{logo:"https://cdn.arz.digital/cr-odin/img/exchanges/afratether/64x64.png",api:{public:"https://afrap2p.com",token:"https://afratether.com"},www:"https://afratether.com",doc:["https://afratether.com"]},api:{public:{get:{"api/v1.0/price":1,token:1}}},fees:{trading:{tierBased:!1,percentage:!0,maker:this.parseNumber("0.001"),taker:this.parseNumber("0.001")}}})}async fetchMarkets(e={}){const t={Authorization:await this.publicGetToken()},i=await this.publicGetApiV10Price(t),s=this.safeList(i,"Items"),r=[];for(let e=0;e{i.d(t,{A:()=>n});var s=i(4523),r=i(5147),a=i(2079),o=i(1579);class n extends s.A{describe(){return this.deepExtend(super.describe(),{id:"alpaca",name:"Alpaca",countries:["US"],rateLimit:333,hostname:"alpaca.markets",pro:!0,urls:{logo:"https://github.com/user-attachments/assets/e9476df8-a450-4c3e-ab9a-1a7794219e1b",www:"https://alpaca.markets",api:{broker:"https://broker-api.{hostname}",trader:"https://api.{hostname}",market:"https://data.{hostname}"},test:{broker:"https://broker-api.sandbox.{hostname}",trader:"https://paper-api.{hostname}",market:"https://data.{hostname}"},doc:"https://alpaca.markets/docs/",fees:"https://docs.alpaca.markets/docs/crypto-fees"},has:{CORS:!1,spot:!0,margin:!1,swap:!1,future:!1,option:!1,addMargin:!1,borrowCrossMargin:!1,borrowIsolatedMargin:!1,borrowMargin:!1,cancelAllOrders:!0,cancelOrder:!0,closeAllPositions:!1,closePosition:!1,createMarketBuyOrder:!0,createMarketBuyOrderWithCost:!0,createMarketOrderWithCost:!0,createOrder:!0,createOrderWithTakeProfitAndStopLoss:!1,createOrderWithTakeProfitAndStopLossWs:!1,createReduceOnlyOrder:!1,createStopOrder:!0,createTriggerOrder:!0,editOrder:!0,fetchBalance:!0,fetchBidsAsks:!1,fetchBorrowInterest:!1,fetchBorrowRate:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchBorrowRates:!1,fetchBorrowRatesPerSymbol:!1,fetchClosedOrders:!0,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!1,fetchDepositAddress:!0,fetchDepositAddressesByNetwork:!1,fetchDeposits:!0,fetchDepositsWithdrawals:!0,fetchFundingHistory:!1,fetchFundingInterval:!1,fetchFundingIntervals:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchGreeks:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchIsolatedPositions:!1,fetchL1OrderBook:!0,fetchL2OrderBook:!1,fetchLeverage:!1,fetchLeverages:!1,fetchLeverageTiers:!1,fetchLiquidations:!1,fetchLongShortRatio:!1,fetchLongShortRatioHistory:!1,fetchMarginAdjustmentHistory:!1,fetchMarginMode:!1,fetchMarginModes:!1,fetchMarketLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMarkPrices:!1,fetchMyLiquidations:!1,fetchMySettlementHistory:!1,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenInterest:!1,fetchOpenInterestHistory:!1,fetchOpenInterests:!1,fetchOpenOrder:!1,fetchOpenOrders:!0,fetchOption:!1,fetchOptionChain:!1,fetchOrder:!0,fetchOrderBook:!0,fetchOrders:!0,fetchPosition:!1,fetchPositionHistory:!1,fetchPositionMode:!1,fetchPositions:!1,fetchPositionsForSymbol:!1,fetchPositionsHistory:!1,fetchPositionsRisk:!1,fetchPremiumIndexOHLCV:!1,fetchSettlementHistory:!1,fetchStatus:!1,fetchTicker:!0,fetchTickers:!0,fetchTime:!0,fetchTrades:!0,fetchTradingFee:!1,fetchTradingFees:!1,fetchTransactionFees:!1,fetchTransactions:!1,fetchTransfers:!1,fetchVolatilityHistory:!1,fetchWithdrawals:!0,reduceMargin:!1,repayCrossMargin:!1,repayIsolatedMargin:!1,sandbox:!0,setLeverage:!1,setMargin:!1,setMarginMode:!1,setPositionMode:!1,transfer:!1,withdraw:!0},api:{broker:{},trader:{private:{get:["v2/account","v2/orders","v2/orders/{order_id}","v2/positions","v2/positions/{symbol_or_asset_id}","v2/account/portfolio/history","v2/watchlists","v2/watchlists/{watchlist_id}","v2/watchlists:by_name","v2/account/configurations","v2/account/activities","v2/account/activities/{activity_type}","v2/calendar","v2/clock","v2/assets","v2/assets/{symbol_or_asset_id}","v2/corporate_actions/announcements/{id}","v2/corporate_actions/announcements","v2/wallets","v2/wallets/transfers"],post:["v2/orders","v2/watchlists","v2/watchlists/{watchlist_id}","v2/watchlists:by_name","v2/wallets/transfers"],put:["v2/orders/{order_id}","v2/watchlists/{watchlist_id}","v2/watchlists:by_name"],patch:["v2/orders/{order_id}","v2/account/configurations"],delete:["v2/orders","v2/orders/{order_id}","v2/positions","v2/positions/{symbol_or_asset_id}","v2/watchlists/{watchlist_id}","v2/watchlists:by_name","v2/watchlists/{watchlist_id}/{symbol}"]}},market:{public:{get:["v1beta3/crypto/{loc}/bars","v1beta3/crypto/{loc}/latest/bars","v1beta3/crypto/{loc}/latest/orderbooks","v1beta3/crypto/{loc}/latest/quotes","v1beta3/crypto/{loc}/latest/trades","v1beta3/crypto/{loc}/quotes","v1beta3/crypto/{loc}/snapshots","v1beta3/crypto/{loc}/trades"]},private:{get:["v1beta1/corporate-actions","v1beta1/forex/latest/rates","v1beta1/forex/rates","v1beta1/logos/{symbol}","v1beta1/news","v1beta1/screener/stocks/most-actives","v1beta1/screener/{market_type}/movers","v2/stocks/auctions","v2/stocks/bars","v2/stocks/bars/latest","v2/stocks/meta/conditions/{ticktype}","v2/stocks/meta/exchanges","v2/stocks/quotes","v2/stocks/quotes/latest","v2/stocks/snapshots","v2/stocks/trades","v2/stocks/trades/latest","v2/stocks/{symbol}/auctions","v2/stocks/{symbol}/bars","v2/stocks/{symbol}/bars/latest","v2/stocks/{symbol}/quotes","v2/stocks/{symbol}/quotes/latest","v2/stocks/{symbol}/snapshot","v2/stocks/{symbol}/trades","v2/stocks/{symbol}/trades/latest"]}}},timeframes:{"1m":"1min","3m":"3min","5m":"5min","15m":"15min","30m":"30min","1h":"1H","2h":"2H","4h":"4H","6h":"6H","8h":"8H","12h":"12H","1d":"1D","3d":"3D","1w":"1W","1M":"1M"},precisionMode:o.kb,requiredCredentials:{apiKey:!0,secret:!0},fees:{trading:{tierBased:!0,percentage:!0,maker:this.parseNumber("0.0015"),taker:this.parseNumber("0.0025"),tiers:{taker:[[this.parseNumber("0"),this.parseNumber("0.0025")],[this.parseNumber("100000"),this.parseNumber("0.0022")],[this.parseNumber("500000"),this.parseNumber("0.0020")],[this.parseNumber("1000000"),this.parseNumber("0.0018")],[this.parseNumber("10000000"),this.parseNumber("0.0015")],[this.parseNumber("25000000"),this.parseNumber("0.0013")],[this.parseNumber("50000000"),this.parseNumber("0.0012")],[this.parseNumber("100000000"),this.parseNumber("0.001")]],maker:[[this.parseNumber("0"),this.parseNumber("0.0015")],[this.parseNumber("100000"),this.parseNumber("0.0012")],[this.parseNumber("500000"),this.parseNumber("0.001")],[this.parseNumber("1000000"),this.parseNumber("0.0008")],[this.parseNumber("10000000"),this.parseNumber("0.0005")],[this.parseNumber("25000000"),this.parseNumber("0.0002")],[this.parseNumber("50000000"),this.parseNumber("0.0002")],[this.parseNumber("100000000"),this.parseNumber("0.00")]]}}},headers:{"APCA-PARTNER-ID":"ccxt"},options:{defaultExchange:"CBSE",exchanges:["CBSE","FTX","GNSS","ERSX"],defaultTimeInForce:"gtc",clientOrderId:"ccxt_{id}"},features:{spot:{sandbox:!0,createOrder:{marginMode:!1,triggerPrice:!0,triggerPriceType:void 0,triggerDirection:!1,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:{triggerPriceType:{last:!0,mark:!0,index:!0},price:!0},timeInForce:{IOC:!0,FOK:!0,PO:!0,GTD:!1},hedged:!1,trailing:!0,leverage:!1,marketBuyRequiresPrice:!1,marketBuyByCost:!1,selfTradePrevention:!1,iceberg:!1},createOrders:void 0,fetchMyTrades:{marginMode:!1,limit:100,daysBack:1e5,untilDays:1e5,symbolRequired:!1},fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!1},fetchOpenOrders:{marginMode:!1,limit:500,trigger:!1,trailing:!1,symbolRequired:!1},fetchOrders:{marginMode:!1,limit:500,daysBack:1e5,untilDays:1e5,trigger:!1,trailing:!1,symbolRequired:!1},fetchClosedOrders:{marginMode:!1,limit:500,daysBack:1e5,daysBackCanceled:void 0,untilDays:1e5,trigger:!1,trailing:!1,symbolRequired:!1},fetchOHLCV:{limit:1e3}},swap:{linear:void 0,inverse:void 0},future:{linear:void 0,inverse:void 0}},exceptions:{exact:{"forbidden.":a.PermissionDenied,4041e4:a.InvalidOrder,40010001:a.BadRequest,4011e4:a.PermissionDenied,4031e4:a.InsufficientFunds,4291e4:a.RateLimitExceeded},broad:{"Invalid format for parameter":a.BadRequest,"Invalid symbol":a.BadSymbol}}})}async fetchTime(e={}){const t=await this.traderPrivateGetV2Clock(e),i=this.safeString(t,"timestamp"),s=i.slice(0,23),r=i.length-6,a=i.length-3,o=i.slice(r,a);return this.parse8601(s)-3600*this.parseToNumeric(o)*1e3}async fetchMarkets(e={}){const t=await this.traderPrivateGetV2Assets(this.extend({asset_class:"crypto",status:"active"},e));return this.parseMarkets(t)}parseMarket(e){const t=this.safeString(e,"symbol"),i=t.split("/"),s=this.safeString(e,"class"),r=this.safeString(i,0),a=this.safeString(i,1),o=this.safeCurrencyCode(r);let n=this.safeCurrencyCode(a);void 0===n&&"us_equity"===s&&(n="USD");const d=o+"/"+n,h="active"===this.safeString(e,"status"),c=this.safeNumber(e,"min_order_size");return{id:t,symbol:d,base:o,quote:n,settle:void 0,baseId:r,quoteId:a,settleId:void 0,type:"spot",spot:!0,margin:void 0,swap:!1,future:!1,option:!1,active:h,contract:!1,linear:void 0,inverse:void 0,contractSize:void 0,expiry:void 0,expiryDatetime:void 0,strike:void 0,optionType:void 0,precision:{amount:this.safeNumber(e,"min_trade_increment"),price:this.safeNumber(e,"price_increment")},limits:{leverage:{min:void 0,max:void 0},amount:{min:c,max:void 0},price:{min:void 0,max:void 0},cost:{min:void 0,max:void 0}},created:void 0,info:e}}async fetchTrades(e,t=void 0,i=void 0,s={}){await this.loadMarkets();const r=this.market(e),o=r.id,n=this.safeString(s,"loc","us"),d=this.safeString(s,"method","marketPublicGetV1beta3CryptoLocTrades"),h={symbols:o,loc:n};let c;if(s=this.omit(s,["loc","method"]),"marketPublicGetV1beta3CryptoLocTrades"===d){void 0!==t&&(h.start=this.iso8601(t)),void 0!==i&&(h.limit=i);const e=await this.marketPublicGetV1beta3CryptoLocTrades(this.extend(h,s)),r=this.safeDict(e,"trades",{});c=this.safeList(r,o,[])}else{if("marketPublicGetV1beta3CryptoLocLatestTrades"!==d)throw new a.NotSupported(this.id+" fetchTrades() does not support "+d+", marketPublicGetV1beta3CryptoLocTrades and marketPublicGetV1beta3CryptoLocLatestTrades are supported");{const e=await this.marketPublicGetV1beta3CryptoLocLatestTrades(this.extend(h,s)),t=this.safeDict(e,"trades",{});c=this.safeDict(t,o,{}),c=[c]}}return this.parseTrades(c,r,t,i)}async fetchOrderBook(e,t=void 0,i={}){await this.loadMarkets();const s=this.market(e),r=s.id,a={symbols:r,loc:this.safeString(i,"loc","us")},o=await this.marketPublicGetV1beta3CryptoLocLatestOrderbooks(this.extend(a,i)),n=this.safeDict(o,"orderbooks",{}),d=this.safeDict(n,r,{}),h=this.parse8601(this.safeString(d,"t"));return this.parseOrderBook(d,s.symbol,h,"b","a","p","s")}async fetchOHLCV(e,t="1m",i=void 0,s=void 0,r={}){await this.loadMarkets();const o=this.market(e),n=o.id,d=this.safeString(r,"loc","us"),h=this.safeString(r,"method","marketPublicGetV1beta3CryptoLocBars"),c={symbols:n,loc:d};let l;if(r=this.omit(r,["loc","method"]),"marketPublicGetV1beta3CryptoLocBars"===h){void 0!==s&&(c.limit=s),void 0!==i&&(c.start=this.yyyymmdd(i)),c.timeframe=this.safeString(this.timeframes,t,t);const e=await this.marketPublicGetV1beta3CryptoLocBars(this.extend(c,r)),a=this.safeDict(e,"bars",{});l=this.safeList(a,n,[])}else{if("marketPublicGetV1beta3CryptoLocLatestBars"!==h)throw new a.NotSupported(this.id+" fetchOHLCV() does not support "+h+", marketPublicGetV1beta3CryptoLocBars and marketPublicGetV1beta3CryptoLocLatestBars are supported");{const e=await this.marketPublicGetV1beta3CryptoLocLatestBars(this.extend(c,r)),t=this.safeDict(e,"bars",{});l=this.safeDict(t,n,{}),l=[l]}}return this.parseOHLCVs(l,o,t,i,s)}parseOHLCV(e,t=void 0){const i=this.safeString(e,"t");return[this.parse8601(i),this.safeNumber(e,"o"),this.safeNumber(e,"h"),this.safeNumber(e,"l"),this.safeNumber(e,"c"),this.safeNumber(e,"v")]}async fetchTicker(e,t={}){await this.loadMarkets(),e=this.symbol(e);const i=await this.fetchTickers([e],t);return this.safeDict(i,e)}async fetchTickers(e=void 0,t={}){if(void 0===e)throw new a.ArgumentsRequired(this.id+" fetchTickers() requires a symbols argument");await this.loadMarkets(),e=this.marketSymbols(e);const i=this.safeString(t,"loc","us"),s={symbols:this.marketIds(e).join(","),loc:i};t=this.omit(t,"loc");const r=await this.marketPublicGetV1beta3CryptoLocSnapshots(this.extend(s,t)),o=[],n=this.safeDict(r,"snapshots",{}),d=Object.keys(n);for(let e=0;e=0))throw new a.NotSupported(this.id+" createOrder() does not support stop orders for "+t+" orders, only stop_limit orders are supported");i="stop_limit",d.stop_price=this.priceToPrecision(e,h),d.type=i}t.indexOf("limit")>=0&&(d.limit_price=this.priceToPrecision(e,r));const c=this.safeString(o,"cost");void 0!==c?(o=this.omit(o,"cost"),d.notional=this.costToPrecision(e,c)):d.qty=this.amountToPrecision(e,s);const l=this.safeString(this.options,"defaultTimeInForce");d.time_in_force=this.safeString(o,"timeInForce",l),o=this.omit(o,["timeInForce","triggerPrice"]),d.client_order_id=this.generateClientOrderId(o),o=this.omit(o,["clientOrderId"]);const u=await this.traderPrivatePostV2Orders(this.extend(d,o));return this.parseOrder(u,n)}async cancelOrder(e,t=void 0,i={}){const s={order_id:e},r=await this.traderPrivateDeleteV2OrdersOrderId(this.extend(s,i));return this.parseOrder(r)}async cancelAllOrders(e=void 0,t={}){await this.loadMarkets();const i=await this.traderPrivateDeleteV2Orders(t);return Array.isArray(i)?this.parseOrders(i,void 0):[this.safeOrder({info:i})]}async fetchOrder(e,t=void 0,i={}){await this.loadMarkets();const s={order_id:e},r=await this.traderPrivateGetV2OrdersOrderId(this.extend(s,i)),a=this.safeString(r,"symbol"),o=this.safeMarket(a);return this.parseOrder(r,o)}async fetchOrders(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();const r={status:"all"};let a;void 0!==e&&(a=this.market(e),r.symbols=a.id);const o=this.safeInteger(s,"until");void 0!==o&&(s=this.omit(s,"until"),r.endTime=this.iso8601(o)),void 0!==t&&(r.after=this.iso8601(t)),void 0!==i&&(r.limit=i);const n=await this.traderPrivateGetV2Orders(this.extend(r,s));return this.parseOrders(n,a,t,i)}async fetchOpenOrders(e=void 0,t=void 0,i=void 0,s={}){return await this.fetchOrders(e,t,i,this.extend({status:"open"},s))}async fetchClosedOrders(e=void 0,t=void 0,i=void 0,s={}){return await this.fetchOrders(e,t,i,this.extend({status:"closed"},s))}async editOrder(e,t,i,s,r=void 0,a=void 0,o={}){await this.loadMarkets();const n={order_id:e};let d;void 0!==t&&(d=this.market(t)),void 0!==r&&(n.qty=this.amountToPrecision(t,r));const h=this.safeStringN(o,["triggerPrice","stop_price"]);let c;void 0!==h&&(n.stop_price=this.priceToPrecision(t,h),o=this.omit(o,"triggerPrice")),void 0!==a&&(n.limit_price=this.priceToPrecision(t,a)),[c,o]=this.handleOptionAndParams2(o,"editOrder","timeInForce","defaultTimeInForce"),void 0!==c&&(n.time_in_force=c),n.client_order_id=this.generateClientOrderId(o),o=this.omit(o,["clientOrderId"]);const l=await this.traderPrivatePatchV2OrdersOrderId(this.extend(n,o));return this.parseOrder(l,d)}parseOrder(e,t=void 0){const i=this.safeString(e,"symbol"),s=(t=this.safeMarket(i,t)).symbol,r=this.safeString(e,"status"),a=this.parseOrderStatus(r),o=this.safeString(e,"commission");let n;void 0!==o&&(n={cost:o,currency:"USD"});let d=this.safeString(e,"order_type");void 0!==d&&d.indexOf("limit")>=0&&(d="limit");const h=this.safeString(e,"submitted_at"),c=this.parse8601(h);return this.safeOrder({id:this.safeString(e,"id"),clientOrderId:this.safeString(e,"client_order_id"),timestamp:c,datetime:h,lastTradeTimeStamp:void 0,status:a,symbol:s,type:d,timeInForce:this.parseTimeInForce(this.safeString(e,"time_in_force")),postOnly:void 0,side:this.safeString(e,"side"),price:this.safeNumber(e,"limit_price"),triggerPrice:this.safeNumber(e,"stop_price"),cost:void 0,average:this.safeNumber(e,"filled_avg_price"),amount:this.safeNumber(e,"qty"),filled:this.safeNumber(e,"filled_qty"),remaining:void 0,trades:void 0,fee:n,info:e},t)}parseOrderStatus(e){return this.safeString({pending_new:"open",accepted:"open",new:"open",partially_filled:"open",activated:"open",filled:"closed"},e,e)}parseTimeInForce(e){return this.safeString({day:"Day"},e,e)}async fetchMyTrades(e=void 0,t=void 0,i=void 0,s={}){let r;await this.loadMarkets();let a={activity_type:"FILL"};void 0!==e&&(r=this.market(e));const o=this.safeInteger(s,"until");void 0!==o&&(s=this.omit(s,"until"),a.until=this.iso8601(o)),void 0!==t&&(a.after=this.iso8601(t)),void 0!==i&&(a.page_size=i),[a,s]=this.handleUntilOption("until",a,s);const n=await this.traderPrivateGetV2AccountActivitiesActivityType(this.extend(a,s));return this.parseTrades(n,r,t,i)}parseTrade(e,t=void 0){const i=this.safeString2(e,"S","symbol"),s=this.safeSymbol(i,t),r=this.safeString2(e,"t","transaction_time"),a=this.parse8601(r),o=this.safeString(e,"tks");let n=this.safeString(e,"side");"B"===o?n="buy":"S"===o&&(n="sell");const d=this.safeString2(e,"p","price"),h=this.safeString2(e,"s","qty");return this.safeTrade({info:e,id:this.safeString2(e,"i","id"),timestamp:a,datetime:this.iso8601(a),symbol:s,order:this.safeString(e,"order_id"),type:void 0,side:n,takerOrMaker:"taker",price:d,amount:h,cost:void 0,fee:void 0},t)}async fetchDepositAddress(e,t={}){await this.loadMarkets();const i=this.currency(e),s={asset:i.id},r=await this.traderPrivateGetV2Wallets(this.extend(s,t));return this.parseDepositAddress(r,i)}parseDepositAddress(e,t=void 0){let i;return void 0!==t&&(i=t.id),{info:e,currency:i,network:void 0,address:this.safeString(e,"address"),tag:void 0}}async withdraw(e,t,i,s=void 0,r={}){[s,r]=this.handleWithdrawTagAndParams(s,r),this.checkAddress(i),await this.loadMarkets();const a=this.currency(e);s&&(i=i+":"+s);const o={asset:a.id,address:i,amount:this.numberToString(t)},n=await this.traderPrivatePostV2WalletsTransfers(this.extend(o,r));return this.parseTransaction(n,a)}async fetchTransactionsHelper(e,t,i,s,r){let a;await this.loadMarkets(),void 0!==t&&(a=this.currency(t));const o=await this.traderPrivateGetV2WalletsTransfers(r),n=[];for(let t=0;t{i.d(t,{A:()=>d});var s=i(5147),r=i(1185),a=i(1579),o=i(4852),n=i(2079);class d extends r.A{describe(){return this.deepExtend(super.describe(),{id:"apex",name:"Apex",countries:[],version:"v3",rateLimit:20,certified:!1,pro:!0,dex:!0,has:{CORS:void 0,spot:!1,margin:!1,swap:!0,future:!1,option:!1,addMargin:!1,borrowCrossMargin:!1,borrowIsolatedMargin:!1,cancelAllOrders:!0,cancelAllOrdersAfter:!1,cancelOrder:!0,cancelOrders:!1,cancelOrdersForSymbols:!1,closeAllPositions:!1,closePosition:!1,createMarketBuyOrderWithCost:!1,createMarketOrderWithCost:!1,createMarketSellOrderWithCost:!1,createOrder:!0,createOrders:!1,createPostOnlyOrder:!0,createReduceOnlyOrder:!0,createStopOrder:!0,createTriggerOrder:!0,editOrder:!1,fetchAccounts:!0,fetchBalance:!0,fetchBorrowInterest:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchCanceledAndClosedOrders:!1,fetchCanceledOrders:!1,fetchClosedOrders:!1,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!0,fetchDepositAddress:!1,fetchDepositAddresses:!1,fetchDeposits:!1,fetchDepositWithdrawFee:!1,fetchDepositWithdrawFees:!1,fetchFundingHistory:!0,fetchFundingRate:!1,fetchFundingRateHistory:!0,fetchFundingRates:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchLedger:!1,fetchLeverage:!1,fetchLeverageTiers:!1,fetchLiquidations:!1,fetchMarginMode:!1,fetchMarketLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMyLiquidations:!1,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenInterest:!0,fetchOpenInterestHistory:!1,fetchOpenInterests:!1,fetchOpenOrders:!0,fetchOrder:!0,fetchOrderBook:!0,fetchOrders:!0,fetchOrderTrades:!0,fetchPosition:!1,fetchPositionMode:!1,fetchPositions:!0,fetchPositionsRisk:!1,fetchPremiumIndexOHLCV:!1,fetchTicker:!0,fetchTickers:!0,fetchTime:!0,fetchTrades:!0,fetchTradingFee:!1,fetchTradingFees:!1,fetchTransfer:!0,fetchTransfers:!0,fetchWithdrawal:!1,fetchWithdrawals:!1,reduceMargin:!1,repayCrossMargin:!1,repayIsolatedMargin:!1,sandbox:!0,setLeverage:!0,setMarginMode:!1,setPositionMode:!1,transfer:!1,withdraw:!1},timeframes:{"1m":"1","5m":"5","15m":"15","30m":"30","1h":"60","2h":"120","4h":"240","6h":"360","12h":"720","1d":"D","1w":"W","1M":"M"},hostname:"omni.apex.exchange",urls:{logo:"https://github.com/user-attachments/assets/fef8f2f7-4265-46aa-965e-33a91881cb00",api:{public:"https://{hostname}/api",private:"https://{hostname}/api"},test:{public:"https://testnet.omni.apex.exchange/api",private:"https://testnet.omni.apex.exchange/api"},www:"https://apex.exchange/",doc:"https://api-docs.pro.apex.exchange",fees:"https://apex-pro.gitbook.io/apex-pro/apex-omni-live-now/trading-perpetual-contracts/trading-fees",referral:"https://omni.apex.exchange/trade"},api:{public:{get:{"v3/symbols":1,"v3/history-funding":1,"v3/ticker":1,"v3/klines":1,"v3/trades":1,"v3/depth":1,"v3/time":1,"v3/data/all-ticker-info":1}},private:{get:{"v3/account":1,"v3/account-balance":1,"v3/fills":1,"v3/order-fills":1,"v3/order":1,"v3/history-orders":1,"v3/order-by-client-order-id":1,"v3/funding":1,"v3/historical-pnl":1,"v3/open-orders":1,"v3/transfers":1,"v3/transfer":1},post:{"v3/delete-open-orders":1,"v3/delete-client-order-id":1,"v3/delete-order":1,"v3/order":1,"v3/set-initial-margin-rate":1,"v3/transfer-out":1,"v3/contract-transfer-out":1}}},httpExceptions:{403:n.RateLimitExceeded},exceptions:{exact:{20006:"apikey sign error",20016:"request para error",10001:n.BadRequest},broad:{ORDER_PRICE_MUST_GREETER_ZERO:n.InvalidOrder,ORDER_POSSIBLE_LEAD_TO_ACCOUNT_LIQUIDATED:n.InvalidOrder,ORDER_WITH_THIS_PRICE_CANNOT_REDUCE_POSITION_ONLY:n.InvalidOrder}},fees:{swap:{taker:this.parseNumber("0.0005"),maker:this.parseNumber("0.0002")}},requiredCredentials:{apiKey:!0,secret:!0,walletAddress:!1,privateKey:!1,password:!0},precisionMode:a.kb,commonCurrencies:{},options:{defaultType:"swap",defaultSlippage:.05,brokerId:"6956"},features:{default:{sandbox:!0,createOrder:{marginMode:!1,triggerPrice:!0,triggerPriceType:void 0,triggerDirection:!1,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!0,FOK:!0,PO:!0,GTD:!0},hedged:!1,selfTradePrevention:!1,trailing:!0,leverage:!1,marketBuyByCost:!1,marketBuyRequiresPrice:!1,iceberg:!1},createOrders:void 0,fetchMyTrades:{marginMode:!1,limit:500,daysBack:1e5,untilDays:1e5,symbolRequired:!1},fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!1},fetchOpenOrders:{marginMode:!1,limit:void 0,trigger:!1,trailing:!1,symbolRequired:!1},fetchOrders:{marginMode:!1,limit:100,daysBack:1e5,untilDays:1e5,trigger:!1,trailing:!1,symbolRequired:!1},fetchClosedOrders:void 0,fetchOHLCV:{limit:200}},swap:{linear:{extends:"default"},inverse:void 0}}})}async fetchTime(e={}){const t=await this.publicGetV3Time(e),i=this.safeDict(t,"data",{});return this.safeInteger(i,"time")}parseBalance(e){const t=this.milliseconds(),i={info:e,timestamp:t,datetime:this.iso8601(t)},s=this.account();return s.free=this.safeString(e,"availableBalance"),s.total=this.safeString(e,"totalEquityValue"),i.USDT=s,this.safeBalance(i)}async fetchBalance(e={}){await this.loadMarkets();const t=await this.privateGetV3AccountBalance(e),i=this.safeDict(t,"data",{});return this.parseBalance(i)}parseAccount(e){return{id:this.safeString(e,"id","0"),type:void 0,code:void 0,info:e}}async fetchAccount(e={}){await this.loadMarkets();const t=await this.privateGetV3Account(e),i=this.safeDict(t,"data",{});return this.parseAccount(i)}async fetchCurrencies(e={}){const t=await this.publicGetV3Symbols(e),i=this.safeDict(t,"data",{}),s=this.safeDict(i,"spotConfig",{}),r=this.safeDict(s,"multiChain",{}),a=this.safeList(s,"assets",[]),o=this.safeList(r,"chains",[]),n={};for(let e=0;e0&&this.markets_by_id[i][0].id2===e&&(t=this.markets_by_id[i][0])}}return super.safeMarket(e,t,i,s)}generateRandomClientIdOmni(e){return"apexomni-"+(e||this.randNumber(12).toString())+"-"+this.milliseconds().toString()+"-"+this.randNumber(6).toString()}addHyphenBeforeUsdt(e){const t=e.toUpperCase().indexOf("USDT"),i=this.safeString(e,t-1);return t>0&&"-"!==i?e.slice(0,t)+"-"+e.slice(t):e}getSeeds(){const e=this.safeString(this.options,"seeds");if(void 0===e)throw new n.ArgumentsRequired(this.id+' the "seeds" key is required in the options to access private endpoints. You can find it in API Management > Omni Key, and then set it as exchange.options["seeds"] = XXXX');return e}async getAccountId(){if("0"===this.safeString(this.options,"accountId","0")){const e=await this.fetchAccount();this.options.accountId=this.safeString(e,"id","0")}return this.options.accountId}async createOrder(e,t,i,r,o=void 0,d={}){await this.loadMarkets();const h=this.market(e),c=t.toUpperCase(),l=i.toUpperCase(),u=this.amountToPrecision(e,r);let f="0";void 0!==o&&(f=this.priceToPrecision(e,o));const p=this.safeDict(this.fees,"swap",{}),m=this.safeNumber(p,"taker",5e-4),g=this.safeNumber(p,"maker",2e-4),v=this.decimalToPrecision(s.Y.stringAdd(s.Y.stringMul(s.Y.stringMul(f,u),m.toString()),h.precision.price.toString()),a.R3,h.precision.price,this.precisionMode,this.paddingMode),y=this.milliseconds(),w="MARKET"===c;if(w&&void 0===o)throw new n.ArgumentsRequired(this.id+" createOrder() requires a price argument for market orders");let b=this.safeStringUpper(d,"timeInForce");const k=this.isPostOnly(w,void 0,d);void 0===b&&(b="GOOD_TIL_CANCEL"),w||(k?b="POST_ONLY":"ioc"===b&&(b="IMMEDIATE_OR_CANCEL")),d=this.omit(d,"timeInForce"),d=this.omit(d,"postOnly");let S=this.safeStringN(d,["clientId","clientOrderId","client_order_id"]);const O=await this.getAccountId();void 0===S&&(S=this.generateRandomClientIdOmni(O)),d=this.omit(d,["clientId","clientOrderId","client_order_id"]);const T={accountId:O,slotId:S,nonce:S,pairId:h.quoteId,size:u,price:f,direction:l,makerFeeRate:g.toString(),takerFeeRate:m.toString()},P=await this.getZKContractSignatureObj(this.remove0xPrefix(this.getSeeds()),T),M={symbol:h.id,side:l,type:c,size:u,price:f,limitFee:v,expiration:Math.floor(y/1e3+2592e3),timeInForce:b,clientId:S,brokerId:this.safeString(this.options,"brokerId","6956")};M.signature=P;const I=await this.privatePostV3Order(this.extend(M,d)),x=this.safeDict(I,"data",{});return this.parseOrder(x,h)}async transfer(e,t,i,r,a={}){await this.loadMarkets();const o=await this.publicGetV3Symbols(a),n=this.safeDict(o,"data",{}),d=this.safeDict(n,"contractConfig",{}),h=this.safeList(d,"assets",[]),c=this.safeDict(n,"spotConfig",{}),l=this.safeList(c,"assets",[]),u=this.safeDict(c,"global",{}),f=this.safeString(u,"contractAssetPoolEthAddress",""),p=this.safeString(u,"contractAssetPoolZkAccountId",""),m=this.safeString(u,"contractAssetPoolSubAccount",""),g=this.safeString(u,"contractAssetPoolAccountId",""),v=await this.privateGetV3Account(a),y=this.safeDict(v,"data",{}),w=this.safeDict(y,"spotAccount",{}),b=this.safeString(w,"zkAccountId",""),k=this.safeString(w,"defaultSubAccountId","0"),S=this.safeList(w,"subAccounts",[]);let O="0";S.length>0&&(O=this.safeString(S[0],"nonce","0"));const T=this.safeString(y,"ethereumAddress",""),P=this.safeString(y,"id","");let M={},I=[];I=void 0!==i&&"contract"===i.toLowerCase()?h:l;for(let t=0;t{i.d(t,{A:()=>r});var s=i(9312);class r extends s.A{describe(){return this.deepExtend(super.describe(),{id:"arzinja",name:"Arzinja",countries:["IR"],rateLimit:1e3,version:"1",certified:!1,pro:!1,has:{CORS:void 0,spot:!0,margin:!1,swap:!1,future:!1,option:!1,addMargin:!1,cancelAllOrders:!1,cancelOrder:!1,cancelOrders:!1,createDepositAddress:!1,createOrder:!1,createStopLimitOrder:!1,createStopMarketOrder:!1,createStopOrder:!1,editOrder:!1,fetchBalance:!1,fetchBorrowInterest:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchClosedOrders:!1,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!1,fetchDepositAddress:!1,fetchDeposits:!1,fetchFundingHistory:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchL2OrderBook:!1,fetchL3OrderBook:!1,fetchLedger:!1,fetchLedgerEntry:!1,fetchLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMyTrades:!1,fetchOHLCV:!1,fetchOpenInterestHistory:!1,fetchOpenOrders:!1,fetchOrder:!1,fetchOrderBook:!1,fetchOrders:!1,fetchOrderTrades:"emulated",fetchPositions:!1,fetchPremiumIndexOHLCV:!1,fetchTicker:!0,fetchTickers:!0,fetchTime:!1,fetchTrades:!1,fetchTradingFee:!1,fetchTradingFees:!1,fetchWithdrawals:!1,setLeverage:!1,setMarginMode:!1,transfer:!1,withdraw:!1},comment:"This comment is optional",urls:{logo:"https://cdn.arz.digital/cr-odin/img/exchanges/arzinja/64x64.png",api:{public:"https://arzinja.app"},www:"https://arzinja.info",doc:["https://arzinja.info"]},api:{public:{get:{prices:1}}},fees:{trading:{tierBased:!1,percentage:!0,maker:this.parseNumber("0.001"),taker:this.parseNumber("0.001")}}})}async fetchMarkets(e={}){const t=await this.publicGetPrices(e),i=this.safeDict(t,"markets"),s=Object.keys(i),r=[];for(let e=0;e{i.d(t,{A:()=>r});var s=i(5042);class r extends s.A{describe(){return this.deepExtend(super.describe(),{id:"arzplus",name:"Arzplus",countries:["IR"],rateLimit:1e3,version:"1",certified:!1,pro:!1,has:{CORS:void 0,spot:!0,margin:!1,swap:!1,future:!1,option:!1,addMargin:!1,cancelAllOrders:!1,cancelOrder:!1,cancelOrders:!1,createDepositAddress:!1,createOrder:!1,createStopLimitOrder:!1,createStopMarketOrder:!1,createStopOrder:!1,editOrder:!1,fetchBalance:!1,fetchBorrowInterest:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchClosedOrders:!1,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!1,fetchDepositAddress:!1,fetchDeposits:!1,fetchFundingHistory:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchL2OrderBook:!1,fetchLedger:!1,fetchLedgerEntry:!1,fetchLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMyTrades:!1,fetchOHLCV:!0,fetchOpenInterestHistory:!1,fetchOpenOrders:!1,fetchOrder:!1,fetchOrderBook:!0,fetchOrders:!1,fetchOrderTrades:"emulated",fetchPositions:!1,fetchPremiumIndexOHLCV:!1,fetchTicker:!0,fetchTickers:!0,fetchTime:!1,fetchTrades:!1,fetchTradingFee:!1,fetchTradingFees:!1,fetchWithdrawals:!1,setLeverage:!1,setMarginMode:!1,transfer:!1,withdraw:!1},comment:"This comment is optional",urls:{logo:"https://cdn.arz.digital/cr-odin/img/exchanges/arzplus/64x64.png",api:{public:"https://api.arzplus.net"},www:"https://arzplus.net",doc:["https://arzplus.net"]},timeframes:{"1h":"60","1d":"1D"},api:{public:{get:{"api/v1/market/symbols":1,"api/v1/market/tradingview/ohlcv":1,"api/v1/market/depth":1,"api/v1/market/irt/info":1}}},fees:{trading:{tierBased:!1,percentage:!0,maker:this.parseNumber("0.001"),taker:this.parseNumber("0.001")}}})}async fetchMarkets(e={}){const t={stats:"1",enable:"true"},i=await this.publicGetApiV1MarketSymbols(t),s=await this.publicGetApiV1MarketIrtInfo(t),r=[];for(let e=0;e{i.d(t,{A:()=>d});var s=i(566),r=i(2079),a=i(5147),o=i(1579),n=i(4852);class d extends s.A{describe(){return this.deepExtend(super.describe(),{id:"ascendex",name:"AscendEX",countries:["SG"],rateLimit:400,certified:!1,pro:!0,has:{CORS:void 0,spot:!0,margin:!0,swap:!0,future:!1,option:!1,addMargin:!0,cancelAllOrders:!0,cancelOrder:!0,createOrder:!0,createOrders:!0,createPostOnlyOrder:!0,createReduceOnlyOrder:!0,createStopLimitOrder:!0,createStopMarketOrder:!0,createStopOrder:!0,fetchAccounts:!0,fetchBalance:!0,fetchClosedOrders:!0,fetchCurrencies:!0,fetchDepositAddress:!0,fetchDepositAddresses:!1,fetchDepositAddressesByNetwork:!1,fetchDeposits:!0,fetchDepositsWithdrawals:!0,fetchDepositWithdrawFee:"emulated",fetchDepositWithdrawFees:!0,fetchFundingHistory:!0,fetchFundingRate:"emulated",fetchFundingRateHistory:!1,fetchFundingRates:!0,fetchGreeks:!1,fetchIndexOHLCV:!1,fetchLeverage:"emulated",fetchLeverages:!0,fetchLeverageTiers:!0,fetchMarginMode:"emulated",fetchMarginModes:!0,fetchMarketLeverageTiers:"emulated",fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMySettlementHistory:!1,fetchOHLCV:!0,fetchOpenInterest:!1,fetchOpenInterestHistory:!1,fetchOpenOrders:!0,fetchOption:!1,fetchOptionChain:!1,fetchOrder:!0,fetchOrderBook:!0,fetchOrders:!1,fetchPosition:!1,fetchPositionMode:!1,fetchPositions:!0,fetchPositionsRisk:!1,fetchPremiumIndexOHLCV:!1,fetchSettlementHistory:!1,fetchTicker:!0,fetchTickers:!0,fetchTime:!0,fetchTrades:!0,fetchTradingFee:!1,fetchTradingFees:!0,fetchTransactionFee:!1,fetchTransactionFees:!1,fetchTransactions:"emulated",fetchTransfer:!1,fetchTransfers:!1,fetchVolatilityHistory:!1,fetchWithdrawal:!1,fetchWithdrawals:!0,reduceMargin:!0,sandbox:!0,setLeverage:!0,setMarginMode:!0,setPositionMode:!1,transfer:!0},timeframes:{"1m":"1","5m":"5","15m":"15","30m":"30","1h":"60","2h":"120","4h":"240","6h":"360","12h":"720","1d":"1d","1w":"1w","1M":"1m"},version:"v2",urls:{logo:"https://github.com/user-attachments/assets/55bab6b9-d4ca-42a8-a0e6-fac81ae557f1",api:{rest:"https://ascendex.com"},test:{rest:"https://api-test.ascendex-sandbox.com"},www:"https://ascendex.com",doc:["https://ascendex.github.io/ascendex-pro-api/#ascendex-pro-api-documentation"],fees:"https://ascendex.com/en/feerate/transactionfee-traderate",referral:{url:"https://ascendex.com/en-us/register?inviteCode=EL6BXBQM",discount:.25}},api:{v1:{public:{get:{assets:1,products:1,ticker:1,"barhist/info":1,barhist:1,depth:1,trades:1,"cash/assets":1,"cash/products":1,"margin/assets":1,"margin/products":1,"futures/collateral":1,"futures/contracts":1,"futures/ref-px":1,"futures/market-data":1,"futures/funding-rates":1,"risk-limit-info":1,"exchange-info":1}},private:{get:{info:1,"wallet/transactions":1,"wallet/deposit/address":1,"data/balance/snapshot":1,"data/balance/history":1},accountCategory:{get:{balance:1,"order/open":1,"order/status":1,"order/hist/current":1,risk:1},post:{order:1,"order/batch":1},delete:{order:1,"order/all":1,"order/batch":1}},accountGroup:{get:{"cash/balance":1,"margin/balance":1,"margin/risk":1,"futures/collateral-balance":1,"futures/position":1,"futures/risk":1,"futures/funding-payments":1,"order/hist":1,"spot/fee":1},post:{transfer:1,"futures/transfer/deposit":1,"futures/transfer/withdraw":1}}}},v2:{public:{get:{assets:1,"futures/contract":1,"futures/collateral":1,"futures/pricing-data":1,"futures/ticker":1,"risk-limit-info":1}},private:{data:{get:{"order/hist":1}},get:{"account/info":1},accountGroup:{get:{"order/hist":1,"futures/position":1,"futures/free-margin":1,"futures/order/hist/current":1,"futures/funding-payments":1,"futures/order/open":1,"futures/order/status":1},post:{"futures/isolated-position-margin":1,"futures/margin-type":1,"futures/leverage":1,"futures/transfer/deposit":1,"futures/transfer/withdraw":1,"futures/order":1,"futures/order/batch":1,"futures/order/open":1,"subuser/subuser-transfer":1,"subuser/subuser-transfer-hist":1},delete:{"futures/order":1,"futures/order/batch":1,"futures/order/all":1}}}}},fees:{trading:{feeSide:"get",tierBased:!0,percentage:!0,taker:this.parseNumber("0.002"),maker:this.parseNumber("0.002")}},precisionMode:o.kb,options:{"account-category":"cash","account-group":void 0,fetchClosedOrders:{method:"v2PrivateDataGetOrderHist"},defaultType:"spot",accountsByType:{spot:"cash",swap:"futures",margin:"margin"},transfer:{fillResponseFromRequest:!0},networks:{BSC:"BEP20 (BSC)",ARB:"arbitrum",SOL:"Solana",AVAX:"avalanche C chain",OMNI:"Omni",TRC20:"TRC20",ERC20:"ERC20",GO20:"GO20",BEP2:"BEP2",BTC:"Bitcoin",BCH:"Bitcoin ABC",LTC:"Litecoin",MATIC:"Matic Network",AKT:"Akash"}},features:{default:{sandbox:!0,createOrder:{marginMode:!0,triggerPrice:!0,triggerPriceType:void 0,triggerDirection:!1,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!0,FOK:!0,PO:!0,GTD:!1},hedged:!1,trailing:!1,leverage:!1,marketBuyRequiresPrice:!1,marketBuyByCost:!1,selfTradePrevention:!1,iceberg:!1},createOrders:{max:10},fetchMyTrades:void 0,fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,marketType:!0,symbolRequired:!1},fetchOpenOrders:{marginMode:!1,limit:void 0,trigger:!1,trailing:!1,marketType:!0,symbolRequired:!1},fetchOrders:void 0,fetchClosedOrders:void 0,fetchOHLCV:{limit:500}},spot:{extends:"default",fetchClosedOrders:{marginMode:!1,limit:1e3,daysBack:1e5,daysBackCanceled:1,untilDays:1e5,trigger:!1,trailing:!1,symbolRequired:!1}},forDerivatives:{extends:"default",createOrder:{attachedStopLossTakeProfit:{triggerPriceType:{last:!0,mark:!1,index:!1},price:!1}},fetchClosedOrders:{marginMode:!1,limit:1e3,daysBack:void 0,daysBackCanceled:void 0,untilDays:void 0,trigger:!1,trailing:!1,symbolRequired:!1}},swap:{linear:{extends:"forDerivatives"},inverse:void 0},future:{linear:void 0,inverse:void 0}},exceptions:{exact:{1900:r.BadRequest,2100:r.AuthenticationError,5002:r.BadSymbol,6001:r.BadSymbol,6010:r.InsufficientFunds,60060:r.InvalidOrder,600503:r.InvalidOrder,100001:r.BadRequest,100002:r.BadRequest,100003:r.BadRequest,100004:r.BadRequest,100005:r.BadRequest,100006:r.BadRequest,100007:r.BadRequest,100008:r.BadSymbol,100009:r.AuthenticationError,100010:r.BadRequest,100011:r.BadRequest,100012:r.BadRequest,100013:r.BadRequest,100101:r.ExchangeError,150001:r.BadRequest,200001:r.AuthenticationError,200002:r.ExchangeError,200003:r.ExchangeError,200004:r.ExchangeError,200005:r.ExchangeError,200006:r.ExchangeError,200007:r.ExchangeError,200008:r.ExchangeError,200009:r.ExchangeError,200010:r.AuthenticationError,200011:r.ExchangeError,200012:r.ExchangeError,200013:r.ExchangeError,200014:r.PermissionDenied,200015:r.PermissionDenied,300001:r.InvalidOrder,300002:r.InvalidOrder,300003:r.InvalidOrder,300004:r.InvalidOrder,300005:r.InvalidOrder,300006:r.InvalidOrder,300007:r.InvalidOrder,300008:r.InvalidOrder,300009:r.InvalidOrder,300011:r.InsufficientFunds,300012:r.BadSymbol,300013:r.InvalidOrder,300014:r.InvalidOrder,300020:r.InvalidOrder,300021:r.AccountSuspended,300031:r.InvalidOrder,310001:r.InsufficientFunds,310002:r.InvalidOrder,310003:r.InvalidOrder,310004:r.BadSymbol,310005:r.InvalidOrder,510001:r.ExchangeError,900001:r.ExchangeError},broad:{}},commonCurrencies:{XBT:"XBT",BOND:"BONDED",BTCBEAR:"BEAR",BTCBULL:"BULL",BYN:"BeyondFi",PLN:"Pollen"}})}getAccount(e={}){const t=this.safeValue(e,"account",this.options.account).toLowerCase();return this.capitalize(t)}async fetchCurrencies(e={}){const t=await this.v2PublicGetAssets(e),i=this.safeList(t,"data",[]),s={};for(let e=0;e=0)continue;const i=h[t],s=this.safeString(i,"status"),r=this.safeString(i,"domain");let a=!1;"Normal"!==s&&"InternalTrading"!==s||"LeveragedETF"===r||(a=!0);const o=this.safeNumber(i,"minQty"),n=this.safeNumber(i,"maxQty"),d=this.safeNumber(i,"tickSize"),u=void 0,f=this.safeString2(i,"underlying","symbol").split("/"),p=this.safeString(f,0),m=this.safeString(f,1),g=this.safeCurrencyCode(p),v=this.safeCurrencyCode(m),y=this.safeNumber(i,"commissionReserveRate"),w=this.safeBool(i,"marginTradable",!1);l.push({id:t,symbol:g+"/"+v,base:g,baseId:p,quote:v,quoteId:m,settle:void 0,settleId:void 0,type:"spot",spot:!0,margin:w,swap:!1,future:!1,option:!1,active:a,contract:!1,linear:void 0,inverse:void 0,taker:y,maker:y,contractSize:void 0,expiry:void 0,expiryDatetime:void 0,strike:void 0,optionType:void 0,precision:{amount:this.safeNumber(i,"lotSize"),price:this.safeNumber(i,"tickSize")},limits:{leverage:{min:void 0,max:void 0},amount:{min:o,max:n},price:{min:d,max:u},cost:{min:this.safeNumber(i,"minNotional"),max:this.safeNumber(i,"maxNotional")}},created:this.safeInteger(i,"tradingStartTime"),info:i})}return l}async fetchContractMarkets(e={}){const t=await this.v2PublicGetFuturesContract(e),i=this.safeList(t,"data",[]),s=[];for(let e=0;e1){const e=this.indexBy(h,"chainName");if(void 0===a){const t=Object.keys(e).join(", ");throw new r.ArgumentsRequired(this.id+" fetchDepositAddress() returned more than one address, a chainName parameter is required, one of "+t)}c=this.safeDict(e,a,{})}else c=this.safeDict(h,0,{});const l=this.parseDepositAddress(c,i);return this.extend(l,{info:n})}async fetchDeposits(e=void 0,t=void 0,i=void 0,s={}){return await this.fetchTransactions(e,t,i,this.extend({txType:"deposit"},s))}async fetchWithdrawals(e=void 0,t=void 0,i=void 0,s={}){return await this.fetchTransactions(e,t,i,this.extend({txType:"withdrawal"},s))}async fetchDepositsWithdrawals(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();const r={};let a;void 0!==e&&(a=this.currency(e),r.asset=a.id),void 0!==t&&(r.startTs=t),void 0!==i&&(r.pageSize=i);const o=await this.v1PrivateGetWalletTransactions(this.extend(r,s)),n=this.safeDict(o,"data",{}),d=this.safeList(n,"data",[]);return this.parseTransactions(d,a,t,i)}parseTransactionStatus(e){return this.safeString({reviewing:"pending",pending:"pending",confirmed:"ok",rejected:"rejected"},e,e)}parseTransaction(e,t=void 0){const i=this.safeDict(e,"destAddress",{}),s=this.safeString(i,"address"),r=this.safeString(i,"destTag"),o=this.safeInteger(e,"time"),n=this.safeString(e,"asset");let d=this.safeString(e,"amount");const h=this.safeString(e,"commission");d=a.Y.stringSub(d,h);const c=this.safeCurrencyCode(n,t);return{info:e,id:this.safeString(e,"requestId"),txid:this.safeString(e,"networkTransactionId"),type:this.safeString(e,"transactionType"),currency:c,network:void 0,amount:this.parseNumber(d),status:this.parseTransactionStatus(this.safeString(e,"status")),timestamp:o,datetime:this.iso8601(o),address:s,addressFrom:void 0,addressTo:s,tag:r,tagFrom:void 0,tagTo:r,updated:void 0,comment:void 0,fee:{currency:c,cost:this.parseNumber(h),rate:void 0},internal:!1}}async fetchPositions(e=void 0,t={}){await this.loadMarkets(),await this.loadAccounts();const i=this.safeDict(this.accounts,0,{}),s={"account-group":this.safeString(i,"id")},r=await this.v2PrivateAccountGroupGetFuturesPosition(this.extend(s,t)),a=this.safeDict(r,"data",{}),o=this.safeList(a,"contracts",[]),n=[];for(let e=0;e100)throw new r.BadRequest(this.id+" leverage should be between 1 and 100");await this.loadMarkets(),await this.loadAccounts();const s=this.market(t);if(!s.swap)throw new r.BadSymbol(this.id+" setLeverage() supports swap contracts only");const a=this.safeDict(this.accounts,0,{}),o={"account-group":this.safeString(a,"id"),symbol:s.id,leverage:e};return await this.v2PrivateAccountGroupPostFuturesLeverage(this.extend(o,i))}async setMarginMode(e,t=void 0,i={}){if(void 0===t)throw new r.ArgumentsRequired(this.id+" setMarginMode() requires a symbol argument");if("cross"===(e=e.toLowerCase())&&(e="crossed"),"isolated"!==e&&"crossed"!==e)throw new r.BadRequest(this.id+" setMarginMode() marginMode argument should be isolated or cross");await this.loadMarkets(),await this.loadAccounts();const s=this.market(t),a=this.safeDict(this.accounts,0,{}),o={"account-group":this.safeString(a,"id"),symbol:s.id,marginType:e};if(!s.swap)throw new r.BadSymbol(this.id+" setMarginMode() supports swap contracts only");return await this.v2PrivateAccountGroupPostFuturesMarginType(this.extend(o,i))}async fetchLeverageTiers(e=void 0,t={}){await this.loadMarkets();const i=await this.v2PublicGetFuturesContract(t),s=this.safeList(i,"data",[]);return e=this.marketSymbols(e),this.parseLeverageTiers(s,e,"symbol")}parseMarketLeverageTiers(e,t=void 0){const i=this.safeList(e,"marginRequirements",[]),s=this.safeString(e,"symbol");t=this.safeMarket(s,t);const r=[];for(let e=0;e=0){const e=u.split("/");u=e[2]}if(s=this.omit(s,this.extractParams(e)),"public"===d)Object.keys(s).length&&(c+="?"+this.urlencode(s));else{this.checkRequiredCredentials();const e=this.milliseconds().toString(),t=e+"+"+u,o=this.hmac(this.encode(t),this.encode(this.secret),n.s,"base64");r={"x-auth-key":this.apiKey,"x-auth-timestamp":e,"x-auth-signature":o},"GET"===i?Object.keys(s).length&&(c+="?"+this.urlencode(s)):(r["Content-Type"]="application/json",a=this.json(s))}return c=this.urls.api.rest+c,{url:c,method:i,body:a,headers:r}}handleErrors(e,t,i,s,a,o,n,d,h){if(void 0===n)return;const c=this.safeString(n,"code"),l=this.safeString(n,"message");if(void 0!==c&&"0"!==c||void 0!==l){const e=this.id+" "+o;throw this.throwExactlyMatchedException(this.exceptions.exact,c,e),this.throwExactlyMatchedException(this.exceptions.exact,l,e),this.throwBroadlyMatchedException(this.exceptions.broad,l,e),new r.ExchangeError(e)}}}},2961:(e,t,i)=>{i.d(t,{k:()=>Ot});var s=i(5095),r=i(7437),a=i(6238),o=i(2079),n=i(5147),d=i(7288),h=i(3206),c=i(3828),l=i(8283),u=i(8995),f=i(5897),p=i(4380),m=i(447),g=i(3187),v=i(7661),y=i(6907),w=i(9793),b=i(9491),k=i(1878),S=i(4852);const{isNode:O,selfIsDefined:T,deepExtend:P,extend:M,clone:I,flatten:x,unique:A,indexBy:_,sortBy:C,sortBy2:B,safeFloat2:E,groupBy:L,aggregate:R,uuid:N,unCamelCase:D,precisionFromString:q,Throttler:V,capitalize:F,now:H,decimalToPrecision:G,safeValue:U,safeValue2:W,safeString:j,safeString2:K,seconds:z,milliseconds:Y,binaryToBase16:X,numberToBE:Q,base16ToBinary:Z,iso8601:$,omit:J,isJsonEncodedObject:ee,safeInteger:te,sum:ie,omitZero:se,implodeParams:re,extractParams:ae,json:oe,merge:ne,binaryConcat:de,hash:he,ecdsa:ce,arrayConcat:le,encode:ue,urlencode:fe,hmac:pe,numberToString:me,roundTimeframe:ge,parseTimeframe:ve,safeInteger2:ye,safeStringLower:we,parse8601:be,yyyymmdd:ke,safeStringUpper:Se,safeTimestamp:Oe,binaryConcatArray:Te,uuidv1:Pe,numberToLE:Me,ymdhms:Ie,stringToBase64:xe,decode:Ae,uuid22:_e,safeIntegerProduct2:Ce,safeIntegerProduct:Be,safeStringLower2:Ee,yymmdd:Le,base58ToBinary:Re,binaryToBase58:Ne,safeTimestamp2:De,rawencode:qe,keysort:Ve,sort:Fe,inArray:He,isEmpty:Ge,ordered:Ue,filterBy:We,uuid16:je,safeFloat:Ke,base64ToBinary:ze,safeStringUpper2:Ye,urlencodeWithArrayRepeat:Xe,microseconds:Qe,binaryToBase64:Ze,strip:$e,toArray:Je,safeFloatN:et,safeIntegerN:tt,safeIntegerProductN:it,safeTimestampN:st,safeValueN:rt,safeStringN:at,safeStringLowerN:ot,safeStringUpperN:nt,urlencodeNested:dt,urlencodeBase64:ht,parseDate:ct,ymd:lt,base64ToString:ut,crc32:ft,packb:pt,TRUNCATE:mt,ROUND:gt,DECIMAL_PLACES:vt,NO_PADDING:yt,TICK_SIZE:wt,SIGNIFICANT_DIGITS:bt,sleep:kt}=s;let St;(async()=>{try{St=await i.e(373).then(i.t.bind(i,2373,23))}catch{}})();class Ot{constructor(e={}){this.isSandboxModeEnabled=!1,this.throttleProp=void 0,this.sleep=kt,this.api=void 0,this.certified=!1,this.pro=!1,this.countries=void 0,this.userAgent=void 0,this.user_agent=void 0,this.userAgents={chrome:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36",chrome39:"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36",chrome100:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 Safari/537.36"},this.headers={},this.returnResponseHeaders=!1,this.origin="*",this.MAX_VALUE=Number.MAX_VALUE,this.agent=void 0,this.nodeHttpModuleLoaded=!1,this.httpAgent=void 0,this.httpsAgent=void 0,this.minFundingAddressLength=1,this.substituteCommonCurrencyCodes=!0,this.quoteJsonNumbers=!0,this.number=Number,this.handleContentTypeApplicationZip=!1,this.reduceFees=!0,this.validateServerSsl=!0,this.validateClientSsl=!1,this.timeout=1e4,this.verbose=!1,this.twofa=void 0,this.balance={},this.liquidations={},this.orderbooks={},this.tickers={},this.fundingRates={},this.bidsasks={},this.orders=void 0,this.triggerOrders=void 0,this.transactions={},this.myLiquidations={},this.requiresWeb3=!1,this.requiresEddsa=!1,this.precision=void 0,this.enableLastJsonResponse=!1,this.enableLastHttpResponse=!0,this.enableLastResponseHeaders=!0,this.last_http_response=void 0,this.last_json_response=void 0,this.last_response_headers=void 0,this.last_request_headers=void 0,this.last_request_body=void 0,this.last_request_url=void 0,this.last_request_path=void 0,this.id="Exchange",this.markets=void 0,this.features=void 0,this.status=void 0,this.rateLimit=void 0,this.tokenBucket=void 0,this.throttler=void 0,this.enableRateLimit=void 0,this.httpExceptions=void 0,this.limits=void 0,this.markets_by_id=void 0,this.symbols=void 0,this.ids=void 0,this.currencies={},this.baseCurrencies=void 0,this.quoteCurrencies=void 0,this.currencies_by_id=void 0,this.codes=void 0,this.reloadingMarkets=void 0,this.marketsLoading=void 0,this.accounts=void 0,this.accountsById=void 0,this.commonCurrencies=void 0,this.hostname=void 0,this.precisionMode=void 0,this.paddingMode=void 0,this.exceptions={},this.timeframes={},this.version=void 0,this.marketsByAltname=void 0,this.name=void 0,this.targetAccount=void 0,this.stablePairs={},this.clients={},this.newUpdates=!0,this.streaming={},this.alias=!1,this.deepExtend=P,this.deepExtendSafe=P,this.isNode=O,this.keys=r.HP,this.values=r.zu,this.extend=M,this.clone=I,this.flatten=x,this.unique=A,this.indexBy=_,this.indexBySafe=_,this.roundTimeframe=ge,this.sortBy=C,this.sortBy2=B,this.groupBy=L,this.aggregate=R,this.uuid=N,this.unCamelCase=D,this.precisionFromString=q,this.capitalize=F,this.now=H,this.decimalToPrecision=G,this.safeValue=U,this.safeValue2=W,this.safeString=j,this.safeString2=K,this.safeFloat=Ke,this.safeFloat2=E,this.seconds=z,this.milliseconds=Y,this.binaryToBase16=X,this.numberToBE=Q,this.base16ToBinary=Z,this.iso8601=$,this.omit=J,this.isJsonEncodedObject=ee,this.safeInteger=te,this.sum=ie,this.omitZero=se,this.implodeParams=re,this.extractParams=ae,this.json=oe,this.vwap=a.ru,this.merge=ne,this.binaryConcat=de,this.hash=he,this.arrayConcat=le,this.encode=ue,this.urlencode=fe,this.hmac=pe,this.numberToString=me,this.parseTimeframe=ve,this.safeInteger2=ye,this.safeStringLower=we,this.parse8601=be,this.yyyymmdd=ke,this.safeStringUpper=Se,this.safeTimestamp=Oe,this.binaryConcatArray=Te,this.uuidv1=Pe,this.numberToLE=Me,this.ymdhms=Ie,this.yymmdd=Le,this.stringToBase64=xe,this.decode=Ae,this.uuid22=_e,this.safeIntegerProduct2=Ce,this.safeIntegerProduct=Be,this.binaryToBase58=Ne,this.base58ToBinary=Re,this.base64ToBinary=ze,this.safeTimestamp2=De,this.rawencode=qe,this.keysort=Ve,this.sort=Fe,this.inArray=He,this.safeStringLower2=Ee,this.safeStringUpper2=Ye,this.isEmpty=Ge,this.ordered=Ue,this.filterBy=We,this.uuid16=je,this.urlencodeWithArrayRepeat=Xe,this.microseconds=Qe,this.binaryToBase64=Ze,this.strip=$e,this.toArray=Je,this.safeFloatN=et,this.safeIntegerN=tt,this.safeIntegerProductN=it,this.safeTimestampN=st,this.safeValueN=rt,this.safeStringN=at,this.safeStringLowerN=ot,this.safeStringUpperN=nt,this.urlencodeNested=dt,this.parseDate=ct,this.ymd=lt,this.base64ToString=ut,this.crc32=ft,this.packb=pt,this.urlencodeBase64=ht,this.httpProxyAgentModule=void 0,this.httpsProxyAgentModule=void 0,this.socksProxyAgentModule=void 0,this.socksProxyAgentModuleChecked=!1,this.proxyDictionaries={},this.proxiesModulesLoading=void 0,Object.assign(this,s),this.options=this.getDefaultOptions(),this.headers={},this.origin="*",this.minFundingAddressLength=1,this.substituteCommonCurrencyCodes=!0,this.quoteJsonNumbers=!0,this.number=Number,this.handleContentTypeApplicationZip=!1,this.reduceFees=!0,this.fetchImplementation=void 0,this.validateServerSsl=!0,this.validateClientSsl=!1,this.timeout=1e4,this.verbose=!1,this.twofa=void 0,this.apiKey=void 0,this.secret=void 0,this.uid=void 0,this.login=void 0,this.password=void 0,this.privateKey=void 0,this.walletAddress=void 0,this.token=void 0,this.balance={},this.orderbooks={},this.tickers={},this.liquidations={},this.orders=void 0,this.trades={},this.transactions={},this.ohlcvs={},this.myLiquidations={},this.myTrades=void 0,this.positions=void 0,this.requiresWeb3=!1,this.requiresEddsa=!1,this.lastRestRequestTimestamp=0,this.enableLastJsonResponse=!1,this.enableLastHttpResponse=!0,this.enableLastResponseHeaders=!0,this.last_http_response=void 0,this.last_json_response=void 0,this.last_response_headers=void 0,this.last_request_headers=void 0,this.last_request_body=void 0,this.last_request_url=void 0,this.last_request_path=void 0;const t=(e=this)=>{if(null!==e){const i=Object.getOwnPropertyNames(e);for(let e=0;ef&&(i=!1),c===f&&(l>p||l===p&&u>m)&&(i=!1),!i){if(t)throw new o.NotSupported("Your current version of CCXT is "+Ot.ccxtVersion+", a newer version "+e+" is required, please, upgrade your version of CCXT");return t}return i}throttle(e=void 0){return this.throttler.throttle(e)}initThrottler(){this.throttler=new V(this.tokenBucket)}defineRestApiEndpoint(e,t,i,s,r,a,o={}){const n=r.split(/[^a-zA-Z0-9]/),d=n.map(this.capitalize).join(""),h=n.map((e=>e.trim().toLowerCase())).filter((e=>e.length>0)).join("_"),c=[a[0]].concat(a.slice(1).map(this.capitalize)).join(""),l=[a[0]].concat(a.slice(1).map((e=>e.trim())).filter((e=>e.length>0))).join("_"),u=c+s+this.capitalize(d),f=l+"_"+i+"_"+h,p=a.length>1?a:a[0],m=async(i={},s={})=>this[e](r,p,t,i,void 0,void 0,o,s);this[u]=m,this[f]=m}defineRestApi(e,t,i=[]){const s=Object.keys(e);for(let r=0;r{try{this.httpProxyAgentModule=await import("../static_dependencies/proxies/http-proxy-agent/index.js"),this.httpsProxyAgentModule=await import("../static_dependencies/proxies/https-proxy-agent/index.js")}catch(e){try{this.httpProxyAgentModule=await import("http-proxy-agent"),this.httpsProxyAgentModule=await import("https-proxy-agent")}catch(e){}}if(!1===this.socksProxyAgentModuleChecked){try{this.socksProxyAgentModule=await import("socks-proxy-agent")}catch(e){}this.socksProxyAgentModuleChecked=!0}})()),await this.proxiesModulesLoading}setProxyAgents(e,t,i){let s;if(!O&&(e||t||i))throw new o.NotSupported(this.id+' - proxies in browser-side projects are not supported. You have several choices: [A] Use `exchange.proxyUrl` property to redirect requests through local/remote cors-proxy server (find sample file named "sample-local-proxy-server-with-cors" in https://github.com/ccxt/ccxt/tree/master/examples/ folder, which can be used for REST requests only) [B] override `exchange.fetch` && `exchange.watch` methods to send requests through your custom proxy');if(e){if(void 0===this.httpProxyAgentModule)throw new o.NotSupported(this.id+" you need to load JS proxy modules with `await instance.loadProxyModules()` method at first to use proxies");e in this.proxyDictionaries||(this.proxyDictionaries[e]=new this.httpProxyAgentModule.HttpProxyAgent(e)),s=this.proxyDictionaries[e]}else if(t){if(void 0===this.httpsProxyAgentModule)throw new o.NotSupported(this.id+" you need to load JS proxy modules with `await instance.loadProxyModules()` method at first to use proxies");t in this.proxyDictionaries||(this.proxyDictionaries[t]=new this.httpsProxyAgentModule.HttpsProxyAgent(t)),s=this.proxyDictionaries[t],s.keepAlive=!0}else if(i){if(void 0===this.socksProxyAgentModule)throw new o.NotSupported(this.id+' - to use SOCKS proxy with ccxt, at first you need install module "npm i socks-proxy-agent" and then initialize proxies with `await instance.loadProxyModules()` method');i in this.proxyDictionaries||(this.proxyDictionaries[i]=new this.socksProxyAgentModule.SocksProxyAgent(i)),s=this.proxyDictionaries[i]}return s}async loadHttpProxyAgent(){if(!this.httpAgent){const e=await import("node:http");this.httpAgent=new e.Agent}return this.httpAgent}getHttpAgentIfNeeded(e){if(O&&"ws://"===e.substring(0,5)){if(void 0===this.httpAgent)throw new o.NotSupported(this.id+" to use proxy with non-ssl ws:// urls, at first run `await exchange.loadHttpProxyAgent()` method");return this.httpAgent}}isBinaryMessage(e){return e instanceof Uint8Array}decodeProtoMsg(e){if(!St)throw new o.NotSupported(this.id+" requires protobuf to decode messages, please install it with `npm install protobufjs`");if(e instanceof Uint8Array){return St.default.PushDataV3ApiWrapper.decode(e).toJSON()}return e}async fetch(e,t="GET",i=void 0,s=void 0){if(O&&!this.nodeHttpModuleLoaded){this.nodeHttpModuleLoaded=!0;const e=await import("node:https");this.httpsAgent=new e.Agent({keepAlive:!0})}i=this.extend(this.headers,i);const r=this.checkProxyUrlSettings(e,t,i,s);let a=!1;void 0!==r&&(O&&(i=this.extend({Origin:this.origin},i),"http:"===r.substring(0,5)&&(await this.loadHttpProxyAgent(),a=this.httpAgent)),e=r+this.urlEncoderForProxyUrl(e));const[n,d,h]=this.checkProxySettings(e,t,i,s);this.checkConflictingProxies(n||d||h,r),O&&await this.loadProxyModules();const c=this.setProxyAgents(n,d,h),l=void 0!==this.userAgent?this.userAgent:this.user_agent;if(l&&O&&("string"==typeof l?i=this.extend({"User-Agent":l},i):"object"==typeof l&&"User-Agent"in l&&(i=this.extend(l,i))),i=this.setHeaders(i),this.verbose&&this.log("fetch Request:\n",this.id,t,e,"\nRequestHeaders:\n",i,"\nRequestBody:\n",s,"\n"),void 0===this.fetchImplementation)if(O){void 0===this.agent&&(this.agent=this.httpsAgent);try{const e=await import("../static_dependencies/node-fetch/index.js");this.AbortError=e.AbortError,this.fetchImplementation=e.default,this.FetchError=e.FetchError}catch(e){if("function"!=typeof fetch)throw new Error('Seems, "fetch" function is not available in your node-js version, please use latest node-js version');this.fetchImplementation=fetch,this.AbortError=DOMException,this.FetchError=TypeError}}else this.fetchImplementation=T()?self.fetch:fetch,this.AbortError=DOMException,this.FetchError=TypeError;const u=this.fetchImplementation,f={method:t,headers:i,body:s,timeout:this.timeout};this.agent&&(f.agent=this.agent),a?f.agent=a:c&&(f.agent=c);const p=new AbortController;f.signal=p.signal;const m=setTimeout((()=>{p.abort()}),this.timeout);try{const r=await u(e,f);return clearTimeout(m),this.handleRestResponse(r,e,t,i,s)}catch(i){if(i instanceof this.AbortError)throw new o.RequestTimeout(this.id+" "+t+" "+e+" request timed out ("+this.timeout+" ms)");if(i instanceof this.FetchError)throw new o.NetworkError(this.id+" "+t+" "+e+" fetch failed");throw i}}parseJson(e){try{if(this.isJsonEncodedObject(e))return JSON.parse(this.onJsonResponse(e))}catch(e){return}}getResponseHeaders(e){const t={};return e.headers.forEach(((e,i)=>{i=i.split("-").map((e=>this.capitalize(e))).join("-"),t[i]=e})),t}handleRestResponse(e,t,i="GET",s=void 0,r=void 0){const a=this.getResponseHeaders(e);if(this.handleContentTypeApplicationZip&&"application/zip"===a["Content-Type"]){const s=e.buffer();return this.enableLastResponseHeaders&&(this.last_response_headers=a),this.enableLastHttpResponse&&(this.last_http_response=s),this.verbose&&this.log("handleRestResponse:\n",this.id,i,t,e.status,e.statusText,"\nResponseHeaders:\n",a,"ZIP redacted","\n"),s}return e.text().then((o=>{const n=this.onRestResponse(e.status,e.statusText,t,i,a,o,s,r),d=this.parseJson(n);this.enableLastResponseHeaders&&(this.last_response_headers=a),this.enableLastHttpResponse&&(this.last_http_response=o),this.enableLastJsonResponse&&(this.last_json_response=d),this.verbose&&this.log("handleRestResponse:\n",this.id,i,t,e.status,e.statusText,"\nResponseHeaders:\n",a,"\nResponseBody:\n",o,"\n");return this.handleErrors(e.status,e.statusText,t,i,a,o,d,s,r)||this.handleHttpStatusCode(e.status,e.statusText,t,i,o),d&&!Array.isArray(d)&&this.returnResponseHeaders&&(d.responseHeaders=a),d||o}))}onRestResponse(e,t,i,s,r,a,o,n){return a.trim()}onJsonResponse(e){return this.quoteJsonNumbers?e.replace(/":([+.0-9eE-]+)([,}])/g,'":"$1"$2'):e}async loadMarketsHelper(e=!1,t={}){if(!e&&this.markets)return this.markets_by_id?this.markets:this.setMarkets(this.markets);let i;!0===this.has.fetchCurrencies&&(i=await this.fetchCurrencies(),this.options.cachedCurrencies=i);const s=await this.fetchMarkets(t);return"cachedCurrencies"in this.options&&delete this.options.cachedCurrencies,this.setMarkets(s,i)}async loadMarkets(e=!1,t={}){return(e&&!this.reloadingMarkets||!this.marketsLoading)&&(this.reloadingMarkets=!0,this.marketsLoading=this.loadMarketsHelper(e,t).then((e=>(this.reloadingMarkets=!1,e)),(e=>{throw this.reloadingMarkets=!1,e}))),this.marketsLoading}async fetchCurrencies(e={}){return new Promise(((e,t)=>e(this.currencies)))}async fetchCurrenciesWs(e={}){return new Promise(((e,t)=>e(this.currencies)))}async fetchMarkets(e={}){return new Promise(((e,t)=>e(Object.values(this.markets))))}async fetchMarketsWs(e={}){return new Promise(((e,t)=>e(Object.values(this.markets))))}checkRequiredDependencies(){}parseNumber(e,t=void 0){if(void 0===e)return t;try{const i=this.numberToString(e);if(i.indexOf("e-")>-1)return this.number(me(parseFloat(i)));const s=this.number(i);return isNaN(s)?t:s}catch(e){return t}}checkOrderArguments(e,t,i,s,r,a){if(void 0===r&&"limit"===t)throw new o.ArgumentsRequired(this.id+" createOrder() requires a price argument for a limit order");if(s<=0)throw new o.ArgumentsRequired(this.id+" createOrder() amount should be above 0")}handleHttpStatusCode(e,t,i,s,r){const a=e.toString();if(a in this.httpExceptions){throw new(0,this.httpExceptions[a])(this.id+" "+s+" "+i+" "+a+" "+t+" "+r)}}remove0xPrefix(e){return"0x"===e.slice(0,2)?e.slice(2):e}mapToSafeMap(e){return e}safeMapToMap(e){return e}spawn(e,...t){const i=(0,h.K)();return setTimeout((()=>{e.apply(this,t).then(i.resolve).catch(i.reject)}),0),i}delay(e,t,...i){setTimeout((()=>{this.spawn(t,...i)}),e)}orderBook(e={},t=Number.MAX_SAFE_INTEGER){return new c.Mi(e,t)}indexedOrderBook(e={},t=Number.MAX_SAFE_INTEGER){return new c.nS(e,t)}countedOrderBook(e={},t=Number.MAX_SAFE_INTEGER){return new c.if(e,t)}handleMessage(e,t){}ping(e){}client(e){if(this.clients=this.clients||{},!this.clients[e]){const t=this.handleMessage.bind(this),i=this.onError.bind(this),s=this.onClose.bind(this),r=this.onConnected.bind(this),a=this.safeValue(this.options,"ws",{}),[o,n,h]=this.checkWsProxySettings(),c=this.setProxyAgents(o,n,h),l=this.getHttpAgentIfNeeded(e),u=c||(l||this.agent),f=this.deepExtend(this.streaming,{log:this.log?this.log.bind(this):this.log,ping:this.ping?this.ping.bind(this):this.ping,verbose:this.verbose,throttler:new V(this.tokenBucket),options:{agent:u},decompressBinary:this.safeBool(this.options,"decompressBinary",!0)},a);this.clients[e]=new d.A(e,t,i,s,r,f)}return this.clients[e]}watchMultiple(e,t,i=void 0,s=void 0,r=void 0){const a=this.client(e),o=h.K.race(t.map((e=>a.future(e))));let n=[];if(void 0!==s)for(let e=0;e{const e=this.safeValue(this.options,"ws"),t=this.safeValue(e,"cost",1);i&&(this.enableRateLimit&&a.throttle?a.throttle(t).then((()=>{a.send(i)})).catch((e=>{for(let e=0;e{for(let e=0;e{for(let e=0;e{const e=this.safeValue(this.options,"ws"),t=this.safeValue(e,"cost",1);i&&(this.enableRateLimit&&a.throttle?a.throttle(t).then((()=>{a.send(i)})).catch((e=>{a.onError(e)})):a.send(i).catch((e=>{a.onError(e)})))})).catch((e=>{delete a.subscriptions[s],o.reject(e)})),o}onConnected(e,t=void 0){}onError(e,t){e.url in this.clients&&this.clients[e.url].error&&delete this.clients[e.url]}onClose(e,t){e.error||this.clients[e.url]&&delete this.clients[e.url]}async close(){const e=Object.values(this.clients||{}),t=[];for(let i=0;i=0)return d.reset(o),this.handleDeltas(d,a.slice(h)),d.cache.length=0,void e.resolve(d,t);n++}e.reject(new o.ExchangeError(this.id+" nonce is behind the cache after "+a.toString()+" tries."),t),delete this.clients[e.url]}catch(a){e.reject(a,t),await this.loadOrderBook(e,t,i,s,r)}}convertToBigInt(e){return BigInt(e)}stringToCharsArray(e){return e.split("")}valueIsDefined(e){return null!=e}arraySlice(e,t,i=void 0){return void 0===i?e.slice(t):e.slice(t,i)}getProperty(e,t,i=void 0){return t in e?e[t]:i}setProperty(e,t,i=void 0){e[t]=i}axolotl(e,t,i){return(0,l.Sw)(e,t,i)}fixStringifiedJsonMembers(e){let t=e.replaceAll("\\","");return t=t.replaceAll('"{',"{"),t=t.replaceAll('}"',"}"),t}ethAbiEncode(e,t){return this.base16ToBinary(f.Ay.encode(e,t).slice(2))}ethEncodeStructuredData(e,t,i){return this.base16ToBinary(p.z.encode(e,t,i).slice(-132))}retrieveStarkAccount(e,t,i){const s=(0,g.b)(e),r=(0,g.$u)(s),a=y.fP.compile({implementation:t,selector:w.BK("initialize"),calldata:y.fP.compile({signer:r,guardian:"0"})});return{privateKey:s,publicKey:r,address:b.r4(r,i,a,0)}}starknetEncodeStructuredData(e,t,i,s){const r=Object.keys(t);if(r.length>1)throw new o.NotSupported(this.id+" starknetEncodeStructuredData only support single type");const a={domain:e,primaryType:r[0],types:this.extend({StarkNetDomain:[{name:"name",type:"felt"},{name:"chainId",type:"felt"},{name:"version",type:"felt"}]},t),message:i};return k.E(a,s)}starknetSign(e,t){const i=(0,g._S)(e.replace("0x",""),t.slice(-64));return this.json([i.r.toString(),i.s.toString()])}async getZKContractSignatureObj(e,t={}){const i=BigInt("0x"+this.remove0xPrefix(this.hash(this.encode(this.safeString(t,"slotId")),S.s,"hex"))).toString(),s=BigInt("0x"+this.remove0xPrefix(this.hash(this.encode(this.safeString(t,"nonce")),S.s,"hex"))).toString(),r="4294967295",a=parseInt(n.Y.stringMod(this.safeString(t,"accountId"),r),10),o=parseInt(n.Y.stringDiv(n.Y.stringMod(i,"18446744073709551615"),r),10),d=parseInt(n.Y.stringMod(s,r),10);await(0,v.Ay)();const h=v.$s({});await h.initZklinkSigner(e);let c=new v.KR(a,0,o,d,this.safeInteger(t,"pairId"),n.Y.stringMul(this.safeString(t,"size"),"1e18"),n.Y.stringMul(this.safeString(t,"price"),"1e18"),"BUY"===this.safeString(t,"direction"),parseInt(n.Y.stringMul(this.safeString(t,"makerFeeRate"),"10000")),parseInt(n.Y.stringMul(this.safeString(t,"takerFeeRate"),"10000")),!1),l=v.JF(c);l?.sign(h?.getZkLinkSigner());const u=l.jsValue(),f=u?.signature?.signature;return f}async getZKTransferSignatureObj(e,t={}){await(0,v.Ay)();const i=v.$s({});await i.initZklinkSigner(e);let s=this.safeString(t,"nonce","0");if(!0===this.safeBool(t,"isContract")){const e="4294967295",t=BigInt("0x"+this.remove0xPrefix(this.hash(this.encode(s),S.s,"hex"))).toString();s=n.Y.stringMod(t,e)}let r=new v.H3(this.safeNumber(t,"zkAccountId",0),this.safeString(t,"receiverAddress"),this.safeNumber(t,"subAccountId",0),this.safeNumber(t,"receiverSubAccountId",0),this.safeNumber(t,"tokenId",0),this.safeString(t,"fee","0"),this.safeString(t,"amount","0"),this.parseToInt(s),this.safeNumber(t,"timestampSeconds",0)),a=v.qj(r);a?.sign(i?.getZkLinkSigner());const o=a.jsValue(),d=o?.signature?.signature;return d}intToBase16(e){return e.toString(16)}extendExchangeOptions(e){this.options=this.extend(this.options,e)}createSafeDictionary(){return{}}convertToSafeDictionary(e){return e}randomBytes(e){const t=new m.D,i=[];return i.length=e,t.nextBytes(i),Buffer.from(i).toString("hex")}randNumber(e){let t="";for(let i=0;i1){const e=r.join(",");throw new o.InvalidProxySettings(this.id+" you have multiple conflicting proxy settings ("+e+"), please use only one from : proxyUrl, proxy_url, proxyUrlCallback, proxy_url_callback")}return a}urlEncoderForProxyUrl(e){return e.indexOf("?")>=0?this.encodeURIComponent(e):e}checkProxySettings(e=void 0,t=void 0,i=void 0,s=void 0){const r=[];let a,n,d;const h=this.valueIsDefined(this.httpProxy),c=this.valueIsDefined(this.http_proxy);(h||c)&&(r.push("httpProxy"),a=h?this.httpProxy:this.http_proxy);const l=this.valueIsDefined(this.httpProxyCallback),u=this.valueIsDefined(this.http_proxy_callback);(l||u)&&(r.push("httpProxyCallback"),a=l?this.httpProxyCallback(e,t,i,s):this.http_proxy_callback(e,t,i,s));const f=this.valueIsDefined(this.httpsProxy),p=this.valueIsDefined(this.https_proxy);(f||p)&&(r.push("httpsProxy"),n=f?this.httpsProxy:this.https_proxy);const m=this.valueIsDefined(this.httpsProxyCallback),g=this.valueIsDefined(this.https_proxy_callback);(m||g)&&(r.push("httpsProxyCallback"),n=m?this.httpsProxyCallback(e,t,i,s):this.https_proxy_callback(e,t,i,s));const v=this.valueIsDefined(this.socksProxy),y=this.valueIsDefined(this.socks_proxy);(v||y)&&(r.push("socksProxy"),d=v?this.socksProxy:this.socks_proxy);const w=this.valueIsDefined(this.socksProxyCallback),b=this.valueIsDefined(this.socks_proxy_callback);(w||b)&&(r.push("socksProxyCallback"),d=w?this.socksProxyCallback(e,t,i,s):this.socks_proxy_callback(e,t,i,s));if(r.length>1){const e=r.join(",");throw new o.InvalidProxySettings(this.id+" you have multiple conflicting proxy settings ("+e+"), please use only one from: httpProxy, httpsProxy, httpProxyCallback, httpsProxyCallback, socksProxy, socksProxyCallback")}return[a,n,d]}checkWsProxySettings(){const e=[];let t,i,s;const r=this.valueIsDefined(this.wsProxy),a=this.valueIsDefined(this.ws_proxy);(r||a)&&(e.push("wsProxy"),t=r?this.wsProxy:this.ws_proxy);const n=this.valueIsDefined(this.wssProxy),d=this.valueIsDefined(this.wss_proxy);(n||d)&&(e.push("wssProxy"),i=n?this.wssProxy:this.wss_proxy);const h=this.valueIsDefined(this.wsSocksProxy),c=this.valueIsDefined(this.ws_socks_proxy);(h||c)&&(e.push("wsSocksProxy"),s=h?this.wsSocksProxy:this.ws_socks_proxy);if(e.length>1){const t=e.join(",");throw new o.InvalidProxySettings(this.id+" you have multiple conflicting proxy settings ("+t+"), please use only one from: wsProxy, wssProxy, wsSocksProxy")}return[t,i,s]}checkConflictingProxies(e,t){if(e&&t)throw new o.InvalidProxySettings(this.id+" you have multiple conflicting proxy settings, please use only one from : proxyUrl, httpProxy, httpsProxy, socksProxy")}checkAddress(e=void 0){if(void 0===e)throw new o.InvalidAddress(this.id+" address is undefined");if(1===this.unique(this.stringToCharsArray(e)).length||e.length-1)throw new o.InvalidAddress(this.id+" address is invalid or has less than "+this.minFundingAddressLength.toString()+' characters: "'+e.toString()+'"');return e}findMessageHashes(e,t){const i=[],s=Object.keys(e.futures);for(let e=0;e=0&&i.push(r)}return i}filterByLimit(e,t=void 0,i="timestamp",s=!1){if(this.valueIsDefined(t)){const r=e.length;if(r>0){let a=!0;if(i in e[0]){const t=e[0][i],s=e[r-1][i];void 0!==t&&void 0!==s&&(a=t<=s)}s?(t>r&&(t=r),e=a?this.arraySlice(e,0,t):this.arraySlice(e,-t)):e=a?this.arraySlice(e,-t):this.arraySlice(e,0,t)}}return e}filterBySinceLimit(e,t=void 0,i=void 0,s="timestamp",r=!1){const a=this.valueIsDefined(t),o=this.toArray(e);let n=o;if(a){n=[];for(let e=0;e=t&&n.push(i)}}if(r&&void 0!==i)return this.arraySlice(n,-i);const d=!r&&a;return this.filterByLimit(n,i,s,d)}filterByValueSinceLimit(e,t,i=void 0,s=void 0,r=void 0,a="timestamp",o=!1){const n=this.valueIsDefined(i),d=this.valueIsDefined(s),h=this.toArray(e);let c=h;if(n||d){c=[];for(let e=0;e=s)&&c.push(r)}}return o&&void 0!==r?this.arraySlice(c,-r):this.filterByLimit(c,r,a,d)}setSandboxMode(e){if(e){if(!("test"in this.urls))throw new o.NotSupported(this.id+" does not have a sandbox URL");"string"==typeof this.urls.api?(this.urls.apiBackup=this.urls.api,this.urls.api=this.urls.test):(this.urls.apiBackup=this.clone(this.urls.api),this.urls.api=this.clone(this.urls.test)),this.isSandboxModeEnabled=!0}else if("apiBackup"in this.urls){"string"==typeof this.urls.api?this.urls.api=this.urls.apiBackup:this.urls.api=this.clone(this.urls.apiBackup);const e=this.omit(this.urls,"apiBackup");this.urls=e,this.isSandboxModeEnabled=!1}}sign(e,t="public",i="GET",s={},r=void 0,a=void 0){return{}}async fetchAccounts(e={}){throw new o.NotSupported(this.id+" fetchAccounts() is not supported yet")}async fetchTrades(e,t=void 0,i=void 0,s={}){throw new o.NotSupported(this.id+" fetchTrades() is not supported yet")}async fetchTradesWs(e,t=void 0,i=void 0,s={}){throw new o.NotSupported(this.id+" fetchTradesWs() is not supported yet")}async watchLiquidations(e,t=void 0,i=void 0,s={}){if(this.has.watchLiquidationsForSymbols)return await this.watchLiquidationsForSymbols([e],t,i,s);throw new o.NotSupported(this.id+" watchLiquidations() is not supported yet")}async watchLiquidationsForSymbols(e,t=void 0,i=void 0,s={}){throw new o.NotSupported(this.id+" watchLiquidationsForSymbols() is not supported yet")}async watchMyLiquidations(e,t=void 0,i=void 0,s={}){if(this.has.watchMyLiquidationsForSymbols)return this.watchMyLiquidationsForSymbols([e],t,i,s);throw new o.NotSupported(this.id+" watchMyLiquidations() is not supported yet")}async watchMyLiquidationsForSymbols(e,t=void 0,i=void 0,s={}){throw new o.NotSupported(this.id+" watchMyLiquidationsForSymbols() is not supported yet")}async watchTrades(e,t=void 0,i=void 0,s={}){throw new o.NotSupported(this.id+" watchTrades() is not supported yet")}async unWatchOrders(e=void 0,t={}){throw new o.NotSupported(this.id+" unWatchOrders() is not supported yet")}async unWatchTrades(e,t={}){throw new o.NotSupported(this.id+" unWatchTrades() is not supported yet")}async watchTradesForSymbols(e,t=void 0,i=void 0,s={}){throw new o.NotSupported(this.id+" watchTradesForSymbols() is not supported yet")}async unWatchTradesForSymbols(e,t={}){throw new o.NotSupported(this.id+" unWatchTradesForSymbols() is not supported yet")}async watchMyTradesForSymbols(e,t=void 0,i=void 0,s={}){throw new o.NotSupported(this.id+" watchMyTradesForSymbols() is not supported yet")}async watchOrdersForSymbols(e,t=void 0,i=void 0,s={}){throw new o.NotSupported(this.id+" watchOrdersForSymbols() is not supported yet")}async watchOHLCVForSymbols(e,t=void 0,i=void 0,s={}){throw new o.NotSupported(this.id+" watchOHLCVForSymbols() is not supported yet")}async unWatchOHLCVForSymbols(e,t={}){throw new o.NotSupported(this.id+" unWatchOHLCVForSymbols() is not supported yet")}async watchOrderBookForSymbols(e,t=void 0,i={}){throw new o.NotSupported(this.id+" watchOrderBookForSymbols() is not supported yet")}async unWatchOrderBookForSymbols(e,t={}){throw new o.NotSupported(this.id+" unWatchOrderBookForSymbols() is not supported yet")}async unWatchPositions(e=void 0,t={}){throw new o.NotSupported(this.id+" unWatchPositions() is not supported yet")}async fetchDepositAddresses(e=void 0,t={}){throw new o.NotSupported(this.id+" fetchDepositAddresses() is not supported yet")}async fetchOrderBook(e,t=void 0,i={}){throw new o.NotSupported(this.id+" fetchOrderBook() is not supported yet")}async fetchOrderBookWs(e,t=void 0,i={}){throw new o.NotSupported(this.id+" fetchOrderBookWs() is not supported yet")}async fetchMarginMode(e,t={}){if(this.has.fetchMarginModes){const i=await this.fetchMarginModes([e],t);return this.safeDict(i,e)}throw new o.NotSupported(this.id+" fetchMarginMode() is not supported yet")}async fetchMarginModes(e=void 0,t={}){throw new o.NotSupported(this.id+" fetchMarginModes () is not supported yet")}async fetchRestOrderBookSafe(e,t=void 0,i={}){const s=this.handleOption("watchOrderBook","maxRetries",3);for(let r=0;r=0?parseFloat(t):parseInt(t)}isRoundNumber(e){return 0===this.parseToNumeric(e%1)}safeNumberOmitZero(e,t,i=void 0){const s=this.safeString(e,t),r=this.parseNumber(this.omitZero(s));return void 0===r?i:r}safeIntegerOmitZero(e,t,i=void 0){const s=this.safeInteger(e,t,i);if(void 0!==s&&0!==s)return s}afterConstruct(){this.createNetworksByIdObject(),this.featuresGenerator(),this.markets&&this.setMarkets(this.markets),this.initRestRateLimiter();const e=this.safeBool2(this.options,"sandbox","testnet",!1);e&&this.setSandboxMode(e)}initRestRateLimiter(){if(void 0===this.rateLimit||void 0!==this.id&&-1===this.rateLimit)throw new o.ExchangeError(this.id+".rateLimit property is not configured");let e=this.MAX_VALUE;this.rateLimit>0&&(e=1/this.rateLimit);const t={delay:.001,capacity:1,cost:1,maxCapacity:1e3,refillRate:e},i=void 0===this.tokenBucket?{}:this.tokenBucket;this.tokenBucket=this.extend(t,i),this.initThrottler()}featuresGenerator(){if(void 0===this.features)return;const e=this.features;this.features={};const t=["spot","swap","future","option"],i=["linear","inverse"];for(let s=0;ss.precision?t:s}o.push(s)}const n=this.sortBy(o,"code");this.currencies=this.mapToSafeMap(this.deepExtend(this.currencies,this.indexBy(n,"code")))}this.currencies_by_id=this.indexBySafe(this.currencies,"id");const o=this.keysort(this.currencies);return this.codes=Object.keys(o),this.markets}getDescribeForExtendedWsExchange(e,t,i){const s=this.deepExtend(t.describe(),e.describe());return this.deepExtend(s,i)}safeBalance(e){const t=this.omit(e,["info","timestamp","datetime","free","used","total"]),i=Object.keys(t);e.free={},e.used={},e.total={};const s={};for(let t=0;t0){void 0===e.symbol&&(e.symbol=O[0].symbol),void 0===e.side&&(e.side=O[0].side),void 0===e.type&&(e.type=O[0].type),void 0===e.id&&(e.id=O[0].order),f&&(r="0"),p&&(a="0");for(let e=0;e=this.sum(a[d][0],r)?a.push([n,s.price,s.price,s.price,s.price,s.amount,1]):(a[d][2]=Math.max(a[d][2],s.price),a[d][3]=Math.min(a[d][3],s.price),a[d][4]=s.price,a[d][5]=this.sum(a[d][5],s.amount),a[d][6]=this.sum(a[d][6],1))}return a}parseTradingViewOHLCV(e,t=void 0,i="1m",s=void 0,r=void 0){const a=this.convertTradingViewToOHLCV(e);return this.parseOHLCVs(a,t,i,s,r)}async editLimitBuyOrder(e,t,i,s=void 0,r={}){return await this.editLimitOrder(e,t,"buy",i,s,r)}async editLimitSellOrder(e,t,i,s=void 0,r={}){return await this.editLimitOrder(e,t,"sell",i,s,r)}async editLimitOrder(e,t,i,s,r=void 0,a={}){return await this.editOrder(e,t,"limit",i,s,r,a)}async editOrder(e,t,i,s,r=void 0,a=void 0,o={}){return await this.cancelOrder(e,t),await this.createOrder(t,i,s,r,a,o)}async editOrderWs(e,t,i,s,r=void 0,a=void 0,o={}){return await this.cancelOrderWs(e,t),await this.createOrderWs(t,i,s,r,a,o)}async fetchPosition(e,t={}){throw new o.NotSupported(this.id+" fetchPosition() is not supported yet")}async fetchPositionWs(e,t={}){throw new o.NotSupported(this.id+" fetchPositionWs() is not supported yet")}async watchPosition(e=void 0,t={}){throw new o.NotSupported(this.id+" watchPosition() is not supported yet")}async watchPositions(e=void 0,t=void 0,i=void 0,s={}){throw new o.NotSupported(this.id+" watchPositions() is not supported yet")}async watchPositionForSymbols(e=void 0,t=void 0,i=void 0,s={}){return await this.watchPositions(e,t,i,s)}async fetchPositionsForSymbol(e,t={}){throw new o.NotSupported(this.id+" fetchPositionsForSymbol() is not supported yet")}async fetchPositionsForSymbolWs(e,t={}){throw new o.NotSupported(this.id+" fetchPositionsForSymbol() is not supported yet")}async fetchPositions(e=void 0,t={}){throw new o.NotSupported(this.id+" fetchPositions() is not supported yet")}async fetchPositionsWs(e=void 0,t={}){throw new o.NotSupported(this.id+" fetchPositions() is not supported yet")}async fetchPositionsRisk(e=void 0,t={}){throw new o.NotSupported(this.id+" fetchPositionsRisk() is not supported yet")}async fetchBidsAsks(e=void 0,t={}){throw new o.NotSupported(this.id+" fetchBidsAsks() is not supported yet")}async fetchBorrowInterest(e=void 0,t=void 0,i=void 0,s=void 0,r={}){throw new o.NotSupported(this.id+" fetchBorrowInterest() is not supported yet")}async fetchLedger(e=void 0,t=void 0,i=void 0,s={}){throw new o.NotSupported(this.id+" fetchLedger() is not supported yet")}async fetchLedgerEntry(e,t=void 0,i={}){throw new o.NotSupported(this.id+" fetchLedgerEntry() is not supported yet")}parseBidAsk(e,t=0,i=1,s=2){const r=this.safeNumber(e,t),a=this.safeNumber(e,i),o=this.safeInteger(e,s),n=[r,a];return void 0!==o&&n.push(o),n}safeCurrency(e,t=void 0){if(void 0===e&&void 0!==t)return t;if(void 0!==this.currencies_by_id&&e in this.currencies_by_id&&void 0!==this.currencies_by_id[e])return this.currencies_by_id[e];let i=e;return void 0!==e&&(i=this.commonCurrencyCode(e.toUpperCase())),this.safeCurrencyStructure({id:e,code:i,precision:void 0})}safeMarket(e=void 0,t=void 0,i=void 0,s=void 0){const r=this.safeMarketStructure({symbol:e,marketId:e});if(void 0!==e)if(void 0!==this.markets_by_id&&e in this.markets_by_id){const i=this.markets_by_id[e];if(1===i.length)return i[0];if(void 0===s){if(void 0===t)throw new o.ArgumentsRequired(this.id+" safeMarket() requires a fourth argument for "+e+" to disambiguate between different markets with the same market id");s=t.type}for(let e=0;e=0)return s}}handleErrors(e,t,i,s,r,a,o,n,d){}calculateRateLimiterCost(e,t,i,s,r={}){return this.safeValue(r,"cost",1)}async fetchTicker(e,t={}){if(this.has.fetchTickers){await this.loadMarkets();e=this.market(e).symbol;const i=await this.fetchTickers([e],t),s=this.safeDict(i,e);if(void 0===s)throw new o.NullResponse(this.id+" fetchTickers() could not find a ticker for "+e);return s}throw new o.NotSupported(this.id+" fetchTicker() is not supported yet")}async fetchMarkPrice(e,t={}){if(this.has.fetchMarkPrices){await this.loadMarkets();e=this.market(e).symbol;const i=await this.fetchMarkPrices([e],t),s=this.safeDict(i,e);if(void 0===s)throw new o.NullResponse(this.id+" fetchMarkPrices() could not find a ticker for "+e);return s}throw new o.NotSupported(this.id+" fetchMarkPrices() is not supported yet")}async fetchTickerWs(e,t={}){if(this.has.fetchTickersWs){await this.loadMarkets();e=this.market(e).symbol;const i=await this.fetchTickersWs([e],t),s=this.safeDict(i,e);if(void 0===s)throw new o.NullResponse(this.id+" fetchTickerWs() could not find a ticker for "+e);return s}throw new o.NotSupported(this.id+" fetchTickerWs() is not supported yet")}async watchTicker(e,t={}){throw new o.NotSupported(this.id+" watchTicker() is not supported yet")}async fetchTickers(e=void 0,t={}){throw new o.NotSupported(this.id+" fetchTickers() is not supported yet")}async fetchMarkPrices(e=void 0,t={}){throw new o.NotSupported(this.id+" fetchMarkPrices() is not supported yet")}async fetchTickersWs(e=void 0,t={}){throw new o.NotSupported(this.id+" fetchTickers() is not supported yet")}async fetchOrderBooks(e=void 0,t=void 0,i={}){throw new o.NotSupported(this.id+" fetchOrderBooks() is not supported yet")}async watchBidsAsks(e=void 0,t={}){throw new o.NotSupported(this.id+" watchBidsAsks() is not supported yet")}async watchTickers(e=void 0,t={}){throw new o.NotSupported(this.id+" watchTickers() is not supported yet")}async unWatchTickers(e=void 0,t={}){throw new o.NotSupported(this.id+" unWatchTickers() is not supported yet")}async fetchOrder(e,t=void 0,i={}){throw new o.NotSupported(this.id+" fetchOrder() is not supported yet")}async fetchOrderWs(e,t=void 0,i={}){throw new o.NotSupported(this.id+" fetchOrderWs() is not supported yet")}async fetchOrderStatus(e,t=void 0,i={}){return(await this.fetchOrder(e,t,i)).status}async fetchUnifiedOrder(e,t={}){return await this.fetchOrder(this.safeString(e,"id"),this.safeString(e,"symbol"),t)}async createOrder(e,t,i,s,r=void 0,a={}){throw new o.NotSupported(this.id+" createOrder() is not supported yet")}async createConvertTrade(e,t,i,s=void 0,r={}){throw new o.NotSupported(this.id+" createConvertTrade() is not supported yet")}async fetchConvertTrade(e,t=void 0,i={}){throw new o.NotSupported(this.id+" fetchConvertTrade() is not supported yet")}async fetchConvertTradeHistory(e=void 0,t=void 0,i=void 0,s={}){throw new o.NotSupported(this.id+" fetchConvertTradeHistory() is not supported yet")}async fetchPositionMode(e=void 0,t={}){throw new o.NotSupported(this.id+" fetchPositionMode() is not supported yet")}async createTrailingAmountOrder(e,t,i,s,r=void 0,a=void 0,n=void 0,d={}){if(void 0===a)throw new o.ArgumentsRequired(this.id+" createTrailingAmountOrder() requires a trailingAmount argument");if(d.trailingAmount=a,void 0!==n&&(d.trailingTriggerPrice=n),this.has.createTrailingAmountOrder)return await this.createOrder(e,t,i,s,r,d);throw new o.NotSupported(this.id+" createTrailingAmountOrder() is not supported yet")}async createTrailingAmountOrderWs(e,t,i,s,r=void 0,a=void 0,n=void 0,d={}){if(void 0===a)throw new o.ArgumentsRequired(this.id+" createTrailingAmountOrderWs() requires a trailingAmount argument");if(d.trailingAmount=a,void 0!==n&&(d.trailingTriggerPrice=n),this.has.createTrailingAmountOrderWs)return await this.createOrderWs(e,t,i,s,r,d);throw new o.NotSupported(this.id+" createTrailingAmountOrderWs() is not supported yet")}async createTrailingPercentOrder(e,t,i,s,r=void 0,a=void 0,n=void 0,d={}){if(void 0===a)throw new o.ArgumentsRequired(this.id+" createTrailingPercentOrder() requires a trailingPercent argument");if(d.trailingPercent=a,void 0!==n&&(d.trailingTriggerPrice=n),this.has.createTrailingPercentOrder)return await this.createOrder(e,t,i,s,r,d);throw new o.NotSupported(this.id+" createTrailingPercentOrder() is not supported yet")}async createTrailingPercentOrderWs(e,t,i,s,r=void 0,a=void 0,n=void 0,d={}){if(void 0===a)throw new o.ArgumentsRequired(this.id+" createTrailingPercentOrderWs() requires a trailingPercent argument");if(d.trailingPercent=a,void 0!==n&&(d.trailingTriggerPrice=n),this.has.createTrailingPercentOrderWs)return await this.createOrderWs(e,t,i,s,r,d);throw new o.NotSupported(this.id+" createTrailingPercentOrderWs() is not supported yet")}async createMarketOrderWithCost(e,t,i,s={}){if(this.has.createMarketOrderWithCost||this.has.createMarketBuyOrderWithCost&&this.has.createMarketSellOrderWithCost)return await this.createOrder(e,"market",t,i,1,s);throw new o.NotSupported(this.id+" createMarketOrderWithCost() is not supported yet")}async createMarketBuyOrderWithCost(e,t,i={}){if(this.options.createMarketBuyOrderRequiresPrice||this.has.createMarketBuyOrderWithCost)return await this.createOrder(e,"market","buy",t,1,i);throw new o.NotSupported(this.id+" createMarketBuyOrderWithCost() is not supported yet")}async createMarketSellOrderWithCost(e,t,i={}){if(this.options.createMarketSellOrderRequiresPrice||this.has.createMarketSellOrderWithCost)return await this.createOrder(e,"market","sell",t,1,i);throw new o.NotSupported(this.id+" createMarketSellOrderWithCost() is not supported yet")}async createMarketOrderWithCostWs(e,t,i,s={}){if(this.has.createMarketOrderWithCostWs||this.has.createMarketBuyOrderWithCostWs&&this.has.createMarketSellOrderWithCostWs)return await this.createOrderWs(e,"market",t,i,1,s);throw new o.NotSupported(this.id+" createMarketOrderWithCostWs() is not supported yet")}async createTriggerOrder(e,t,i,s,r=void 0,a=void 0,n={}){if(void 0===a)throw new o.ArgumentsRequired(this.id+" createTriggerOrder() requires a triggerPrice argument");if(n.triggerPrice=a,this.has.createTriggerOrder)return await this.createOrder(e,t,i,s,r,n);throw new o.NotSupported(this.id+" createTriggerOrder() is not supported yet")}async createTriggerOrderWs(e,t,i,s,r=void 0,a=void 0,n={}){if(void 0===a)throw new o.ArgumentsRequired(this.id+" createTriggerOrderWs() requires a triggerPrice argument");if(n.triggerPrice=a,this.has.createTriggerOrderWs)return await this.createOrderWs(e,t,i,s,r,n);throw new o.NotSupported(this.id+" createTriggerOrderWs() is not supported yet")}async createStopLossOrder(e,t,i,s,r=void 0,a=void 0,n={}){if(void 0===a)throw new o.ArgumentsRequired(this.id+" createStopLossOrder() requires a stopLossPrice argument");if(n.stopLossPrice=a,this.has.createStopLossOrder)return await this.createOrder(e,t,i,s,r,n);throw new o.NotSupported(this.id+" createStopLossOrder() is not supported yet")}async createStopLossOrderWs(e,t,i,s,r=void 0,a=void 0,n={}){if(void 0===a)throw new o.ArgumentsRequired(this.id+" createStopLossOrderWs() requires a stopLossPrice argument");if(n.stopLossPrice=a,this.has.createStopLossOrderWs)return await this.createOrderWs(e,t,i,s,r,n);throw new o.NotSupported(this.id+" createStopLossOrderWs() is not supported yet")}async createTakeProfitOrder(e,t,i,s,r=void 0,a=void 0,n={}){if(void 0===a)throw new o.ArgumentsRequired(this.id+" createTakeProfitOrder() requires a takeProfitPrice argument");if(n.takeProfitPrice=a,this.has.createTakeProfitOrder)return await this.createOrder(e,t,i,s,r,n);throw new o.NotSupported(this.id+" createTakeProfitOrder() is not supported yet")}async createTakeProfitOrderWs(e,t,i,s,r=void 0,a=void 0,n={}){if(void 0===a)throw new o.ArgumentsRequired(this.id+" createTakeProfitOrderWs() requires a takeProfitPrice argument");if(n.takeProfitPrice=a,this.has.createTakeProfitOrderWs)return await this.createOrderWs(e,t,i,s,r,n);throw new o.NotSupported(this.id+" createTakeProfitOrderWs() is not supported yet")}async createOrderWithTakeProfitAndStopLoss(e,t,i,s,r=void 0,a=void 0,n=void 0,d={}){if(d=this.setTakeProfitAndStopLossParams(e,t,i,s,r,a,n,d),this.has.createOrderWithTakeProfitAndStopLoss)return await this.createOrder(e,t,i,s,r,d);throw new o.NotSupported(this.id+" createOrderWithTakeProfitAndStopLoss() is not supported yet")}setTakeProfitAndStopLossParams(e,t,i,s,r=void 0,a=void 0,n=void 0,d={}){if(void 0===a&&void 0===n)throw new o.ArgumentsRequired(this.id+" createOrderWithTakeProfitAndStopLoss() requires either a takeProfit or stopLoss argument");void 0!==a&&(d.takeProfit={triggerPrice:a}),void 0!==n&&(d.stopLoss={triggerPrice:n});const h=this.safeString(d,"takeProfitType"),c=this.safeString(d,"takeProfitPriceType"),l=this.safeString(d,"takeProfitLimitPrice"),u=this.safeString(d,"takeProfitAmount"),f=this.safeString(d,"stopLossType"),p=this.safeString(d,"stopLossPriceType"),m=this.safeString(d,"stopLossLimitPrice"),g=this.safeString(d,"stopLossAmount");return void 0!==h&&(d.takeProfit.type=h),void 0!==c&&(d.takeProfit.priceType=c),void 0!==l&&(d.takeProfit.price=this.parseToNumeric(l)),void 0!==u&&(d.takeProfit.amount=this.parseToNumeric(u)),void 0!==f&&(d.stopLoss.type=f),void 0!==p&&(d.stopLoss.priceType=p),void 0!==m&&(d.stopLoss.price=this.parseToNumeric(m)),void 0!==g&&(d.stopLoss.amount=this.parseToNumeric(g)),d=this.omit(d,["takeProfitType","takeProfitPriceType","takeProfitLimitPrice","takeProfitAmount","stopLossType","stopLossPriceType","stopLossLimitPrice","stopLossAmount"])}async createOrderWithTakeProfitAndStopLossWs(e,t,i,s,r=void 0,a=void 0,n=void 0,d={}){if(d=this.setTakeProfitAndStopLossParams(e,t,i,s,r,a,n,d),this.has.createOrderWithTakeProfitAndStopLossWs)return await this.createOrderWs(e,t,i,s,r,d);throw new o.NotSupported(this.id+" createOrderWithTakeProfitAndStopLossWs() is not supported yet")}async createOrders(e,t={}){throw new o.NotSupported(this.id+" createOrders() is not supported yet")}async editOrders(e,t={}){throw new o.NotSupported(this.id+" editOrders() is not supported yet")}async createOrderWs(e,t,i,s,r=void 0,a={}){throw new o.NotSupported(this.id+" createOrderWs() is not supported yet")}async cancelOrder(e,t=void 0,i={}){throw new o.NotSupported(this.id+" cancelOrder() is not supported yet")}async cancelOrderWs(e,t=void 0,i={}){throw new o.NotSupported(this.id+" cancelOrderWs() is not supported yet")}async cancelOrdersWs(e,t=void 0,i={}){throw new o.NotSupported(this.id+" cancelOrdersWs() is not supported yet")}async cancelAllOrders(e=void 0,t={}){throw new o.NotSupported(this.id+" cancelAllOrders() is not supported yet")}async cancelAllOrdersAfter(e,t={}){throw new o.NotSupported(this.id+" cancelAllOrdersAfter() is not supported yet")}async cancelOrdersForSymbols(e,t={}){throw new o.NotSupported(this.id+" cancelOrdersForSymbols() is not supported yet")}async cancelAllOrdersWs(e=void 0,t={}){throw new o.NotSupported(this.id+" cancelAllOrdersWs() is not supported yet")}async cancelUnifiedOrder(e,t={}){return this.cancelOrder(this.safeString(e,"id"),this.safeString(e,"symbol"),t)}async fetchOrders(e=void 0,t=void 0,i=void 0,s={}){if(this.has.fetchOpenOrders&&this.has.fetchClosedOrders)throw new o.NotSupported(this.id+" fetchOrders() is not supported yet, consider using fetchOpenOrders() and fetchClosedOrders() instead");throw new o.NotSupported(this.id+" fetchOrders() is not supported yet")}async fetchOrdersWs(e=void 0,t=void 0,i=void 0,s={}){throw new o.NotSupported(this.id+" fetchOrdersWs() is not supported yet")}async fetchOrderTrades(e,t=void 0,i=void 0,s=void 0,r={}){throw new o.NotSupported(this.id+" fetchOrderTrades() is not supported yet")}async watchOrders(e=void 0,t=void 0,i=void 0,s={}){throw new o.NotSupported(this.id+" watchOrders() is not supported yet")}async fetchOpenOrders(e=void 0,t=void 0,i=void 0,s={}){if(this.has.fetchOrders){const r=await this.fetchOrders(e,t,i,s);return this.filterBy(r,"status","open")}throw new o.NotSupported(this.id+" fetchOpenOrders() is not supported yet")}async fetchOpenOrdersWs(e=void 0,t=void 0,i=void 0,s={}){if(this.has.fetchOrdersWs){const r=await this.fetchOrdersWs(e,t,i,s);return this.filterBy(r,"status","open")}throw new o.NotSupported(this.id+" fetchOpenOrdersWs() is not supported yet")}async fetchClosedOrders(e=void 0,t=void 0,i=void 0,s={}){if(this.has.fetchOrders){const r=await this.fetchOrders(e,t,i,s);return this.filterBy(r,"status","closed")}throw new o.NotSupported(this.id+" fetchClosedOrders() is not supported yet")}async fetchCanceledAndClosedOrders(e=void 0,t=void 0,i=void 0,s={}){throw new o.NotSupported(this.id+" fetchCanceledAndClosedOrders() is not supported yet")}async fetchClosedOrdersWs(e=void 0,t=void 0,i=void 0,s={}){if(this.has.fetchOrdersWs){const r=await this.fetchOrdersWs(e,t,i,s);return this.filterBy(r,"status","closed")}throw new o.NotSupported(this.id+" fetchClosedOrdersWs() is not supported yet")}async fetchMyTrades(e=void 0,t=void 0,i=void 0,s={}){throw new o.NotSupported(this.id+" fetchMyTrades() is not supported yet")}async fetchMyLiquidations(e=void 0,t=void 0,i=void 0,s={}){throw new o.NotSupported(this.id+" fetchMyLiquidations() is not supported yet")}async fetchLiquidations(e,t=void 0,i=void 0,s={}){throw new o.NotSupported(this.id+" fetchLiquidations() is not supported yet")}async fetchMyTradesWs(e=void 0,t=void 0,i=void 0,s={}){throw new o.NotSupported(this.id+" fetchMyTradesWs() is not supported yet")}async watchMyTrades(e=void 0,t=void 0,i=void 0,s={}){throw new o.NotSupported(this.id+" watchMyTrades() is not supported yet")}async fetchGreeks(e,t={}){throw new o.NotSupported(this.id+" fetchGreeks() is not supported yet")}async fetchAllGreeks(e=void 0,t={}){throw new o.NotSupported(this.id+" fetchAllGreeks() is not supported yet")}async fetchOptionChain(e,t={}){throw new o.NotSupported(this.id+" fetchOptionChain() is not supported yet")}async fetchOption(e,t={}){throw new o.NotSupported(this.id+" fetchOption() is not supported yet")}async fetchConvertQuote(e,t,i=void 0,s={}){throw new o.NotSupported(this.id+" fetchConvertQuote() is not supported yet")}async fetchDepositsWithdrawals(e=void 0,t=void 0,i=void 0,s={}){throw new o.NotSupported(this.id+" fetchDepositsWithdrawals() is not supported yet")}async fetchDeposits(e=void 0,t=void 0,i=void 0,s={}){throw new o.NotSupported(this.id+" fetchDeposits() is not supported yet")}async fetchWithdrawals(e=void 0,t=void 0,i=void 0,s={}){throw new o.NotSupported(this.id+" fetchWithdrawals() is not supported yet")}async fetchDepositsWs(e=void 0,t=void 0,i=void 0,s={}){throw new o.NotSupported(this.id+" fetchDepositsWs() is not supported yet")}async fetchWithdrawalsWs(e=void 0,t=void 0,i=void 0,s={}){throw new o.NotSupported(this.id+" fetchWithdrawalsWs() is not supported yet")}async fetchFundingRateHistory(e=void 0,t=void 0,i=void 0,s={}){throw new o.NotSupported(this.id+" fetchFundingRateHistory() is not supported yet")}async fetchFundingHistory(e=void 0,t=void 0,i=void 0,s={}){throw new o.NotSupported(this.id+" fetchFundingHistory() is not supported yet")}async closePosition(e,t=void 0,i={}){throw new o.NotSupported(this.id+" closePosition() is not supported yet")}async closeAllPositions(e={}){throw new o.NotSupported(this.id+" closeAllPositions() is not supported yet")}async fetchL3OrderBook(e,t=void 0,i={}){throw new o.BadRequest(this.id+" fetchL3OrderBook() is not supported yet")}parseLastPrice(e,t=void 0){throw new o.NotSupported(this.id+" parseLastPrice() is not supported yet")}async fetchDepositAddress(e,t={}){if(this.has.fetchDepositAddresses){const i=await this.fetchDepositAddresses([e],t),s=this.safeValue(i,e);if(void 0===s)throw new o.InvalidAddress(this.id+" fetchDepositAddress() could not find a deposit address for "+e+", make sure you have created a corresponding deposit address in your wallet on the exchange website");return s}if(this.has.fetchDepositAddressesByNetwork){const i=this.safeString(t,"network");t=this.omit(t,"network");const s=await this.fetchDepositAddressesByNetwork(e,t);if(void 0!==i)return this.safeDict(s,i);{const e=Object.keys(s),t=this.safeString(e,0);return this.safeDict(s,t)}}throw new o.NotSupported(this.id+" fetchDepositAddress() is not supported yet")}account(){return{free:void 0,used:void 0,total:void 0}}commonCurrencyCode(e){return this.substituteCommonCurrencyCodes?this.safeString(this.commonCurrencies,e,e):e}currency(e){if(void 0===this.currencies)throw new o.ExchangeError(this.id+" currencies not loaded");if("string"==typeof e){if(e in this.currencies)return this.currencies[e];if(e in this.currencies_by_id)return this.currencies_by_id[e]}throw new o.ExchangeError(this.id+" does not have currency code "+e)}market(e){if(void 0===this.markets)throw new o.ExchangeError(this.id+" markets not loaded");if(e in this.markets)return this.markets[e];if(e in this.markets_by_id){const t=this.markets_by_id[e],i=this.safeString2(this.options,"defaultType","defaultSubType","spot");for(let e=0;e0){let e="0.";for(let i=0;i0&&!this.inArray(t,s)){const t=s.join(", ");let r=this.id+" "+e+"() requires a "+i+" argument";throw""!==t&&(r+=", one of ("+t+")"),new o.ArgumentsRequired(r)}}checkRequiredMarginArgument(e,t,i){if("isolated"===i&&void 0===t)throw new o.ArgumentsRequired(this.id+" "+e+"() requires a symbol argument for isolated margin");if("cross"===i&&void 0!==t)throw new o.ArgumentsRequired(this.id+" "+e+"() cannot have a symbol argument for cross margin")}parseDepositWithdrawFees(e,t=void 0,i=void 0){const s={},r=Array.isArray(e);let a=e;r||(a=Object.keys(e));for(let o=0;o=g)break}}catch(e){if(m+=1,m>h)throw e}}let v=p;u&&(v=this.removeRepeatedElementsFromArray(p));const y="fetchOHLCV"===e?0:"timestamp";return this.filterBySinceLimit(v,i,s,y)}async safeDeterministicCall(e,t=void 0,i=void 0,s=void 0,r=void 0,a={}){let n;[n,a]=this.handleOptionAndParams(a,e,"maxRetries",3);let d=0;for(;d<=n;)try{return r&&"fetchFundingRateHistory"!==e?await this[e](t,r,i,s,a):await this[e](t,i,s,a)}catch(e){if(e instanceof o.RateLimitExceeded)throw e;if(d+=1,d>n)throw e}return[]}async fetchPaginatedCallDeterministic(e,t=void 0,i=void 0,s=void 0,r=void 0,a={},n=void 0){let d;[d,a]=this.handleOptionAndParams(a,e,"paginationCalls",10),[n,a]=this.handleMaxEntriesPerRequestAndParams(e,n,a);const h=this.milliseconds(),c=[],l=1e3*this.parseTimeframe(r)*n;let u=h-d*l-1;u=void 0!==i?Math.max(u,i):Math.max(u,1241440531e3);const f=this.safeInteger2(a,"until","till");if(void 0!==f){const e=Math.ceil((f-i)/l);if(e>d)throw new o.BadRequest(this.id+" the number of required calls is greater than the max number of calls allowed, either increase the paginationCalls or decrease the since-until gap. Current paginationCalls limit is "+d.toString()+" required calls is "+e.toString())}for(let i=0;i=f)&&!(u>=h);i++)c.push(this.safeDeterministicCall(e,t,u,n,r,a)),u=this.sum(u,l)-1;const p=await Promise.all(c);let m=[];for(let e=0;ec)throw e}u+=1}const g=this.sortCursorPaginatedResult(p),v="fetchOHLCV"===e?0:"timestamp";return this.filterBySinceLimit(g,i,s,v)}async fetchPaginatedCallIncremental(e,t=void 0,i=void 0,s=void 0,r={},a=void 0,o=void 0){let n,d;[n,r]=this.handleOptionAndParams(r,e,"paginationCalls",10),[d,r]=this.handleOptionAndParams(r,e,"maxRetries",3),[o,r]=this.handleMaxEntriesPerRequestAndParams(e,o,r);let h=0,c=0,l=[];for(;hd)throw e}h+=1}const u=this.sortCursorPaginatedResult(l),f="fetchOHLCV"===e?0:"timestamp";return this.filterBySinceLimit(u,i,s,f)}sortCursorPaginatedResult(e){const t=this.safeValue(e,0);if(void 0!==t){if("timestamp"in t)return this.sortBy(e,"timestamp",!0);if("id"in t)return this.sortBy(e,"id",!0)}return e}removeRepeatedElementsFromArray(e,t=!0){const i={},s=[];for(let r=0;r0?s:e}removeRepeatedTradesFromArray(e){const t={};for(let i=0;i0)for(let e=0;e{i.d(t,{A:()=>n,Y:()=>o});const s=BigInt(0),r=BigInt(-1),a=BigInt(10);class o{constructor(e,t=void 0){if(this.base=void 0,void 0===t){let t=0;if((e=e.toLowerCase()).indexOf("e")>-1){let i="0";[e,i]=e.split("e"),t=parseInt(i)}const i=e.indexOf(".");this.decimals=i>-1?e.length-i-1:0;const s=e.replace(".","");this.integer=BigInt(s),this.decimals=this.decimals-t}else this.integer=e,this.decimals=t}mul(e){const t=this.integer*e.integer;return new o(t,this.decimals+e.decimals)}div(e,t=18){const i=t-this.decimals+e.decimals;let s;if(0===i)s=this.integer;else if(i<0){const e=a**BigInt(-i);s=this.integer/e}else{const e=a**BigInt(i);s=this.integer*e}const r=s/e.integer;return new o(r,t)}add(e){if(this.decimals===e.decimals){const t=this.integer+e.integer;return new o(t,this.decimals)}{const[t,i]=this.decimals>e.decimals?[e,this]:[this,e],s=i.decimals-t.decimals,r=t.integer*a**BigInt(s)+i.integer;return new o(r,i.decimals)}}mod(e){const t=Math.max(-this.decimals+e.decimals,0),i=this.integer*a**BigInt(t),s=Math.max(-e.decimals+this.decimals,0),r=e.integer*a**BigInt(s);return new o(i%r,s+e.decimals)}sub(e){const t=new o(-e.integer,e.decimals);return this.add(t)}abs(){return new o(this.integer<0?this.integer*r:this.integer,this.decimals)}neg(){return new o(-this.integer,this.decimals)}or(e){const t=this.integer|e.integer;return new o(t,this.decimals)}min(e){return this.lt(e)?this:e}max(e){return this.gt(e)?this:e}gt(e){return this.sub(e).integer>0}ge(e){return this.sub(e).integer>=0}lt(e){return e.gt(this)}le(e){return e.ge(this)}reduce(){const e=this.integer.toString(),t=e.length-1;if(0===t)return"0"===e&&(this.decimals=0),this;let i;for(i=t;i>=0&&"0"===e.charAt(i);i--);const s=t-i;if(0===s)return this;this.decimals-=s,this.integer=BigInt(e.slice(0,i+1))}equals(e){return this.reduce(),e.reduce(),this.decimals===e.decimals&&this.integer===e.integer}toString(){let e,t;this.reduce(),this.integer<0?(e="-",t=-this.integer):(e="",t=this.integer);const i=Array.from(t.toString(Number(a)).padStart(this.decimals,"0")),s=i.length-this.decimals;let r;return r=0===s?"0.":this.decimals<0?"0".repeat(-this.decimals):0===this.decimals?"":".",i.splice(s,0,r),e+i.join("")}static stringMul(e,t){if(void 0!==e&&void 0!==t)return new o(e).mul(new o(t)).toString()}static stringDiv(e,t,i=18){if(void 0===e||void 0===t)return;const r=new o(t);return r.integer!==s?new o(e).div(r,i).toString():void 0}static stringAdd(e,t){if(void 0!==e||void 0!==t)return void 0===e?t:void 0===t?e:new o(e).add(new o(t)).toString()}static stringSub(e,t){if(void 0!==e&&void 0!==t)return new o(e).sub(new o(t)).toString()}static stringAbs(e){if(void 0!==e)return new o(e).abs().toString()}static stringNeg(e){if(void 0!==e)return new o(e).neg().toString()}static stringMod(e,t){if(void 0!==e&&void 0!==t)return new o(e).mod(new o(t)).toString()}static stringOr(e,t){if(void 0!==e&&void 0!==t)return new o(e).or(new o(t)).toString()}static stringEquals(e,t){if(void 0!==e&&void 0!==t)return new o(e).equals(new o(t))}static stringEq(e,t){if(void 0!==e&&void 0!==t)return new o(e).equals(new o(t))}static stringMin(e,t){if(void 0!==e&&void 0!==t)return new o(e).min(new o(t)).toString()}static stringMax(e,t){if(void 0!==e&&void 0!==t)return new o(e).max(new o(t)).toString()}static stringGt(e,t){if(void 0!==e&&void 0!==t)return new o(e).gt(new o(t))}static stringGe(e,t){if(void 0!==e&&void 0!==t)return new o(e).ge(new o(t))}static stringLt(e,t){if(void 0!==e&&void 0!==t)return new o(e).lt(new o(t))}static stringLe(e,t){if(void 0!==e&&void 0!==t)return new o(e).le(new o(t))}}const n=o},2079:(e,t,i)=>{i.r(t),i.d(t,{AccountNotEnabled:()=>n,AccountSuspended:()=>d,AddressPending:()=>b,ArgumentsRequired:()=>h,AuthenticationError:()=>a,BadRequest:()=>c,BadResponse:()=>F,BadSymbol:()=>l,BaseError:()=>s,CancelPending:()=>G,ChecksumError:()=>q,ContractUnavailable:()=>I,DDoSProtection:()=>E,DuplicateOrderId:()=>M,ExchangeClosedByUser:()=>_,ExchangeError:()=>r,ExchangeNotAvailable:()=>R,InsufficientFunds:()=>y,InvalidAddress:()=>w,InvalidNonce:()=>D,InvalidOrder:()=>k,InvalidProxySettings:()=>A,ManualInteractionNeeded:()=>g,MarginModeAlreadySet:()=>p,MarketClosed:()=>m,NetworkError:()=>B,NoChange:()=>f,NotSupported:()=>x,NullResponse:()=>H,OnMaintenance:()=>N,OperationFailed:()=>C,OperationRejected:()=>u,OrderImmediatelyFillable:()=>T,OrderNotCached:()=>O,OrderNotFillable:()=>P,OrderNotFound:()=>S,PermissionDenied:()=>o,RateLimitExceeded:()=>L,RequestTimeout:()=>V,RestrictedLocation:()=>v,UnsubscribeError:()=>U,default:()=>W});class s extends Error{constructor(e){super(e),this.name="BaseError"}}class r extends s{constructor(e){super(e),this.name="ExchangeError"}}class a extends r{constructor(e){super(e),this.name="AuthenticationError"}}class o extends a{constructor(e){super(e),this.name="PermissionDenied"}}class n extends o{constructor(e){super(e),this.name="AccountNotEnabled"}}class d extends a{constructor(e){super(e),this.name="AccountSuspended"}}class h extends r{constructor(e){super(e),this.name="ArgumentsRequired"}}class c extends r{constructor(e){super(e),this.name="BadRequest"}}class l extends c{constructor(e){super(e),this.name="BadSymbol"}}class u extends r{constructor(e){super(e),this.name="OperationRejected"}}class f extends u{constructor(e){super(e),this.name="NoChange"}}class p extends f{constructor(e){super(e),this.name="MarginModeAlreadySet"}}class m extends u{constructor(e){super(e),this.name="MarketClosed"}}class g extends u{constructor(e){super(e),this.name="ManualInteractionNeeded"}}class v extends u{constructor(e){super(e),this.name="RestrictedLocation"}}class y extends r{constructor(e){super(e),this.name="InsufficientFunds"}}class w extends r{constructor(e){super(e),this.name="InvalidAddress"}}class b extends w{constructor(e){super(e),this.name="AddressPending"}}class k extends r{constructor(e){super(e),this.name="InvalidOrder"}}class S extends k{constructor(e){super(e),this.name="OrderNotFound"}}class O extends k{constructor(e){super(e),this.name="OrderNotCached"}}class T extends k{constructor(e){super(e),this.name="OrderImmediatelyFillable"}}class P extends k{constructor(e){super(e),this.name="OrderNotFillable"}}class M extends k{constructor(e){super(e),this.name="DuplicateOrderId"}}class I extends k{constructor(e){super(e),this.name="ContractUnavailable"}}class x extends r{constructor(e){super(e),this.name="NotSupported"}}class A extends r{constructor(e){super(e),this.name="InvalidProxySettings"}}class _ extends r{constructor(e){super(e),this.name="ExchangeClosedByUser"}}class C extends s{constructor(e){super(e),this.name="OperationFailed"}}class B extends C{constructor(e){super(e),this.name="NetworkError"}}class E extends B{constructor(e){super(e),this.name="DDoSProtection"}}class L extends B{constructor(e){super(e),this.name="RateLimitExceeded"}}class R extends B{constructor(e){super(e),this.name="ExchangeNotAvailable"}}class N extends R{constructor(e){super(e),this.name="OnMaintenance"}}class D extends B{constructor(e){super(e),this.name="InvalidNonce"}}class q extends D{constructor(e){super(e),this.name="ChecksumError"}}class V extends B{constructor(e){super(e),this.name="RequestTimeout"}}class F extends C{constructor(e){super(e),this.name="BadResponse"}}class H extends F{constructor(e){super(e),this.name="NullResponse"}}class G extends C{constructor(e){super(e),this.name="CancelPending"}}class U extends s{constructor(e){super(e),this.name="UnsubscribeError"}}const W={BaseError:s,ExchangeError:r,AuthenticationError:a,PermissionDenied:o,AccountNotEnabled:n,AccountSuspended:d,ArgumentsRequired:h,BadRequest:c,BadSymbol:l,OperationRejected:u,NoChange:f,MarginModeAlreadySet:p,MarketClosed:m,ManualInteractionNeeded:g,RestrictedLocation:v,InsufficientFunds:y,InvalidAddress:w,AddressPending:b,InvalidOrder:k,OrderNotFound:S,OrderNotCached:O,OrderImmediatelyFillable:T,OrderNotFillable:P,DuplicateOrderId:M,ContractUnavailable:I,NotSupported:x,InvalidProxySettings:A,ExchangeClosedByUser:_,OperationFailed:C,NetworkError:B,DDoSProtection:E,RateLimitExceeded:L,ExchangeNotAvailable:R,OnMaintenance:N,InvalidNonce:D,ChecksumError:q,RequestTimeout:V,BadResponse:F,NullResponse:H,CancelPending:G,UnsubscribeError:U}},5095:(e,t,i)=>{i.r(t),i.d(t,{DECIMAL_PLACES:()=>n.fv,NO_PADDING:()=>n.w1,PAD_WITH_ZERO:()=>n.ex,ROUND:()=>n.D_,ROUND_DOWN:()=>n._g,ROUND_UP:()=>n.Tz,SIGNIFICANT_DIGITS:()=>n.v,TICK_SIZE:()=>n.kb,TRUNCATE:()=>n.R3,Throttler:()=>l.x,TimedOut:()=>c.GA,aggregate:()=>u.QD,arrayConcat:()=>r.ax,asFloat:()=>o.Pf,asInteger:()=>o.JU,axolotl:()=>h.Sw,base16ToBinary:()=>d.FF,base58ToBinary:()=>d.Ry,base64ToBinary:()=>d.cg,base64ToString:()=>d.QM,binaryConcat:()=>d.qo,binaryConcatArray:()=>d.Vw,binaryToBase16:()=>d.t7,binaryToBase58:()=>d.bj,binaryToBase64:()=>d.sQ,binaryToString:()=>d.kn,capitalize:()=>a.ZH,clone:()=>r.o8,crc32:()=>h.QR,decimalToPrecision:()=>n.fq,decode:()=>d.D4,deepExtend:()=>r.zw,ecdsa:()=>h.h1,eddsa:()=>h.q4,encode:()=>d.lF,extend:()=>r.X$,extractParams:()=>u.um,filterBy:()=>r.WP,flatten:()=>r.Bq,groupBy:()=>r.$z,hasProps:()=>o.dl,hash:()=>h.tW,hmac:()=>h.w8,implodeParams:()=>u.Hp,inArray:()=>r.RV,index:()=>r.Pe,indexBy:()=>r.wQ,isArray:()=>o.cy,isBrowser:()=>s.Bd,isDeno:()=>s.N6,isDictionary:()=>o.Hf,isElectron:()=>s.b8,isEmpty:()=>r.Im,isInteger:()=>o.Fq,isJsonEncodedObject:()=>d.mC,isNode:()=>s.Ll,isNumber:()=>o.Et,isObject:()=>o.Gv,isString:()=>o.Kg,isStringCoercible:()=>o.KL,isWebWorker:()=>s.p7,isWindows:()=>s.uF,iso8601:()=>c.LC,json:()=>d.Pq,keys:()=>r.HP,keysort:()=>r.CA,mdy:()=>c.rE,merge:()=>r.h1,microseconds:()=>c.EZ,milliseconds:()=>c.Rz,now:()=>c.tB,numberToBE:()=>d.qE,numberToLE:()=>d.aN,numberToString:()=>n.um,omit:()=>r.cJ,omitZero:()=>n.Ye,ordered:()=>r.Sj,packb:()=>d.Am,parse8601:()=>c.Dj,parseDate:()=>c._U,parseTimeframe:()=>u.ce,pluck:()=>r.Ey,precisionConstants:()=>n.S2,precisionFromString:()=>n.Iu,prop:()=>o._w,rawencode:()=>d.rO,rfc2616:()=>c.D9,roundTimeframe:()=>u.jG,safeFloat:()=>o.w,safeFloat2:()=>o.Cw,safeFloatN:()=>o.Q7,safeInteger:()=>o.Y2,safeInteger2:()=>o.mU,safeIntegerN:()=>o.At,safeIntegerProduct:()=>o.lu,safeIntegerProduct2:()=>o.J0,safeIntegerProductN:()=>o.hO,safeString:()=>o.nr,safeString2:()=>o.d0,safeStringLower:()=>o.gw,safeStringLower2:()=>o.uS,safeStringLowerN:()=>o.I9,safeStringN:()=>o.Rc,safeStringUpper:()=>o.RH,safeStringUpper2:()=>o.F7,safeStringUpperN:()=>o.fu,safeTimestamp:()=>o.q0,safeTimestamp2:()=>o.ww,safeTimestampN:()=>o.Y_,safeValue:()=>o.pI,safeValue2:()=>o.Dj,safeValueN:()=>o.DR,seconds:()=>c.YA,selfIsDefined:()=>u.Se,setTimeout_safe:()=>c.k4,sleep:()=>c.yy,sort:()=>r.di,sortBy:()=>r.Ul,sortBy2:()=>r.sy,stringToBase64:()=>d.q3,stringToBinary:()=>d.wN,strip:()=>a.bB,sum:()=>r.cz,timeout:()=>c.wR,toArray:()=>r.$r,truncate:()=>n.xv,truncate_to_string:()=>n.NZ,unCamelCase:()=>a.Qd,unique:()=>r.Am,urlencode:()=>d.mu,urlencodeBase64:()=>d.LI,urlencodeNested:()=>d.Dy,urlencodeWithArrayRepeat:()=>d.ev,uuid:()=>a.uR,uuid16:()=>a.tg,uuid22:()=>a._n,uuidv1:()=>c.nm,values:()=>r.zu,vwap:()=>u.ru,ymd:()=>c.Th,ymdhms:()=>c.RR,yymmdd:()=>c.x_,yyyymmdd:()=>c.Rn});var s=i(7597),r=i(7437),a=i(3503),o=i(6834),n=i(1579),d=i(9560),h=i(8283),c=i(8403),l=i(7618),u=i(6238)},8283:(e,t,i)=>{i.d(t,{QR:()=>v,Sw:()=>m,h1:()=>p,q4:()=>g,tW:()=>u,w8:()=>f});var s=i(712),r=i(4710),a=i(5268),o=i(890),n=i(987),d=i(8342),h=i(191);const c={binary:e=>e,hex:r.xn.encode,base64:r.K3.encode},l={"1.3.132.0.10":n.bI,"1.2.840.10045.3.1.7":d.Qj},u=(e,t,i="hex")=>{const s=t(e);return c[i](s)},f=(e,t,i,r="hex")=>{const a=(0,s.w)(i,t,e);return c[r](a)};function p(e,t,i,s=null,r=!1){if(s&&(e=u(e,s,"hex")),"string"==typeof t&&t.length>64){if(!t.startsWith("-----BEGIN EC PRIVATE KEY-----"))throw new Error("Unsupported key format");{const e=a.o.unarmor(t);let s=o.Ge.decode(e);if(4!==s.sub.length)throw new Error("Unsupported key format");if(null!==typeof s.sub[2].sub&&s.sub[2].sub.length>0){const e=s.sub[2].sub[0].content(void 0);if(void 0===l[e])throw new Error("Unsupported curve");i=l[e]}t=s.sub[1].getHexStringValue()}}let n=i.sign(e,t,{lowS:!0});const d=(BigInt(1)<c||n.r<=d||n.s<=d);)n=i.sign(e,t,{lowS:!0,extraEntropy:(0,h.z)(BigInt(f),32)}),f+=1;return{r:n.r.toString(16),s:n.s.toString(16),v:n.recovery}}function m(e,t,i){const s=i.signModified(e,t);return r.tw.encode(s)}function g(e,t,i){let s;32===t.length?s=t:"string"==typeof t&&(s=new Uint8Array(a.o.unarmor(t).slice(16)));const o=i.sign(e,s);return r.K3.encode(o)}function v(e,t=!1){void 0===v.table&&(v.table="00000000 77073096 EE0E612C 990951BA 076DC419 706AF48F E963A535 9E6495A3 0EDB8832 79DCB8A4 E0D5E91E 97D2D988 09B64C2B 7EB17CBD E7B82D07 90BF1D91 1DB71064 6AB020F2 F3B97148 84BE41DE 1ADAD47D 6DDDE4EB F4D4B551 83D385C7 136C9856 646BA8C0 FD62F97A 8A65C9EC 14015C4F 63066CD9 FA0F3D63 8D080DF5 3B6E20C8 4C69105E D56041E4 A2677172 3C03E4D1 4B04D447 D20D85FD A50AB56B 35B5A8FA 42B2986C DBBBC9D6 ACBCF940 32D86CE3 45DF5C75 DCD60DCF ABD13D59 26D930AC 51DE003A C8D75180 BFD06116 21B4F4B5 56B3C423 CFBA9599 B8BDA50F 2802B89E 5F058808 C60CD9B2 B10BE924 2F6F7C87 58684C11 C1611DAB B6662D3D 76DC4190 01DB7106 98D220BC EFD5102A 71B18589 06B6B51F 9FBFE4A5 E8B8D433 7807C9A2 0F00F934 9609A88E E10E9818 7F6A0DBB 086D3D2D 91646C97 E6635C01 6B6B51F4 1C6C6162 856530D8 F262004E 6C0695ED 1B01A57B 8208F4C1 F50FC457 65B0D9C6 12B7E950 8BBEB8EA FCB9887C 62DD1DDF 15DA2D49 8CD37CF3 FBD44C65 4DB26158 3AB551CE A3BC0074 D4BB30E2 4ADFA541 3DD895D7 A4D1C46D D3D6F4FB 4369E96A 346ED9FC AD678846 DA60B8D0 44042D73 33031DE5 AA0A4C5F DD0D7CC9 5005713C 270241AA BE0B1010 C90C2086 5768B525 206F85B3 B966D409 CE61E49F 5EDEF90E 29D9C998 B0D09822 C7D7A8B4 59B33D17 2EB40D81 B7BD5C3B C0BA6CAD EDB88320 9ABFB3B6 03B6E20C 74B1D29A EAD54739 9DD277AF 04DB2615 73DC1683 E3630B12 94643B84 0D6D6A3E 7A6A5AA8 E40ECF0B 9309FF9D 0A00AE27 7D079EB1 F00F9344 8708A3D2 1E01F268 6906C2FE F762575D 806567CB 196C3671 6E6B06E7 FED41B76 89D32BE0 10DA7A5A 67DD4ACC F9B9DF6F 8EBEEFF9 17B7BE43 60B08ED5 D6D6A3E8 A1D1937E 38D8C2C4 4FDFF252 D1BB67F1 A6BC5767 3FB506DD 48B2364B D80D2BDA AF0A1B4C 36034AF6 41047A60 DF60EFC3 A867DF55 316E8EEF 4669BE79 CB61B38C BC66831A 256FD2A0 5268E236 CC0C7795 BB0B4703 220216B9 5505262F C5BA3BBE B2BD0B28 2BB45A92 5CB36A04 C2D7FFA7 B5D0CF31 2CD99E8B 5BDEAE1D 9B64C2B0 EC63F226 756AA39C 026D930A 9C0906A9 EB0E363F 72076785 05005713 95BF4A82 E2B87A14 7BB12BAE 0CB61B38 92D28E9B E5D5BE0D 7CDCEFB7 0BDBDF21 86D3D2D4 F1D4E242 68DDB3F8 1FDA836E 81BE16CD F6B9265B 6FB077E1 18B74777 88085AE6 FF0F6A70 66063BCA 11010B5C 8F659EFF F862AE69 616BFFD3 166CCF45 A00AE278 D70DD2EE 4E048354 3903B3C2 A7672661 D06016F7 4969474D 3E6E77DB AED16A4A D9D65ADC 40DF0B66 37D83BF0 A9BCAE53 DEBB9EC5 47B2CF7F 30B5FFE9 BDBDF21C CABAC28A 53B39330 24B4A3A6 BAD03605 CDD70693 54DE5729 23D967BF B3667A2E C4614AB8 5D681B02 2A6F2B94 B40BBE37 C30C8EA1 5A05DF1B 2D02EF8D".split(" ").map((e=>parseInt(e,16))));let i=-1;for(let t=0;t>>8^v.table[255&(i^e.charCodeAt(t))];const s=~i>>>0;return t&&s>=2147483648?s-4294967296:s}},9560:(e,t,i)=>{i.d(t,{Am:()=>C,D4:()=>I,Dy:()=>O,FF:()=>g,LI:()=>x,Pq:()=>d,QM:()=>f,Ry:()=>y,Vw:()=>k,aN:()=>A,bj:()=>w,cg:()=>p,ev:()=>T,kn:()=>c,lF:()=>M,mC:()=>h,mu:()=>S,q3:()=>u,qE:()=>_,qo:()=>b,rO:()=>P,sQ:()=>m,t7:()=>v,wN:()=>l});var s=i(4710),r=i(191),a=i(917),o=i(4580),n=i.n(o);const d=(e,t=void 0)=>JSON.stringify(e),h=e=>"string"==typeof e&&e.length>=2&&("{"===e[0]||"["===e[0]),c=s.As.encode,l=s.As.decode,u=e=>s.K3.encode(s.As.decode(e)),f=e=>s.As.encode(s.K3.decode(e)),p=s.K3.decode,m=s.K3.encode,g=s.xn.decode,v=s.xn.encode,y=s.tw.decode,w=s.tw.encode,b=r.Id,k=e=>(0,r.Id)(...e),S=(e,t=!1)=>n().stringify(e),O=e=>n().stringify(e),T=e=>n().stringify(e,{arrayFormat:"repeat"}),P=(e,t=!1)=>n().stringify(e,{encode:!1}),M=s.As.decode,I=s.As.encode,x=e=>("string"==typeof e?u(e):m(e)).replace(/[=]+$/,"").replace(/\+/g,"-").replace(/\//g,"_"),A=(e,t)=>(0,r.z)(BigInt(e),t),_=(e,t)=>(0,r.lq)(BigInt(e),t);function C(e){return(0,a.l)(e)}},7437:(e,t,i)=>{i.d(t,{$r:()=>f,$z:()=>v,Am:()=>c,Bq:()=>S,CA:()=>m,Ey:()=>O,HP:()=>r,Im:()=>p,Pe:()=>o,RV:()=>u,Sj:()=>h,Ul:()=>b,WP:()=>w,X$:()=>n,ax:()=>l,cJ:()=>T,cz:()=>P,di:()=>g,h1:()=>I,o8:()=>d,sy:()=>k,wQ:()=>y,zu:()=>a,zw:()=>M});var s=i(6834);const r=Object.keys,a=e=>(0,s.cy)(e)?e:Object.values(e),o=e=>new Set(a(e)),n=(...e)=>Object.assign({},...e),d=e=>(0,s.cy)(e)?Array.from(e):n(e),h=e=>e,c=e=>Array.from(o(e)),l=(e,t)=>e.concat(t),u=(e,t)=>t.includes(e),f=e=>Object.values(e),p=e=>!e||(Array.isArray(e)?e:Object.keys(e)).length<1,m=(e,t={})=>{for(const i of r(e).sort())t[i]=e[i];return t},g=e=>{const t=e.slice();return t.sort(),t},v=(e,t,i={})=>{for(const s of a(e))if(t in s){const e=s[t];i[e]=i[e]||[],i[e].push(s)}return i},y=(e,t,i={})=>{for(const s of a(e))t in s&&(i[s[t]]=s);return i},w=(e,t,i=void 0,s=[])=>{for(const r of a(e))r[t]===i&&s.push(r);return s},b=(e,t,i=!1,s=0,r=(i?-1:1))=>e.sort(((e,i)=>{const a=t in e?e[t]:s,o=t in i?i[t]:s;return ao?r:0})),k=(e,t,i,s=!1,r=(s?-1:1))=>e.sort(((e,s)=>e[t]s[t]?r:e[i]s[i]?r:0)),S=function e(t,i=[]){for(const r of t)(0,s.cy)(r)?e(r,i):i.push(r);return i},O=(e,t)=>a(e).filter((e=>t in e)).map((e=>e[t])),T=(e,...t)=>{if(!Array.isArray(e)){const i=d(e);for(const e of t)if((0,s.cy)(e))for(const t of e)delete i[t];else delete i[e];return i}return e},P=(...e)=>{const t=e.filter(s.Et);return t.length>0?t.reduce(((e,t)=>e+t),0):void 0},M=function e(...t){let i;for(const r of t)if((0,s.Hf)(r)){(0,s.Hf)(i)||(i={});for(const t in r)i[t]=e(i[t],r[t])}else i=r;return i},I=(e,...t)=>{const i={},s=Object.assign({},...t),r=Object.keys(s);for(let t=0;t{i.d(t,{Hp:()=>h,QD:()=>l,Se:()=>u,ce:()=>o,jG:()=>n,ru:()=>c,um:()=>d});var s=i(1579),r=i(6834),a=i(2079);const o=e=>{const t=(0,r.Pf)(e.slice(0,-1)),i=e.slice(-1);let s;if("y"===i)s=31536e3;else if("M"===i)s=2592e3;else if("w"===i)s=604800;else if("d"===i)s=86400;else if("h"===i)s=3600;else if("m"===i)s=60;else{if("s"!==i)throw new a.NotSupported("timeframe unit "+i+" is not supported");s=1}return t*s},n=(e,t,i=s._g)=>{const r=1e3*o(e);return t-t%r+(i===s.Tz?r:0)},d=e=>{const t=/{([\w-]+)}/g,i=[];let s=t.exec(e);for(;s;)i.push(s[1]),s=t.exec(e);return i},h=(e,t)=>{if(!Array.isArray(t)){const i=Object.keys(t);for(let s=0;s0?t/e:void 0}function l(e){const t={};for(let i=0;i0&&(t[s]=(t[s]||0)+r)}return Object.keys(t).map((e=>[parseFloat(e),parseFloat(t[e])]))}function u(){let e=!1;try{e=void 0!==self}catch(t){e=!1}return e}},1579:(e,t,i)=>{i.d(t,{D_:()=>r,Iu:()=>y,NZ:()=>g,R3:()=>s,S2:()=>u,Tz:()=>a,Ye:()=>k,_g:()=>o,ex:()=>l,fq:()=>w,fv:()=>n,kb:()=>h,um:()=>p,v:()=>d,w1:()=>c,xv:()=>v});const s=0,r=1,a=2,o=3,n=2,d=3,h=4,c=5,l=6,u={ROUND:r,TRUNCATE:s,ROUND_UP:a,ROUND_DOWN:o,DECIMAL_PLACES:n,SIGNIFICANT_DIGITS:d,TICK_SIZE:h,NO_PADDING:c,PAD_WITH_ZERO:l},f=(e,t)=>{if(!e)throw new Error(t||"assertion failed")};function p(e){if(void 0===e)return;if("number"!=typeof e)return e.toString();const t=e.toString();if(Math.abs(e)<1){const i=t.split("e-"),s=i[0].replace(".",""),r=parseInt(i[1]),a="-"===t[0];if(r)return e=(a?"-":"")+"0."+new Array(r).join("0")+s.substring(a)}else{const e=t.split("e");if(e[1]){let t=parseInt(e[1]);const i=e[0].split(".");let s="";return i[1]&&(t-=i[1].length,s=i[1]),i[0]+s+new Array(t+1).join("0")}}return t}const m=[],g=(e,t=0)=>{if(e=p(e),t>0){const i=m[t]||(m[t]=new RegExp("([-]*\\d+\\.\\d{"+t+"})(\\d)")),[,s]=e.toString().match(i)||[null,e];return s.toString()}return parseInt(e).toString()},v=(e,t=0)=>parseFloat(g(e,t));function y(e){if(e.indexOf("e")>-1||e.indexOf("E")>-1){const t=e.replace(/\d\.?\d*[eE]/,"");return-1*parseInt(t)}const t=e.replace(/0+$/g,"").split(".");return t.length>1?t[1].length:0}const w=(e,t,i,s=n,r=c)=>b(e,t,i,s,r),b=(e,t,i,a=n,o=c)=>{if(f(void 0!==i,"numPrecisionDigits should not be undefined"),"string"==typeof i&&(i=parseFloat(i)),f(Number.isFinite(i),"numPrecisionDigits has an invalid number"),a===h?f(i>0,"negative or zero numPrecisionDigits can not be used with TICK_SIZE precisionMode"):f(Number.isInteger(i),"numPrecisionDigits must be an integer with DECIMAL_PLACES or SIGNIFICANT_DIGITS precisionMode"),f(t===r||t===s,"invalid roundingMode provided"),f(a===n||a===d||a===h,"invalid countingMode provided"),f(o===c||o===l,"invalid paddingMode provided"),i<0){const n=Math.pow(10,-i);if(t===r)return(n*b(e/n,t,0,a,o)).toString();if(t===s)return(e-e%n).toString()}if(a===h){const a=y(b(i,r,22,n,c));if(t===s){const t=p(e),s=g(t,Math.max(0,a)),d=Number(s),h=Math.pow(10,a),l=Math.round(d*h),u=Math.round(i*h);return e=Math.trunc(l/u)*u/h,o===c?String(Number(e.toFixed(a))):b(e,r,a,n,o)}let d=e%i;d=Number(b(d,r,8,n,c));return 0!==y(b(d/i,r,Math.max(a,8),n,c))&&t===r&&(e>0?d>=i/2?e=e-d+i:e-=d:e=d>=i/2?Number(e)-d:Number(e)-d-i),b(e,r,a,n,o)}const u=p(e),m="-"===u[0],v=m?1:0,w=u.length;for(var k=0;k57)throw new Error(`${u}: invalid number (contains an illegal character '${u[x-1]}')`);T[x]=e,e!==O&&M<0&&(M=x)}}M<0&&(M=1);let _=a===n?P:M,C=_+i;I=-1;let B=!0,E=m;for(let e=T.length-1,s=0;e>=0;e--){let a=T[e];if(0!==e){if(a+=s,e>=_+i){a=t===r&&a>=53&&!(53===a&&s)?58:O}a>57?(a=O,s=1):s=0}else s&&(a=49);T[e]=a,a!==O&&(B=!1,M=e,I=I<0?e+1:I)}a===d&&(_=M,C=_+i),B&&(E=!1);const L=M>=P||B?P-1:M,R=I{i.d(t,{Bd:()=>s,Ll:()=>d,N6:()=>n,b8:()=>r,p7:()=>a,uF:()=>o});const s="undefined"!=typeof window,r="undefined"!=typeof process&&void 0!==process.versions&&void 0!==process.versions.electron,a="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,o="undefined"!=typeof process&&"win32"===process.platform,n="undefined"!=typeof Deno,d=!(s||a||n)},5354:(e,t,i)=>{i.d(t,{a:()=>h,n:()=>d});var s=i(5944),r=i(4710),a=i(9560),o=i(8283),n=i(8342);function d(e,t,i){const a=new s.v;a.setPrivateKey(t);const o=i.create().constructor.name.toLowerCase();return a.sign(e,(e=>r.xn.encode(i(e))),o)}function h(e,t,i,s=!1,h={}){let c=(s?"RS":"HS")+8*i.outputLen;h.alg&&(c=h.alg.toUpperCase());const l=Object.assign({alg:c,typ:"JWT"},h);void 0!==l.iat&&(e.iat=l.iat,delete l.iat);const u=[(0,a.LI)(JSON.stringify(l)),(0,a.LI)(JSON.stringify(e))].join("."),f=c.slice(0,2);let p;if("HS"===f)p=(0,a.LI)((0,o.w8)(u,t,i,"binary"));else if(s||"RS"===f)p=(0,a.LI)((0,a.cg)(d(u,r.As.encode(t),i)));else if("ES"===f){const e=(0,o.h1)(u,r.As.encode(t),n.Qj,i),s=e.r.padStart(64,"0"),d=e.s.padStart(64,"0");p=(0,a.LI)((0,a.FF)(s+d))}return[u,p].join(".")}},3503:(e,t,i)=>{i.d(t,{Qd:()=>s,ZH:()=>r,_n:()=>d,bB:()=>a,tg:()=>n,uR:()=>o});const s=e=>{const t={fetchOHLCVWs:"fetch_ohlcv_ws"};return t[e]?t[e]:e.match(/[A-Z]/)?e.replace(/[a-z0-9][A-Z]/g,(e=>e[0]+"_"+e[1])).replace(/[A-Z0-9][A-Z0-9][a-z][^$]/g,(e=>e[0]+"_"+e[1]+e[2]+e[3])).replace(/[a-z][0-9]$/g,(e=>e[0]+"_"+e[1])).toLowerCase():e},r=e=>e.length?e.charAt(0).toUpperCase()+e.slice(1):e,a=e=>e.replace(/^\s+|\s+$/g,""),o=e=>e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,o),n=e=>e?(e^16*Math.random()>>e/4).toString(16):([1e5]+100+400+8e3).replace(/[018]/g,n),d=e=>e?(e^16*Math.random()>>e/4).toString(16):([1e7]+1e3+4e3+8e5).replace(/[018]/g,d)},7618:(e,t,i)=>{i.d(t,{x:()=>r});var s=i(8403);class r{constructor(e){this.config={refillRate:1,delay:.001,capacity:1,maxCapacity:2e3,tokens:0,cost:1},Object.assign(this.config,e),this.queue=[],this.running=!1}async loop(){let e=(0,s.tB)();for(;this.running;){const{resolver:t,cost:i}=this.queue[0];if(this.config.tokens>=0)this.config.tokens-=i,t(),this.queue.shift(),await Promise.resolve(),0===this.queue.length&&(this.running=!1);else{await(0,s.yy)(1e3*this.config.delay);const t=(0,s.tB)(),i=t-e;e=t;const r=this.config.tokens+this.config.refillRate*i;this.config.tokens=Math.min(r,this.config.capacity)}}}throttle(e=void 0){let t;const i=new Promise(((e,i)=>{t=e}));if(this.queue.length>this.config.maxCapacity)throw new Error("throttle queue is over maxCapacity ("+this.config.maxCapacity.toString()+"), see https://github.com/ccxt/ccxt/issues/11645#issuecomment-1195695526");return e=void 0===e?this.config.cost:e,this.queue.push({resolver:t,cost:e}),this.running||(this.running=!0,this.loop()),i}}},8403:(e,t,i)=>{i.d(t,{D9:()=>p,Dj:()=>u,EZ:()=>r,GA:()=>c,LC:()=>l,RR:()=>w,Rn:()=>y,Rz:()=>a,Th:()=>g,YA:()=>o,_U:()=>f,k4:()=>h,nm:()=>n,rE:()=>m,tB:()=>s,wR:()=>k,x_:()=>v,yy:()=>b});const s=Date.now,r=()=>1e3*s(),a=s,o=()=>Math.floor(s()/1e3),n=()=>{const e=(10*r()+122192928e9).toString(16);return e.slice(7,15)+e.slice(3,7)+"1"+e.slice(0,3)+"9696"+"ff".repeat(6)},d=setTimeout,h=(e,t,i=d,r=s()+t)=>{if(t>=2147483647)throw new Error("setTimeout() function was called with unrealistic value of "+t.toString());let a=()=>{},o=!0;const n=i((()=>{o=!0;const t=r-s();t>0?a=h(e,t,i,r):e()}),t);return function(){o&&(o=!1,clearTimeout(n)),a()}};class c extends Error{constructor(){const e="timed out";super(e),this.constructor=c,this.__proto__=c.prototype,this.message=e}}const l=e=>{let t;if(t="number"==typeof e?Math.floor(e):parseInt(e,10),!(Number.isNaN(t)||t<0))try{return new Date(t).toISOString()}catch(e){return}},u=e=>{if("string"==typeof e&&e&&!e.match(/^[0-9]+$/)&&!(e.indexOf("-")<0||e.indexOf(":")<0))try{const t=Date.parse(e.indexOf("+")>=0||"Z"===e.slice(-1)?e:(e+"Z").replace(/\s(\d\d):/,"T$1:"));if(Number.isNaN(t))return;return t}catch(e){return}},f=e=>{if("string"==typeof e&&e){if(e.indexOf("GMT")>=0)try{return Date.parse(e)}catch(e){return}return u(e)}},p=(e=void 0)=>new Date(e).toUTCString(),m=(e,t="-")=>{t=t||"";const i=new Date(e),s=i.getUTCFullYear().toString();let r=i.getUTCMonth()+1,a=i.getUTCDate();return r=r<10?"0"+r:r.toString(),a=a<10?"0"+a:a.toString(),r+t+a+t+s},g=(e,t,i=!0)=>{t=t||"";const s=new Date(e),r=s.getUTCFullYear(),a=(i?r:r-2e3).toString();let o=s.getUTCMonth()+1,n=s.getUTCDate();return o=o<10?"0"+o:o.toString(),n=n<10?"0"+n:n.toString(),a+t+o+t+n},v=(e,t="")=>g(e,t,!1),y=(e,t="-")=>g(e,t,!0),w=(e,t=" ")=>{const i=new Date(e),s=i.getUTCFullYear();let r=i.getUTCMonth()+1,a=i.getUTCDate(),o=i.getUTCHours(),n=i.getUTCMinutes(),d=i.getUTCSeconds();return r=r<10?"0"+r:r,a=a<10?"0"+a:a,o=o<10?"0"+o:o,n=n<10?"0"+n:n,d=d<10?"0"+d:d,s+"-"+r+"-"+a+t+o+":"+n+":"+d},b=e=>new Promise((t=>h(t,e))),k=async(e,t)=>{let i=()=>{};const s=new Promise((t=>i=h(t,e)));try{return await Promise.race([t,s.then((()=>{throw new c}))])}finally{i()}}},8995:(e,t,i)=>{i.d(t,{A:()=>n,O:()=>o});var s=i(4710),r=i(3466),a=i(8283);function o(e){const t=e=>parseInt(e,16);e=e.replace(" ","");const i=Math.round((new Date).getTime()/1e3),o=((e,t)=>(t+e).slice(-t.length))(((n=Math.floor(i/30))<15.5?"0":"")+Math.round(n).toString(16),"0000000000000000");var n;const d=(0,a.w8)(s.xn.decode(o),s.RG.decode(e),r.e,"hex"),h=t(d.substring(d.length-1));let c=(t(d.substr(2*h,8))&t("7fffffff"))+"";return c.substring(c.length-6,c.length)}const n=o},6834:(e,t,i)=>{i.d(t,{At:()=>E,Cw:()=>T,DR:()=>N,Dj:()=>x,Et:()=>s,F7:()=>C,Fq:()=>r,Gv:()=>d,Hf:()=>h,I9:()=>q,J0:()=>M,JU:()=>m,KL:()=>c,Kg:()=>n,Pf:()=>p,Q7:()=>B,RH:()=>O,Rc:()=>D,Y2:()=>v,Y_:()=>R,_w:()=>l,cy:()=>a,d0:()=>A,dl:()=>o,fu:()=>V,gw:()=>S,hO:()=>L,lu:()=>y,mU:()=>P,nr:()=>k,pI:()=>b,q0:()=>w,uS:()=>_,w:()=>g,ww:()=>I});const s=Number.isFinite,r=Number.isInteger,a=Array.isArray,o=e=>null!=e,n=e=>"string"==typeof e,d=e=>null!==e&&"object"==typeof e,h=e=>d(e)&&Object.getPrototypeOf(e)===Object.prototype&&!a(e)&&!(e=>e instanceof RegExp)(e),c=e=>o(e)&&e.toString||s(e),l=(e,t)=>d(e)&&""!==e[t]&&null!==e[t]?e[t]:void 0,u=(e,t,i)=>d(e)?void 0!==e[t]&&""!==e[t]&&null!==e[t]?e[t]:""!==e[i]&&null!==e[i]?e[i]:void 0:void 0,f=(e,t)=>d(e)?e[t.find((t=>void 0!==l(e,t)))]:void 0,p=e=>s(e)||n(e)&&0!==e.length?parseFloat(e):NaN,m=e=>s(e)||n(e)&&0!==e.length?Math.trunc(Number(e)):NaN,g=(e,t,i)=>{const r=p(l(e,t));return s(r)?r:i},v=(e,t,i)=>{const r=m(l(e,t));return s(r)?r:i},y=(e,t,i,r)=>{const a=p(l(e,t));return s(a)?parseInt(a*i):r},w=(e,t,i)=>{const r=p(l(e,t));return s(r)?parseInt(1e3*r):i},b=(e,t,i)=>{const s=l(e,t);return o(s)?s:i},k=(e,t,i)=>{const s=l(e,t);return c(s)?String(s):i},S=(e,t,i)=>{const s=l(e,t);return c(s)?String(s).toLowerCase():c(i)?String(i).toLowerCase():i},O=(e,t,i)=>{const s=l(e,t);return c(s)?String(s).toUpperCase():c(i)?String(i).toUpperCase():i},T=(e,t,i,r)=>{const a=p(u(e,t,i));return s(a)?a:r},P=(e,t,i,r)=>{const a=m(u(e,t,i));return s(a)?a:r},M=(e,t,i,r,a)=>{const o=p(u(e,t,i));return s(o)?parseInt(o*r):a},I=(e,t,i,r)=>{const a=p(u(e,t,i));return s(a)?parseInt(1e3*a):r},x=(e,t,i,s)=>{const r=u(e,t,i);return o(r)?r:s},A=(e,t,i,s)=>{const r=u(e,t,i);return c(r)?String(r):s},_=(e,t,i,s)=>{const r=u(e,t,i);return c(r)?String(r).toLowerCase():c(s)?String(s).toLowerCase():s},C=(e,t,i,s)=>{const r=u(e,t,i);return c(r)?String(r).toUpperCase():c(s)?String(s).toUpperCase():s},B=(e,t,i)=>{const r=p(f(e,t));return s(r)?r:i},E=(e,t,i)=>{if(void 0===e)return i;const r=m(f(e,t));return s(r)?r:i},L=(e,t,i,r)=>{const a=p(f(e,t));return s(a)?parseInt(a*i):r},R=(e,t,i)=>{const r=p(f(e,t));return s(r)?parseInt(1e3*r):i},N=(e,t,i)=>{if(void 0===e)return i;const s=f(e,t);return o(s)?s:i},D=(e,t,i)=>{if(void 0===e)return i;const s=f(e,t);return c(s)?String(s):i},q=(e,t,i)=>{const s=f(e,t);return c(s)?String(s).toLowerCase():c(i)?String(i).toLowerCase():i},V=(e,t,i)=>{const s=f(e,t);return c(s)?String(s).toUpperCase():c(i)?String(i).toUpperCase():i}},2931:(e,t,i)=>{i.d(t,{Hk:()=>n,I3:()=>r,Pt:()=>o,TG:()=>a});class s extends Array{constructor(e=void 0){super(),Object.defineProperty(this,"maxSize",{__proto__:null,value:e,writable:!0})}clear(){this.length=0}}class r extends s{constructor(e=void 0){super(e),this.hashmap={},Object.defineProperty(this,"nestedNewUpdatesBySymbol",{__proto__:null,value:!1,writable:!0}),Object.defineProperty(this,"newUpdatesBySymbol",{__proto__:null,value:{},writable:!0}),Object.defineProperty(this,"clearUpdatesBySymbol",{__proto__:null,value:{},writable:!0}),Object.defineProperty(this,"allNewUpdates",{__proto__:null,value:0,writable:!0}),Object.defineProperty(this,"clearAllUpdates",{__proto__:null,value:!1,writable:!0}),Object.defineProperty(this,"hashmap",{__proto__:null,value:{},writable:!0,enumerable:!1})}getLimit(e,t){let i;return void 0===e?(i=this.allNewUpdates,this.clearAllUpdates=!0):(i=this.newUpdatesBySymbol[e],void 0!==i&&this.nestedNewUpdatesBySymbol&&(i=i.size),this.clearUpdatesBySymbol[e]=!0),void 0===i?t:void 0!==t?Math.min(i,t):i}append(e){this.maxSize&&this.length===this.maxSize&&this.shift(),this.push(e),this.clearAllUpdates&&(this.clearAllUpdates=!1,this.clearUpdatesBySymbol={},this.allNewUpdates=0,this.newUpdatesBySymbol={}),this.clearUpdatesBySymbol[e.symbol]&&(this.clearUpdatesBySymbol[e.symbol]=!1,this.newUpdatesBySymbol[e.symbol]=0),this.newUpdatesBySymbol[e.symbol]=(this.newUpdatesBySymbol[e.symbol]||0)+1,this.allNewUpdates=(this.allNewUpdates||0)+1}}class a extends s{constructor(e=void 0){super(e),Object.defineProperty(this,"hashmap",{__proto__:null,value:{},writable:!0}),Object.defineProperty(this,"sizeTracker",{__proto__:null,value:new Set,writable:!0}),Object.defineProperty(this,"newUpdates",{__proto__:null,value:0,writable:!0}),Object.defineProperty(this,"clearUpdates",{__proto__:null,value:!1,writable:!0})}getLimit(e,t){return this.clearUpdates=!0,void 0===t?this.newUpdates:Math.min(this.newUpdates,t)}append(e){if(e[0]in this.hashmap){const t=this.hashmap[e[0]];if(t!==e)for(const i in e)t[i]=e[i]}else{if(this.hashmap[e[0]]=e,this.maxSize&&this.length===this.maxSize){const e=this.shift();delete this.hashmap[e[0]]}this.push(e)}this.clearUpdates&&(this.clearUpdates=!1,this.sizeTracker.clear()),this.sizeTracker.add(e[0]),this.newUpdates=this.sizeTracker.size}}class o extends r{constructor(e=void 0){super(e),this.nestedNewUpdatesBySymbol=!0}append(e){const t=this.hashmap[e.symbol]=this.hashmap[e.symbol]||{};if(e.id in t){const i=t[e.id];if(i!==e)for(const t in e)i[t]=e[t];e=i;const s=this.findIndex((t=>t.id===e.id));this.splice(s,1)}else t[e.id]=e;if(this.maxSize&&this.length===this.maxSize){const e=this.shift();delete this.hashmap[e.symbol][e.id]}this.push(e),this.clearAllUpdates&&(this.clearAllUpdates=!1,this.clearUpdatesBySymbol={},this.allNewUpdates=0,this.newUpdatesBySymbol={}),void 0===this.newUpdatesBySymbol[e.symbol]&&(this.newUpdatesBySymbol[e.symbol]=new Set),this.clearUpdatesBySymbol[e.symbol]&&(this.clearUpdatesBySymbol[e.symbol]=!1,this.newUpdatesBySymbol[e.symbol].clear());const i=this.newUpdatesBySymbol[e.symbol],s=i.size;i.add(e.id);const r=i.size;this.allNewUpdates=(this.allNewUpdates||0)+(r-s)}}class n extends r{constructor(){super(),this.nestedNewUpdatesBySymbol=!0,Object.defineProperty(this,"hashmap",{__proto__:null,value:{},writable:!0})}append(e){const t=this.hashmap[e.symbol]=this.hashmap[e.symbol]||{};if(e.side in t){const i=t[e.side];if(i!==e)for(const t in e)i[t]=e[t];e=i;const s=this.findIndex((t=>t.symbol===e.symbol&&t.side===e.side));this.splice(s,1)}else t[e.side]=e;this.push(e),this.clearAllUpdates&&(this.clearAllUpdates=!1,this.clearUpdatesBySymbol={},this.allNewUpdates=0,this.newUpdatesBySymbol={}),void 0===this.newUpdatesBySymbol[e.symbol]&&(this.newUpdatesBySymbol[e.symbol]=new Set),this.clearUpdatesBySymbol[e.symbol]&&(this.clearUpdatesBySymbol[e.symbol]=!1,this.newUpdatesBySymbol[e.symbol].clear());const i=this.newUpdatesBySymbol[e.symbol],s=i.size;i.add(e.side);const r=i.size;this.allNewUpdates=(this.allNewUpdates||0)+(r-s)}}},934:(e,t,i)=>{i.d(t,{A:()=>l});var s=i(2079),r=i(4350),a=i(3206),o=i(7437),n=i(8403),d=i(7597),h=i(9560),c=i(4710);class l{constructor(e,t,i,s,r,n={}){this.verbose=!1,this.decompressBinary=!0;const d={url:e,onMessageCallback:t,onErrorCallback:i,onCloseCallback:s,onConnectedCallback:r,verbose:!1,protocols:void 0,options:void 0,futures:{},subscriptions:{},rejections:{},connected:void 0,error:void 0,connectionStarted:void 0,connectionEstablished:void 0,isConnected:!1,connectionTimer:void 0,connectionTimeout:1e4,pingInterval:void 0,ping:void 0,keepAlive:3e4,maxPingPongMisses:2,connection:void 0,startedConnecting:!1,gunzip:!1,inflate:!1};Object.assign(this,(0,o.zw)(d,n)),this.connected=(0,a.K)()}future(e){e in this.futures||(this.futures[e]=(0,a.K)());const t=this.futures[e];return e in this.rejections&&(t.reject(this.rejections[e]),delete this.rejections[e]),t}resolve(e,t){if(this.verbose&&void 0===t&&this.log(new Date,"resolve received undefined messageHash"),void 0!==t&&t in this.futures){this.futures[t].resolve(e),delete this.futures[t]}return e}reject(e,t=void 0){if(t)if(t in this.futures){this.futures[t].reject(e),delete this.futures[t]}else this.rejections[t]=e;else{const t=Object.keys(this.futures);for(let i=0;i{this.onError(e)})):d.Ll?this.connection.ping():this.lastPong=e}}}onOpen(){this.verbose&&this.log(new Date,"onOpen"),this.connectionEstablished=(0,n.Rz)(),this.isConnected=!0,this.connected.resolve(this.url),this.clearConnectionTimeout(),this.setPingInterval(),this.onConnectedCallback(this)}onPing(){this.verbose&&this.log(new Date,"onPing")}onPong(){this.lastPong=(0,n.Rz)(),this.verbose&&this.log(new Date,"onPong")}onError(e){this.verbose&&this.log(new Date,"onError",e.message),e instanceof s.BaseError||(e=new s.NetworkError(e.message)),this.error=e,this.reset(this.error),this.onErrorCallback(this,this.error)}onClose(e){this.verbose&&this.log(new Date,"onClose",e),this.error||this.reset(new s.NetworkError("connection closed by remote server, closing code "+String(e.code))),this.error instanceof s.ExchangeClosedByUser&&this.reset(this.error),void 0!==this.disconnected&&this.disconnected.resolve(!0),this.onCloseCallback(this,e)}onUpgrade(e){this.verbose&&this.log(new Date,"onUpgrade")}async send(e){this.verbose&&this.log(new Date,"sending",e),e="string"==typeof e?e:JSON.stringify(e);const t=(0,a.K)();if(d.Ll){function i(e){e?t.reject(e):t.resolve(null)}this.connection.send(e,{},i)}else this.connection.send(e),t.resolve(null);return t}close(){throw new s.NotSupported("close() not implemented yet")}onMessage(e){let t,i=e.data;"string"!=typeof i&&(this.gunzip||this.inflate?(t=new Uint8Array(i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength)),this.gunzip?t=(0,r.Wt)(t):this.inflate&&(t=(0,r.HM)(t)),i=c.As.encode(t)):this.decompressBinary&&(i=i.toString()));try{(0,h.mC)(i)&&(i=i.toString(),i=JSON.parse(i.replace(/:(\d{15,}),/g,':"$1",'))),this.verbose&&this.log(new Date,"onMessage",i)}catch(e){this.log(new Date,"onMessage JSON.parse",e)}try{this.onMessageCallback(this,i)}catch(e){this.reject(e)}}}},3206:(e,t,i)=>{i.d(t,{K:()=>r});var s=i(2634);function r(){let e,t;const i=new Promise(((i,s)=>{e=i,t=s}));return i.resolve=function(){queueMicrotask((()=>{e.apply(this,arguments)}))},i.reject=function(){queueMicrotask((()=>{t.apply(this,arguments)}))},i}r.race=e=>function(e){const t=r();return e.then(t.resolve,t.reject),t}(s.V.race(e))},3828:(e,t,i)=>{i.d(t,{Mi:()=>o,if:()=>n,nS:()=>d});var s=i(8403),r=i(7437),a=i(975);class o{constructor(e={},t=void 0){this.cache=[],Object.defineProperty(this,"cache",{__proto__:null,value:[],writable:!0,enumerable:!1}),t=t||Number.MAX_SAFE_INTEGER;const i={bids:[],asks:[],timestamp:void 0,datetime:void 0,nonce:void 0,symbol:void 0},o=Object.entries((0,r.X$)(i,e));for(let e=0;e{function s(e,t){let i=0,s=e.length-1;for(;i<=s;){const r=i+s>>>1;e[r]-t<0?i=r+1:s=r-1}return i}i.d(t,{$w:()=>d,PB:()=>h,eB:()=>f,f_:()=>c,jR:()=>l,o5:()=>u});const r=new Float64Array(new Array(1024).fill(Number.MAX_VALUE));class a extends Array{constructor(e=[],t=void 0){super(),Object.defineProperty(this,"index",{__proto__:null,value:new Float64Array(r),writable:!0}),Object.defineProperty(this,"depth",{__proto__:null,value:t||Number.MAX_SAFE_INTEGER,writable:!0}),this.length=0;for(let t=0;tthis.index.length-1){const e=Array.from(this.index);e.length=2*this.length,e.fill(Number.MAX_VALUE,this.index.length),this.index=new Float64Array(e)}}else this.index[a]===r&&(this.index.copyWithin(a,a+1,this.index.length),this.index[this.length-1]=Number.MAX_VALUE,this.copyWithin(a,a+1,this.length),this.length--)}store(e,t){this.storeArray([e,t])}limit(){if(this.length>this.depth){for(let e=this.depth;ethis.index.length-1){const e=Array.from(this.index);e.length=2*this.length,e.fill(Number.MAX_VALUE,this.index.length),this.index=new Float64Array(e)}}else this.index[o]===a&&(this.index.copyWithin(o,o+1,this.index.length),this.index[this.length-1]=Number.MAX_VALUE,this.copyWithin(o,o+1,this.length),this.length--)}}class n extends Array{constructor(e=[],t=Number.MAX_SAFE_INTEGER){super(e.length),Object.defineProperty(this,"hashmap",{__proto__:null,value:new Map,writable:!0}),Object.defineProperty(this,"index",{__proto__:null,value:new Float64Array(r),writable:!0}),Object.defineProperty(this,"depth",{__proto__:null,value:t||Number.MAX_SAFE_INTEGER,writable:!0});for(let t=0;tthis.index.length-1){const e=Array.from(this.index);e.length=2*this.length,e.fill(Number.MAX_VALUE,this.index.length),this.index=new Float64Array(e)}}else if(this.hashmap.has(r)){const e=this.hashmap.get(r);let t=s(this.index,e);for(;this[t][2]!==r;)t++;this.index.copyWithin(t,t+1,this.index.length),this.index[this.length-1]=Number.MAX_VALUE,this.copyWithin(t,t+1,this.length),this.length--,this.hashmap.delete(r)}}limit(){if(this.length>this.depth){for(let e=this.depth;e{i.d(t,{A:()=>l});var s=i(1591),r=i.n(s),a=i(934),o=i(7597),n=i(6238),d=i(8403),h=i(3206);const c=o.Ll||!(0,n.Se)()?r():self.WebSocket;class l extends a.A{constructor(){super(...arguments),this.startedConnecting=!1}createConnection(){this.verbose&&this.log(new Date,"connecting to",this.url),this.connectionStarted=(0,d.Rz)(),this.setConnectionTimeout(),o.Ll?this.connection=new c(this.url,this.protocols,this.options):this.connection=new c(this.url,this.protocols),this.connection.onopen=this.onOpen.bind(this),this.connection.onmessage=this.onMessage.bind(this),this.connection.onerror=this.onError.bind(this),this.connection.onclose=this.onClose.bind(this),o.Ll&&this.connection.on("ping",this.onPing.bind(this)).on("pong",this.onPong.bind(this)).on("upgrade",this.onUpgrade.bind(this))}connect(e=0){return this.startedConnecting||(this.startedConnecting=!0,e?(0,d.yy)(e).then(this.createConnection.bind(this)):this.createConnection()),this.connected}isOpen(){return this.connection.readyState===c.OPEN}close(){return this.connection instanceof c&&(void 0===this.disconnected&&(this.disconnected=(0,h.K)()),this.connection.close()),this.disconnected}}},9002:(e,t,i)=>{i.d(t,{A:()=>r});var s=i(7996);class r extends s.A{describe(){return this.deepExtend(super.describe(),{id:"bequant",name:"Bequant",pro:!0,countries:["MT"],urls:{logo:"https://github.com/user-attachments/assets/0583ef1f-29fe-4b7c-8189-63565a0e2867",api:{public:"https://api.bequant.io/api/3",private:"https://api.bequant.io/api/3"},www:"https://bequant.io",doc:["https://api.bequant.io/"],fees:["https://bequant.io/fees-and-limits"],referral:"https://bequant.io/referral/dd104e3bee7634ec"}})}}},8698:(e,t,i)=>{i.d(t,{A:()=>h});var s=i(3971),r=i(2079),a=i(1579),o=i(5354),n=i(4852),d=i(5147);class h extends s.A{describe(){return this.deepExtend(super.describe(),{id:"bigone",name:"BigONE",countries:["CN"],version:"v3",rateLimit:20,has:{CORS:void 0,spot:!0,margin:!1,swap:void 0,future:void 0,option:!1,cancelAllOrders:!0,cancelOrder:!0,createMarketBuyOrderWithCost:!0,createMarketOrderWithCost:!1,createMarketSellOrderWithCost:!1,createOrder:!0,createPostOnlyOrder:!0,createStopLimitOrder:!0,createStopMarketOrder:!0,createStopOrder:!0,fetchBalance:!0,fetchClosedOrders:!0,fetchCurrencies:!0,fetchDepositAddress:!0,fetchDepositAddresses:!1,fetchDepositAddressesByNetwork:!1,fetchDeposits:!0,fetchFundingHistory:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchMarkets:!0,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenOrders:!0,fetchOrder:!0,fetchOrderBook:!0,fetchOrders:!0,fetchTicker:!0,fetchTickers:!0,fetchTime:!0,fetchTrades:!0,fetchTradingFee:!1,fetchTradingFees:!1,fetchTransactionFees:!1,fetchWithdrawals:!0,transfer:!0,withdraw:!0},timeframes:{"1m":"min1","5m":"min5","15m":"min15","30m":"min30","1h":"hour1","3h":"hour3","4h":"hour4","6h":"hour6","12h":"hour12","1d":"day1","1w":"week1","1M":"month1"},hostname:"big.one",urls:{logo:"https://github.com/user-attachments/assets/4e5cfd53-98cc-4b90-92cd-0d7b512653d1",api:{public:"https://{hostname}/api/v3",private:"https://{hostname}/api/v3/viewer",contractPublic:"https://{hostname}/api/contract/v2",contractPrivate:"https://{hostname}/api/contract/v2",webExchange:"https://{hostname}/api/"},www:"https://big.one",doc:"https://open.big.one/docs/api.html",fees:"https://bigone.zendesk.com/hc/en-us/articles/115001933374-BigONE-Fee-Policy",referral:"https://b1.run/users/new?code=D3LLBVFT"},api:{public:{get:["ping","asset_pairs","asset_pairs/{asset_pair_name}/depth","asset_pairs/{asset_pair_name}/trades","asset_pairs/{asset_pair_name}/ticker","asset_pairs/{asset_pair_name}/candles","asset_pairs/tickers"]},private:{get:["accounts","fund/accounts","assets/{asset_symbol}/address","orders","orders/{id}","orders/multi","trades","withdrawals","deposits"],post:["orders","orders/{id}/cancel","orders/cancel","withdrawals","transfer"]},contractPublic:{get:["symbols","instruments","depth@{symbol}/snapshot","instruments/difference","instruments/prices"]},contractPrivate:{get:["accounts","orders/{id}","orders","orders/opening","orders/count","orders/opening/count","trades","trades/count"],post:["orders","orders/batch"],put:["positions/{symbol}/margin","positions/{symbol}/risk-limit"],delete:["orders/{id}","orders/batch"]},webExchange:{get:["v3/assets"]}},fees:{trading:{maker:this.parseNumber("0.001"),taker:this.parseNumber("0.001")},funding:{withdraw:{}}},options:{createMarketBuyOrderRequiresPrice:!0,accountsByType:{spot:"SPOT",fund:"FUND",funding:"FUND",future:"CONTRACT",swap:"CONTRACT"},transfer:{fillResponseFromRequest:!0},exchangeMillisecondsCorrection:-100,fetchCurrencies:{webApiEnable:!0,webApiRetries:5,webApiMuteFailure:!0},defaultNetwork:"ERC20",defaultNetworks:{USDT:"TRC20"},networks:{ABBC:"ABBC",ACA:"Acala",AE:"Aeternity",ALGO:"Algorand",APT:"Aptos",AR:"Arweave",ASTR:"Astar",AVAXC:"Avax",AVAXX:"AvaxChain",BEAM:"Beam",BEP20:"BinanceSmartChain",BITCI:"BitciChain",BTC:"Bitcoin",BCH:"BitcoinCash",BSV:"BitcoinSV",CELO:"Celo",CKKB:"CKB",ATOM:"Cosmos",CRC20:"CRO",DASH:"Dash",DOGE:"Dogecoin",XEC:"ECash",EOS:"EOS",ETH:"Ethereum",ETC:"EthereumClassic",ETHW:"EthereumPow",FTM:"Fantom",FIL:"Filecoin",FSN:"Fusion",GRIN:"Grin",ONE:"Harmony",HRC20:"Hecochain",HBAR:"Hedera",HNT:"Helium",ZEN:"Horizen",IOST:"IOST",IRIS:"IRIS",KLAY:"Klaytn",KSM:"Kusama",LTC:"Litecoin",XMR:"Monero",GLMR:"Moonbeam",NEAR:"Near",NEO:"Neo",NEON3:"NeoN3",OASIS:"Oasis",OKC:"Okexchain",ONT:"Ontology",OPTIMISM:"Optimism",DOT:"Polkadot",MATIC:"Polygon",QTUM:"Qtum",REI:"REI",XRP:"Ripple",SGB:"SGB",SDN:"Shiden",SOL:"Solana",XLM:"Stellar",TERA:"Tera",XTZ:"Tezos",TRC20:"Tron",VET:"Vechain",VSYS:"VSystems",WAX:"WAX",ZEC:"Zcash"}},features:{default:{sandbox:!1,createOrder:{marginMode:!1,triggerPrice:!0,triggerPriceType:void 0,triggerDirection:!0,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!0,FOK:!1,PO:!0,GTD:!1},hedged:!1,trailing:!1,leverage:!1,marketBuyRequiresPrice:!0,marketBuyByCost:!0,selfTradePrevention:!1,iceberg:!1},createOrders:void 0,fetchMyTrades:{marginMode:!1,limit:200,daysBack:void 0,untilDays:void 0,symbolRequired:!0},fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!1},fetchOpenOrders:{marginMode:!1,limit:200,trigger:!1,trailing:!1,symbolRequired:!0},fetchOrders:{marginMode:!1,limit:200,daysBack:void 0,untilDays:void 0,trigger:!1,trailing:!1,symbolRequired:!0},fetchClosedOrders:{marginMode:!1,limit:200,daysBack:void 0,daysBackCanceled:void 0,untilDays:void 0,trigger:!1,trailing:!1,symbolRequired:!0},fetchOHLCV:{limit:500}},spot:{extends:"default"},forDerivatives:{extends:"default",createOrder:{triggerPriceType:{mark:!0,index:!0,last:!0}},fetchOrders:{daysBack:1e5,untilDays:1e5},fetchClosedOrders:{daysBack:1e5,untilDays:1e5}},swap:{linear:{extends:"forDerivatives"},inverse:{extends:"forDerivatives"}},future:{linear:void 0,inverse:void 0}},precisionMode:a.kb,exceptions:{exact:{10001:r.BadRequest,10005:r.ExchangeError,"Amount's scale must greater than AssetPair's base scale":r.InvalidOrder,"Price mulit with amount should larger than AssetPair's min_quote_value":r.InvalidOrder,10007:r.BadRequest,10011:r.ExchangeError,10013:r.BadSymbol,10014:r.InsufficientFunds,10403:r.PermissionDenied,10429:r.RateLimitExceeded,40004:r.AuthenticationError,40103:r.AuthenticationError,40104:r.AuthenticationError,40301:r.PermissionDenied,40302:r.ExchangeError,40601:r.ExchangeError,40602:r.ExchangeError,40603:r.InsufficientFunds,40604:r.InvalidOrder,40605:r.InvalidOrder,40120:r.InvalidOrder,40121:r.InvalidOrder,60100:r.BadSymbol},broad:{}},commonCurrencies:{CRE:"Cybereits",FXT:"FXTTOKEN",FREE:"FreeRossDAO",MBN:"Mobilian Coin",ONE:"BigONE Token"}})}async fetchCurrencies(e={}){const t=await this.fetchWebEndpoint("fetchCurrencies","webExchangeGetV3Assets",!0);if(void 0===t)return;const i=this.safeList(t,"data",[]),s={};for(let e=0;e{i.d(t,{A:()=>l});var s=i(335),r=i(2079),a=i(5147),o=i(1579),n=i(4852),d=i(5354),h=i(8283),c=i(6414);class l extends s.A{describe(){return this.deepExtend(super.describe(),{id:"binance",name:"Binance",countries:[],rateLimit:50,certified:!0,pro:!0,has:{CORS:void 0,spot:!0,margin:!0,swap:!0,future:!0,option:!0,addMargin:!0,borrowCrossMargin:!0,borrowIsolatedMargin:!0,cancelAllOrders:!0,cancelOrder:!0,cancelOrders:!0,closeAllPositions:!1,closePosition:!1,createConvertTrade:!0,createDepositAddress:!1,createLimitBuyOrder:!0,createLimitSellOrder:!0,createMarketBuyOrder:!0,createMarketBuyOrderWithCost:!0,createMarketOrderWithCost:!0,createMarketSellOrder:!0,createMarketSellOrderWithCost:!0,createOrder:!0,createOrders:!0,createOrderWithTakeProfitAndStopLoss:!1,createPostOnlyOrder:!0,createReduceOnlyOrder:!0,createStopLimitOrder:!0,createStopLossOrder:!0,createStopMarketOrder:!1,createStopOrder:!0,createTakeProfitOrder:!0,createTrailingPercentOrder:!0,createTriggerOrder:!0,editOrder:!0,editOrders:!0,fetchAccounts:void 0,fetchAllGreeks:!0,fetchBalance:!0,fetchBidsAsks:!0,fetchBorrowInterest:!0,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!0,fetchCanceledAndClosedOrders:"emulated",fetchCanceledOrders:"emulated",fetchClosedOrder:!1,fetchClosedOrders:"emulated",fetchConvertCurrencies:!0,fetchConvertQuote:!0,fetchConvertTrade:!0,fetchConvertTradeHistory:!0,fetchCrossBorrowRate:!0,fetchCrossBorrowRates:!1,fetchCurrencies:!0,fetchDeposit:!1,fetchDepositAddress:!0,fetchDepositAddresses:!1,fetchDepositAddressesByNetwork:!1,fetchDeposits:!0,fetchDepositsWithdrawals:!1,fetchDepositWithdrawFee:"emulated",fetchDepositWithdrawFees:!0,fetchFundingHistory:!0,fetchFundingInterval:"emulated",fetchFundingIntervals:!0,fetchFundingRate:!0,fetchFundingRateHistory:!0,fetchFundingRates:!0,fetchGreeks:!0,fetchIndexOHLCV:!0,fetchIsolatedBorrowRate:"emulated",fetchIsolatedBorrowRates:!0,fetchL3OrderBook:!1,fetchLastPrices:!0,fetchLedger:!0,fetchLedgerEntry:!0,fetchLeverage:"emulated",fetchLeverages:!0,fetchLeverageTiers:!0,fetchLiquidations:!1,fetchLongShortRatio:!1,fetchLongShortRatioHistory:!0,fetchMarginAdjustmentHistory:!0,fetchMarginMode:!0,fetchMarginModes:!0,fetchMarketLeverageTiers:"emulated",fetchMarkets:!0,fetchMarkOHLCV:!0,fetchMarkPrice:!0,fetchMarkPrices:!0,fetchMyLiquidations:!0,fetchMySettlementHistory:!0,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenInterest:!0,fetchOpenInterestHistory:!0,fetchOpenOrder:!0,fetchOpenOrders:!0,fetchOption:!0,fetchOptionChain:!1,fetchOrder:!0,fetchOrderBook:!0,fetchOrderBooks:!1,fetchOrders:!0,fetchOrderTrades:!0,fetchPosition:!0,fetchPositionHistory:!1,fetchPositionMode:!0,fetchPositions:!0,fetchPositionsHistory:!1,fetchPositionsRisk:!0,fetchPremiumIndexOHLCV:!0,fetchSettlementHistory:!0,fetchStatus:!0,fetchTicker:!0,fetchTickers:!0,fetchTime:!0,fetchTrades:!0,fetchTradingFee:!0,fetchTradingFees:!0,fetchTradingLimits:"emulated",fetchTransactionFee:"emulated",fetchTransactionFees:!0,fetchTransactions:!1,fetchTransfer:!1,fetchTransfers:!0,fetchUnderlyingAssets:!1,fetchVolatilityHistory:!1,fetchWithdrawAddresses:!1,fetchWithdrawal:!1,fetchWithdrawals:!0,fetchWithdrawalWhitelist:!1,reduceMargin:!0,repayCrossMargin:!0,repayIsolatedMargin:!0,sandbox:!0,setLeverage:!0,setMargin:!1,setMarginMode:!0,setPositionMode:!0,signIn:!1,transfer:!0,withdraw:!0},timeframes:{"1s":"1s","1m":"1m","3m":"3m","5m":"5m","15m":"15m","30m":"30m","1h":"1h","2h":"2h","4h":"4h","6h":"6h","8h":"8h","12h":"12h","1d":"1d","3d":"3d","1w":"1w","1M":"1M"},urls:{logo:"https://github.com/user-attachments/assets/e9419b93-ccb0-46aa-9bff-c883f096274b",test:{dapiPublic:"https://testnet.binancefuture.com/dapi/v1",dapiPrivate:"https://testnet.binancefuture.com/dapi/v1",dapiPrivateV2:"https://testnet.binancefuture.com/dapi/v2",fapiPublic:"https://testnet.binancefuture.com/fapi/v1",fapiPublicV2:"https://testnet.binancefuture.com/fapi/v2",fapiPublicV3:"https://testnet.binancefuture.com/fapi/v3",fapiPrivate:"https://testnet.binancefuture.com/fapi/v1",fapiPrivateV2:"https://testnet.binancefuture.com/fapi/v2",fapiPrivateV3:"https://testnet.binancefuture.com/fapi/v3",public:"https://testnet.binance.vision/api/v3",private:"https://testnet.binance.vision/api/v3",v1:"https://testnet.binance.vision/api/v1"},api:{sapi:"https://api.binance.com/sapi/v1",sapiV2:"https://api.binance.com/sapi/v2",sapiV3:"https://api.binance.com/sapi/v3",sapiV4:"https://api.binance.com/sapi/v4",dapiPublic:"https://dapi.binance.com/dapi/v1",dapiPrivate:"https://dapi.binance.com/dapi/v1",eapiPublic:"https://eapi.binance.com/eapi/v1",eapiPrivate:"https://eapi.binance.com/eapi/v1",dapiPrivateV2:"https://dapi.binance.com/dapi/v2",dapiData:"https://dapi.binance.com/futures/data",fapiPublic:"https://fapi.binance.com/fapi/v1",fapiPublicV2:"https://fapi.binance.com/fapi/v2",fapiPublicV3:"https://fapi.binance.com/fapi/v3",fapiPrivate:"https://fapi.binance.com/fapi/v1",fapiPrivateV2:"https://fapi.binance.com/fapi/v2",fapiPrivateV3:"https://fapi.binance.com/fapi/v3",fapiData:"https://fapi.binance.com/futures/data",public:"https://api.binance.com/api/v3",private:"https://api.binance.com/api/v3",v1:"https://api.binance.com/api/v1",papi:"https://papi.binance.com/papi/v1"},www:"https://www.binance.com",referral:{url:"https://accounts.binance.com/en/register?ref=D7YA7CLY",discount:.1},doc:["https://developers.binance.com/en"],api_management:"https://www.binance.com/en/usercenter/settings/api-management",fees:"https://www.binance.com/en/fee/schedule"},api:{sapi:{get:{"copyTrading/futures/userStatus":2,"copyTrading/futures/leadSymbol":2,"system/status":.1,accountSnapshot:240,"account/info":.1,"margin/asset":1,"margin/pair":1,"margin/allAssets":.1,"margin/allPairs":.1,"margin/priceIndex":1,"spot/delist-schedule":10,"asset/assetDividend":1,"asset/dribblet":.1,"asset/transfer":.1,"asset/assetDetail":.1,"asset/tradeFee":.1,"asset/ledger-transfer/cloud-mining/queryByPage":4.0002,"asset/convert-transfer/queryByPage":.033335,"asset/wallet/balance":6,"asset/custody/transfer-history":6,"margin/borrow-repay":1,"margin/loan":1,"margin/repay":1,"margin/account":1,"margin/transfer":.1,"margin/interestHistory":.1,"margin/forceLiquidationRec":.1,"margin/order":1,"margin/openOrders":1,"margin/allOrders":20,"margin/myTrades":1,"margin/maxBorrowable":5,"margin/maxTransferable":5,"margin/tradeCoeff":1,"margin/isolated/transfer":.1,"margin/isolated/account":1,"margin/isolated/pair":1,"margin/isolated/allPairs":1,"margin/isolated/accountLimit":.1,"margin/interestRateHistory":.1,"margin/orderList":1,"margin/allOrderList":20,"margin/openOrderList":1,"margin/crossMarginData":{cost:.1,noCoin:.5},"margin/isolatedMarginData":{cost:.1,noCoin:1},"margin/isolatedMarginTier":.1,"margin/rateLimit/order":2,"margin/dribblet":.1,"margin/dust":20.001,"margin/crossMarginCollateralRatio":10,"margin/exchange-small-liability":.6667,"margin/exchange-small-liability-history":.6667,"margin/next-hourly-interest-rate":.6667,"margin/capital-flow":10,"margin/delist-schedule":10,"margin/available-inventory":.3334,"margin/leverageBracket":.1,"loan/vip/loanable/data":40,"loan/vip/collateral/data":40,"loan/vip/request/data":2.6668,"loan/vip/request/interestRate":2.6668,"loan/income":40.002,"loan/ongoing/orders":40,"loan/ltv/adjustment/history":40,"loan/borrow/history":40,"loan/repay/history":40,"loan/loanable/data":40,"loan/collateral/data":40,"loan/repay/collateral/rate":600,"loan/flexible/ongoing/orders":30,"loan/flexible/borrow/history":40,"loan/flexible/repay/history":40,"loan/flexible/ltv/adjustment/history":40,"loan/vip/ongoing/orders":40,"loan/vip/repay/history":40,"loan/vip/collateral/account":600,"fiat/orders":600.03,"fiat/payments":.1,"futures/transfer":1,"futures/histDataLink":.1,"rebate/taxQuery":80.004,"capital/config/getall":1,"capital/deposit/address":1,"capital/deposit/address/list":1,"capital/deposit/hisrec":.1,"capital/deposit/subAddress":.1,"capital/deposit/subHisrec":.1,"capital/withdraw/history":2,"capital/withdraw/address/list":10,"capital/contract/convertible-coins":4.0002,"convert/tradeFlow":20.001,"convert/exchangeInfo":50,"convert/assetInfo":10,"convert/orderStatus":.6667,"convert/limit/queryOpenOrders":20.001,"account/status":.1,"account/apiTradingStatus":.1,"account/apiRestrictions/ipRestriction":.1,bnbBurn:.1,"sub-account/futures/account":1,"sub-account/futures/accountSummary":.1,"sub-account/futures/positionRisk":1,"sub-account/futures/internalTransfer":.1,"sub-account/list":.1,"sub-account/margin/account":1,"sub-account/margin/accountSummary":1,"sub-account/spotSummary":.1,"sub-account/status":1,"sub-account/sub/transfer/history":.1,"sub-account/transfer/subUserHistory":.1,"sub-account/universalTransfer":.1,"sub-account/apiRestrictions/ipRestriction/thirdPartyList":1,"sub-account/transaction-statistics":.40002,"sub-account/subAccountApi/ipRestriction":20.001,"managed-subaccount/asset":.1,"managed-subaccount/accountSnapshot":240,"managed-subaccount/queryTransLogForInvestor":.1,"managed-subaccount/queryTransLogForTradeParent":.40002,"managed-subaccount/fetch-future-asset":.40002,"managed-subaccount/marginAsset":.1,"managed-subaccount/info":.40002,"managed-subaccount/deposit/address":.006667,"managed-subaccount/query-trans-log":.40002,"lending/daily/product/list":.1,"lending/daily/userLeftQuota":.1,"lending/daily/userRedemptionQuota":.1,"lending/daily/token/position":.1,"lending/union/account":.1,"lending/union/purchaseRecord":.1,"lending/union/redemptionRecord":.1,"lending/union/interestHistory":.1,"lending/project/list":.1,"lending/project/position/list":.1,"eth-staking/eth/history/stakingHistory":15,"eth-staking/eth/history/redemptionHistory":15,"eth-staking/eth/history/rewardsHistory":15,"eth-staking/eth/quota":15,"eth-staking/eth/history/rateHistory":15,"eth-staking/account":15,"eth-staking/wbeth/history/wrapHistory":15,"eth-staking/wbeth/history/unwrapHistory":15,"eth-staking/eth/history/wbethRewardsHistory":15,"sol-staking/sol/history/stakingHistory":15,"sol-staking/sol/history/redemptionHistory":15,"sol-staking/sol/history/bnsolRewardsHistory":15,"sol-staking/sol/history/rateHistory":15,"sol-staking/account":15,"sol-staking/sol/quota":15,"mining/pub/algoList":.1,"mining/pub/coinList":.1,"mining/worker/detail":.5,"mining/worker/list":.5,"mining/payment/list":.5,"mining/statistics/user/status":.5,"mining/statistics/user/list":.5,"mining/payment/uid":.5,"bswap/pools":.1,"bswap/liquidity":{cost:.1,noPoolId:1},"bswap/liquidityOps":20.001,"bswap/quote":1.00005,"bswap/swap":20.001,"bswap/poolConfigure":1.00005,"bswap/addLiquidityPreview":1.00005,"bswap/removeLiquidityPreview":1.00005,"bswap/unclaimedRewards":6.667,"bswap/claimedHistory":6.667,"blvt/tokenInfo":.1,"blvt/subscribe/record":.1,"blvt/redeem/record":.1,"blvt/userLimit":.1,"apiReferral/ifNewUser":1,"apiReferral/customization":1,"apiReferral/userCustomization":1,"apiReferral/rebate/recentRecord":1,"apiReferral/rebate/historicalRecord":1,"apiReferral/kickback/recentRecord":1,"apiReferral/kickback/historicalRecord":1,"broker/subAccountApi":1,"broker/subAccount":1,"broker/subAccountApi/commission/futures":1,"broker/subAccountApi/commission/coinFutures":1,"broker/info":1,"broker/transfer":1,"broker/transfer/futures":1,"broker/rebate/recentRecord":1,"broker/rebate/historicalRecord":1,"broker/subAccount/bnbBurn/status":1,"broker/subAccount/depositHist":1,"broker/subAccount/spotSummary":1,"broker/subAccount/marginSummary":1,"broker/subAccount/futuresSummary":1,"broker/rebate/futures/recentRecord":1,"broker/subAccountApi/ipRestriction":1,"broker/universalTransfer":1,"account/apiRestrictions":.1,"c2c/orderMatch/listUserOrderHistory":.1,"nft/history/transactions":20.001,"nft/history/deposit":20.001,"nft/history/withdraw":20.001,"nft/user/getAsset":20.001,"pay/transactions":20.001,"giftcard/verify":.1,"giftcard/cryptography/rsa-public-key":.1,"giftcard/buyCode/token-limit":.1,"algo/spot/openOrders":.1,"algo/spot/historicalOrders":.1,"algo/spot/subOrders":.1,"algo/futures/openOrders":.1,"algo/futures/historicalOrders":.1,"algo/futures/subOrders":.1,"portfolio/account":.1,"portfolio/collateralRate":5,"portfolio/pmLoan":3.3335,"portfolio/interest-history":.6667,"portfolio/asset-index-price":.1,"portfolio/repay-futures-switch":3,"portfolio/margin-asset-leverage":5,"portfolio/balance":2,"portfolio/negative-balance-exchange-record":2,"portfolio/pmloan-history":5,"portfolio/earn-asset-balance":150,"staking/productList":.1,"staking/position":.1,"staking/stakingRecord":.1,"staking/personalLeftQuota":.1,"lending/auto-invest/target-asset/list":.1,"lending/auto-invest/target-asset/roi/list":.1,"lending/auto-invest/all/asset":.1,"lending/auto-invest/source-asset/list":.1,"lending/auto-invest/plan/list":.1,"lending/auto-invest/plan/id":.1,"lending/auto-invest/history/list":.1,"lending/auto-invest/index/info":.1,"lending/auto-invest/index/user-summary":.1,"lending/auto-invest/one-off/status":.1,"lending/auto-invest/redeem/history":.1,"lending/auto-invest/rebalance/history":.1,"simple-earn/flexible/list":15,"simple-earn/locked/list":15,"simple-earn/flexible/personalLeftQuota":15,"simple-earn/locked/personalLeftQuota":15,"simple-earn/flexible/subscriptionPreview":15,"simple-earn/locked/subscriptionPreview":15,"simple-earn/flexible/history/rateHistory":15,"simple-earn/flexible/position":15,"simple-earn/locked/position":15,"simple-earn/account":15,"simple-earn/flexible/history/subscriptionRecord":15,"simple-earn/locked/history/subscriptionRecord":15,"simple-earn/flexible/history/redemptionRecord":15,"simple-earn/locked/history/redemptionRecord":15,"simple-earn/flexible/history/rewardsRecord":15,"simple-earn/locked/history/rewardsRecord":15,"simple-earn/flexible/history/collateralRecord":.1,"dci/product/list":.1,"dci/product/positions":.1,"dci/product/accounts":.1},post:{"asset/dust":.06667,"asset/dust-btc":.1,"asset/transfer":6.0003,"asset/get-funding-asset":.1,"asset/convert-transfer":.033335,"account/disableFastWithdrawSwitch":.1,"account/enableFastWithdrawSwitch":.1,"capital/withdraw/apply":4.0002,"capital/contract/convertible-coins":4.0002,"capital/deposit/credit-apply":.1,"margin/borrow-repay":20.001,"margin/transfer":4.0002,"margin/loan":20.001,"margin/repay":20.001,"margin/order":.040002,"margin/order/oco":.040002,"margin/dust":20.001,"margin/exchange-small-liability":20.001,"margin/isolated/transfer":4.0002,"margin/isolated/account":2.0001,"margin/max-leverage":300,bnbBurn:.1,"sub-account/virtualSubAccount":.1,"sub-account/margin/transfer":4.0002,"sub-account/margin/enable":.1,"sub-account/futures/enable":.1,"sub-account/futures/transfer":.1,"sub-account/futures/internalTransfer":.1,"sub-account/transfer/subToSub":.1,"sub-account/transfer/subToMaster":.1,"sub-account/universalTransfer":.1,"sub-account/options/enable":.1,"managed-subaccount/deposit":.1,"managed-subaccount/withdraw":.1,userDataStream:.1,"userDataStream/isolated":.1,"futures/transfer":.1,"lending/customizedFixed/purchase":.1,"lending/daily/purchase":.1,"lending/daily/redeem":.1,"bswap/liquidityAdd":60,"bswap/liquidityRemove":60,"bswap/swap":60,"bswap/claimRewards":6.667,"blvt/subscribe":.1,"blvt/redeem":.1,"apiReferral/customization":1,"apiReferral/userCustomization":1,"apiReferral/rebate/historicalRecord":1,"apiReferral/kickback/historicalRecord":1,"broker/subAccount":1,"broker/subAccount/margin":1,"broker/subAccount/futures":1,"broker/subAccountApi":1,"broker/subAccountApi/permission":1,"broker/subAccountApi/commission":1,"broker/subAccountApi/commission/futures":1,"broker/subAccountApi/commission/coinFutures":1,"broker/transfer":1,"broker/transfer/futures":1,"broker/rebate/historicalRecord":1,"broker/subAccount/bnbBurn/spot":1,"broker/subAccount/bnbBurn/marginInterest":1,"broker/subAccount/blvt":1,"broker/subAccountApi/ipRestriction":1,"broker/subAccountApi/ipRestriction/ipList":1,"broker/universalTransfer":1,"broker/subAccountApi/permission/universalTransfer":1,"broker/subAccountApi/permission/vanillaOptions":1,"giftcard/createCode":.1,"giftcard/redeemCode":.1,"giftcard/buyCode":.1,"algo/spot/newOrderTwap":20.001,"algo/futures/newOrderVp":20.001,"algo/futures/newOrderTwap":20.001,"staking/purchase":.1,"staking/redeem":.1,"staking/setAutoStaking":.1,"eth-staking/eth/stake":15,"eth-staking/eth/redeem":15,"eth-staking/wbeth/wrap":15,"sol-staking/sol/stake":15,"sol-staking/sol/redeem":15,"mining/hash-transfer/config":.5,"mining/hash-transfer/config/cancel":.5,"portfolio/repay":20.001,"loan/vip/renew":40.002,"loan/vip/borrow":40.002,"loan/borrow":40.002,"loan/repay":40.002,"loan/adjust/ltv":40.002,"loan/customize/margin_call":40.002,"loan/flexible/repay":40.002,"loan/flexible/adjust/ltv":40.002,"loan/vip/repay":40.002,"convert/getQuote":1.3334,"convert/acceptQuote":3.3335,"convert/limit/placeOrder":3.3335,"convert/limit/cancelOrder":1.3334,"portfolio/auto-collection":150,"portfolio/asset-collection":6,"portfolio/bnb-transfer":150,"portfolio/repay-futures-switch":150,"portfolio/repay-futures-negative-balance":150,"portfolio/mint":20,"portfolio/redeem":20,"portfolio/earn-asset-transfer":150,"lending/auto-invest/plan/add":.1,"lending/auto-invest/plan/edit":.1,"lending/auto-invest/plan/edit-status":.1,"lending/auto-invest/one-off":.1,"lending/auto-invest/redeem":.1,"simple-earn/flexible/subscribe":.1,"simple-earn/locked/subscribe":.1,"simple-earn/flexible/redeem":.1,"simple-earn/locked/redeem":.1,"simple-earn/flexible/setAutoSubscribe":15,"simple-earn/locked/setAutoSubscribe":15,"simple-earn/locked/setRedeemOption":5,"dci/product/subscribe":.1,"dci/product/auto_compound/edit":.1},put:{userDataStream:.1,"userDataStream/isolated":.1},delete:{"margin/openOrders":.1,"margin/order":.006667,"margin/orderList":.006667,"margin/isolated/account":2.0001,userDataStream:.1,"userDataStream/isolated":.1,"broker/subAccountApi":1,"broker/subAccountApi/ipRestriction/ipList":1,"algo/spot/order":.1,"algo/futures/order":.1,"sub-account/subAccountApi/ipRestriction/ipList":20.001}},sapiV2:{get:{"eth-staking/account":15,"sub-account/futures/account":.1,"sub-account/futures/accountSummary":1,"sub-account/futures/positionRisk":.1,"loan/flexible/ongoing/orders":30,"loan/flexible/borrow/history":40,"loan/flexible/repay/history":40,"loan/flexible/ltv/adjustment/history":40,"loan/flexible/loanable/data":40,"loan/flexible/collateral/data":40,"portfolio/account":2},post:{"eth-staking/eth/stake":15,"sub-account/subAccountApi/ipRestriction":20.001,"loan/flexible/borrow":40.002,"loan/flexible/repay":40.002,"loan/flexible/adjust/ltv":40.002}},sapiV3:{get:{"sub-account/assets":.40002},post:{"asset/getUserAsset":.5}},sapiV4:{get:{"sub-account/assets":.40002}},dapiPublic:{get:{ping:1,time:1,exchangeInfo:1,depth:{cost:2,byLimit:[[50,2],[100,5],[500,10],[1e3,20]]},trades:5,historicalTrades:20,aggTrades:20,premiumIndex:10,fundingRate:1,klines:{cost:1,byLimit:[[99,1],[499,2],[1e3,5],[1e4,10]]},continuousKlines:{cost:1,byLimit:[[99,1],[499,2],[1e3,5],[1e4,10]]},indexPriceKlines:{cost:1,byLimit:[[99,1],[499,2],[1e3,5],[1e4,10]]},markPriceKlines:{cost:1,byLimit:[[99,1],[499,2],[1e3,5],[1e4,10]]},premiumIndexKlines:{cost:1,byLimit:[[99,1],[499,2],[1e3,5],[1e4,10]]},"ticker/24hr":{cost:1,noSymbol:40},"ticker/price":{cost:1,noSymbol:2},"ticker/bookTicker":{cost:2,noSymbol:5},constituents:2,openInterest:1,fundingInfo:1}},dapiData:{get:{"delivery-price":1,openInterestHist:1,topLongShortAccountRatio:1,topLongShortPositionRatio:1,globalLongShortAccountRatio:1,takerBuySellVol:1,basis:1}},dapiPrivate:{get:{"positionSide/dual":30,orderAmendment:1,order:1,openOrder:1,openOrders:{cost:1,noSymbol:5},allOrders:{cost:20,noSymbol:40},balance:1,account:5,"positionMargin/history":1,positionRisk:1,userTrades:{cost:20,noSymbol:40},income:20,leverageBracket:1,forceOrders:{cost:20,noSymbol:50},adlQuantile:5,commissionRate:20,"income/asyn":5,"income/asyn/id":5,"trade/asyn":.5,"trade/asyn/id":.5,"order/asyn":.5,"order/asyn/id":.5,pmExchangeInfo:.5,pmAccountInfo:.5},post:{"positionSide/dual":1,order:4,batchOrders:5,countdownCancelAll:10,leverage:1,marginType:1,positionMargin:1,listenKey:1},put:{listenKey:1,order:1,batchOrders:5},delete:{order:1,allOpenOrders:1,batchOrders:5,listenKey:1}},dapiPrivateV2:{get:{leverageBracket:1}},fapiPublic:{get:{ping:1,time:1,exchangeInfo:1,depth:{cost:2,byLimit:[[50,2],[100,5],[500,10],[1e3,20]]},trades:5,historicalTrades:20,aggTrades:20,klines:{cost:1,byLimit:[[99,1],[499,2],[1e3,5],[1e4,10]]},continuousKlines:{cost:1,byLimit:[[99,1],[499,2],[1e3,5],[1e4,10]]},markPriceKlines:{cost:1,byLimit:[[99,1],[499,2],[1e3,5],[1e4,10]]},indexPriceKlines:{cost:1,byLimit:[[99,1],[499,2],[1e3,5],[1e4,10]]},premiumIndexKlines:{cost:1,byLimit:[[99,1],[499,2],[1e3,5],[1e4,10]]},fundingRate:1,fundingInfo:1,premiumIndex:1,"ticker/24hr":{cost:1,noSymbol:40},"ticker/price":{cost:1,noSymbol:2},"ticker/bookTicker":{cost:1,noSymbol:2},openInterest:1,indexInfo:1,assetIndex:{cost:1,noSymbol:10},constituents:2,apiTradingStatus:{cost:1,noSymbol:10},lvtKlines:1,"convert/exchangeInfo":4,insuranceBalance:1}},fapiData:{get:{"delivery-price":1,openInterestHist:1,topLongShortAccountRatio:1,topLongShortPositionRatio:1,globalLongShortAccountRatio:1,takerlongshortRatio:1,basis:1}},fapiPrivate:{get:{forceOrders:{cost:20,noSymbol:50},allOrders:5,openOrder:1,openOrders:{cost:1,noSymbol:40},order:1,account:5,balance:5,leverageBracket:1,"positionMargin/history":1,positionRisk:5,"positionSide/dual":30,userTrades:5,income:30,commissionRate:20,"rateLimit/order":1,apiTradingStatus:1,multiAssetsMargin:30,"apiReferral/ifNewUser":1,"apiReferral/customization":1,"apiReferral/userCustomization":1,"apiReferral/traderNum":1,"apiReferral/overview":1,"apiReferral/tradeVol":1,"apiReferral/rebateVol":1,"apiReferral/traderSummary":1,adlQuantile:5,pmAccountInfo:5,orderAmendment:1,"income/asyn":1e3,"income/asyn/id":10,"order/asyn":1e3,"order/asyn/id":10,"trade/asyn":1e3,"trade/asyn/id":10,feeBurn:1,symbolConfig:5,accountConfig:5,"convert/orderStatus":5},post:{batchOrders:5,"positionSide/dual":1,positionMargin:1,marginType:1,order:4,leverage:1,listenKey:1,countdownCancelAll:10,multiAssetsMargin:1,"apiReferral/customization":1,"apiReferral/userCustomization":1,feeBurn:1,"convert/getQuote":200,"convert/acceptQuote":20},put:{listenKey:1,order:1,batchOrders:5},delete:{batchOrders:1,order:1,allOpenOrders:1,listenKey:1}},fapiPublicV2:{get:{"ticker/price":0}},fapiPrivateV2:{get:{account:1,balance:1,positionRisk:1}},fapiPublicV3:{get:{}},fapiPrivateV3:{get:{account:1,balance:1,positionRisk:1}},eapiPublic:{get:{ping:1,time:1,exchangeInfo:1,index:1,ticker:5,mark:5,depth:1,klines:1,trades:5,historicalTrades:20,exerciseHistory:3,openInterest:3}},eapiPrivate:{get:{account:3,position:5,openOrders:{cost:1,noSymbol:40},historyOrders:3,userTrades:5,exerciseRecord:5,bill:1,"income/asyn":5,"income/asyn/id":5,marginAccount:3,mmp:1,countdownCancelAll:1,order:1,"block/order/orders":5,"block/order/execute":5,"block/user-trades":5,blockTrades:5},post:{order:1,batchOrders:5,listenKey:1,mmpSet:1,mmpReset:1,countdownCancelAll:1,countdownCancelAllHeartBeat:10,"block/order/create":5,"block/order/execute":5},put:{listenKey:1,"block/order/create":5},delete:{order:1,batchOrders:1,allOpenOrders:1,allOpenOrdersByUnderlying:1,listenKey:1,"block/order/create":5}},public:{get:{ping:.2,time:.2,depth:{cost:1,byLimit:[[100,1],[500,5],[1e3,10],[5e3,50]]},trades:2,aggTrades:.4,historicalTrades:2,klines:.4,uiKlines:.4,"ticker/24hr":{cost:.4,noSymbol:16},ticker:{cost:.4,noSymbol:16},"ticker/tradingDay":.8,"ticker/price":{cost:.4,noSymbol:.8},"ticker/bookTicker":{cost:.4,noSymbol:.8},exchangeInfo:4,avgPrice:.4},put:{userDataStream:.4},post:{userDataStream:.4},delete:{userDataStream:.4}},private:{get:{allOrderList:4,openOrderList:1.2,orderList:.8,order:.8,openOrders:{cost:1.2,noSymbol:16},allOrders:4,account:4,myTrades:4,"rateLimit/order":8,myPreventedMatches:4,myAllocations:4,"account/commission":4},post:{"order/oco":.2,"orderList/oco":.2,"orderList/oto":.2,"orderList/otoco":.2,"sor/order":.2,"sor/order/test":.2,order:.2,"order/cancelReplace":.2,"order/test":.2},delete:{openOrders:.2,orderList:.2,order:.2}},papi:{get:{ping:.2,"um/order":1,"um/openOrder":1,"um/openOrders":{cost:1,noSymbol:40},"um/allOrders":5,"cm/order":1,"cm/openOrder":1,"cm/openOrders":{cost:1,noSymbol:40},"cm/allOrders":20,"um/conditional/openOrder":1,"um/conditional/openOrders":{cost:1,noSymbol:40},"um/conditional/orderHistory":1,"um/conditional/allOrders":{cost:1,noSymbol:40},"cm/conditional/openOrder":1,"cm/conditional/openOrders":{cost:1,noSymbol:40},"cm/conditional/orderHistory":1,"cm/conditional/allOrders":40,"margin/order":10,"margin/openOrders":5,"margin/allOrders":100,"margin/orderList":5,"margin/allOrderList":100,"margin/openOrderList":5,"margin/myTrades":5,balance:4,account:4,"margin/maxBorrowable":1,"margin/maxWithdraw":1,"um/positionRisk":1,"cm/positionRisk":.2,"um/positionSide/dual":6,"cm/positionSide/dual":6,"um/userTrades":5,"cm/userTrades":20,"um/leverageBracket":.2,"cm/leverageBracket":.2,"margin/forceOrders":1,"um/forceOrders":{cost:20,noSymbol:50},"cm/forceOrders":{cost:20,noSymbol:50},"um/apiTradingStatus":{cost:.2,noSymbol:2},"um/commissionRate":4,"cm/commissionRate":4,"margin/marginLoan":2,"margin/repayLoan":2,"margin/marginInterestHistory":.2,"portfolio/interest-history":10,"um/income":6,"cm/income":6,"um/account":1,"cm/account":1,"repay-futures-switch":6,"um/adlQuantile":5,"cm/adlQuantile":5,"um/trade/asyn":300,"um/trade/asyn/id":2,"um/order/asyn":300,"um/order/asyn/id":2,"um/income/asyn":300,"um/income/asyn/id":2,"um/orderAmendment":1,"cm/orderAmendment":1,"um/feeBurn":30,"um/accountConfig":1,"um/symbolConfig":1,"cm/accountConfig":1,"cm/symbolConfig":1,"rateLimit/order":1},post:{"um/order":1,"um/conditional/order":1,"cm/order":1,"cm/conditional/order":1,"margin/order":1,marginLoan:100,repayLoan:100,"margin/order/oco":1,"um/leverage":.2,"cm/leverage":.2,"um/positionSide/dual":.2,"cm/positionSide/dual":.2,"auto-collection":150,"bnb-transfer":150,"repay-futures-switch":150,"repay-futures-negative-balance":150,listenKey:.2,"asset-collection":6,"margin/repay-debt":3e3,"um/feeBurn":1},put:{listenKey:.2,"um/order":1,"cm/order":1},delete:{"um/order":1,"um/conditional/order":1,"um/allOpenOrders":1,"um/conditional/allOpenOrders":1,"cm/order":1,"cm/conditional/order":1,"cm/allOpenOrders":1,"cm/conditional/allOpenOrders":1,"margin/order":2,"margin/allOpenOrders":5,"margin/orderList":2,listenKey:.2}}},fees:{trading:{feeSide:"get",tierBased:!1,percentage:!0,taker:this.parseNumber("0.001"),maker:this.parseNumber("0.001")},linear:{trading:{feeSide:"quote",tierBased:!0,percentage:!0,taker:this.parseNumber("0.000500"),maker:this.parseNumber("0.000200"),tiers:{taker:[[this.parseNumber("0"),this.parseNumber("0.000400")],[this.parseNumber("250"),this.parseNumber("0.000400")],[this.parseNumber("2500"),this.parseNumber("0.000350")],[this.parseNumber("7500"),this.parseNumber("0.000320")],[this.parseNumber("22500"),this.parseNumber("0.000300")],[this.parseNumber("50000"),this.parseNumber("0.000270")],[this.parseNumber("100000"),this.parseNumber("0.000250")],[this.parseNumber("200000"),this.parseNumber("0.000220")],[this.parseNumber("400000"),this.parseNumber("0.000200")],[this.parseNumber("750000"),this.parseNumber("0.000170")]],maker:[[this.parseNumber("0"),this.parseNumber("0.000200")],[this.parseNumber("250"),this.parseNumber("0.000160")],[this.parseNumber("2500"),this.parseNumber("0.000140")],[this.parseNumber("7500"),this.parseNumber("0.000120")],[this.parseNumber("22500"),this.parseNumber("0.000100")],[this.parseNumber("50000"),this.parseNumber("0.000080")],[this.parseNumber("100000"),this.parseNumber("0.000060")],[this.parseNumber("200000"),this.parseNumber("0.000040")],[this.parseNumber("400000"),this.parseNumber("0.000020")],[this.parseNumber("750000"),this.parseNumber("0")]]}}},inverse:{trading:{feeSide:"base",tierBased:!0,percentage:!0,taker:this.parseNumber("0.000500"),maker:this.parseNumber("0.000100"),tiers:{taker:[[this.parseNumber("0"),this.parseNumber("0.000500")],[this.parseNumber("250"),this.parseNumber("0.000450")],[this.parseNumber("2500"),this.parseNumber("0.000400")],[this.parseNumber("7500"),this.parseNumber("0.000300")],[this.parseNumber("22500"),this.parseNumber("0.000250")],[this.parseNumber("50000"),this.parseNumber("0.000240")],[this.parseNumber("100000"),this.parseNumber("0.000240")],[this.parseNumber("200000"),this.parseNumber("0.000240")],[this.parseNumber("400000"),this.parseNumber("0.000240")],[this.parseNumber("750000"),this.parseNumber("0.000240")]],maker:[[this.parseNumber("0"),this.parseNumber("0.000100")],[this.parseNumber("250"),this.parseNumber("0.000080")],[this.parseNumber("2500"),this.parseNumber("0.000050")],[this.parseNumber("7500"),this.parseNumber("0.0000030")],[this.parseNumber("22500"),this.parseNumber("0")],[this.parseNumber("50000"),this.parseNumber("-0.000050")],[this.parseNumber("100000"),this.parseNumber("-0.000060")],[this.parseNumber("200000"),this.parseNumber("-0.000070")],[this.parseNumber("400000"),this.parseNumber("-0.000080")],[this.parseNumber("750000"),this.parseNumber("-0.000090")]]}}},option:{}},currencies:{BNFCR:this.safeCurrencyStructure({id:"BNFCR",code:"BNFCR",precision:this.parseNumber("0.001")})},commonCurrencies:{BCC:"BCC",YOYO:"YOYOW"},precisionMode:o.kb,options:{sandboxMode:!1,fetchMargins:!0,fetchMarkets:{types:["spot","linear","inverse"]},loadAllOptions:!1,fetchCurrencies:!0,defaultTimeInForce:"GTC",defaultType:"spot",defaultSubType:void 0,hasAlreadyAuthenticatedSuccessfully:!1,warnOnFetchOpenOrdersWithoutSymbol:!0,throwMarginModeAlreadySet:!1,fetchPositions:"positionRisk",recvWindow:1e4,timeDifference:0,adjustForTimeDifference:!1,newOrderRespType:{market:"FULL",limit:"FULL"},quoteOrderQty:!0,broker:{spot:"x-TKT5PX2F",margin:"x-TKT5PX2F",future:"x-cvBPrNm9",delivery:"x-xcKtGhcu",swap:"x-cvBPrNm9",option:"x-xcKtGhcu",inverse:"x-xcKtGhcu"},accountsByType:{main:"MAIN",spot:"MAIN",funding:"FUNDING",margin:"MARGIN",cross:"MARGIN",future:"UMFUTURE",delivery:"CMFUTURE",linear:"UMFUTURE",swap:"UMFUTURE",inverse:"CMFUTURE",option:"OPTION"},accountsById:{MAIN:"spot",FUNDING:"funding",MARGIN:"margin",UMFUTURE:"linear",CMFUTURE:"inverse",OPTION:"option"},networks:{ERC20:"ETH",TRC20:"TRX",BEP2:"BNB",BEP20:"BSC",OMNI:"OMNI",EOS:"EOS",SPL:"SOL",SOL:"SOL"},networksById:{SOL:"SOL"},impliedNetworks:{ETH:{ERC20:"ETH"},TRX:{TRC20:"TRX"}},legalMoney:{MXN:!0,UGX:!0,SEK:!0,CHF:!0,VND:!0,AED:!0,DKK:!0,KZT:!0,HUF:!0,PEN:!0,PHP:!0,USD:!0,TRY:!0,EUR:!0,NGN:!0,PLN:!0,BRL:!0,ZAR:!0,KES:!0,ARS:!0,RUB:!0,AUD:!0,NOK:!0,CZK:!0,GBP:!0,UAH:!0,GHS:!0,HKD:!0,CAD:!0,INR:!0,JPY:!0,NZD:!0},legalMoneyCurrenciesById:{BUSD:"USD"},defaultWithdrawPrecision:1e-8},features:{spot:{sandbox:!0,createOrder:{marginMode:!0,triggerPrice:!0,triggerPriceType:void 0,triggerDirection:!1,stopLossPrice:!0,takeProfitPrice:!0,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!0,FOK:!0,PO:!0,GTD:!1},hedged:!0,leverage:!1,marketBuyByCost:!0,marketBuyRequiresPrice:!1,selfTradePrevention:{expire_maker:!0,expire_taker:!0,expire_both:!0,none:!0},trailing:!1,icebergAmount:!0},createOrders:void 0,fetchMyTrades:{marginMode:!1,limit:1e3,daysBack:void 0,untilDays:1,symbolRequired:!0},fetchOrder:{marginMode:!0,trigger:!1,trailing:!1,symbolRequired:!0},fetchOpenOrders:{marginMode:!0,limit:void 0,trigger:!1,trailing:!1,symbolRequired:!1},fetchOrders:{marginMode:!0,limit:1e3,daysBack:void 0,untilDays:1e4,trigger:!1,trailing:!1,symbolRequired:!0},fetchClosedOrders:{marginMode:!0,limit:1e3,daysBack:void 0,daysBackCanceled:void 0,untilDays:1e4,trigger:!1,trailing:!1,symbolRequired:!0},fetchOHLCV:{limit:1e3}},forDerivatives:{sandbox:!0,createOrder:{marginMode:!1,triggerPrice:!0,triggerPriceType:{mark:!0,last:!0,index:!1},stopLossPrice:!0,takeProfitPrice:!0,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!0,FOK:!0,PO:!0,GTD:!0},hedged:!0,selfTradePrevention:!0,trailing:!0,iceberg:!1,leverage:!1,marketBuyRequiresPrice:!1,marketBuyByCost:!0},createOrders:{max:5},fetchMyTrades:{marginMode:!1,daysBack:void 0,limit:1e3,untilDays:7,symbolRequired:!0},fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!0},fetchOpenOrders:{marginMode:!0,limit:500,trigger:!1,trailing:!1,symbolRequired:!1},fetchOrders:{marginMode:!0,limit:1e3,daysBack:90,untilDays:7,trigger:!1,trailing:!1,symbolRequired:!0},fetchClosedOrders:{marginMode:!0,limit:1e3,daysBack:90,daysBackCanceled:3,untilDays:7,trigger:!1,trailing:!1,symbolRequired:!0},fetchOHLCV:{limit:1500}},swap:{linear:{extends:"forDerivatives"},inverse:{extends:"forDerivatives"}},future:{linear:{extends:"forDerivatives"},inverse:{extends:"forDerivatives"}}},exceptions:{spot:{exact:{"-1004":r.OperationFailed,"-1008":r.OperationFailed,"-1099":r.AuthenticationError,"-1108":r.BadRequest,"-1131":r.BadRequest,"-1134":r.BadRequest,"-1135":r.BadRequest,"-1145":r.BadRequest,"-1151":r.BadSymbol,"-2008":r.AuthenticationError,"-2016":r.OperationRejected,"-2021":r.BadResponse,"-2022":r.BadResponse,"-2026":r.InvalidOrder,"-3000":r.OperationFailed,"-3001":r.AuthenticationError,"-3002":r.BadSymbol,"-3003":r.BadRequest,"-3004":r.OperationRejected,"-3005":r.BadRequest,"-3006":r.BadRequest,"-3007":r.OperationFailed,"-3008":r.BadRequest,"-3009":r.OperationRejected,"-3010":r.BadRequest,"-3011":r.BadRequest,"-3012":r.OperationRejected,"-3013":r.BadRequest,"-3014":r.AccountSuspended,"-3015":r.BadRequest,"-3016":r.BadRequest,"-3017":r.OperationRejected,"-3018":r.AccountSuspended,"-3019":r.AccountSuspended,"-3020":r.BadRequest,"-3021":r.BadRequest,"-3022":r.AccountSuspended,"-3023":r.OperationRejected,"-3024":r.OperationRejected,"-3025":r.BadRequest,"-3026":r.BadRequest,"-3027":r.BadSymbol,"-3028":r.BadSymbol,"-3029":r.OperationFailed,"-3036":r.AccountSuspended,"-3037":r.OperationFailed,"-3038":r.BadRequest,"-3041":r.InsufficientFunds,"-3042":r.BadRequest,"-3043":r.PermissionDenied,"-3044":r.OperationFailed,"-3045":r.OperationRejected,"-3999":r.PermissionDenied,"-4000":r.ExchangeError,"-4001":r.BadRequest,"-4002":r.BadRequest,"-4003":r.BadRequest,"-4004":r.AuthenticationError,"-4005":r.RateLimitExceeded,"-4006":r.BadRequest,"-4007":r.PermissionDenied,"-4008":r.PermissionDenied,"-4009":r.ExchangeError,"-4010":r.PermissionDenied,"-4011":r.BadRequest,"-4012":r.PermissionDenied,"-4013":r.AuthenticationError,"-4014":r.OperationRejected,"-4015":r.PermissionDenied,"-4016":r.PermissionDenied,"-4017":r.PermissionDenied,"-4018":r.BadSymbol,"-4019":r.BadRequest,"-4020":r.ExchangeError,"-4021":r.BadRequest,"-4022":r.BadRequest,"-4023":r.OperationRejected,"-4024":r.InsufficientFunds,"-4025":r.InsufficientFunds,"-4026":r.InsufficientFunds,"-4027":r.OperationFailed,"-4028":r.BadRequest,"-4029":r.BadRequest,"-4030":r.BadResponse,"-4031":r.OperationFailed,"-4032":r.OperationRejected,"-4033":r.BadRequest,"-4034":r.OperationRejected,"-4035":r.PermissionDenied,"-4036":r.PermissionDenied,"-4037":r.OperationFailed,"-4038":r.OperationFailed,"-4039":r.PermissionDenied,"-4040":r.OperationRejected,"-4041":r.OperationFailed,"-4042":r.OperationRejected,"-4043":r.OperationRejected,"-4044":r.PermissionDenied,"-4045":r.OperationFailed,"-4046":r.AuthenticationError,"-4047":r.BadRequest,"-4048":r.ExchangeError,"-4049":r.ExchangeError,"-4050":r.ExchangeError,"-4051":r.ExchangeError,"-4052":r.ExchangeError,"-4053":r.ExchangeError,"-4054":r.ExchangeError,"-4055":r.ExchangeError,"-4056":r.ExchangeError,"-4057":r.ExchangeError,"-4058":r.ExchangeError,"-4059":r.ExchangeError,"-4060":r.OperationFailed,"-4061":r.ExchangeError,"-4062":r.ExchangeError,"-4063":r.ExchangeError,"-4064":r.ExchangeError,"-4065":r.ExchangeError,"-4066":r.ExchangeError,"-4067":r.ExchangeError,"-4068":r.ExchangeError,"-4069":r.ExchangeError,"-4070":r.ExchangeError,"-4071":r.ExchangeError,"-4072":r.ExchangeError,"-4073":r.ExchangeError,"-4074":r.ExchangeError,"-4075":r.ExchangeError,"-4076":r.ExchangeError,"-4077":r.ExchangeError,"-4078":r.ExchangeError,"-4079":r.ExchangeError,"-4080":r.ExchangeError,"-4081":r.ExchangeError,"-4082":r.ExchangeError,"-4083":r.ExchangeError,"-4084":r.ExchangeError,"-4085":r.ExchangeError,"-4086":r.ExchangeError,"-4087":r.ExchangeError,"-4088":r.ExchangeError,"-4089":r.ExchangeError,"-4091":r.ExchangeError,"-4092":r.ExchangeError,"-4093":r.ExchangeError,"-4094":r.ExchangeError,"-4095":r.ExchangeError,"-4096":r.ExchangeError,"-4097":r.ExchangeError,"-4098":r.ExchangeError,"-4099":r.ExchangeError,"-4101":r.ExchangeError,"-4102":r.ExchangeError,"-4103":r.ExchangeError,"-4104":r.ExchangeError,"-4105":r.ExchangeError,"-4106":r.ExchangeError,"-4107":r.ExchangeError,"-4108":r.ExchangeError,"-4109":r.ExchangeError,"-4110":r.ExchangeError,"-4112":r.ExchangeError,"-4113":r.ExchangeError,"-4114":r.ExchangeError,"-4115":r.ExchangeError,"-4116":r.ExchangeError,"-4117":r.ExchangeError,"-4118":r.ExchangeError,"-4119":r.ExchangeError,"-4120":r.ExchangeError,"-4121":r.ExchangeError,"-4122":r.ExchangeError,"-4123":r.ExchangeError,"-4124":r.ExchangeError,"-4125":r.ExchangeError,"-4126":r.ExchangeError,"-4127":r.ExchangeError,"-4128":r.ExchangeError,"-4129":r.ExchangeError,"-4130":r.ExchangeError,"-4131":r.ExchangeError,"-4132":r.ExchangeError,"-4133":r.ExchangeError,"-4134":r.ExchangeError,"-4135":r.ExchangeError,"-4136":r.ExchangeError,"-4137":r.ExchangeError,"-4138":r.ExchangeError,"-4139":r.ExchangeError,"-4141":r.ExchangeError,"-4142":r.ExchangeError,"-4143":r.ExchangeError,"-4144":r.ExchangeError,"-4145":r.ExchangeError,"-4146":r.ExchangeError,"-4147":r.ExchangeError,"-4148":r.ExchangeError,"-4149":r.ExchangeError,"-4150":r.ExchangeError,"-5001":r.BadRequest,"-5002":r.InsufficientFunds,"-5003":r.InsufficientFunds,"-5004":r.OperationRejected,"-5005":r.OperationRejected,"-5006":r.OperationRejected,"-5007":r.BadRequest,"-5008":r.OperationRejected,"-5009":r.BadSymbol,"-5010":r.OperationFailed,"-5011":r.BadRequest,"-5012":r.OperationFailed,"-5013":r.InsufficientFunds,"-5021":r.BadRequest,"-5022":r.BadRequest,"-6001":r.BadSymbol,"-6003":r.PermissionDenied,"-6004":r.BadRequest,"-6005":r.BadRequest,"-6006":r.BadRequest,"-6007":r.OperationRejected,"-6008":r.OperationRejected,"-6009":r.RateLimitExceeded,"-6011":r.OperationRejected,"-6012":r.InsufficientFunds,"-6013":r.BadResponse,"-6014":r.OperationRejected,"-6015":r.BadRequest,"-6016":r.BadRequest,"-6017":r.PermissionDenied,"-6018":r.InsufficientFunds,"-6019":r.OperationRejected,"-6020":r.BadRequest,"-7001":r.BadRequest,"-7002":r.BadRequest,"-10001":r.OperationFailed,"-10002":r.BadRequest,"-10005":r.BadResponse,"-10007":r.BadRequest,"-10008":r.BadRequest,"-10009":r.BadRequest,"-10010":r.BadRequest,"-10011":r.InsufficientFunds,"-10012":r.BadRequest,"-10013":r.InsufficientFunds,"-10015":r.OperationFailed,"-10016":r.OperationFailed,"-10017":r.OperationRejected,"-10018":r.BadRequest,"-10019":r.BadRequest,"-10020":r.BadRequest,"-10021":r.InvalidOrder,"-10022":r.BadRequest,"-10023":r.OperationFailed,"-10024":r.BadRequest,"-10025":r.OperationFailed,"-10026":r.BadRequest,"-10028":r.BadRequest,"-10029":r.OperationRejected,"-10030":r.OperationRejected,"-10031":r.OperationRejected,"-10032":r.OperationFailed,"-10034":r.OperationRejected,"-10039":r.OperationRejected,"-10040":r.OperationRejected,"-10041":r.OperationFailed,"-10042":r.BadSymbol,"-10043":r.OperationRejected,"-10044":r.OperationRejected,"-10045":r.OperationRejected,"-10046":r.OperationRejected,"-10047":r.PermissionDenied,"-11008":r.OperationRejected,"-12014":r.RateLimitExceeded,"-13000":r.OperationRejected,"-13001":r.OperationRejected,"-13002":r.OperationRejected,"-13003":r.PermissionDenied,"-13004":r.OperationRejected,"-13005":r.OperationRejected,"-13006":r.OperationRejected,"-13007":r.PermissionDenied,"-18002":r.OperationRejected,"-18003":r.OperationRejected,"-18004":r.OperationRejected,"-18005":r.PermissionDenied,"-18006":r.OperationRejected,"-18007":r.OperationRejected,"-21001":r.BadRequest,"-21002":r.BadRequest,"-21003":r.BadResponse,"-21004":r.OperationRejected,"-21005":r.InsufficientFunds,"-21006":r.OperationFailed,"-21007":r.OperationFailed,"-32603":r.BadRequest,400002:r.BadRequest,100001003:r.AuthenticationError,200003903:r.AuthenticationError}},linear:{exact:{"-1005":r.PermissionDenied,"-1008":r.OperationFailed,"-1011":r.PermissionDenied,"-1023":r.BadRequest,"-1099":r.AuthenticationError,"-1109":r.PermissionDenied,"-1110":r.BadRequest,"-1113":r.BadRequest,"-1122":r.BadRequest,"-1126":r.BadSymbol,"-1136":r.BadRequest,"-2012":r.OperationFailed,"-2016":r.OperationRejected,"-2017":r.PermissionDenied,"-2018":r.InsufficientFunds,"-2019":r.InsufficientFunds,"-2020":r.OperationFailed,"-2021":r.OrderImmediatelyFillable,"-2022":r.InvalidOrder,"-2023":r.OperationFailed,"-2024":r.InsufficientFunds,"-2025":r.OperationRejected,"-2026":r.InvalidOrder,"-2027":r.OperationRejected,"-2028":r.OperationRejected,"-4063":r.BadRequest,"-4064":r.BadRequest,"-4065":r.BadRequest,"-4066":r.BadRequest,"-4069":r.BadRequest,"-4070":r.BadRequest,"-4071":r.BadRequest,"-4072":r.OperationRejected,"-4073":r.BadRequest,"-4074":r.OperationRejected,"-4075":r.BadRequest,"-4076":r.OperationRejected,"-4077":r.OperationRejected,"-4078":r.OperationFailed,"-4079":r.BadRequest,"-4080":r.PermissionDenied,"-4081":r.BadRequest,"-4085":r.BadRequest,"-4087":r.PermissionDenied,"-4088":r.PermissionDenied,"-4114":r.BadRequest,"-4115":r.BadRequest,"-4116":r.InvalidOrder,"-4117":r.OperationRejected,"-4118":r.OperationRejected,"-4131":r.OperationRejected,"-4140":r.BadRequest,"-4141":r.OperationRejected,"-4144":r.BadSymbol,"-4164":r.InvalidOrder,"-4136":r.InvalidOrder,"-4165":r.BadRequest,"-4167":r.BadRequest,"-4168":r.BadRequest,"-4169":r.OperationRejected,"-4170":r.OperationRejected,"-4171":r.OperationRejected,"-4172":r.OperationRejected,"-4183":r.BadRequest,"-4184":r.BadRequest,"-4192":r.PermissionDenied,"-4202":r.PermissionDenied,"-4203":r.PermissionDenied,"-4205":r.PermissionDenied,"-4206":r.PermissionDenied,"-4208":r.OperationRejected,"-4209":r.OperationRejected,"-4210":r.BadRequest,"-4211":r.BadRequest,"-4400":r.PermissionDenied,"-4401":r.PermissionDenied,"-4402":r.PermissionDenied,"-4403":r.PermissionDenied,"-5021":r.OrderNotFillable,"-5022":r.OrderNotFillable,"-5024":r.OperationRejected,"-5025":r.OperationRejected,"-5026":r.OperationRejected,"-5027":r.OperationRejected,"-5028":r.BadRequest,"-5037":r.BadRequest,"-5038":r.BadRequest,"-5039":r.BadRequest,"-5040":r.BadRequest,"-5041":r.OperationFailed}},inverse:{exact:{"-1005":r.PermissionDenied,"-1011":r.PermissionDenied,"-1023":r.BadRequest,"-1109":r.AuthenticationError,"-1110":r.BadSymbol,"-1113":r.BadRequest,"-1128":r.BadRequest,"-1136":r.BadRequest,"-2016":r.OperationRejected,"-2018":r.InsufficientFunds,"-2019":r.InsufficientFunds,"-2020":r.OperationFailed,"-2021":r.OrderImmediatelyFillable,"-2022":r.InvalidOrder,"-2023":r.OperationFailed,"-2024":r.BadRequest,"-2025":r.OperationRejected,"-2026":r.InvalidOrder,"-2027":r.OperationRejected,"-2028":r.OperationRejected,"-4086":r.BadRequest,"-4087":r.BadSymbol,"-4088":r.BadRequest,"-4089":r.PermissionDenied,"-4090":r.PermissionDenied,"-4110":r.BadRequest,"-4111":r.BadRequest,"-4112":r.OperationRejected,"-4113":r.OperationRejected,"-4150":r.OperationRejected,"-4151":r.BadRequest,"-4152":r.BadRequest,"-4154":r.BadRequest,"-4155":r.BadRequest,"-4178":r.BadRequest,"-4188":r.BadRequest,"-4192":r.PermissionDenied,"-4194":r.PermissionDenied,"-4195":r.PermissionDenied,"-4196":r.BadRequest,"-4197":r.OperationRejected,"-4198":r.OperationRejected,"-4199":r.BadRequest,"-4200":r.PermissionDenied,"-4201":r.PermissionDenied,"-4202":r.OperationRejected}},option:{exact:{"-1003":r.ExchangeError,"-1004":r.ExchangeError,"-1006":r.ExchangeError,"-1007":r.ExchangeError,"-1008":r.RateLimitExceeded,"-1010":r.ExchangeError,"-1013":r.ExchangeError,"-1108":r.ExchangeError,"-1112":r.ExchangeError,"-1114":r.ExchangeError,"-1128":r.BadSymbol,"-1129":r.BadSymbol,"-1131":r.BadRequest,"-2011":r.ExchangeError,"-2018":r.InsufficientFunds,"-2027":r.InsufficientFunds,"-3029":r.OperationFailed,"-4006":r.ExchangeError,"-4007":r.ExchangeError,"-4008":r.ExchangeError,"-4009":r.ExchangeError,"-4010":r.ExchangeError,"-4011":r.ExchangeError,"-4012":r.ExchangeError,"-4014":r.ExchangeError,"-4015":r.ExchangeError,"-4016":r.ExchangeError,"-4017":r.ExchangeError,"-4018":r.ExchangeError,"-4019":r.ExchangeError,"-4020":r.ExchangeError,"-4021":r.ExchangeError,"-4022":r.ExchangeError,"-4023":r.ExchangeError,"-4024":r.ExchangeError,"-4025":r.ExchangeError,"-4026":r.ExchangeError,"-4027":r.ExchangeError,"-4028":r.ExchangeError,"-4031":r.ExchangeError,"-4032":r.ExchangeError,"-4033":r.ExchangeError,"-4034":r.ExchangeError,"-4035":r.ExchangeError,"-4036":r.ExchangeError,"-4037":r.ExchangeError,"-4038":r.ExchangeError,"-4039":r.ExchangeError,"-4040":r.ExchangeError,"-4041":r.ExchangeError,"-4042":r.ExchangeError,"-4043":r.ExchangeError,"-4044":r.ExchangeError,"-4045":r.ExchangeError,"-4046":r.ExchangeError,"-4047":r.ExchangeError,"-4048":r.ExchangeError,"-4049":r.ExchangeError,"-4050":r.ExchangeError,"-4051":r.ExchangeError,"-4052":r.ExchangeError,"-4053":r.ExchangeError,"-4054":r.ExchangeError,"-4056":r.ExchangeError,"-4057":r.ExchangeError,"-4058":r.ExchangeError,"-4059":r.ExchangeError,"-4060":r.ExchangeError,"-4061":r.ExchangeError,"-4062":r.ExchangeError,"-4063":r.ExchangeError,"-4064":r.ExchangeError,"-4065":r.ExchangeError,"-4066":r.ExchangeError,"-4067":r.ExchangeError,"-4068":r.ExchangeError,"-4069":r.ExchangeError,"-4070":r.ExchangeError,"-4071":r.ExchangeError,"-4072":r.ExchangeError,"-4073":r.ExchangeError,"-4074":r.ExchangeError,"-4075":r.ExchangeError,"-4076":r.ExchangeError,"-4077":r.ExchangeError,"-4078":r.ExchangeError,"-4079":r.ExchangeError,"-4080":r.ExchangeError,"-4081":r.ExchangeError,"-4082":r.ExchangeError,"-4083":r.ExchangeError,"-4084":r.ExchangeError,"-4085":r.ExchangeError,"-4086":r.ExchangeError,"-4087":r.ExchangeError,"-4088":r.ExchangeError,"-4089":r.ExchangeError,"-4091":r.ExchangeError,"-4092":r.ExchangeError,"-4093":r.ExchangeError,"-4094":r.ExchangeError,"-4095":r.ExchangeError,"-4096":r.ExchangeError,"-4097":r.ExchangeError,"-4098":r.ExchangeError,"-4099":r.ExchangeError,"-4101":r.ExchangeError,"-4102":r.ExchangeError,"-4103":r.ExchangeError,"-4104":r.ExchangeError,"-4105":r.ExchangeError,"-4106":r.ExchangeError,"-4107":r.ExchangeError,"-4108":r.ExchangeError,"-4109":r.ExchangeError,"-4110":r.ExchangeError,"-4112":r.ExchangeError,"-4113":r.ExchangeError,"-4114":r.ExchangeError,"-4115":r.ExchangeError,"-4116":r.ExchangeError,"-4117":r.ExchangeError,"-4118":r.ExchangeError,"-4119":r.ExchangeError,"-4120":r.ExchangeError,"-4121":r.ExchangeError,"-4122":r.ExchangeError,"-4123":r.ExchangeError,"-4124":r.ExchangeError,"-4125":r.ExchangeError,"-4126":r.ExchangeError,"-4127":r.ExchangeError,"-4128":r.ExchangeError,"-4129":r.ExchangeError,"-4130":r.ExchangeError,"-4131":r.ExchangeError,"-4132":r.ExchangeError,"-4133":r.ExchangeError,"-4134":r.ExchangeError,"-4135":r.ExchangeError,"-4136":r.ExchangeError,"-4137":r.ExchangeError,"-4138":r.ExchangeError,"-4139":r.ExchangeError,"-4141":r.ExchangeError,"-4142":r.ExchangeError,"-4143":r.ExchangeError,"-4144":r.ExchangeError,"-4145":r.ExchangeError,"-4146":r.ExchangeError,"-4147":r.ExchangeError,"-4148":r.ExchangeError,"-4149":r.ExchangeError,"-4150":r.ExchangeError,"-20121":r.ExchangeError,"-20124":r.ExchangeError,"-20130":r.ExchangeError,"-20132":r.ExchangeError,"-20194":r.ExchangeError,"-20195":r.ExchangeError,"-20196":r.ExchangeError,"-20198":r.ExchangeError,"-20204":r.ExchangeError}},portfolioMargin:{exact:{"-1000":r.OperationFailed,"-1001":r.ExchangeError,"-1002":r.PermissionDenied,"-1003":r.RateLimitExceeded,"-1004":r.BadRequest,"-1005":r.PermissionDenied,"-1006":r.BadResponse,"-1007":r.BadResponse,"-1008":r.OperationFailed,"-1010":r.ExchangeError,"-1011":r.PermissionDenied,"-1013":r.ExchangeError,"-1014":r.InvalidOrder,"-1015":r.InvalidOrder,"-1016":r.NotSupported,"-1020":r.NotSupported,"-1021":r.BadRequest,"-1022":r.BadRequest,"-1023":r.BadRequest,"-1099":r.OperationFailed,"-1100":r.BadRequest,"-1101":r.BadRequest,"-1102":r.BadRequest,"-1103":r.BadRequest,"-1104":r.BadRequest,"-1105":r.BadRequest,"-1106":r.BadRequest,"-1108":r.BadRequest,"-1109":r.BadRequest,"-1110":r.BadSymbol,"-1111":r.BadRequest,"-1112":r.BadRequest,"-1113":r.BadRequest,"-1114":r.BadRequest,"-1115":r.BadRequest,"-1116":r.BadRequest,"-1117":r.BadRequest,"-1118":r.BadRequest,"-1119":r.BadRequest,"-1120":r.BadRequest,"-1121":r.BadSymbol,"-1125":r.BadRequest,"-1127":r.BadRequest,"-1128":r.BadRequest,"-1130":r.BadRequest,"-1131":r.BadRequest,"-1134":r.BadRequest,"-1136":r.BadRequest,"-1145":r.BadRequest,"-1151":r.BadRequest,"-2010":r.InvalidOrder,"-2011":r.OperationRejected,"-2013":r.OrderNotFound,"-2014":r.OperationRejected,"-2015":r.OperationRejected,"-2016":r.OperationFailed,"-2018":r.OperationFailed,"-2019":r.OperationFailed,"-2020":r.OrderNotFillable,"-2021":r.OrderImmediatelyFillable,"-2022":r.InvalidOrder,"-2023":r.OperationFailed,"-2024":r.OperationRejected,"-2025":r.OperationRejected,"-2026":r.InvalidOrder,"-2027":r.OperationRejected,"-2028":r.OperationRejected,"-4000":r.BadRequest,"-4001":r.BadRequest,"-4002":r.BadRequest,"-4003":r.BadRequest,"-4004":r.BadRequest,"-4005":r.BadRequest,"-4006":r.BadRequest,"-4007":r.BadRequest,"-4008":r.BadRequest,"-4009":r.BadRequest,"-4010":r.BadRequest,"-4011":r.BadRequest,"-4012":r.BadRequest,"-4013":r.BadRequest,"-4014":r.BadRequest,"-4015":r.BadRequest,"-4016":r.BadRequest,"-4017":r.BadRequest,"-4018":r.BadRequest,"-4019":r.BadRequest,"-4020":r.BadRequest,"-4021":r.BadRequest,"-4022":r.BadRequest,"-4023":r.BadRequest,"-4024":r.BadRequest,"-4025":r.BadRequest,"-4026":r.BadRequest,"-4027":r.BadRequest,"-4028":r.BadRequest,"-4029":r.BadRequest,"-4030":r.BadRequest,"-4031":r.BadRequest,"-4032":r.BadRequest,"-4033":r.BadRequest,"-4044":r.BadRequest,"-4045":r.BadRequest,"-4046":r.BadRequest,"-4047":r.BadRequest,"-4048":r.BadRequest,"-4049":r.BadRequest,"-4050":r.BadRequest,"-4051":r.BadRequest,"-4052":r.BadRequest,"-4053":r.BadRequest,"-4054":r.BadRequest,"-4055":r.BadRequest,"-4056":r.PermissionDenied,"-4057":r.PermissionDenied,"-4058":r.BadRequest,"-4059":r.BadRequest,"-4060":r.BadRequest,"-4061":r.InvalidOrder,"-4062":r.BadRequest,"-4063":r.BadRequest,"-4064":r.BadRequest,"-4065":r.BadRequest,"-4066":r.BadRequest,"-4067":r.BadRequest,"-4068":r.BadRequest,"-4069":r.BadRequest,"-4070":r.BadRequest,"-4071":r.BadRequest,"-4072":r.OperationRejected,"-4073":r.BadRequest,"-4074":r.BadRequest,"-4075":r.BadRequest,"-4076":r.OperationRejected,"-4077":r.OperationRejected,"-4078":r.OperationFailed,"-4079":r.BadRequest,"-4080":r.PermissionDenied,"-4081":r.BadRequest,"-4082":r.BadRequest,"-4083":r.BadRequest,"-4084":r.NotSupported,"-4085":r.BadRequest,"-4086":r.BadRequest,"-4087":r.PermissionDenied,"-4088":r.PermissionDenied,"-4104":r.BadRequest,"-4114":r.BadRequest,"-4115":r.BadRequest,"-4118":r.OperationRejected,"-4131":r.OperationRejected,"-4135":r.BadRequest,"-4137":r.BadRequest,"-4138":r.BadRequest,"-4139":r.BadRequest,"-4140":r.OrderImmediatelyFillable,"-4141":r.BadRequest,"-4142":r.OrderImmediatelyFillable,"-4144":r.BadSymbol,"-4161":r.OperationRejected,"-4164":r.InvalidOrder,"-4165":r.BadRequest,"-4183":r.InvalidOrder,"-4184":r.InvalidOrder,"-4408":r.InvalidOrder,"-5021":r.OrderNotFillable,"-5022":r.OrderNotFillable,"-5028":r.OperationFailed,"-5041":r.RateLimitExceeded}},exact:{"-1000":r.OperationFailed,"-1001":r.OperationFailed,"-1002":r.AuthenticationError,"-1003":r.RateLimitExceeded,"-1004":r.OperationRejected,"-1006":r.OperationFailed,"-1007":r.RequestTimeout,"-1010":r.OperationFailed,"-1013":r.BadRequest,"-1014":r.InvalidOrder,"-1015":r.RateLimitExceeded,"-1016":r.BadRequest,"-1020":r.BadRequest,"-1021":r.InvalidNonce,"-1022":r.AuthenticationError,"-1100":r.BadRequest,"-1101":r.BadRequest,"-1102":r.BadRequest,"-1103":r.BadRequest,"-1104":r.BadRequest,"-1105":r.BadRequest,"-1106":r.BadRequest,"-1108":r.BadSymbol,"-1111":r.BadRequest,"-1112":r.OperationFailed,"-1114":r.BadRequest,"-1115":r.BadRequest,"-1116":r.BadRequest,"-1117":r.BadRequest,"-1118":r.BadRequest,"-1119":r.BadRequest,"-1120":r.BadRequest,"-1121":r.BadSymbol,"-1125":r.AuthenticationError,"-1127":r.BadRequest,"-1128":r.BadRequest,"-1130":r.BadRequest,"-2010":r.InvalidOrder,"-2011":r.OrderNotFound,"-2013":r.OrderNotFound,"-2014":r.AuthenticationError,"-2015":r.AuthenticationError,"-4000":r.InvalidOrder,"-4001":r.BadRequest,"-4002":r.BadRequest,"-4003":r.BadRequest,"-4004":r.BadRequest,"-4005":r.BadRequest,"-4006":r.BadRequest,"-4007":r.BadRequest,"-4008":r.BadRequest,"-4009":r.BadRequest,"-4010":r.BadRequest,"-4011":r.BadRequest,"-4012":r.BadRequest,"-4013":r.BadRequest,"-4014":r.BadRequest,"-4015":r.BadRequest,"-4016":r.BadRequest,"-4017":r.BadRequest,"-4018":r.BadRequest,"-4019":r.OperationRejected,"-4020":r.BadRequest,"-4021":r.BadRequest,"-4022":r.BadRequest,"-4023":r.BadRequest,"-4024":r.BadRequest,"-4025":r.BadRequest,"-4026":r.BadRequest,"-4027":r.BadRequest,"-4028":r.BadRequest,"-4029":r.BadRequest,"-4030":r.BadRequest,"-4031":r.BadRequest,"-4032":r.OperationRejected,"-4033":r.BadRequest,"-4044":r.BadRequest,"-4045":r.OperationRejected,"-4046":r.OperationRejected,"-4047":r.OperationRejected,"-4048":r.OperationRejected,"-4049":r.BadRequest,"-4050":r.InsufficientFunds,"-4051":r.InsufficientFunds,"-4052":r.OperationRejected,"-4053":r.BadRequest,"-4054":r.OperationRejected,"-4055":r.BadRequest,"-4056":r.AuthenticationError,"-4057":r.AuthenticationError,"-4058":r.BadRequest,"-4059":r.OperationRejected,"-4060":r.BadRequest,"-4061":r.OperationRejected,"-4062":r.BadRequest,"-4067":r.OperationRejected,"-4068":r.OperationRejected,"-4082":r.BadRequest,"-4083":r.OperationRejected,"-4084":r.BadRequest,"-4086":r.BadRequest,"-4104":r.BadRequest,"-4135":r.BadRequest,"-4137":r.BadRequest,"-4138":r.BadRequest,"-4139":r.BadRequest,"-4142":r.OrderImmediatelyFillable,"-20121":r.BadSymbol,"-20124":r.BadRequest,"-20130":r.BadRequest,"-20132":r.BadRequest,"-20194":r.BadRequest,"-20195":r.BadRequest,"-20196":r.BadRequest,"-20198":r.OperationRejected,"-20204":r.BadRequest,"System is under maintenance.":r.OnMaintenance,"System abnormality":r.OperationFailed,"You are not authorized to execute this request.":r.PermissionDenied,"API key does not exist":r.AuthenticationError,"Order would trigger immediately.":r.OrderImmediatelyFillable,"Stop price would trigger immediately.":r.OrderImmediatelyFillable,"Order would immediately match and take.":r.OrderImmediatelyFillable,"Account has insufficient balance for requested action.":r.InsufficientFunds,"Rest API trading is not enabled.":r.PermissionDenied,"This account may not place or cancel orders.":r.PermissionDenied,"You don't have permission.":r.PermissionDenied,"Market is closed.":r.MarketClosed,"Too many requests. Please try again later.":r.RateLimitExceeded,"This action is disabled on this account.":r.AccountSuspended,"Limit orders require GTC for this phase.":r.BadRequest,"This order type is not possible in this trading phase.":r.BadRequest,"This type of sub-account exceeds the maximum number limit":r.OperationRejected,"This symbol is restricted for this account.":r.PermissionDenied,"This symbol is not permitted for this account.":r.PermissionDenied},broad:{"has no operation privilege":r.PermissionDenied,MAX_POSITION:r.BadRequest}}})}isInverse(e,t=void 0){return void 0===t?"delivery"===e:"inverse"===t}isLinear(e,t=void 0){return void 0===t?"future"===e||"swap"===e:"linear"===t}setSandboxMode(e){super.setSandboxMode(e),this.options.sandboxMode=e}createExpiredOptionMarket(e){const t="USDT",i=e.split("-"),s=e.split("/");let r;r=e.indexOf("/")>-1?this.safeString(s,0):this.safeString(i,0);const a=this.safeString(i,1),o=this.safeInteger(i,2),n=this.safeString(i,2),d=this.safeString(i,3),h=this.convertExpireDate(a);return{id:r+"-"+a+"-"+n+"-"+d,symbol:r+"/"+t+":"+t+"-"+a+"-"+n+"-"+d,base:r,quote:t,baseId:r,quoteId:t,active:void 0,type:"option",linear:void 0,inverse:void 0,spot:!1,swap:!1,future:!1,option:!0,margin:!1,contract:!0,contractSize:void 0,expiry:this.parse8601(h),expiryDatetime:h,optionType:"C"===d?"call":"put",strike:o,settle:t,settleId:t,precision:{amount:void 0,price:void 0},limits:{amount:{min:void 0,max:void 0},price:{min:void 0,max:void 0},cost:{min:void 0,max:void 0}},info:void 0}}market(e){if(void 0===this.markets)throw new r.ExchangeError(this.id+" markets not loaded");let t=this.safeString(this.options,"defaultType");const i=this.safeString(this.options,"defaultSubType"),s="future"===t,a="delivery"===t,o=s||a;if("string"==typeof e)if(e in this.markets){const t=this.markets[e];if(!o||!t.spot)return t;{const i=e+":"+(s?t.quote:t.base);if(i in this.markets)return this.markets[i]}}else{if(e in this.markets_by_id){const r=this.markets_by_id[e];s?t="linear":a?t="inverse":void 0===t&&(t=i);for(let e=0;e-1&&e.indexOf(":")<0){if(void 0!==t&&"spot"!==t){const[t,i]=e.split("/"),s=e+":"+("USD"===i?t:i);if(s in this.markets)return this.markets[s]}}else if(e.indexOf("-C")>-1||e.indexOf("-P")>-1)return this.createExpiredOptionMarket(e)}throw new r.BadSymbol(this.id+" does not have market symbol "+e)}safeMarket(e=void 0,t=void 0,i=void 0,s=void 0){return void 0!==e&&(e.indexOf("-C")>-1||e.indexOf("-P")>-1)&&!(e in this.markets_by_id)?this.createExpiredOptionMarket(e):super.safeMarket(e,t,i,s)}costToPrecision(e,t){return this.decimalToPrecision(t,o.R3,this.markets[e].precision.quote,this.precisionMode,this.paddingMode)}currencyToPrecision(e,t,i=void 0){return void 0!==this.safeValue(this.currencies[e],"precision")?this.decimalToPrecision(t,o.R3,this.currencies[e].precision,this.precisionMode,this.paddingMode):this.numberToString(t)}nonce(){return this.milliseconds()-this.options.timeDifference}async fetchTime(e={}){const t=this.safeString2(this.options,"fetchTime","defaultType","spot"),i=this.safeString(e,"type",t),s=this.omit(e,"type");let r,a;return[r,e]=this.handleSubTypeAndParams("fetchTime",void 0,e),a=this.isLinear(i,r)?await this.fapiPublicGetTime(s):this.isInverse(i,r)?await this.dapiPublicGetTime(s):await this.publicGetTime(s),this.safeInteger(a,"serverTime")}async fetchCurrencies(e={}){if(!this.safeBool(this.options,"fetchCurrencies"))return;if(!this.checkRequiredCredentials(!1))return;if(void 0!==this.safeValue(this.urls,"apiBackup"))return;const t=[this.sapiGetCapitalConfigGetall(e)],i=this.safeBool(this.options,"fetchMargins",!1);i&&t.push(this.sapiGetMarginAllPairs(e));const s=await Promise.all(t),r=s[0];let o;if(i){const e=s[1];o=this.indexBy(e,"assetName")}const n={};for(let e=0;e0)){const e=this.parseTimeframe(t),r=this.sum(i,s*e*1e3-1),a=this.milliseconds();h.endTime=Math.min(a,r)}let l;void 0!==d&&(h.endTime=d),l=o.option?await this.eapiPublicGetKlines(this.extend(h,r)):"mark"===n?o.inverse?await this.dapiPublicGetMarkPriceKlines(this.extend(h,r)):await this.fapiPublicGetMarkPriceKlines(this.extend(h,r)):"index"===n?o.inverse?await this.dapiPublicGetIndexPriceKlines(this.extend(h,r)):await this.fapiPublicGetIndexPriceKlines(this.extend(h,r)):"premiumIndex"===n?o.inverse?await this.dapiPublicGetPremiumIndexKlines(this.extend(h,r)):await this.fapiPublicGetPremiumIndexKlines(this.extend(h,r)):o.linear?await this.fapiPublicGetKlines(this.extend(h,r)):o.inverse?await this.dapiPublicGetKlines(this.extend(h,r)):await this.publicGetKlines(this.extend(h,r));return this.parseOHLCVs(l,o,t,i,s)}parseTrade(e,t=void 0){if("isDustTrade"in e)return this.parseDustTrade(e,t);const i=this.safeInteger2(e,"T","time");let s=this.safeString2(e,"q","qty");s=this.safeString(e,"quantity",s);const r=this.safeString(e,"symbol"),o="isIsolated"in e||"M"in e||"orderListId"in e||"isMaker"in e?"spot":"contract",n=(t=this.safeMarket(r,t,void 0,o)).symbol;let d;const h=this.safeBool2(e,"m","isBuyerMaker");let c,l;if(void 0!==h?d=h?"sell":"buy":"side"in e?d=this.safeStringLower(e,"side"):"isBuyer"in e&&(d=e.isBuyer?"buy":"sell"),"commission"in e&&(l={cost:this.safeString(e,"commission"),currency:this.safeCurrencyCode(this.safeString(e,"commissionAsset"))}),"isMaker"in e&&(c=e.isMaker?"maker":"taker"),"maker"in e&&(c=e.maker?"maker":"taker"),"optionSide"in e||t.option){const t=this.safeCurrencyCode(this.safeString(e,"quoteAsset","USDT"));c=this.safeStringLower(e,"liquidity"),"fee"in e&&(l={cost:this.safeString(e,"fee"),currency:t}),"buy"!==d&&"sell"!==d&&(d="1"===d?"buy":"sell"),"optionSide"in e&&"buy"!==d&&(s=a.Y.stringMul("-1",s))}return this.safeTrade({info:e,timestamp:i,datetime:this.iso8601(i),symbol:n,id:this.safeStringN(e,["t","a","tradeId","id"]),order:this.safeString(e,"orderId"),type:this.safeStringLower(e,"type"),side:d,takerOrMaker:c,price:this.safeString2(e,"p","price"),amount:s,cost:this.safeString2(e,"quoteQty","baseQty"),fee:l},t)}async fetchTrades(e,t=void 0,i=void 0,s={}){await this.loadMarkets();let r=!1;if([r,s]=this.handleOptionAndParams(s,"fetchTrades","paginate"),r)return await this.fetchPaginatedCallDynamic("fetchTrades",e,t,i,s);const a=this.market(e),o={symbol:a.id};if(!a.option){void 0!==t&&(o.startTime=t,o.endTime=this.sum(t,36e5));const e=this.safeInteger(s,"until");void 0!==e&&(o.endTime=e)}let n,d=this.safeString(this.options,"fetchTradesMethod");if(d=this.safeString2(s,"fetchTradesMethod","method",d),void 0!==i){const e=a.swap||a.future,t=void 0!==d&&d.indexOf("GetHistoricalTrades")>=0?500:1e3;o.limit=e?Math.min(i,t):i}return s=this.omit(s,["until","fetchTradesMethod"]),n=a.option||"eapiPublicGetTrades"===d?await this.eapiPublicGetTrades(this.extend(o,s)):a.linear||"fapiPublicGetAggTrades"===d?await this.fapiPublicGetAggTrades(this.extend(o,s)):a.inverse||"dapiPublicGetAggTrades"===d?await this.dapiPublicGetAggTrades(this.extend(o,s)):await this.publicGetAggTrades(this.extend(o,s)),this.parseTrades(n,a,t,i)}async editSpotOrder(e,t,i,s,a,o=void 0,n={}){await this.loadMarkets();const d=this.market(t);if(!d.spot)throw new r.NotSupported(this.id+" editSpotOrder() does not support "+d.type+" orders");const h=this.editSpotOrderRequest(e,t,i,s,a,o,n),c=await this.privatePostOrderCancelReplace(h),l=this.safeDict(c,"newOrderResponse");return this.parseOrder(l,d)}editSpotOrderRequest(e,t,i,s,n,d=void 0,h={}){const c=this.market(t),l=this.safeStringN(h,["newClientOrderId","clientOrderId","origClientOrderId"]),u={symbol:c.id,side:s.toUpperCase()},f=i.toUpperCase();let p=f;this.isPostOnly("MARKET"===f,"LIMIT_MAKER"===f,h)&&(p="LIMIT_MAKER");const m=this.safeNumber2(h,"stopPrice","triggerPrice");void 0!==m&&("MARKET"===p?p="STOP_LOSS":"LIMIT"===p&&(p="STOP_LOSS_LIMIT")),u.type=p;const g=this.safeList(c.info,"orderTypes");if(!this.inArray(p,g))throw f!==p?new r.InvalidOrder(this.id+" triggerPrice parameter is not allowed for "+t+" "+i+" orders"):new r.InvalidOrder(this.id+" "+i+" is not a valid order type for the "+t+" market");if(void 0===l){const e=this.safeDict(this.options,"broker");if(void 0!==e){const t=this.safeString(e,"spot");void 0!==t&&(u.newClientOrderId=t+this.uuid22())}}else u.newClientOrderId=l;u.newOrderRespType=this.safeValue(this.options.newOrderRespType,i,"RESULT");let v=!1,y=!1,w=!1,b=!1;if("MARKET"===p){if(this.safeBool(this.options,"quoteOrderQty",!0)){const e=this.safeValue2(h,"quoteOrderQty","cost"),t=c.precision.price;if(void 0!==e)u.quoteOrderQty=this.decimalToPrecision(e,o.R3,t,this.precisionMode);else if(void 0!==d){const e=this.numberToString(n),i=this.numberToString(d),s=a.Y.stringMul(e,i);u.quoteOrderQty=this.decimalToPrecision(s,o.R3,t,this.precisionMode)}else b=!0}else b=!0}else"LIMIT"===p?(y=!0,v=!0,b=!0):"STOP_LOSS"===p||"TAKE_PROFIT"===p?(w=!0,b=!0):"STOP_LOSS_LIMIT"===p||"TAKE_PROFIT_LIMIT"===p?(b=!0,w=!0,y=!0,v=!0):"LIMIT_MAKER"===p&&(y=!0,b=!0);if(b&&(u.quantity=this.amountToPrecision(t,n)),y){if(void 0===d)throw new r.InvalidOrder(this.id+" editOrder() requires a price argument for a "+i+" order");u.price=this.priceToPrecision(t,d)}if(v&&void 0===this.safeString(h,"timeInForce")&&(u.timeInForce=this.options.defaultTimeInForce),w){if(void 0===m)throw new r.InvalidOrder(this.id+" editOrder() requires a triggerPrice extra param for a "+i+" order");u.stopPrice=this.priceToPrecision(t,m)}u.cancelReplaceMode="STOP_ON_FAILURE";return void 0===this.safeString2(h,"cancelNewClientOrderId","cancelOrigClientOrderId")&&(u.cancelOrderId=e),"PO"===this.safeString(h,"timeInForce")&&(h=this.omit(h,["timeInForce"])),h=this.omit(h,["quoteOrderQty","cost","stopPrice","newClientOrderId","clientOrderId","postOnly"]),this.extend(u,h)}editContractOrderRequest(e,t,i,s,a,o=void 0,n={}){const d=this.market(t);if(!d.contract)throw new r.NotSupported(this.id+" editContractOrder() does not support "+d.type+" orders");const h={symbol:d.id,side:s.toUpperCase(),orderId:e,quantity:this.amountToPrecision(t,a)},c=this.safeStringN(n,["newClientOrderId","clientOrderId","origClientOrderId"]);return void 0!==o&&(h.price=this.priceToPrecision(t,o)),void 0!==c&&(h.origClientOrderId=c),n=this.omit(n,["clientOrderId","newClientOrderId"]),h}async editContractOrder(e,t,i,s,a,o=void 0,n={}){await this.loadMarkets();const d=this.market(t);let h;if([h,n]=this.handleOptionAndParams2(n,"editContractOrder","papi","portfolioMargin",!1),(d.linear||h)&&void 0===o&&!("priceMatch"in n))throw new r.ArgumentsRequired(this.id+" editOrder() requires a price argument for portfolio margin and linear orders");const c=this.editContractOrderRequest(e,t,i,s,a,o,n);let l;return d.linear?l=h?await this.papiPutUmOrder(this.extend(c,n)):await this.fapiPrivatePutOrder(this.extend(c,n)):d.inverse&&(l=h?await this.papiPutCmOrder(this.extend(c,n)):await this.dapiPrivatePutOrder(this.extend(c,n))),this.parseOrder(l,d)}async editOrder(e,t,i,s,a=void 0,o=void 0,n={}){await this.loadMarkets();const d=this.market(t);if(d.option)throw new r.NotSupported(this.id+" editOrder() does not support "+d.type+" orders");return d.spot?await this.editSpotOrder(e,t,i,s,a,o,n):await this.editContractOrder(e,t,i,s,a,o,n)}async editOrders(e,t={}){await this.loadMarkets();const i=[];let s=[];for(let t=0;t=s&&void 0===l&&n.linear&&(l=this.sum(e,s),l=Math.min(l,i))}if(void 0!==l&&(o.endTime=l,s=this.omit(s,["endTime","until"])),void 0!==i&&(("option"===d||n.contract)&&(i=Math.min(i,1e3)),o.limit=i),"option"===d)c=await this.eapiPrivateGetUserTrades(this.extend(o,s));else{if(void 0===e)throw new r.ArgumentsRequired(this.id+" fetchMyTrades() requires a symbol argument");let t;[h,s]=this.handleMarginModeAndParams("fetchMyTrades",s),[t,s]=this.handleOptionAndParams2(s,"fetchMyTrades","papi","portfolioMargin",!1),"spot"===d||"margin"===d?t?c=await this.papiGetMarginMyTrades(this.extend(o,s)):"margin"===d||void 0!==h?("isolated"===h&&(o.isIsolated=!0),c=await this.sapiGetMarginMyTrades(this.extend(o,s))):c=await this.privateGetMyTrades(this.extend(o,s)):n.linear?c=t?await this.papiGetUmUserTrades(this.extend(o,s)):await this.fapiPrivateGetUserTrades(this.extend(o,s)):n.inverse&&(c=t?await this.papiGetCmUserTrades(this.extend(o,s)):await this.dapiPrivateGetUserTrades(this.extend(o,s)))}return this.parseTrades(c,n,t,i)}async fetchMyDustTrades(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();const r={};void 0!==t&&(r.startTime=t,r.endTime=this.sum(t,7776e6));const a=this.safeStringUpper(s,"type");s=this.omit(s,"type"),void 0!==a&&(r.accountType=a);const o=await this.sapiGetAssetDribblet(this.extend(r,s)),n=this.safeList(o,"userAssetDribblets",[]),d=this.safeInteger(o,"total",0),h=[];for(let e=0;e=0&&(a=a.slice(18));const o=this.safeString2(e,"coin","fiatCurrency");let n,d=this.safeCurrencyCode(o,t);n=this.safeInteger2(e,"insertTime","createTime"),void 0===n&&(n=this.parse8601(this.safeString(e,"applyTime")));const h=this.safeInteger2(e,"successTime","updateTime");let c=this.safeString(e,"type");if(void 0===c){const t=this.safeString(e,"transactionType");void 0!==t&&(c="0"===t?"deposit":"withdrawal");const i=this.safeDict(this.options,"legalMoneyCurrenciesById");d=this.safeString(i,d,d)}const l=this.parseTransactionStatusByType(this.safeString(e,"status"),c),u=this.safeNumber(e,"amount"),f=this.safeNumber2(e,"transactionFee","totalFee");let p;void 0!==f&&(p={currency:d,cost:f});const m=this.safeInteger(e,"transferType");let g;void 0!==m&&(g=0!==m);const v=this.safeString(e,"network");return{info:e,id:i,txid:a,timestamp:n,datetime:this.iso8601(n),network:v,address:s,addressTo:s,addressFrom:void 0,tag:r,tagTo:r,tagFrom:void 0,type:c,amount:u,currency:d,status:l,updated:h,internal:g,comment:void 0,fee:p}}parseTransferStatus(e){return this.safeString({CONFIRMED:"ok"},e,e)}parseTransfer(e,t=void 0){const i=this.safeString2(e,"tranId","transactionId"),s=this.safeString2(e,"asset","currency"),r=this.safeCurrencyCode(s,t),a=this.safeNumber(e,"amount"),o=this.safeString(e,"type");let n,d;const h=this.safeDict(this.options,"accountsById",{});if(void 0!==o){const e=o.split("_");n=this.safeValue(e,0),d=this.safeValue(e,1),n=this.safeString(h,n,n),d=this.safeString(h,d,d)}if(void 0!==this.safeInteger(e,"walletType")){const t=this.safeDict(e,"payerInfo",{}),i=this.safeDict(e,"receiverInfo",{});n=this.safeString(t,"accountId"),d=this.safeString(i,"accountId")}const c=this.safeInteger2(e,"timestamp","transactionTime"),l=this.parseTransferStatus(this.safeString(e,"status"));return{info:e,id:i,timestamp:c,datetime:this.iso8601(c),currency:r,amount:a,fromAccount:n,toAccount:d,status:l}}parseIncome(e,t=void 0){const i=this.safeString(e,"symbol"),s=this.safeString(e,"asset"),r=this.safeInteger(e,"time");return{info:e,symbol:this.safeSymbol(i,t,void 0,"swap"),code:this.safeCurrencyCode(s),timestamp:r,datetime:this.iso8601(r),id:this.safeString(e,"tranId"),amount:this.safeNumber(e,"income")}}async transfer(e,t,i,s,a={}){await this.loadMarkets();const o=this.currency(e),n={asset:o.id,amount:this.currencyToPrecision(e,t)};if(n.type=this.safeString(a,"type"),a=this.omit(a,"type"),void 0===n.type){const e=this.safeString(a,"symbol");let t;void 0!==e&&(t=this.market(e),a=this.omit(a,"symbol"));let o,d=this.convertTypeToAccount(i).toUpperCase(),h=this.convertTypeToAccount(s).toUpperCase();if(void 0!==t&&(o=t.id),"ISOLATED"===d&&void 0===e)throw new r.ArgumentsRequired(this.id+' transfer () requires params["symbol"] when fromAccount is '+i);if("ISOLATED"===h&&void 0===e)throw new r.ArgumentsRequired(this.id+' transfer () requires params["symbol"] when toAccount is '+s);const c=this.safeDict(this.options,"accountsById",{}),l=!(d in c),u=!(h in c);if(l&&void 0===t&&(o=d),u&&void 0===t&&(o=h),l||u){const e="MAIN"===d,t="MAIN"===h;if((l||u)&&("UMFUTURE"===d||"CMFUTURE"===d||("UMFUTURE"===h||"CMFUTURE"===h)||("FUNDING"===d||"FUNDING"===h)||("OPTION"===d||"OPTION"===h)))throw new r.BadRequest(this.id+" transfer () does not allow transfers between "+i+" and "+s);t&&l?(d="ISOLATED_MARGIN",n.fromSymbol=o):e&&u?(h="ISOLATED_MARGIN",n.toSymbol=o):l&&u?(n.fromSymbol=d,n.toSymbol=h,d="ISOLATEDMARGIN",h="ISOLATEDMARGIN"):(l&&(n.fromSymbol=o,d="ISOLATEDMARGIN"),u&&(n.toSymbol=o,h="ISOLATEDMARGIN")),n.type=d+"_"+h}else n.type=d+"_"+h}const d=await this.sapiPostAssetTransfer(this.extend(n,a));return this.parseTransfer(d,o)}async fetchTransfers(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();const a=this.safeBool(s,"internal");s=this.omit(s,"internal");let o,n=!1;if([n,s]=this.handleOptionAndParams(s,"fetchTransfers","paginate"),n&&!a)return await this.fetchPaginatedCallDynamic("fetchTransfers",e,t,i,s);void 0!==e&&(o=this.currency(e));const d={};let h="limit";if(!a){const e=this.safeString2(this.options,"fetchTransfers","defaultType","spot"),t=this.safeString(s,"fromAccount",e),i="future"===t?"spot":"future",a=this.safeString(s,"toAccount",i);let o=this.safeString(s,"type");const n=this.safeDict(this.options,"accountsByType",{}),c=this.safeString(n,t),l=this.safeString(n,a);if(void 0===o){if(void 0===c){const e=Object.keys(n);throw new r.ExchangeError(this.id+" fromAccount parameter must be one of "+e.join(", "))}if(void 0===l){const e=Object.keys(n);throw new r.ExchangeError(this.id+" toAccount parameter must be one of "+e.join(", "))}o=c+"_"+l}d.type=o,h="size"}void 0!==i&&(d[h]=i),void 0!==t&&(d.startTime=t);const c=this.safeInteger(s,"until");let l;void 0!==c&&(s=this.omit(s,"until"),d.endTime=c),l=a?await this.sapiGetPayTransactions(this.extend(d,s)):await this.sapiGetAssetTransfer(this.extend(d,s));const u=this.safeList2(l,"rows","data",[]);return this.parseTransfers(u,o,t,i)}async fetchDepositAddress(e,t={}){await this.loadMarkets();const i=this.currency(e),s={coin:i.id},r=this.safeDict(this.options,"networks",{});let a=this.safeStringUpper(t,"network");a=this.safeString(r,a,a),void 0!==a&&(s.network=a,t=this.omit(t,"network"));const o=await this.sapiGetCapitalDepositAddress(this.extend(s,t));return this.parseDepositAddress(o,i)}parseDepositAddress(e,t=void 0){const i=this.safeString(e,"url"),s=this.safeString(e,"address"),r=this.safeString(e,"currency"),a=this.safeCurrencyCode(r,t),o=this.getNetworkCodeByNetworkUrl(a,i);let n=this.safeString(e,"tag","");return 0===n.length&&(n=void 0),this.checkAddress(s),{info:e,currency:a,network:o,address:s,tag:n}}async fetchTransactionFees(e=void 0,t={}){await this.loadMarkets();const i=await this.sapiGetCapitalConfigGetall(t),s={};for(let e=0;e4)throw new r.ArgumentsRequired(this.id+" type must be between 1 and 4");await this.loadMarkets();const a=this.currency(e),o={asset:a.id,amount:t,type:i},n=await this.sapiPostFuturesTransfer(this.extend(o,s));return this.parseTransfer(n,a)}async fetchFundingRate(e,t={}){await this.loadMarkets();const i=this.market(e),s={symbol:i.id};let a;if(i.linear)a=await this.fapiPublicGetPremiumIndex(this.extend(s,t));else{if(!i.inverse)throw new r.NotSupported(this.id+" fetchFundingRate() supports linear and inverse contracts only");a=await this.dapiPublicGetPremiumIndex(this.extend(s,t))}return i.inverse&&(a=a[0]),this.parseFundingRate(a,i)}async fetchFundingRateHistory(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();const a={};let o=!1;if([o,s]=this.handleOptionAndParams(s,"fetchFundingRateHistory","paginate"),o)return await this.fetchPaginatedCallDeterministic("fetchFundingRateHistory",e,t,i,"8h",s);const n=this.safeString2(this.options,"fetchFundingRateHistory","defaultType","future"),d=this.safeString(s,"type",n);let h,c;void 0!==e&&(h=this.market(e),e=h.symbol,a.symbol=h.id),[c,s]=this.handleSubTypeAndParams("fetchFundingRateHistory",h,s,"linear"),s=this.omit(s,"type"),void 0!==t&&(a.startTime=t);const l=this.safeInteger(s,"until"),u=this.safeInteger(s,"endTime",l);let f;if(s=this.omit(s,["endTime","until"]),void 0!==u&&(a.endTime=u),void 0!==i&&(a.limit=i),this.isLinear(d,c))f=await this.fapiPublicGetFundingRate(this.extend(a,s));else{if(!this.isInverse(d,c))throw new r.NotSupported(this.id+" fetchFundingRateHistory() is not supported for "+d+" markets");f=await this.dapiPublicGetFundingRate(this.extend(a,s))}return this.parseFundingRateHistories(f,h,t,i)}parseFundingRateHistory(e,t=void 0){const i=this.safeInteger(e,"fundingTime");return{info:e,symbol:this.safeSymbol(this.safeString(e,"symbol"),void 0,void 0,"swap"),fundingRate:this.safeNumber(e,"fundingRate"),timestamp:i,datetime:this.iso8601(i)}}async fetchFundingRates(e=void 0,t={}){await this.loadMarkets(),e=this.marketSymbols(e);const i=this.safeString2(this.options,"fetchFundingRates","defaultType","future"),s=this.safeString(t,"type",i);let a;[a,t]=this.handleSubTypeAndParams("fetchFundingRates",void 0,t,"linear");const o=this.omit(t,"type");let n;if(this.isLinear(s,a))n=await this.fapiPublicGetPremiumIndex(o);else{if(!this.isInverse(s,a))throw new r.NotSupported(this.id+" fetchFundingRates() supports linear and inverse contracts only");n=await this.dapiPublicGetPremiumIndex(o)}return this.parseFundingRates(n,e)}parseFundingRate(e,t=void 0){const i=this.safeInteger(e,"time"),s=this.safeString(e,"symbol"),r=this.safeSymbol(s,t,void 0,"contract"),a=this.safeNumber(e,"markPrice"),o=this.safeNumber(e,"indexPrice"),n=this.safeNumber(e,"interestRate"),d=this.safeNumber(e,"estimatedSettlePrice"),h=this.safeNumber(e,"lastFundingRate"),c=this.safeInteger(e,"nextFundingTime"),l=this.safeString(e,"fundingIntervalHours");let u;return void 0!==l&&(u=l+"h"),{info:e,symbol:r,markPrice:a,indexPrice:o,interestRate:n,estimatedSettlePrice:d,timestamp:i,datetime:this.iso8601(i),fundingRate:h,fundingTimestamp:c,fundingDatetime:this.iso8601(c),nextFundingRate:void 0,nextFundingTimestamp:void 0,nextFundingDatetime:void 0,previousFundingRate:void 0,previousFundingTimestamp:void 0,previousFundingDatetime:void 0,interval:u}}parseAccountPositions(e,t=!1){const i=this.safeList(e,"positions"),s=this.safeList(e,"assets",[]),r={};for(let e=0;e1)throw new r.BadRequest(this.id+" fetchPositions() symbols argument cannot contain more than 1 symbol");t=e[0]}else t=e;s=this.market(t),i.symbol=s.id}const a=await this.eapiPrivateGetPosition(this.extend(i,t)),o=[];for(let e=0;e125)throw new r.BadRequest(this.id+" leverage should be between 1 and 125");await this.loadMarkets();const s=this.market(t),a={symbol:s.id,leverage:e};let o,n;if([o,i]=this.handleOptionAndParams2(i,"setLeverage","papi","portfolioMargin",!1),s.linear)n=o?await this.papiPostUmLeverage(this.extend(a,i)):await this.fapiPrivatePostLeverage(this.extend(a,i));else{if(!s.inverse)throw new r.NotSupported(this.id+" setLeverage() supports linear and inverse contracts only");n=o?await this.papiPostCmLeverage(this.extend(a,i)):await this.dapiPrivatePostLeverage(this.extend(a,i))}return n}async setMarginMode(e,t=void 0,i={}){if(void 0===t)throw new r.ArgumentsRequired(this.id+" setMarginMode() requires a symbol argument");if("CROSS"===(e=e.toUpperCase())&&(e="CROSSED"),"ISOLATED"!==e&&"CROSSED"!==e)throw new r.BadRequest(this.id+" marginMode must be either isolated or cross");await this.loadMarkets();const s=this.market(t),a={symbol:s.id,marginType:e};let o;try{if(s.linear)o=await this.fapiPrivatePostMarginType(this.extend(a,i));else{if(!s.inverse)throw new r.NotSupported(this.id+" setMarginMode() supports linear and inverse contracts only");o=await this.dapiPrivatePostMarginType(this.extend(a,i))}}catch(e){if(!(e instanceof r.MarginModeAlreadySet))throw e;if(this.safeBool(this.options,"throwMarginModeAlreadySet",!1))throw e;o={code:-4046,msg:"No need to change margin type."}}return o}async setPositionMode(e,t=void 0,i={}){const s=this.safeString(this.options,"defaultType","future"),a=this.safeString(i,"type",s);let o,n,d;i=this.omit(i,["type"]),[o,i]=this.handleSubTypeAndParams("setPositionMode",void 0,i),[n,i]=this.handleOptionAndParams2(i,"setPositionMode","papi","portfolioMargin",!1),d=e?"true":"false";const h={dualSidePosition:d};let c;if(this.isInverse(a,o))c=n?await this.papiPostCmPositionSideDual(this.extend(h,i)):await this.dapiPrivatePostPositionSideDual(this.extend(h,i));else{if(!this.isLinear(a,o))throw new r.BadRequest(this.id+" setPositionMode() supports linear and inverse contracts only");c=n?await this.papiPostUmPositionSideDual(this.extend(h,i)):await this.fapiPrivatePostPositionSideDual(this.extend(h,i))}return c}async fetchLeverages(e=void 0,t={}){let i,s,a,o;if(await this.loadMarkets(),await this.loadLeverageBrackets(!1,t),[i,t]=this.handleMarketTypeAndParams("fetchLeverages",void 0,t),[s,t]=this.handleSubTypeAndParams("fetchLeverages",void 0,t,"linear"),[a,t]=this.handleOptionAndParams2(t,"fetchLeverages","papi","portfolioMargin",!1),this.isLinear(i,s))o=a?await this.papiGetUmAccount(t):await this.fapiPrivateGetSymbolConfig(t);else{if(!this.isInverse(i,s))throw new r.NotSupported(this.id+" fetchLeverages() supports linear and inverse contracts only");o=a?await this.papiGetCmAccount(t):await this.dapiPrivateGetAccount(t)}let n=this.safeList(o,"positions",[]);return Array.isArray(o)&&(n=o),this.parseLeverages(n,e,"symbol")}parseLeverage(e,t=void 0){const i=this.safeString(e,"symbol"),s=this.safeBool(e,"isolated");let r;void 0!==s&&(r=s?"isolated":"cross");const a=this.safeStringLower(e,"marginType");void 0!==a&&(r="crossed"===a?"cross":"isolated");const o=this.safeStringLower(e,"positionSide");let n,d;const h=this.safeInteger(e,"leverage");return void 0===o||"both"===o?(n=h,d=h):"long"===o?n=h:"short"===o&&(d=h),{info:e,symbol:this.safeSymbol(i,t),marginMode:r,longLeverage:n,shortLeverage:d}}async fetchSettlementHistory(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();const a=void 0===e?void 0:this.market(e);let o;if([o,s]=this.handleMarketTypeAndParams("fetchSettlementHistory",a,s),"option"!==o)throw new r.NotSupported(this.id+" fetchSettlementHistory() supports option markets only");const n={};void 0!==e&&(e=a.symbol,n.underlying=a.baseId+a.quoteId),void 0!==t&&(n.startTime=t),void 0!==i&&(n.limit=i);const d=await this.eapiPublicGetExerciseHistory(this.extend(n,s)),h=this.parseSettlements(d,a),c=this.sortBy(h,"timestamp");return this.filterBySymbolSinceLimit(c,e,t,i)}async fetchMySettlementHistory(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();const a=void 0===e?void 0:this.market(e);let o;if([o,s]=this.handleMarketTypeAndParams("fetchMySettlementHistory",a,s),"option"!==o)throw new r.NotSupported(this.id+" fetchMySettlementHistory() supports option markets only");const n={};void 0!==e&&(n.symbol=a.id,e=a.symbol),void 0!==t&&(n.startTime=t),void 0!==i&&(n.limit=i);const d=await this.eapiPrivateGetExerciseRecord(this.extend(n,s)),h=this.parseSettlements(d,a),c=this.sortBy(h,"timestamp");return this.filterBySymbolSinceLimit(c,e,t,i)}parseSettlement(e,t){const i=this.safeInteger2(e,"expiryDate","createDate"),s=this.safeString(e,"symbol");return{info:e,symbol:this.safeSymbol(s,t),price:this.safeNumber2(e,"realStrikePrice","exercisePrice"),timestamp:i,datetime:this.iso8601(i)}}parseSettlements(e,t){const i=[];for(let s=0;s-1||"private"===t,i=e?"spot":"future",r=e?"x-TKT5PX2F":"x-xcKtGhcu",a=this.safeDict(this.options,"broker",{}),o=this.safeString(a,i,r);s.newClientOrderId=o+this.uuid22()}}let r;if("batchOrders"===e&&("POST"===i||"PUT"===i)){const e=this.safeList(s,"batchOrders");let r=e;if("POST"===i&&"fapiPrivate"===t){r=[];for(let t=0;t=0||"capital/withdraw/apply"===e||e.indexOf("staking")>=0||e.indexOf("simple-earn")>=0)if("DELETE"===i&&"batchOrders"===e){const e=this.safeList(f,"orderidlist",[]),t=this.safeList(f,"origclientorderidlist",[]);f=this.omit(f,["orderidlist","origclientorderidlist"]),r=this.rawencode(f);const i=e.length,s=t.length;i>0&&(r=r+"&orderidlist=%5B"+e.join("%2C")+"%5D"),s>0&&(r=r+"&origclientorderidlist=%5B"+t.join("%2C")+"%5D")}else r=this.rawencode(f);else r=this.urlencode(f);let m;m=this.secret.indexOf("PRIVATE KEY")>-1?this.secret.length>120?this.encodeURIComponent((0,d.n)(r,this.secret,n.s)):this.encodeURIComponent((0,h.q4)(this.encode(r),this.secret,c.ev)):this.hmac(this.encode(r),this.encode(this.secret),n.s),r+="&signature="+m,a={"X-MBX-APIKEY":this.apiKey},"GET"===i||"DELETE"===i?l+="?"+r:(o=r,a["Content-Type"]="application/x-www-form-urlencoded")}else Object.keys(s).length&&(l+="?"+this.urlencode(s));return{url:l,method:i,body:o,headers:a}}getExceptionsByUrl(e,t){let i;const s=void 0!==this.hostname?this.hostname:"binance.com";if(e.startsWith("https://api."+s+"/")||e.startsWith("https://testnet.binance.vision")?i="spot":e.startsWith("https://dapi."+s+"/")||e.startsWith("https://testnet.binancefuture.com/dapi")?i="inverse":e.startsWith("https://fapi."+s+"/")||e.startsWith("https://testnet.binancefuture.com/fapi")?i="linear":e.startsWith("https://eapi."+s+"/")?i="option":e.startsWith("https://papi."+s+"/")&&(i="portfolioMargin"),void 0!==i){const e=this.safeDict(this.exceptions,i,{});return this.safeDict(e,t,{})}return{}}handleErrors(e,t,i,s,o,n,d,h,c){if(418===e||429===e)throw new r.DDoSProtection(this.id+" "+e.toString()+" "+t+" "+n);if(e>=400){if(n.indexOf("Price * QTY is zero or less")>=0)throw new r.InvalidOrder(this.id+" order cost = amount * price is zero or less "+n);if(n.indexOf("LOT_SIZE")>=0)throw new r.InvalidOrder(this.id+" order amount should be evenly divisible by lot size "+n);if(n.indexOf("PRICE_FILTER")>=0)throw new r.InvalidOrder(this.id+" order price is invalid, i.e. exceeds allowed price precision, exceeds min price or max price limits or is invalid value in general, use this.priceToPrecision (symbol, amount) "+n)}if(void 0===d)return;const l=this.safeBool(d,"success",!0);if(!l){const e=this.safeString(d,"msg");let t;if(void 0!==e){try{t=JSON.parse(e)}catch(e){t=void 0}void 0!==t&&(d=t)}}const u=this.safeString(d,"msg");void 0!==u&&(this.throwExactlyMatchedException(this.getExceptionsByUrl(i,"exact"),u,this.id+" "+u),this.throwExactlyMatchedException(this.exceptions.exact,u,this.id+" "+u),this.throwBroadlyMatchedException(this.getExceptionsByUrl(i,"broad"),u,this.id+" "+u),this.throwBroadlyMatchedException(this.exceptions.broad,u,this.id+" "+u));const f=this.safeString(d,"code");if(void 0!==f){if("200"===f||a.Y.stringEquals(f,"0"))return;if("-2015"===f&&this.options.hasAlreadyAuthenticatedSuccessfully)throw new r.DDoSProtection(this.id+" "+n);const e=this.id+" "+n;if("No need to change margin type."===u)throw new r.MarginModeAlreadySet(e);throw this.throwExactlyMatchedException(this.getExceptionsByUrl(i,"exact"),f,e),this.throwExactlyMatchedException(this.exceptions.exact,f,e),new r.ExchangeError(e)}if(!l)throw new r.ExchangeError(this.id+" "+n);if(Array.isArray(d)){if(1===d.length){const e=d[0],t=this.safeString(e,"code");void 0!==t&&(this.throwExactlyMatchedException(this.getExceptionsByUrl(i,"exact"),t,this.id+" "+n),this.throwExactlyMatchedException(this.exceptions.exact,t,this.id+" "+n))}}}calculateRateLimiterCost(e,t,i,s,r={}){if("noCoin"in r&&!("coin"in s))return r.noCoin;if("noSymbol"in r&&!("symbol"in s))return r.noSymbol;if("noPoolId"in r&&!("poolId"in s))return r.noPoolId;if("byLimit"in r&&"limit"in s){const e=s.limit,t=r.byLimit;for(let i=0;i93)throw new r.BadRequest(this.id+" fetchBorrowRateHistory() limit parameter cannot exceed 92");const a={asset:this.currency(e).id,limit:i};if(void 0!==t){a.startTime=t;const e=this.sum(t,864e5*i)-1,s=this.milliseconds();a.endTime=Math.min(e,s)}const o=await this.sapiGetMarginInterestRateHistory(this.extend(a,s));return this.parseBorrowRateHistory(o,e,t,i)}parseBorrowRate(e,t=void 0){const i=this.safeInteger(e,"timestamp"),s=this.safeString(e,"asset");return{currency:this.safeCurrencyCode(s,t),rate:this.safeNumber(e,"dailyInterestRate"),period:864e5,timestamp:i,datetime:this.iso8601(i),info:e}}parseIsolatedBorrowRate(e,t=void 0){const i=this.safeString(e,"symbol");t=this.safeMarket(i,t,void 0,"spot");const s=this.safeList(e,"data"),r=this.safeDict(s,0),a=this.safeDict(s,1);return{info:e,symbol:this.safeString(t,"symbol"),base:this.safeString(r,"coin"),baseRate:this.safeNumber(r,"dailyInterest"),quote:this.safeString(a,"coin"),quoteRate:this.safeNumber(a,"dailyInterest"),period:864e5,timestamp:void 0,datetime:void 0}}async createGiftCode(e,t,i={}){await this.loadMarkets();const s={token:this.currency(e).id,amount:t},r=await this.sapiPostGiftcardCreateCode(this.extend(s,i)),a=this.safeDict(r,"data"),o=this.safeString(a,"code");return{info:r,id:this.safeString(a,"referenceNo"),code:o,currency:e,amount:t}}async redeemGiftCode(e,t={}){const i={code:e};return await this.sapiPostGiftcardRedeemCode(this.extend(i,t))}async verifyGiftCode(e,t={}){const i={referenceNo:e};return await this.sapiGetGiftcardVerify(this.extend(i,t))}async fetchBorrowInterest(e=void 0,t=void 0,i=void 0,s=void 0,r={}){let a;await this.loadMarkets(),[a,r]=this.handleOptionAndParams2(r,"fetchBorrowInterest","papi","portfolioMargin",!1);let o,n,d={};if(void 0!==e){const t=this.currency(e);d.asset=t.id}void 0!==i&&(d.startTime=i),void 0!==s&&(d.size=s),[d,r]=this.handleUntilOption("endTime",d,r),a?n=await this.papiGetMarginMarginInterestHistory(this.extend(d,r)):(void 0!==t&&(o=this.market(t),d.isolatedSymbol=o.id),n=await this.sapiGetMarginInterestHistory(this.extend(d,r)));const h=this.safeList(n,"rows"),c=this.parseBorrowInterests(h,o);return this.filterByCurrencySinceLimit(c,e,i,s)}parseBorrowInterest(e,t=void 0){const i=this.safeString(e,"isolatedSymbol"),s=this.safeInteger(e,"interestAccuredTime"),r=void 0===i?"cross":"isolated";return{info:e,symbol:i,currency:this.safeCurrencyCode(this.safeString(e,"asset")),interest:this.safeNumber(e,"interest"),interestRate:this.safeNumber(e,"interestRate"),amountBorrowed:this.safeNumber(e,"principal"),marginMode:r,timestamp:s,datetime:this.iso8601(s)}}async repayCrossMargin(e,t,i={}){await this.loadMarkets();const s=this.currency(e),r={asset:s.id,amount:this.currencyToPrecision(e,t)};let a,o;if([o,i]=this.handleOptionAndParams2(i,"repayCrossMargin","papi","portfolioMargin",!1),o){let e;[e,i]=this.handleOptionAndParams2(i,"repayCrossMargin","repayCrossMarginMethod","method"),a="papiPostMarginRepayDebt"===e?await this.papiPostMarginRepayDebt(this.extend(r,i)):await this.papiPostRepayLoan(this.extend(r,i))}else r.isIsolated="FALSE",r.type="REPAY",a=await this.sapiPostMarginBorrowRepay(this.extend(r,i));return this.parseMarginLoan(a,s)}async repayIsolatedMargin(e,t,i,s={}){await this.loadMarkets();const r=this.currency(t),a=this.market(e),o={asset:r.id,amount:this.currencyToPrecision(t,i),symbol:a.id,isIsolated:"TRUE",type:"REPAY"},n=await this.sapiPostMarginBorrowRepay(this.extend(o,s));return this.parseMarginLoan(n,r)}async borrowCrossMargin(e,t,i={}){await this.loadMarkets();const s=this.currency(e),r={asset:s.id,amount:this.currencyToPrecision(e,t)};let a,o;return[o,i]=this.handleOptionAndParams2(i,"borrowCrossMargin","papi","portfolioMargin",!1),o?a=await this.papiPostMarginLoan(this.extend(r,i)):(r.isIsolated="FALSE",r.type="BORROW",a=await this.sapiPostMarginBorrowRepay(this.extend(r,i))),this.parseMarginLoan(a,s)}async borrowIsolatedMargin(e,t,i,s={}){await this.loadMarkets();const r=this.currency(t),a=this.market(e),o={asset:r.id,amount:this.currencyToPrecision(t,i),symbol:a.id,isIsolated:"TRUE",type:"BORROW"},n=await this.sapiPostMarginBorrowRepay(this.extend(o,s));return this.parseMarginLoan(n,r)}parseMarginLoan(e,t=void 0){const i=this.safeString(e,"asset"),s=this.safeInteger(e,"updateTime");return{id:this.safeInteger(e,"tranId"),currency:this.safeCurrencyCode(i,t),amount:this.safeNumber(e,"amount"),symbol:void 0,timestamp:s,datetime:this.iso8601(s),info:e}}async fetchOpenInterestHistory(e,t="5m",i=void 0,s=void 0,a={}){if("1m"===t)throw new r.BadRequest(this.id+" fetchOpenInterestHistory cannot use the 1m timeframe");await this.loadMarkets();let o=!1;if([o,a]=this.handleOptionAndParams(a,"fetchOpenInterestHistory","paginate",!1),o)return await this.fetchPaginatedCallDeterministic("fetchOpenInterestHistory",e,i,s,t,a,500);const n=this.market(e),d={period:this.safeString(this.timeframes,t,t)};void 0!==s&&(d.limit=s);d[n.linear?"symbol":"pair"]=n.id,n.inverse&&(d.contractType=this.safeString(a,"contractType","CURRENT_QUARTER")),void 0!==i&&(d.startTime=i);const h=this.safeInteger(a,"until"),c=this.safeInteger(a,"endTime",h);if(a=this.omit(a,["endTime","until"]),c)d.endTime=c;else if(i){void 0===s&&(s=30);const e=this.parseTimeframe(t);d.endTime=this.sum(i,e*s*1e3)}let l;return l=n.inverse?await this.dapiDataGetOpenInterestHist(this.extend(d,a)):await this.fapiDataGetOpenInterestHist(this.extend(d,a)),this.parseOpenInterestsHistory(l,n,i,s)}async fetchOpenInterest(e,t={}){await this.loadMarkets();const i=this.market(e),s={};if(i.option){if(s.underlyingAsset=i.baseId,void 0===i.expiry)throw new r.NotSupported(this.id+" fetchOpenInterest does not support "+e);s.expiration=this.yymmdd(i.expiry)}else s.symbol=i.id;let a;if(a=i.option?await this.eapiPublicGetOpenInterest(this.extend(s,t)):i.inverse?await this.dapiPublicGetOpenInterest(this.extend(s,t)):await this.fapiPublicGetOpenInterest(this.extend(s,t)),!i.option)return this.parseOpenInterest(a,i);{e=i.symbol;const t=this.parseOpenInterestsHistory(a,i);for(let i=0;io)throw new r.BadRequest(this.id+" fetchConvertTradeHistory () the max interval between startTime and endTime is 30 days.");void 0!==i&&(a.limit=i),l="fromAsset",u="toAsset",c="list",h=await this.sapiGetConvertTradeFlow(this.extend(a,s))}const f=this.safeList(h,c,[]);return this.parseConversions(f,e,l,u,t,i)}parseConversion(e,t=void 0,i=void 0){const s=this.safeIntegerN(e,["time","validTimestamp","createTime"]),r=this.safeString2(e,"deductedAsset","fromAsset"),a=this.safeCurrencyCode(r,t),o=this.safeString2(e,"targetAsset","toAsset"),n=this.safeCurrencyCode(o,i);return{info:e,timestamp:s,datetime:this.iso8601(s),id:this.safeStringN(e,["tranId","orderId","quoteId"]),fromCurrency:a,fromAmount:this.safeNumber2(e,"deductedAmount","fromAmount"),toCurrency:n,toAmount:this.safeNumber2(e,"targetAmount","toAmount"),price:void 0,fee:void 0}}async fetchFundingIntervals(e=void 0,t={}){let i;await this.loadMarkets(),void 0!==e&&(e=this.marketSymbols(e),i=this.market(e[0]));const s="swap";let a,o;if([a,t]=this.handleSubTypeAndParams("fetchFundingIntervals",i,t,"linear"),this.isLinear(s,a))o=await this.fapiPublicGetFundingInfo(t);else{if(!this.isInverse(s,a))throw new r.NotSupported(this.id+" fetchFundingIntervals() supports linear and inverse swap contracts only");o=await this.dapiPublicGetFundingInfo(t)}return this.parseFundingRates(o,e)}async fetchLongShortRatioHistory(e=void 0,t=void 0,i=void 0,s=void 0,a={}){await this.loadMarkets();const o=this.market(e);void 0===t&&(t="1d");let n,d,h={period:t};if([h,a]=this.handleUntilOption("endTime",h,a),void 0!==i&&(h.startTime=i),void 0!==s&&(h.limit=s),[n,a]=this.handleSubTypeAndParams("fetchLongShortRatioHistory",o,a),"linear"===n)h.symbol=o.id,d=await this.fapiDataGetGlobalLongShortAccountRatio(this.extend(h,a));else{if("inverse"!==n)throw new r.BadRequest(this.id+" fetchLongShortRatioHistory() supports linear and inverse subTypes only");h.pair=o.info.pair,d=await this.dapiDataGetGlobalLongShortAccountRatio(this.extend(h,a))}return this.parseLongShortRatioHistory(d,o)}parseLongShortRatio(e,t=void 0){const i=this.safeString(e,"symbol"),s=this.safeIntegerOmitZero(e,"timestamp");return{info:e,symbol:this.safeSymbol(i,t,void 0,"contract"),timestamp:s,datetime:this.iso8601(s),timeframe:void 0,longShortRatio:this.safeNumber(e,"longShortRatio")}}}},1510:(e,t,i)=>{i.d(t,{A:()=>r});var s=i(3192);class r extends s.A{describe(){return this.deepExtend(super.describe(),{id:"binancecoinm",name:"Binance COIN-M",urls:{logo:"https://github.com/user-attachments/assets/387cfc4e-5f33-48cd-8f5c-cd4854dabf0c",doc:["https://binance-docs.github.io/apidocs/delivery/en/","https://binance-docs.github.io/apidocs/spot/en","https://developers.binance.com/en"]},has:{CORS:void 0,spot:!1,margin:!1,swap:!0,future:!0,option:void 0,createStopMarketOrder:!0},options:{fetchMarkets:{types:["inverse"]},defaultSubType:"inverse",leverageBrackets:void 0}})}async transferIn(e,t,i={}){return await this.futuresTransfer(e,t,3,i)}async transferOut(e,t,i={}){return await this.futuresTransfer(e,t,4,i)}}},8228:(e,t,i)=>{i.d(t,{A:()=>r});var s=i(3192);class r extends s.A{describe(){return this.deepExtend(super.describe(),{id:"binanceus",name:"Binance US",countries:["US"],hostname:"binance.us",rateLimit:50,certified:!1,pro:!0,urls:{logo:"https://github.com/user-attachments/assets/a9667919-b632-4d52-a832-df89f8a35e8c",api:{web:"https://www.binance.us",public:"https://api.binance.us/api/v3",private:"https://api.binance.us/api/v3",sapi:"https://api.binance.us/sapi/v1",sapiV2:"https://api.binance.us/sapi/v2",sapiV3:"https://api.binance.us/sapi/v3"},www:"https://www.binance.us",referral:"https://www.binance.us/?ref=35005074",doc:"https://github.com/binance-us/binance-official-api-docs",fees:"https://www.binance.us/en/fee/schedule"},fees:{trading:{tierBased:!0,percentage:!0,taker:this.parseNumber("0.001"),maker:this.parseNumber("0.001")}},options:{fetchMarkets:{types:["spot"]},defaultType:"spot",fetchMargins:!1,quoteOrderQty:!1},has:{CORS:void 0,spot:!0,margin:!1,swap:!1,future:void 0,option:!1,addMargin:!1,closeAllPositions:!1,closePosition:!1,createReduceOnlyOrder:!1,fetchBorrowInterest:!1,fetchBorrowRate:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchBorrowRates:!1,fetchBorrowRatesPerSymbol:!1,fetchFundingHistory:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchIndexOHLCV:!1,fetchIsolatedPositions:!1,fetchLeverage:!1,fetchLeverageTiers:!1,fetchMarketLeverageTiers:!1,fetchMarkOHLCV:!1,fetchOpenInterestHistory:!1,fetchPosition:!1,fetchPositions:!1,fetchPositionsRisk:!1,fetchPremiumIndexOHLCV:!1,reduceMargin:!1,setLeverage:!1,setMargin:!1,setMarginMode:!1,setPositionMode:!1},api:{public:{get:{ping:1,time:1,exchangeInfo:10,trades:1,historicalTrades:5,aggTrades:1,depth:{cost:1,byLimit:[[100,1],[500,5],[1e3,10],[5e3,50]]},klines:1,"ticker/price":{cost:1,noSymbol:2},avgPrice:1,"ticker/bookTicker":{cost:1,noSymbol:2},"ticker/24hr":{cost:1,noSymbol:40},ticker:{cost:2,noSymbol:100}}},private:{get:{account:10,"rateLimit/order":20,order:2,openOrders:{cost:3,noSymbol:40},myTrades:10,myPreventedMatches:10,allOrders:10,orderList:2,allOrderList:10,openOrderList:3},post:{order:1,"order/test":1,"order/cancelReplace":1,"order/oco":1},delete:{order:1,openOrders:1,orderList:1}},sapi:{get:{"system/status":1,"asset/assetDistributionHistory":1,"asset/query/trading-fee":1,"asset/query/trading-volume":1,"sub-account/spotSummary":1,"sub-account/status":1,"otc/coinPairs":1,"otc/orders/{orderId}":1,"otc/orders":1,"ocbs/orders":1,"capital/config/getall":1,"capital/withdraw/history":1,"fiatpayment/query/withdraw/history":1,"capital/deposit/address":1,"capital/deposit/hisrec":1,"fiatpayment/query/deposit/history":1,"capital/sub-account/deposit/address":1,"capital/sub-account/deposit/history":1,"asset/query/dust-logs":1,"asset/query/dust-assets":1,"marketing/referral/reward/history":1,"staking/asset":1,"staking/stakingBalance":1,"staking/history":1,"staking/stakingRewardsHistory":1,"custodian/balance":1,"custodian/supportedAssetList":1,"custodian/walletTransferHistory":1,"custodian/custodianTransferHistory":1,"custodian/openOrders":1,"custodian/order":1,"custodian/orderHistory":1,"custodian/tradeHistory":1,"custodian/settlementSetting":1,"custodian/settlementHistory":1,"cl/transferHistory":1,"apipartner/checkEligibility":1,"apipartner/rebateHistory":1},post:{"otc/quotes":1,"otc/orders":1,"fiatpayment/withdraw/apply":1,"capital/withdraw/apply":1,"asset/dust":10,"staking/stake":1,"staking/unstake":1,"custodian/walletTransfer":1,"custodian/custodianTransfer":1,"custodian/undoTransfer":1,"custodian/order":1,"custodian/ocoOrder":1,"cl/transfer":1},delete:{"custodian/cancelOrder":1,"custodian/cancelOrdersBySymbol":1,"custodian/cancelOcoOrder":1}},sapiV2:{get:{"cl/account":10,"cl/alertHistory":1}},sapiV3:{get:{accountStatus:1,apiTradingStatus:1,"sub-account/list":1,"sub-account/transfer/history":1,"sub-account/assets":1},post:{"sub-account/transfer":1}}},features:{swap:{linear:void 0,inverse:void 0},future:{linear:void 0,inverse:void 0}}})}}},2171:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(3192),r=i(2079);class a extends s.A{describe(){return this.deepExtend(super.describe(),{id:"binanceusdm",name:"Binance USDⓈ-M",urls:{logo:"https://github.com/user-attachments/assets/871cbea7-eebb-4b28-b260-c1c91df0487a",doc:["https://binance-docs.github.io/apidocs/futures/en/","https://binance-docs.github.io/apidocs/spot/en","https://developers.binance.com/en"]},has:{CORS:void 0,spot:!1,margin:!1,swap:!0,future:!0,option:void 0,createStopMarketOrder:!0},options:{fetchMarkets:{types:["linear"]},defaultSubType:"linear",leverageBrackets:void 0,marginTypes:{},marginModes:{}},exceptions:{exact:{"-5021":r.InvalidOrder,"-5022":r.InvalidOrder,"-5028":r.InvalidOrder}}})}async transferIn(e,t,i={}){return await this.futuresTransfer(e,t,1,i)}async transferOut(e,t,i={}){return await this.futuresTransfer(e,t,2,i)}}},2480:(e,t,i)=>{i.d(t,{A:()=>d});var s=i(4619),r=i(2079),a=i(5147),o=i(4852),n=i(1579);class d extends s.A{describe(){return this.deepExtend(super.describe(),{id:"bingx",name:"BingX",countries:["US"],rateLimit:100,version:"v1",certified:!0,pro:!0,has:{CORS:void 0,spot:!0,margin:!1,swap:!0,future:!1,option:!1,addMargin:!0,cancelAllOrders:!0,cancelAllOrdersAfter:!0,cancelOrder:!0,cancelOrders:!0,closeAllPositions:!0,closePosition:!0,createMarketBuyOrderWithCost:!0,createMarketOrderWithCost:!0,createMarketSellOrderWithCost:!0,createOrder:!0,createOrders:!0,createOrderWithTakeProfitAndStopLoss:!0,createReduceOnlyOrder:!0,createStopLossOrder:!0,createStopOrder:!0,createTakeProfitOrder:!0,createTrailingAmountOrder:!0,createTrailingPercentOrder:!0,createTriggerOrder:!0,editOrder:!0,fetchBalance:!0,fetchCanceledOrders:!0,fetchClosedOrders:!0,fetchCurrencies:!0,fetchDepositAddress:!0,fetchDepositAddresses:!1,fetchDepositAddressesByNetwork:!0,fetchDeposits:!0,fetchDepositWithdrawFee:"emulated",fetchDepositWithdrawFees:!0,fetchFundingRate:!0,fetchFundingRateHistory:!0,fetchFundingRates:!0,fetchLeverage:!0,fetchLiquidations:!1,fetchMarginAdjustmentHistory:!1,fetchMarginMode:!0,fetchMarkets:!0,fetchMarkOHLCV:!0,fetchMarkPrice:!0,fetchMarkPrices:!0,fetchMyLiquidations:!0,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenInterest:!0,fetchOpenOrders:!0,fetchOrder:!0,fetchOrderBook:!0,fetchOrders:!0,fetchPosition:!0,fetchPositionHistory:!1,fetchPositionMode:!0,fetchPositions:!0,fetchPositionsHistory:!0,fetchTicker:!0,fetchTickers:!0,fetchTime:!0,fetchTrades:!0,fetchTradingFee:!0,fetchTransfers:!0,fetchWithdrawals:!0,reduceMargin:!0,sandbox:!0,setLeverage:!0,setMargin:!0,setMarginMode:!0,setPositionMode:!0,transfer:!0},hostname:"bingx.com",urls:{logo:"https://github-production-user-asset-6210df.s3.amazonaws.com/1294454/253675376-6983b72e-4999-4549-b177-33b374c195e3.jpg",api:{fund:"https://open-api.{hostname}/openApi",spot:"https://open-api.{hostname}/openApi",swap:"https://open-api.{hostname}/openApi",contract:"https://open-api.{hostname}/openApi",wallets:"https://open-api.{hostname}/openApi",user:"https://open-api.{hostname}/openApi",subAccount:"https://open-api.{hostname}/openApi",account:"https://open-api.{hostname}/openApi",copyTrading:"https://open-api.{hostname}/openApi",cswap:"https://open-api.{hostname}/openApi",api:"https://open-api.{hostname}/openApi"},test:{swap:"https://open-api-vst.{hostname}/openApi"},www:"https://bingx.com/",doc:"https://bingx-api.github.io/docs/",referral:"https://bingx.com/invite/OHETOM"},fees:{tierBased:!0,spot:{feeSide:"get",maker:this.parseNumber("0.001"),taker:this.parseNumber("0.001")},swap:{feeSide:"quote",maker:this.parseNumber("0.0002"),taker:this.parseNumber("0.0005")}},requiredCredentials:{apiKey:!0,secret:!0},api:{fund:{v1:{private:{get:{"account/balance":1}}}},spot:{v1:{public:{get:{"server/time":1,"common/symbols":1,"market/trades":1,"market/depth":1,"market/kline":1,"ticker/24hr":1,"ticker/price":1,"ticker/bookTicker":1}},private:{get:{"trade/query":1,"trade/openOrders":1,"trade/historyOrders":1,"trade/myTrades":2,"user/commissionRate":5,"account/balance":2},post:{"trade/order":2,"trade/cancel":2,"trade/batchOrders":5,"trade/order/cancelReplace":5,"trade/cancelOrders":5,"trade/cancelOpenOrders":5,"trade/cancelAllAfter":5}}},v2:{public:{get:{"market/depth":1,"market/kline":1}}},v3:{private:{get:{"get/asset/transfer":1,"asset/transfer":1,"capital/deposit/hisrec":1,"capital/withdraw/history":1},post:{"post/asset/transfer":5}}}},swap:{v1:{public:{get:{"ticker/price":1,"market/historicalTrades":1,"market/markPriceKlines":1,"trade/multiAssetsRules":1}},private:{get:{"positionSide/dual":5,"trade/batchCancelReplace":5,"trade/fullOrder":2,maintMarginRatio:2,"trade/positionHistory":2,"positionMargin/history":2,"twap/openOrders":5,"twap/historyOrders":5,"twap/orderDetail":5,"trade/assetMode":5,"user/marginAssets":5},post:{"trade/cancelReplace":2,"positionSide/dual":5,"trade/batchCancelReplace":5,"trade/closePosition":2,"trade/getVst":5,"twap/order":5,"twap/cancelOrder":5,"trade/assetMode":5}}},v2:{public:{get:{"server/time":1,"quote/contracts":1,"quote/price":1,"quote/depth":1,"quote/trades":1,"quote/premiumIndex":1,"quote/fundingRate":1,"quote/klines":1,"quote/openInterest":1,"quote/ticker":1,"quote/bookTicker":1}},private:{get:{"user/balance":2,"user/positions":2,"user/income":2,"trade/openOrders":2,"trade/openOrder":2,"trade/order":2,"trade/marginType":5,"trade/leverage":2,"trade/forceOrders":1,"trade/allOrders":2,"trade/allFillOrders":2,"trade/fillHistory":2,"user/income/export":2,"user/commissionRate":2,"quote/bookTicker":1},post:{"trade/order":2,"trade/batchOrders":2,"trade/closeAllPositions":2,"trade/cancelAllAfter":5,"trade/marginType":5,"trade/leverage":5,"trade/positionMargin":5,"trade/order/test":2},delete:{"trade/order":2,"trade/batchOrders":2,"trade/allOpenOrders":2}}},v3:{public:{get:{"quote/klines":1}}}},cswap:{v1:{public:{get:{"market/contracts":1,"market/premiumIndex":1,"market/openInterest":1,"market/klines":1,"market/depth":1,"market/ticker":1}},private:{get:{"trade/leverage":2,"trade/forceOrders":2,"trade/allFillOrders":2,"trade/openOrders":2,"trade/orderDetail":2,"trade/orderHistory":2,"trade/marginType":2,"user/commissionRate":2,"user/positions":2,"user/balance":2},post:{"trade/order":2,"trade/leverage":2,"trade/allOpenOrders":2,"trade/closeAllPositions":2,"trade/marginType":2,"trade/positionMargin":2},delete:{"trade/allOpenOrders":2,"trade/cancelOrder":2}}}},contract:{v1:{private:{get:{allPosition:2,allOrders:2,balance:2}}}},wallets:{v1:{private:{get:{"capital/config/getall":5,"capital/deposit/address":5,"capital/innerTransfer/records":1,"capital/subAccount/deposit/address":5,"capital/deposit/subHisrec":2,"capital/subAccount/innerTransfer/records":1,"capital/deposit/riskRecords":5},post:{"capital/withdraw/apply":5,"capital/innerTransfer/apply":5,"capital/subAccountInnerTransfer/apply":2,"capital/deposit/createSubAddress":2}}}},subAccount:{v1:{private:{get:{list:10,assets:2,allAccountBalance:2},post:{create:10,"apiKey/create":2,"apiKey/edit":2,"apiKey/del":2,updateStatus:10}}}},account:{v1:{private:{get:{uid:1,"apiKey/query":2,"account/apiPermissions":5,allAccountBalance:2},post:{"innerTransfer/authorizeSubAccount":1}}},transfer:{v1:{private:{get:{"subAccount/asset/transferHistory":1},post:{"subAccount/transferAsset/supportCoins":1,"subAccount/transferAsset":1}}}}},user:{auth:{private:{post:{userDataStream:2},put:{userDataStream:2},delete:{userDataStream:2}}}},copyTrading:{v1:{private:{get:{"swap/trace/currentTrack":2},post:{"swap/trace/closeTrackOrder":2,"swap/trace/setTPSL":2,"spot/trader/sellOrder":10}}}},api:{v3:{private:{get:{"asset/transfer":1,"asset/transferRecord":5,"capital/deposit/hisrec":1,"capital/withdraw/history":1},post:{"post/asset/transfer":1}}},asset:{v1:{private:{post:{transfer:5}},public:{get:{"transfer/supportCoins":5}}}}}},timeframes:{"1m":"1m","3m":"3m","5m":"5m","15m":"15m","30m":"30m","1h":"1h","2h":"2h","4h":"4h","6h":"6h","12h":"12h","1d":"1d","3d":"3d","1w":"1w","1M":"1M"},precisionMode:n.kb,exceptions:{exact:{400:r.BadRequest,401:r.AuthenticationError,403:r.PermissionDenied,404:r.BadRequest,429:r.DDoSProtection,418:r.PermissionDenied,500:r.ExchangeError,504:r.ExchangeError,100001:r.AuthenticationError,100412:r.AuthenticationError,100202:r.InsufficientFunds,100204:r.BadRequest,100400:r.BadRequest,100410:r.OperationFailed,100421:r.BadSymbol,100440:r.ExchangeError,100500:r.OperationFailed,100503:r.ExchangeError,80001:r.BadRequest,80012:r.InsufficientFunds,80014:r.BadRequest,80016:r.OrderNotFound,80017:r.OrderNotFound,100414:r.AccountSuspended,100419:r.PermissionDenied,100437:r.BadRequest,101204:r.InsufficientFunds,110425:r.InvalidOrder,"Insufficient assets":r.InsufficientFunds,"illegal transferType":r.BadRequest},broad:{}},commonCurrencies:{SNOW:"Snowman",OMNI:"OmniCat",NAP:"$NAP",TRUMP:"TRUMPMAGA",TRUMPSOL:"TRUMP"},options:{defaultType:"spot",accountsByType:{funding:"fund",spot:"spot",future:"stdFutures",swap:"USDTMPerp",linear:"USDTMPerp",inverse:"coinMPerp"},accountsById:{fund:"funding",spot:"spot",stdFutures:"future",USDTMPerp:"linear",coinMPerp:"inverse"},recvWindow:5e3,broker:"CCXT",defaultNetworks:{ETH:"ETH",USDT:"ERC20",USDC:"ERC20",BTC:"BTC",LTC:"LTC"},networks:{ARBITRUM:"ARB",MATIC:"POLYGON",ZKSYNC:"ZKSYNCERA",AVAXC:"AVAX-C",HBAR:"HEDERA"}},features:{defaultForLinear:{sandbox:!0,createOrder:{marginMode:!1,triggerPrice:!0,triggerPriceType:{last:!0,mark:!0,index:!0},triggerDirection:!1,stopLossPrice:!0,takeProfitPrice:!0,attachedStopLossTakeProfit:{triggerPriceType:{last:!0,mark:!0,index:!0},price:!0},timeInForce:{IOC:!0,FOK:!0,PO:!0,GTD:!1},hedged:!0,trailing:!0,leverage:!1,marketBuyRequiresPrice:!1,marketBuyByCost:!0,selfTradePrevention:!1,iceberg:!1},createOrders:{max:5},fetchMyTrades:{marginMode:!1,limit:512,daysBack:30,untilDays:30,symbolRequired:!0},fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!0},fetchOpenOrders:{marginMode:!1,limit:void 0,trigger:!1,trailing:!1,symbolRequired:!1},fetchOrders:{marginMode:!1,limit:1e3,daysBack:2e4,untilDays:7,trigger:!1,trailing:!1,symbolRequired:!0},fetchClosedOrders:{marginMode:!1,limit:1e3,daysBack:void 0,daysBackCanceled:void 0,untilDays:7,trigger:!1,trailing:!1,symbolRequired:!0},fetchOHLCV:{limit:1440}},defaultForInverse:{extends:"defaultForLinear",fetchMyTrades:{limit:1e3,daysBack:void 0,untilDays:void 0},fetchOrders:void 0},spot:{extends:"defaultForLinear",createOrder:{triggerPriceType:void 0,attachedStopLossTakeProfit:void 0,trailing:!1},fetchMyTrades:{limit:1e3,daysBack:1,untilDays:1},fetchOrders:void 0,fetchClosedOrders:{limit:100,untilDays:void 0}},swap:{linear:{extends:"defaultForLinear"},inverse:{extends:"defaultForInverse"}},defaultForFuture:{extends:"defaultForLinear",fetchOrders:void 0},future:{linear:{extends:"defaultForFuture"},inverse:{extends:"defaultForFuture"}}}})}async fetchTime(e={}){const t=await this.swapV2PublicGetServerTime(e),i=this.safeDict(t,"data");return this.safeInteger(i,"serverTime")}async fetchCurrencies(e={}){if(!this.checkRequiredCredentials(!1))return;if(this.safeBool(this.options,"sandboxMode",!1))return;const t=await this.walletsV1PrivateGetCapitalConfigGetall(e),i=this.safeList(t,"data",[]),s={};for(let e=0;e5)throw new r.InvalidOrder(this.id+" createOrders() can not create more than 5 orders at once for swap markets");d.batchOrders=this.json(i),h=await this.swapV2PrivatePostTradeBatchOrders(d)}else{this.safeBool(t,"sync",!1)&&(d.sync=!0),d.data=this.json(i),h=await this.spotV1PrivatePostTradeBatchOrders(d)}"string"==typeof h&&(h=this.fixStringifiedJsonMembers(h),h=this.parseJson(h));const c=this.safeDict(h,"data",{}),l=this.safeList(c,"orders",[]);return this.parseOrders(l,n)}parseOrderSide(e){return this.safeString({BUY:"buy",SELL:"sell",SHORT:"sell",LONG:"buy",ask:"sell",bid:"buy"},e,e)}parseOrderType(e){return this.safeString({trigger_market:"market",trigger_limit:"limit",stop_limit:"limit",stop_market:"market",take_profit_market:"market",stop:"limit"},e,e)}parseOrder(e,t=void 0){const i=e,s=this.safeDict2(e,"newOrderResponse","orderOpenResponse");void 0!==s&&(e=s);const r=void 0===this.safeString2(e,"positionSide","ps")?"spot":"swap",o=this.safeString2(e,"symbol","s");void 0===t&&(t=this.safeMarket(o,void 0,void 0,r));const n=this.safeStringLower2(e,"side","S"),d=this.safeIntegerN(e,["time","transactTime","E","createdTime"]),h=this.safeInteger2(e,"updateTime","T"),c=this.safeStringUpperN(e,["status","X","orderStatus"]);let l=this.safeString2(e,"feeAsset","N");const u=this.safeStringN(e,["fee","commission","n"]);void 0===l&&(l=t.spot&&"buy"===n?t.base:t.quote);let f,p=this.safeValue(e,"stopLoss");void 0!==p&&""!==p&&(f=this.omitZero(this.safeString(p,"stopLoss"))),void 0!==p&&"number"!=typeof p&&""!==p&&("string"==typeof p&&(p=this.parseJson(p)),f=this.omitZero(this.safeString(p,"stopPrice")));let m,g=this.safeValue(e,"takeProfit");void 0!==g&&""!==g&&(m=this.omitZero(this.safeString(g,"takeProfit"))),void 0!==g&&"number"!=typeof g&&""!==g&&("string"==typeof g&&(g=this.parseJson(g)),m=this.omitZero(this.safeString(g,"stopPrice")));const v=this.safeStringLower2(e,"type","o"),y=this.omitZero(this.safeString2(e,"StopPrice","stopPrice"));let w=y;return void 0!==y&&(v.indexOf("stop")>-1&&void 0===f&&(f=y,w=void 0),v.indexOf("take")>-1&&void 0===m&&(m=y,w=void 0)),this.safeOrder({info:i,id:this.safeStringN(e,["orderId","i","mainOrderId"]),clientOrderId:this.safeStringN(e,["clientOrderID","clientOrderId","origClientOrderId","c"]),symbol:this.safeSymbol(o,t,"-",r),timestamp:d,datetime:this.iso8601(d),lastTradeTimestamp:h,lastUpdateTimestamp:this.safeInteger(e,"updateTime"),type:this.parseOrderType(v),timeInForce:this.safeString(e,"timeInForce"),postOnly:void 0,side:this.parseOrderSide(n),price:this.safeString2(e,"price","p"),triggerPrice:w,stopLossPrice:f,takeProfitPrice:m,average:this.safeString2(e,"avgPrice","ap"),cost:this.safeString(e,"cummulativeQuoteQty"),amount:this.safeStringN(e,["origQty","q","quantity","totalAmount"]),filled:this.safeString2(e,"executedQty","z"),remaining:void 0,status:this.parseOrderStatus(c),fee:{currency:l,cost:a.Y.stringAbs(u)},trades:void 0,reduceOnly:this.safeBool2(e,"reduceOnly","ro")},t)}parseOrderStatus(e){return this.safeString({NEW:"open",PENDING:"open",PARTIALLY_FILLED:"open",RUNNING:"open",FILLED:"closed",CANCELED:"canceled",CANCELLED:"canceled",FAILED:"canceled"},e,e)}async cancelOrder(e,t=void 0,i={}){await this.loadMarkets();const s=this.safeBool(i,"twap",!1);let a,o;if(i=this.omit(i,"twap"),s){const t={mainOrderId:e};a=await this.swapV1PrivatePostTwapCancelOrder(this.extend(t,i))}else{if(void 0===t)throw new r.ArgumentsRequired(this.id+" cancelOrder() requires a symbol argument");o=this.market(t);const s={symbol:o.id},n=this.safeString2(i,"clientOrderId","clientOrderID");let d,h;i=this.omit(i,["clientOrderId"]),void 0!==n?s.clientOrderID=n:s.orderId=e,[d,i]=this.handleMarketTypeAndParams("cancelOrder",o,i),[h,i]=this.handleSubTypeAndParams("cancelOrder",o,i),a="spot"===d?await this.spotV1PrivatePostTradeCancel(this.extend(s,i)):"inverse"===h?await this.cswapV1PrivateDeleteTradeCancelOrder(this.extend(s,i)):await this.swapV2PrivateDeleteTradeOrder(this.extend(s,i))}const n=this.safeDict(a,"data",{}),d=this.safeDict(n,"order",n);return this.parseOrder(d,o)}async cancelAllOrders(e=void 0,t={}){if(void 0===e)throw new r.ArgumentsRequired(this.id+" cancelAllOrders() requires a symbol argument");await this.loadMarkets();const i=this.market(e),s={symbol:i.id};let a;if(i.spot)a=await this.spotV1PrivatePostTradeCancelOpenOrders(this.extend(s,t));else{if(!i.swap)throw new r.BadRequest(this.id+" cancelAllOrders is only supported for spot and swap markets.");a=i.inverse?await this.cswapV1PrivateDeleteTradeAllOpenOrders(this.extend(s,t)):await this.swapV2PrivateDeleteTradeAllOpenOrders(this.extend(s,t))}const o=this.safeDict(a,"data",{}),n=this.safeList2(o,"success","orders",[]);return this.parseOrders(n)}async cancelOrders(e,t=void 0,i={}){if(void 0===t)throw new r.ArgumentsRequired(this.id+" cancelOrders() requires a symbol argument");await this.loadMarkets();const s=this.market(t),a={symbol:s.id},o=this.safeValue(i,"clientOrderIds");i=this.omit(i,"clientOrderIds");let n=e;const d=void 0!==o;d&&(n=o);const h=[];for(let e=0;e0,s={type:i?"ACTIVATE":"CLOSE",timeOut:i?this.parseToInt(e/1e3):0};let a,o;if([o,t]=this.handleMarketTypeAndParams("cancelAllOrdersAfter",void 0,t),"spot"===o)a=await this.spotV1PrivatePostTradeCancelAllAfter(this.extend(s,t));else{if("swap"!==o)throw new r.NotSupported(this.id+" cancelAllOrdersAfter() is not supported for "+o+" markets");a=await this.swapV2PrivatePostTradeCancelAllAfter(this.extend(s,t))}return a}async fetchOrder(e,t=void 0,i={}){await this.loadMarkets();const s=this.safeBool(i,"twap",!1);let a,o;if(i=this.omit(i,"twap"),s){const t={mainOrderId:e};a=await this.swapV1PrivateGetTwapOrderDetail(this.extend(t,i))}else{if(void 0===t)throw new r.ArgumentsRequired(this.id+" fetchOrder() requires a symbol argument");o=this.market(t);const s={symbol:o.id,orderId:e};let n,d;[n,i]=this.handleMarketTypeAndParams("fetchOrder",o,i),[d,i]=this.handleSubTypeAndParams("fetchOrder",o,i),a="spot"===n?await this.spotV1PrivateGetTradeQuery(this.extend(s,i)):"inverse"===d?await this.cswapV1PrivateGetTradeOrderDetail(this.extend(s,i)):await this.swapV2PrivateGetTradeOrder(this.extend(s,i))}const n=this.safeDict(a,"data",{}),d=this.safeDict(n,"order",n);return this.parseOrder(d,o)}async fetchOrders(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();let a,o,n={};if(void 0!==e&&(a=this.market(e),n.symbol=a.id),[o,s]=this.handleMarketTypeAndParams("fetchOrders",a,s),"swap"!==o)throw new r.NotSupported(this.id+" fetchOrders() is only supported for swap markets");void 0!==i&&(n.limit=i),void 0!==t&&(n.startTime=t),[n,s]=this.handleUntilOption("endTime",n,s);const d=await this.swapV1PrivateGetTradeFullOrder(this.extend(n,s)),h=this.safeDict(d,"data",{}),c=this.safeList(h,"orders",[]);return this.parseOrders(c,a,t,i)}async fetchOpenOrders(e=void 0,t=void 0,i=void 0,s={}){let r;await this.loadMarkets();const a={};let o,n,d;if(void 0!==e&&(r=this.market(e),a.symbol=r.id),[o,s]=this.handleMarketTypeAndParams("fetchOpenOrders",r,s),[n,s]=this.handleSubTypeAndParams("fetchOpenOrders",r,s),"spot"===o)d=await this.spotV1PrivateGetTradeOpenOrders(this.extend(a,s));else{const e=this.safeBool(s,"twap",!1);s=this.omit(s,"twap"),d=e?await this.swapV1PrivateGetTwapOpenOrders(this.extend(a,s)):"inverse"===n?await this.cswapV1PrivateGetTradeOpenOrders(this.extend(a,s)):await this.swapV2PrivateGetTradeOpenOrders(this.extend(a,s))}const h=this.safeDict(d,"data",{}),c=this.safeList2(h,"orders","list",[]);return this.parseOrders(c,r,t,i)}async fetchClosedOrders(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();const r=await this.fetchCanceledAndClosedOrders(e,t,i,s);return this.filterBy(r,"status","closed")}async fetchCanceledOrders(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();const r=await this.fetchCanceledAndClosedOrders(e,t,i,s);return this.filterBy(r,"status","canceled")}async fetchCanceledAndClosedOrders(e=void 0,t=void 0,i=void 0,s={}){let r;await this.loadMarkets();const a={};let o,n,d,h;if(void 0!==e&&(r=this.market(e),a.symbol=r.id),[o,s]=this.handleMarketTypeAndParams("fetchClosedOrders",r,s),[n,s]=this.handleSubTypeAndParams("fetchClosedOrders",r,s),[d,s]=this.handleOptionAndParams(s,"fetchClosedOrders","standard",!1),d)h=await this.contractV1PrivateGetAllOrders(this.extend(a,s));else if("spot"===o)void 0!==i&&(a.pageSize=i),h=await this.spotV1PrivateGetTradeHistoryOrders(this.extend(a,s));else{const e=this.safeBool(s,"twap",!1);if(s=this.omit(s,"twap"),e){a.pageIndex=1,a.pageSize=void 0===i?100:i,a.startTime=void 0===t?1:t;const e=this.safeInteger(s,"until",this.milliseconds());s=this.omit(s,"until"),a.endTime=e,h=await this.swapV1PrivateGetTwapHistoryOrders(this.extend(a,s))}else h="inverse"===n?await this.cswapV1PrivateGetTradeOrderHistory(this.extend(a,s)):await this.swapV2PrivateGetTradeAllOrders(this.extend(a,s))}const c=this.safeDict(h,"data",{}),l=this.safeList2(c,"orders","list",[]);return this.parseOrders(l,r,t,i)}async transfer(e,t,i,s,r={}){await this.loadMarkets();const a=this.currency(e),o=this.safeDict(this.options,"accountsByType",{});let n;[n,r]=this.handleSubTypeAndParams("transfer",void 0,r);let d=this.safeString(o,i,i),h=this.safeString(o,s,s);"swap"===d&&(d="inverse"===n?"coinMPerp":"USDTMPerp"),"swap"===h&&(h="inverse"===n?"coinMPerp":"USDTMPerp");const c={fromAccount:d,toAccount:h,asset:a.id,amount:this.currencyToPrecision(e,t)},l=await this.apiAssetV1PrivatePostTransfer(this.extend(c,r));return{info:l,id:this.safeString(l,"transferId"),timestamp:void 0,datetime:void 0,currency:e,amount:t,fromAccount:i,toAccount:s,status:void 0}}async fetchTransfers(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();let a,o={};void 0!==e&&(a=this.currency(e));const n=this.safeDict(this.options,"accountsByType",{}),d=this.safeString(s,"fromAccount"),h=this.safeString(s,"toAccount"),c=this.safeString(n,d,d),l=this.safeString(n,h,h);if(void 0===c||void 0===l)throw new r.ExchangeError(this.id+" fromAccount & toAccount parameters are required");void 0!==d&&(o.fromAccount=c),void 0!==h&&(o.toAccount=l),s=this.omit(s,["fromAccount","toAccount"]);let u=!1;if([u,s]=this.handleOptionAndParams(s,"fetchTransfers","paginate",!1),u)return await this.fetchPaginatedCallDynamic("fetchTransfers",void 0,t,i,s,100);void 0!==t&&(o.startTime=t),void 0!==i&&(o.pageSize=i),[o,s]=this.handleUntilOption("endTime",o,s);const f=await this.apiV3PrivateGetAssetTransferRecord(this.extend(o,s)),p=this.safeList(f,"rows",[]);return this.parseTransfers(p,a,t,i)}parseTransfer(e,t=void 0){const i=this.safeString(e,"transferId"),s=this.safeInteger(e,"timestamp"),r=this.safeString(e,"asset"),a=this.safeCurrencyCode(r,t),o=this.safeString(e,"status"),n=this.safeDict(this.options,"accountsById",{}),d=this.safeString(e,"fromAccount"),h=this.safeString(e,"toAccount"),c=this.safeString(n,d,d),l=this.safeString(n,h,h);return{info:e,id:i,timestamp:s,datetime:this.iso8601(s),currency:a,amount:this.safeNumber(e,"amount"),fromAccount:c,toAccount:l,status:this.parseTransferStatus(o)}}parseTransferStatus(e){return this.safeString({CONFIRMED:"ok"},e,e)}async fetchDepositAddressesByNetwork(e,t={}){await this.loadMarkets();const i=this.currency(e),s=this.safeInteger(this.options,"recvWindow"),r=this.safeInteger(this.parseParams,"recvWindow",s),a={coin:i.id,offset:0,limit:1e3,recvWindow:r},o=await this.walletsV1PrivateGetCapitalDepositAddress(this.extend(a,t)),n=this.safeList(this.safeDict(o,"data"),"data"),d=this.parseDepositAddresses(n,[i.code],!1);return this.indexBy(d,"network")}async fetchDepositAddress(e,t={}){const i=this.safeString(t,"network");t=this.omit(t,["network"]);const s=await this.fetchDepositAddressesByNetwork(e,t);if(void 0!==i)return this.safeDict(s,i);{const t=this.safeDict(this.options,"defaultNetworks"),i=this.safeString(t,e);if(void 0!==i)return this.safeDict(s,i);{const e=Object.keys(s),t=this.safeString(e,0);return this.safeDict(s,t)}}}parseDepositAddress(e,t=void 0){const i=this.safeString(e,"tag"),s=this.safeString(e,"coin"),r=(t=this.safeCurrency(s,t)).code,a=this.safeString(e,"addressWithPrefix"),o=this.safeString(e,"network"),n=this.networkIdToCode(o,r);return this.checkAddress(a),{info:e,currency:r,network:n,address:a,tag:i}}async fetchDeposits(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();const r={};let a;void 0!==e&&(a=this.currency(e),r.coin=a.id),void 0!==t&&(r.startTime=t),void 0!==i&&(r.limit=i);const o=await this.spotV3PrivateGetCapitalDepositHisrec(this.extend(r,s));return this.parseTransactions(o,a,t,i)}async fetchWithdrawals(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();const r={};let a;void 0!==e&&(a=this.currency(e),r.coin=a.id),void 0!==t&&(r.startTime=t),void 0!==i&&(r.limit=i);const o=await this.spotV3PrivateGetCapitalWithdrawHistory(this.extend(r,s));return this.parseTransactions(o,a,t,i)}parseTransaction(e,t=void 0){const i=this.safeValue(e,"data"),s=void 0===i?void 0:this.safeString(i,"id"),r=this.safeString(e,"id",s),a=this.safeString(e,"address"),o=this.safeString(e,"addressTag");let n=this.safeInteger2(e,"insertTime","timestamp"),d=this.iso8601(n);void 0===n&&(d=this.safeString(e,"applyTime"),n=this.parse8601(d));const h=this.safeString(e,"network"),c=this.safeString(e,"coin");let l=this.safeCurrencyCode(c,t);void 0!==l&&l!==h&&l.indexOf(h)>=0&&void 0!==h&&(l=l.replace(h,""));const u="0"===this.safeString(e,"transferType")?"deposit":"withdrawal";return{info:e,id:r,txid:this.safeString(e,"txId"),type:u,currency:l,network:this.networkIdToCode(h),amount:this.safeNumber(e,"amount"),status:this.parseTransactionStatus(this.safeString(e,"status")),timestamp:n,datetime:d,address:a,addressFrom:void 0,addressTo:a,tag:o,tagFrom:o,tagTo:void 0,updated:void 0,comment:this.safeString(e,"info"),fee:{currency:l,cost:this.safeNumber(e,"transactionFee"),rate:void 0},internal:void 0}}parseTransactionStatus(e){return this.safeString({0:"pending",1:"ok",10:"pending",20:"rejected",30:"ok",40:"rejected",50:"ok",60:"pending",70:"rejected",2:"pending",3:"rejected",4:"pending",5:"rejected",6:"ok"},e,e)}async setMarginMode(e,t=void 0,i={}){if(void 0===t)throw new r.ArgumentsRequired(this.id+" setMarginMode() requires a symbol argument");await this.loadMarkets();const s=this.market(t);if("swap"!==s.type)throw new r.BadSymbol(this.id+" setMarginMode() supports swap contracts only");if("CROSS"===(e=e.toUpperCase())&&(e="CROSSED"),"ISOLATED"!==e&&"CROSSED"!==e)throw new r.BadRequest(this.id+" setMarginMode() marginMode argument should be isolated or cross");const a={symbol:s.id,marginType:e};let o;return[o,i]=this.handleSubTypeAndParams("setMarginMode",s,i),"inverse"===o?await this.cswapV1PrivatePostTradeMarginType(this.extend(a,i)):await this.swapV2PrivatePostTradeMarginType(this.extend(a,i))}async addMargin(e,t,i={}){return await this.setMargin(e,t,this.extend({type:1},i))}async reduceMargin(e,t,i={}){return await this.setMargin(e,t,this.extend({type:2},i))}async setMargin(e,t,i={}){const s=this.safeInteger(i,"type");if(void 0===s)throw new r.ArgumentsRequired(this.id+" setMargin() requires a type parameter either 1 (increase margin) or 2 (decrease margin)");if(!this.inArray(s,[1,2]))throw new r.ArgumentsRequired(this.id+" setMargin() requires a type parameter either 1 (increase margin) or 2 (decrease margin)");await this.loadMarkets();const a=this.market(e),o={symbol:a.id,amount:this.amountToPrecision(a.symbol,t),type:s},n=await this.swapV2PrivatePostTradePositionMargin(this.extend(o,i));return this.parseMarginModification(n,a)}parseMarginModification(e,t=void 0){const i=this.safeString(e,"type");return{info:e,symbol:this.safeString(t,"symbol"),type:"1"===i?"add":"reduce",marginMode:"isolated",amount:this.safeNumber(e,"amount"),total:this.safeNumber(e,"margin"),code:this.safeString(t,"settle"),status:void 0,timestamp:void 0,datetime:void 0}}async fetchLeverage(e,t={}){await this.loadMarkets();const i=this.market(e),s={symbol:i.id};let r;r=i.inverse?await this.cswapV1PrivateGetTradeLeverage(this.extend(s,t)):await this.swapV2PrivateGetTradeLeverage(this.extend(s,t));const a=this.safeDict(r,"data",{});return this.parseLeverage(a,i)}parseLeverage(e,t=void 0){const i=this.safeString(e,"symbol");return{info:e,symbol:this.safeSymbol(i,t),marginMode:void 0,longLeverage:this.safeInteger(e,"longLeverage"),shortLeverage:this.safeInteger(e,"shortLeverage")}}async setLeverage(e,t=void 0,i={}){if(void 0===t)throw new r.ArgumentsRequired(this.id+" setLeverage() requires a symbol argument");const s=this.safeStringUpper(i,"side");this.checkRequiredArgument("setLeverage",s,"side",["LONG","SHORT","BOTH"]),await this.loadMarkets();const a=this.market(t),o={symbol:a.id,side:s,leverage:e};return a.inverse?await this.cswapV1PrivatePostTradeLeverage(this.extend(o,i)):await this.swapV2PrivatePostTradeLeverage(this.extend(o,i))}async fetchMyTrades(e=void 0,t=void 0,i=void 0,s={}){if(void 0===e)throw new r.ArgumentsRequired(this.id+" fetchMyTrades() requires a symbol argument");await this.loadMarkets();const a=this.market(e),o={};let n,d,h;if([h,s]=this.handleSubTypeAndParams("fetchMyTrades",a,s),"inverse"===h){if(void 0===this.safeString(s,"orderId"))throw new r.ArgumentsRequired(this.id+" fetchMyTrades() requires an orderId argument for inverse swap trades");d=await this.cswapV1PrivateGetTradeAllFillOrders(this.extend(o,s)),n=this.safeList(d,"data",[])}else{o.symbol=a.id;const e=this.milliseconds();if(void 0!==t){o[a.spot?"startTime":"startTs"]=t}else a.swap&&(o.startTs=e-2592e6);const r=this.safeInteger(s,"until");if(s=this.omit(s,"until"),void 0!==r){o[a.spot?"endTime":"endTs"]=r}else a.swap&&(o.endTs=e);if(a.spot){void 0!==i&&(o.limit=i),d=await this.spotV1PrivateGetTradeMyTrades(this.extend(o,s));const e=this.safeDict(d,"data",{});n=this.safeList(e,"fills",[])}else{const e=this.safeStringUpper(s,"tradingUnit","CONT");s=this.omit(s,"tradingUnit"),o.tradingUnit=e,d=await this.swapV2PrivateGetTradeAllFillOrders(this.extend(o,s));const t=this.safeDict(d,"data",{});n=this.safeList(t,"fill_orders",[])}}return this.parseTrades(n,a,t,i,s)}parseDepositWithdrawFee(e,t=void 0){const i=this.safeDict(e,"networks",{}),s=Object.keys(i),r=s.length,a={info:i,withdraw:{fee:void 0,percentage:void 0},deposit:{fee:void 0,percentage:void 0},networks:{}};if(0!==r)for(let e=0;e0&&(t+=","),t+=r[e].toString()}t+="]",e[s]=t}}return e}async fetchMyLiquidations(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();let r,a,o,n,d={autoCloseType:"LIQUIDATION"};if([d,s]=this.handleUntilOption("endTime",d,s),void 0!==e&&(r=this.market(e),d.symbol=r.id),void 0!==t&&(d.startTime=t),void 0!==i&&(d.limit=i),[a,s]=this.handleSubTypeAndParams("fetchMyLiquidations",r,s),"inverse"===a)o=await this.cswapV1PrivateGetTradeForceOrders(this.extend(d,s)),n=this.safeList(o,"data",[]);else{o=await this.swapV2PrivateGetTradeForceOrders(this.extend(d,s));const e=this.safeDict(o,"data",{});n=this.safeList(e,"orders",[])}return this.parseLiquidations(n,r,t,i)}parseLiquidation(e,t=void 0){const i=this.safeString(e,"symbol"),s=this.safeInteger(e,"time"),r=this.safeString(e,"executedQty"),o=this.safeString(t,"contractSize"),n=this.safeString(e,"avgPrice"),d=a.Y.stringMul(r,o),h=a.Y.stringMul(d,n);return this.safeLiquidation({info:e,symbol:this.safeSymbol(i,t),contracts:this.parseNumber(r),contractSize:this.parseNumber(o),price:this.parseNumber(n),baseValue:this.parseNumber(d),quoteValue:this.parseNumber(h),timestamp:s,datetime:this.iso8601(s)})}async closePosition(e,t=void 0,i={}){await this.loadMarkets();const s=this.market(e),r={};let a;void 0!==this.safeString(i,"positionId")?a=await this.swapV1PrivatePostTradeClosePosition(this.extend(r,i)):(r.symbol=s.id,a=s.inverse?await this.cswapV1PrivatePostTradeCloseAllPositions(this.extend(r,i)):await this.swapV2PrivatePostTradeCloseAllPositions(this.extend(r,i)));const o=this.safeDict(a,"data");return this.parseOrder(o,s)}async closeAllPositions(e={}){await this.loadMarkets();const t=this.safeInteger(this.options,"recvWindow"),i=this.safeInteger(this.parseParams,"recvWindow",t);let s,a;if([s,e]=this.handleMarketTypeAndParams("closeAllPositions",void 0,e),[a,e]=this.handleSubTypeAndParams("closeAllPositions",void 0,e),"margin"===s)throw new r.BadRequest(this.id+" closePositions () cannot be used for "+s+" markets");const o={recvWindow:i};let n;n="inverse"===a?await this.cswapV1PrivatePostTradeCloseAllPositions(this.extend(o,e)):await this.swapV2PrivatePostTradeCloseAllPositions(this.extend(o,e));const d=this.safeDict(n,"data",{}),h=this.safeList(d,"success",[]),c=[];for(let e=0;e0?e+=',"'+i.toString()+'"':e='"'+i.toString()+'"':t>0?e+=","+i.toString():e=i.toString()}s="["+e+"]",o=s}0===t?r=a+"="+o:r+="&"+a+"="+o}return r}sign(e,t="public",i="GET",s={},a=void 0,n=void 0){let d=t[0],h=t[1],c=t[2];if(this.safeBool(this.options,"sandboxMode",!1)&&"swap"!==d)throw new r.NotSupported(this.id+" does not have a testnet/sandbox URL for "+d+" endpoints");let l=this.implodeHostname(this.urls.api[d]);e=this.implodeParams(e,s);const u="transfer"===h;if((u||"asset"===h)&&(d=u?"account/transfer":"api/asset",h=t[2],c=t[3]),"account/apiPermissions"!==e&&(l+="spot"===d&&"v3"===h?"/api":"/"+d),l+="/"+h+"/"+e,(s=this.omit(s,this.extractParams(e))).timestamp=this.nonce(),s=this.keysort(s),"public"===c)Object.keys(s).length&&(l+="?"+this.urlencode(s));else if("private"===c){this.checkRequiredCredentials();const e=("subAccount"===d||"account/transfer"===d)&&"POST"===i;let t,r;e?r=this.customEncode(s):(t=this.parseParams(s),r=this.rawencode(t,!0));const h=this.hmac(this.encode(r),this.encode(this.secret),o.s);if(a={"X-BX-APIKEY":this.apiKey,"X-SOURCE-KEY":this.safeString(this.options,"broker","CCXT")},e)a["Content-Type"]="application/json",s.signature=h,n=this.json(s);else{l+="?"+this.urlencode(t,!0)+"&signature="+h}}return{url:l,method:i,body:n,headers:a}}nonce(){return this.milliseconds()}setSandboxMode(e){super.setSandboxMode(e),this.options.sandboxMode=e}handleErrors(e,t,i,s,a,o,n,d,h){if(void 0===n)return;const c=this.safeString(n,"code");let l=this.safeString(n,"msg");const u=this.safeString(n,"transferErrorMsg");if(void 0!==u||void 0!==c&&"0"!==c){void 0!==u&&(l=u);const e=this.id+" "+o;throw this.throwExactlyMatchedException(this.exceptions.exact,l,e),this.throwExactlyMatchedException(this.exceptions.exact,c,e),this.throwBroadlyMatchedException(this.exceptions.broad,l,e),new r.ExchangeError(e)}}}},1183:(e,t,i)=>{i.d(t,{A:()=>r});var s=i(5408);class r extends s.A{describe(){return this.deepExtend(super.describe(),{id:"bit24",name:"Bit24",countries:["IR"],rateLimit:1e3,version:"1",certified:!1,pro:!1,has:{CORS:void 0,spot:!0,margin:!1,swap:!1,future:!1,option:!1,addMargin:!1,cancelAllOrders:!1,cancelOrder:!1,cancelOrders:!1,createDepositAddress:!1,createOrder:!1,createStopLimitOrder:!1,createStopMarketOrder:!1,createStopOrder:!1,editOrder:!1,fetchBalance:!1,fetchBorrowInterest:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchClosedOrders:!1,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!1,fetchDepositAddress:!1,fetchDeposits:!1,fetchFundingHistory:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchL2OrderBook:!1,fetchL3OrderBook:!1,fetchLedger:!1,fetchLedgerEntry:!1,fetchLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMyTrades:!1,fetchOHLCV:!1,fetchOpenInterestHistory:!1,fetchOpenOrders:!1,fetchOrder:!1,fetchOrderBook:!1,fetchOrders:!1,fetchOrderTrades:"emulated",fetchPositions:!1,fetchPremiumIndexOHLCV:!1,fetchTicker:!0,fetchTickers:!0,fetchTime:!1,fetchTrades:!1,fetchTradingFee:!1,fetchTradingFees:!1,fetchWithdrawals:!1,setLeverage:!1,setMarginMode:!1,transfer:!1,withdraw:!1},comment:"This comment is optional",urls:{logo:"https://cdn.arz.digital/cr-odin/img/exchanges/bit24/64x64.png",api:{public:"https://bit24.cash/api/"},www:"https://bit24.cash/",doc:["https://bit24.cash/"]},api:{public:{get:{"pro/v3/markets":1}}},fees:{}})}async fetchMarkets(e={}){const t=[];let i=1;for(;;){const s=await this.publicGetProV3Markets(this.extend(e,{page:i,per_page:100})),r=this.safeDict(s,"data"),a=this.safeList(r,"results",[]);for(let e=0;e{i.d(t,{A:()=>d});var s=i(3885),r=i(2079),a=i(5147),o=i(1579),n=i(7481);class d extends s.A{describe(){return this.deepExtend(super.describe(),{id:"bit2c",name:"Bit2C",countries:["IL"],rateLimit:3e3,pro:!1,has:{CORS:void 0,spot:!0,margin:!1,swap:!1,future:!1,option:!1,addMargin:!1,borrowCrossMargin:!1,borrowIsolatedMargin:!1,borrowMargin:!1,cancelAllOrders:!1,cancelOrder:!0,closeAllPositions:!1,closePosition:!1,createOrder:!0,createOrderWithTakeProfitAndStopLoss:!1,createOrderWithTakeProfitAndStopLossWs:!1,createReduceOnlyOrder:!1,fetchBalance:!0,fetchBorrowInterest:!1,fetchBorrowRate:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchBorrowRates:!1,fetchBorrowRatesPerSymbol:!1,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchDepositAddress:!0,fetchDepositAddresses:!1,fetchDepositAddressesByNetwork:!1,fetchFundingHistory:!1,fetchFundingInterval:!1,fetchFundingIntervals:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchGreeks:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchIsolatedPositions:!1,fetchLeverage:!1,fetchLeverages:!1,fetchLeverageTiers:!1,fetchLiquidations:!1,fetchLongShortRatio:!1,fetchLongShortRatioHistory:!1,fetchMarginAdjustmentHistory:!1,fetchMarginMode:!1,fetchMarginModes:!1,fetchMarketLeverageTiers:!1,fetchMarkOHLCV:!1,fetchMarkPrices:!1,fetchMyLiquidations:!1,fetchMySettlementHistory:!1,fetchMyTrades:!0,fetchOpenInterest:!1,fetchOpenInterestHistory:!1,fetchOpenInterests:!1,fetchOpenOrders:!0,fetchOption:!1,fetchOptionChain:!1,fetchOrder:!0,fetchOrderBook:!0,fetchPosition:!1,fetchPositionHistory:!1,fetchPositionMode:!1,fetchPositions:!1,fetchPositionsForSymbol:!1,fetchPositionsHistory:!1,fetchPositionsRisk:!1,fetchPremiumIndexOHLCV:!1,fetchSettlementHistory:!1,fetchTicker:!0,fetchTrades:!0,fetchTradingFee:!1,fetchTradingFees:!0,fetchTransfer:!1,fetchTransfers:!1,fetchUnderlyingAssets:!1,fetchVolatilityHistory:!1,reduceMargin:!1,repayCrossMargin:!1,repayIsolatedMargin:!1,repayMargin:!1,setLeverage:!1,setMargin:!1,setMarginMode:!1,setPositionMode:!1,transfer:!1,ws:!1},urls:{logo:"https://github.com/user-attachments/assets/db0bce50-6842-4c09-a1d5-0c87d22118aa",api:{rest:"https://bit2c.co.il"},www:"https://www.bit2c.co.il",referral:"https://bit2c.co.il/Aff/63bfed10-e359-420c-ab5a-ad368dab0baf",doc:["https://www.bit2c.co.il/home/api","https://github.com/OferE/bit2c"]},api:{public:{get:["Exchanges/{pair}/Ticker","Exchanges/{pair}/orderbook","Exchanges/{pair}/trades","Exchanges/{pair}/lasttrades"]},private:{post:["Merchant/CreateCheckout","Funds/AddCoinFundsRequest","Order/AddFund","Order/AddOrder","Order/GetById","Order/AddOrderMarketPriceBuy","Order/AddOrderMarketPriceSell","Order/CancelOrder","Order/AddCoinFundsRequest","Order/AddStopOrder","Payment/GetMyId","Payment/Send","Payment/Pay"],get:["Account/Balance","Account/Balance/v2","Order/MyOrders","Order/GetById","Order/AccountHistory","Order/OrderHistory"]}},markets:{"BTC/NIS":this.safeMarketStructure({id:"BtcNis",symbol:"BTC/NIS",base:"BTC",quote:"NIS",baseId:"Btc",quoteId:"Nis",type:"spot",spot:!0}),"ETH/NIS":this.safeMarketStructure({id:"EthNis",symbol:"ETH/NIS",base:"ETH",quote:"NIS",baseId:"Eth",quoteId:"Nis",type:"spot",spot:!0}),"LTC/NIS":this.safeMarketStructure({id:"LtcNis",symbol:"LTC/NIS",base:"LTC",quote:"NIS",baseId:"Ltc",quoteId:"Nis",type:"spot",spot:!0}),"USDC/NIS":this.safeMarketStructure({id:"UsdcNis",symbol:"USDC/NIS",base:"USDC",quote:"NIS",baseId:"Usdc",quoteId:"Nis",type:"spot",spot:!0})},fees:{trading:{tierBased:!0,percentage:!0,maker:this.parseNumber("0.025"),taker:this.parseNumber("0.03"),tiers:{taker:[[this.parseNumber("0"),this.parseNumber("0.03")],[this.parseNumber("20000"),this.parseNumber("0.0275")],[this.parseNumber("50000"),this.parseNumber("0.025")],[this.parseNumber("75000"),this.parseNumber("0.0225")],[this.parseNumber("100000"),this.parseNumber("0.02")],[this.parseNumber("250000"),this.parseNumber("0.015")],[this.parseNumber("500000"),this.parseNumber("0.0125")],[this.parseNumber("750000"),this.parseNumber("0.01")],[this.parseNumber("1000000"),this.parseNumber("0.008")],[this.parseNumber("2000000"),this.parseNumber("0.006")],[this.parseNumber("3000000"),this.parseNumber("0.004")],[this.parseNumber("4000000"),this.parseNumber("0.002")]],maker:[[this.parseNumber("0"),this.parseNumber("0.025")],[this.parseNumber("20000"),this.parseNumber("0.0225")],[this.parseNumber("50000"),this.parseNumber("0.02")],[this.parseNumber("75000"),this.parseNumber("0.0175")],[this.parseNumber("100000"),this.parseNumber("0.015")],[this.parseNumber("250000"),this.parseNumber("0.01")],[this.parseNumber("500000"),this.parseNumber("0.0075")],[this.parseNumber("750000"),this.parseNumber("0.005")],[this.parseNumber("1000000"),this.parseNumber("0.004")],[this.parseNumber("2000000"),this.parseNumber("0.003")],[this.parseNumber("3000000"),this.parseNumber("0.002")],[this.parseNumber("4000000"),this.parseNumber("0.001")]]}}},options:{fetchTradesMethod:"public_get_exchanges_pair_trades"},features:{spot:{sandbox:!1,createOrder:{marginMode:!1,triggerPrice:!1,triggerPriceType:void 0,triggerDirection:!1,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!1,FOK:!1,PO:!1,GTD:!1},hedged:!1,trailing:!1,leverage:!1,marketBuyRequiresPrice:!1,marketBuyByCost:!1,selfTradePrevention:!1,iceberg:!1},createOrders:void 0,fetchMyTrades:{marginMode:!1,limit:100,daysBack:30,untilDays:30,symbolRequired:!1},fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!1},fetchOpenOrders:{marginMode:!1,limit:void 0,trigger:!1,trailing:!1,symbolRequired:!0},fetchOrders:void 0,fetchClosedOrders:void 0,fetchOHLCV:void 0},swap:{linear:void 0,inverse:void 0},future:{linear:void 0,inverse:void 0}},precisionMode:o.kb,exceptions:{exact:{"Please provide valid APIkey":r.AuthenticationError,"No order found.":r.OrderNotFound},broad:{"Please provide valid nonce":r.InvalidNonce,"please approve new terms of use on site":r.PermissionDenied}}})}parseBalance(e){const t={info:e,timestamp:void 0,datetime:void 0},i=Object.keys(this.currencies);for(let s=0;s{i.d(t,{A:()=>n});var s=i(2308),r=i(2079),a=i(1579),o=i(4852);class n extends s.A{describe(){return this.deepExtend(super.describe(),{id:"bitbank",name:"bitbank",countries:["JP"],version:"v1",has:{CORS:void 0,spot:!0,margin:!1,swap:!1,future:!1,option:!1,addMargin:!1,borrowCrossMargin:!1,borrowIsolatedMargin:!1,borrowMargin:!1,cancelAllOrders:!1,cancelOrder:!0,closeAllPositions:!1,closePosition:!1,createOrder:!0,createOrderWithTakeProfitAndStopLoss:!1,createOrderWithTakeProfitAndStopLossWs:!1,createReduceOnlyOrder:!1,fetchBalance:!0,fetchBorrowInterest:!1,fetchBorrowRate:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchBorrowRates:!1,fetchBorrowRatesPerSymbol:!1,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchDepositAddress:!0,fetchDepositAddresses:!1,fetchDepositAddressesByNetwork:!1,fetchFundingHistory:!1,fetchFundingInterval:!1,fetchFundingIntervals:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchGreeks:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchIsolatedPositions:!1,fetchLeverage:!1,fetchLeverages:!1,fetchLeverageTiers:!1,fetchLiquidations:!1,fetchLongShortRatio:!1,fetchLongShortRatioHistory:!1,fetchMarginAdjustmentHistory:!1,fetchMarginMode:!1,fetchMarginModes:!1,fetchMarketLeverageTiers:!1,fetchMarkOHLCV:!1,fetchMarkPrices:!1,fetchMyLiquidations:!1,fetchMySettlementHistory:!1,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenInterest:!1,fetchOpenInterestHistory:!1,fetchOpenInterests:!1,fetchOpenOrders:!0,fetchOption:!1,fetchOptionChain:!1,fetchOrder:!0,fetchOrderBook:!0,fetchPosition:!1,fetchPositionHistory:!1,fetchPositionMode:!1,fetchPositions:!1,fetchPositionsForSymbol:!1,fetchPositionsHistory:!1,fetchPositionsRisk:!1,fetchPremiumIndexOHLCV:!1,fetchSettlementHistory:!1,fetchTicker:!0,fetchTrades:!0,fetchTradingFee:!1,fetchTradingFees:!0,fetchTransfer:!1,fetchTransfers:!1,fetchVolatilityHistory:!1,reduceMargin:!1,repayCrossMargin:!1,repayIsolatedMargin:!1,setLeverage:!1,setMargin:!1,setMarginMode:!1,setPositionMode:!1,transfer:!1,withdraw:!0},timeframes:{"1m":"1min","5m":"5min","15m":"15min","30m":"30min","1h":"1hour","4h":"4hour","8h":"8hour","12h":"12hour","1d":"1day","1w":"1week"},hostname:"bitbank.cc",urls:{logo:"https://github.com/user-attachments/assets/9d616de0-8a88-4468-8e38-d269acab0348",api:{public:"https://public.{hostname}",private:"https://api.{hostname}",markets:"https://api.{hostname}"},www:"https://bitbank.cc/",doc:"https://docs.bitbank.cc/",fees:"https://bitbank.cc/docs/fees/"},api:{public:{get:["{pair}/ticker","tickers","tickers_jpy","{pair}/depth","{pair}/transactions","{pair}/transactions/{yyyymmdd}","{pair}/candlestick/{candletype}/{yyyymmdd}","{pair}/circuit_break_info"]},private:{get:["user/assets","user/spot/order","user/spot/active_orders","user/margin/positions","user/spot/trade_history","user/deposit_history","user/unconfirmed_deposits","user/deposit_originators","user/withdrawal_account","user/withdrawal_history","spot/status","spot/pairs"],post:["user/spot/order","user/spot/cancel_order","user/spot/cancel_orders","user/spot/orders_info","user/confirm_deposits","user/confirm_deposits_all","user/request_withdrawal"]},markets:{get:["spot/pairs"]}},features:{spot:{sandbox:!1,createOrder:{marginMode:!1,triggerPrice:!0,triggerPriceType:void 0,triggerDirection:!1,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!1,FOK:!1,PO:!0,GTD:!1},hedged:!1,trailing:!1,leverage:!1,marketBuyRequiresPrice:!1,marketBuyByCost:!1,selfTradePrevention:!1,iceberg:!1},createOrders:void 0,fetchMyTrades:{marginMode:!1,limit:1e3,daysBack:void 0,untilDays:void 0,symbolRequired:!1},fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!1},fetchOpenOrders:{marginMode:!1,limit:1e3,trigger:!1,trailing:!1,symbolRequired:!1},fetchOrders:void 0,fetchClosedOrders:void 0,fetchOHLCV:{limit:1e3}},swap:{linear:void 0,inverse:void 0},future:{linear:void 0,inverse:void 0}},precisionMode:a.kb,exceptions:{exact:{20001:r.AuthenticationError,20002:r.AuthenticationError,20003:r.AuthenticationError,20005:r.AuthenticationError,20004:r.InvalidNonce,40020:r.InvalidOrder,40021:r.InvalidOrder,40025:r.ExchangeError,40013:r.OrderNotFound,40014:r.OrderNotFound,50008:r.PermissionDenied,50009:r.OrderNotFound,50010:r.OrderNotFound,60001:r.InsufficientFunds,60005:r.InvalidOrder}}})}async fetchMarkets(e={}){const t=await this.marketsGetSpotPairs(e),i=this.safeValue(t,"data"),s=this.safeValue(i,"pairs",[]);return this.parseMarkets(s)}parseMarket(e){const t=this.safeString(e,"name"),i=this.safeString(e,"base_asset"),s=this.safeString(e,"quote_asset"),r=this.safeCurrencyCode(i),a=this.safeCurrencyCode(s);return{id:t,symbol:r+"/"+a,base:r,quote:a,settle:void 0,baseId:i,quoteId:s,settleId:void 0,type:"spot",spot:!0,margin:!1,swap:!1,future:!1,option:!1,active:this.safeValue(e,"is_enabled"),contract:!1,linear:void 0,inverse:void 0,taker:this.safeNumber(e,"taker_fee_rate_quote"),maker:this.safeNumber(e,"maker_fee_rate_quote"),contractSize:void 0,expiry:void 0,expiryDatetime:void 0,strike:void 0,optionType:void 0,precision:{amount:this.parseNumber(this.parsePrecision(this.safeString(e,"amount_digits"))),price:this.parseNumber(this.parsePrecision(this.safeString(e,"price_digits")))},limits:{leverage:{min:void 0,max:void 0},amount:{min:this.safeNumber(e,"unit_amount"),max:this.safeNumber(e,"limit_max_amount")},price:{min:void 0,max:void 0},cost:{min:void 0,max:void 0}},created:void 0,info:e}}parseTicker(e,t=void 0){const i=this.safeSymbol(void 0,t),s=this.safeInteger(e,"timestamp"),r=this.safeString(e,"last");return this.safeTicker({symbol:i,timestamp:s,datetime:this.iso8601(s),high:this.safeString(e,"high"),low:this.safeString(e,"low"),bid:this.safeString(e,"buy"),bidVolume:void 0,ask:this.safeString(e,"sell"),askVolume:void 0,vwap:void 0,open:void 0,close:r,last:r,previousClose:void 0,change:void 0,percentage:void 0,average:void 0,baseVolume:this.safeString(e,"vol"),quoteVolume:void 0,info:e},t)}async fetchTicker(e,t={}){await this.loadMarkets();const i=this.market(e),s={pair:i.id},r=await this.publicGetPairTicker(this.extend(s,t)),a=this.safeDict(r,"data",{});return this.parseTicker(a,i)}async fetchOrderBook(e,t=void 0,i={}){await this.loadMarkets();const s=this.market(e),r={pair:s.id},a=await this.publicGetPairDepth(this.extend(r,i)),o=this.safeValue(a,"data",{}),n=this.safeInteger(o,"timestamp");return this.parseOrderBook(o,s.symbol,n)}parseTrade(e,t=void 0){const i=this.safeInteger(e,"executed_at");t=this.safeMarket(void 0,t);const s=this.safeString(e,"price"),r=this.safeString(e,"amount"),a=this.safeString2(e,"transaction_id","trade_id"),o=this.safeString(e,"maker_taker");let n;const d=this.safeString(e,"fee_amount_quote");void 0!==d&&(n={currency:t.quote,cost:d});const h=this.safeString(e,"order_id"),c=this.safeString(e,"type"),l=this.safeString(e,"side");return this.safeTrade({timestamp:i,datetime:this.iso8601(i),symbol:t.symbol,id:a,order:h,type:c,side:l,takerOrMaker:o,price:s,amount:r,cost:void 0,fee:n,info:e},t)}async fetchTrades(e,t=void 0,i=void 0,s={}){await this.loadMarkets();const r=this.market(e),a={pair:r.id},o=await this.publicGetPairTransactions(this.extend(a,s)),n=this.safeValue(o,"data",{}),d=this.safeList(n,"transactions",[]);return this.parseTrades(d,r,t,i)}async fetchTradingFees(e={}){await this.loadMarkets();const t=await this.marketsGetSpotPairs(e),i=this.safeValue(t,"data",{}),s=this.safeValue(i,"pairs",[]),r={};for(let e=0;e{i.d(t,{A:()=>d});var s=i(5625),r=i(2079),a=i(5147),o=i(1579),n=i(7481);class d extends s.A{describe(){return this.deepExtend(super.describe(),{id:"bitbns",name:"Bitbns",countries:["IN"],rateLimit:1e3,certified:!1,version:"v2",has:{CORS:void 0,spot:!0,margin:void 0,swap:!1,future:!1,option:void 0,cancelAllOrders:!1,cancelOrder:!0,createOrder:!0,createStopOrder:!0,createTriggerOrder:!0,fetchBalance:!0,fetchDepositAddress:!0,fetchDepositAddresses:!1,fetchDepositAddressesByNetwork:!1,fetchDeposits:!0,fetchFundingHistory:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchIndexOHLCV:!1,fetchMarginMode:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMyTrades:!0,fetchOHLCV:!1,fetchOpenOrders:!0,fetchOrder:!0,fetchOrderBook:!0,fetchPositionMode:!1,fetchPremiumIndexOHLCV:!1,fetchStatus:!0,fetchTicker:"emulated",fetchTickers:!0,fetchTrades:!0,fetchTradingFee:!1,fetchTradingFees:!1,fetchTransfer:!1,fetchTransfers:!1,fetchWithdrawal:!1,fetchWithdrawals:!0,transfer:!1,withdraw:!1},hostname:"bitbns.com",urls:{logo:"https://github.com/user-attachments/assets/a5b9a562-cdd8-4bea-9fa7-fd24c1dad3d9",api:{www:"https://{hostname}",v1:"https://api.{hostname}/api/trade/v1",v2:"https://api.{hostname}/api/trade/v2"},www:"https://bitbns.com",referral:"https://ref.bitbns.com/1090961",doc:["https://bitbns.com/trade/#/api-trading/"],fees:"https://bitbns.com/fees"},api:{www:{get:["order/fetchMarkets","order/fetchTickers","order/fetchOrderbook","order/getTickerWithVolume","exchangeData/ohlc","exchangeData/orderBook","exchangeData/tradedetails"]},v1:{get:["platform/status","tickers","orderbook/sell/{symbol}","orderbook/buy/{symbol}"],post:["currentCoinBalance/EVERYTHING","getApiUsageStatus/USAGE","getOrderSocketToken/USAGE","currentCoinBalance/{symbol}","orderStatus/{symbol}","depositHistory/{symbol}","withdrawHistory/{symbol}","withdrawHistoryAll/{symbol}","depositHistoryAll/{symbol}","listOpenOrders/{symbol}","listOpenStopOrders/{symbol}","getCoinAddress/{symbol}","placeSellOrder/{symbol}","placeBuyOrder/{symbol}","buyStopLoss/{symbol}","sellStopLoss/{symbol}","cancelOrder/{symbol}","cancelStopLossOrder/{symbol}","listExecutedOrders/{symbol}","placeMarketOrder/{symbol}","placeMarketOrderQnty/{symbol}"]},v2:{post:["orders","cancel","getordersnew","marginOrders"]}},fees:{trading:{feeSide:"quote",tierBased:!1,percentage:!0,taker:this.parseNumber("0.0025"),maker:this.parseNumber("0.0025")}},precisionMode:o.kb,features:{spot:{sandbox:!1,createOrder:{marginMode:!1,triggerPrice:!0,triggerPriceType:void 0,triggerDirection:!1,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!1,FOK:!1,PO:!1,GTD:!1},hedged:!1,trailing:!1,leverage:!1,marketBuyRequiresPrice:!1,marketBuyByCost:!1,selfTradePrevention:!1,iceberg:!1},createOrders:void 0,fetchMyTrades:{marginMode:!1,limit:void 0,daysBack:void 0,untilDays:void 0,symbolRequired:!0},fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!0},fetchOpenOrders:{marginMode:!1,limit:void 0,trigger:!0,trailing:!1,symbolRequired:!0},fetchOrders:void 0,fetchClosedOrders:void 0,fetchOHLCV:{limit:100}},swap:{linear:void 0,inverse:void 0},future:{linear:void 0,inverse:void 0}},exceptions:{exact:{400:r.BadRequest,409:r.BadSymbol,416:r.InsufficientFunds,417:r.OrderNotFound},broad:{}}})}async fetchStatus(e={}){const t=await this.v1GetPlatformStatus(e),i=this.safeString(t,"status");return{status:this.safeString({1:"ok"},i,i),updated:void 0,eta:void 0,url:void 0,info:t}}async fetchMarkets(e={}){const t=await this.wwwGetOrderFetchMarkets(e),i=[];for(let e=0;e1){let e=this.safeString(a,1);const r=this.account();r.free=this.safeString(s,t),r.used=this.safeString(s,"inorder"+e),"Money"===e&&(e="INR");i[this.safeCurrencyCode(e)]=r}}return this.safeBalance(i)}async fetchBalance(e={}){await this.loadMarkets();const t=await this.v1PostCurrentCoinBalanceEVERYTHING(e);return this.parseBalance(t)}parseStatus(e){return this.safeString({"-1":"cancelled",0:"open",1:"open",2:"done"},e,e)}parseOrder(e,t=void 0){const i=this.safeString2(e,"id","entry_id"),s=this.safeString(e,"time"),r=this.safeString(e,"t_rate");let a=this.safeString(e,"type");"0"===a?a="buy":"1"===a&&(a="sell");const o=this.safeString(e,"data");let n=this.safeString(e,"status");return n="Successfully cancelled the order"===o?"cancelled":this.parseStatus(n),this.safeOrder({info:e,id:i,clientOrderId:void 0,timestamp:this.parse8601(s),datetime:s,lastTradeTimestamp:void 0,symbol:this.safeString(t,"symbol"),timeInForce:void 0,postOnly:void 0,side:a,price:this.safeString(e,"rate"),triggerPrice:r,amount:this.safeString(e,"btc"),cost:void 0,average:void 0,filled:void 0,remaining:void 0,status:n,fee:{cost:void 0,currency:void 0,rate:void 0},trades:void 0},t)}async createOrder(e,t,i,s,r=void 0,a={}){await this.loadMarkets();const o=this.market(e),n=this.safeStringN(a,["triggerPrice","stopPrice","t_rate"]),d=this.safeString(a,"target_rate"),h=this.safeString(a,"trail_rate");a=this.omit(a,["triggerPrice","stopPrice","trail_rate","target_rate","t_rate"]);const c={side:i.toUpperCase(),symbol:o.uppercaseId,quantity:this.amountToPrecision(e,s)};let l="v2PostOrders";"limit"===t?c.rate=this.priceToPrecision(e,r):(l="v1PostPlaceMarketOrderQntySymbol",c.market=o.quoteId),void 0!==n&&(c.t_rate=this.priceToPrecision(e,n)),void 0!==d&&(c.target_rate=this.priceToPrecision(e,d)),void 0!==h&&(c.trail_rate=this.priceToPrecision(e,h));const u=await this[l](this.extend(c,a));return this.parseOrder(u,o)}async cancelOrder(e,t=void 0,i={}){if(void 0===t)throw new r.ArgumentsRequired(this.id+" cancelOrder() requires a symbol argument");await this.loadMarkets();const s=this.market(t),a=this.safeBool2(i,"trigger","stop");i=this.omit(i,["trigger","stop"]);const o={entry_id:e,symbol:s.uppercaseId};let n;const d=a?"StopLossOrder":"Order";let h="USDT"===s.quoteId?"usdtcancel":"cancel";return h+=d,o.side=h,n=await this.v2PostCancel(this.extend(o,i)),this.parseOrder(n,s)}async fetchOrder(e,t=void 0,i={}){if(void 0===t)throw new r.ArgumentsRequired(this.id+" fetchOrder() requires a symbol argument");await this.loadMarkets();const s=this.market(t),a={symbol:s.id,entry_id:e};if(this.safeBool2(i,"trigger","stop"))throw new r.BadRequest(this.id+" fetchOrder cannot fetch stop orders");const o=await this.v1PostOrderStatusSymbol(this.extend(a,i)),n=this.safeList(o,"data",[]),d=this.safeDict(n,0);return this.parseOrder(d,s)}async fetchOpenOrders(e=void 0,t=void 0,i=void 0,s={}){if(void 0===e)throw new r.ArgumentsRequired(this.id+" fetchOpenOrders() requires a symbol argument");await this.loadMarkets();const a=this.market(e),o=this.safeBool2(s,"trigger","stop");s=this.omit(s,["trigger","stop"]);const n="USDT"===a.quoteId?"usdtListOpen":"listOpen",d={symbol:a.uppercaseId,page:0,side:o?n+"StopOrders":n+"Orders"},h=await this.v2PostGetordersnew(this.extend(d,s)),c=this.safeList(h,"data",[]);return this.parseOrders(c,a,t,i)}parseTrade(e,t=void 0){t=this.safeMarket(void 0,t);const i=this.safeString2(e,"id","tradeId");let s=this.parse8601(this.safeString(e,"date"));s=this.safeInteger(e,"timestamp",s);const r=this.safeString2(e,"rate","price");let o=this.safeString(e,"amount"),n=this.safeStringLower(e,"type");void 0!==n&&(n.indexOf("buy")>=0?n="buy":n.indexOf("sell")>=0&&(n="sell"));const d=this.safeString(e,"factor");let h;void 0!==d?o=a.Y.stringDiv(o,d):(o=this.safeString(e,"base_volume"),h=this.safeString(e,"quote_volume"));const c=t.symbol;let l;const u=this.safeString(e,"fee");if(void 0!==u){l={cost:u,currency:t.quote}}return this.safeTrade({info:e,timestamp:s,datetime:this.iso8601(s),symbol:c,id:i,order:i,type:void 0,side:n,takerOrMaker:void 0,price:r,amount:o,cost:h,fee:l},t)}async fetchMyTrades(e=void 0,t=void 0,i=void 0,s={}){if(void 0===e)throw new r.ArgumentsRequired(this.id+" fetchMyTrades() requires a symbol argument");await this.loadMarkets();const a=this.market(e),o={symbol:a.id,page:0};void 0!==t&&(o.since=this.iso8601(t));const n=await this.v1PostListExecutedOrdersSymbol(this.extend(o,s)),d=this.safeList(n,"data",[]);return this.parseTrades(d,a,t,i)}async fetchTrades(e,t=void 0,i=void 0,s={}){if(void 0===e)throw new r.ArgumentsRequired(this.id+" fetchTrades() requires a symbol argument");await this.loadMarkets();const a=this.market(e),o={coin:a.baseId,market:a.quoteId},n=await this.wwwGetExchangeDataTradedetails(this.extend(o,s));return this.parseTrades(n,a,t,i)}async fetchDeposits(e=void 0,t=void 0,i=void 0,s={}){if(void 0===e)throw new r.ArgumentsRequired(this.id+" fetchDeposits() requires a currency code argument");await this.loadMarkets();const a=this.currency(e),o={symbol:a.id,page:0},n=await this.v1PostDepositHistorySymbol(this.extend(o,s)),d=this.safeList(n,"data",[]);return this.parseTransactions(d,a,t,i)}async fetchWithdrawals(e=void 0,t=void 0,i=void 0,s={}){if(void 0===e)throw new r.ArgumentsRequired(this.id+" fetchWithdrawals() requires a currency code argument");await this.loadMarkets();const a=this.currency(e),o={symbol:a.id,page:0},n=await this.v1PostWithdrawHistorySymbol(this.extend(o,s)),d=this.safeList(n,"data",[]);return this.parseTransactions(d,a,t,i)}parseTransactionStatusByType(e,t=void 0){const i=this.safeDict({deposit:{0:"pending",1:"ok"},withdrawal:{0:"pending",1:"canceled",2:"pending",3:"failed",4:"pending",5:"failed",6:"ok"}},t,{});return this.safeString(i,e,e)}parseTransaction(e,t=void 0){const i=this.safeString(e,"unit"),s=this.safeCurrencyCode(i,t),r=this.parse8601(this.safeString2(e,"date","timestamp"));let a=this.safeString(e,"type");const o=this.safeString(e,"expTime","");let n;void 0!==a&&(a.indexOf("deposit")>=0?(a="deposit",n="ok"):(a.indexOf("withdraw")>=0||o.indexOf("withdraw")>=0)&&(a="withdrawal"));const d=this.safeNumber(e,"amount"),h=this.safeNumber(e,"fee");let c;return void 0!==h&&(c={currency:s,cost:h}),{info:e,id:void 0,txid:void 0,timestamp:r,datetime:this.iso8601(r),network:void 0,address:void 0,addressTo:void 0,addressFrom:void 0,tag:void 0,tagTo:void 0,tagFrom:void 0,type:a,amount:d,currency:s,status:n,updated:void 0,comment:void 0,internal:void 0,fee:c}}async fetchDepositAddress(e,t={}){await this.loadMarkets();const i={symbol:this.currency(e).id},s=await this.v1PostGetCoinAddressSymbol(this.extend(i,t)),r=this.safeDict(s,"data",{}),a=this.safeString(r,"token"),o=this.safeString(r,"tag");return this.checkAddress(a),{info:s,currency:e,network:void 0,address:a,tag:o}}nonce(){return this.milliseconds()}sign(e,t="www",i="GET",s={},a=void 0,o=void 0){if(!(t in this.urls.api))throw new r.ExchangeError(this.id+" does not have a testnet/sandbox URL for "+t+" endpoints");"www"!==t&&(this.checkRequiredCredentials(),a={"X-BITBNS-APIKEY":this.apiKey});let d=this.implodeHostname(this.urls.api[t])+"/"+this.implodeParams(e,s);const h=this.omit(s,this.extractParams(e)),c=this.nonce().toString();if("GET"===i)Object.keys(h).length&&(d+="?"+this.urlencode(h));else if("POST"===i){const e={timeStamp_nonce:c,body:o=Object.keys(h).length?this.json(h):"{}"},t=this.stringToBase64(this.json(e)),i=this.hmac(this.encode(t),this.encode(this.secret),n.Zf);a["X-BITBNS-PAYLOAD"]=t,a["X-BITBNS-SIGNATURE"]=i,a["Content-Type"]="application/x-www-form-urlencoded"}return{url:d,method:i,body:o,headers:a}}handleErrors(e,t,i,s,a,o,n,d,h){if(void 0===n)return;const c=this.safeString(n,"code"),l=this.safeString(n,"msg");if(void 0!==c&&"200"!==c&&"204"!==c||void 0!==l){const e=this.id+" "+o;throw this.throwExactlyMatchedException(this.exceptions.exact,c,e),this.throwExactlyMatchedException(this.exceptions.exact,l,e),this.throwBroadlyMatchedException(this.exceptions.broad,l,e),new r.ExchangeError(e)}}}},8657:(e,t,i)=>{i.d(t,{A:()=>d});var s=i(2079),r=i(5147),a=i(9332),o=i(1579),n=i(7481);class d extends a.A{describe(){return this.deepExtend(super.describe(),{id:"bitfinex",name:"Bitfinex",countries:["VG"],version:"v2",certified:!1,pro:!0,has:{CORS:void 0,spot:!0,margin:!0,swap:!0,future:!1,option:!1,addMargin:!1,borrowCrossMargin:!1,borrowIsolatedMargin:!1,cancelAllOrders:!0,cancelOrder:!0,cancelOrders:!0,createDepositAddress:!0,createLimitOrder:!0,createMarketOrder:!0,createOrder:!0,createPostOnlyOrder:!0,createReduceOnlyOrder:!0,createStopLimitOrder:!0,createStopMarketOrder:!0,createStopOrder:!0,createTrailingAmountOrder:!0,createTrailingPercentOrder:!1,createTriggerOrder:!0,editOrder:!0,fetchBalance:!0,fetchBorrowInterest:!1,fetchBorrowRate:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchBorrowRates:!1,fetchBorrowRatesPerSymbol:!1,fetchClosedOrder:!0,fetchClosedOrders:!0,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!0,fetchDepositAddress:!0,fetchDepositAddresses:!1,fetchDepositAddressesByNetwork:!1,fetchDepositsWithdrawals:!0,fetchFundingHistory:!1,fetchFundingRate:"emulated",fetchFundingRateHistory:!0,fetchFundingRates:!0,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchLedger:!0,fetchLeverage:!1,fetchLeverageTiers:!1,fetchLiquidations:!0,fetchMarginMode:!1,fetchMarketLeverageTiers:!1,fetchMarkOHLCV:!1,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenInterest:!0,fetchOpenInterestHistory:!0,fetchOpenInterests:!0,fetchOpenOrder:!0,fetchOpenOrders:!0,fetchOrder:!0,fetchOrderBook:!0,fetchOrderBooks:!1,fetchOrderTrades:!0,fetchPosition:!1,fetchPositionMode:!1,fetchPositions:!0,fetchPremiumIndexOHLCV:!1,fetchStatus:!0,fetchTickers:!0,fetchTime:!1,fetchTradingFee:!1,fetchTradingFees:!0,fetchTransactionFees:void 0,fetchTransactions:"emulated",reduceMargin:!1,repayCrossMargin:!1,repayIsolatedMargin:!1,setLeverage:!1,setMargin:!0,setMarginMode:!1,setPositionMode:!1,signIn:!1,transfer:!0,withdraw:!0},timeframes:{"1m":"1m","5m":"5m","15m":"15m","30m":"30m","1h":"1h","3h":"3h","4h":"4h","6h":"6h","12h":"12h","1d":"1D","1w":"7D","2w":"14D","1M":"1M"},rateLimit:250,urls:{logo:"https://github.com/user-attachments/assets/4a8e947f-ab46-481a-a8ae-8b20e9b03178",api:{v1:"https://api.bitfinex.com",public:"https://api-pub.bitfinex.com",private:"https://api.bitfinex.com"},www:"https://www.bitfinex.com",doc:["https://docs.bitfinex.com/v2/docs/","https://github.com/bitfinexcom/bitfinex-api-node"],fees:"https://www.bitfinex.com/fees"},api:{public:{get:{"conf/{config}":2.7,"conf/pub:{action}:{object}":2.7,"conf/pub:{action}:{object}:{detail}":2.7,"conf/pub:map:{object}":2.7,"conf/pub:map:{object}:{detail}":2.7,"conf/pub:map:currency:{detail}":2.7,"conf/pub:map:currency:sym":2.7,"conf/pub:map:currency:label":2.7,"conf/pub:map:currency:unit":2.7,"conf/pub:map:currency:undl":2.7,"conf/pub:map:currency:pool":2.7,"conf/pub:map:currency:explorer":2.7,"conf/pub:map:currency:tx:fee":2.7,"conf/pub:map:tx:method":2.7,"conf/pub:list:{object}":2.7,"conf/pub:list:{object}:{detail}":2.7,"conf/pub:list:currency":2.7,"conf/pub:list:pair:exchange":2.7,"conf/pub:list:pair:margin":2.7,"conf/pub:list:pair:futures":2.7,"conf/pub:list:competitions":2.7,"conf/pub:info:{object}":2.7,"conf/pub:info:{object}:{detail}":2.7,"conf/pub:info:pair":2.7,"conf/pub:info:pair:futures":2.7,"conf/pub:info:tx:status":2.7,"conf/pub:fees":2.7,"platform/status":8,tickers:2.7,"ticker/{symbol}":2.7,"tickers/hist":2.7,"trades/{symbol}/hist":2.7,"book/{symbol}/{precision}":1,"book/{symbol}/P0":1,"book/{symbol}/P1":1,"book/{symbol}/P2":1,"book/{symbol}/P3":1,"book/{symbol}/R0":1,"stats1/{key}:{size}:{symbol}:{side}/{section}":2.7,"stats1/{key}:{size}:{symbol}:{side}/last":2.7,"stats1/{key}:{size}:{symbol}:{side}/hist":2.7,"stats1/{key}:{size}:{symbol}/{section}":2.7,"stats1/{key}:{size}:{symbol}/last":2.7,"stats1/{key}:{size}:{symbol}/hist":2.7,"stats1/{key}:{size}:{symbol}:long/last":2.7,"stats1/{key}:{size}:{symbol}:long/hist":2.7,"stats1/{key}:{size}:{symbol}:short/last":2.7,"stats1/{key}:{size}:{symbol}:short/hist":2.7,"candles/trade:{timeframe}:{symbol}:{period}/{section}":2.7,"candles/trade:{timeframe}:{symbol}/{section}":2.7,"candles/trade:{timeframe}:{symbol}/last":2.7,"candles/trade:{timeframe}:{symbol}/hist":2.7,"status/{type}":2.7,"status/deriv":2.7,"status/deriv/{symbol}/hist":2.7,"liquidations/hist":80,"rankings/{key}:{timeframe}:{symbol}/{section}":2.7,"rankings/{key}:{timeframe}:{symbol}/hist":2.7,"pulse/hist":2.7,"pulse/profile/{nickname}":2.7,"funding/stats/{symbol}/hist":10,"ext/vasps":1},post:{"calc/trade/avg":2.7,"calc/fx":2.7}},private:{post:{"auth/r/wallets":2.7,"auth/r/wallets/hist":2.7,"auth/r/orders":2.7,"auth/r/orders/{symbol}":2.7,"auth/w/order/submit":2.7,"auth/w/order/update":2.7,"auth/w/order/cancel":2.7,"auth/w/order/multi":2.7,"auth/w/order/cancel/multi":2.7,"auth/r/orders/{symbol}/hist":2.7,"auth/r/orders/hist":2.7,"auth/r/order/{symbol}:{id}/trades":2.7,"auth/r/trades/{symbol}/hist":2.7,"auth/r/trades/hist":2.7,"auth/r/ledgers/{currency}/hist":2.7,"auth/r/ledgers/hist":2.7,"auth/r/info/margin/{key}":2.7,"auth/r/info/margin/base":2.7,"auth/r/info/margin/sym_all":2.7,"auth/r/positions":2.7,"auth/w/position/claim":2.7,"auth/w/position/increase:":2.7,"auth/r/position/increase/info":2.7,"auth/r/positions/hist":2.7,"auth/r/positions/audit":2.7,"auth/r/positions/snap":2.7,"auth/w/deriv/collateral/set":2.7,"auth/w/deriv/collateral/limits":2.7,"auth/r/funding/offers":2.7,"auth/r/funding/offers/{symbol}":2.7,"auth/w/funding/offer/submit":2.7,"auth/w/funding/offer/cancel":2.7,"auth/w/funding/offer/cancel/all":2.7,"auth/w/funding/close":2.7,"auth/w/funding/auto":2.7,"auth/w/funding/keep":2.7,"auth/r/funding/offers/{symbol}/hist":2.7,"auth/r/funding/offers/hist":2.7,"auth/r/funding/loans":2.7,"auth/r/funding/loans/hist":2.7,"auth/r/funding/loans/{symbol}":2.7,"auth/r/funding/loans/{symbol}/hist":2.7,"auth/r/funding/credits":2.7,"auth/r/funding/credits/hist":2.7,"auth/r/funding/credits/{symbol}":2.7,"auth/r/funding/credits/{symbol}/hist":2.7,"auth/r/funding/trades/{symbol}/hist":2.7,"auth/r/funding/trades/hist":2.7,"auth/r/info/funding/{key}":2.7,"auth/r/info/user":2.7,"auth/r/summary":2.7,"auth/r/logins/hist":2.7,"auth/r/permissions":2.7,"auth/w/token":2.7,"auth/r/audit/hist":2.7,"auth/w/transfer":2.7,"auth/w/deposit/address":24,"auth/w/deposit/invoice":24,"auth/w/withdraw":24,"auth/r/movements/{currency}/hist":2.7,"auth/r/movements/hist":2.7,"auth/r/alerts":5.34,"auth/w/alert/set":2.7,"auth/w/alert/price:{symbol}:{price}/del":2.7,"auth/w/alert/{type}:{symbol}:{price}/del":2.7,"auth/calc/order/avail":2.7,"auth/w/settings/set":2.7,"auth/r/settings":2.7,"auth/w/settings/del":2.7,"auth/r/pulse/hist":2.7,"auth/w/pulse/add":16,"auth/w/pulse/del":2.7}}},fees:{trading:{feeSide:"get",percentage:!0,tierBased:!0,maker:this.parseNumber("0.001"),taker:this.parseNumber("0.002"),tiers:{taker:[[this.parseNumber("0"),this.parseNumber("0.002")],[this.parseNumber("500000"),this.parseNumber("0.002")],[this.parseNumber("1000000"),this.parseNumber("0.002")],[this.parseNumber("2500000"),this.parseNumber("0.002")],[this.parseNumber("5000000"),this.parseNumber("0.002")],[this.parseNumber("7500000"),this.parseNumber("0.002")],[this.parseNumber("10000000"),this.parseNumber("0.0018")],[this.parseNumber("15000000"),this.parseNumber("0.0016")],[this.parseNumber("20000000"),this.parseNumber("0.0014")],[this.parseNumber("25000000"),this.parseNumber("0.0012")],[this.parseNumber("30000000"),this.parseNumber("0.001")]],maker:[[this.parseNumber("0"),this.parseNumber("0.001")],[this.parseNumber("500000"),this.parseNumber("0.0008")],[this.parseNumber("1000000"),this.parseNumber("0.0006")],[this.parseNumber("2500000"),this.parseNumber("0.0004")],[this.parseNumber("5000000"),this.parseNumber("0.0002")],[this.parseNumber("7500000"),this.parseNumber("0")],[this.parseNumber("10000000"),this.parseNumber("0")],[this.parseNumber("15000000"),this.parseNumber("0")],[this.parseNumber("20000000"),this.parseNumber("0")],[this.parseNumber("25000000"),this.parseNumber("0")],[this.parseNumber("30000000"),this.parseNumber("0")]]}},funding:{withdraw:{}}},precisionMode:o.v,options:{precision:"R0",exchangeTypes:{MARKET:"market","EXCHANGE MARKET":"market",LIMIT:"limit","EXCHANGE LIMIT":"limit","EXCHANGE STOP":"market","EXCHANGE FOK":"limit","EXCHANGE STOP LIMIT":"limit","EXCHANGE IOC":"limit"},orderTypes:{market:"EXCHANGE MARKET",limit:"EXCHANGE LIMIT"},fiat:{USD:"USD",EUR:"EUR",JPY:"JPY",GBP:"GBP",CHN:"CHN"},v2AccountsByType:{spot:"exchange",exchange:"exchange",funding:"funding",margin:"margin",derivatives:"margin",future:"margin",swap:"margin"},withdraw:{includeFee:!1},networks:{BTC:"BITCOIN",LTC:"LITECOIN",ERC20:"ETHEREUM",OMNI:"TETHERUSO",LIQUID:"TETHERUSL",TRC20:"TETHERUSX",EOS:"TETHERUSS",AVAX:"TETHERUSDTAVAX",SOL:"TETHERUSDTSOL",ALGO:"TETHERUSDTALG",BCH:"TETHERUSDTBCH",KSM:"TETHERUSDTKSM",DVF:"TETHERUSDTDVF",OMG:"TETHERUSDTOMG"},networksById:{TETHERUSE:"ERC20"}},features:{default:{sandbox:!1,createOrder:{marginMode:!0,triggerPrice:!0,triggerPriceType:void 0,triggerDirection:!1,stopLossPrice:!0,takeProfitPrice:!0,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!0,FOK:!0,PO:!0,GTD:!1},hedged:!1,trailing:!0,leverage:!0,marketBuyRequiresPrice:!1,marketBuyByCost:!0,selfTradePrevention:!1,iceberg:!1},createOrders:{max:75},fetchMyTrades:{marginMode:!1,limit:2500,daysBack:void 0,untilDays:1e5,symbolRequired:!1},fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!1},fetchOpenOrders:{marginMode:!1,limit:void 0,trigger:!1,trailing:!1,symbolRequired:!1},fetchOrders:void 0,fetchClosedOrders:{marginMode:!1,limit:void 0,daysBack:void 0,daysBackCanceled:void 0,untilDays:1e5,trigger:!1,trailing:!1,symbolRequired:!1},fetchOHLCV:{limit:1e4}},spot:{extends:"default"},swap:{linear:{extends:"default"},inverse:void 0},future:{linear:void 0,inverse:void 0}},exceptions:{exact:{11010:s.RateLimitExceeded,10001:s.PermissionDenied,10020:s.BadRequest,10100:s.AuthenticationError,10114:s.InvalidNonce,20060:s.OnMaintenance,temporarily_unavailable:s.ExchangeNotAvailable},broad:{"available balance is only":s.InsufficientFunds,"not enough exchange balance":s.InsufficientFunds,"Order not found":s.OrderNotFound,"symbol: invalid":s.BadSymbol}},commonCurrencies:{UST:"USDT",EUTF0:"EURT",USTF0:"USDT",ALG:"ALGO",AMP:"AMPL",ATO:"ATOM",BCHABC:"XEC",BCHN:"BCH",DAT:"DATA",DOG:"MDOGE",DSH:"DASH",EDO:"PNT",EUS:"EURS",EUT:"EURT",HTX:"HT",IDX:"ID",IOT:"IOTA",IQX:"IQ",LUNA:"LUNC",LUNA2:"LUNA",MNA:"MANA",ORS:"ORS Group",PAS:"PASS",QSH:"QASH",QTM:"QTUM",RBT:"RBTC",SNG:"SNGLS",STJ:"STORJ",TERRAUST:"USTC",TSD:"TUSD",YGG:"YEED",YYW:"YOYOW",UDC:"USDC",VSY:"VSYS",WAX:"WAXP",XCH:"XCHF",ZBT:"ZB"}})}isFiat(e){return e in this.options.fiat}getCurrencyId(e){return"f"+e}getCurrencyName(e){if(e in this.options.currencyNames)return this.options.currencyNames[e];throw new s.NotSupported(this.id+" "+e+" not supported for withdrawal")}amountToPrecision(e,t){return e=this.safeSymbol(e),this.decimalToPrecision(t,o.R3,this.markets[e].precision.amount,o.fv)}priceToPrecision(e,t){return e=this.safeSymbol(e),t=this.decimalToPrecision(t,o.D_,this.markets[e].precision.price,this.precisionMode),this.decimalToPrecision(t,o.R3,8,o.fv)}async fetchStatus(e={}){const t=await this.publicGetPlatformStatus(e),i=this.safeString(t,0);return{status:this.safeString({0:"maintenance",1:"ok"},i,i),updated:void 0,eta:void 0,url:void 0,info:t}}async fetchMarkets(e={}){const t=this.publicGetConfPubInfoPair(e),i=this.publicGetConfPubInfoPairFutures(e),s=this.publicGetConfPubListPairMargin(e);let[r,a,o]=await Promise.all([t,i,s]);r=this.safeList(r,0,[]),a=this.safeList(a,0,[]);const n=this.arrayConcat(r,a);o=this.safeValue(o,0,[]);const d=[];for(let e=0;e=0&&(r=!1);const a=!r;let h,c;if(i.indexOf(":")>=0){const e=i.split(":");h=e[0],c=e[1]}else h=i.slice(0,3),c=i.slice(3,6);let l=this.safeCurrencyCode(h),u=this.safeCurrencyCode(c);const f=l.split("F0"),p=u.split("F0");l=this.safeString(f,0),u=this.safeString(p,0);let m,g,v=l+"/"+u;h=this.getCurrencyId(h),c=this.getCurrencyId(c),a&&(m=u,g=u,v=v+":"+m);const y=this.safeString(s,3),w=this.safeString(s,4);let b=!1;r&&this.inArray(i,o)&&(b=!0),d.push({id:"t"+i,symbol:v,base:l,quote:u,settle:m,baseId:h,quoteId:c,settleId:g,type:r?"spot":"swap",spot:r,margin:b,swap:a,future:!1,option:!1,active:!0,contract:a,linear:!!a||void 0,inverse:!a&&void 0,contractSize:a?this.parseNumber("1"):void 0,expiry:void 0,expiryDatetime:void 0,strike:void 0,optionType:void 0,precision:{amount:parseInt("8"),price:parseInt("5")},limits:{leverage:{min:void 0,max:void 0},amount:{min:this.parseNumber(y),max:this.parseNumber(w)},price:{min:this.parseNumber("1e-8"),max:void 0},cost:{min:void 0,max:void 0}},created:void 0,info:s})}return d}async fetchCurrencies(e={}){const t={config:["pub:list:currency","pub:map:currency:sym","pub:map:currency:label","pub:map:currency:unit","pub:map:currency:undl","pub:map:currency:pool","pub:map:currency:explorer","pub:map:currency:tx:fee","pub:map:tx:method","pub:info:tx:status"].join(",")},i=await this.publicGetConfConfig(this.extend(t,e)),s={sym:this.indexBy(this.safeList(i,1,[]),0),label:this.indexBy(this.safeList(i,2,[]),0),unit:this.indexBy(this.safeList(i,3,[]),0),undl:this.indexBy(this.safeList(i,4,[]),0),pool:this.indexBy(this.safeList(i,5,[]),0),explorer:this.indexBy(this.safeList(i,6,[]),0),fees:this.indexBy(this.safeList(i,7,[]),0),networks:this.safeList(i,8,[]),statuses:this.indexBy(this.safeList(i,9,[]),0)},r={};for(let e=0;e5,a=this.safeString(i,0),o=s?4:2;let n,d=this.safeString(i,o);const h=s?5:3,c=this.safeString(i,h);let l,u,f,p;"-"===d[0]?(n="sell",d=r.Y.stringAbs(d)):n="buy";let m=this.safeSymbol(void 0,t);const g=s?2:1,v=this.safeInteger(i,g);if(s){const e=i[1];m=this.safeSymbol(e),l=this.safeString(i,3);u=1===this.safeInteger(i,8)?"maker":"taker";let t=this.safeString(i,9);t=r.Y.stringNeg(t);const s=this.safeString(i,10);p={cost:t,currency:this.safeCurrencyCode(s)};const a=i[6];f=this.safeString(this.options.exchangeTypes,a)}return this.safeTrade({id:a,timestamp:v,datetime:this.iso8601(v),symbol:m,order:l,side:n,type:f,takerOrMaker:u,price:c,amount:d,cost:void 0,fee:p,info:i},t)}async fetchTrades(e,t=void 0,i=void 0,s={}){await this.loadMarkets();let r=!1;if([r,s]=this.handleOptionAndParams(s,"fetchTrades","paginate"),r)return await this.fetchPaginatedCallDynamic("fetchTrades",e,t,i,s,1e4);const a=this.market(e);let o="-1",n={symbol:a.id};void 0!==t&&(n.start=t,o="1"),void 0!==i&&(n.limit=Math.min(i,1e4)),n.sort=o,[n,s]=this.handleUntilOption("end",n,s);const d=await this.publicGetTradesSymbolHist(this.extend(n,s)),h=this.sortBy(d,1),c=[];for(let e=0;e=0||e.indexOf("charged")>=0?"fee":e.indexOf("rebate")>=0?"rebate":e.indexOf("deposit")>=0||e.indexOf("withdrawal")>=0?"transaction":e.indexOf("transfer")>=0?"transfer":e.indexOf("payment")>=0?"payout":e.indexOf("exchange")>=0||e.indexOf("position")>=0?"trade":e}parseLedgerEntry(e,t=void 0){const i=this.safeList(e,"result",[]);let s;const r=this.safeString(i,0),a=this.safeString(i,1),o=this.safeCurrencyCode(a,t);t=this.safeCurrency(a,t);const n=this.safeInteger(i,3),d=this.safeNumber(i,5),h=this.safeNumber(i,6),c=this.safeString(i,8);if(void 0!==c){const e=c.split(" @ "),t=this.safeStringLower(e,0);s=this.parseLedgerEntryType(t)}return this.safeLedgerEntry({info:e,id:r,direction:void 0,account:void 0,referenceId:r,referenceAccount:void 0,type:s,currency:o,amount:d,timestamp:n,datetime:this.iso8601(n),before:void 0,after:h,status:void 0,fee:void 0},t)}async fetchLedger(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();let r,a=!1;if([a,s]=this.handleOptionAndParams(s,"fetchLedger","paginate"),a)return await this.fetchPaginatedCallDynamic("fetchLedger",e,t,i,s,2500);let o,n={};void 0!==t&&(n.start=t),void 0!==i&&(n.limit=i),[n,s]=this.handleUntilOption("end",n,s),void 0!==e?(r=this.currency(e),n.currency=r.uppercaseId,o=await this.privatePostAuthRLedgersCurrencyHist(this.extend(n,s))):o=await this.privatePostAuthRLedgersHist(this.extend(n,s));const d=[];for(let e=0;e{i.d(t,{A:()=>d});var s=i(1578),r=i(2079),a=i(1579),o=i(4852),n=i(5147);class d extends s.A{describe(){return this.deepExtend(super.describe(),{id:"bitflyer",name:"bitFlyer",countries:["JP"],version:"v1",rateLimit:1e3,hostname:"bitflyer.com",has:{CORS:void 0,spot:!0,margin:!1,swap:void 0,future:void 0,option:!1,cancelAllOrders:void 0,cancelOrder:!0,createOrder:!0,fetchBalance:!0,fetchClosedOrders:"emulated",fetchDeposits:!0,fetchFundingRate:!0,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchMarginMode:!1,fetchMarkets:!0,fetchMyTrades:!0,fetchOpenOrders:"emulated",fetchOrder:"emulated",fetchOrderBook:!0,fetchOrders:!0,fetchPositionMode:!1,fetchPositions:!0,fetchTicker:!0,fetchTrades:!0,fetchTradingFee:!0,fetchTradingFees:!1,fetchTransfer:!1,fetchTransfers:!1,fetchWithdrawals:!0,transfer:!1,withdraw:!0},urls:{logo:"https://github.com/user-attachments/assets/d0217747-e54d-4533-8416-0d553dca74bb",api:{rest:"https://api.{hostname}"},www:"https://bitflyer.com",doc:"https://lightning.bitflyer.com/docs?lang=en"},api:{public:{get:["getmarkets/usa","getmarkets/eu","getmarkets","getboard","getticker","getexecutions","gethealth","getboardstate","getchats","getfundingrate"]},private:{get:["getpermissions","getbalance","getbalancehistory","getcollateral","getcollateralhistory","getcollateralaccounts","getaddresses","getcoinins","getcoinouts","getbankaccounts","getdeposits","getwithdrawals","getchildorders","getparentorders","getparentorder","getexecutions","getpositions","gettradingcommission"],post:["sendcoin","withdraw","sendchildorder","cancelchildorder","sendparentorder","cancelparentorder","cancelallchildorders"]}},fees:{trading:{maker:this.parseNumber("0.002"),taker:this.parseNumber("0.002")}},precisionMode:a.kb,features:{spot:{sandbox:!1,createOrder:{marginMode:!1,triggerPrice:!1,triggerPriceType:void 0,triggerDirection:!1,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!0,FOK:!0,PO:!0,GTD:!0},hedged:!1,trailing:!1,leverage:!1,marketBuyRequiresPrice:!1,marketBuyByCost:!1,selfTradePrevention:!1,iceberg:!1},createOrders:void 0,fetchMyTrades:{marginMode:!1,limit:100,daysBack:void 0,untilDays:void 0,symbolRequired:!0},fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!0},fetchOpenOrders:{marginMode:!1,limit:100,trigger:!1,trailing:!1,symbolRequired:!0},fetchOrders:{marginMode:!1,limit:100,daysBack:void 0,untilDays:void 0,trigger:!1,trailing:!1,symbolRequired:!0},fetchClosedOrders:{marginMode:!1,limit:100,daysBack:void 0,daysBackCanceled:void 0,untilDays:void 0,trigger:!1,trailing:!1,symbolRequired:!0},fetchOHLCV:void 0},swap:{linear:void 0,inverse:void 0},future:{linear:void 0,inverse:void 0}},exceptions:{exact:{"-2":r.OnMaintenance}}})}parseExpiryDate(e){const t=e.slice(0,2),i=e.slice(2,5),s=e.slice(5,9),r=this.safeString({JAN:"01",FEB:"02",MAR:"03",APR:"04",MAY:"05",JUN:"06",JUL:"07",AUG:"08",SEP:"09",OCT:"10",NOV:"11",DEC:"12"},i);return this.parse8601(s+"-"+r+"-"+t+"T00:00:00Z")}safeMarket(e=void 0,t=void 0,i=void 0,s=void 0){return super.safeMarket(e,t,i,"spot")}async fetchMarkets(e={}){const t=await this.publicGetGetmarkets(e),i=await this.publicGetGetmarketsUsa(e),s=await this.publicGetGetmarketsEu(e);let r=this.arrayConcat(t,i);r=this.arrayConcat(r,s);const a=[];for(let e=0;e{i.d(t,{A:()=>d});var s=i(9152),r=i(2079),a=i(5147),o=i(1579),n=i(4852);class d extends s.A{describe(){return this.deepExtend(super.describe(),{id:"bitget",name:"Bitget",countries:["SG"],version:"v2",rateLimit:50,certified:!0,pro:!0,has:{CORS:void 0,spot:!0,margin:!0,swap:!0,future:!0,option:!1,addMargin:!0,borrowCrossMargin:!0,borrowIsolatedMargin:!0,cancelAllOrders:!0,cancelOrder:!0,cancelOrders:!0,closeAllPositions:!0,closePosition:!0,createConvertTrade:!0,createDepositAddress:!1,createMarketBuyOrderWithCost:!0,createMarketOrderWithCost:!1,createMarketSellOrderWithCost:!1,createOrder:!0,createOrders:!0,createOrderWithTakeProfitAndStopLoss:!0,createPostOnlyOrder:!0,createReduceOnlyOrder:!1,createStopLimitOrder:!0,createStopLossOrder:!0,createStopMarketOrder:!0,createStopOrder:!0,createTakeProfitOrder:!0,createTrailingAmountOrder:!1,createTrailingPercentOrder:!0,createTriggerOrder:!0,editOrder:!0,fetchAccounts:!1,fetchBalance:!0,fetchBorrowInterest:!0,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchCanceledAndClosedOrders:!0,fetchCanceledOrders:!0,fetchClosedOrders:!0,fetchConvertCurrencies:!0,fetchConvertQuote:!0,fetchConvertTrade:!1,fetchConvertTradeHistory:!0,fetchCrossBorrowRate:!0,fetchCrossBorrowRates:!1,fetchCurrencies:!0,fetchDeposit:!1,fetchDepositAddress:!0,fetchDepositAddresses:!1,fetchDepositAddressesByNetwork:!1,fetchDeposits:!0,fetchDepositsWithdrawals:!1,fetchDepositWithdrawFee:"emulated",fetchDepositWithdrawFees:!0,fetchFundingHistory:!0,fetchFundingInterval:!0,fetchFundingIntervals:!1,fetchFundingRate:!0,fetchFundingRateHistory:!0,fetchFundingRates:!0,fetchIndexOHLCV:!0,fetchIsolatedBorrowRate:!0,fetchIsolatedBorrowRates:!1,fetchLedger:!0,fetchLeverage:!0,fetchLeverageTiers:!1,fetchLiquidations:!1,fetchLongShortRatio:!1,fetchLongShortRatioHistory:!0,fetchMarginAdjustmentHistory:!1,fetchMarginMode:!0,fetchMarketLeverageTiers:!0,fetchMarkets:!0,fetchMarkOHLCV:!0,fetchMarkPrice:!0,fetchMyLiquidations:!0,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenInterest:!0,fetchOpenInterestHistory:!1,fetchOpenOrders:!0,fetchOrder:!0,fetchOrderBook:!0,fetchOrderBooks:!1,fetchOrders:!1,fetchOrderTrades:!1,fetchPosition:!0,fetchPositionHistory:"emulated",fetchPositionMode:!1,fetchPositions:!0,fetchPositionsHistory:!0,fetchPositionsRisk:!1,fetchPremiumIndexOHLCV:!1,fetchStatus:!1,fetchTicker:!0,fetchTickers:!0,fetchTime:!0,fetchTrades:!0,fetchTradingFee:!0,fetchTradingFees:!0,fetchTransactions:!1,fetchTransfer:!1,fetchTransfers:!0,fetchWithdrawAddresses:!1,fetchWithdrawal:!1,fetchWithdrawals:!0,reduceMargin:!0,repayCrossMargin:!0,repayIsolatedMargin:!0,setLeverage:!0,setMargin:!1,setMarginMode:!0,setPositionMode:!0,signIn:!1,transfer:!0,withdraw:!0},timeframes:{"1m":"1m","3m":"3m","5m":"5m","15m":"15m","30m":"30m","1h":"1h","2h":"2h","4h":"4h","6h":"6h","12h":"12h","1d":"1d","3d":"3d","1w":"1w","1M":"1m"},hostname:"bitget.com",urls:{logo:"https://github.com/user-attachments/assets/fbaa10cc-a277-441d-a5b7-997dd9a87658",api:{spot:"https://api.{hostname}",mix:"https://api.{hostname}",user:"https://api.{hostname}",p2p:"https://api.{hostname}",broker:"https://api.{hostname}",margin:"https://api.{hostname}",common:"https://api.{hostname}",tax:"https://api.{hostname}",convert:"https://api.{hostname}",copy:"https://api.{hostname}",earn:"https://api.{hostname}",uta:"https://api.{hostname}"},www:"https://www.bitget.com",doc:["https://www.bitget.com/api-doc/common/intro","https://www.bitget.com/api-doc/spot/intro","https://www.bitget.com/api-doc/contract/intro","https://www.bitget.com/api-doc/broker/intro","https://www.bitget.com/api-doc/margin/intro","https://www.bitget.com/api-doc/copytrading/intro","https://www.bitget.com/api-doc/earn/intro","https://bitgetlimited.github.io/apidoc/en/mix","https://bitgetlimited.github.io/apidoc/en/spot","https://bitgetlimited.github.io/apidoc/en/broker","https://bitgetlimited.github.io/apidoc/en/margin"],fees:"https://www.bitget.cc/zh-CN/rate?tab=1",referral:"https://www.bitget.com/expressly?languageType=0&channelCode=ccxt&vipCode=tg9j"},api:{public:{common:{get:{"v2/public/annoucements":1,"v2/public/time":1}},spot:{get:{"spot/v1/notice/queryAllNotices":1,"spot/v1/public/time":1,"spot/v1/public/currencies":6.6667,"spot/v1/public/products":1,"spot/v1/public/product":1,"spot/v1/market/ticker":1,"spot/v1/market/tickers":1,"spot/v1/market/fills":2,"spot/v1/market/fills-history":2,"spot/v1/market/candles":1,"spot/v1/market/depth":1,"spot/v1/market/spot-vip-level":2,"spot/v1/market/merge-depth":1,"spot/v1/market/history-candles":1,"spot/v1/public/loan/coinInfos":2,"spot/v1/public/loan/hour-interest":2,"v2/spot/public/coins":6.6667,"v2/spot/public/symbols":1,"v2/spot/market/vip-fee-rate":2,"v2/spot/market/tickers":1,"v2/spot/market/merge-depth":1,"v2/spot/market/orderbook":1,"v2/spot/market/candles":1,"v2/spot/market/history-candles":1,"v2/spot/market/fills":2,"v2/spot/market/fills-history":2}},mix:{get:{"mix/v1/market/contracts":1,"mix/v1/market/depth":1,"mix/v1/market/ticker":1,"mix/v1/market/tickers":1,"mix/v1/market/contract-vip-level":2,"mix/v1/market/fills":1,"mix/v1/market/fills-history":2,"mix/v1/market/candles":1,"mix/v1/market/index":1,"mix/v1/market/funding-time":1,"mix/v1/market/history-fundRate":1,"mix/v1/market/current-fundRate":1,"mix/v1/market/open-interest":1,"mix/v1/market/mark-price":1,"mix/v1/market/symbol-leverage":1,"mix/v1/market/queryPositionLever":1,"mix/v1/market/open-limit":1,"mix/v1/market/history-candles":1,"mix/v1/market/history-index-candles":1,"mix/v1/market/history-mark-candles":1,"mix/v1/market/merge-depth":1,"v2/mix/market/vip-fee-rate":2,"v2/mix/market/merge-depth":1,"v2/mix/market/ticker":1,"v2/mix/market/tickers":1,"v2/mix/market/fills":1,"v2/mix/market/fills-history":2,"v2/mix/market/candles":1,"v2/mix/market/history-candles":1,"v2/mix/market/history-index-candles":1,"v2/mix/market/history-mark-candles":1,"v2/mix/market/open-interest":1,"v2/mix/market/funding-time":1,"v2/mix/market/symbol-price":1,"v2/mix/market/history-fund-rate":1,"v2/mix/market/current-fund-rate":1,"v2/mix/market/contracts":1,"v2/mix/market/query-position-lever":2,"v2/mix/market/account-long-short":20}},margin:{get:{"margin/v1/cross/public/interestRateAndLimit":2,"margin/v1/isolated/public/interestRateAndLimit":2,"margin/v1/cross/public/tierData":2,"margin/v1/isolated/public/tierData":2,"margin/v1/public/currencies":1,"v2/margin/currencies":2,"v2/margin/market/long-short-ratio":20}},earn:{get:{"v2/earn/loan/public/coinInfos":2,"v2/earn/loan/public/hour-interest":2}},uta:{get:{"v3/market/instruments":1,"v3/market/tickers":1,"v3/market/orderbook":1,"v3/market/fills":1,"v3/market/open-interest":1,"v3/market/candles":1,"v3/market/history-candles":1,"v3/market/current-fund-rate":1,"v3/market/history-fund-rate":1,"v3/market/risk-reserve":1,"v3/market/discount-rate":1,"v3/market/margin-loans":1,"v3/market/position-tier":1,"v3/market/oi-limit":2}}},private:{spot:{get:{"spot/v1/wallet/deposit-address":4,"spot/v1/wallet/withdrawal-list":1,"spot/v1/wallet/deposit-list":1,"spot/v1/account/getInfo":20,"spot/v1/account/assets":2,"spot/v1/account/assets-lite":2,"spot/v1/account/transferRecords":1,"spot/v1/convert/currencies":2,"spot/v1/convert/convert-record":2,"spot/v1/loan/ongoing-orders":2,"spot/v1/loan/repay-history":2,"spot/v1/loan/revise-history":2,"spot/v1/loan/borrow-history":2,"spot/v1/loan/debts":2,"v2/spot/trade/orderInfo":1,"v2/spot/trade/unfilled-orders":1,"v2/spot/trade/history-orders":1,"v2/spot/trade/fills":2,"v2/spot/trade/current-plan-order":1,"v2/spot/trade/history-plan-order":1,"v2/spot/account/info":20,"v2/spot/account/assets":2,"v2/spot/account/subaccount-assets":2,"v2/spot/account/bills":2,"v2/spot/account/transferRecords":1,"v2/account/funding-assets":2,"v2/account/bot-assets":2,"v2/account/all-account-balance":20,"v2/spot/wallet/deposit-address":2,"v2/spot/wallet/deposit-records":2,"v2/spot/wallet/withdrawal-records":2},post:{"spot/v1/wallet/transfer":4,"spot/v1/wallet/transfer-v2":4,"spot/v1/wallet/subTransfer":10,"spot/v1/wallet/withdrawal":4,"spot/v1/wallet/withdrawal-v2":4,"spot/v1/wallet/withdrawal-inner":4,"spot/v1/wallet/withdrawal-inner-v2":4,"spot/v1/account/sub-account-spot-assets":200,"spot/v1/account/bills":2,"spot/v1/trade/orders":2,"spot/v1/trade/batch-orders":4,"spot/v1/trade/cancel-order":2,"spot/v1/trade/cancel-order-v2":2,"spot/v1/trade/cancel-symbol-order":2,"spot/v1/trade/cancel-batch-orders":4,"spot/v1/trade/cancel-batch-orders-v2":4,"spot/v1/trade/orderInfo":1,"spot/v1/trade/open-orders":1,"spot/v1/trade/history":1,"spot/v1/trade/fills":1,"spot/v1/plan/placePlan":1,"spot/v1/plan/modifyPlan":1,"spot/v1/plan/cancelPlan":1,"spot/v1/plan/currentPlan":1,"spot/v1/plan/historyPlan":1,"spot/v1/plan/batchCancelPlan":2,"spot/v1/convert/quoted-price":4,"spot/v1/convert/trade":4,"spot/v1/loan/borrow":2,"spot/v1/loan/repay":2,"spot/v1/loan/revise-pledge":2,"spot/v1/trace/order/orderCurrentList":2,"spot/v1/trace/order/orderHistoryList":2,"spot/v1/trace/order/closeTrackingOrder":2,"spot/v1/trace/order/updateTpsl":2,"spot/v1/trace/order/followerEndOrder":2,"spot/v1/trace/order/spotInfoList":2,"spot/v1/trace/config/getTraderSettings":2,"spot/v1/trace/config/getFollowerSettings":2,"spot/v1/trace/user/myTraders":2,"spot/v1/trace/config/setFollowerConfig":2,"spot/v1/trace/user/myFollowers":2,"spot/v1/trace/config/setProductCode":2,"spot/v1/trace/user/removeTrader":2,"spot/v1/trace/getRemovableFollower":2,"spot/v1/trace/user/removeFollower":2,"spot/v1/trace/profit/totalProfitInfo":2,"spot/v1/trace/profit/totalProfitList":2,"spot/v1/trace/profit/profitHisList":2,"spot/v1/trace/profit/profitHisDetailList":2,"spot/v1/trace/profit/waitProfitDetailList":2,"spot/v1/trace/user/getTraderInfo":2,"v2/spot/trade/place-order":2,"v2/spot/trade/cancel-order":2,"v2/spot/trade/batch-orders":20,"v2/spot/trade/batch-cancel-order":2,"v2/spot/trade/cancel-symbol-order":4,"v2/spot/trade/place-plan-order":1,"v2/spot/trade/modify-plan-order":1,"v2/spot/trade/cancel-plan-order":1,"v2/spot/trade/batch-cancel-plan-order":2,"v2/spot/wallet/transfer":2,"v2/spot/wallet/subaccount-transfer":2,"v2/spot/wallet/withdrawal":2,"v2/spot/wallet/cancel-withdrawal":2,"v2/spot/wallet/modify-deposit-account":2}},mix:{get:{"mix/v1/account/account":2,"mix/v1/account/accounts":2,"mix/v1/position/singlePosition":2,"mix/v1/position/singlePosition-v2":2,"mix/v1/position/allPosition":4,"mix/v1/position/allPosition-v2":4,"mix/v1/position/history-position":1,"mix/v1/account/accountBill":2,"mix/v1/account/accountBusinessBill":4,"mix/v1/order/current":1,"mix/v1/order/marginCoinCurrent":1,"mix/v1/order/history":2,"mix/v1/order/historyProductType":4,"mix/v1/order/detail":2,"mix/v1/order/fills":2,"mix/v1/order/allFills":2,"mix/v1/plan/currentPlan":1,"mix/v1/plan/historyPlan":2,"mix/v1/trace/currentTrack":2,"mix/v1/trace/followerOrder":2,"mix/v1/trace/followerHistoryOrders":2,"mix/v1/trace/historyTrack":2,"mix/v1/trace/summary":1,"mix/v1/trace/profitSettleTokenIdGroup":1,"mix/v1/trace/profitDateGroupList":1,"mix/v1/trade/profitDateList":2,"mix/v1/trace/waitProfitDateList":1,"mix/v1/trace/traderSymbols":1,"mix/v1/trace/traderList":2,"mix/v1/trace/traderDetail":2,"mix/v1/trace/queryTraceConfig":2,"v2/mix/account/account":2,"v2/mix/account/accounts":2,"v2/mix/account/sub-account-assets":200,"v2/mix/account/open-count":2,"v2/mix/account/bill":2,"v2/mix/market/query-position-lever":2,"v2/mix/position/single-position":2,"v2/mix/position/all-position":4,"v2/mix/position/history-position":1,"v2/mix/order/detail":2,"v2/mix/order/fills":2,"v2/mix/order/fill-history":2,"v2/mix/order/orders-pending":2,"v2/mix/order/orders-history":2,"v2/mix/order/orders-plan-pending":2,"v2/mix/order/orders-plan-history":2,"v2/mix/market/position-long-short":20},post:{"mix/v1/account/sub-account-contract-assets":200,"mix/v1/account/open-count":1,"mix/v1/account/setLeverage":4,"mix/v1/account/setMargin":4,"mix/v1/account/setMarginMode":4,"mix/v1/account/setPositionMode":4,"mix/v1/order/placeOrder":2,"mix/v1/order/batch-orders":2,"mix/v1/order/cancel-order":2,"mix/v1/order/cancel-batch-orders":2,"mix/v1/order/modifyOrder":2,"mix/v1/order/cancel-symbol-orders":2,"mix/v1/order/cancel-all-orders":2,"mix/v1/order/close-all-positions":20,"mix/v1/plan/placePlan":2,"mix/v1/plan/modifyPlan":2,"mix/v1/plan/modifyPlanPreset":2,"mix/v1/plan/placeTPSL":2,"mix/v1/plan/placeTrailStop":2,"mix/v1/plan/placePositionsTPSL":2,"mix/v1/plan/modifyTPSLPlan":2,"mix/v1/plan/cancelPlan":2,"mix/v1/plan/cancelSymbolPlan":2,"mix/v1/plan/cancelAllPlan":2,"mix/v1/trace/closeTrackOrder":2,"mix/v1/trace/modifyTPSL":2,"mix/v1/trace/closeTrackOrderBySymbol":2,"mix/v1/trace/setUpCopySymbols":2,"mix/v1/trace/followerSetBatchTraceConfig":2,"mix/v1/trace/followerCloseByTrackingNo":2,"mix/v1/trace/followerCloseByAll":2,"mix/v1/trace/followerSetTpsl":2,"mix/v1/trace/cancelCopyTrader":4,"mix/v1/trace/traderUpdateConfig":2,"mix/v1/trace/myTraderList":2,"mix/v1/trace/myFollowerList":2,"mix/v1/trace/removeFollower":2,"mix/v1/trace/public/getFollowerConfig":2,"mix/v1/trace/report/order/historyList":2,"mix/v1/trace/report/order/currentList":2,"mix/v1/trace/queryTraderTpslRatioConfig":2,"mix/v1/trace/traderUpdateTpslRatioConfig":2,"v2/mix/account/set-leverage":4,"v2/mix/account/set-margin":4,"v2/mix/account/set-margin-mode":4,"v2/mix/account/set-position-mode":4,"v2/mix/order/place-order":2,"v2/mix/order/click-backhand":20,"v2/mix/order/batch-place-order":20,"v2/mix/order/modify-order":2,"v2/mix/order/cancel-order":2,"v2/mix/order/batch-cancel-orders":2,"v2/mix/order/close-positions":20,"v2/mix/order/place-tpsl-order":2,"v2/mix/order/place-plan-order":2,"v2/mix/order/modify-tpsl-order":2,"v2/mix/order/modify-plan-order":2,"v2/mix/order/cancel-plan-order":2}},user:{get:{"user/v1/fee/query":2,"user/v1/sub/virtual-list":2,"user/v1/sub/virtual-api-list":2,"user/v1/tax/spot-record":1,"user/v1/tax/future-record":1,"user/v1/tax/margin-record":1,"user/v1/tax/p2p-record":1,"v2/user/virtual-subaccount-list":2,"v2/user/virtual-subaccount-apikey-list":2},post:{"user/v1/sub/virtual-create":4,"user/v1/sub/virtual-modify":4,"user/v1/sub/virtual-api-batch-create":20,"user/v1/sub/virtual-api-create":4,"user/v1/sub/virtual-api-modify":4,"v2/user/create-virtual-subaccount":4,"v2/user/modify-virtual-subaccount":4,"v2/user/batch-create-subaccount-and-apikey":20,"v2/user/create-virtual-subaccount-apikey":4,"v2/user/modify-virtual-subaccount-apikey":4}},p2p:{get:{"p2p/v1/merchant/merchantList":2,"p2p/v1/merchant/merchantInfo":2,"p2p/v1/merchant/advList":2,"p2p/v1/merchant/orderList":2,"v2/p2p/merchantList":2,"v2/p2p/merchantInfo":2,"v2/p2p/orderList":2,"v2/p2p/advList":2}},broker:{get:{"broker/v1/account/info":2,"broker/v1/account/sub-list":20,"broker/v1/account/sub-email":20,"broker/v1/account/sub-spot-assets":2,"broker/v1/account/sub-future-assets":2,"broker/v1/account/subaccount-transfer":1,"broker/v1/account/subaccount-deposit":1,"broker/v1/account/subaccount-withdrawal":1,"broker/v1/account/sub-api-list":2,"v2/broker/account/info":2,"v2/broker/account/subaccount-list":20,"v2/broker/account/subaccount-email":2,"v2/broker/account/subaccount-spot-assets":2,"v2/broker/account/subaccount-future-assets":2,"v2/broker/manage/subaccount-apikey-list":2},post:{"broker/v1/account/sub-create":20,"broker/v1/account/sub-modify":20,"broker/v1/account/sub-modify-email":20,"broker/v1/account/sub-address":2,"broker/v1/account/sub-withdrawal":2,"broker/v1/account/sub-auto-transfer":4,"broker/v1/account/sub-api-create":2,"broker/v1/account/sub-api-modify":2,"v2/broker/account/modify-subaccount-email":2,"v2/broker/account/create-subaccount":20,"v2/broker/account/modify-subaccount":20,"v2/broker/account/subaccount-address":2,"v2/broker/account/subaccount-withdrawal":2,"v2/broker/account/set-subaccount-autotransfer":2,"v2/broker/manage/create-subaccount-apikey":2,"v2/broker/manage/modify-subaccount-apikey":2}},margin:{get:{"margin/v1/cross/account/riskRate":2,"margin/v1/cross/account/maxTransferOutAmount":2,"margin/v1/isolated/account/maxTransferOutAmount":2,"margin/v1/isolated/order/openOrders":2,"margin/v1/isolated/order/history":2,"margin/v1/isolated/order/fills":2,"margin/v1/isolated/loan/list":2,"margin/v1/isolated/repay/list":2,"margin/v1/isolated/interest/list":2,"margin/v1/isolated/liquidation/list":2,"margin/v1/isolated/fin/list":2,"margin/v1/cross/order/openOrders":2,"margin/v1/cross/order/history":2,"margin/v1/cross/order/fills":2,"margin/v1/cross/loan/list":2,"margin/v1/cross/repay/list":2,"margin/v1/cross/interest/list":2,"margin/v1/cross/liquidation/list":2,"margin/v1/cross/fin/list":2,"margin/v1/cross/account/assets":2,"margin/v1/isolated/account/assets":2,"v2/margin/crossed/borrow-history":2,"v2/margin/crossed/repay-history":2,"v2/margin/crossed/interest-history":2,"v2/margin/crossed/liquidation-history":2,"v2/margin/crossed/financial-records":2,"v2/margin/crossed/account/assets":2,"v2/margin/crossed/account/risk-rate":2,"v2/margin/crossed/account/max-borrowable-amount":2,"v2/margin/crossed/account/max-transfer-out-amount":2,"v2/margin/crossed/interest-rate-and-limit":2,"v2/margin/crossed/tier-data":2,"v2/margin/crossed/open-orders":2,"v2/margin/crossed/history-orders":2,"v2/margin/crossed/fills":2,"v2/margin/isolated/borrow-history":2,"v2/margin/isolated/repay-history":2,"v2/margin/isolated/interest-history":2,"v2/margin/isolated/liquidation-history":2,"v2/margin/isolated/financial-records":2,"v2/margin/isolated/account/assets":2,"v2/margin/isolated/account/risk-rate":2,"v2/margin/isolated/account/max-borrowable-amount":2,"v2/margin/isolated/account/max-transfer-out-amount":2,"v2/margin/isolated/interest-rate-and-limit":2,"v2/margin/isolated/tier-data":2,"v2/margin/isolated/open-orders":2,"v2/margin/isolated/history-orders":2,"v2/margin/isolated/fills":2},post:{"margin/v1/cross/account/borrow":2,"margin/v1/isolated/account/borrow":2,"margin/v1/cross/account/repay":2,"margin/v1/isolated/account/repay":2,"margin/v1/isolated/account/riskRate":2,"margin/v1/cross/account/maxBorrowableAmount":2,"margin/v1/isolated/account/maxBorrowableAmount":2,"margin/v1/isolated/account/flashRepay":2,"margin/v1/isolated/account/queryFlashRepayStatus":2,"margin/v1/cross/account/flashRepay":2,"margin/v1/cross/account/queryFlashRepayStatus":2,"margin/v1/isolated/order/placeOrder":4,"margin/v1/isolated/order/batchPlaceOrder":4,"margin/v1/isolated/order/cancelOrder":2,"margin/v1/isolated/order/batchCancelOrder":2,"margin/v1/cross/order/placeOrder":2,"margin/v1/cross/order/batchPlaceOrder":2,"margin/v1/cross/order/cancelOrder":2,"margin/v1/cross/order/batchCancelOrder":2,"v2/margin/crossed/account/borrow":2,"v2/margin/crossed/account/repay":2,"v2/margin/crossed/account/flash-repay":2,"v2/margin/crossed/account/query-flash-repay-status":2,"v2/margin/crossed/place-order":2,"v2/margin/crossed/batch-place-order":2,"v2/margin/crossed/cancel-order":2,"v2/margin/crossed/batch-cancel-order":2,"v2/margin/isolated/account/borrow":2,"v2/margin/isolated/account/repay":2,"v2/margin/isolated/account/flash-repay":2,"v2/margin/isolated/account/query-flash-repay-status":2,"v2/margin/isolated/place-order":2,"v2/margin/isolated/batch-place-order":2,"v2/margin/isolated/cancel-order":2,"v2/margin/isolated/batch-cancel-order":2}},copy:{get:{"v2/copy/mix-trader/order-current-track":2,"v2/copy/mix-trader/order-history-track":2,"v2/copy/mix-trader/order-total-detail":2,"v2/copy/mix-trader/profit-history-summarys":1,"v2/copy/mix-trader/profit-history-details":1,"v2/copy/mix-trader/profit-details":1,"v2/copy/mix-trader/profits-group-coin-date":1,"v2/copy/mix-trader/config-query-symbols":1,"v2/copy/mix-trader/config-query-followers":2,"v2/copy/mix-follower/query-current-orders":2,"v2/copy/mix-follower/query-history-orders":1,"v2/copy/mix-follower/query-settings":2,"v2/copy/mix-follower/query-traders":2,"v2/copy/mix-follower/query-quantity-limit":2,"v2/copy/mix-broker/query-traders":2,"v2/copy/mix-broker/query-history-traces":2,"v2/copy/mix-broker/query-current-traces":2,"v2/copy/spot-trader/profit-summarys":2,"v2/copy/spot-trader/profit-history-details":2,"v2/copy/spot-trader/profit-details":2,"v2/copy/spot-trader/order-total-detail":2,"v2/copy/spot-trader/order-history-track":2,"v2/copy/spot-trader/order-current-track":2,"v2/copy/spot-trader/config-query-settings":2,"v2/copy/spot-trader/config-query-followers":2,"v2/copy/spot-follower/query-traders":2,"v2/copy/spot-follower/query-trader-symbols":2,"v2/copy/spot-follower/query-settings":2,"v2/copy/spot-follower/query-history-orders":2,"v2/copy/spot-follower/query-current-orders":2},post:{"v2/copy/mix-trader/order-modify-tpsl":2,"v2/copy/mix-trader/order-close-positions":2,"v2/copy/mix-trader/config-setting-symbols":2,"v2/copy/mix-trader/config-setting-base":2,"v2/copy/mix-trader/config-remove-follower":2,"v2/copy/mix-follower/setting-tpsl":1,"v2/copy/mix-follower/settings":2,"v2/copy/mix-follower/close-positions":2,"v2/copy/mix-follower/cancel-trader":4,"v2/copy/spot-trader/order-modify-tpsl":2,"v2/copy/spot-trader/order-close-tracking":2,"v2/copy/spot-trader/config-setting-symbols":2,"v2/copy/spot-trader/config-remove-follower":2,"v2/copy/spot-follower/stop-order":2,"v2/copy/spot-follower/settings":2,"v2/copy/spot-follower/setting-tpsl":2,"v2/copy/spot-follower/order-close-tracking":2,"v2/copy/spot-follower/cancel-trader":2}},tax:{get:{"v2/tax/spot-record":20,"v2/tax/future-record":20,"v2/tax/margin-record":20,"v2/tax/p2p-record":20}},convert:{get:{"v2/convert/currencies":2,"v2/convert/quoted-price":2,"v2/convert/convert-record":2,"v2/convert/bgb-convert-coin-list":2,"v2/convert/bgb-convert-records":2},post:{"v2/convert/trade":2,"v2/convert/bgb-convert":2}},earn:{get:{"v2/earn/savings/product":2,"v2/earn/savings/account":2,"v2/earn/savings/assets":2,"v2/earn/savings/records":2,"v2/earn/savings/subscribe-info":2,"v2/earn/savings/subscribe-result":2,"v2/earn/savings/redeem-result":2,"v2/earn/sharkfin/product":2,"v2/earn/sharkfin/account":2,"v2/earn/sharkfin/assets":2,"v2/earn/sharkfin/records":2,"v2/earn/sharkfin/subscribe-info":2,"v2/earn/sharkfin/subscribe-result":4,"v2/earn/loan/ongoing-orders":2,"v2/earn/loan/repay-history":2,"v2/earn/loan/revise-history":2,"v2/earn/loan/borrow-history":2,"v2/earn/loan/debts":2,"v2/earn/loan/reduces":2,"v2/earn/account/assets":2},post:{"v2/earn/savings/subscribe":2,"v2/earn/savings/redeem":2,"v2/earn/sharkfin/subscribe":2,"v2/earn/loan/borrow":2,"v2/earn/loan/repay":2,"v2/earn/loan/revise-pledge":2}},common:{get:{"v2/common/trade-rate":2}},uta:{get:{"v3/account/assets":1,"v3/account/settings":1,"v3/account/deposit-records":2,"v3/account/financial-records":1,"v3/account/repayable-coins":2,"v3/account/payment-coins":2,"v3/account/convert-records":1,"v3/account/transferable-coins":2,"v3/account/sub-transfer-record":4,"v3/ins-loan/transfered":6.6667,"v3/ins-loan/symbols":6.6667,"v3/ins-loan/risk-unit":6.6667,"v3/ins-loan/repaid-history":6.6667,"v3/ins-loan/product-infos":6.6667,"v3/ins-loan/loan-order":6.6667,"v3/ins-loan/ltv-convert":6.6667,"v3/ins-loan/ensure-coins-convert":6.6667,"v3/position/current-position":1,"v3/position/history-position":1,"v3/trade/order-info":1,"v3/trade/unfilled-orders":1,"v3/trade/unfilled-strategy-orders":1,"v3/trade/history-orders":1,"v3/trade/history-strategy-orders":1,"v3/trade/fills":1,"v3/user/sub-list":2,"v3/user/sub-api-list":2},post:{"v3/account/set-leverage":2,"v3/account/set-hold-mode":2,"v3/account/repay":4,"v3/account/transfer":4,"v3/account/sub-transfer":4,"v3/account/max-open-available":4,"v3/ins-loan/bind-uid":6.6667,"v3/trade/place-order":2,"v3/trade/place-strategy-order":2,"v3/trade/modify-order":2,"v3/trade/modify-strategy-order":2,"v3/trade/cancel-order":2,"v3/trade/cancel-strategy-order":2,"v3/trade/place-batch":4,"v3/trade/batch-modify-order":2,"v3/trade/cancel-batch":4,"v3/trade/cancel-symbol-order":4,"v3/trade/close-positions":4,"v3/user/create-sub":2,"v3/user/freeze-sub":2,"v3/user/create-sub-api":2,"v3/user/update-sub-api":2,"v3/user/delete-sub-api":2}}}},fees:{spot:{taker:this.parseNumber("0.002"),maker:this.parseNumber("0.002")},swap:{taker:this.parseNumber("0.0006"),maker:this.parseNumber("0.0004")}},requiredCredentials:{apiKey:!0,secret:!0,password:!0},exceptions:{exact:{1:r.ExchangeError,"failure to get a peer from the ring-balancer":r.ExchangeNotAvailable,4010:r.PermissionDenied,4001:r.ExchangeError,4002:r.ExchangeError,40020:r.BadRequest,30001:r.AuthenticationError,30002:r.AuthenticationError,30003:r.AuthenticationError,30004:r.AuthenticationError,30005:r.InvalidNonce,30006:r.AuthenticationError,30007:r.BadRequest,30008:r.RequestTimeout,30009:r.ExchangeError,30010:r.AuthenticationError,30011:r.PermissionDenied,30012:r.AuthenticationError,30013:r.AuthenticationError,30014:r.DDoSProtection,30015:r.AuthenticationError,30016:r.ExchangeError,30017:r.ExchangeError,30018:r.ExchangeError,30019:r.ExchangeNotAvailable,30020:r.BadRequest,30021:r.BadRequest,30022:r.PermissionDenied,30023:r.BadRequest,30024:r.BadSymbol,30025:r.BadRequest,30026:r.DDoSProtection,30027:r.AuthenticationError,30028:r.PermissionDenied,30029:r.AccountSuspended,30030:r.ExchangeError,30031:r.BadRequest,30032:r.BadSymbol,30033:r.BadRequest,30034:r.ExchangeError,30035:r.ExchangeError,30036:r.ExchangeError,30037:r.ExchangeNotAvailable,30038:r.OnMaintenance,32001:r.AccountSuspended,32002:r.PermissionDenied,32003:r.CancelPending,32004:r.ExchangeError,32005:r.InvalidOrder,32006:r.InvalidOrder,32007:r.InvalidOrder,32008:r.InvalidOrder,32009:r.InvalidOrder,32010:r.ExchangeError,32011:r.ExchangeError,32012:r.ExchangeError,32013:r.ExchangeError,32014:r.ExchangeError,32015:r.ExchangeError,32016:r.ExchangeError,32017:r.ExchangeError,32018:r.ExchangeError,32019:r.ExchangeError,32020:r.ExchangeError,32021:r.ExchangeError,32022:r.ExchangeError,32023:r.ExchangeError,32024:r.ExchangeError,32025:r.ExchangeError,32026:r.ExchangeError,32027:r.ExchangeError,32028:r.AccountSuspended,32029:r.ExchangeError,32030:r.InvalidOrder,32031:r.ArgumentsRequired,32038:r.AuthenticationError,32040:r.ExchangeError,32044:r.ExchangeError,32045:r.ExchangeError,32046:r.ExchangeError,32047:r.ExchangeError,32048:r.InvalidOrder,32049:r.ExchangeError,32050:r.InvalidOrder,32051:r.InvalidOrder,32052:r.ExchangeError,32053:r.ExchangeError,32057:r.ExchangeError,32054:r.ExchangeError,32055:r.InvalidOrder,32056:r.ExchangeError,32058:r.ExchangeError,32059:r.InvalidOrder,32060:r.InvalidOrder,32061:r.InvalidOrder,32062:r.InvalidOrder,32063:r.InvalidOrder,32064:r.ExchangeError,32065:r.ExchangeError,32066:r.ExchangeError,32067:r.ExchangeError,32068:r.ExchangeError,32069:r.ExchangeError,32070:r.ExchangeError,32071:r.ExchangeError,32072:r.ExchangeError,32073:r.ExchangeError,32074:r.ExchangeError,32075:r.ExchangeError,32076:r.ExchangeError,32077:r.ExchangeError,32078:r.ExchangeError,32079:r.ExchangeError,32080:r.ExchangeError,32083:r.ExchangeError,33001:r.PermissionDenied,33002:r.AccountSuspended,33003:r.InsufficientFunds,33004:r.ExchangeError,33005:r.ExchangeError,33006:r.ExchangeError,33007:r.ExchangeError,33008:r.InsufficientFunds,33009:r.ExchangeError,33010:r.ExchangeError,33011:r.ExchangeError,33012:r.ExchangeError,33013:r.InvalidOrder,33014:r.OrderNotFound,33015:r.InvalidOrder,33016:r.ExchangeError,33017:r.InsufficientFunds,33018:r.ExchangeError,33020:r.ExchangeError,33021:r.BadRequest,33022:r.InvalidOrder,33023:r.ExchangeError,33024:r.InvalidOrder,33025:r.InvalidOrder,33026:r.ExchangeError,33027:r.InvalidOrder,33028:r.InvalidOrder,33029:r.InvalidOrder,33034:r.ExchangeError,33035:r.ExchangeError,33036:r.ExchangeError,33037:r.ExchangeError,33038:r.ExchangeError,33039:r.ExchangeError,33040:r.ExchangeError,33041:r.ExchangeError,33042:r.ExchangeError,33043:r.ExchangeError,33044:r.ExchangeError,33045:r.ExchangeError,33046:r.ExchangeError,33047:r.ExchangeError,33048:r.ExchangeError,33049:r.ExchangeError,33050:r.ExchangeError,33051:r.ExchangeError,33059:r.BadRequest,33060:r.BadRequest,33061:r.ExchangeError,33062:r.ExchangeError,33063:r.ExchangeError,33064:r.ExchangeError,33065:r.ExchangeError,21009:r.ExchangeError,34001:r.PermissionDenied,34002:r.InvalidAddress,34003:r.ExchangeError,34004:r.ExchangeError,34005:r.ExchangeError,34006:r.ExchangeError,34007:r.ExchangeError,34008:r.InsufficientFunds,34009:r.ExchangeError,34010:r.ExchangeError,34011:r.ExchangeError,34012:r.ExchangeError,34013:r.ExchangeError,34014:r.ExchangeError,34015:r.ExchangeError,34016:r.PermissionDenied,34017:r.AccountSuspended,34018:r.AuthenticationError,34019:r.PermissionDenied,34020:r.PermissionDenied,34021:r.InvalidAddress,34022:r.ExchangeError,34023:r.PermissionDenied,34026:r.ExchangeError,34036:r.ExchangeError,34037:r.ExchangeError,34038:r.ExchangeError,34039:r.ExchangeError,35001:r.ExchangeError,35002:r.ExchangeError,35003:r.ExchangeError,35004:r.ExchangeError,35005:r.AuthenticationError,35008:r.InvalidOrder,35010:r.InvalidOrder,35012:r.InvalidOrder,35014:r.InvalidOrder,35015:r.InvalidOrder,35017:r.ExchangeError,35019:r.InvalidOrder,35020:r.InvalidOrder,35021:r.InvalidOrder,35022:r.ExchangeError,35024:r.ExchangeError,35025:r.InsufficientFunds,35026:r.ExchangeError,35029:r.OrderNotFound,35030:r.InvalidOrder,35031:r.InvalidOrder,35032:r.ExchangeError,35037:r.ExchangeError,35039:r.ExchangeError,35040:r.InvalidOrder,35044:r.ExchangeError,35046:r.InsufficientFunds,35047:r.InsufficientFunds,35048:r.ExchangeError,35049:r.InvalidOrder,35050:r.InvalidOrder,35052:r.InsufficientFunds,35053:r.ExchangeError,35055:r.InsufficientFunds,35057:r.ExchangeError,35058:r.ExchangeError,35059:r.BadRequest,35060:r.BadRequest,35061:r.BadRequest,35062:r.InvalidOrder,35063:r.InvalidOrder,35064:r.InvalidOrder,35066:r.InvalidOrder,35067:r.InvalidOrder,35068:r.InvalidOrder,35069:r.InvalidOrder,35070:r.InvalidOrder,35071:r.InvalidOrder,35072:r.InvalidOrder,35073:r.InvalidOrder,35074:r.InvalidOrder,35075:r.InvalidOrder,35076:r.InvalidOrder,35077:r.InvalidOrder,35078:r.InvalidOrder,35079:r.InvalidOrder,35080:r.InvalidOrder,35081:r.InvalidOrder,35082:r.InvalidOrder,35083:r.InvalidOrder,35084:r.InvalidOrder,35085:r.InvalidOrder,35086:r.InvalidOrder,35087:r.InvalidOrder,35088:r.InvalidOrder,35089:r.InvalidOrder,35090:r.ExchangeError,35091:r.ExchangeError,35092:r.ExchangeError,35093:r.ExchangeError,35094:r.ExchangeError,35095:r.BadRequest,35096:r.ExchangeError,35097:r.ExchangeError,35098:r.ExchangeError,35099:r.ExchangeError,36001:r.BadRequest,36002:r.BadRequest,36005:r.ExchangeError,36101:r.AuthenticationError,36102:r.PermissionDenied,36103:r.AccountSuspended,36104:r.PermissionDenied,36105:r.PermissionDenied,36106:r.AccountSuspended,36107:r.PermissionDenied,36108:r.InsufficientFunds,36109:r.PermissionDenied,36201:r.PermissionDenied,36202:r.PermissionDenied,36203:r.InvalidOrder,36204:r.ExchangeError,36205:r.BadRequest,36206:r.BadRequest,36207:r.InvalidOrder,36208:r.InvalidOrder,36209:r.InvalidOrder,36210:r.InvalidOrder,36211:r.InvalidOrder,36212:r.InvalidOrder,36213:r.InvalidOrder,36214:r.ExchangeError,36216:r.OrderNotFound,36217:r.InvalidOrder,36218:r.InvalidOrder,36219:r.InvalidOrder,36220:r.InvalidOrder,36221:r.InvalidOrder,36222:r.InvalidOrder,36223:r.InvalidOrder,36224:r.InvalidOrder,36225:r.InvalidOrder,36226:r.InvalidOrder,36227:r.InvalidOrder,36228:r.InvalidOrder,36229:r.InvalidOrder,36230:r.InvalidOrder,400:r.BadRequest,401:r.AuthenticationError,403:r.PermissionDenied,404:r.BadRequest,405:r.BadRequest,415:r.BadRequest,429:r.DDoSProtection,500:r.ExchangeNotAvailable,1001:r.RateLimitExceeded,1002:r.ExchangeError,1003:r.ExchangeError,40001:r.AuthenticationError,40002:r.AuthenticationError,40003:r.AuthenticationError,40004:r.InvalidNonce,40005:r.InvalidNonce,40006:r.AuthenticationError,40007:r.BadRequest,40008:r.InvalidNonce,40009:r.AuthenticationError,40010:r.AuthenticationError,40011:r.AuthenticationError,40012:r.AuthenticationError,40013:r.ExchangeError,40014:r.PermissionDenied,40015:r.ExchangeError,40016:r.PermissionDenied,40017:r.ExchangeError,40018:r.PermissionDenied,40019:r.BadRequest,40031:r.AccountSuspended,40037:r.AuthenticationError,40102:r.BadRequest,40103:r.BadRequest,40104:r.ExchangeError,40105:r.ExchangeError,40106:r.ExchangeError,40107:r.ExchangeError,40108:r.InvalidOrder,40109:r.OrderNotFound,40200:r.OnMaintenance,40201:r.InvalidOrder,40202:r.ExchangeError,40203:r.BadRequest,40204:r.BadRequest,40205:r.BadRequest,40206:r.BadRequest,40207:r.BadRequest,40208:r.BadRequest,40209:r.BadRequest,40300:r.ExchangeError,40301:r.PermissionDenied,40302:r.BadRequest,40303:r.BadRequest,40304:r.BadRequest,40305:r.BadRequest,40306:r.ExchangeError,40308:r.OnMaintenance,40309:r.BadSymbol,40400:r.ExchangeError,40401:r.ExchangeError,40402:r.BadRequest,40403:r.BadRequest,40404:r.BadRequest,40405:r.BadRequest,40406:r.BadRequest,40407:r.ExchangeError,40408:r.ExchangeError,40409:r.ExchangeError,40500:r.InvalidOrder,40501:r.ExchangeError,40502:r.ExchangeError,40503:r.ExchangeError,40504:r.ExchangeError,40505:r.ExchangeError,40506:r.AuthenticationError,40507:r.AuthenticationError,40508:r.ExchangeError,40509:r.ExchangeError,40600:r.ExchangeError,40601:r.ExchangeError,40602:r.ExchangeError,40603:r.ExchangeError,40604:r.ExchangeNotAvailable,40605:r.ExchangeError,40606:r.ExchangeError,40607:r.ExchangeError,40608:r.ExchangeError,40609:r.ExchangeError,40700:r.BadRequest,40701:r.ExchangeError,40702:r.ExchangeError,40703:r.ExchangeError,40704:r.ExchangeError,40705:r.BadRequest,40706:r.InvalidOrder,40707:r.BadRequest,40708:r.BadRequest,40709:r.ExchangeError,40710:r.ExchangeError,40711:r.InsufficientFunds,40712:r.InsufficientFunds,40713:r.ExchangeError,40714:r.ExchangeError,40762:r.InsufficientFunds,40768:r.OrderNotFound,40808:r.InvalidOrder,41103:r.InvalidOrder,41114:r.OnMaintenance,43011:r.InvalidOrder,43001:r.OrderNotFound,43012:r.InsufficientFunds,43025:r.InvalidOrder,43115:r.OnMaintenance,45110:r.InvalidOrder,"invalid sign":r.AuthenticationError,"invalid currency":r.BadSymbol,"invalid symbol":r.BadSymbol,"invalid period":r.BadRequest,"invalid user":r.ExchangeError,"invalid amount":r.InvalidOrder,"invalid type":r.InvalidOrder,"invalid orderId":r.InvalidOrder,"invalid record":r.ExchangeError,"invalid accountId":r.BadRequest,"invalid address":r.BadRequest,"accesskey not null":r.AuthenticationError,"illegal accesskey":r.AuthenticationError,"sign not null":r.AuthenticationError,"req_time is too much difference from server time":r.InvalidNonce,"permissions not right":r.PermissionDenied,"illegal sign invalid":r.AuthenticationError,"user locked":r.AccountSuspended,"Request Frequency Is Too High":r.RateLimitExceeded,"more than a daily rate of cash":r.BadRequest,"more than the maximum daily withdrawal amount":r.BadRequest,"need to bind email or mobile":r.ExchangeError,"user forbid":r.PermissionDenied,"User Prohibited Cash Withdrawal":r.PermissionDenied,"Cash Withdrawal Is Less Than The Minimum Value":r.BadRequest,"Cash Withdrawal Is More Than The Maximum Value":r.BadRequest,"the account with in 24 hours ban coin":r.PermissionDenied,"order cancel fail":r.BadRequest,"base symbol error":r.BadSymbol,"base date error":r.ExchangeError,"api signature not valid":r.AuthenticationError,"gateway internal error":r.ExchangeError,"audit failed":r.ExchangeError,"order queryorder invalid":r.BadRequest,"market no need price":r.InvalidOrder,"limit need price":r.InvalidOrder,"userid not equal to account_id":r.ExchangeError,"your balance is low":r.InsufficientFunds,"address invalid cointype":r.ExchangeError,"system exception":r.ExchangeError,50003:r.ExchangeError,50004:r.BadSymbol,50006:r.PermissionDenied,50007:r.PermissionDenied,50008:r.RequestTimeout,50009:r.RateLimitExceeded,50010:r.ExchangeError,50014:r.InvalidOrder,50015:r.InvalidOrder,50016:r.InvalidOrder,50017:r.InvalidOrder,50018:r.InvalidOrder,50019:r.InvalidOrder,50020:r.InsufficientFunds,50021:r.InvalidOrder,50026:r.InvalidOrder,"invalid order query time":r.ExchangeError,"invalid start time":r.BadRequest,"invalid end time":r.BadRequest,20003:r.ExchangeError,"01001":r.ExchangeError,43111:r.PermissionDenied},broad:{"invalid size, valid range":r.ExchangeError}},precisionMode:o.kb,commonCurrencies:{APX:"AstroPepeX",DEGEN:"DegenReborn",JADE:"Jade Protocol",OMNI:"omni",TONCOIN:"TON"},options:{uta:!1,timeDifference:0,adjustForTimeDifference:!1,timeframes:{spot:{"1m":"1min","5m":"5min","15m":"15min","30m":"30min","1h":"1h","4h":"4h","6h":"6Hutc","12h":"12Hutc","1d":"1Dutc","3d":"3Dutc","1w":"1Wutc","1M":"1Mutc"},swap:{"1m":"1m","3m":"3m","5m":"5m","15m":"15m","30m":"30m","1h":"1H","2h":"2H","4h":"4H","6h":"6Hutc","12h":"12Hutc","1d":"1Dutc","3d":"3Dutc","1w":"1Wutc","1M":"1Mutc"},uta:{"1m":"1m","3m":"3m","5m":"5m","15m":"15m","30m":"30m","1h":"1H","2h":"2H","4h":"4H","6h":"6H","12h":"12H","1d":"1D"}},fetchMarkets:{types:["spot","swap"]},defaultType:"spot",defaultSubType:"linear",createMarketBuyOrderRequiresPrice:!0,broker:"p4sve",withdraw:{fillResponseFromRequest:!0},fetchOHLCV:{maxRecentDaysPerTimeframe:{"1m":30,"3m":30,"5m":30,"15m":30,"30m":30,"1h":60,"4h":240,"6h":360,"12h":720,"1d":1440,"3d":4320,"1w":10080,"1M":43200},spot:{maxLimitPerTimeframe:{"1d":300,"3d":100,"1w":100,"1M":100},method:"publicSpotGetV2SpotMarketCandles"},swap:{maxLimitPerTimeframe:{"4h":540,"6h":360,"12h":180,"1d":90,"3d":30,"1w":13,"1M":4},method:"publicMixGetV2MixMarketCandles"}},fetchTrades:{spot:{method:"publicSpotGetV2SpotMarketFillsHistory"},swap:{method:"publicMixGetV2MixMarketFillsHistory"}},fetchFundingRate:{method:"publicMixGetV2MixMarketCurrentFundRate"},accountsByType:{spot:"spot",cross:"crossed_margin",isolated:"isolated_margin",swap:"usdt_futures",usdc_swap:"usdc_futures",future:"coin_futures",p2p:"p2p"},accountsById:{spot:"spot",crossed_margin:"cross",isolated_margin:"isolated",usdt_futures:"swap",usdc_futures:"usdc_swap",coin_futures:"future",p2p:"p2p"},sandboxMode:!1,networks:{TRC20:"TRC20",ERC20:"ERC20",BEP20:"BSC",ATOM:"ATOM",ACA:"AcalaToken",APT:"Aptos",ARBONE:"ArbitrumOne",ARBNOVA:"ArbitrumNova",AVAXC:"C-Chain",AVAXX:"X-Chain",AR:"Arweave",BCH:"BCH",BCHA:"BCHA",BITCI:"BITCI",BTC:"BTC",CELO:"CELO",CSPR:"CSPR",ADA:"Cardano",CHZ:"ChilizChain",CRC20:"CronosChain",DOGE:"DOGE",DOT:"DOT",EOS:"EOS",ETHF:"ETHFAIR",ETHW:"ETHW",ETC:"ETC",EGLD:"Elrond",FIL:"FIL",FIO:"FIO",FTM:"Fantom",HRC20:"HECO",ONE:"Harmony",HNT:"Helium",ICP:"ICP",IOTX:"IoTeX",KARDIA:"KAI",KAVA:"KAVA",KDA:"KDA",KLAY:"Klaytn",KSM:"Kusama",LAT:"LAT",LTC:"LTC",MINA:"MINA",MOVR:"MOVR",METIS:"MetisToken",GLMR:"Moonbeam",NEAR:"NEARProtocol",NULS:"NULS",OASYS:"OASYS",OASIS:"ROSE",OMNI:"OMNI",ONT:"Ontology",OPTIMISM:"Optimism",OSMO:"Osmosis",POKT:"PocketNetwork",MATIC:"Polygon",QTUM:"QTUM",REEF:"REEF",SOL:"SOL",SYS:"SYS",SXP:"Solar",XYM:"Symbol",TON:"TON",TT:"TT",TLOS:"Telos",THETA:"ThetaToken",VITE:"VITE",WAVES:"WAVES",WAX:"WAXP",WEMIX:"WEMIXMainnet",XDC:"XDCNetworkXDC",XRP:"XRP",FET:"FETCH",NEM:"NEM",REI:"REINetwork",ZIL:"ZIL",ABBC:"ABBCCoin",RSK:"RSK",AZERO:"AZERO",TRC10:"TRC10",JUNO:"JUNO",ZKSYNC:"zkSyncEra",STARKNET:"Starknet",VIC:"VICTION"},networksById:{},fetchPositions:{method:"privateMixGetV2MixPositionAllPosition"},defaultTimeInForce:"GTC",fiatCurrencies:["EUR","VND","PLN","CZK","HUF","DKK","AUD","CAD","NOK","SEK","CHF","MXN","COP","ARS","GBP","BRL","UAH","ZAR"]},features:{spot:{sandbox:!0,createOrder:{marginMode:!0,triggerPrice:!0,triggerPriceType:{last:!0,mark:!0,index:!1},triggerDirection:!1,stopLossPrice:!0,takeProfitPrice:!0,attachedStopLossTakeProfit:{triggerPriceType:{last:!1,mark:!1,index:!1},price:!0},timeInForce:{IOC:!0,FOK:!0,PO:!0,GTD:!1},hedged:!1,trailing:!1,marketBuyRequiresPrice:!0,marketBuyByCost:!0},createOrders:{max:50},fetchMyTrades:{marginMode:!0,limit:100,daysBack:void 0,untilDays:90,symbolRequired:!0},fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!0},fetchOpenOrders:{marginMode:!0,limit:100,trigger:!0,trailing:!1,symbolRequired:!1},fetchOrders:void 0,fetchClosedOrders:{marginMode:!0,limit:100,daysBack:void 0,daysBackCanceled:void 0,untilDays:90,trigger:!0,trailing:!1,symbolRequired:!1},fetchOHLCV:{limit:200}},forPerps:{extends:"spot",createOrder:{triggerPrice:!0,triggerPriceType:{last:!0,mark:!0,index:!1},triggerDirection:!1,stopLossPrice:!0,takeProfitPrice:!0,attachedStopLossTakeProfit:{triggerPriceType:{last:!0,mark:!0,index:!0},price:!1},timeInForce:{IOC:!0,FOK:!0,PO:!0,GTD:!1},hedged:!0,trailing:!0,marketBuyRequiresPrice:!1,marketBuyByCost:!1},fetchMyTrades:{untilDays:7},fetchClosedOrders:{trailing:!0}},swap:{linear:{extends:"forPerps"},inverse:{extends:"forPerps"}},future:{linear:{extends:"forPerps"},inverse:{extends:"forPerps"}}}})}setSandboxMode(e){this.options.sandboxMode=e}handleProductTypeAndParams(e=void 0,t={}){let i,s;[i,t]=this.handleSubTypeAndParams("handleProductTypeAndParams",void 0,t),void 0!==i&&void 0===e&&(s="linear"===i?"USDT-FUTURES":"COIN-FUTURES");let a=this.safeString2(t,"productType","category",s);if(void 0===a&&void 0!==e){const i=e.settle;if(e.spot){let e;[e,t]=this.handleMarginModeAndParams("handleProductTypeAndParams",t),a=void 0!==e?"MARGIN":"SPOT"}else a="USDT"===i?"USDT-FUTURES":"USDC"===i?"USDC-FUTURES":"SUSDT"===i?"SUSDT-FUTURES":"SUSDC"===i?"SUSDC-FUTURES":"SBTC"===i||"SETH"===i||"SEOS"===i?"SCOIN-FUTURES":"COIN-FUTURES"}if(void 0===a)throw new r.ArgumentsRequired(this.id+' requires a productType param, one of "USDT-FUTURES", "USDC-FUTURES", "COIN-FUTURES", "SUSDT-FUTURES", "SUSDC-FUTURES", "SCOIN-FUTURES" or for uta only "SPOT"');return[a,t=this.omit(t,["productType","category"])]}async fetchTime(e={}){const t=await this.publicCommonGetV2PublicTime(e),i=this.safeValue(t,"data",{});return this.safeInteger(i,"serverTime")}async fetchMarkets(e={}){let t;return this.options.adjustForTimeDifference&&await this.loadTimeDifference(),[t,e]=this.handleOptionAndParams(e,"fetchMarkets","uta",!1),t?await this.fetchUtaMarkets(e):await this.fetchDefaultMarkets(e)}async fetchDefaultMarkets(e){let t;const i=this.safeDict(this.options,"fetchMarkets"),s=["spot","swap"];t=void 0!==i?this.safeList(i,"types",s):this.safeList(this.options,"fetchMarkets",s);const o=[];let n=!1;for(let i=0;ie*f&&(I=this.sum(M,e*f),h.endTime=I)}if(h.limit=s,[C,r]=this.handleParamString(r,"price"),[_,r]=this.handleProductTypeAndParams(d,r),u)void 0!==C&&("mark"===C?h.type="MARK":"index"===C&&(h.type="INDEX")),h.category=_,A=await this.publicUtaGetV3MarketCandles(this.extend(h,r));else if(d.spot)B?A=await this.publicSpotGetV2SpotMarketHistoryCandles(this.extend(h,r)):(v||(h.limit=1e3,s=1e3),A=await this.publicSpotGetV2SpotMarketCandles(this.extend(h,r)));else{h.productType=_;const e=this.extend(h,r);B||"mark"!==C&&"index"!==C?"mark"===C?A=await this.publicMixGetV2MixMarketHistoryMarkCandles(e):"index"===C?A=await this.publicMixGetV2MixMarketHistoryIndexCandles(e):B?A=await this.publicMixGetV2MixMarketHistoryCandles(e):(v||(e.limit=1e3,s=1e3),A=await this.publicMixGetV2MixMarketCandles(e)):(v||(e.limit=1e3,s=1e3),A=await this.publicMixGetV2MixMarketCandles(this.extend({kLineType:C},e)))}if(""===A)return[];const E=this.safeList(A,"data",A);return this.parseOHLCVs(E,d,t,i,s)}async fetchBalance(e={}){await this.loadMarkets();const t={};let i,s,a,o;if([o,e]=this.handleOptionAndParams(e,"fetchBalance","uta",!1),[i,e]=this.handleMarketTypeAndParams("fetchBalance",void 0,e),[s,e]=this.handleMarginModeAndParams("fetchBalance",e),o){a=await this.privateUtaGetV3AccountAssets(this.extend(t,e));const i=this.safeDict(a,"data",{}),s=this.safeList(i,"assets",[]);return this.parseUtaBalance(s)}if("swap"===i||"future"===i){let i;[i,e]=this.handleProductTypeAndParams(void 0,e),t.productType=i,a=await this.privateMixGetV2MixAccountAccounts(this.extend(t,e))}else if("isolated"===s)a=await this.privateMarginGetMarginV1IsolatedAccountAssets(this.extend(t,e));else if("cross"===s)a=await this.privateMarginGetMarginV1CrossAccountAssets(this.extend(t,e));else{if("spot"!==i)throw new r.NotSupported(this.id+" fetchBalance() does not support "+i+" accounts");a=await this.privateSpotGetV2SpotAccountAssets(this.extend(t,e))}const n=this.safeValue(a,"data",[]);return this.parseBalance(n)}parseUtaBalance(e){const t={info:e};for(let i=0;i1)throw new r.ExchangeError(this.id+" createOrder() params can only contain one of triggerPrice, stopLossPrice, takeProfitPrice, trailingPercent");"limit"===t&&(l.price=this.priceToPrecision(e,o));const x=this.safeString2(n,"triggerPriceType","triggerType","mark_price"),A=this.safeBool(n,"reduceOnly",!1),_=this.safeString2(n,"clientOid","clientOrderId"),C=this.safeString2(n,"force","timeInForce");let B;[B,n]=this.handlePostOnly(u,"post_only"===C,n);const E=this.safeStringUpper(this.options,"defaultTimeInForce"),L=this.safeStringUpper(n,"timeInForce",E);if(B?l.force="post_only":"GTC"===L?l.force="GTC":"FOK"===L?l.force="FOK":"IOC"===L&&(l.force="IOC"),n=this.omit(n,["stopPrice","triggerType","stopLossPrice","takeProfitPrice","stopLoss","takeProfit","postOnly","reduceOnly","clientOrderId","trailingPercent","trailingTriggerPrice"]),"swap"===h||"future"===h){let t;if(l.marginCoin=d.settleId,l.size=this.amountToPrecision(e,s),[t,n]=this.handleProductTypeAndParams(d,n),l.productType=t,void 0!==_&&(l.clientOid=_),(y||O||I)&&(l.triggerType=x),I){if(!u)throw new r.BadRequest(this.id+" createOrder() bitget trailing orders must be market orders");if(void 0===P)throw new r.ArgumentsRequired(this.id+" createOrder() bitget trailing orders must have a trailingTriggerPrice param");l.planType="track_plan",l.triggerPrice=this.priceToPrecision(e,P),l.callbackRatio=M}else if(y){if(l.planType="normal_plan",l.triggerPrice=this.priceToPrecision(e,f),void 0!==o&&(l.executePrice=this.priceToPrecision(e,o)),k){const t=this.safeString2(g,"triggerPrice","stopPrice");l.stopLossTriggerPrice=this.priceToPrecision(e,t);const i=this.safeString(g,"price");l.stopLossExecutePrice=this.priceToPrecision(e,i);const s=this.safeString(g,"type","mark_price");l.stopLossTriggerType=s}if(S){const t=this.safeString2(v,"triggerPrice","stopPrice");l.stopSurplusTriggerPrice=this.priceToPrecision(e,t);const i=this.safeString(v,"price");l.stopSurplusExecutePrice=this.priceToPrecision(e,i);const s=this.safeString(v,"type","mark_price");l.stopSurplusTriggerType=s}}else if(O){if(!u)throw new r.ExchangeError(this.id+" createOrder() bitget stopLoss or takeProfit orders must be market orders");l.holdSide="buy"===i?"long":"short",w?(l.triggerPrice=this.priceToPrecision(e,p),l.planType="pos_loss"):b&&(l.triggerPrice=this.priceToPrecision(e,m),l.planType="pos_profit")}else{if(k){const t=this.safeValue2(g,"triggerPrice","stopPrice");l.presetStopLossPrice=this.priceToPrecision(e,t)}if(S){const t=this.safeValue2(v,"triggerPrice","stopPrice");l.presetStopSurplusPrice=this.priceToPrecision(e,t)}}if(!O){void 0===c&&(c="cross");const e="cross"===c?"crossed":"isolated";let t,s;l.marginMode=e,[t,n]=this.handleParamBool(n,"hedged",!1),[s,n]=this.handleParamBool(n,"oneWayMode"),void 0!==s&&(t=!s);let r=i;A?t?(r="buy"===i?"sell":"buy",l.tradeSide="Close"):l.reduceOnly="YES":t&&(l.tradeSide="Open"),l.side=r}}else{if("spot"!==h)throw new r.NotSupported(this.id+" createOrder() does not support "+h+" orders");{if(O||T)throw new r.InvalidOrder(this.id+" createOrder() does not support stop loss/take profit orders on spot markets, only swap markets");let t,d;l.side=i;let h=!0;if([h,n]=this.handleOptionAndParams(n,"createOrder","createMarketBuyOrderRequiresPrice",!0),u&&"buy"===i){d="total";const i=this.safeNumber(n,"cost");if(n=this.omit(n,"cost"),void 0!==i)t=this.costToPrecision(e,i);else if(h){if(void 0===o)throw new r.InvalidOrder(this.id+" createOrder() requires the price argument for market buy orders to calculate the total cost to spend (amount * price), alternatively set the createMarketBuyOrderRequiresPrice option or param to false and pass the cost to spend in the amount argument");{const i=this.numberToString(s),r=this.numberToString(o),n=a.Y.stringMul(i,r);t=this.costToPrecision(e,n)}}else t=this.costToPrecision(e,s)}else d="amount",t=this.amountToPrecision(e,s);void 0!==_&&(l.clientOid=_),void 0!==c?(l.loanType="normal",u&&"buy"===i?l.quoteSize=t:l.baseSize=t):(void 0!==t&&(l.size=t),void 0!==f&&(l.planType=d,l.triggerType=x,l.triggerPrice=this.priceToPrecision(e,f),void 0!==o&&(l.executePrice=this.priceToPrecision(e,o))))}}return this.extend(l,n)}async createUtaOrders(e,t={}){await this.loadMarkets();const i=[];let s,a;for(let t=0;t1)throw new r.ExchangeError(this.id+" editOrder() params can only contain one of triggerPrice, stopLossPrice, takeProfitPrice, trailingPercent");const P=this.safeString2(d,"clientOid","clientOrderId");let M,I,x;if(void 0!==P&&(c.clientOid=P),d=this.omit(d,["stopPrice","triggerType","stopLossPrice","takeProfitPrice","stopLoss","takeProfit","clientOrderId","trailingTriggerPrice","trailingPercent"]),[I,d]=this.handleProductTypeAndParams(h,d),[x,d]=this.handleOptionAndParams(d,"editOrder","uta",!1),x)if(void 0!==o&&(c.qty=this.amountToPrecision(t,o)),m||v){if(m){const e=this.safeString(d,"slTriggerBy","mark");c.slTriggerBy=e,c.stopLoss=this.priceToPrecision(t,p),void 0!==n?(c.slLimitPrice=this.priceToPrecision(t,n),c.slOrderType=this.safeString(d,"slOrderType","limit")):c.slOrderType=this.safeString(d,"slOrderType","market")}else if(v){const e=this.safeString(d,"tpTriggerBy","mark");c.tpTriggerBy=e,c.takeProfit=this.priceToPrecision(t,g),void 0!==n?(c.tpLimitPrice=this.priceToPrecision(t,n),c.tpOrderType=this.safeString(d,"tpOrderType","limit")):c.tpOrderType=this.safeString(d,"tpOrderType","market")}d=this.omit(d,["stopLossPrice","takeProfitPrice"]),M=await this.privateUtaPostV3TradeModifyStrategyOrder(this.extend(c,d))}else void 0!==n&&(c.price=this.priceToPrecision(t,n)),M=await this.privateUtaPostV3TradeModifyOrder(this.extend(c,d));else if(h.spot){if(void 0===u)throw new r.NotSupported(this.id+" editOrder() only supports plan/trigger spot orders");if(this.safeBool(this.options,"editMarketBuyOrderRequiresPrice",!0)&&l&&"buy"===s){if(void 0===n)throw new r.InvalidOrder(this.id+" editOrder() requires price argument for market buy orders on spot markets to calculate the total amount to spend (amount * price), alternatively set the editMarketBuyOrderRequiresPrice option to false and pass in the cost to spend into the amount parameter");{const e=this.numberToString(o),i=this.numberToString(n),s=this.parseNumber(a.Y.stringMul(e,i));c.size=this.priceToPrecision(t,s)}}else c.size=this.amountToPrecision(t,o);c.orderType=i,c.triggerPrice=this.priceToPrecision(t,u),c.executePrice=this.priceToPrecision(t,n),M=await this.privateSpotPostV2SpotTradeModifyPlanOrder(this.extend(c,d))}else{if(!h.swap&&!h.future)throw new r.NotSupported(this.id+" editOrder() does not support "+h.type+" orders");if(c.symbol=h.id,c.productType=I,v||m||(c.newSize=this.amountToPrecision(t,o),void 0===n||T||(c.newPrice=this.priceToPrecision(t,n))),T){if(!l)throw new r.BadRequest(this.id+" editOrder() bitget trailing orders must be market orders");void 0!==S&&(c.newTriggerPrice=this.priceToPrecision(t,S)),c.newCallbackRatio=O,M=await this.privateMixPostV2MixOrderModifyPlanOrder(this.extend(c,d))}else if(v||m)c.marginCoin=h.settleId,c.size=this.amountToPrecision(t,o),void 0!==n&&(c.executePrice=this.priceToPrecision(t,n)),m?c.triggerPrice=this.priceToPrecision(t,p):v&&(c.triggerPrice=this.priceToPrecision(t,g)),M=await this.privateMixPostV2MixOrderModifyTpslOrder(this.extend(c,d));else if(f){if(c.newTriggerPrice=this.priceToPrecision(t,u),b){const e=this.safeNumber2(y,"triggerPrice","stopPrice");c.newStopLossTriggerPrice=this.priceToPrecision(t,e);const i=this.safeNumber(y,"price");c.newStopLossExecutePrice=this.priceToPrecision(t,i);const s=this.safeString(y,"type","mark_price");c.newStopLossTriggerType=s}if(k){const e=this.safeNumber2(w,"triggerPrice","stopPrice");c.newSurplusTriggerPrice=this.priceToPrecision(t,e);const i=this.safeNumber(w,"price");c.newStopSurplusExecutePrice=this.priceToPrecision(t,i);const s=this.safeString(w,"type","mark_price");c.newStopSurplusTriggerType=s}M=await this.privateMixPostV2MixOrderModifyPlanOrder(this.extend(c,d))}else{const e=this.uuid(),i=this.safeString2(d,"newClientOid","newClientOrderId",e);if(d=this.omit(d,"newClientOrderId"),c.newClientOid=i,b){const e=this.safeValue2(y,"triggerPrice","stopPrice");c.newPresetStopLossPrice=this.priceToPrecision(t,e)}if(k){const e=this.safeValue2(w,"triggerPrice","stopPrice");c.newPresetStopSurplusPrice=this.priceToPrecision(t,e)}M=await this.privateMixPostV2MixOrderModifyOrder(this.extend(c,d))}}const A=this.safeDict(M,"data",{});return this.parseOrder(A,h)}async cancelOrder(e,t=void 0,i={}){if(void 0===t)throw new r.ArgumentsRequired(this.id+" cancelOrder() requires a symbol argument");await this.loadMarkets();const s=this.market(t);let a,o;[a,i]=this.handleMarginModeAndParams("cancelOrder",i);const n={},d=this.safeValue(i,"trailing"),h=this.safeValue2(i,"stop","trigger");let c;i=this.omit(i,["stop","trigger","trailing"]),s.spot&&h||(n.symbol=s.id),[c,i]=this.handleOptionAndParams(i,"cancelOrder","uta",!1);const l=h||d,u=(s.swap||s.future)&&l&&!c,f=this.safeString2(i,"clientOrderId","clientOid");if(u){const t=[],s={};void 0!==f?(i=this.omit(i,"clientOrderId"),s.clientOid=f):s.orderId=e,t.push(s),n.orderIdList=t}else void 0!==f?(i=this.omit(i,"clientOrderId"),n.clientOid=f):n.orderId=e;if(c)o=h?await this.privateUtaPostV3TradeCancelStrategyOrder(this.extend(n,i)):await this.privateUtaPostV3TradeCancelOrder(this.extend(n,i));else if(s.swap||s.future){let e;if([e,i]=this.handleProductTypeAndParams(s,i),n.productType=e,d){const e=this.safeString(i,"planType","track_plan");n.planType=e,o=await this.privateMixPostV2MixOrderCancelPlanOrder(this.extend(n,i))}else o=h?await this.privateMixPostV2MixOrderCancelPlanOrder(this.extend(n,i)):await this.privateMixPostV2MixOrderCancelOrder(this.extend(n,i))}else{if(!s.spot)throw new r.NotSupported(this.id+" cancelOrder() does not support "+s.type+" orders");void 0!==a?"isolated"===a?o=await this.privateMarginPostV2MarginIsolatedCancelOrder(this.extend(n,i)):"cross"===a&&(o=await this.privateMarginPostV2MarginCrossedCancelOrder(this.extend(n,i))):o=h?await this.privateSpotPostV2SpotTradeCancelPlanOrder(this.extend(n,i)):await this.privateSpotPostV2SpotTradeCancelOrder(this.extend(n,i))}const p=this.safeValue(o,"data",{});let m;if(u){m=this.safeValue(p,"successList",[])[0]}else m=c&&h?o:p;return this.parseOrder(m,s)}async cancelUtaOrders(e,t=void 0,i={}){if(void 0===t)throw new r.ArgumentsRequired(this.id+" cancelOrders() requires a symbol argument");await this.loadMarkets();const s=this.market(t);let a;[a,i]=this.handleProductTypeAndParams(s,i);const o=[];for(let t=0;t=0&&(c="out"),this.safeLedgerEntry({info:e,id:this.safeString(e,"billId"),timestamp:r,datetime:this.iso8601(r),direction:c,account:void 0,referenceId:void 0,referenceAccount:void 0,type:this.parseLedgerType(this.safeString(e,"businessType")),currency:s,amount:h,before:void 0,after:o,status:void 0,fee:{currency:s,cost:n}},t)}parseLedgerType(e){return this.safeString({trans_to_cross:"transfer",trans_from_cross:"transfer",trans_to_exchange:"transfer",trans_from_exchange:"transfer",trans_to_isolated:"transfer",trans_from_isolated:"transfer",trans_to_contract:"transfer",trans_from_contract:"transfer",trans_to_otc:"transfer",trans_from_otc:"transfer",open_long:"trade",close_long:"trade",open_short:"trade",close_short:"trade",force_close_long:"trade",force_close_short:"trade",burst_long_loss_query:"trade",burst_short_loss_query:"trade",force_buy:"trade",force_sell:"trade",burst_buy:"trade",burst_sell:"trade",delivery_long:"settlement",delivery_short:"settlement",contract_settle_fee:"fee",append_margin:"transaction",adjust_down_lever_append_margin:"transaction",reduce_margin:"transaction",auto_append_margin:"transaction",cash_gift_issue:"cashback",cash_gift_recycle:"cashback",bonus_issue:"rebate",bonus_recycle:"rebate",bonus_expired:"rebate",transfer_in:"transfer",transfer_out:"transfer",deposit:"deposit",withdraw:"withdrawal",buy:"trade",sell:"trade"},e,e)}async fetchMyTrades(e=void 0,t=void 0,i=void 0,s={}){let a;if([a,s]=this.handleOptionAndParams(s,"fetchMyTrades","uta",!1),!a&&void 0===e)throw new r.ArgumentsRequired(this.id+" fetchMyTrades() requires a symbol argument");await this.loadMarkets();const o=this.market(e);let n={};[n,s]=this.handleUntilOption("endTime",n,s),void 0!==t&&(n.startTime=t),void 0!==i&&(n.limit=i);let d,h,c=!1;if([c,s]=this.handleOptionAndParams(s,"fetchMyTrades","paginate"),[d,s]=this.handleMarginModeAndParams("fetchMyTrades",s),c){let r,n;return a?(r="cursor",n="cursor"):o.spot?void 0!==d&&(r="minId",n="idLessThan"):(r="endId",n="idLessThan"),await this.fetchPaginatedCallCursor("fetchMyTrades",e,t,i,s,r,n)}if(a)h=await this.privateUtaGetV3TradeFills(this.extend(n,s));else if(n.symbol=o.id,o.spot)void 0!==d?(void 0===t&&(n.startTime=this.milliseconds()-7776e6),"isolated"===d?h=await this.privateMarginGetV2MarginIsolatedFills(this.extend(n,s)):"cross"===d&&(h=await this.privateMarginGetV2MarginCrossedFills(this.extend(n,s)))):h=await this.privateSpotGetV2SpotTradeFills(this.extend(n,s));else{let e;[e,s]=this.handleProductTypeAndParams(o,s),n.productType=e,h=await this.privateMixGetV2MixOrderFills(this.extend(n,s))}const l=this.safeValue(h,"data");if(a){const e=this.safeList(l,"list",[]);return this.parseTrades(e,o,t,i)}if(o.swap||o.future){const e=this.safeList(l,"fillList",[]);return this.parseTrades(e,o,t,i)}if(void 0!==d){const e=this.safeList(l,"fills",[]);return this.parseTrades(e,o,t,i)}return this.parseTrades(l,o,t,i)}async fetchPosition(e,t={}){await this.loadMarkets();const i=this.market(e);let s;[s,t]=this.handleProductTypeAndParams(i,t);const r={symbol:i.id};let a,o,n;if([o,t]=this.handleOptionAndParams(t,"fetchPosition","uta",!1),o){r.category=s,a=await this.privateUtaGetV3PositionCurrentPosition(this.extend(r,t));const e=this.safeDict(a,"data",{});n=this.safeList(e,"list",[])}else r.marginCoin=i.settleId,r.productType=s,a=await this.privateMixGetV2MixPositionSinglePosition(this.extend(r,t)),n=this.safeList(a,"data",[]);const d=this.safeDict(n,0,{});return this.parsePosition(d,i)}async fetchPositions(e=void 0,t={}){await this.loadMarkets();let i,s=!1;if([s,t]=this.handleOptionAndParams(t,"fetchPositions","paginate"),s)return await this.fetchPaginatedCallCursor("fetchPositions",void 0,void 0,void 0,t,"endId","idLessThan");let a,o;if(this.safeBool(t,"useHistoryEndpoint",!1)?i="privateMixGetV2MixPositionHistoryPosition":[i,t]=this.handleOptionAndParams(t,"fetchPositions","method","privateMixGetV2MixPositionAllPosition"),void 0!==e){const t=this.safeString(e,0);a=this.market(t)}[o,t]=this.handleProductTypeAndParams(a,t);const n={productType:o};let d,h=!1;if("privateMixGetV2MixPositionAllPosition"===i){let i=this.safeString(t,"marginCoin","USDT");if(void 0!==e)i=a.settleId;else if("USDT-FUTURES"===o)i="USDT";else if("USDC-FUTURES"===o)i="USDC";else if("SUSDT-FUTURES"===o)i="SUSDT";else if("SUSDC-FUTURES"===o)i="SUSDC";else if(("SCOIN-FUTURES"===o||"COIN-FUTURES"===o)&&void 0===i)throw new r.ArgumentsRequired(this.id+" fetchPositions() requires a marginCoin parameter that matches the productType");n.marginCoin=i,d=await this.privateMixGetV2MixPositionAllPosition(this.extend(n,t))}else h=!0,void 0!==a&&(n.symbol=a.id),d=await this.privateMixGetV2MixPositionHistoryPosition(this.extend(n,t));let c=[];if(h){const e=this.safeDict(d,"data",{});c=this.safeList(e,"list",[])}else c=this.safeList(d,"data",[]);const l=[];for(let e=0;e0)throw new r.BadRequest(this.id+" reduceMargin() amount parameter must be a negative value");if(void 0===this.safeString(i,"holdSide"))throw new r.ArgumentsRequired(this.id+" reduceMargin() requires a holdSide parameter, either long or short");return await this.modifyMarginHelper(e,t,"reduce",i)}async addMargin(e,t,i={}){if(void 0===this.safeString(i,"holdSide"))throw new r.ArgumentsRequired(this.id+" addMargin() requires a holdSide parameter, either long or short");return await this.modifyMarginHelper(e,t,"add",i)}async fetchLeverage(e,t={}){await this.loadMarkets();const i=this.market(e);let s;[s,t]=this.handleProductTypeAndParams(i,t);const r={symbol:i.id,marginCoin:i.settleId,productType:s},a=await this.privateMixGetV2MixAccountAccount(this.extend(r,t)),o=this.safeDict(a,"data",{});return this.parseLeverage(o,i)}parseLeverage(e,t=void 0){const i="crossed"===this.safeString(e,"marginMode"),s=i?"crossedMarginLeverage":"isolatedLongLever",r=i?"crossedMarginLeverage":"isolatedShortLever";return{info:e,symbol:t.symbol,marginMode:i?"cross":"isolated",longLeverage:this.safeInteger(e,s),shortLeverage:this.safeInteger(e,r)}}async setLeverage(e,t=void 0,i={}){if(void 0===t)throw new r.ArgumentsRequired(this.id+" setLeverage() requires a symbol argument");await this.loadMarkets();const s=this.market(t);let a;[a,i]=this.handleProductTypeAndParams(s,i);const o={symbol:s.id,leverage:this.numberToString(e)};let n,d;if([n,i]=this.handleOptionAndParams(i,"setLeverage","uta",!1),n){if("SPOT"===a){let e;[e,i]=this.handleMarginModeAndParams("fetchTrades",i),void 0!==e&&(a="MARGIN")}o.coin=s.settleId,o.category=a,d=await this.privateUtaPostV3AccountSetLeverage(this.extend(o,i))}else o.marginCoin=s.settleId,o.productType=a,d=await this.privateMixPostV2MixAccountSetLeverage(this.extend(o,i));return d}async setMarginMode(e,t=void 0,i={}){if(void 0===t)throw new r.ArgumentsRequired(this.id+" setMarginMode() requires a symbol argument");if("cross"===(e=e.toLowerCase())&&(e="crossed"),"isolated"!==e&&"crossed"!==e)throw new r.ArgumentsRequired(this.id+" setMarginMode() marginMode must be either isolated or crossed (cross)");await this.loadMarkets();const s=this.market(t);let a;[a,i]=this.handleProductTypeAndParams(s,i);const o={symbol:s.id,marginCoin:s.settleId,marginMode:e,productType:a};return await this.privateMixPostV2MixAccountSetMarginMode(this.extend(o,i))}async setPositionMode(e,t=void 0,i={}){await this.loadMarkets();const s=e?"hedge_mode":"one_way_mode",r={};let a,o,n,d;return void 0!==t&&(a=this.market(t)),[o,i]=this.handleProductTypeAndParams(a,i),[n,i]=this.handleOptionAndParams(i,"setPositionMode","uta",!1),n?(r.holdMode=s,d=await this.privateUtaPostV3AccountSetHoldMode(this.extend(r,i))):(r.posMode=s,r.productType=o,d=await this.privateMixPostV2MixAccountSetPositionMode(this.extend(r,i))),d}async fetchOpenInterest(e,t={}){await this.loadMarkets();const i=this.market(e);if(!i.contract)throw new r.BadRequest(this.id+" fetchOpenInterest() supports contract markets only");let s;[s,t]=this.handleProductTypeAndParams(i,t);const a={symbol:i.id};let o,n;[o,t]=this.handleOptionAndParams(t,"fetchOpenInterest","uta",!1),o?(a.category=s,n=await this.publicUtaGetV3MarketOpenInterest(this.extend(a,t))):(a.productType=s,n=await this.publicMixGetV2MixMarketOpenInterest(this.extend(a,t)));const d=this.safeDict(n,"data",{});return this.parseOpenInterest(d,i)}parseOpenInterest(e,t=void 0){const i=this.safeList2(e,"openInterestList","list",[]),s=this.safeInteger(e,"ts"),r=this.safeString(i[0],"symbol");return this.safeOpenInterest({symbol:this.safeSymbol(r,t,void 0,"contract"),openInterestAmount:this.safeNumber2(i[0],"size","openInterest"),openInterestValue:void 0,timestamp:s,datetime:this.iso8601(s),info:e},t)}async fetchTransfers(e=void 0,t=void 0,i=void 0,s={}){if(void 0===e)throw new r.ArgumentsRequired(this.id+" fetchTransfers() requires a code argument");let a;await this.loadMarkets(),[a,s]=this.handleMarketTypeAndParams("fetchTransfers",void 0,s);const o=this.safeString(s,"fromAccount",a);s=this.omit(s,"fromAccount");const n=this.safeValue(this.options,"accountsByType",{});a=this.safeString(n,o);const d=this.currency(e);let h={coin:d.id,fromType:a};void 0!==t&&(h.startTime=t),void 0!==i&&(h.limit=i),[h,s]=this.handleUntilOption("endTime",h,s);const c=await this.privateSpotGetV2SpotAccountTransferRecords(this.extend(h,s)),l=this.safeList(c,"data",[]);return this.parseTransfers(l,d,t,i)}async transfer(e,t,i,s,r={}){await this.loadMarkets();const a=this.currency(e),o=this.safeValue(this.options,"accountsByType",{}),n={fromType:this.safeString(o,i),toType:this.safeString(o,s),amount:t,coin:a.id},d=this.safeString(r,"symbol");let h;r=this.omit(r,"symbol"),void 0!==d&&(h=this.market(d),n.symbol=h.id);const c=await this.privateSpotPostV2SpotWalletTransfer(this.extend(n,r)),l=this.safeValue(c,"data",{});return l.ts=this.safeInteger(c,"requestTime"),this.parseTransfer(l,a)}parseTransfer(e,t=void 0){const i=this.safeInteger(e,"ts"),s=this.safeStringLower(e,"status"),r=this.safeString(e,"coin"),a=this.safeString(e,"fromType"),o=this.safeValue(this.options,"accountsById",{}),n=this.safeString(o,a,a),d=this.safeString(e,"toType"),h=this.safeString(o,d,d);return{info:e,id:this.safeString(e,"transferId"),timestamp:i,datetime:this.iso8601(i),currency:this.safeCurrencyCode(r,t),amount:this.safeNumber(e,"size"),fromAccount:n,toAccount:h,status:this.parseTransferStatus(s)}}parseTransferStatus(e){return this.safeString({successful:"ok"},e,e)}parseDepositWithdrawFee(e,t=void 0){const i=this.safeValue(e,"chains",[]),s=i.length,r={info:e,withdraw:{fee:void 0,percentage:void 0},deposit:{fee:void 0,percentage:void 0},networks:{}};for(let e=0;e0&&(r=this.market(e[0]),d.symbol=r.id)}void 0!==t&&(d.startTime=t),void 0!==i&&(d.limit=i),[d,s]=this.handleUntilOption("endTime",d,s),[a,s]=this.handleProductTypeAndParams(r,s),[o,s]=this.handleOptionAndParams(s,"fetchPositionsHistory","uta",!1),o?(d.category=a,n=await this.privateUtaGetV3PositionHistoryPosition(this.extend(d,s))):n=await this.privateMixGetV2MixPositionHistoryPosition(this.extend(d,s));const h=this.safeDict(n,"data",{}),c=this.safeList(h,"list",[]),l=this.parsePositions(c,e,s);return this.filterBySinceLimit(l,t,i)}async fetchConvertQuote(e,t,i=void 0,s={}){await this.loadMarkets();const r={fromCoin:e,toCoin:t,fromCoinSize:this.numberToString(i)},a=await this.privateConvertGetV2ConvertQuotedPrice(this.extend(r,s)),o=this.safeDict(a,"data",{}),n=this.safeString(o,"fromCoin",e),d=this.currency(n),h=this.safeString(o,"toCoin",t),c=this.currency(h);return this.parseConversion(o,d,c)}async createConvertTrade(e,t,i,s=void 0,a={}){await this.loadMarkets();const o=this.safeString2(a,"price","cnvtPrice");if(void 0===o)throw new r.ArgumentsRequired(this.id+" createConvertTrade() requires a price parameter");const n=this.safeString2(a,"toAmount","toCoinSize");if(void 0===n)throw new r.ArgumentsRequired(this.id+" createConvertTrade() requires a toAmount parameter");a=this.omit(a,["price","toAmount"]);const d={traceId:e,fromCoin:t,toCoin:i,fromCoinSize:this.numberToString(s),toCoinSize:n,cnvtPrice:o},h=await this.privateConvertPostV2ConvertTrade(this.extend(d,a)),c=this.safeDict(h,"data",{}),l=this.safeString(c,"toCoin",i),u=this.currency(l);return this.parseConversion(c,void 0,u)}async fetchConvertTradeHistory(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();const r={},a=this.milliseconds();r.startTime=void 0!==t?t:a-864e5;const o=this.safeString2(s,"endTime","until");r.endTime=void 0!==o?o:a,void 0!==i&&(r.limit=i),s=this.omit(s,"until");const n=await this.privateConvertGetV2ConvertConvertRecord(this.extend(r,s)),d=this.safeDict(n,"data",{}),h=this.safeList(d,"dataList",[]);return this.parseConversions(h,e,"fromCoin","toCoin",t,i)}parseConversion(e,t=void 0,i=void 0){const s=this.safeInteger(e,"ts"),r=this.safeString(e,"fromCoin"),a=this.safeCurrencyCode(r,t),o=this.safeString(e,"toCoin"),n=this.safeCurrencyCode(o,i);return{info:e,timestamp:s,datetime:this.iso8601(s),id:this.safeString2(e,"id","traceId"),fromCurrency:a,fromAmount:this.safeNumber(e,"fromCoinSize"),toCurrency:n,toAmount:this.safeNumber(e,"toCoinSize"),price:this.safeNumber(e,"cnvtPrice"),fee:this.safeNumber(e,"fee")}}async fetchConvertCurrencies(e={}){await this.loadMarkets();const t=await this.privateConvertGetV2ConvertCurrencies(e),i={},s=this.safeList(t,"data",[]);for(let e=0;e0&&(c=c+"?"+this.urlencode(l))}if(o){this.checkRequiredCredentials();const e=this.nonce().toString();let t=e+i+h;if("POST"===i)t+=a=this.json(s);else if(Object.keys(s).length){let e="?"+this.urlencode(this.keysort(s));e.indexOf("%24")>-1&&(e=e.replace("%24","$")),c+=e,t+=e}const o=this.hmac(this.encode(t),this.encode(this.secret),n.s,"base64"),d=this.safeString(this.options,"broker");r={"ACCESS-KEY":this.apiKey,"ACCESS-SIGN":o,"ACCESS-TIMESTAMP":e,"ACCESS-PASSPHRASE":this.password,"X-CHANNEL-API-CODE":d},"POST"===i&&(r["Content-Type"]="application/json")}if(this.safeBool2(this.options,"sandboxMode","sandbox",!1)&&"v2/public/time"!==e&&"v3/market/current-fund-rate"!==e){void 0===r&&(r={});const e=this.safeString(s,"productType");"SCOIN-FUTURES"!==e&&"SUSDT-FUTURES"!==e&&"SUSDC-FUTURES"!==e&&(r.PAPTRADING="1")}return{url:c,method:i,body:a,headers:r}}}},357:(e,t,i)=>{i.d(t,{A:()=>d});var s=i(3974),r=i(2079),a=i(5147),o=i(1579),n=i(7481);class d extends s.A{describe(){return this.deepExtend(super.describe(),{id:"bithumb",name:"Bithumb",countries:["KR"],rateLimit:500,pro:!0,has:{CORS:!0,spot:!0,margin:!1,swap:!1,future:!1,option:!1,addMargin:!1,borrowCrossMargin:!1,borrowIsolatedMargin:!1,borrowMargin:!1,cancelOrder:!0,closeAllPositions:!1,closePosition:!1,createMarketOrder:!0,createOrder:!0,createOrderWithTakeProfitAndStopLoss:!1,createOrderWithTakeProfitAndStopLossWs:!1,createReduceOnlyOrder:!1,fetchBalance:!0,fetchBorrowInterest:!1,fetchBorrowRate:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchBorrowRates:!1,fetchBorrowRatesPerSymbol:!1,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchFundingHistory:!1,fetchFundingInterval:!1,fetchFundingIntervals:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchGreeks:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchIsolatedPositions:!1,fetchLeverage:!1,fetchLeverages:!1,fetchLeverageTiers:!1,fetchLiquidations:!1,fetchLongShortRatio:!1,fetchLongShortRatioHistory:!1,fetchMarginAdjustmentHistory:!1,fetchMarginMode:!1,fetchMarginModes:!1,fetchMarketLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMarkPrices:!1,fetchMyLiquidations:!1,fetchMySettlementHistory:!1,fetchOHLCV:!0,fetchOpenInterest:!1,fetchOpenInterestHistory:!1,fetchOpenInterests:!1,fetchOpenOrders:!0,fetchOption:!1,fetchOptionChain:!1,fetchOrder:!0,fetchOrderBook:!0,fetchPosition:!1,fetchPositionHistory:!1,fetchPositionMode:!1,fetchPositions:!1,fetchPositionsForSymbol:!1,fetchPositionsHistory:!1,fetchPositionsRisk:!1,fetchPremiumIndexOHLCV:!1,fetchSettlementHistory:!1,fetchTicker:!0,fetchTickers:!0,fetchTrades:!0,fetchTransfer:!1,fetchTransfers:!1,fetchVolatilityHistory:!1,reduceMargin:!1,repayCrossMargin:!1,repayIsolatedMargin:!1,setLeverage:!1,setMargin:!1,setMarginMode:!1,setPositionMode:!1,transfer:!1,withdraw:!0},hostname:"bithumb.com",urls:{logo:"https://github.com/user-attachments/assets/c9e0eefb-4777-46b9-8f09-9d7f7c4af82d",api:{public:"https://api.{hostname}/public",private:"https://api.{hostname}"},www:"https://www.bithumb.com",doc:"https://apidocs.bithumb.com",fees:"https://en.bithumb.com/customer_support/info_fee"},api:{public:{get:["ticker/ALL_{quoteId}","ticker/{baseId}_{quoteId}","orderbook/ALL_{quoteId}","orderbook/{baseId}_{quoteId}","transaction_history/{baseId}_{quoteId}","network-info","assetsstatus/multichain/ALL","assetsstatus/multichain/{currency}","withdraw/minimum/ALL","withdraw/minimum/{currency}","assetsstatus/ALL","assetsstatus/{baseId}","candlestick/{baseId}_{quoteId}/{interval}"]},private:{post:["info/account","info/balance","info/wallet_address","info/ticker","info/orders","info/user_transactions","info/order_detail","trade/place","trade/cancel","trade/btc_withdrawal","trade/krw_deposit","trade/krw_withdrawal","trade/market_buy","trade/market_sell","trade/stop_limit"]}},fees:{trading:{maker:this.parseNumber("0.0025"),taker:this.parseNumber("0.0025")}},precisionMode:o.v,features:{spot:{sandbox:!1,createOrder:{marginMode:!1,triggerPrice:!1,triggerPriceType:void 0,triggerDirection:!1,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!1,FOK:!1,PO:!1,GTD:!1},hedged:!1,trailing:!1,leverage:!1,marketBuyRequiresPrice:!1,marketBuyByCost:!1,selfTradePrevention:!1,iceberg:!1},createOrders:void 0,fetchMyTrades:void 0,fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!0},fetchOpenOrders:{marginMode:!1,limit:1e3,trigger:!1,trailing:!1,symbolRequired:!0},fetchOrders:void 0,fetchClosedOrders:void 0,fetchOHLCV:{limit:1e3}},swap:{linear:void 0,inverse:void 0},future:{linear:void 0,inverse:void 0}},exceptions:{"Bad Request(SSL)":r.BadRequest,"Bad Request(Bad Method)":r.BadRequest,"Bad Request.(Auth Data)":r.AuthenticationError,"Not Member":r.AuthenticationError,"Invalid Apikey":r.AuthenticationError,"Method Not Allowed.(Access IP)":r.PermissionDenied,"Method Not Allowed.(BTC Adress)":r.InvalidAddress,"Method Not Allowed.(Access)":r.PermissionDenied,"Database Fail":r.ExchangeNotAvailable,"Invalid Parameter":r.BadRequest,5600:r.ExchangeError,"Unknown Error":r.ExchangeError,"After May 23th, recent_transactions is no longer, hence users will not be able to connect to recent_transactions":r.ExchangeError},timeframes:{"1m":"1m","3m":"3m","5m":"5m","10m":"10m","30m":"30m","1h":"1h","6h":"6h","12h":"12h","1d":"24h"},options:{quoteCurrencies:{BTC:{limits:{cost:{min:2e-4,max:100}}},KRW:{limits:{cost:{min:500,max:5e9}}}}},commonCurrencies:{ALT:"ArchLoot",FTC:"FTC2",SOC:"Soda Coin"}})}safeMarket(e=void 0,t=void 0,i=void 0,s=void 0){return super.safeMarket(e,t,i,"spot")}amountToPrecision(e,t){return this.decimalToPrecision(t,o.R3,this.markets[e].precision.amount,o.fv)}async fetchMarkets(e={}){const t=[],i=this.safeDict(this.options,"quoteCurrencies",{}),s=Object.keys(i),r=[];for(let t=0;t1){const e=t[0];let s=t[1];s.length<8&&(s="0"+s),i=this.parse8601(e+" "+s)}else i=this.safeIntegerProduct(e,"transaction_date",.001)}void 0!==i&&(i-=324e5);let r=this.safeString(e,"type");r="ask"===r?"sell":"buy";const a=this.safeString(e,"cont_no");t=this.safeMarket(void 0,t);const o=this.safeString(e,"price"),n=this.fixCommaNumber(this.safeString2(e,"units_traded","units")),d=this.safeString(e,"total");let h;const c=this.safeString(e,"fee");if(void 0!==c){const t=this.safeString(e,"fee_currency");h={cost:c,currency:this.commonCurrencyCode(t)}}return this.safeTrade({id:a,info:e,timestamp:i,datetime:this.iso8601(i),symbol:t.symbol,order:void 0,type:undefined,side:r,takerOrMaker:void 0,price:o,amount:n,cost:d,fee:h},t)}async fetchTrades(e,t=void 0,i=void 0,s={}){await this.loadMarkets();const r=this.market(e),a={baseId:r.baseId,quoteId:r.quoteId};void 0!==i&&(a.count=i);const o=await this.publicGetTransactionHistoryBaseIdQuoteId(this.extend(a,s)),n=this.safeList(o,"data",[]);return this.parseTrades(n,r,t,i)}async createOrder(e,t,i,s,a=void 0,o={}){await this.loadMarkets();const n=this.market(e),d={order_currency:n.id,payment_currency:n.quote,units:s};let h="privatePostTradePlace";"limit"===t?(d.price=a,d.type="buy"===i?"bid":"ask"):h="privatePostTradeMarket"+this.capitalize(i);const c=await this[h](this.extend(d,o)),l=this.safeString(c,"order_id");if(void 0===l)throw new r.InvalidOrder(this.id+" createOrder() did not return an order id");return this.safeOrder({info:c,symbol:e,type:t,side:i,id:l},n)}async fetchOrder(e,t=void 0,i={}){if(void 0===t)throw new r.ArgumentsRequired(this.id+" fetchOrder() requires a symbol argument");await this.loadMarkets();const s=this.market(t),a={order_id:e,count:1,order_currency:s.base,payment_currency:s.quote},o=await this.privatePostInfoOrderDetail(this.extend(a,i)),n=this.safeDict(o,"data");return this.parseOrder(this.extend(n,{order_id:e}),s)}parseOrderStatus(e){return this.safeString({Pending:"open",Completed:"closed",Cancel:"canceled"},e,e)}parseOrder(e,t=void 0){const i=this.safeIntegerProduct(e,"order_date",.001),s="bid"===this.safeString2(e,"type","side")?"buy":"sell",r=this.parseOrderStatus(this.safeString(e,"order_status")),o=this.safeString2(e,"order_price","price");let n="limit";a.Y.stringEquals(o,"0")&&(n="market");const d=this.fixCommaNumber(this.safeString2(e,"order_qty","units"));let h,c=this.fixCommaNumber(this.safeString(e,"units_remaining"));void 0===c&&("closed"===r?c="0":"canceled"!==r&&(c=d));const l=this.safeString(e,"order_currency"),u=this.safeString(e,"payment_currency"),f=this.safeCurrencyCode(l),p=this.safeCurrencyCode(u);void 0!==f&&void 0!==p&&(h=f+"/"+p),void 0===h&&(h=(t=this.safeMarket(void 0,t)).symbol);const m=this.safeString(e,"order_id"),g=this.safeList(e,"contract",[]);return this.safeOrder({info:e,id:m,clientOrderId:void 0,timestamp:i,datetime:this.iso8601(i),lastTradeTimestamp:void 0,symbol:h,type:n,timeInForce:void 0,postOnly:void 0,side:s,price:o,triggerPrice:void 0,amount:d,cost:void 0,average:void 0,filled:void 0,remaining:c,status:r,fee:void 0,trades:g},t)}async fetchOpenOrders(e=void 0,t=void 0,i=void 0,s={}){if(void 0===e)throw new r.ArgumentsRequired(this.id+" fetchOpenOrders() requires a symbol argument");await this.loadMarkets();const a=this.market(e);void 0===i&&(i=100);const o={count:i,order_currency:a.base,payment_currency:a.quote};void 0!==t&&(o.after=t);const n=await this.privatePostInfoOrders(this.extend(o,s)),d=this.safeList(n,"data",[]);return this.parseOrders(d,a,t,i)}async cancelOrder(e,t=void 0,i={}){if(void 0===t)throw new r.ArgumentsRequired(this.id+" cancelOrder() requires a symbol argument");if(!("side"in i))throw new r.ArgumentsRequired(this.id+" cancelOrder() requires a `side` parameter (sell or buy)");const s=this.market(t),a="buy"===i.side?"bid":"ask";i=this.omit(i,["side","currency"]);const o={order_id:e,type:a,order_currency:s.base,payment_currency:s.quote},n=await this.privatePostTradeCancel(this.extend(o,i));return this.safeOrder({info:n})}async cancelUnifiedOrder(e,t={}){const i={side:e.side};return await this.cancelOrder(e.id,e.symbol,this.extend(i,t))}async withdraw(e,t,i,s=void 0,a={}){[s,a]=this.handleWithdrawTagAndParams(s,a),this.checkAddress(i),await this.loadMarkets();const o=this.currency(e),n={units:t,address:i,currency:o.id};if("XRP"===e||"XMR"===e||"EOS"===e||"STEEM"===e||"TON"===e){const t=this.safeString(a,"destination");if(void 0===s&&void 0===t)throw new r.ArgumentsRequired(this.id+" "+e+" withdraw() requires a tag argument or an extra destination param");void 0!==s&&(n.destination=s)}const d=await this.privatePostTradeBtcWithdrawal(this.extend(n,a));return this.parseTransaction(d,o)}parseTransaction(e,t=void 0){return{id:void 0,txid:void 0,timestamp:void 0,datetime:void 0,network:void 0,addressFrom:void 0,address:void 0,addressTo:void 0,amount:void 0,type:void 0,currency:(t=this.safeCurrency(void 0,t)).code,status:void 0,updated:void 0,tagFrom:void 0,tag:void 0,tagTo:void 0,comment:void 0,internal:void 0,fee:void 0,info:e}}fixCommaNumber(e){if(void 0===e)return;let t=e;for(;t.indexOf(",")>-1;)t=t.replace(",","");return t}nonce(){return this.milliseconds()}sign(e,t="public",i="GET",s={},r=void 0,a=void 0){const o="/"+this.implodeParams(e,s);let d=this.implodeHostname(this.urls.api[t])+o;const h=this.omit(s,this.extractParams(e));if("public"===t)Object.keys(h).length&&(d+="?"+this.urlencode(h));else{this.checkRequiredCredentials(),a=this.urlencode(this.extend({endpoint:o},h));const e=this.nonce().toString(),t=o+"\0"+a+"\0"+e,i=this.hmac(this.encode(t),this.encode(this.secret),n.Zf),s=this.stringToBase64(i);r={Accept:"application/json","Content-Type":"application/x-www-form-urlencoded","Api-Key":this.apiKey,"Api-Sign":s,"Api-Nonce":e}}return{url:d,method:i,body:a,headers:r}}handleErrors(e,t,i,s,a,o,n,d,h){if(void 0!==n&&"status"in n){const e=this.safeString(n,"status"),t=this.safeString(n,"message");if(void 0!==e){if("0000"===e)return;if("거래 진행중인 내역이 존재하지 않습니다."===t)return;const i=this.id+" "+t;throw this.throwExactlyMatchedException(this.exceptions,e,i),this.throwExactlyMatchedException(this.exceptions,t,i),new r.ExchangeError(i)}}}}},4456:(e,t,i)=>{i.d(t,{A:()=>r});var s=i(6555);class r extends s.A{describe(){return this.deepExtend(super.describe(),{id:"bitimen",name:"Bitimen",countries:["IR"],rateLimit:1e3,version:"1",certified:!1,pro:!1,has:{CORS:void 0,spot:!0,margin:!1,swap:!1,future:!1,option:!1,addMargin:!1,cancelAllOrders:!1,cancelOrder:!1,cancelOrders:!1,createDepositAddress:!1,createOrder:!1,createStopLimitOrder:!1,createStopMarketOrder:!1,createStopOrder:!1,editOrder:!1,fetchBalance:!1,fetchBorrowInterest:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchClosedOrders:!1,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!1,fetchDepositAddress:!1,fetchDeposits:!1,fetchFundingHistory:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchL2OrderBook:!1,fetchL3OrderBook:!1,fetchLedger:!1,fetchLedgerEntry:!1,fetchLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMyTrades:!1,fetchOHLCV:!0,fetchOpenInterestHistory:!1,fetchOpenOrders:!1,fetchOrder:!1,fetchOrderBook:!0,fetchOrders:!1,fetchOrderTrades:"emulated",fetchPositions:!1,fetchPremiumIndexOHLCV:!1,fetchTicker:!0,fetchTickers:!0,fetchTime:!1,fetchTrades:!1,fetchTradingFee:!1,fetchTradingFees:!1,fetchWithdrawals:!1,setLeverage:!1,setMarginMode:!1,transfer:!1,withdraw:!1},comment:"This comment is optional",urls:{logo:"https://cdn.arz.digital/cr-odin/img/exchanges/bitimen/64x64.png",api:{public:"https://api.bitimen.com"},www:"https://bitimen.com",doc:["https://bitimen.com"]},timeframes:{"1h":"60","3h":"180","6h":"360","12h":"720","1d":"1440"},api:{public:{get:{"api/market/stats":1,"api/orderbook/depth":1,"api/kline/history":1}}},fees:{trading:{tierBased:!1,percentage:!0,maker:this.parseNumber("0.001"),taker:this.parseNumber("0.001")}}})}async fetchMarkets(e={}){const t=await this.publicGetApiMarketStats(e),i=Object.keys(t),s=[];for(let e=0;e{i.d(t,{A:()=>r});var s=i(5537);class r extends s.A{describe(){return this.deepExtend(super.describe(),{id:"bitir",name:"Bit.ir",countries:["IR"],rateLimit:1e3,version:"1",certified:!1,pro:!1,has:{CORS:void 0,spot:!0,margin:!1,swap:!1,future:!1,option:!1,addMargin:!1,cancelAllOrders:!1,cancelOrder:!1,cancelOrders:!1,createDepositAddress:!1,createOrder:!1,createStopLimitOrder:!1,createStopMarketOrder:!1,createStopOrder:!1,editOrder:!1,fetchBalance:!1,fetchBorrowInterest:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchClosedOrders:!1,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!1,fetchDepositAddress:!1,fetchDeposits:!1,fetchFundingHistory:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchL2OrderBook:!1,fetchLedger:!1,fetchLedgerEntry:!1,fetchLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMyTrades:!1,fetchOHLCV:!0,fetchOpenInterestHistory:!1,fetchOpenOrders:!1,fetchOrder:!1,fetchOrderBook:!0,fetchOrders:!1,fetchOrderTrades:"emulated",fetchPositions:!1,fetchPremiumIndexOHLCV:!1,fetchTicker:!0,fetchTickers:!0,fetchTime:!1,fetchTrades:!1,fetchTradingFee:!1,fetchTradingFees:!1,fetchWithdrawals:!1,setLeverage:!1,setMarginMode:!1,transfer:!1,withdraw:!1},comment:"This comment is optional",urls:{logo:"https://iranbroker.net/wp-content/uploads/2023/05/bit.ir-logo-png.png",api:{public:"https://api.bit.ir"},www:"https://www.bit.ir",doc:["https://www.bit.ir"]},timeframes:{"1h":"60","3h":"180","6h":"360","12h":"720","1d":"1D","2d":"2D","3d":"3D","1w":"1W","1M":"1M"},api:{public:{get:{"v1/market":1,"v2/udf/real/history":1,"v1/market/{id}/order":1}}},commonCurrencies:{IRR:"IRT"},fees:{trading:{tierBased:!1,percentage:!0,maker:this.parseNumber("0.001"),taker:this.parseNumber("0.001")}}})}async fetchMarkets(e={}){const t=await this.publicGetV1Market(),i=this.safeList(t,"data"),s=[];for(let e=0;e{i.d(t,{A:()=>d});var s=i(1466),r=i(2079),a=i(5147),o=i(1579),n=i(4852);class d extends s.A{describe(){return this.deepExtend(super.describe(),{id:"bitmart",name:"BitMart",countries:["US","CN","HK","KR"],rateLimit:33.34,version:"v2",certified:!0,pro:!0,has:{CORS:void 0,spot:!0,margin:!0,swap:!0,future:!1,option:!1,borrowCrossMargin:!1,borrowIsolatedMargin:!0,cancelAllOrders:!0,cancelOrder:!0,cancelOrders:!0,createMarketBuyOrderWithCost:!0,createMarketOrderWithCost:!1,createMarketSellOrderWithCost:!1,createOrder:!0,createOrders:!0,createPostOnlyOrder:!0,createReduceOnlyOrder:!0,createStopLimitOrder:!1,createStopMarketOrder:!1,createStopOrder:!1,createTrailingPercentOrder:!0,fetchBalance:!0,fetchBorrowInterest:!0,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchCanceledOrders:!0,fetchClosedOrders:!0,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!0,fetchDeposit:!0,fetchDepositAddress:!0,fetchDepositAddresses:!1,fetchDepositAddressesByNetwork:!1,fetchDeposits:!0,fetchDepositWithdrawFee:!0,fetchDepositWithdrawFees:!1,fetchFundingHistory:!0,fetchFundingRate:!0,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchIsolatedBorrowRate:!0,fetchIsolatedBorrowRates:!0,fetchLedger:!0,fetchLiquidations:!1,fetchMarginMode:!1,fetchMarkets:!0,fetchMarkOHLCV:!0,fetchMyLiquidations:!0,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenInterest:!0,fetchOpenInterestHistory:!1,fetchOpenOrders:!0,fetchOrder:!0,fetchOrderBook:!0,fetchOrders:!1,fetchOrderTrades:!0,fetchPosition:!0,fetchPositionMode:!0,fetchPositions:!0,fetchStatus:!0,fetchTicker:!0,fetchTickers:!0,fetchTime:!0,fetchTrades:!0,fetchTradingFee:!0,fetchTradingFees:!1,fetchTransactionFee:!0,fetchTransactionFees:!1,fetchTransfer:!1,fetchTransfers:!0,fetchWithdrawAddresses:!0,fetchWithdrawAddressesByNetwork:!1,fetchWithdrawal:!0,fetchWithdrawals:!0,reduceMargin:!1,repayCrossMargin:!1,repayIsolatedMargin:!0,setLeverage:!0,setMarginMode:!1,setPositionMode:!0,transfer:!0,withdraw:!0},hostname:"bitmart.com",urls:{logo:"https://github.com/user-attachments/assets/0623e9c4-f50e-48c9-82bd-65c3908c3a14",api:{spot:"https://api-cloud.{hostname}",swap:"https://api-cloud-v2.{hostname}"},www:"https://www.bitmart.com/",doc:"https://developer-pro.bitmart.com/",referral:{url:"http://www.bitmart.com/?r=rQCFLh",discount:.3},fees:"https://www.bitmart.com/fee/en"},requiredCredentials:{apiKey:!0,secret:!0,uid:!0},api:{public:{get:{"system/time":3,"system/service":3,"spot/v1/currencies":7.5,"spot/v1/symbols":7.5,"spot/v1/symbols/details":5,"spot/quotation/v3/tickers":6,"spot/quotation/v3/ticker":4,"spot/quotation/v3/lite-klines":5,"spot/quotation/v3/klines":7,"spot/quotation/v3/books":4,"spot/quotation/v3/trades":4,"spot/v1/ticker":5,"spot/v2/ticker":30,"spot/v1/ticker_detail":5,"spot/v1/steps":30,"spot/v1/symbols/kline":6,"spot/v1/symbols/book":5,"spot/v1/symbols/trades":5,"contract/v1/tickers":15,"contract/public/details":5,"contract/public/depth":5,"contract/public/open-interest":30,"contract/public/funding-rate":30,"contract/public/funding-rate-history":30,"contract/public/kline":6,"account/v1/currencies":30,"contract/public/markprice-kline":5}},private:{get:{"account/sub-account/v1/transfer-list":7.5,"account/sub-account/v1/transfer-history":7.5,"account/sub-account/main/v1/wallet":5,"account/sub-account/main/v1/subaccount-list":7.5,"account/contract/sub-account/main/v1/wallet":5,"account/contract/sub-account/main/v1/transfer-list":7.5,"account/contract/sub-account/v1/transfer-history":7.5,"account/v1/wallet":5,"account/v1/currencies":30,"spot/v1/wallet":5,"account/v1/deposit/address":30,"account/v1/withdraw/charge":32,"account/v2/deposit-withdraw/history":7.5,"account/v1/deposit-withdraw/detail":7.5,"account/v1/withdraw/address/list":30,"spot/v1/order_detail":1,"spot/v2/orders":5,"spot/v1/trades":5,"spot/v2/trades":4,"spot/v3/orders":5,"spot/v2/order_detail":1,"spot/v1/margin/isolated/borrow_record":1,"spot/v1/margin/isolated/repay_record":1,"spot/v1/margin/isolated/pairs":30,"spot/v1/margin/isolated/account":5,"spot/v1/trade_fee":30,"spot/v1/user_fee":30,"spot/v1/broker/rebate":1,"contract/private/assets-detail":5,"contract/private/order":1.2,"contract/private/order-history":10,"contract/private/position":10,"contract/private/position-v2":10,"contract/private/get-open-orders":1.2,"contract/private/current-plan-order":1.2,"contract/private/trades":10,"contract/private/position-risk":10,"contract/private/affilate/rebate-list":10,"contract/private/affilate/trade-list":10,"contract/private/transaction-history":10,"contract/private/get-position-mode":1},post:{"account/sub-account/main/v1/sub-to-main":30,"account/sub-account/sub/v1/sub-to-main":30,"account/sub-account/main/v1/main-to-sub":30,"account/sub-account/sub/v1/sub-to-sub":30,"account/sub-account/main/v1/sub-to-sub":30,"account/contract/sub-account/main/v1/sub-to-main":7.5,"account/contract/sub-account/main/v1/main-to-sub":7.5,"account/contract/sub-account/sub/v1/sub-to-main":7.5,"account/v1/withdraw/apply":7.5,"spot/v1/submit_order":1,"spot/v1/batch_orders":1,"spot/v2/cancel_order":1,"spot/v1/cancel_orders":15,"spot/v4/query/order":1,"spot/v4/query/client-order":1,"spot/v4/query/open-orders":5,"spot/v4/query/history-orders":5,"spot/v4/query/trades":5,"spot/v4/query/order-trades":5,"spot/v4/cancel_orders":3,"spot/v4/cancel_all":90,"spot/v4/batch_orders":3,"spot/v3/cancel_order":1,"spot/v2/batch_orders":1,"spot/v2/submit_order":1,"spot/v1/margin/submit_order":1.5,"spot/v1/margin/isolated/borrow":30,"spot/v1/margin/isolated/repay":30,"spot/v1/margin/isolated/transfer":30,"account/v1/transfer-contract-list":60,"account/v1/transfer-contract":60,"contract/private/submit-order":2.5,"contract/private/cancel-order":1.5,"contract/private/cancel-orders":30,"contract/private/submit-plan-order":2.5,"contract/private/cancel-plan-order":1.5,"contract/private/submit-leverage":2.5,"contract/private/submit-tp-sl-order":2.5,"contract/private/modify-plan-order":2.5,"contract/private/modify-preset-plan-order":2.5,"contract/private/modify-limit-order":2.5,"contract/private/modify-tp-sl-order":2.5,"contract/private/submit-trail-order":2.5,"contract/private/cancel-trail-order":1.5,"contract/private/set-position-mode":1}}},timeframes:{"1m":1,"3m":3,"5m":5,"15m":15,"30m":30,"45m":45,"1h":60,"2h":120,"3h":180,"4h":240,"1d":1440,"1w":10080,"1M":43200},fees:{trading:{tierBased:!0,percentage:!0,taker:this.parseNumber("0.0040"),maker:this.parseNumber("0.0035"),tiers:{taker:[[this.parseNumber("0"),this.parseNumber("0.0020")],[this.parseNumber("10"),this.parseNumber("0.18")],[this.parseNumber("50"),this.parseNumber("0.0016")],[this.parseNumber("250"),this.parseNumber("0.0014")],[this.parseNumber("1000"),this.parseNumber("0.0012")],[this.parseNumber("5000"),this.parseNumber("0.0010")],[this.parseNumber("25000"),this.parseNumber("0.0008")],[this.parseNumber("50000"),this.parseNumber("0.0006")]],maker:[[this.parseNumber("0"),this.parseNumber("0.001")],[this.parseNumber("10"),this.parseNumber("0.0009")],[this.parseNumber("50"),this.parseNumber("0.0008")],[this.parseNumber("250"),this.parseNumber("0.0007")],[this.parseNumber("1000"),this.parseNumber("0.0006")],[this.parseNumber("5000"),this.parseNumber("0.0005")],[this.parseNumber("25000"),this.parseNumber("0.0004")],[this.parseNumber("50000"),this.parseNumber("0.0003")]]}}},precisionMode:o.kb,exceptions:{exact:{3e4:r.ExchangeError,30001:r.AuthenticationError,30002:r.AuthenticationError,30003:r.AccountSuspended,30004:r.AuthenticationError,30005:r.AuthenticationError,30006:r.AuthenticationError,30007:r.AuthenticationError,30008:r.AuthenticationError,30010:r.PermissionDenied,30011:r.AuthenticationError,30012:r.AuthenticationError,30013:r.RateLimitExceeded,30014:r.ExchangeNotAvailable,30016:r.OnMaintenance,30017:r.RateLimitExceeded,30018:r.BadRequest,30019:r.PermissionDenied,6e4:r.BadRequest,60001:r.BadRequest,60002:r.BadRequest,60003:r.ExchangeError,60004:r.ExchangeError,60005:r.ExchangeError,60006:r.ExchangeError,60007:r.InvalidAddress,60008:r.InsufficientFunds,60009:r.ExchangeError,60010:r.ExchangeError,60011:r.InvalidAddress,60012:r.ExchangeError,60020:r.PermissionDenied,60021:r.PermissionDenied,60022:r.PermissionDenied,60026:r.PermissionDenied,60027:r.PermissionDenied,60028:r.AccountSuspended,60029:r.AccountSuspended,60030:r.BadRequest,60031:r.BadRequest,60050:r.ExchangeError,60051:r.ExchangeError,61001:r.InsufficientFunds,61003:r.BadRequest,61004:r.BadRequest,61005:r.BadRequest,61006:r.NotSupported,61007:r.ExchangeError,61008:r.ExchangeError,7e4:r.ExchangeError,70001:r.BadRequest,70002:r.BadSymbol,70003:r.NetworkError,71001:r.BadRequest,71002:r.BadRequest,71003:r.BadRequest,71004:r.BadRequest,71005:r.BadRequest,5e4:r.BadRequest,50001:r.BadSymbol,50002:r.BadRequest,50003:r.BadRequest,50004:r.BadRequest,50005:r.OrderNotFound,50006:r.InvalidOrder,50007:r.InvalidOrder,50008:r.InvalidOrder,50009:r.InvalidOrder,50010:r.InvalidOrder,50011:r.InvalidOrder,50012:r.InvalidOrder,50013:r.InvalidOrder,50014:r.BadRequest,50015:r.BadRequest,50016:r.BadRequest,50017:r.BadRequest,50018:r.BadRequest,50019:r.ExchangeError,50020:r.InsufficientFunds,50021:r.BadRequest,50022:r.ExchangeNotAvailable,50023:r.BadSymbol,50024:r.BadRequest,50025:r.BadRequest,50026:r.BadRequest,50027:r.BadRequest,50028:r.BadRequest,50029:r.InvalidOrder,50030:r.OrderNotFound,50031:r.OrderNotFound,50032:r.OrderNotFound,50033:r.InvalidOrder,50034:r.InvalidOrder,50035:r.InvalidOrder,50036:r.ExchangeError,50037:r.BadRequest,50038:r.BadRequest,50039:r.BadRequest,50040:r.BadSymbol,50041:r.ExchangeError,50042:r.BadRequest,51e3:r.BadSymbol,51001:r.ExchangeError,51002:r.ExchangeError,51003:r.ExchangeError,51004:r.InsufficientFunds,51005:r.InvalidOrder,51006:r.InvalidOrder,51007:r.BadRequest,51008:r.ExchangeError,51009:r.InvalidOrder,51010:r.InvalidOrder,51011:r.InvalidOrder,51012:r.InvalidOrder,51013:r.InvalidOrder,51014:r.InvalidOrder,51015:r.InvalidOrder,52e3:r.BadRequest,52001:r.BadRequest,52002:r.BadRequest,52003:r.BadRequest,52004:r.BadRequest,53e3:r.AccountSuspended,53001:r.AccountSuspended,53002:r.PermissionDenied,53003:r.PermissionDenied,53005:r.PermissionDenied,53006:r.PermissionDenied,53007:r.PermissionDenied,53008:r.PermissionDenied,53009:r.PermissionDenied,53010:r.PermissionDenied,57001:r.BadRequest,58001:r.BadRequest,59001:r.ExchangeError,59002:r.ExchangeError,59003:r.ExchangeError,59004:r.ExchangeError,59005:r.PermissionDenied,59006:r.ExchangeError,59007:r.ExchangeError,59008:r.ExchangeError,59009:r.ExchangeError,59010:r.InsufficientFunds,59011:r.ExchangeError,40001:r.ExchangeError,40002:r.ExchangeError,40003:r.ExchangeError,40004:r.ExchangeError,40005:r.ExchangeError,40006:r.PermissionDenied,40007:r.BadRequest,40008:r.InvalidNonce,40009:r.BadRequest,40010:r.BadRequest,40011:r.BadRequest,40012:r.ExchangeError,40013:r.ExchangeError,40014:r.BadSymbol,40015:r.BadSymbol,40016:r.InvalidOrder,40017:r.InvalidOrder,40018:r.InvalidOrder,40019:r.ExchangeError,40020:r.InvalidOrder,40021:r.ExchangeError,40022:r.ExchangeError,40023:r.ExchangeError,40024:r.ExchangeError,40025:r.ExchangeError,40026:r.ExchangeError,40027:r.InsufficientFunds,40028:r.PermissionDenied,40029:r.InvalidOrder,40030:r.InvalidOrder,40031:r.InvalidOrder,40032:r.InvalidOrder,40033:r.InvalidOrder,40034:r.BadSymbol,40035:r.OrderNotFound,40036:r.InvalidOrder,40037:r.OrderNotFound,40038:r.BadRequest,40039:r.BadRequest,40040:r.InvalidOrder,40041:r.InvalidOrder,40042:r.InvalidOrder,40043:r.InvalidOrder,40044:r.InvalidOrder,40045:r.InvalidOrder,40046:r.PermissionDenied,40047:r.PermissionDenied,40048:r.InvalidOrder,40049:r.InvalidOrder,40050:r.InvalidOrder},broad:{"You contract account available balance not enough":r.InsufficientFunds,"you contract account available balance not enough":r.InsufficientFunds}},commonCurrencies:{$GM:"GOLDMINER",$HERO:"Step Hero",$PAC:"PAC",BP:"BEYOND",GDT:"Gorilla Diamond",GLD:"Goldario",MVP:"MVP Coin",TRU:"Truebit"},options:{defaultNetworks:{USDT:"TRC20",BTC:"BTC",ETH:"ERC20"},timeDifference:0,adjustForTimeDifference:!1,networks:{ERC20:"ERC20",SOL:"SOL",BTC:"BTC",TRC20:"TRC20",OMNI:"OMNI",XLM:"XLM",EOS:"EOS",NEO:"NEO",BTM:"BTM",BCH:"BCH",LTC:"LTC",BSV:"BSV",XRP:"XRP",PLEX:"PLEX",XCH:"XCH",NEAR:"NEAR",FIO:"FIO",SCRT:"SCRT",IOTX:"IOTX",ALGO:"ALGO",ATOM:"ATOM",DOT:"DOT",ADA:"ADA",DOGE:"DOGE",XYM:"XYM",GLMR:"GLMR",MOVR:"MOVR",ZIL:"ZIL",INJ:"INJ",KSM:"KSM",ZEC:"ZEC",NAS:"NAS",POLYGON:"MATIC",HRC20:"HECO",XDC:"XDC",ONE:"ONE",LAT:"LAT",CSPR:"Casper",ICP:"Computer",XTZ:"XTZ",MINA:"MINA",BEP20:"BSC_BNB",THETA:"THETA",AKT:"AKT",AR:"AR",CELO:"CELO",FIL:"FIL",NULS:"NULS",ETC:"ETC",DASH:"DASH",DGB:"DGB",BEP2:"BEP2",GRIN:"GRIN",WAVES:"WAVES",ABBC:"ABBC",ACA:"ACA",QTUM:"QTUM",PAC:"PAC",TLOS:"TLOS",KARDIA:"KardiaChain",FUSE:"FUSE",TRC10:"TRC10",FIRO:"FIRO",FTM:"Fantom",EVER:"EVER",KAVA:"KAVA",HYDRA:"HYDRA",PLCU:"PLCU",BRISE:"BRISE",OPTIMISM:"OPTIMISM",REEF:"REEF",SYS:"SYS",VITE:"VITE",STX:"STX",SXP:"SXP",BITCI:"BITCI",XRD:"XRD",ASTR:"ASTAR",ZEN:"HORIZEN",LTO:"LTO",ETHW:"ETHW",ETHF:"ETHF",IOST:"IOST",APT:"APT",ONT:"ONT",EVMOS:"EVMOS",XMR:"XMR",OASYS:"OAS",OSMO:"OSMO",OMAX:"OMAX Chain",DESO:"DESO",BFIC:"BFIC",OHO:"OHO",CS:"CS",CHEQ:"CHEQ",NODL:"NODL",NEM:"XEM",FRA:"FRA",ERGO:"ERG"},networksById:{ETH:"ERC20",Ethereum:"ERC20",USDT:"OMNI",Bitcoin:"BTC"},defaultType:"spot",fetchBalance:{type:"spot"},accountsByType:{spot:"spot",swap:"swap"},createMarketBuyOrderRequiresPrice:!0,brokerId:"CCXTxBitmart000"},features:{default:{sandbox:!1,createOrder:{marginMode:!0,triggerPrice:!1,triggerPriceType:void 0,triggerDirection:!1,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!0,FOK:!1,PO:!0,GTD:!1},hedged:!1,trailing:!1,marketBuyRequiresPrice:!1,marketBuyByCost:!0,leverage:!0,selfTradePrevention:!1,iceberg:!1},createOrders:{max:10},fetchMyTrades:{marginMode:!0,limit:200,daysBack:void 0,untilDays:99999,symbolRequired:!1},fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!1},fetchOpenOrders:{marginMode:!0,limit:200,trigger:!1,trailing:!1,symbolRequired:!1},fetchOrders:void 0,fetchClosedOrders:{marginMode:!0,limit:200,daysBack:void 0,daysBackCanceled:void 0,untilDays:void 0,trigger:!1,trailing:!1,symbolRequired:!1},fetchOHLCV:{limit:1e3}},forDerivatives:{extends:"default",createOrder:{marginMode:!0,triggerPrice:!0,triggerPriceType:{last:!0,mark:!0,index:!1},triggerDirection:!0,stopLossPrice:!0,takeProfitPrice:!0,attachedStopLossTakeProfit:{triggerPriceType:{last:!0,mark:!0,index:!1},price:!1},timeInForce:{IOC:!0,FOK:!0,PO:!0,GTD:!1},hedged:!1,trailing:!0,marketBuyRequiresPrice:!0,marketBuyByCost:!0},fetchMyTrades:{marginMode:!0,limit:void 0,daysBack:void 0,untilDays:99999},fetchOrder:{marginMode:!1,trigger:!1,trailing:!0},fetchOpenOrders:{marginMode:!1,limit:100,trigger:!0,trailing:!1},fetchClosedOrders:{marginMode:!0,limit:200,daysBack:void 0,daysBackCanceled:void 0,untilDays:void 0,trigger:!1,trailing:!1},fetchOHLCV:{limit:500}},spot:{extends:"default"},swap:{linear:{extends:"forDerivatives"},inverse:{extends:"forDerivatives"}},future:{linear:void 0,inverse:void 0}}})}async fetchTime(e={}){const t=await this.publicGetSystemTime(e),i=this.safeDict(t,"data",{});return this.safeInteger(i,"server_time")}async fetchStatus(e={}){const t=this.safeDict(this.options,"fetchStatus",{}),i=this.safeString(this.options,"defaultType");let s=this.safeString(t,"type",i);s=this.safeString(e,"type",s),e=this.omit(e,"type");const r=await this.publicGetSystemService(e),a=this.safeDict(r,"data",{}),o=this.safeList(a,"service",[]),n=this.indexBy(o,"service_type");"swap"===s&&(s="contract");const d=this.safeString(n,s);let h,c;if(void 0!==d){2===this.safeInteger(d,"status")?h="ok":(h="maintenance",c=this.safeInteger(d,"end_time"))}return{status:h,updated:void 0,eta:c,url:void 0,info:r}}async fetchSpotMarkets(e={}){const t=await this.publicGetSpotV1SymbolsDetails(e),i=this.safeDict(t,"data",{}),s=this.safeList(i,"symbols",[]),r=[],o=this.fees.trading;for(let e=0;e=0;if(!n){const e=i.split("-");a=this.safeString(e,0);const t=this.safeString(e,1);void 0!==t&&(o=t.toUpperCase())}const d=this.safeCurrencyCode(a);let h=this.safeDict(r,d);void 0===h&&(h={info:t,id:a,code:d,precision:void 0,name:this.safeString(t,"name"),deposit:void 0,withdraw:void 0,active:void 0,networks:{},type:n?"other":"crypto"});const c=this.networkIdToCode(o),l=this.safeBool(t,"withdraw_enabled"),u=this.safeBool(t,"deposit_enabled");h.networks[c]={info:t,id:o,code:c,withdraw:l,deposit:u,active:l&&u,fee:this.safeNumber(t,"withdraw_fee"),limits:{withdraw:{min:this.safeNumber(t,"withdraw_minsize"),max:void 0},deposit:{min:void 0,max:void 0}}},r[d]=h}const a=Object.keys(r);for(let e=0;e0&&(t=this.safeValue(a,e[0]))}o=this.safeDict(t,"info",{}),s=this.safeString(o,"currency")}else{const i=this.safeDict(a,t);void 0!==i?(o=this.safeDict(i,"info",{}),s=this.safeString(o,"currency")):r+="-"+this.networkCodeToId(t,e)}return void 0!==s?s:r}async fetchTransactionFee(e,t={}){await this.loadMarkets();const i=this.currency(e);let s;[s,t]=this.handleNetworkCodeAndParams(t);const r={currency:this.getCurrencyIdFromCodeAndNetwork(i.code,s)},a=await this.privateGetAccountV1WithdrawCharge(this.extend(r,t)),o=a.data,n={};return n[e]=this.safeNumber(o,"withdraw_fee"),{info:a,withdraw:n,deposit:{}}}parseDepositWithdrawFee(e,t=void 0){return{info:e,withdraw:{fee:this.safeNumber(e,"withdraw_fee"),percentage:void 0},deposit:{fee:void 0,percentage:void 0},networks:{}}}async fetchDepositWithdrawFee(e,t={}){let i;await this.loadMarkets(),[i,t]=this.handleNetworkCodeAndParams(t);const s={currency:this.getCurrencyIdFromCodeAndNetwork(e,i)},r=(await this.privateGetAccountV1WithdrawCharge(this.extend(s,t))).data;return this.parseDepositWithdrawFee(r)}parseTicker(e,t=void 0){const i=this.safeList(e,"result",[]),s=this.safeString2(e,"avg_price","index_price");let r=this.safeString2(e,"symbol","contract_symbol"),o=this.safeInteger2(e,"timestamp","ts"),n=this.safeString2(e,"last_price","last"),d=this.safeString2(e,"price_change_percent_24h","change_24h"),h=this.safeString(e,"fluctuation"),c=this.safeString2(e,"high_24h","high_price"),l=this.safeString2(e,"low_24h","low_price"),u=this.safeString2(e,"best_bid","bid_px"),f=this.safeString2(e,"best_bid_size","bid_sz"),p=this.safeString2(e,"best_ask","ask_px"),m=this.safeString2(e,"best_ask_size","ask_sz"),g=this.safeString(e,"open_24h"),v=this.safeStringN(e,["base_volume_24h","v_24h","volume_24h"]),y=this.safeStringLowerN(e,["quote_volume_24h","qv_24h","turnover_24h"]);const w=this.safeString(i,0);void 0!==w&&(r=w,o=this.safeInteger(i,12),c=this.safeString(i,5),l=this.safeString(i,6),u=this.safeString(i,8),f=this.safeString(i,9),p=this.safeString(i,10),m=this.safeString(i,11),g=this.safeString(i,4),n=this.safeString(i,1),h=this.safeString(i,7),v=this.safeString(i,2),y=this.safeStringLower(i,3));const b=(t=this.safeMarket(r,t)).symbol;return void 0===o&&(o=this.safeIntegerProduct(e,"s_t",1e3)),void 0===d&&(d=a.Y.stringMul(h,"100")),void 0===y&&(void 0===v?y=this.safeString(e,"volume_24h",y):(y=v,v=void 0)),this.safeTicker({symbol:b,timestamp:o,datetime:this.iso8601(o),high:c,low:l,bid:u,bidVolume:f,ask:p,askVolume:m,vwap:void 0,open:g,close:n,last:n,previousClose:void 0,change:void 0,percentage:d,average:s,baseVolume:v,quoteVolume:y,indexPrice:this.safeString(e,"index_price"),info:e},t)}async fetchTicker(e,t={}){await this.loadMarkets();const i=this.market(e),s={};let a;if(i.swap)s.symbol=i.id,a=await this.publicGetContractPublicDetails(this.extend(s,t));else{if(!i.spot)throw new r.NotSupported(this.id+" fetchTicker() does not support "+i.type+" markets, only spot and swap markets are accepted");s.symbol=i.id,a=await this.publicGetSpotQuotationV3Ticker(this.extend(s,t))}let o=[],n={};if(i.spot)n=this.safeDict(a,"data",{});else{const e=this.safeDict(a,"data",{});o=this.safeList(e,"symbols",[]),n=this.safeDict(o,0,{})}return this.parseTicker(n,i)}async fetchTickers(e=void 0,t={}){let i,s,a;if(await this.loadMarkets(),void 0!==(e=this.marketSymbols(e))){const t=this.safeString(e,0);s=this.market(t)}if([i,t]=this.handleMarketTypeAndParams("fetchTickers",s,t),"spot"===i)a=await this.publicGetSpotQuotationV3Tickers(t);else{if("swap"!==i)throw new r.NotSupported(this.id+" fetchTickers() does not support "+i+" markets, only spot and swap markets are accepted");a=await this.publicGetContractPublicDetails(t)}let o=[];if("spot"===i)o=this.safeList(a,"data",[]);else{const e=this.safeDict(a,"data",{});o=this.safeList(e,"symbols",[])}const n={};for(let e=0;e{i.d(t,{A:()=>h});var s=i(8186),r=i(1579),a=i(2079),o=i(5147),n=i(4852),d=i(8995);class h extends s.A{describe(){return this.deepExtend(super.describe(),{id:"bitmex",name:"BitMEX",countries:["SC"],version:"v1",userAgent:void 0,rateLimit:100,certified:!0,pro:!0,has:{CORS:void 0,spot:!0,margin:!1,swap:!0,future:!0,option:!1,addMargin:void 0,cancelAllOrders:!0,cancelAllOrdersAfter:!0,cancelOrder:!0,cancelOrders:!0,closeAllPositions:!1,closePosition:!0,createOrder:!0,createReduceOnlyOrder:!0,createStopOrder:!0,createTrailingAmountOrder:!0,createTriggerOrder:!0,editOrder:!0,fetchBalance:!0,fetchClosedOrders:!0,fetchCurrencies:!0,fetchDepositAddress:!0,fetchDepositAddresses:!1,fetchDepositAddressesByNetwork:!1,fetchDepositsWithdrawals:"emulated",fetchDepositWithdrawFee:"emulated",fetchDepositWithdrawFees:!0,fetchFundingHistory:!1,fetchFundingRate:"emulated",fetchFundingRateHistory:!0,fetchFundingRates:!0,fetchIndexOHLCV:!1,fetchLedger:!0,fetchLeverage:"emulated",fetchLeverages:!0,fetchLeverageTiers:!1,fetchLiquidations:!0,fetchMarginAdjustmentHistory:!1,fetchMarketLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMyLiquidations:!1,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenOrders:!0,fetchOrder:!0,fetchOrderBook:!0,fetchOrders:!0,fetchPosition:!1,fetchPositionHistory:!1,fetchPositions:!0,fetchPositionsHistory:!1,fetchPositionsRisk:!1,fetchPremiumIndexOHLCV:!1,fetchTicker:!0,fetchTickers:!0,fetchTrades:!0,fetchTransactions:"emulated",fetchTransfer:!1,fetchTransfers:!1,index:!0,reduceMargin:void 0,sandbox:!0,setLeverage:!0,setMargin:void 0,setMarginMode:!0,setPositionMode:!1,transfer:!1,withdraw:!0},timeframes:{"1m":"1m","5m":"5m","1h":"1h","1d":"1d"},urls:{test:{public:"https://testnet.bitmex.com",private:"https://testnet.bitmex.com"},logo:"https://github.com/user-attachments/assets/c78425ab-78d5-49d6-bd14-db7734798f04",api:{public:"https://www.bitmex.com",private:"https://www.bitmex.com"},www:"https://www.bitmex.com",doc:["https://www.bitmex.com/app/apiOverview","https://github.com/BitMEX/api-connectors/tree/master/official-http"],fees:"https://www.bitmex.com/app/fees",referral:{url:"https://www.bitmex.com/app/register/NZTR1q",discount:.1}},api:{public:{get:{announcement:5,"announcement/urgent":5,chat:5,"chat/channels":5,"chat/connected":5,"chat/pinned":5,funding:5,guild:5,instrument:5,"instrument/active":5,"instrument/activeAndIndices":5,"instrument/activeIntervals":5,"instrument/compositeIndex":5,"instrument/indices":5,"instrument/usdVolume":5,insurance:5,leaderboard:5,liquidation:5,"orderBook/L2":5,"porl/nonce":5,quote:5,"quote/bucketed":5,schema:5,"schema/websocketHelp":5,settlement:5,stats:5,"stats/history":5,"stats/historyUSD":5,trade:5,"trade/bucketed":5,"wallet/assets":5,"wallet/networks":5}},private:{get:{address:5,apiKey:5,execution:5,"execution/tradeHistory":5,globalNotification:5,"leaderboard/name":5,order:5,"porl/snapshots":5,position:5,user:5,"user/affiliateStatus":5,"user/checkReferralCode":5,"user/commission":5,"user/csa":5,"user/depositAddress":5,"user/executionHistory":5,"user/getWalletTransferAccounts":5,"user/margin":5,"user/quoteFillRatio":5,"user/quoteValueRatio":5,"user/staking":5,"user/staking/instruments":5,"user/staking/tiers":5,"user/tradingVolume":5,"user/unstakingRequests":5,"user/wallet":5,"user/walletHistory":5,"user/walletSummary":5,userAffiliates:5,userEvent:5},post:{address:5,chat:5,guild:5,"guild/archive":5,"guild/join":5,"guild/kick":5,"guild/leave":5,"guild/sharesTrades":5,order:1,"order/cancelAllAfter":5,"order/closePosition":5,"position/isolate":1,"position/leverage":1,"position/riskLimit":5,"position/transferMargin":1,"user/addSubaccount":5,"user/cancelWithdrawal":5,"user/communicationToken":5,"user/confirmEmail":5,"user/confirmWithdrawal":5,"user/logout":5,"user/preferences":5,"user/requestWithdrawal":5,"user/unstakingRequests":5,"user/updateSubaccount":5,"user/walletTransfer":5},put:{guild:5,order:1},delete:{order:1,"order/all":1,"user/unstakingRequests":5}}},exceptions:{exact:{"Invalid API Key.":a.AuthenticationError,"This key is disabled.":a.PermissionDenied,"Access Denied":a.PermissionDenied,"Duplicate clOrdID":a.InvalidOrder,"orderQty is invalid":a.InvalidOrder,"Invalid price":a.InvalidOrder,"Invalid stopPx for ordType":a.InvalidOrder,"Account is restricted":a.PermissionDenied},broad:{"Signature not valid":a.AuthenticationError,overloaded:a.ExchangeNotAvailable,"Account has insufficient Available Balance":a.InsufficientFunds,"Service unavailable":a.ExchangeNotAvailable,"Server Error":a.ExchangeError,"Unable to cancel order due to existing state":a.InvalidOrder,"We require all new traders to verify":a.PermissionDenied}},precisionMode:r.kb,options:{"api-expires":5,fetchOHLCVOpenTimestamp:!0,oldPrecision:!1,networks:{BTC:"btc",ERC20:"eth",BEP20:"bsc",TRC20:"tron",AVAXC:"avax",NEAR:"near",XTZ:"xtz",DOT:"dot",SOL:"sol",ADA:"ada"}},features:{default:{sandbox:!0,createOrder:{marginMode:!0,triggerPrice:!0,triggerPriceType:{last:!0,mark:!0},triggerDirection:!0,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!0,FOK:!0,PO:!0,GTD:!1},hedged:!1,trailing:!0,marketBuyRequiresPrice:!1,marketBuyByCost:!1},createOrders:void 0,fetchMyTrades:{marginMode:!1,limit:500,daysBack:void 0,untilDays:1e6,symbolRequired:!1},fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!1},fetchOpenOrders:{marginMode:!1,limit:500,trigger:!1,trailing:!1,symbolRequired:!1},fetchOrders:{marginMode:!1,limit:500,daysBack:void 0,untilDays:1e6,trigger:!1,trailing:!1,symbolRequired:!1},fetchClosedOrders:{marginMode:!1,limit:500,daysBack:void 0,daysBackCanceled:void 0,untilDays:1e6,trigger:!1,trailing:!1,symbolRequired:!1},fetchOHLCV:{limit:1e4}},spot:{extends:"default",createOrder:{triggerPriceType:{index:!1}}},derivatives:{extends:"default",createOrder:{triggerPriceType:{index:!0}}},swap:{linear:{extends:"derivatives"},inverse:{extends:"derivatives"}},future:{linear:{extends:"derivatives"},inverse:{extends:"derivatives"}}},commonCurrencies:{USDt:"USDT",XBt:"BTC",XBT:"BTC",Gwei:"ETH",GWEI:"ETH",LAMP:"SOL",LAMp:"SOL"}})}async fetchCurrencies(e={}){const t=await this.publicGetWalletAssets(e),i={};for(let e=0;e=0)throw new a.OrderNotFound(this.id+" cancelOrder() failed: "+d);return this.parseOrder(n)}async cancelOrders(e,t=void 0,i={}){await this.loadMarkets();const s=this.safeValue2(i,"clOrdID","clientOrderId"),r={};void 0===s?r.orderID=e:(r.clOrdID=s,i=this.omit(i,["clOrdID","clientOrderId"]));const a=await this.privateDeleteOrder(this.extend(r,i));return this.parseOrders(a)}async cancelAllOrders(e=void 0,t={}){await this.loadMarkets();const i={};let s;void 0!==e&&(s=this.market(e),i.symbol=s.id);const r=await this.privateDeleteOrderAll(this.extend(i,t));return this.parseOrders(r,s)}async cancelAllOrdersAfter(e,t={}){await this.loadMarkets();const i={timeout:e>0?this.parseToInt(e/1e3):0};return await this.privatePostOrderCancelAllAfter(this.extend(i,t))}async fetchLeverages(e=void 0,t={}){await this.loadMarkets();const i=await this.fetchPositions(e,t);return this.parseLeverages(i,e,"symbol")}parseLeverage(e,t=void 0){const i=this.safeString(e,"symbol");return{info:e,symbol:this.safeSymbol(i,t),marginMode:this.safeStringLower(e,"marginMode"),longLeverage:this.safeInteger(e,"leverage"),shortLeverage:this.safeInteger(e,"leverage")}}async fetchPositions(e=void 0,t={}){await this.loadMarkets();const i=await this.privateGetPosition(t),s=this.parsePositions(i,e);return this.filterByArrayPositions(s,"symbol",e,!1)}parsePosition(e,t=void 0){const i=(t=this.safeMarket(this.safeString(e,"symbol"),t)).symbol,s=this.safeString(e,"timestamp"),r=!0===this.safeValue(e,"crossMargin")?"cross":"isolated",a=o.Y.stringAbs(this.safeString2(e,"foreignNotional","homeNotional")),n=this.safeString(t,"settle"),d=this.convertToRealAmount(n,this.safeString(e,"maintMargin")),h=this.convertToRealAmount(n,this.safeString(e,"unrealisedPnl")),c=this.parseNumber(o.Y.stringAbs(this.safeString(e,"currentQty"))),l=this.safeNumber(t,"contractSize");let u;const f=this.safeString(e,"homeNotional");return void 0!==f&&(u="-"===f[0]?"short":"long"),this.safePosition({info:e,id:this.safeString(e,"account"),symbol:i,timestamp:this.parse8601(s),datetime:s,lastUpdateTimestamp:void 0,hedged:void 0,side:u,contracts:c,contractSize:l,entryPrice:this.safeNumber(e,"avgEntryPrice"),markPrice:this.safeNumber(e,"markPrice"),lastPrice:void 0,notional:this.parseNumber(a),leverage:this.safeNumber(e,"leverage"),collateral:void 0,initialMargin:this.safeNumber(e,"initMargin"),initialMarginPercentage:this.safeNumber(e,"initMarginReq"),maintenanceMargin:d,maintenanceMarginPercentage:this.safeNumber(e,"maintMarginReq"),unrealizedPnl:h,liquidationPrice:this.safeNumber(e,"liquidationPrice"),marginMode:r,marginRatio:void 0,percentage:this.safeNumber(e,"unrealisedPnlPcnt"),stopLossPrice:void 0,takeProfitPrice:void 0})}async withdraw(e,t,i,s=void 0,r={}){[s,r]=this.handleWithdrawTagAndParams(s,r),this.checkAddress(i),await this.loadMarkets();const a=this.currency(e),o=this.convertFromRealAmount(e,t);let n;[n,r]=this.handleNetworkCodeAndParams(r);const h={currency:a.id,amount:o,address:i,network:this.networkCodeToId(n,a.code)};void 0!==this.twofa&&(h.otpToken=(0,d.O)(this.twofa));const c=await this.privatePostUserRequestWithdrawal(this.extend(h,r));return this.parseTransaction(c,a)}async fetchFundingRates(e=void 0,t={}){await this.loadMarkets();const i=await this.publicGetInstrumentActiveAndIndices(t),s=[];for(let e=0;e1&&this.inArray(t[1],i)){e=this.currency(t[0]).id+":"+t[1],r.symbol=e}else a=this.market(e),r.symbol=a.id}void 0!==t&&(r.startTime=this.iso8601(t)),void 0!==i&&(r.count=i);const o=this.safeInteger(s,"until");s=this.omit(s,["until"]),void 0!==o&&(r.endTime=this.iso8601(o)),void 0===t&&void 0===o&&(r.reverse=!0);const n=await this.publicGetFunding(this.extend(r,s));return this.parseFundingRateHistories(n,a,t,i)}parseFundingRateHistory(e,t=void 0){const i=this.safeString(e,"symbol"),s=this.safeString(e,"timestamp");return{info:e,symbol:this.safeSymbol(i,t),fundingRate:this.safeNumber(e,"fundingRate"),timestamp:this.parse8601(s),datetime:s}}async setLeverage(e,t=void 0,i={}){if(void 0===t)throw new a.ArgumentsRequired(this.id+" setLeverage() requires a symbol argument");if(e<.01||e>100)throw new a.BadRequest(this.id+" leverage should be between 0.01 and 100");await this.loadMarkets();const s=this.market(t);if("swap"!==s.type&&"future"!==s.type)throw new a.BadSymbol(this.id+" setLeverage() supports future and swap contracts only");const r={symbol:s.id,leverage:e};return await this.privatePostPositionLeverage(this.extend(r,i))}async setMarginMode(e,t=void 0,i={}){if(void 0===t)throw new a.ArgumentsRequired(this.id+" setMarginMode() requires a symbol argument");if("isolated"!==(e=e.toLowerCase())&&"cross"!==e)throw new a.BadRequest(this.id+" setMarginMode() marginMode argument should be isolated or cross");await this.loadMarkets();const s=this.market(t);if("swap"!==s.type&&"future"!==s.type)throw new a.BadSymbol(this.id+" setMarginMode() supports swap and future contracts only");const r="cross"!==e,o={symbol:s.id,enabled:r};return await this.privatePostPositionIsolate(this.extend(o,i))}async fetchDepositAddress(e,t={}){let i;if(await this.loadMarkets(),[i,t]=this.handleNetworkCodeAndParams(t),void 0===i)throw new a.ArgumentsRequired(this.id+' fetchDepositAddress requires params["network"]');const s=this.currency(e);t=this.omit(t,"network");const r={currency:s.id,network:this.networkCodeToId(i,s.code)},o=await this.privateGetUserDepositAddress(this.extend(r,t));return{info:o,currency:e,network:i,address:o.replace('"',"").replace('"',""),tag:void 0}}parseDepositWithdrawFee(e,t=void 0){const i=this.safeValue(e,"networks",[]),s=i.length,r={info:e,withdraw:{fee:void 0,percentage:void 0},deposit:{fee:void 0,percentage:void 0},networks:{}};if(0!==s){const a=this.safeString(e,"scale"),n=this.parsePrecision(a);for(let e=0;e=400){const t=this.safeValue(n,"error",{}),i=this.safeString(t,"message"),s=this.id+" "+o;if(this.throwExactlyMatchedException(this.exceptions.exact,i,s),this.throwBroadlyMatchedException(this.exceptions.broad,i,s),400===e)throw new a.BadRequest(s);throw new a.ExchangeError(s)}}}nonce(){return this.milliseconds()}sign(e,t="public",i="GET",s={},r=void 0,a=void 0){let o="/api/"+this.version+"/"+e;if("GET"===i)Object.keys(s).length&&(o+="?"+this.urlencode(s));else{const e=this.safeString(s,"_format");void 0!==e&&(o+="?"+this.urlencode({_format:e}),s=this.omit(s,"_format"))}const d=this.urls.api[t]+o,h=this.checkRequiredCredentials(!1);if("private"===t||"public"===t&&h){this.checkRequiredCredentials();let e=i+o,t=this.safeInteger(this.options,"api-expires");r={"Content-Type":"application/json","api-key":this.apiKey},t=this.sum(this.seconds(),t);const d=t.toString();e+=d,r["api-expires"]=d,"POST"!==i&&"PUT"!==i&&"DELETE"!==i||Object.keys(s).length&&(e+=a=this.json(s)),r["api-signature"]=this.hmac(this.encode(e),this.encode(this.secret),n.s)}return{url:d,method:i,body:a,headers:r}}}},2753:(e,t,i)=>{i.d(t,{A:()=>d});var s=i(7202),r=i(2079),a=i(5147),o=i(1579),n=i(7481);class d extends s.A{describe(){return this.deepExtend(super.describe(),{id:"bitopro",name:"BitoPro",countries:["TW"],version:"v3",rateLimit:100,pro:!0,has:{CORS:void 0,spot:!0,margin:!1,swap:!1,future:!1,option:!1,addMargin:!1,borrowCrossMargin:!1,borrowIsolatedMargin:!1,borrowMargin:!1,cancelAllOrders:!0,cancelOrder:!0,cancelOrders:!0,closeAllPositions:!1,closePosition:!1,createOrder:!0,createOrderWithTakeProfitAndStopLoss:!1,createOrderWithTakeProfitAndStopLossWs:!1,createReduceOnlyOrder:!1,createStopOrder:!0,createTriggerOrder:!0,editOrder:!1,fetchBalance:!0,fetchBorrowInterest:!1,fetchBorrowRate:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchBorrowRates:!1,fetchBorrowRatesPerSymbol:!1,fetchClosedOrders:!0,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!0,fetchDepositAddress:!1,fetchDeposits:!0,fetchDepositsWithdrawals:!1,fetchDepositWithdrawFee:"emulated",fetchDepositWithdrawFees:!0,fetchFundingHistory:!1,fetchFundingInterval:!1,fetchFundingIntervals:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchGreeks:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchIsolatedPositions:!1,fetchLeverage:!1,fetchLeverages:!1,fetchLeverageTiers:!1,fetchLiquidations:!1,fetchLongShortRatio:!1,fetchLongShortRatioHistory:!1,fetchMarginAdjustmentHistory:!1,fetchMarginMode:!1,fetchMarginModes:!1,fetchMarketLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMarkPrices:!1,fetchMyLiquidations:!1,fetchMySettlementHistory:!1,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenInterest:!1,fetchOpenInterestHistory:!1,fetchOpenInterests:!1,fetchOpenOrders:!0,fetchOption:!1,fetchOptionChain:!1,fetchOrder:!0,fetchOrderBook:!0,fetchOrders:!1,fetchOrderTrades:!1,fetchPosition:!1,fetchPositionHistory:!1,fetchPositionMode:!1,fetchPositions:!1,fetchPositionsForSymbol:!1,fetchPositionsHistory:!1,fetchPositionsRisk:!1,fetchPremiumIndexOHLCV:!1,fetchSettlementHistory:!1,fetchTicker:!0,fetchTickers:!0,fetchTime:!1,fetchTrades:!0,fetchTradingFee:!1,fetchTradingFees:!0,fetchTransactionFees:!1,fetchTransactions:!1,fetchTransfer:!1,fetchTransfers:!1,fetchVolatilityHistory:!1,fetchWithdrawal:!0,fetchWithdrawals:!0,reduceMargin:!1,repayCrossMargin:!1,repayIsolatedMargin:!1,setLeverage:!1,setMargin:!1,setMarginMode:!1,setPositionMode:!1,transfer:!1,withdraw:!0},timeframes:{"1m":"1m","5m":"5m","15m":"15m","30m":"30m","1h":"1h","3h":"3h","6h":"6h","12h":"12h","1d":"1d","1w":"1w","1M":"1M"},urls:{logo:"https://github.com/user-attachments/assets/affc6337-b95a-44bf-aacd-04f9722364f6",api:{rest:"https://api.bitopro.com/v3"},www:"https://www.bitopro.com",doc:["https://github.com/bitoex/bitopro-offical-api-docs/blob/master/v3-1/rest-1/rest.md"],fees:"https://www.bitopro.com/fees"},requiredCredentials:{apiKey:!0,secret:!0},api:{public:{get:{"order-book/{pair}":1,tickers:1,"tickers/{pair}":1,"trades/{pair}":1,"provisioning/currencies":1,"provisioning/trading-pairs":1,"provisioning/limitations-and-fees":1,"trading-history/{pair}":1,"price/otc/{currency}":1}},private:{get:{"accounts/balance":1,"orders/history":1,"orders/all/{pair}":1,"orders/trades/{pair}":1,"orders/{pair}/{orderId}":1,"wallet/withdraw/{currency}/{serial}":1,"wallet/withdraw/{currency}/id/{id}":1,"wallet/depositHistory/{currency}":1,"wallet/withdrawHistory/{currency}":1,"orders/open":1},post:{"orders/{pair}":.5,"orders/batch":20/3,"wallet/withdraw/{currency}":10},put:{orders:5},delete:{"orders/{pair}/{id}":2/3,"orders/all":5,"orders/{pair}":5}}},fees:{trading:{tierBased:!0,percentage:!0,maker:this.parseNumber("0.001"),taker:this.parseNumber("0.002"),tiers:{taker:[[this.parseNumber("0"),this.parseNumber("0.002")],[this.parseNumber("3000000"),this.parseNumber("0.00194")],[this.parseNumber("5000000"),this.parseNumber("0.0015")],[this.parseNumber("30000000"),this.parseNumber("0.0014")],[this.parseNumber("300000000"),this.parseNumber("0.0013")],[this.parseNumber("550000000"),this.parseNumber("0.0012")],[this.parseNumber("1300000000"),this.parseNumber("0.0011")]],maker:[[this.parseNumber("0"),this.parseNumber("0.001")],[this.parseNumber("3000000"),this.parseNumber("0.00097")],[this.parseNumber("5000000"),this.parseNumber("0.0007")],[this.parseNumber("30000000"),this.parseNumber("0.0006")],[this.parseNumber("300000000"),this.parseNumber("0.0005")],[this.parseNumber("550000000"),this.parseNumber("0.0004")],[this.parseNumber("1300000000"),this.parseNumber("0.0003")]]}}},options:{networks:{ERC20:"ERC20",ETH:"ERC20",TRX:"TRX",TRC20:"TRX",BEP20:"BSC",BSC:"BSC"},fiatCurrencies:["TWD"]},features:{spot:{sandbox:!1,createOrder:{marginMode:!1,triggerPrice:!0,triggerPriceType:void 0,triggerDirection:!0,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!1,FOK:!1,PO:!0,GTD:!1},hedged:!1,trailing:!1,leverage:!1,marketBuyRequiresPrice:!1,marketBuyByCost:!1,selfTradePrevention:!1,iceberg:!1},createOrders:void 0,fetchMyTrades:{marginMode:!1,limit:1e3,daysBack:1e5,untilDays:1e5,symbolRequired:!0},fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!0},fetchOpenOrders:{marginMode:!1,limit:void 0,trigger:!1,trailing:!1,symbolRequired:!1},fetchOrders:{marginMode:!1,limit:1e3,daysBack:1e5,untilDays:1e5,trigger:!1,trailing:!1,symbolRequired:!0},fetchClosedOrders:{marginMode:!1,limit:1e3,daysBack:1e5,daysBackCanceled:1,untilDays:1e4,trigger:!1,trailing:!1,symbolRequired:!0},fetchOHLCV:{limit:1e3}},swap:{linear:void 0,inverse:void 0},future:{linear:void 0,inverse:void 0}},precisionMode:o.kb,exceptions:{exact:{"Unsupported currency.":r.BadRequest,"Unsupported order type":r.BadRequest,"Invalid body":r.BadRequest,"Invalid Signature":r.AuthenticationError,"Address not in whitelist.":r.BadRequest},broad:{"Invalid amount":r.InvalidOrder,"Balance for ":r.InsufficientFunds,"Invalid ":r.BadRequest,"Wrong parameter":r.BadRequest}},commonCurrencies:{}})}async fetchCurrencies(e={}){const t=await this.publicGetProvisioningCurrencies(e),i=this.safeList(t,"data",[]),s={},r=this.safeList(this.options,"fiatCurrencies",[]);for(let e=0;e=200&&e<300)return;const c=this.id+" "+o,l=this.safeString(n,"error");throw this.throwExactlyMatchedException(this.exceptions.exact,l,c),this.throwBroadlyMatchedException(this.exceptions.broad,l,c),new r.ExchangeError(c)}}},9558:(e,t,i)=>{i.d(t,{A:()=>r});var s=i(6607);class r extends s.A{describe(){return this.deepExtend(super.describe(),{id:"bitpin",name:"bitpin",countries:["IR"],rateLimit:1e3,version:"1",certified:!1,pro:!1,has:{CORS:void 0,spot:!0,margin:!1,swap:!1,future:!1,option:!1,addMargin:!1,cancelAllOrders:!1,cancelOrder:!1,cancelOrders:!1,createDepositAddress:!1,createOrder:!1,createStopLimitOrder:!1,createStopMarketOrder:!1,createStopOrder:!1,editOrder:!1,fetchBalance:!1,fetchBorrowInterest:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchClosedOrders:!1,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!1,fetchDepositAddress:!1,fetchDeposits:!1,fetchFundingHistory:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchL2OrderBook:!1,fetchL3OrderBook:!1,fetchLedger:!1,fetchLedgerEntry:!1,fetchLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMyTrades:!1,fetchOHLCV:!0,fetchOpenInterestHistory:!1,fetchOpenOrders:!1,fetchOrder:!1,fetchOrderBook:!0,fetchOrders:!1,fetchOrderTrades:"emulated",fetchPositions:!1,fetchPremiumIndexOHLCV:!1,fetchTicker:!0,fetchTickers:!0,fetchTime:!1,fetchTrades:!1,fetchTradingFee:!1,fetchTradingFees:!1,fetchWithdrawals:!1,setLeverage:!1,setMarginMode:!1,transfer:!1,withdraw:!1},comment:"This comment is optional",urls:{logo:"https://cdn.arz.digital/cr-odin/img/exchanges/bitpin/64x64.png",api:{public:"https://api.bitpin.ir",OHLCV:"https://api.bitpin.org"},www:"https://bitpin.ir",doc:["https://docs.bitpin.ir"]},timeframes:{"1m":"1","5m":"5","15m":"15","30m":"30","1h":"60","3h":"180","4h":"240","12h":"720","1d":"1D","1w":"1W"},api:{public:{get:{"v1/mkt/markets/":1,"v2/mth/actives/":1,"v1/mkt/tv/get_bars/":1}}},fees:{trading:{tierBased:!1,percentage:!0,maker:this.parseNumber("0.001"),taker:this.parseNumber("0.001")}}})}async fetchMarkets(e={}){const t=await this.publicGetV1MktMarkets(e),i=this.safeList(t,"results"),s=[];for(let e=0;e{i.d(t,{A:()=>d});var s=i(8800),r=i(2079),a=i(5147),o=i(1579),n=i(4852);class d extends s.A{describe(){return this.deepExtend(super.describe(),{id:"bitrue",name:"Bitrue",countries:["SG"],rateLimit:10,certified:!1,version:"v1",pro:!0,has:{CORS:void 0,spot:!0,margin:!1,swap:!0,future:!1,option:!1,addMargin:!1,borrowCrossMargin:!1,borrowIsolatedMargin:!1,borrowMargin:!1,cancelAllOrders:!0,cancelOrder:!0,closeAllPositions:!1,closePosition:!1,createMarketBuyOrderWithCost:!0,createMarketOrderWithCost:!1,createMarketSellOrderWithCost:!1,createOrder:!0,createOrderWithTakeProfitAndStopLoss:!1,createOrderWithTakeProfitAndStopLossWs:!1,createReduceOnlyOrder:!0,createStopLimitOrder:!0,createStopMarketOrder:!0,createStopOrder:!0,fetchBalance:!0,fetchBidsAsks:!0,fetchBorrowInterest:!1,fetchBorrowRate:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchBorrowRates:!1,fetchBorrowRatesPerSymbol:!1,fetchClosedOrders:!0,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!0,fetchDepositAddress:!1,fetchDeposits:!0,fetchDepositsWithdrawals:!1,fetchDepositWithdrawFee:"emulated",fetchDepositWithdrawFees:!0,fetchFundingHistory:!1,fetchFundingInterval:!1,fetchFundingIntervals:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchGreeks:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchIsolatedPositions:!1,fetchLeverage:!1,fetchLeverages:!1,fetchLeverageTiers:!1,fetchLiquidations:!1,fetchLongShortRatio:!1,fetchLongShortRatioHistory:!1,fetchMarginAdjustmentHistory:!1,fetchMarginMode:!1,fetchMarginModes:!1,fetchMarketLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMarkPrices:!1,fetchMyLiquidations:!1,fetchMySettlementHistory:!1,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenInterest:!1,fetchOpenInterestHistory:!1,fetchOpenInterests:!1,fetchOpenOrders:!0,fetchOption:!1,fetchOptionChain:!1,fetchOrder:!0,fetchOrderBook:!0,fetchOrders:!1,fetchPosition:!1,fetchPositionHistory:!1,fetchPositionMode:!1,fetchPositions:!1,fetchPositionsHistory:!1,fetchPositionsRisk:!1,fetchPremiumIndexOHLCV:!1,fetchSettlementHistory:!1,fetchStatus:!0,fetchTicker:!0,fetchTickers:!0,fetchTime:!0,fetchTrades:!0,fetchTradingFee:!1,fetchTradingFees:!1,fetchTransactionFees:!1,fetchTransactions:!1,fetchTransfers:!0,fetchVolatilityHistory:!1,fetchWithdrawals:!0,reduceMargin:!1,repayCrossMargin:!1,repayIsolatedMargin:!1,setLeverage:!0,setMargin:!0,setMarginMode:!1,setPositionMode:!1,transfer:!0,withdraw:!0},timeframes:{"1m":"1m","5m":"5m","15m":"15m","30m":"30m","1h":"1H","2h":"2H","4h":"4H","1d":"1D","1w":"1W"},urls:{logo:"https://github.com/user-attachments/assets/67abe346-1273-461a-bd7c-42fa32907c8e",api:{spot:"https://www.bitrue.com/api",fapi:"https://fapi.bitrue.com/fapi",dapi:"https://fapi.bitrue.com/dapi",kline:"https://www.bitrue.com/kline-api"},www:"https://www.bitrue.com",referral:"https://www.bitrue.com/affiliate/landing?cn=600000&inviteCode=EZWETQE",doc:["https://github.com/Bitrue-exchange/bitrue-official-api-docs","https://www.bitrue.com/api-docs"],fees:"https://bitrue.zendesk.com/hc/en-001/articles/4405479952537"},api:{spot:{kline:{public:{get:{"public.json":.24,"public{currency}.json":.24}}},v1:{public:{get:{ping:.24,time:.24,exchangeInfo:.24,depth:{cost:1,byLimit:[[100,.24],[500,1.2],[1e3,2.4]]},trades:.24,historicalTrades:1.2,aggTrades:.24,"ticker/24hr":{cost:.24,noSymbol:9.6},"ticker/price":.24,"ticker/bookTicker":.24,"market/kline":.24}},private:{get:{order:5,openOrders:5,allOrders:25,account:25,myTrades:25,"etf/net-value/{symbol}":.24,"withdraw/history":120,"deposit/history":120},post:{order:5,"withdraw/commit":120},delete:{order:5}}},v2:{private:{get:{myTrades:1.2}}}},fapi:{v1:{public:{get:{ping:.24,time:.24,contracts:.24,depth:.24,ticker:.24,klines:.24}}},v2:{private:{get:{myTrades:5,openOrders:5,order:5,account:5,leverageBracket:5,commissionRate:5,futures_transfer_history:5,forceOrdersHistory:5},post:{positionMargin:5,level_edit:5,cancel:5,order:25,allOpenOrders:5,futures_transfer:5}}}},dapi:{v1:{public:{get:{ping:.24,time:.24,contracts:.24,depth:.24,ticker:.24,klines:.24}}},v2:{private:{get:{myTrades:5,openOrders:5,order:5,account:5,leverageBracket:5,commissionRate:5,futures_transfer_history:5,forceOrdersHistory:5},post:{positionMargin:5,level_edit:5,cancel:5,order:5,allOpenOrders:5,futures_transfer:5}}}}},fees:{trading:{feeSide:"get",tierBased:!1,percentage:!0,taker:this.parseNumber("0.00098"),maker:this.parseNumber("0.00098")},future:{trading:{feeSide:"quote",tierBased:!0,percentage:!0,taker:this.parseNumber("0.000400"),maker:this.parseNumber("0.000200"),tiers:{taker:[[this.parseNumber("0"),this.parseNumber("0.000400")],[this.parseNumber("250"),this.parseNumber("0.000400")],[this.parseNumber("2500"),this.parseNumber("0.000350")],[this.parseNumber("7500"),this.parseNumber("0.000320")],[this.parseNumber("22500"),this.parseNumber("0.000300")],[this.parseNumber("50000"),this.parseNumber("0.000270")],[this.parseNumber("100000"),this.parseNumber("0.000250")],[this.parseNumber("200000"),this.parseNumber("0.000220")],[this.parseNumber("400000"),this.parseNumber("0.000200")],[this.parseNumber("750000"),this.parseNumber("0.000170")]],maker:[[this.parseNumber("0"),this.parseNumber("0.000200")],[this.parseNumber("250"),this.parseNumber("0.000160")],[this.parseNumber("2500"),this.parseNumber("0.000140")],[this.parseNumber("7500"),this.parseNumber("0.000120")],[this.parseNumber("22500"),this.parseNumber("0.000100")],[this.parseNumber("50000"),this.parseNumber("0.000080")],[this.parseNumber("100000"),this.parseNumber("0.000060")],[this.parseNumber("200000"),this.parseNumber("0.000040")],[this.parseNumber("400000"),this.parseNumber("0.000020")],[this.parseNumber("750000"),this.parseNumber("0")]]}}},delivery:{trading:{feeSide:"base",tierBased:!0,percentage:!0,taker:this.parseNumber("0.000500"),maker:this.parseNumber("0.000100"),tiers:{taker:[[this.parseNumber("0"),this.parseNumber("0.000500")],[this.parseNumber("250"),this.parseNumber("0.000450")],[this.parseNumber("2500"),this.parseNumber("0.000400")],[this.parseNumber("7500"),this.parseNumber("0.000300")],[this.parseNumber("22500"),this.parseNumber("0.000250")],[this.parseNumber("50000"),this.parseNumber("0.000240")],[this.parseNumber("100000"),this.parseNumber("0.000240")],[this.parseNumber("200000"),this.parseNumber("0.000240")],[this.parseNumber("400000"),this.parseNumber("0.000240")],[this.parseNumber("750000"),this.parseNumber("0.000240")]],maker:[[this.parseNumber("0"),this.parseNumber("0.000100")],[this.parseNumber("250"),this.parseNumber("0.000080")],[this.parseNumber("2500"),this.parseNumber("0.000050")],[this.parseNumber("7500"),this.parseNumber("0.0000030")],[this.parseNumber("22500"),this.parseNumber("0")],[this.parseNumber("50000"),this.parseNumber("-0.000050")],[this.parseNumber("100000"),this.parseNumber("-0.000060")],[this.parseNumber("200000"),this.parseNumber("-0.000070")],[this.parseNumber("400000"),this.parseNumber("-0.000080")],[this.parseNumber("750000"),this.parseNumber("-0.000090")]]}}}},options:{createMarketBuyOrderRequiresPrice:!0,fetchMarkets:{types:["spot","linear","inverse"]},fetchMyTradesMethod:"v2PrivateGetMyTrades",hasAlreadyAuthenticatedSuccessfully:!1,currencyToPrecisionRoundingMode:o.R3,recvWindow:5e3,timeDifference:0,adjustForTimeDifference:!1,parseOrderToPrecision:!1,newOrderRespType:{market:"FULL",limit:"FULL"},networks:{ERC20:"ETH",TRC20:"TRX",AETERNITY:"Aeternity",AION:"AION",ALGO:"Algorand",ASK:"ASK",ATOM:"ATOM",AVAXC:"AVAX C-Chain",BCH:"BCH",BEP2:"BEP2",BEP20:"BEP20",Bitcoin:"Bitcoin",BRP20:"BRP20",ADA:"Cardano",CASINOCOIN:"CasinoCoin","CASINOCOIN-XRPL":"CasinoCoin XRPL",CONTENTOS:"Contentos",DASH:"Dash",DECOIN:"Decoin",DFI:"DeFiChain",DGB:"DGB",DIVI:"Divi",DOGE:"dogecoin",EOS:"EOS",ETC:"ETC",FILECOIN:"Filecoin",FREETON:"FREETON",HBAR:"HBAR",HEDERA:"Hedera Hashgraph",HRC20:"HRC20",ICON:"ICON",ICP:"ICP",IGNIS:"Ignis",INTERNETCOMPUTER:"Internet Computer",IOTA:"IOTA",KAVA:"KAVA",KSM:"KSM",LTC:"LiteCoin",LUNA:"Luna",MATIC:"MATIC",MOBILECOIN:"Mobile Coin",MONACOIN:"MonaCoin",XMR:"Monero",NEM:"NEM",NEP5:"NEP5",OMNI:"OMNI",PAC:"PAC",DOT:"Polkadot",RAVEN:"Ravencoin",SAFEX:"Safex",SOL:"SOLANA",SGB:"Songbird",XML:"Stellar Lumens",XYM:"Symbol",XTZ:"Tezos",theta:"theta",THETA:"THETA",VECHAIN:"VeChain",WANCHAIN:"Wanchain",XINFIN:"XinFin Network",XRP:"XRP",XRPL:"XRPL",ZIL:"ZIL"},defaultType:"spot",timeframes:{spot:{"1m":"1m","5m":"5m","15m":"15m","30m":"30m","1h":"1H","2h":"2H","4h":"4H","12h":"12H","1d":"1D","1w":"1W"},future:{"1m":"1min","5m":"5min","15m":"15min","30m":"30min","1h":"1h","1d":"1day","1w":"1week","1M":"1month"}},accountsByType:{spot:"wallet",future:"contract",swap:"contract",funding:"wallet",fund:"wallet",contract:"contract"}},commonCurrencies:{MIM:"MIM Swarm"},precisionMode:o.kb,features:{default:{sandbox:!1,createOrder:{marginMode:!1,triggerPrice:!0,triggerPriceType:void 0,triggerDirection:void 0,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!0,FOK:!0,PO:!0,GTD:!1},hedged:!1,trailing:!1,leverage:!1,marketBuyRequiresPrice:!0,marketBuyByCost:!0,selfTradePrevention:!1,iceberg:!0},createOrders:void 0,fetchMyTrades:{marginMode:!1,limit:1e3,daysBack:1e5,untilDays:1e5,symbolRequired:!0},fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!0},fetchOpenOrders:{marginMode:!1,limit:void 0,trigger:!1,trailing:!1,symbolRequired:!0},fetchOrders:void 0,fetchClosedOrders:{marginMode:!1,limit:1e3,daysBack:90,daysBackCanceled:1,untilDays:90,trigger:!1,trailing:!1,symbolRequired:!0},fetchOHLCV:{limit:1440}},spot:{extends:"default"},forDerivatives:{extends:"default",createOrder:{marginMode:!0,leverage:!0,marketBuyRequiresPrice:!1,marketBuyByCost:!1},fetchOHLCV:{limit:300},fetchClosedOrders:void 0},swap:{linear:{extends:"forDerivatives"},inverse:{extends:"forDerivatives"}},future:{linear:void 0,inverse:void 0}},exceptions:{exact:{"System is under maintenance.":r.OnMaintenance,"System abnormality":r.ExchangeError,"You are not authorized to execute this request.":r.PermissionDenied,"API key does not exist":r.AuthenticationError,"Order would trigger immediately.":r.OrderImmediatelyFillable,"Stop price would trigger immediately.":r.OrderImmediatelyFillable,"Order would immediately match and take.":r.OrderImmediatelyFillable,"Account has insufficient balance for requested action.":r.InsufficientFunds,"Rest API trading is not enabled.":r.ExchangeNotAvailable,"You don't have permission.":r.PermissionDenied,"Market is closed.":r.ExchangeNotAvailable,"Too many requests. Please try again later.":r.DDoSProtection,"-1000":r.ExchangeNotAvailable,"-1001":r.ExchangeNotAvailable,"-1002":r.AuthenticationError,"-1003":r.RateLimitExceeded,"-1013":r.InvalidOrder,"-1015":r.RateLimitExceeded,"-1016":r.ExchangeNotAvailable,"-1020":r.BadRequest,"-1021":r.InvalidNonce,"-1022":r.AuthenticationError,"-1100":r.BadRequest,"-1101":r.BadRequest,"-1102":r.BadRequest,"-1103":r.BadRequest,"-1104":r.BadRequest,"-1105":r.BadRequest,"-1106":r.BadRequest,"-1111":r.BadRequest,"-1112":r.InvalidOrder,"-1114":r.BadRequest,"-1115":r.BadRequest,"-1116":r.BadRequest,"-1117":r.BadRequest,"-1166":r.InvalidOrder,"-1118":r.BadRequest,"-1119":r.BadRequest,"-1120":r.BadRequest,"-1121":r.BadSymbol,"-1125":r.AuthenticationError,"-1127":r.BadRequest,"-1128":r.BadRequest,"-1130":r.BadRequest,"-1131":r.BadRequest,"-1160":r.InvalidOrder,"-1156":r.InvalidOrder,"-2008":r.AuthenticationError,"-2010":r.ExchangeError,"-2011":r.OrderNotFound,"-2013":r.OrderNotFound,"-2014":r.AuthenticationError,"-2015":r.AuthenticationError,"-2017":r.InsufficientFunds,"-2019":r.InsufficientFunds,"-3005":r.InsufficientFunds,"-3006":r.InsufficientFunds,"-3008":r.InsufficientFunds,"-3010":r.ExchangeError,"-3015":r.ExchangeError,"-3022":r.AccountSuspended,"-4028":r.BadRequest,"-3020":r.InsufficientFunds,"-3041":r.InsufficientFunds,"-5013":r.InsufficientFunds,"-11008":r.InsufficientFunds,"-4051":r.InsufficientFunds},broad:{"Insufficient account balance":r.InsufficientFunds,"has no operation privilege":r.PermissionDenied,MAX_POSITION:r.InvalidOrder}}})}nonce(){return this.milliseconds()-this.options.timeDifference}async fetchStatus(e={}){const t=await this.spotV1PublicGetPing(e);return{status:Object.keys(t).length?"maintenance":"ok",updated:void 0,eta:void 0,url:void 0,info:t}}async fetchTime(e={}){const t=await this.spotV1PublicGetTime(e);return this.safeInteger(t,"serverTime")}async fetchCurrencies(e={}){const t=await this.spotV1PublicGetExchangeInfo(e),i={},s=this.safeList(t,"coins",[]);for(let e=0;e100&&(t=100),e.limit=t),s.linear?a=await this.fapiV1PublicGetDepth(this.extend(e,i)):s.inverse&&(a=await this.dapiV1PublicGetDepth(this.extend(e,i)))}else{if(!s.spot)throw new r.NotSupported(this.id+" fetchOrderBook only support spot & swap markets");{const e={symbol:s.id};void 0!==t&&(t>1e3&&(t=1e3),e.limit=t),a=await this.spotV1PublicGetDepth(this.extend(e,i))}}const o=this.safeInteger2(a,"time","lastUpdateId"),n=this.parseOrderBook(a,e,o);return n.nonce=this.safeInteger(a,"lastUpdateId"),n}parseTicker(e,t=void 0){const i=this.safeSymbol(void 0,t),s=this.safeString2(e,"lastPrice","last"),r=this.safeInteger(e,"time");let o;return o=t.swap?a.Y.stringMul(this.safeString(e,"rose"),"100"):this.safeString(e,"priceChangePercent"),this.safeTicker({symbol:i,timestamp:r,datetime:this.iso8601(r),high:this.safeString2(e,"highPrice","high"),low:this.safeString2(e,"lowPrice","low"),bid:this.safeString2(e,"bidPrice","buy"),bidVolume:this.safeString(e,"bidQty"),ask:this.safeString2(e,"askPrice","sell"),askVolume:this.safeString(e,"askQty"),vwap:this.safeString(e,"weightedAvgPrice"),open:this.safeString(e,"openPrice"),close:s,last:s,previousClose:void 0,change:this.safeString(e,"priceChange"),percentage:o,average:void 0,baseVolume:this.safeString2(e,"volume","vol"),quoteVolume:this.safeString(e,"quoteVolume"),info:e},t)}async fetchTicker(e,t={}){await this.loadMarkets();const i=this.market(e);let s,a;if(i.swap){const e={contractName:i.id};i.linear?s=await this.fapiV1PublicGetTicker(this.extend(e,t)):i.inverse&&(s=await this.dapiV1PublicGetTicker(this.extend(e,t))),a=s}else{if(!i.spot)throw new r.NotSupported(this.id+" fetchTicker only support spot & swap markets");{const e={symbol:i.id};s=await this.spotV1PublicGetTicker24hr(this.extend(e,t)),a=this.safeDict(s,0,{})}}return this.parseTicker(a,i)}async fetchOHLCV(e,t="1m",i=void 0,s=void 0,a={}){await this.loadMarkets();const o=this.market(e),n=this.safeDict(this.options,"timeframes",{});let d,h;if(o.swap){const e=this.safeDict(n,"future",{}),i={contractName:o.id,interval:this.safeString(e,t,"1min")};void 0!==s&&(i.limit=s),o.linear?d=await this.fapiV1PublicGetKlines(this.extend(i,a)):o.inverse&&(d=await this.dapiV1PublicGetKlines(this.extend(i,a))),h=d}else{if(!o.spot)throw new r.NotSupported(this.id+" fetchOHLCV only support spot & swap markets");{const e=this.safeDict(n,"spot",{}),i={symbol:o.id,scale:this.safeString(e,t,"1m")};void 0!==s&&(i.limit=s);const r=this.safeInteger(a,"until");void 0!==r&&(a=this.omit(a,"until"),i.fromIdx=r),d=await this.spotV1PublicGetMarketKline(this.extend(i,a)),h=this.safeList(d,"data",[])}}return this.parseOHLCVs(h,o,t,i,s)}parseOHLCV(e,t=void 0){let i=this.safeTimestamp(e,"i");return void 0===i&&(i=this.safeInteger(e,"idx")),[i,this.safeNumber2(e,"o","open"),this.safeNumber2(e,"h","high"),this.safeNumber2(e,"l","low"),this.safeNumber2(e,"c","close"),this.safeNumber2(e,"v","vol")]}async fetchBidsAsks(e=void 0,t={}){await this.loadMarkets(),e=this.marketSymbols(e,void 0,!1);const i=this.safeString(e,0),s=this.market(i);let a;if(s.swap){const e={contractName:s.id};s.linear?a=await this.fapiV1PublicGetTicker(this.extend(e,t)):s.inverse&&(a=await this.dapiV1PublicGetTicker(this.extend(e,t)))}else{if(!s.spot)throw new r.NotSupported(this.id+" fetchBidsAsks only support spot & swap markets");{const e={symbol:s.id};a=await this.spotV1PublicGetTickerBookTicker(this.extend(e,t))}}const o={};return o[s.id]=a,this.parseTickers(o,e)}async fetchTickers(e=void 0,t={}){let i,s;await this.loadMarkets();const a={};let o;if(void 0!==(e=this.marketSymbols(e))){const o=this.safeString(e,0),n=this.market(o);if(n.swap)throw new r.NotSupported(this.id+" fetchTickers does not support swap markets, please use fetchTicker instead");if(!n.spot)throw new r.NotSupported(this.id+" fetchTickers only support spot & swap markets");i=await this.spotV1PublicGetTicker24hr(this.extend(a,t)),s=i}else{if([o,t]=this.handleMarketTypeAndParams("fetchTickers",void 0,t),"spot"!==o)throw new r.NotSupported(this.id+" fetchTickers only support spot when symbols are not proved");i=await this.spotV1PublicGetTicker24hr(this.extend(a,t)),s=i}const n={};for(let e=0;e1e3&&(i=1e3),d.limit=i),a.swap)d.contractName=a.id,a.linear?o=await this.fapiV2PrivateGetMyTrades(this.extend(d,s)):a.inverse&&(o=await this.dapiV2PrivateGetMyTrades(this.extend(d,s))),n=this.safeList(o,"data",[]);else{if(!a.spot)throw new r.NotSupported(this.id+" fetchMyTrades only support spot & swap markets");d.symbol=a.id,o=await this.spotV2PrivateGetMyTrades(this.extend(d,s)),n=o}return this.parseTrades(n,a,t,i)}async fetchDeposits(e=void 0,t=void 0,i=void 0,s={}){if(void 0===e)throw new r.ArgumentsRequired(this.id+" fetchDeposits() requires a code argument");await this.loadMarkets();const a=this.currency(e),o={coin:a.id,status:1};void 0!==t&&(o.startTime=t),void 0!==i&&(o.limit=i);const n=await this.spotV1PrivateGetDepositHistory(this.extend(o,s)),d=this.safeList(n,"data",[]);return this.parseTransactions(d,a,t,i)}async fetchWithdrawals(e=void 0,t=void 0,i=void 0,s={}){if(void 0===e)throw new r.ArgumentsRequired(this.id+" fetchWithdrawals() requires a code argument");await this.loadMarkets();const a=this.currency(e),o={coin:a.id,status:5};void 0!==t&&(o.startTime=t),void 0!==i&&(o.limit=i);const n=await this.spotV1PrivateGetWithdrawHistory(this.extend(o,s)),d=this.safeList(n,"data",[]);return this.parseTransactions(d,a)}parseTransactionStatusByType(e,t=void 0){const i=this.safeDict({deposit:{0:"pending",1:"ok"},withdrawal:{0:"pending",5:"ok",6:"canceled"}},t,{});return this.safeString(i,e,e)}parseTransaction(e,t=void 0){const i=this.safeString2(e,"id","withdrawId"),s=this.safeString(e,"tagType");let r,a,o=this.safeString(e,"addressTo"),n=this.safeString(e,"addressFrom");if(void 0!==s){if(void 0!==o){const e=o.split("_");o=this.safeString(e,0),r=this.safeString(e,1)}if(void 0!==n){const e=n.split("_");n=this.safeString(e,0),a=this.safeString(e,1)}}const d=this.safeString(e,"txid"),h=this.safeInteger(e,"createdAt"),c=this.safeInteger(e,"updatedAt"),l="payAmount"in e||"ctime"in e?"withdrawal":"deposit",u=this.parseTransactionStatusByType(this.safeString(e,"status"),l),f=this.safeNumber(e,"amount");let p,m=this.safeString2(e,"symbol","coin");if(void 0!==m){const e=m.split("_");m=this.safeString(e,0);const t=this.safeString(e,1);void 0!==t&&(p=t.toUpperCase())}const g=this.safeCurrencyCode(m,t),v=this.safeNumber(e,"fee");let y;return void 0!==v&&(y={currency:g,cost:v}),{info:e,id:i,txid:d,timestamp:h,datetime:this.iso8601(h),network:p,address:o,addressTo:o,addressFrom:n,tag:r,tagTo:r,tagFrom:a,type:l,amount:f,currency:g,status:u,updated:c,internal:!1,comment:void 0,fee:y}}async withdraw(e,t,i,s=void 0,r={}){[s,r]=this.handleWithdrawTagAndParams(s,r),this.checkAddress(i),await this.loadMarkets();const a=this.currency(e),o={coin:a.id,amount:t,addressTo:i};let n;[n,r]=this.handleNetworkCodeAndParams(r),void 0!==n&&(o.chainName=this.networkCodeToId(n)),void 0!==s&&(o.tag=s);const d=await this.spotV1PrivatePostWithdrawCommit(this.extend(o,r)),h=this.safeDict(d,"data",{});return this.parseTransaction(h,a)}parseDepositWithdrawFee(e,t=void 0){const i=this.safeList(e,"chainDetail",[]),s=i.length,r={info:e,withdraw:{fee:void 0,percentage:void 0},deposit:{fee:void 0,percentage:void 0},networks:{}};if(0!==s)for(let e=0;e200&&(i=200),r.limit=i);const o=this.safeInteger(s,"until");void 0!==o&&(s=this.omit(s,"until"),r.endTime=o);const n=await this.fapiV2PrivateGetFuturesTransferHistory(this.extend(r,s)),d=this.safeList(n,"data",[]);return this.parseTransfers(d,a,t,i)}async transfer(e,t,i,s,r={}){await this.loadMarkets();const a=this.currency(e),o=this.safeDict(this.options,"accountsByType",{}),n=this.safeString(o,i,i),d=this.safeString(o,s,s),h={coinSymbol:a.id,amount:this.currencyToPrecision(e,t),transferType:n+"_to_"+d},c=await this.fapiV2PrivatePostFuturesTransfer(this.extend(h,r)),l=this.safeDict(c,"data",{});return this.parseTransfer(l,a)}async setLeverage(e,t=void 0,i={}){if(void 0===t)throw new r.ArgumentsRequired(this.id+" setLeverage() requires a symbol argument");if(e<1||e>125)throw new r.BadRequest(this.id+" leverage should be between 1 and 125");await this.loadMarkets();const s=this.market(t);let a;const o={contractName:s.id,leverage:e};if(!s.swap)throw new r.NotSupported(this.id+" setLeverage only support swap markets");return s.linear?a=await this.fapiV2PrivatePostLevelEdit(this.extend(o,i)):s.inverse&&(a=await this.dapiV2PrivatePostLevelEdit(this.extend(o,i))),a}parseMarginModification(e,t=void 0){return{info:e,symbol:t.symbol,type:void 0,marginMode:"isolated",amount:void 0,total:void 0,code:void 0,status:void 0,timestamp:void 0,datetime:void 0}}async setMargin(e,t,i={}){await this.loadMarkets();const s=this.market(e);if(!s.swap)throw new r.NotSupported(this.id+" setMargin only support swap markets");let a;const o={contractName:s.id,amount:this.parseToNumeric(t)};return s.linear?a=await this.fapiV2PrivatePostPositionMargin(this.extend(o,i)):s.inverse&&(a=await this.dapiV2PrivatePostPositionMargin(this.extend(o,i))),this.parseMarginModification(a,s)}sign(e,t="public",i="GET",s={},r=void 0,a=void 0){const o=this.safeString(t,0),d=this.safeString(t,1),h=this.safeString(t,2);let c;if(c="api"===o&&"kline"===d||"open"===o&&e.indexOf("listenKey")>=0?this.urls.api[o]:this.urls.api[o]+"/"+d,c=c+"/"+this.implodeParams(e,s),s=this.omit(s,this.extractParams(e)),"private"===h){this.checkRequiredCredentials();const t=this.safeInteger(this.options,"recvWindow",5e3);if("spot"===o||"open"===o){let e=this.urlencode(this.extend({timestamp:this.nonce(),recvWindow:t},s));e+="&signature="+this.hmac(this.encode(e),this.encode(this.secret),n.s),r={"X-MBX-APIKEY":this.apiKey},"GET"===i||"DELETE"===i?c+="?"+e:(a=e,r["Content-Type"]="application/x-www-form-urlencoded")}else{const h=this.nonce().toString();let l;"fapi"===o?l="/fapi":"dapi"===o&&(l="/dapi"),l=l+"/"+d+"/"+e;let u=h+i+l;if("GET"===i){Object.keys(s).length>0&&(u+="?"+this.urlencode(s));const e=this.hmac(this.encode(u),this.encode(this.secret),n.s);r={"X-CH-APIKEY":this.apiKey,"X-CH-SIGN":e,"X-CH-TS":h},c+="?"+this.urlencode(s)}else{const e=this.extend({recvWindow:t},s);u+=a=this.json(e);const i=this.hmac(this.encode(u),this.encode(this.secret),n.s);r={"Content-Type":"application/json","X-CH-APIKEY":this.apiKey,"X-CH-SIGN":i,"X-CH-TS":h}}}}else Object.keys(s).length&&(c+="?"+this.urlencode(s));return{url:c,method:i,body:a,headers:r}}handleErrors(e,t,i,s,o,n,d,h,c){if(418===e||429===e)throw new r.DDoSProtection(this.id+" "+e.toString()+" "+t+" "+n);if(e>=400){if(n.indexOf("Price * QTY is zero or less")>=0)throw new r.InvalidOrder(this.id+" order cost = amount * price is zero or less "+n);if(n.indexOf("LOT_SIZE")>=0)throw new r.InvalidOrder(this.id+" order amount should be evenly divisible by lot size "+n);if(n.indexOf("PRICE_FILTER")>=0)throw new r.InvalidOrder(this.id+" order price is invalid, i.e. exceeds allowed price precision, exceeds min price or max price limits or is invalid float value in general, use this.priceToPrecision (symbol, amount) "+n)}if(void 0===d)return;const l=this.safeBool(d,"success",!0);if(!l){const e=this.safeString(d,"msg");let t;if(void 0!==e){try{t=JSON.parse(e)}catch(e){t=void 0}void 0!==t&&(d=t)}}const u=this.safeString(d,"msg");void 0!==u&&(this.throwExactlyMatchedException(this.exceptions.exact,u,this.id+" "+u),this.throwBroadlyMatchedException(this.exceptions.broad,u,this.id+" "+u));const f=this.safeString(d,"code");if(void 0!==f){if("200"===f||a.Y.stringEquals(f,"0"))return;if("-2015"===f&&this.options.hasAlreadyAuthenticatedSuccessfully)throw new r.DDoSProtection(this.id+" temporary banned: "+n);const e=this.id+" "+n;throw this.throwExactlyMatchedException(this.exceptions.exact,f,e),new r.ExchangeError(e)}if(!l)throw new r.ExchangeError(this.id+" "+n)}calculateRateLimiterCost(e,t,i,s,r={}){if("noSymbol"in r&&!("symbol"in s))return r.noSymbol;if("byLimit"in r&&"limit"in s){const e=s.limit,t=r.byLimit;for(let i=0;i{i.d(t,{A:()=>d});var s=i(9656),r=i(2079),a=i(5147),o=i(1579),n=i(4852);class d extends s.A{describe(){return this.deepExtend(super.describe(),{id:"bitso",name:"Bitso",countries:["MX"],rateLimit:2e3,version:"v3",has:{CORS:void 0,spot:!0,margin:!1,swap:!1,future:!1,option:!1,addMargin:!1,borrowCrossMargin:!1,borrowIsolatedMargin:!1,borrowMargin:!1,cancelAllOrders:!0,cancelOrder:!0,cancelOrders:!0,closeAllPositions:!1,closePosition:!1,createDepositAddress:!1,createOrder:!0,createOrderWithTakeProfitAndStopLoss:!1,createOrderWithTakeProfitAndStopLossWs:!1,createReduceOnlyOrder:!1,fetchAccounts:!1,fetchBalance:!0,fetchBorrowInterest:!1,fetchBorrowRate:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchBorrowRates:!1,fetchBorrowRatesPerSymbol:!1,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchDeposit:!0,fetchDepositAddress:!0,fetchDepositAddresses:!1,fetchDepositAddressesByNetwork:!1,fetchDeposits:!0,fetchDepositsWithdrawals:!1,fetchDepositWithdrawFee:"emulated",fetchDepositWithdrawFees:!0,fetchFundingHistory:!1,fetchFundingInterval:!1,fetchFundingIntervals:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchGreeks:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchIsolatedPositions:!1,fetchLedger:!0,fetchLeverage:!1,fetchLeverages:!1,fetchLeverageTiers:!1,fetchLiquidations:!1,fetchLongShortRatio:!1,fetchLongShortRatioHistory:!1,fetchMarginAdjustmentHistory:!1,fetchMarginMode:!1,fetchMarginModes:!1,fetchMarketLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMarkPrices:!1,fetchMyLiquidations:!1,fetchMySettlementHistory:!1,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenInterest:!1,fetchOpenInterestHistory:!1,fetchOpenInterests:!1,fetchOpenOrders:!0,fetchOption:!1,fetchOptionChain:!1,fetchOrder:!0,fetchOrderBook:!0,fetchOrderTrades:!0,fetchPosition:!1,fetchPositionHistory:!1,fetchPositionMode:!1,fetchPositions:!1,fetchPositionsForSymbol:!1,fetchPositionsHistory:!1,fetchPositionsRisk:!1,fetchPremiumIndexOHLCV:!1,fetchSettlementHistory:!1,fetchTicker:!0,fetchTickers:!1,fetchTime:!1,fetchTrades:!0,fetchTradingFee:!1,fetchTradingFees:!0,fetchTransactionFee:!1,fetchTransactionFees:!0,fetchTransactions:!1,fetchTransfer:!1,fetchTransfers:!1,fetchVolatilityHistory:!1,reduceMargin:!1,repayCrossMargin:!1,repayIsolatedMargin:!1,setLeverage:!1,setMargin:!1,setMarginMode:!1,setPositionMode:!1,transfer:!1,withdraw:!0},urls:{logo:"https://github.com/user-attachments/assets/178c8e56-9054-4107-b192-5e5053d4f975",api:{rest:"https://bitso.com/api"},test:{rest:"https://stage.bitso.com/api"},www:"https://bitso.com",doc:"https://bitso.com/api_info",fees:"https://bitso.com/fees",referral:"https://bitso.com/?ref=itej"},precisionMode:o.kb,options:{precision:{XRP:1e-6,MXN:.01,TUSD:.01},defaultPrecision:1e-8,networks:{TRC20:"trx",ERC20:"erc20",BEP20:"bsc",BEP2:"bep2"}},timeframes:{"1m":"60","5m":"300","15m":"900","30m":"1800","1h":"3600","4h":"14400","12h":"43200","1d":"86400","1w":"604800"},api:{public:{get:["available_books","ticker","order_book","trades","ohlc"]},private:{get:["account_status","balance","fees","fundings","fundings/{fid}","funding_destination","kyc_documents","ledger","ledger/trades","ledger/fees","ledger/fundings","ledger/withdrawals","mx_bank_codes","open_orders","order_trades/{oid}","orders/{oid}","user_trades","user_trades/{tid}","withdrawals/","withdrawals/{wid}"],post:["bitcoin_withdrawal","debit_card_withdrawal","ether_withdrawal","orders","phone_number","phone_verification","phone_withdrawal","spei_withdrawal","ripple_withdrawal","bcash_withdrawal","litecoin_withdrawal"],delete:["orders","orders/{oid}","orders/all"]}},features:{spot:{sandbox:!1,createOrder:{marginMode:!1,triggerPrice:!0,triggerPriceType:void 0,triggerDirection:void 0,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!0,FOK:!0,PO:!0,GTD:!1},hedged:!1,trailing:!1,leverage:!1,marketBuyRequiresPrice:!1,marketBuyByCost:!1,selfTradePrevention:!1,iceberg:!1},createOrders:void 0,fetchMyTrades:{marginMode:!1,limit:100,daysBack:void 0,untilDays:void 0,symbolRequired:!0},fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!0},fetchOpenOrders:{marginMode:!1,limit:500,trigger:!1,trailing:!1,symbolRequired:!0},fetchOrders:void 0,fetchClosedOrders:void 0,fetchOHLCV:{limit:300}},swap:{linear:void 0,inverse:void 0},future:{linear:void 0,inverse:void 0}},exceptions:{"0201":r.AuthenticationError,104:r.InvalidNonce,"0304":r.BadRequest}})}async fetchLedger(e=void 0,t=void 0,i=void 0,s={}){const r={};void 0!==i&&(r.limit=i);const a=await this.privateGetLedger(this.extend(r,s)),o=this.safeValue(a,"payload",[]),n=this.safeCurrency(e);return this.parseLedger(o,n,t,i)}parseLedgerEntryType(e){return this.safeString({funding:"transaction",withdrawal:"transaction",trade:"trade",fee:"fee"},e,e)}parseLedgerEntry(e,t=void 0){const i=this.safeString(e,"operation"),s=this.parseLedgerEntryType(i),r=this.safeValue(e,"balance_updates",[]),o=this.safeValue(r,0,{});let n,d;const h=this.safeString(o,"amount"),c=this.safeString(o,"currency"),l=this.safeCurrencyCode(c,t);t=this.safeCurrency(c,t);const u=this.safeValue(e,"details",{});let f=this.safeString2(u,"fid","wid");if(void 0===f&&(f=this.safeString(u,"tid")),"funding"===i)n="in";else if("withdrawal"===i)n="out";else if("trade"===i)n=void 0;else if("fee"===i){n="out";d={cost:a.Y.stringAbs(h),currency:t}}const p=this.parse8601(this.safeString(e,"created_at"));return this.safeLedgerEntry({info:e,id:this.safeString(e,"eid"),direction:n,account:void 0,referenceId:f,referenceAccount:void 0,type:s,currency:l,amount:h,timestamp:p,datetime:this.iso8601(p),before:void 0,after:void 0,status:"ok",fee:d},t)}async fetchMarkets(e={}){const t=await this.publicGetAvailableBooks(e),i=this.safeValue(t,"payload",[]),s=[];for(let e=0;e=0){const e=a.split("?dt=");a=this.safeString(e,0),r=this.safeString(e,1)}return this.checkAddress(a),{info:s,currency:e,network:void 0,address:a,tag:r}}async fetchTransactionFees(e=void 0,t={}){await this.loadMarkets();const i=await this.privateGetFees(t),s={},r=this.safeValue(i,"payload",{}),a=this.safeValue(r,"deposit_fees",[]);for(let t=0;t{i.d(t,{A:()=>d});var s=i(5223),r=i(2079),a=i(5147),o=i(1579),n=i(4852);class d extends s.A{describe(){return this.deepExtend(super.describe(),{id:"bitstamp",name:"Bitstamp",countries:["GB"],rateLimit:75,version:"v2",userAgent:this.userAgents.chrome,pro:!0,has:{CORS:!0,spot:!0,margin:!1,swap:!1,future:!1,option:!1,addMargin:!1,borrowCrossMargin:!1,borrowIsolatedMargin:!1,borrowMargin:!1,cancelAllOrders:!0,cancelOrder:!0,closeAllPositions:!1,closePosition:!1,createOrder:!0,createOrderWithTakeProfitAndStopLoss:!1,createOrderWithTakeProfitAndStopLossWs:!1,createReduceOnlyOrder:!1,createStopLimitOrder:!1,createStopMarketOrder:!1,createStopOrder:!1,fetchBalance:!0,fetchBorrowInterest:!1,fetchBorrowRate:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchBorrowRates:!1,fetchBorrowRatesPerSymbol:!1,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!0,fetchDepositAddress:!0,fetchDepositAddresses:!1,fetchDepositAddressesByNetwork:!1,fetchDepositsWithdrawals:!0,fetchDepositWithdrawFee:"emulated",fetchDepositWithdrawFees:!0,fetchFundingHistory:!1,fetchFundingInterval:!1,fetchFundingIntervals:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchGreeks:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchIsolatedPositions:!1,fetchLedger:!0,fetchLeverage:!1,fetchLeverages:!1,fetchLeverageTiers:!1,fetchLiquidations:!1,fetchLongShortRatio:!1,fetchLongShortRatioHistory:!1,fetchMarginAdjustmentHistory:!1,fetchMarginMode:!1,fetchMarginModes:!1,fetchMarketLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMarkPrices:!1,fetchMyLiquidations:!1,fetchMySettlementHistory:!1,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenInterest:!1,fetchOpenInterestHistory:!1,fetchOpenInterests:!1,fetchOpenOrders:!0,fetchOption:!1,fetchOptionChain:!1,fetchOrder:!0,fetchOrderBook:!0,fetchPosition:!1,fetchPositionHistory:!1,fetchPositionMode:!1,fetchPositions:!1,fetchPositionsForSymbol:!1,fetchPositionsHistory:!1,fetchPositionsRisk:!1,fetchPremiumIndexOHLCV:!1,fetchSettlementHistory:!1,fetchTicker:!0,fetchTickers:!0,fetchTrades:!0,fetchTradingFee:!0,fetchTradingFees:!0,fetchTransactionFees:!0,fetchTransactions:"emulated",fetchVolatilityHistory:!1,fetchWithdrawals:!0,reduceMargin:!1,repayCrossMargin:!1,repayIsolatedMargin:!1,setLeverage:!1,setMargin:!1,setMarginMode:!1,setPositionMode:!1,transfer:!0,withdraw:!0},urls:{logo:"https://github.com/user-attachments/assets/d5480572-1fee-43cb-b900-d38c522d0024",api:{public:"https://www.bitstamp.net/api",private:"https://www.bitstamp.net/api"},www:"https://www.bitstamp.net",doc:"https://www.bitstamp.net/api"},timeframes:{"1m":"60","3m":"180","5m":"300","15m":"900","30m":"1800","1h":"3600","2h":"7200","4h":"14400","6h":"21600","12h":"43200","1d":"86400","1w":"259200"},requiredCredentials:{apiKey:!0,secret:!0},api:{public:{get:{"ohlc/{pair}/":1,"order_book/{pair}/":1,"ticker/":1,"ticker_hour/{pair}/":1,"ticker/{pair}/":1,"transactions/{pair}/":1,"trading-pairs-info/":1,"currencies/":1,"eur_usd/":1,"travel_rule/vasps/":1}},private:{get:{"travel_rule/contacts/":1,"contacts/{contact_uuid}/":1,"earn/subscriptions/":1,"earn/transactions/":1},post:{"account_balances/":1,"account_balances/{currency}/":1,"balance/":1,"balance/{pair}/":1,"bch_withdrawal/":1,"bch_address/":1,"user_transactions/":1,"user_transactions/{pair}/":1,"crypto-transactions/":1,open_order:1,"open_orders/all/":1,"open_orders/{pair}/":1,"order_status/":1,"cancel_order/":1,"cancel_all_orders/":1,"cancel_all_orders/{pair}/":1,"buy/{pair}/":1,"buy/market/{pair}/":1,"buy/instant/{pair}/":1,"sell/{pair}/":1,"sell/market/{pair}/":1,"sell/instant/{pair}/":1,"transfer-to-main/":1,"transfer-from-main/":1,"my_trading_pairs/":1,"fees/trading/":1,"fees/trading/{market_symbol}":1,"fees/withdrawal/":1,"fees/withdrawal/{currency}/":1,"withdrawal-requests/":1,"withdrawal/open/":1,"withdrawal/status/":1,"withdrawal/cancel/":1,"liquidation_address/new/":1,"liquidation_address/info/":1,"btc_unconfirmed/":1,"websockets_token/":1,"btc_withdrawal/":1,"btc_address/":1,"ripple_withdrawal/":1,"ripple_address/":1,"ltc_withdrawal/":1,"ltc_address/":1,"eth_withdrawal/":1,"eth_address/":1,"xrp_withdrawal/":1,"xrp_address/":1,"xlm_withdrawal/":1,"xlm_address/":1,"pax_withdrawal/":1,"pax_address/":1,"link_withdrawal/":1,"link_address/":1,"usdc_withdrawal/":1,"usdc_address/":1,"omg_withdrawal/":1,"omg_address/":1,"dai_withdrawal/":1,"dai_address/":1,"knc_withdrawal/":1,"knc_address/":1,"mkr_withdrawal/":1,"mkr_address/":1,"zrx_withdrawal/":1,"zrx_address/":1,"gusd_withdrawal/":1,"gusd_address/":1,"aave_withdrawal/":1,"aave_address/":1,"bat_withdrawal/":1,"bat_address/":1,"uma_withdrawal/":1,"uma_address/":1,"snx_withdrawal/":1,"snx_address/":1,"uni_withdrawal/":1,"uni_address/":1,"yfi_withdrawal/":1,"yfi_address/":1,"audio_withdrawal/":1,"audio_address/":1,"crv_withdrawal/":1,"crv_address/":1,"algo_withdrawal/":1,"algo_address/":1,"comp_withdrawal/":1,"comp_address/":1,"grt_withdrawal/":1,"grt_address/":1,"usdt_withdrawal/":1,"usdt_address/":1,"eurt_withdrawal/":1,"eurt_address/":1,"matic_withdrawal/":1,"matic_address/":1,"sushi_withdrawal/":1,"sushi_address/":1,"chz_withdrawal/":1,"chz_address/":1,"enj_withdrawal/":1,"enj_address/":1,"alpha_withdrawal/":1,"alpha_address/":1,"ftt_withdrawal/":1,"ftt_address/":1,"storj_withdrawal/":1,"storj_address/":1,"axs_withdrawal/":1,"axs_address/":1,"sand_withdrawal/":1,"sand_address/":1,"hbar_withdrawal/":1,"hbar_address/":1,"rgt_withdrawal/":1,"rgt_address/":1,"fet_withdrawal/":1,"fet_address/":1,"skl_withdrawal/":1,"skl_address/":1,"cel_withdrawal/":1,"cel_address/":1,"sxp_withdrawal/":1,"sxp_address/":1,"ada_withdrawal/":1,"ada_address/":1,"slp_withdrawal/":1,"slp_address/":1,"ftm_withdrawal/":1,"ftm_address/":1,"perp_withdrawal/":1,"perp_address/":1,"dydx_withdrawal/":1,"dydx_address/":1,"gala_withdrawal/":1,"gala_address/":1,"shib_withdrawal/":1,"shib_address/":1,"amp_withdrawal/":1,"amp_address/":1,"sgb_withdrawal/":1,"sgb_address/":1,"avax_withdrawal/":1,"avax_address/":1,"wbtc_withdrawal/":1,"wbtc_address/":1,"ctsi_withdrawal/":1,"ctsi_address/":1,"cvx_withdrawal/":1,"cvx_address/":1,"imx_withdrawal/":1,"imx_address/":1,"nexo_withdrawal/":1,"nexo_address/":1,"ust_withdrawal/":1,"ust_address/":1,"ant_withdrawal/":1,"ant_address/":1,"gods_withdrawal/":1,"gods_address/":1,"rad_withdrawal/":1,"rad_address/":1,"band_withdrawal/":1,"band_address/":1,"inj_withdrawal/":1,"inj_address/":1,"rly_withdrawal/":1,"rly_address/":1,"rndr_withdrawal/":1,"rndr_address/":1,"vega_withdrawal/":1,"vega_address/":1,"1inch_withdrawal/":1,"1inch_address/":1,"ens_withdrawal/":1,"ens_address/":1,"mana_withdrawal/":1,"mana_address/":1,"lrc_withdrawal/":1,"lrc_address/":1,"ape_withdrawal/":1,"ape_address/":1,"mpl_withdrawal/":1,"mpl_address/":1,"euroc_withdrawal/":1,"euroc_address/":1,"sol_withdrawal/":1,"sol_address/":1,"dot_withdrawal/":1,"dot_address/":1,"near_withdrawal/":1,"near_address/":1,"doge_withdrawal/":1,"doge_address/":1,"flr_withdrawal/":1,"flr_address/":1,"dgld_withdrawal/":1,"dgld_address/":1,"ldo_withdrawal/":1,"ldo_address/":1,"travel_rule/contacts/":1,"earn/subscribe/":1,"earn/subscriptions/setting/":1,"earn/unsubscribe":1,"wecan_withdrawal/":1,"wecan_address/":1,"trac_withdrawal/":1,"trac_address/":1,"eurcv_withdrawal/":1,"eurcv_address/":1,"pyusd_withdrawal/":1,"pyusd_address/":1,"lmwr_withdrawal/":1,"lmwr_address/":1,"pepe_withdrawal/":1,"pepe_address/":1,"blur_withdrawal/":1,"blur_address/":1,"vext_withdrawal/":1,"vext_address/":1,"cspr_withdrawal/":1,"cspr_address/":1,"vchf_withdrawal/":1,"vchf_address/":1,"veur_withdrawal/":1,"veur_address/":1,"truf_withdrawal/":1,"truf_address/":1,"wif_withdrawal/":1,"wif_address/":1,"smt_withdrawal/":1,"smt_address/":1,"sui_withdrawal/":1,"sui_address/":1,"jup_withdrawal/":1,"jup_address/":1,"ondo_withdrawal/":1,"ondo_address/":1,"boba_withdrawal/":1,"boba_address/":1,"pyth_withdrawal/":1,"pyth_address/":1}}},fees:{trading:{tierBased:!0,percentage:!0,taker:this.parseNumber("0.004"),maker:this.parseNumber("0.004"),tiers:{taker:[[this.parseNumber("0"),this.parseNumber("0.004")],[this.parseNumber("10000"),this.parseNumber("0.003")],[this.parseNumber("100000"),this.parseNumber("0.002")],[this.parseNumber("500000"),this.parseNumber("0.0018")],[this.parseNumber("1500000"),this.parseNumber("0.0016")],[this.parseNumber("5000000"),this.parseNumber("0.0012")],[this.parseNumber("20000000"),this.parseNumber("0.001")],[this.parseNumber("50000000"),this.parseNumber("0.0008")],[this.parseNumber("100000000"),this.parseNumber("0.0006")],[this.parseNumber("250000000"),this.parseNumber("0.0005")],[this.parseNumber("1000000000"),this.parseNumber("0.0003")]],maker:[[this.parseNumber("0"),this.parseNumber("0.003")],[this.parseNumber("10000"),this.parseNumber("0.002")],[this.parseNumber("100000"),this.parseNumber("0.001")],[this.parseNumber("500000"),this.parseNumber("0.0008")],[this.parseNumber("1500000"),this.parseNumber("0.0006")],[this.parseNumber("5000000"),this.parseNumber("0.0003")],[this.parseNumber("20000000"),this.parseNumber("0.002")],[this.parseNumber("50000000"),this.parseNumber("0.0001")],[this.parseNumber("100000000"),this.parseNumber("0")],[this.parseNumber("250000000"),this.parseNumber("0")],[this.parseNumber("1000000000"),this.parseNumber("0")]]}},funding:{tierBased:!1,percentage:!1,withdraw:{},deposit:{BTC:0,BCH:0,LTC:0,ETH:0,XRP:0,XLM:0,PAX:0,USD:7.5,EUR:0}}},precisionMode:o.kb,commonCurrencies:{UST:"USTC"},options:{networksById:{"bitcoin-cash":"BCH",bitcoin:"BTC",ethereum:"ERC20",litecoin:"LTC",stellar:"XLM",xrpl:"XRP",tron:"TRC20",algorand:"ALGO",flare:"FLR",hedera:"HBAR",cardana:"ADA",songbird:"FLR","avalanche-c-chain":"AVAX",solana:"SOL",polkadot:"DOT",near:"NEAR",doge:"DOGE",sui:"SUI",casper:"CSRP"}},exceptions:{exact:{"No permission found":r.PermissionDenied,"API key not found":r.AuthenticationError,"IP address not allowed":r.PermissionDenied,"Invalid nonce":r.InvalidNonce,"Invalid signature":r.AuthenticationError,"Authentication failed":r.AuthenticationError,"Missing key, signature and nonce parameters":r.AuthenticationError,"Wrong API key format":r.AuthenticationError,"Your account is frozen":r.PermissionDenied,"Please update your profile with your FATCA information, before using API.":r.PermissionDenied,"Order not found.":r.OrderNotFound,"Price is more than 20% below market price.":r.InvalidOrder,"Bitstamp.net is under scheduled maintenance. We'll be back soon.":r.OnMaintenance,"Order could not be placed.":r.ExchangeNotAvailable,"Invalid offset.":r.BadRequest,"Trading is currently unavailable for your account.":r.AccountSuspended},broad:{"Minimum order size is":r.InvalidOrder,"Check your account balance for details.":r.InsufficientFunds,"Ensure this value has at least":r.InvalidAddress,"Ensure that there are no more than":r.InvalidOrder}},features:{spot:{sandbox:!1,createOrder:{marginMode:!1,triggerPrice:!1,triggerPriceType:void 0,triggerDirection:!1,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!0,FOK:!0,PO:!0,GTD:!0},hedged:!1,trailing:!1,leverage:!1,marketBuyByCost:!1,marketBuyRequiresPrice:!1,selfTradePrevention:!1,iceberg:!1},createOrders:void 0,fetchMyTrades:{marginMode:!1,limit:1e3,daysBack:void 0,untilDays:30,symbolRequired:!1},fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!1},fetchOpenOrders:{marginMode:!1,limit:void 0,trigger:!1,trailing:!1,symbolRequired:!1},fetchOrders:void 0,fetchClosedOrders:void 0,fetchOHLCV:{limit:1e3}},swap:{linear:void 0,inverse:void 0},future:{linear:void 0,inverse:void 0}}})}async fetchMarkets(e={}){const t=await this.fetchMarketsFromCache(e),i=[];for(let e=0;es){const i=await this.publicGetTradingPairsInfo(e);this.options.fetchMarkets=this.extend(t,{response:i,timestamp:r})}return this.safeValue(this.options.fetchMarkets,"response")}async fetchCurrencies(e={}){const t=await this.fetchMarketsFromCache(e),i={};for(let e=0;e2)throw new r.ExchangeError(this.id+" getMarketFromTrade() too many keys: "+this.json(t)+" in the trade: "+this.json(e));if(2===i){let e=t[0]+t[1];if(e in this.markets_by_id)return this.safeMarket(e);if(e=t[1]+t[0],e in this.markets_by_id)return this.safeMarket(e)}}parseTrade(e,t=void 0){const i=this.safeString2(e,"id","tid");let s,r,o=this.safeString(e,"price"),n=this.safeString(e,"amount");const d=this.safeString(e,"order_id");let h,c=this.safeString(e,"cost");if(void 0===t){const i=Object.keys(e);for(let e=0;e=0&&(h=s,t=this.safeMarket(h,t,"_"))}}void 0===t&&(t=this.getMarketFromTrade(e));const l=this.safeString(e,"fee"),u=t.quote,f=void 0!==h?h:t.marketId;o=this.safeString(e,f,o),n=this.safeString(e,t.baseId,n),c=this.safeString(e,t.quoteId,c),s=t.symbol;const p=this.safeString2(e,"date","datetime");let m,g;if(void 0!==p&&(p.indexOf(" ")>=0?m=this.parse8601(p):(m=parseInt(p),m*=1e3)),"id"in e){if(void 0!==n){a.Y.stringLt(n,"0")?(r="sell",n=a.Y.stringNeg(n)):r="buy"}}else r=this.safeString(e,"type"),r="1"===r?"sell":"0"===r?"buy":void 0;return void 0!==c&&(c=a.Y.stringAbs(c)),void 0!==l&&(g={cost:l,currency:u}),this.safeTrade({id:i,info:e,timestamp:m,datetime:this.iso8601(m),symbol:s,order:d,type:undefined,side:r,takerOrMaker:void 0,price:o,amount:n,cost:c,fee:g},t)}async fetchTrades(e,t=void 0,i=void 0,s={}){await this.loadMarkets();const r=this.market(e),a={pair:r.id,time:"hour"},o=await this.publicGetTransactionsPair(this.extend(a,s));return this.parseTrades(o,r,t,i)}parseOHLCV(e,t=void 0){return[this.safeTimestamp(e,"timestamp"),this.safeNumber(e,"open"),this.safeNumber(e,"high"),this.safeNumber(e,"low"),this.safeNumber(e,"close"),this.safeNumber(e,"volume")]}async fetchOHLCV(e,t="1m",i=void 0,s=void 0,r={}){await this.loadMarkets();const a=this.market(e),o={pair:a.id,step:this.safeString(this.timeframes,t,t)},n=this.parseTimeframe(t);if(void 0===s)if(void 0===i)o.limit=1e3;else{s=1e3;const e=this.parseToInt(i/1e3);o.start=e,o.end=this.sum(e,n*(s-1)),o.limit=s}else{if(void 0!==i){const e=this.parseToInt(i/1e3);o.start=e,o.end=this.sum(e,n*(s-1))}o.limit=Math.min(s,1e3)}const d=await this.publicGetOhlcPair(this.extend(o,r)),h=this.safeValue(d,"data",{}),c=this.safeList(h,"ohlc",[]);return this.parseOHLCVs(c,a,t,i,s)}parseBalance(e){const t={info:e,timestamp:void 0,datetime:void 0};void 0===e&&(e=[]);for(let i=0;i1&&(u=e[0],c=e[1])}let f={currency:void 0,cost:void 0,rate:void 0};return void 0!==o&&(f={currency:n,cost:o,rate:void 0}),{info:e,id:this.safeString(e,"id"),txid:this.safeString(e,"transaction_id"),type:h,currency:r,network:void 0,amount:this.parseNumber(d),status:l,timestamp:i,datetime:this.iso8601(i),address:u,addressFrom:void 0,addressTo:u,tag:c,tagFrom:void 0,tagTo:c,updated:void 0,comment:void 0,internal:void 0,fee:f}}parseTransactionStatus(e){return this.safeString({0:"pending",1:"pending",2:"ok",3:"canceled",4:"failed"},e,e)}parseOrder(e,t=void 0){const i=this.safeString(e,"id"),s=this.safeString(e,"client_order_id");let r=this.safeString(e,"type");void 0!==r&&(r="1"===r?"sell":"buy");const a=this.parse8601(this.safeString(e,"datetime")),o=this.safeStringLower(e,"currency_pair"),n=this.safeSymbol(o,t,"/"),d=this.parseOrderStatus(this.safeString(e,"status")),h=this.safeString(e,"amount"),c=this.safeValue(e,"transactions",[]),l=this.safeString(e,"price");return this.safeOrder({id:i,clientOrderId:s,datetime:this.iso8601(a),timestamp:a,lastTradeTimestamp:void 0,status:d,symbol:n,type:void 0,timeInForce:void 0,postOnly:void 0,side:r,price:l,triggerPrice:void 0,cost:void 0,amount:h,filled:void 0,remaining:void 0,trades:c,fee:void 0,info:e,average:void 0},t)}parseLedgerEntryType(e){return this.safeString({0:"transaction",1:"transaction",2:"trade",14:"transfer"},e,e)}parseLedgerEntry(e,t=void 0){const i=this.parseLedgerEntryType(this.safeString(e,"type"));if("trade"===i){const s=this.parseTrade(e);let r;const a=Object.keys(e);for(let e=0;e=0){const t=a[e].replace("_","");r=this.safeMarket(t,r)}void 0===r&&(r=this.getMarketFromTrade(e));const o="buy"===s.side?"in":"out";return this.safeLedgerEntry({info:e,id:s.id,timestamp:s.timestamp,datetime:s.datetime,direction:o,account:void 0,referenceId:s.order,referenceAccount:void 0,type:i,currency:r.base,amount:s.amount,before:void 0,after:void 0,status:"ok",fee:s.fee},t)}{const s=this.parseTransaction(e,t);let r;if("amount"in e){const t=this.safeString(e,"amount");r=a.Y.stringGt(t,"0")?"in":"out"}else if("currency"in s&&void 0!==s.currency){const i=this.safeString(s,"currency");t=this.currency(i);const o=this.safeString(e,t.id);r=a.Y.stringGt(o,"0")?"in":"out"}return this.safeLedgerEntry({info:e,id:s.id,timestamp:s.timestamp,datetime:s.datetime,direction:r,account:void 0,referenceId:s.txid,referenceAccount:void 0,type:i,currency:s.currency,amount:s.amount,before:void 0,after:void 0,status:s.status,fee:s.fee},t)}}async fetchLedger(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();const r={};void 0!==i&&(r.limit=i);const a=await this.privatePostUserTransactions(this.extend(r,s));let o;return void 0!==e&&(o=this.currency(e)),this.parseLedger(a,o,t,i)}async fetchOpenOrders(e=void 0,t=void 0,i=void 0,s={}){let r;await this.loadMarkets(),void 0!==e&&(r=this.market(e));const a=await this.privatePostOpenOrdersAll(s);return this.parseOrders(a,r,t,i,{status:"open",type:"limit"})}getCurrencyName(e){return e.toLowerCase()}isFiat(e){return"USD"===e||"EUR"===e||"GBP"===e}async fetchDepositAddress(e,t={}){if(this.isFiat(e))throw new r.NotSupported(this.id+" fiat fetchDepositAddress() for "+e+" is not supported!");const i=this.getCurrencyName(e),s="privatePost"+this.capitalize(i)+"Address",a=await this[s](t),o=this.safeString(a,"address"),n=this.safeString2(a,"memo_id","destination_tag");return this.checkAddress(o),{info:a,currency:e,network:void 0,address:o,tag:n}}async withdraw(e,t,i,s=void 0,r={}){[s,r]=this.handleWithdrawTagAndParams(s,r),await this.loadMarkets(),this.checkAddress(i);const a={amount:t};let o,n;if(this.isFiat(e))n="privatePostWithdrawalOpen",o=this.currency(e),a.iban=i,a.account_currency=o.id;else{const t=this.getCurrencyName(e);n="privatePost"+this.capitalize(t)+"Withdrawal","XRP"===e?void 0!==s&&(a.destination_tag=s):"XLM"!==e&&"HBAR"!==e||void 0!==s&&(a.memo_id=s),a.address=i}const d=await this[n](this.extend(a,r));return this.parseTransaction(d,o)}async transfer(e,t,i,s,a={}){await this.loadMarkets();const o=this.currency(e),n={amount:this.parseToNumeric(this.currencyToPrecision(e,t)),currency:o.id.toUpperCase()};let d;if("main"===i)n.subAccount=s,d=await this.privatePostTransferFromMain(this.extend(n,a));else{if("main"!==s)throw new r.BadRequest(this.id+" transfer() only supports from or to main");n.subAccount=i,d=await this.privatePostTransferToMain(this.extend(n,a))}const h=this.parseTransfer(d,o);return h.amount=t,h.fromAccount=i,h.toAccount=s,h}parseTransfer(e,t=void 0){const i=this.safeString(e,"status");return{info:e,id:void 0,timestamp:void 0,datetime:void 0,currency:t.code,amount:void 0,fromAccount:void 0,toAccount:void 0,status:this.parseTransferStatus(i)}}parseTransferStatus(e){return this.safeString({ok:"ok",error:"failed"},e,e)}nonce(){return this.milliseconds()}sign(e,t="public",i="GET",s={},r=void 0,a=void 0){let o=this.urls.api[t]+"/";o+=this.version+"/",o+=this.implodeParams(e,s);const d=this.omit(s,this.extractParams(e));if("public"===t)Object.keys(d).length&&(o+="?"+this.urlencode(d));else{this.checkRequiredCredentials();const e="BITSTAMP "+this.apiKey,t=this.uuid(),s=this.milliseconds().toString(),h="v2";let c="";r={"X-Auth":e,"X-Auth-Nonce":t,"X-Auth-Timestamp":s,"X-Auth-Version":h},"POST"===i&&(Object.keys(d).length?(a=this.urlencode(d),c="application/x-www-form-urlencoded",r["Content-Type"]=c):(a=this.urlencode({foo:"bar"}),c="application/x-www-form-urlencoded",r["Content-Type"]=c));const l=a||"",u=e+i+o.replace("https://","")+c+t+s+h+l,f=this.hmac(this.encode(u),this.encode(this.secret),n.s);r["X-Auth-Signature"]=f}return{url:o,method:i,body:a,headers:r}}handleErrors(e,t,i,s,a,o,n,d,h){if(void 0===n)return;const c=this.safeString(n,"status"),l=this.safeValue(n,"error");if("error"===c||void 0!==l){let e=[];if("string"==typeof l)e.push(l);else if(void 0!==l){const t=Object.keys(l);for(let i=0;i{i.d(t,{A:()=>n});var s=i(8535),r=i(2079),a=i(1579),o=i(5147);class n extends s.A{describe(){return this.deepExtend(super.describe(),{id:"bitteam",name:"BIT.TEAM",countries:["UK"],version:"v2.0.6",rateLimit:1,certified:!1,pro:!1,has:{CORS:void 0,spot:!0,margin:!1,swap:!1,future:!1,option:!1,addMargin:!1,borrowCrossMargin:!1,borrowIsolatedMargin:!1,borrowMargin:!1,cancelAllOrders:!0,cancelOrder:!0,cancelOrders:!1,closeAllPositions:!1,closePosition:!1,createDepositAddress:!1,createOrder:!0,createOrderWithTakeProfitAndStopLoss:!1,createOrderWithTakeProfitAndStopLossWs:!1,createPostOnlyOrder:!1,createReduceOnlyOrder:!1,createStopLimitOrder:!1,createStopMarketOrder:!1,createStopOrder:!1,deposit:!1,editOrder:!1,fetchAccounts:!1,fetchBalance:!0,fetchBidsAsks:!1,fetchBorrowInterest:!1,fetchBorrowRate:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchBorrowRates:!1,fetchBorrowRatesPerSymbol:!1,fetchCanceledOrders:!0,fetchClosedOrder:!1,fetchClosedOrders:!0,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!0,fetchDeposit:!1,fetchDepositAddress:!1,fetchDepositAddresses:!1,fetchDepositAddressesByNetwork:!1,fetchDeposits:!1,fetchDepositsWithdrawals:!0,fetchDepositWithdrawFee:!1,fetchDepositWithdrawFees:!1,fetchFundingHistory:!1,fetchFundingInterval:!1,fetchFundingIntervals:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchGreeks:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchIsolatedPositions:!1,fetchL3OrderBook:!1,fetchLedger:!1,fetchLeverage:!1,fetchLeverages:!1,fetchLeverageTiers:!1,fetchLiquidations:!1,fetchLongShortRatio:!1,fetchLongShortRatioHistory:!1,fetchMarginAdjustmentHistory:!1,fetchMarginMode:!1,fetchMarginModes:!1,fetchMarketLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMarkPrices:!1,fetchMyLiquidations:!1,fetchMySettlementHistory:!1,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenInterest:!1,fetchOpenInterestHistory:!1,fetchOpenInterests:!1,fetchOpenOrder:!1,fetchOpenOrders:!0,fetchOption:!1,fetchOptionChain:!1,fetchOrder:!0,fetchOrderBook:!0,fetchOrderBooks:!1,fetchOrders:!0,fetchOrderTrades:!1,fetchPosition:!1,fetchPositionHistory:!1,fetchPositionMode:!1,fetchPositions:!1,fetchPositionsForSymbol:!1,fetchPositionsHistory:!1,fetchPositionsRisk:!1,fetchPremiumIndexOHLCV:!1,fetchSettlementHistory:!1,fetchStatus:!1,fetchTicker:!0,fetchTickers:!0,fetchTime:!1,fetchTrades:!0,fetchTradingFee:!1,fetchTradingFees:!1,fetchTradingLimits:!1,fetchTransactionFee:!1,fetchTransactionFees:!1,fetchTransactions:!0,fetchTransfers:!1,fetchVolatilityHistory:!1,fetchWithdrawal:!1,fetchWithdrawals:!1,fetchWithdrawalWhitelist:!1,reduceMargin:!1,repayCrossMargin:!1,repayIsolatedMargin:!1,repayMargin:!1,setLeverage:!1,setMargin:!1,setMarginMode:!1,setPositionMode:!1,signIn:!1,transfer:!1,withdraw:!1,ws:!1},timeframes:{"1m":"1","5m":"5","15m":"15","1h":"60","1d":"1D"},urls:{logo:"https://github.com/user-attachments/assets/b41b5e0d-98e5-4bd3-8a6e-aeb230a4a135",api:{history:"https://history.bit.team",public:"https://bit.team",private:"https://bit.team"},www:"https://bit.team/",referral:"https://bit.team/auth/sign-up?ref=bitboy2023",doc:["https://bit.team/trade/api/documentation"]},api:{history:{get:{"api/tw/history/{pairName}/{resolution}":1}},public:{get:{"trade/api/asset":1,"trade/api/currencies":1,"trade/api/orderbooks/{symbol}":1,"trade/api/orders":1,"trade/api/pair/{name}":1,"trade/api/pairs":1,"trade/api/pairs/precisions":1,"trade/api/rates":1,"trade/api/trade/{id}":1,"trade/api/trades":1,"trade/api/ccxt/pairs":1,"trade/api/cmc/assets":1,"trade/api/cmc/orderbook/{pair}":1,"trade/api/cmc/summary":1,"trade/api/cmc/ticker":1,"trade/api/cmc/trades/{pair}":1}},private:{get:{"trade/api/ccxt/balance":1,"trade/api/ccxt/order/{id}":1,"trade/api/ccxt/ordersOfUser":1,"trade/api/ccxt/tradesOfUser":1,"trade/api/transactionsOfUser":1},post:{"trade/api/ccxt/cancel-all-order":1,"trade/api/ccxt/cancelorder":1,"trade/api/ccxt/ordercreate":1}}},fees:{trading:{feeSide:"get",tierBased:!1,percentage:!0,taker:this.parseNumber("0.002"),maker:this.parseNumber("0.002")}},precisionMode:a.kb,options:{networksById:{Ethereum:"ERC20",ethereum:"ERC20",Tron:"TRC20",tron:"TRC20",Binance:"BSC",binance:"BSC","Binance Smart Chain":"BSC",bscscan:"BSC",Bitcoin:"BTC",bitcoin:"BTC",Litecoin:"LTC",litecoin:"LTC",Polygon:"POLYGON",polygon:"POLYGON",PRIZM:"PRIZM",Decimal:"Decimal",ufobject:"ufobject",tonchain:"tonchain"},currenciesValuedInUsd:{USDT:!0,BUSD:!0}},features:{spot:{sandbox:!1,createOrder:{marginMode:!1,triggerPrice:!1,triggerPriceType:void 0,triggerDirection:void 0,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!1,FOK:!1,PO:!1,GTD:!1},hedged:!1,trailing:!1,leverage:!1,marketBuyRequiresPrice:!1,marketBuyByCost:!1,selfTradePrevention:!1,iceberg:!1},createOrders:void 0,fetchMyTrades:{marginMode:!1,limit:100,daysBack:1e5,untilDays:1e5,symbolRequired:!1},fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!1},fetchOpenOrders:{marginMode:!1,limit:100,trigger:!1,trailing:!1,symbolRequired:!1},fetchOrders:{marginMode:!0,limit:100,daysBack:void 0,untilDays:void 0,trigger:!1,trailing:!1,symbolRequired:!1},fetchClosedOrders:{marginMode:!1,limit:100,daysBack:void 0,daysBackCanceled:void 0,untilDays:void 0,trigger:!1,trailing:!1,symbolRequired:!1},fetchOHLCV:{limit:1e3}},swap:{linear:void 0,inverse:void 0},future:{linear:void 0,inverse:void 0}},exceptions:{exact:{400002:r.BadSymbol,401e3:r.AuthenticationError,403002:r.BadRequest,404200:r.BadSymbol},broad:{"is not allowed":r.BadRequest,"Insufficient funds":r.InsufficientFunds,"Invalid request params input":r.BadRequest,"must be a number":r.BadRequest,"must be a string":r.BadRequest,"must be of type":r.BadRequest,"must be one of":r.BadRequest,"Order not found":r.OrderNotFound,"Pair with pair name":r.BadSymbol,pairName:r.BadSymbol,"Service Unavailable":r.ExchangeNotAvailable,"Symbol ":r.BadSymbol}}})}async fetchMarkets(e={}){const t=await this.publicGetTradeApiCcxtPairs(e),i=this.safeValue(t,"result",{}),s=this.safeValue(i,"pairs",[]);return this.parseMarkets(s)}parseMarket(e){const t=this.safeString(e,"name"),i=this.safeInteger(e,"id"),s=t.split("_"),r=this.safeString(s,0),a=this.safeString(s,1),o=this.safeCurrencyCode(r),n=this.safeCurrencyCode(a),d=this.safeValue(e,"active"),h=this.safeString(e,"timeStart"),c=this.parse8601(h);let l;const u=this.safeValue(this.options,"currenciesValuedInUsd",{});if(this.safeBool(u,n,!1)){const t=this.safeValue(e,"settings",{});l=this.safeNumber(t,"limit_usd")}return this.safeMarketStructure({id:t,numericId:i,symbol:o+"/"+n,base:o,quote:n,settle:void 0,baseId:r,quoteId:a,settleId:void 0,type:"spot",spot:!0,margin:!1,swap:!1,future:!1,option:!1,active:d,contract:!1,linear:void 0,inverse:void 0,contractSize:void 0,expiry:void 0,expiryDatetime:void 0,strike:void 0,optionType:void 0,precision:{amount:this.parseNumber(this.parsePrecision(this.safeString(e,"baseStep"))),price:this.parseNumber(this.parsePrecision(this.safeString(e,"quoteStep")))},limits:{leverage:{min:void 0,max:void 0},amount:{min:void 0,max:void 0},price:{min:void 0,max:void 0},cost:{min:l,max:void 0}},created:c,info:e})}async fetchCurrencies(e={}){const t=await this.publicGetTradeApiCurrencies(e),i=this.safeValue(t,"result",{}),s=this.safeValue(i,"currencies",[]);let r=await this.publicGetTradeApiCmcAssets();r=this.indexBy(r,"unified_cryptoasset_id");const a={};for(let e=0;e=0&&"GET"===s){const e=i.split("/order/"),t=this.safeString(e,1);throw new r.OrderNotFound(this.id+" order "+t+" not found")}if(i.indexOf("/cmc/orderbook/")>=0){const e=i.split("/cmc/orderbook/"),t=this.safeString(e,1);throw new r.BadSymbol(this.id+" symbolId "+t+" not found")}}const t=this.id+" "+o,a=this.safeString(n,"message"),d=this.safeString(n,"code");throw this.throwBroadlyMatchedException(this.exceptions.broad,a,t),this.throwExactlyMatchedException(this.exceptions.exact,d,t),new r.ExchangeError(t)}}}},2263:(e,t,i)=>{i.d(t,{A:()=>d});var s=i(7754),r=i(2079),a=i(5147),o=i(1579),n=i(4852);class d extends s.A{describe(){return this.deepExtend(super.describe(),{id:"bittrade",name:"BitTrade",countries:["JP"],rateLimit:100,userAgent:this.userAgents.chrome39,certified:!1,version:"v1",hostname:"api-cloud.bittrade.co.jp",pro:!0,has:{CORS:void 0,spot:!0,margin:void 0,swap:!1,future:!1,option:!1,cancelAllOrders:!0,cancelOrder:!0,cancelOrders:!0,createMarketBuyOrderWithCost:!0,createMarketOrderWithCost:!1,createMarketSellOrderWithCost:!1,createOrder:!0,createStopLimitOrder:!1,createStopMarketOrder:!1,createStopOrder:!1,fetchAccounts:!0,fetchBalance:!0,fetchClosedOrders:!0,fetchCurrencies:!0,fetchDepositAddress:!1,fetchDepositAddressesByNetwork:!1,fetchDeposits:!0,fetchFundingHistory:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchIndexOHLCV:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenOrders:!0,fetchOrder:!0,fetchOrderBook:!0,fetchOrders:!0,fetchOrderTrades:!0,fetchPremiumIndexOHLCV:!1,fetchTicker:!0,fetchTickers:!0,fetchTime:!0,fetchTrades:!0,fetchTradingLimits:!0,fetchWithdrawals:!0,withdraw:!0},timeframes:{"1m":"1min","5m":"5min","15m":"15min","30m":"30min","1h":"60min","4h":"4hour","1d":"1day","1w":"1week","1M":"1mon","1y":"1year"},urls:{logo:"https://user-images.githubusercontent.com/1294454/85734211-85755480-b705-11ea-8b35-0b7f1db33a2f.jpg",api:{market:"https://{hostname}",public:"https://{hostname}",private:"https://{hostname}",v2Public:"https://{hostname}",v2Private:"https://{hostname}"},www:"https://www.bittrade.co.jp",referral:"https://www.bittrade.co.jp/register/?invite_code=znnq3",doc:"https://api-doc.bittrade.co.jp",fees:"https://www.bittrade.co.jp/ja-jp/support/fee"},api:{v2Public:{get:{"reference/currencies":1,"market-status":1}},v2Private:{get:{"account/ledger":1,"account/withdraw/quota":1,"account/withdraw/address":1,"account/deposit/address":1,"account/repayment":5,"reference/transact-fee-rate":1,"account/asset-valuation":.2,"point/account":5,"sub-user/user-list":1,"sub-user/user-state":1,"sub-user/account-list":1,"sub-user/deposit-address":1,"sub-user/query-deposit":1,"user/api-key":1,"user/uid":1,"algo-orders/opening":1,"algo-orders/history":1,"algo-orders/specific":1,"c2c/offers":1,"c2c/offer":1,"c2c/transactions":1,"c2c/repayment":1,"c2c/account":1,"etp/reference":1,"etp/transactions":5,"etp/transaction":5,"etp/rebalance":1,"etp/limit":1},post:{"account/transfer":1,"account/repayment":5,"point/transfer":5,"sub-user/management":1,"sub-user/creation":1,"sub-user/tradable-market":1,"sub-user/transferability":1,"sub-user/api-key-generation":1,"sub-user/api-key-modification":1,"sub-user/api-key-deletion":1,"sub-user/deduct-mode":1,"algo-orders":1,"algo-orders/cancel-all-after":1,"algo-orders/cancellation":1,"c2c/offer":1,"c2c/cancellation":1,"c2c/cancel-all":1,"c2c/repayment":1,"c2c/transfer":1,"etp/creation":5,"etp/redemption":5,"etp/{transactId}/cancel":10,"etp/batch-cancel":50}},market:{get:{"history/kline":1,"detail/merged":1,depth:1,trade:1,"history/trade":1,detail:1,tickers:1,etp:1}},public:{get:{"common/symbols":1,"common/currencys":1,"common/timestamp":1,"common/exchange":1,"settings/currencys":1}},private:{get:{"account/accounts":.2,"account/accounts/{id}/balance":.2,"account/accounts/{sub-uid}":1,"account/history":4,"cross-margin/loan-info":1,"margin/loan-info":1,"fee/fee-rate/get":1,"order/openOrders":.4,"order/orders":.4,"order/orders/{id}":.4,"order/orders/{id}/matchresults":.4,"order/orders/getClientOrder":.4,"order/history":1,"order/matchresults":1,"query/deposit-withdraw":1,"margin/loan-orders":.2,"margin/accounts/balance":.2,"cross-margin/loan-orders":1,"cross-margin/accounts/balance":1,"points/actions":1,"points/orders":1,"subuser/aggregate-balance":10,"stable-coin/exchange_rate":1,"stable-coin/quote":1},post:{"account/transfer":1,"futures/transfer":1,"order/batch-orders":.4,"order/orders/place":.2,"order/orders/submitCancelClientOrder":.2,"order/orders/batchCancelOpenOrders":.4,"order/orders/{id}/submitcancel":.2,"order/orders/batchcancel":.4,"dw/withdraw/api/create":1,"dw/withdraw-virtual/{id}/cancel":1,"dw/transfer-in/margin":10,"dw/transfer-out/margin":10,"margin/orders":10,"margin/orders/{id}/repay":10,"cross-margin/transfer-in":1,"cross-margin/transfer-out":1,"cross-margin/orders":1,"cross-margin/orders/{id}/repay":1,"stable-coin/exchange":1,"subuser/transfer":10}}},fees:{trading:{feeSide:"get",tierBased:!1,percentage:!0,maker:this.parseNumber("0.002"),taker:this.parseNumber("0.002")}},features:{spot:{sandbox:!1,createOrder:{marginMode:!1,triggerPrice:!0,triggerPriceType:void 0,triggerDirection:!1,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!1,FOK:!1,PO:!1,GTD:!1},hedged:!1,selfTradePrevention:!1,trailing:!1,leverage:!1,marketBuyByCost:!0,marketBuyRequiresPrice:!1,iceberg:!1},createOrders:void 0,fetchMyTrades:{marginMode:!1,limit:100,daysBack:120,untilDays:2,symbolRequired:!1},fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!1},fetchOpenOrders:{marginMode:!1,limit:void 0,trigger:!1,trailing:!1,symbolRequired:!1},fetchOrders:{marginMode:!1,limit:void 0,daysBack:void 0,untilDays:void 0,trigger:!1,trailing:!1,symbolRequired:!1},fetchClosedOrders:{marginMode:!1,limit:void 0,daysBack:void 0,daysBackCanceled:void 0,untilDays:void 0,trigger:!1,trailing:!1,symbolRequired:!1},fetchOHLCV:{limit:2e3}},swap:{linear:void 0,inverse:void 0},future:{linear:void 0,inverse:void 0}},precisionMode:o.kb,exceptions:{broad:{"contract is restricted of closing positions on API. Please contact customer service":r.OnMaintenance,maintain:r.OnMaintenance},exact:{"bad-request":r.BadRequest,"base-date-limit-error":r.BadRequest,"api-not-support-temp-addr":r.PermissionDenied,timeout:r.RequestTimeout,"gateway-internal-error":r.ExchangeNotAvailable,"account-frozen-balance-insufficient-error":r.InsufficientFunds,"invalid-amount":r.InvalidOrder,"order-limitorder-amount-min-error":r.InvalidOrder,"order-limitorder-amount-max-error":r.InvalidOrder,"order-marketorder-amount-min-error":r.InvalidOrder,"order-limitorder-price-min-error":r.InvalidOrder,"order-limitorder-price-max-error":r.InvalidOrder,"order-holding-limit-failed":r.InvalidOrder,"order-orderprice-precision-error":r.InvalidOrder,"order-etp-nav-price-max-error":r.InvalidOrder,"order-orderstate-error":r.OrderNotFound,"order-queryorder-invalid":r.OrderNotFound,"order-update-error":r.ExchangeNotAvailable,"api-signature-check-failed":r.AuthenticationError,"api-signature-not-valid":r.AuthenticationError,"base-record-invalid":r.OrderNotFound,"base-symbol-trade-disabled":r.BadSymbol,"base-symbol-error":r.BadSymbol,"system-maintenance":r.OnMaintenance,"invalid symbol":r.BadSymbol,"symbol trade not open now":r.BadSymbol,"invalid-address":r.BadRequest,"base-currency-chain-error":r.BadRequest,"dw-insufficient-balance":r.InsufficientFunds}},options:{defaultNetwork:"ERC20",networks:{ETH:"erc20",TRX:"trc20",HRC20:"hrc20",HECO:"hrc20",HT:"hrc20",ALGO:"algo",OMNI:""},fetchOrdersByStatesMethod:"private_get_order_orders",fetchOpenOrdersMethod:"fetch_open_orders_v1",createMarketBuyOrderRequiresPrice:!0,fetchMarketsMethod:"publicGetCommonSymbols",fetchBalanceMethod:"privateGetAccountAccountsIdBalance",createOrderMethod:"privatePostOrderOrdersPlace",currencyToPrecisionRoundingMode:o.R3,language:"en-US",broker:{id:"AA03022abc"}},commonCurrencies:{GET:"Themis",GTC:"Game.com",HIT:"HitChain",PNT:"Penta",SBTC:"Super Bitcoin",BIFI:"Bitcoin File"}})}async fetchTime(e={}){const t=await this.publicGetCommonTimestamp(e);return this.safeInteger(t,"data")}async fetchTradingLimits(e=void 0,t={}){await this.loadMarkets(),void 0===e&&(e=this.symbols);const i={};for(let s=0;s100)&&(i=100),await this.loadMarkets(),void 0!==e&&(r=this.currency(e));const a={type:"deposit",from:0};void 0!==r&&(a.currency=r.id),void 0!==i&&(a.size=i);const o=await this.privateGetQueryDepositWithdraw(this.extend(a,s));return this.parseTransactions(o.data,r,t,i)}async fetchWithdrawals(e=void 0,t=void 0,i=void 0,s={}){let r;(void 0===i||i>100)&&(i=100),await this.loadMarkets(),void 0!==e&&(r=this.currency(e));const a={type:"withdraw",from:0};void 0!==r&&(a.currency=r.id),void 0!==i&&(a.size=i);const o=await this.privateGetQueryDepositWithdraw(this.extend(a,s));return this.parseTransactions(o.data,r,t,i)}parseTransaction(e,t=void 0){const i=this.safeInteger(e,"created-at"),s=this.safeCurrencyCode(this.safeString(e,"currency"));let r=this.safeString(e,"type");"withdraw"===r&&(r="withdrawal");let o=this.safeString(e,"fee");return void 0!==o&&(o=a.Y.stringAbs(o)),{info:e,id:this.safeString2(e,"id","data"),txid:this.safeString(e,"tx-hash"),timestamp:i,datetime:this.iso8601(i),network:this.safeStringUpper(e,"chain"),address:this.safeString(e,"address"),addressTo:void 0,addressFrom:void 0,tag:this.safeString(e,"address-tag"),tagTo:void 0,tagFrom:void 0,type:r,amount:this.safeNumber(e,"amount"),currency:s,status:this.parseTransactionStatus(this.safeString(e,"state")),updated:this.safeInteger(e,"updated-at"),comment:void 0,internal:void 0,fee:{currency:s,cost:this.parseNumber(o),rate:void 0}}}parseTransactionStatus(e){return this.safeString({unknown:"failed",confirming:"pending",confirmed:"ok",safe:"ok",orphan:"failed",submitted:"pending",canceled:"canceled",reexamine:"pending",reject:"failed",pass:"pending","wallet-reject":"failed","confirm-error":"failed",repealed:"failed","wallet-transfer":"pending","pre-transfer":"pending"},e,e)}async withdraw(e,t,i,s=void 0,r={}){[s,r]=this.handleWithdrawTagAndParams(s,r),await this.loadMarkets(),this.checkAddress(i);const a=this.currency(e),o={address:i,amount:t,currency:a.id.toLowerCase()};void 0!==s&&(o["addr-tag"]=s);const n=this.safeValue(this.options,"networks",{});let d=this.safeStringUpper(r,"network");d=this.safeStringLower(n,d,d),void 0!==d&&(o.chain="erc20"===d?a.id+d:d+a.id,r=this.omit(r,"network"));const h=await this.privatePostDwWithdrawApiCreate(this.extend(o,r));return this.parseTransaction(h,a)}sign(e,t="public",i="GET",s={},r=void 0,a=void 0){let o="/";"market"===t?o+=t:"public"===t||"private"===t?o+=this.version:"v2Public"!==t&&"v2Private"!==t||(o+="v2"),o+="/"+this.implodeParams(e,s);const d=this.omit(s,this.extractParams(e));if("private"===t||"v2Private"===t){this.checkRequiredCredentials();const e=this.ymdhms(this.milliseconds(),"T");let t={SignatureMethod:"HmacSHA256",SignatureVersion:"2",AccessKeyId:this.apiKey,Timestamp:e};"POST"!==i&&(t=this.extend(t,d));const s=this.keysort(t);let h=this.urlencode(s);const c=[i,this.hostname,o,h].join("\n"),l=this.hmac(this.encode(c),this.encode(this.secret),n.s,"base64");h+="&"+this.urlencode({Signature:l}),o+="?"+h,"POST"===i?(a=this.json(d),r={"Content-Type":"application/json"}):r={"Content-Type":"application/x-www-form-urlencoded"}}else Object.keys(s).length&&(o+="?"+this.urlencode(s));return o=this.implodeParams(this.urls.api[t],{hostname:this.hostname})+o,{url:o,method:i,body:a,headers:r}}handleErrors(e,t,i,s,a,o,n,d,h){if(void 0!==n&&"status"in n){if("error"===this.safeString(n,"status")){const e=this.safeString(n,"err-code"),t=this.id+" "+o;this.throwBroadlyMatchedException(this.exceptions.broad,o,t),this.throwExactlyMatchedException(this.exceptions.exact,e,t);const i=this.safeString(n,"err-msg");throw this.throwExactlyMatchedException(this.exceptions.exact,i,t),new r.ExchangeError(t)}}}}},587:(e,t,i)=>{i.d(t,{A:()=>r});var s=i(7584);class r extends s.A{describe(){return this.deepExtend(super.describe(),{id:"bitunix",name:"bitunix",countries:["IR"],rateLimit:1e3,version:"1",certified:!1,pro:!1,has:{CORS:void 0,spot:!0,margin:!1,swap:!1,future:!0,option:!1,addMargin:!1,cancelAllOrders:!1,cancelOrder:!1,cancelOrders:!1,createDepositAddress:!1,createOrder:!1,createStopLimitOrder:!1,createStopMarketOrder:!1,createStopOrder:!1,editOrder:!1,fetchBalance:!1,fetchBorrowInterest:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchClosedOrders:!1,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!1,fetchDepositAddress:!1,fetchDeposits:!1,fetchFundingHistory:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchL2OrderBook:!1,fetchL3OrderBook:!1,fetchLedger:!1,fetchLedgerEntry:!1,fetchLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMyTrades:!1,fetchOHLCV:!0,fetchOpenInterestHistory:!1,fetchOpenOrders:!1,fetchOrder:!1,fetchOrderBook:!0,fetchOrders:!1,fetchOrderTrades:"emulated",fetchPositions:!1,fetchPremiumIndexOHLCV:!1,fetchTicker:!0,fetchTickers:!0,fetchTime:!1,fetchTrades:!1,fetchTradingFee:!1,fetchTradingFees:!1,fetchWithdrawals:!1,setLeverage:!1,setMarginMode:!1,transfer:!1,withdraw:!1},comment:"This comment is optional",urls:{logo:"https://cdn.arz.digital/cr-odin/img/exchanges/bitunix/64x64.png",api:{market:"https://openapi.bitunix.com/",tickers:"https://api.bitunix.com/"},www:"https://www.bitunix.com/",doc:["https://openapidoc.bitunix.com/"]},timeframes:{"1m":"1","5m":"5","15m":"15","30m":"30","1h":"60","3h":"180","4h":"240","12h":"720","1d":"1D","1w":"1W"},api:{public:{get:{"api/spot/v1/common/coin_pair/list/":1,"web/api/v1/common/tickers/":1}}},fees:{trading:{tierBased:!1,percentage:!0,maker:this.parseNumber("0.001"),taker:this.parseNumber("0.001")}}})}async fetchMarkets(e={}){const t=await this.publicGetApiSpotV1CommonCoinPairList(e),i=this.safeList(t,"data"),s=[];for(let e=0;e{i.d(t,{A:()=>d});var s=i(8716),r=i(2079),a=i(1579),o=i(5147),n=i(4852);class d extends s.A{describe(){return this.deepExtend(super.describe(),{id:"bitvavo",name:"Bitvavo",countries:["NL"],rateLimit:60,version:"v2",certified:!1,pro:!0,has:{CORS:void 0,spot:!0,margin:!1,swap:!1,future:!1,option:!1,addMargin:!1,borrowCrossMargin:!1,borrowIsolatedMargin:!1,borrowMargin:!1,cancelAllOrders:!0,cancelOrder:!0,closeAllPositions:!1,closePosition:!1,createOrder:!0,createOrderWithTakeProfitAndStopLoss:!1,createOrderWithTakeProfitAndStopLossWs:!1,createPostOnlyOrder:!1,createReduceOnlyOrder:!1,createStopLimitOrder:!0,createStopMarketOrder:!0,createStopOrder:!0,editOrder:!0,fetchBalance:!0,fetchBorrowInterest:!1,fetchBorrowRate:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchBorrowRates:!1,fetchBorrowRatesPerSymbol:!1,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!0,fetchDepositAddress:!0,fetchDepositAddresses:!1,fetchDepositAddressesByNetwork:!1,fetchDeposits:!0,fetchDepositWithdrawFee:"emulated",fetchDepositWithdrawFees:!0,fetchFundingHistory:!1,fetchFundingInterval:!1,fetchFundingIntervals:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchGreeks:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchIsolatedPositions:!1,fetchLeverage:!1,fetchLeverages:!1,fetchLeverageTiers:!1,fetchLiquidations:!1,fetchLongShortRatio:!1,fetchLongShortRatioHistory:!1,fetchMarginAdjustmentHistory:!1,fetchMarginMode:!1,fetchMarginModes:!1,fetchMarketLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMarkPrices:!1,fetchMyLiquidations:!1,fetchMySettlementHistory:!1,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenInterest:!1,fetchOpenInterestHistory:!1,fetchOpenInterests:!1,fetchOpenOrders:!0,fetchOption:!1,fetchOptionChain:!1,fetchOrder:!0,fetchOrderBook:!0,fetchOrders:!0,fetchPosition:!1,fetchPositionHistory:!1,fetchPositionMode:!1,fetchPositions:!1,fetchPositionsForSymbol:!1,fetchPositionsHistory:!1,fetchPositionsRisk:!1,fetchPremiumIndexOHLCV:!1,fetchSettlementHistory:!1,fetchTicker:!0,fetchTickers:!0,fetchTime:!0,fetchTrades:!0,fetchTradingFee:!1,fetchTradingFees:!0,fetchTransfer:!1,fetchTransfers:!1,fetchVolatilityHistory:!1,fetchWithdrawals:!0,reduceMargin:!1,repayCrossMargin:!1,repayIsolatedMargin:!1,repayMargin:!1,setLeverage:!1,setMargin:!1,setMarginMode:!1,setPositionMode:!1,transfer:!1,withdraw:!0},timeframes:{"1m":"1m","5m":"5m","15m":"15m","30m":"30m","1h":"1h","2h":"2h","4h":"4h","6h":"6h","8h":"8h","12h":"12h","1d":"1d"},urls:{logo:"https://github.com/user-attachments/assets/d213155c-8c71-4701-9bd5-45351febc2a8",api:{public:"https://api.bitvavo.com",private:"https://api.bitvavo.com"},www:"https://bitvavo.com/",doc:"https://docs.bitvavo.com/",fees:"https://bitvavo.com/en/fees",referral:"https://bitvavo.com/?a=24F34952F7"},api:{public:{get:{time:1,markets:1,assets:1,"{market}/book":1,"{market}/trades":5,"{market}/candles":1,"ticker/price":1,"ticker/book":1,"ticker/24h":{cost:1,noMarket:25}}},private:{get:{account:1,order:1,orders:5,ordersOpen:{cost:1,noMarket:25},trades:5,balance:5,deposit:1,depositHistory:5,withdrawalHistory:5},post:{order:1,withdrawal:1},put:{order:1},delete:{order:1,orders:1}}},fees:{trading:{tierBased:!0,percentage:!0,taker:this.parseNumber("0.0025"),maker:this.parseNumber("0.002"),tiers:{taker:[[this.parseNumber("0"),this.parseNumber("0.0025")],[this.parseNumber("100000"),this.parseNumber("0.0020")],[this.parseNumber("250000"),this.parseNumber("0.0016")],[this.parseNumber("500000"),this.parseNumber("0.0012")],[this.parseNumber("1000000"),this.parseNumber("0.0010")],[this.parseNumber("2500000"),this.parseNumber("0.0008")],[this.parseNumber("5000000"),this.parseNumber("0.0006")],[this.parseNumber("10000000"),this.parseNumber("0.0005")],[this.parseNumber("25000000"),this.parseNumber("0.0004")]],maker:[[this.parseNumber("0"),this.parseNumber("0.0015")],[this.parseNumber("100000"),this.parseNumber("0.0010")],[this.parseNumber("250000"),this.parseNumber("0.0008")],[this.parseNumber("500000"),this.parseNumber("0.0006")],[this.parseNumber("1000000"),this.parseNumber("0.0005")],[this.parseNumber("2500000"),this.parseNumber("0.0004")],[this.parseNumber("5000000"),this.parseNumber("0.0004")],[this.parseNumber("10000000"),this.parseNumber("0.0003")],[this.parseNumber("25000000"),this.parseNumber("0.0003")]]}}},requiredCredentials:{apiKey:!0,secret:!0},features:{spot:{sandbox:!1,createOrder:{marginMode:!1,triggerPrice:!0,triggerPriceType:void 0,triggerDirection:void 0,stopLossPrice:!0,takeProfitPrice:!0,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!0,FOK:!0,PO:!0,GTD:!1},hedged:!1,trailing:!1,leverage:!1,marketBuyRequiresPrice:!1,marketBuyByCost:!0,selfTradePrevention:!0,iceberg:!1},createOrders:void 0,fetchMyTrades:{marginMode:!1,limit:1e3,daysBack:1e5,untilDays:1e5,symbolRequired:!0},fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!0},fetchOpenOrders:{marginMode:!1,limit:void 0,trigger:!1,trailing:!1,symbolRequired:!0},fetchOrders:{marginMode:!0,limit:1e3,daysBack:1e5,untilDays:1e5,trigger:!1,trailing:!1,symbolRequired:!0},fetchClosedOrders:void 0,fetchOHLCV:{limit:1440}},swap:{linear:void 0,inverse:void 0},future:{linear:void 0,inverse:void 0}},exceptions:{exact:{101:r.ExchangeError,102:r.BadRequest,103:r.RateLimitExceeded,104:r.RateLimitExceeded,105:r.PermissionDenied,107:r.ExchangeNotAvailable,108:r.ExchangeNotAvailable,109:r.ExchangeNotAvailable,110:r.BadRequest,200:r.BadRequest,201:r.BadRequest,202:r.BadRequest,203:r.BadSymbol,204:r.BadRequest,205:r.BadRequest,206:r.BadRequest,210:r.InvalidOrder,211:r.InvalidOrder,212:r.InvalidOrder,213:r.InvalidOrder,214:r.InvalidOrder,215:r.InvalidOrder,216:r.InsufficientFunds,217:r.InvalidOrder,230:r.ExchangeError,231:r.ExchangeError,232:r.BadRequest,233:r.InvalidOrder,234:r.InvalidOrder,235:r.ExchangeError,236:r.BadRequest,240:r.OrderNotFound,300:r.AuthenticationError,301:r.AuthenticationError,302:r.AuthenticationError,303:r.AuthenticationError,304:r.AuthenticationError,305:r.AuthenticationError,306:r.AuthenticationError,307:r.PermissionDenied,308:r.AuthenticationError,309:r.AuthenticationError,310:r.PermissionDenied,311:r.PermissionDenied,312:r.PermissionDenied,315:r.BadRequest,317:r.AccountSuspended,400:r.ExchangeError,401:r.ExchangeError,402:r.PermissionDenied,403:r.PermissionDenied,404:r.OnMaintenance,405:r.ExchangeError,406:r.BadRequest,407:r.ExchangeError,408:r.InsufficientFunds,409:r.InvalidAddress,410:r.ExchangeError,411:r.BadRequest,412:r.InvalidAddress,413:r.InvalidAddress,414:r.ExchangeError},broad:{"start parameter is invalid":r.BadRequest,"symbol parameter is invalid":r.BadSymbol,"amount parameter is invalid":r.InvalidOrder,"orderId parameter is invalid":r.InvalidOrder}},options:{currencyToPrecisionRoundingMode:a.R3,"BITVAVO-ACCESS-WINDOW":1e4,networks:{ERC20:"ETH",TRC20:"TRX"},operatorId:void 0,fiatCurrencies:["EUR"]},precisionMode:a.v,commonCurrencies:{MIOTA:"IOTA"}})}amountToPrecision(e,t){return this.decimalToPrecision(t,a.R3,this.markets[e].precision.amount,a.fv)}priceToPrecision(e,t){return t=this.decimalToPrecision(t,a.D_,this.markets[e].precision.price,this.precisionMode),this.decimalToPrecision(t,a.R3,8,a.fv)}async fetchTime(e={}){const t=await this.publicGetTime(e);return this.safeInteger(t,"time")}async fetchMarkets(e={}){const t=await this.publicGetMarkets(e);return this.parseMarkets(t)}parseMarkets(e){const t=this.currencies,i=this.indexBy(t,"id"),s=[],r=this.fees;for(let t=0;t{i.d(t,{A:()=>n});var s=i(5254),r=i(2079),a=i(5147),o=i(1579);class n extends s.A{describe(){return this.deepExtend(super.describe(),{id:"blockchaincom",secret:void 0,name:"Blockchain.com",countries:["LX"],rateLimit:500,version:"v3",pro:!0,has:{CORS:!1,spot:!0,margin:void 0,swap:!1,future:!1,option:!1,cancelAllOrders:!0,cancelOrder:!0,createOrder:!0,createStopLimitOrder:!0,createStopMarketOrder:!0,createStopOrder:!0,fetchBalance:!0,fetchCanceledOrders:!0,fetchClosedOrders:!0,fetchDeposit:!0,fetchDepositAddress:!0,fetchDepositAddresses:!1,fetchDepositAddressesByNetwork:!1,fetchDeposits:!0,fetchFundingHistory:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchIndexOHLCV:!1,fetchL2OrderBook:!0,fetchL3OrderBook:!0,fetchLedger:!1,fetchMarginMode:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMyTrades:!0,fetchOHLCV:!1,fetchOpenInterestHistory:!1,fetchOpenOrders:!0,fetchOrder:!0,fetchOrderBook:!0,fetchPositionMode:!1,fetchPremiumIndexOHLCV:!1,fetchTicker:!0,fetchTickers:!0,fetchTrades:!1,fetchTradingFee:!1,fetchTradingFees:!0,fetchTransfer:!1,fetchTransfers:!1,fetchWithdrawal:!0,fetchWithdrawals:!0,fetchWithdrawalWhitelist:!0,transfer:!1,withdraw:!0},timeframes:void 0,urls:{logo:"https://github.com/user-attachments/assets/975e3054-3399-4363-bcee-ec3c6d63d4e8",test:{public:"https://testnet-api.delta.exchange",private:"https://testnet-api.delta.exchange"},api:{public:"https://api.blockchain.com/v3/exchange",private:"https://api.blockchain.com/v3/exchange"},www:"https://blockchain.com",doc:["https://api.blockchain.com/v3"],fees:"https://exchange.blockchain.com/fees"},api:{public:{get:{tickers:1,"tickers/{symbol}":1,symbols:1,"symbols/{symbol}":1,"l2/{symbol}":1,"l3/{symbol}":1}},private:{get:{fees:1,orders:1,"orders/{orderId}":1,trades:1,fills:1,deposits:1,"deposits/{depositId}":1,accounts:1,"accounts/{account}/{currency}":1,whitelist:1,"whitelist/{currency}":1,withdrawals:1,"withdrawals/{withdrawalId}":1},post:{orders:1,"deposits/{currency}":1,withdrawals:1},delete:{orders:1,"orders/{orderId}":1}}},fees:{trading:{feeSide:"get",tierBased:!0,percentage:!0,tiers:{taker:[[this.parseNumber("0"),this.parseNumber("0.0045")],[this.parseNumber("10000"),this.parseNumber("0.0035")],[this.parseNumber("50000"),this.parseNumber("0.0018")],[this.parseNumber("100000"),this.parseNumber("0.0018")],[this.parseNumber("500000"),this.parseNumber("0.0018")],[this.parseNumber("1000000"),this.parseNumber("0.0018")],[this.parseNumber("2500000"),this.parseNumber("0.0018")],[this.parseNumber("5000000"),this.parseNumber("0.0016")],[this.parseNumber("25000000"),this.parseNumber("0.0014")],[this.parseNumber("100000000"),this.parseNumber("0.0011")],[this.parseNumber("500000000"),this.parseNumber("0.0008")],[this.parseNumber("1000000000"),this.parseNumber("0.0006")]],maker:[[this.parseNumber("0"),this.parseNumber("0.004")],[this.parseNumber("10000"),this.parseNumber("0.0017")],[this.parseNumber("50000"),this.parseNumber("0.0015")],[this.parseNumber("100000"),this.parseNumber("0.0008")],[this.parseNumber("500000"),this.parseNumber("0.0007")],[this.parseNumber("1000000"),this.parseNumber("0.0006")],[this.parseNumber("2500000"),this.parseNumber("0.0005")],[this.parseNumber("5000000"),this.parseNumber("0.0004")],[this.parseNumber("25000000"),this.parseNumber("0.0003")],[this.parseNumber("100000000"),this.parseNumber("0.0002")],[this.parseNumber("500000000"),this.parseNumber("0.0001")],[this.parseNumber("1000000000"),this.parseNumber("0")]]}}},requiredCredentials:{apiKey:!1,secret:!0},options:{networks:{ERC20:"ETH",TRC20:"TRX",ALGO:"ALGO",ADA:"ADA",AR:"AR",ATOM:"ATOM",AVAXC:"AVAX",BCH:"BCH",BSV:"BSV",BTC:"BTC",DCR:"DCR",DESO:"DESO",DASH:"DASH",CELO:"CELO",CHZ:"CHZ",MATIC:"MATIC",SOL:"SOL",DOGE:"DOGE",DOT:"DOT",EOS:"EOS",ETC:"ETC",FIL:"FIL",KAVA:"KAVA",LTC:"LTC",IOTA:"MIOTA",NEAR:"NEAR",STX:"STX",XLM:"XLM",XMR:"XMR",XRP:"XRP",XTZ:"XTZ",ZEC:"ZEC",ZIL:"ZIL"}},features:{spot:{sandbox:!1,createOrder:{marginMode:!1,triggerPrice:!0,triggerPriceType:void 0,triggerDirection:!1,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!0,FOK:!0,PO:!1,GTD:!0},hedged:!1,leverage:!1,marketBuyRequiresPrice:!1,marketBuyByCost:!1,selfTradePrevention:!1,trailing:!1,iceberg:!1},createOrders:void 0,fetchMyTrades:{marginMode:!1,limit:1e3,daysBack:1e5,untilDays:1e5,symbolRequired:!1},fetchOrder:{marginMode:!1,trigger:!1,symbolRequired:!1,trailing:!1},fetchOpenOrders:{marginMode:!1,limit:1e3,trigger:!1,trailing:!1,symbolRequired:!1},fetchOrders:void 0,fetchClosedOrders:{marginMode:!1,limit:1e3,daysBack:1e5,daysBackCanceled:1,untilDays:1e5,trigger:!1,trailing:!1,symbolRequired:!1},fetchOHLCV:void 0},swap:{linear:void 0,inverse:void 0},future:{linear:void 0,inverse:void 0}},precisionMode:o.kb,exceptions:{exact:{401:r.AuthenticationError,404:r.OrderNotFound},broad:{}}})}async fetchMarkets(e={}){const t=await this.publicGetSymbols(e),i=Object.keys(t),s=[];for(let e=0;e{i.d(t,{A:()=>d});var s=i(1769),r=i(2079),a=i(5147),o=i(1579),n=i(4852);class d extends s.A{describe(){return this.deepExtend(super.describe(),{id:"blofin",name:"BloFin",countries:["US"],version:"v1",rateLimit:100,pro:!0,has:{CORS:void 0,spot:!1,margin:!1,swap:!0,future:!1,option:!1,addMargin:!1,borrowMargin:!1,cancelAllOrders:!1,cancelOrder:!0,cancelOrders:!0,closeAllPositions:!1,closePosition:!0,createDepositAddress:!1,createMarketBuyOrderWithCost:!1,createMarketSellOrderWithCost:!1,createOrder:!0,createOrders:!0,createOrderWithTakeProfitAndStopLoss:!0,createPostOnlyOrder:!1,createReduceOnlyOrder:!1,createStopLimitOrder:!1,createStopLossOrder:!0,createStopMarketOrder:!1,createStopOrder:!1,createTakeProfitOrder:!0,createTriggerOrder:!0,editOrder:!1,fetchAccounts:!1,fetchBalance:!0,fetchBidsAsks:void 0,fetchBorrowInterest:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchCanceledOrders:!1,fetchClosedOrder:!1,fetchClosedOrders:!0,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!1,fetchDeposit:!1,fetchDepositAddress:!1,fetchDepositAddresses:!1,fetchDepositAddressesByNetwork:!1,fetchDeposits:!0,fetchDepositsWithdrawals:!1,fetchDepositWithdrawFee:"emulated",fetchDepositWithdrawFees:!1,fetchFundingHistory:!0,fetchFundingRate:!0,fetchFundingRateHistory:!0,fetchFundingRates:!1,fetchGreeks:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchL3OrderBook:!1,fetchLedger:!0,fetchLedgerEntry:void 0,fetchLeverage:!0,fetchLeverages:!0,fetchLeverageTiers:!1,fetchMarginMode:!0,fetchMarginModes:!1,fetchMarketLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMySettlementHistory:!1,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenInterest:!1,fetchOpenInterestHistory:!1,fetchOpenOrder:void 0,fetchOpenOrders:!0,fetchOrder:void 0,fetchOrderBook:!0,fetchOrderBooks:!1,fetchOrders:!1,fetchOrderTrades:!0,fetchPosition:!0,fetchPositionMode:!0,fetchPositions:!0,fetchPositionsForSymbol:!1,fetchPositionsRisk:!1,fetchPremiumIndexOHLCV:!1,fetchSettlementHistory:!1,fetchStatus:!1,fetchTicker:!0,fetchTickers:!0,fetchTime:!1,fetchTrades:!0,fetchTradingFee:!1,fetchTradingFees:!1,fetchTradingLimits:!1,fetchTransactionFee:!1,fetchTransactionFees:!1,fetchTransactions:!1,fetchTransfer:!1,fetchTransfers:!1,fetchUnderlyingAssets:!1,fetchVolatilityHistory:!1,fetchWithdrawal:!1,fetchWithdrawals:!0,fetchWithdrawalWhitelist:!1,reduceMargin:!1,repayCrossMargin:!1,setLeverage:!0,setMargin:!1,setMarginMode:!0,setPositionMode:!0,signIn:!1,transfer:!0,withdraw:!1},timeframes:{"1m":"1m","3m":"3m","5m":"5m","15m":"15m","30m":"30m","1h":"1H","2h":"2H","4h":"4H","6h":"6H","8h":"8H","12h":"12H","1d":"1D","3d":"3D","1w":"1W","1M":"1M"},hostname:"www.blofin.com",urls:{logo:"https://github.com/user-attachments/assets/518cdf80-f05d-4821-a3e3-d48ceb41d73b",api:{rest:"https://openapi.blofin.com"},test:{rest:"https://demo-trading-openapi.blofin.com"},referral:{url:"https://blofin.com/register?referral_code=f79EsS",discount:.05},www:"https://www.blofin.com",doc:"https://blofin.com/docs"},api:{public:{get:{"market/instruments":1,"market/tickers":1,"market/books":1,"market/trades":1,"market/candles":1,"market/mark-price":1,"market/funding-rate":1,"market/funding-rate-history":1}},private:{get:{"asset/balances":1,"trade/orders-pending":1,"trade/fills-history":1,"asset/deposit-history":1,"asset/withdrawal-history":1,"asset/bills":1,"account/balance":1,"account/positions":1,"account/leverage-info":1,"account/margin-mode":1,"account/position-mode":1,"account/batch-leverage-info":1,"trade/orders-tpsl-pending":1,"trade/orders-algo-pending":1,"trade/orders-history":1,"trade/orders-tpsl-history":1,"trade/orders-algo-history":1,"trade/order/price-range":1,"user/query-apikey":1,"affiliate/basic":1,"copytrading/instruments":1,"copytrading/account/balance":1,"copytrading/account/positions-by-order":1,"copytrading/account/positions-details-by-order":1,"copytrading/account/positions-by-contract":1,"copytrading/account/position-mode":1,"copytrading/account/leverage-info":1,"copytrading/trade/orders-pending":1,"copytrading/trade/pending-tpsl-by-contract":1,"copytrading/trade/position-history-by-order":1,"copytrading/trade/orders-history":1,"copytrading/trade/pending-tpsl-by-order":1},post:{"account/set-margin-mode":1,"account/set-position-mode":1,"trade/order":1,"trade/order-algo":1,"trade/cancel-order":1,"trade/cancel-algo":1,"account/set-leverage":1,"trade/batch-orders":1,"trade/order-tpsl":1,"trade/cancel-batch-orders":1,"trade/cancel-tpsl":1,"trade/close-position":1,"asset/transfer":1,"copytrading/account/set-position-mode":1,"copytrading/account/set-leverage":1,"copytrading/trade/place-order":1,"copytrading/trade/cancel-order":1,"copytrading/trade/place-tpsl-by-contract":1,"copytrading/trade/cancel-tpsl-by-contract":1,"copytrading/trade/place-tpsl-by-order":1,"copytrading/trade/cancel-tpsl-by-order":1,"copytrading/trade/close-position-by-order":1,"copytrading/trade/close-position-by-contract":1}}},fees:{swap:{taker:this.parseNumber("0.00060"),maker:this.parseNumber("0.00020")}},requiredCredentials:{apiKey:!0,secret:!0,password:!0},features:{default:{sandbox:!1,createOrder:{timeInForce:{IOC:!0,FOK:!0,PO:!0,GTD:!1},leverage:!1,marketBuyRequiresPrice:!1,marketBuyByCost:!1,selfTradePrevention:!1,trailing:!1,iceberg:!1},createOrders:{max:10},fetchMyTrades:{marginMode:!1,limit:100,daysBack:1e5,untilDays:1e5,symbolRequired:!1},fetchOrder:void 0,fetchOpenOrders:{marginMode:!1,limit:100,trigger:!0,trailing:!1,symbolRequired:!1},fetchOrders:void 0,fetchClosedOrders:{marginMode:!1,limit:1e3,daysBack:1e5,daysBackCanceled:1,untilDays:1e5,trigger:!0,trailing:!1,symbolRequired:!1},fetchOHLCV:{limit:1440}},spot:{extends:"default",createOrder:{marginMode:!1,triggerPrice:!1,triggerPriceType:void 0,triggerDirection:!1,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,hedged:!1}},forDerivatives:{extends:"default",createOrder:{marginMode:!0,triggerPrice:!1,triggerPriceType:void 0,triggerDirection:!1,stopLossPrice:!0,takeProfitPrice:!0,attachedStopLossTakeProfit:{triggerPriceType:void 0,price:!0},hedged:!0}},swap:{linear:{extends:"forDerivatives"},inverse:void 0},future:{linear:void 0,inverse:void 0}},exceptions:{exact:{400:r.BadRequest,401:r.AuthenticationError,500:r.ExchangeError,404:r.BadRequest,405:r.BadRequest,406:r.BadRequest,429:r.RateLimitExceeded,152001:r.BadRequest,152002:r.BadRequest,152003:r.BadRequest,152004:r.BadRequest,152005:r.BadRequest,152006:r.InvalidOrder,152007:r.InvalidOrder,152008:r.InvalidOrder,152009:r.InvalidOrder,150003:r.InvalidOrder,150004:r.InvalidOrder,542:r.InvalidOrder,102002:r.InvalidOrder,102005:r.InvalidOrder,102014:r.InvalidOrder,102015:r.InvalidOrder,102022:r.InvalidOrder,102037:r.InvalidOrder,102038:r.InvalidOrder,102039:r.InvalidOrder,102040:r.InvalidOrder,102047:r.InvalidOrder,102048:r.InvalidOrder,102049:r.InvalidOrder,102050:r.InvalidOrder,102051:r.InvalidOrder,102052:r.InvalidOrder,102053:r.InvalidOrder,102054:r.InvalidOrder,102055:r.InvalidOrder,102064:r.BadRequest,102065:r.BadRequest,102068:r.BadRequest,103013:r.ExchangeError,"Order failed. Insufficient USDT margin in account":r.InsufficientFunds},broad:{"Internal Server Error":r.ExchangeNotAvailable,"server error":r.ExchangeNotAvailable}},httpExceptions:{429:r.ExchangeNotAvailable},precisionMode:o.kb,options:{brokerId:"ec6dd3a7dd982d0b",accountsByType:{swap:"futures",funding:"funding",future:"futures",copy_trading:"copy_trading",earn:"earn",spot:"spot"},accountsById:{funding:"funding",futures:"swap",copy_trading:"copy_trading",earn:"earn",spot:"spot"},defaultNetwork:"ERC20",defaultNetworks:{ETH:"ERC20",BTC:"BTC",USDT:"TRC20"},networks:{BTC:"Bitcoin",BEP20:"BSC",ERC20:"ERC20",TRC20:"TRC20"},fetchOpenInterestHistory:{timeframes:{"5m":"5m","1h":"1H","8h":"8H","1d":"1D","5M":"5m","1H":"1H","8H":"8H","1D":"1D"}},fetchOHLCV:{timezone:"UTC"},fetchPositions:{method:"privateGetAccountPositions"},createOrder:"privatePostTradeOrder",createMarketBuyOrderRequiresPrice:!1,fetchMarkets:["swap"],defaultType:"swap",fetchLedger:{method:"privateGetAssetBills"},fetchOpenOrders:{method:"privateGetTradeOrdersPending"},cancelOrders:{method:"privatePostTradeCancelBatchOrders"},fetchCanceledOrders:{method:"privateGetTradeOrdersHistory"},fetchClosedOrders:{method:"privateGetTradeOrdersHistory"},withdraw:{password:void 0,pwd:void 0},exchangeType:{spot:"SPOT",swap:"SWAP",SPOT:"SPOT",SWAP:"SWAP"}}})}async fetchMarkets(e={}){const t=await this.publicGetMarketInstruments(e),i=this.safeList(t,"data",[]);return this.parseMarkets(i)}parseMarket(e){const t=this.safeString(e,"instId"),i=this.safeStringLower(e,"instType"),s="spot"===i,r="future"===i,o="swap"===i,n="option"===i,d=o||r,h=this.safeString(e,"baseCurrency"),c=this.safeString(e,"quoteCurrency"),l=this.safeString(e,"quoteCurrency"),u=this.safeCurrencyCode(l),f=this.safeCurrencyCode(h),p=this.safeCurrencyCode(c);let m=f+"/"+p;o&&(m=m+":"+u);const g=void 0,v=this.safeString(e,"tickSize"),y=this.safeDict2(this.fees,i,"trading",{}),w=this.safeNumber(y,"taker"),b=this.safeNumber(y,"maker");let k=this.safeString(e,"maxLeverage","100");k=a.Y.stringMax(k,"1");const S="live"===this.safeString(e,"state");return this.safeMarketStructure({id:t,symbol:m,base:f,quote:p,baseId:h,quoteId:c,settle:u,settleId:l,type:i,spot:s,option:n,margin:s&&a.Y.stringGt(k,"1"),swap:o,future:r,active:S,taker:w,maker:b,contract:d,linear:d?c===l:void 0,inverse:d?h===l:void 0,contractSize:d?this.safeNumber(e,"contractValue"):void 0,expiry:g,expiryDatetime:g,strike:undefined,optionType:undefined,created:this.safeInteger(e,"listTime"),precision:{amount:this.safeNumber(e,"lotSize"),price:this.parseNumber(v)},limits:{leverage:{min:this.parseNumber("1"),max:this.parseNumber(k)},amount:{min:this.safeNumber(e,"minSize"),max:void 0},price:{min:void 0,max:void 0},cost:{min:void 0,max:void 0}},info:e})}async fetchOrderBook(e,t=void 0,i={}){await this.loadMarkets();const s={instId:this.market(e).id};void 0!==(t=void 0===t?50:t)&&(s.size=t);const r=await this.publicGetMarketBooks(this.extend(s,i)),a=this.safeList(r,"data",[]),o=this.safeDict(a,0,{}),n=this.safeInteger(o,"ts");return this.parseOrderBook(o,e,n)}parseTicker(e,t=void 0){const i=this.safeInteger(e,"ts"),s=this.safeString(e,"instId"),r=(t=this.safeMarket(s,t,"-")).symbol,a=this.safeString(e,"last"),o=this.safeString(e,"open24h"),n=this.safeBool(t,"spot",!1)?this.safeString(e,"volCurrency24h"):void 0,d=this.safeString(e,"vol24h"),h=this.safeString(e,"high24h"),c=this.safeString(e,"low24h");return this.safeTicker({symbol:r,timestamp:i,datetime:this.iso8601(i),high:h,low:c,bid:this.safeString(e,"bidPrice"),bidVolume:this.safeString(e,"bidSize"),ask:this.safeString(e,"askPrice"),askVolume:this.safeString(e,"askSize"),vwap:void 0,open:o,close:a,last:a,previousClose:void 0,change:void 0,percentage:void 0,average:void 0,baseVolume:d,quoteVolume:n,indexPrice:this.safeString(e,"indexPrice"),markPrice:this.safeString(e,"markPrice"),info:e},t)}async fetchTicker(e,t={}){await this.loadMarkets();const i=this.market(e),s={instId:i.id},r=await this.publicGetMarketTickers(this.extend(s,t)),a=this.safeList(r,"data",[]),o=this.safeDict(a,0,{});return this.parseTicker(o,i)}async fetchMarkPrice(e,t={}){await this.loadMarkets();const i=this.market(e),s={symbol:i.id},r=await this.publicGetMarketMarkPrice(this.extend(s,t)),a=this.safeList(r,"data",[]),o=this.safeDict(a,0,{});return this.parseTicker(o,i)}async fetchTickers(e=void 0,t={}){await this.loadMarkets(),e=this.marketSymbols(e);const i=await this.publicGetMarketTickers(t),s=this.safeList(i,"data",[]);return this.parseTickers(s,e)}parseTrade(e,t=void 0){const i=this.safeString(e,"tradeId"),s=this.safeString(e,"instId"),r=(t=this.safeMarket(s,t,"-")).symbol,a=this.safeInteger(e,"ts"),o=this.safeString2(e,"price","fillPrice"),n=this.safeString2(e,"size","fillSize"),d=this.safeString(e,"side"),h=this.safeString(e,"orderId"),c=this.safeString(e,"fee");let l;return void 0!==c&&(l={cost:c,currency:t.settle}),this.safeTrade({info:e,timestamp:a,datetime:this.iso8601(a),symbol:r,id:i,order:h,type:void 0,takerOrMaker:void 0,side:d,price:o,amount:n,cost:void 0,fee:l},t)}async fetchTrades(e,t=void 0,i=void 0,s={}){await this.loadMarkets();let r=!1;if([r,s]=this.handleOptionAndParams(s,"fetchTrades","paginate"),r)return await this.fetchPaginatedCallCursor("fetchTrades",e,t,i,s,"tradeId","after",void 0,100);const a=this.market(e),o={instId:a.id};let n,d;void 0!==i&&(o.limit=i),[d,s]=this.handleOptionAndParams(s,"fetchTrades","method","publicGetMarketTrades"),"publicGetMarketTrades"===d&&(n=await this.publicGetMarketTrades(this.extend(o,s)));const h=this.safeList(n,"data",[]);return this.parseTrades(h,a,t,i)}parseOHLCV(e,t=void 0){return[this.safeInteger(e,0),this.safeNumber(e,1),this.safeNumber(e,2),this.safeNumber(e,3),this.safeNumber(e,4),this.safeNumber(e,6)]}async fetchOHLCV(e,t="1m",i=void 0,s=void 0,r={}){await this.loadMarkets();const a=this.market(e);let o=!1;if([o,r]=this.handleOptionAndParams(r,"fetchOHLCV","paginate"),o)return await this.fetchPaginatedCallDeterministic("fetchOHLCV",e,i,s,t,r,100);void 0===s&&(s=100);const n={instId:a.id,bar:this.safeString(this.timeframes,t,t),limit:s},d=this.safeInteger(r,"until");let h;void 0!==d&&(n.after=d,r=this.omit(r,"until")),h=await this.publicGetMarketCandles(this.extend(n,r));const c=this.safeList(h,"data",[]);return this.parseOHLCVs(c,a,t,i,s)}async fetchFundingRateHistory(e=void 0,t=void 0,i=void 0,s={}){if(void 0===e)throw new r.ArgumentsRequired(this.id+" fetchFundingRateHistory() requires a symbol argument");await this.loadMarkets();let a=!1;if([a,s]=this.handleOptionAndParams(s,"fetchFundingRateHistory","paginate"),a)return await this.fetchPaginatedCallDeterministic("fetchFundingRateHistory",e,t,i,"8h",s,100);const o=this.market(e),n={instId:o.id};void 0!==t&&(n.before=Math.max(t-1,0)),void 0!==i&&(n.limit=i);const d=this.safeInteger(s,"until");void 0!==d&&(n.after=d,s=this.omit(s,"until"));const h=await this.publicGetMarketFundingRateHistory(this.extend(n,s)),c=[],l=this.safeList(h,"data",[]);for(let e=0;e0?s=s+","+r.id:s+=r.id}const a={instId:s,marginMode:i},o=await this.privateGetAccountBatchLeverageInfo(this.extend(a,t)),n=this.safeList(o,"data",[]);return this.parseLeverages(n,e,"instId")}async fetchLeverage(e,t={}){let i;if(await this.loadMarkets(),[i,t]=this.handleMarginModeAndParams("fetchLeverage",t),void 0===i&&(i=this.safeString(t,"marginMode","cross")),"cross"!==i&&"isolated"!==i)throw new r.BadRequest(this.id+" fetchLeverage() requires a marginMode parameter that must be either cross or isolated");const s=this.market(e),a={instId:s.id,marginMode:i},o=await this.privateGetAccountLeverageInfo(this.extend(a,t)),n=this.safeDict(o,"data",{});return this.parseLeverage(n,s)}parseLeverage(e,t=void 0){const i=this.safeString(e,"instId"),s=this.safeInteger(e,"leverage");return{info:e,symbol:this.safeSymbol(i,t),marginMode:this.safeStringLower(e,"marginMode"),longLeverage:s,shortLeverage:s}}async setLeverage(e,t=void 0,i={}){if(void 0===t)throw new r.ArgumentsRequired(this.id+" setLeverage() requires a symbol argument");if(e<1||e>125)throw new r.BadRequest(this.id+" setLeverage() leverage should be between 1 and 125");await this.loadMarkets();const s=this.market(t);let a;if([a,i]=this.handleMarginModeAndParams("setLeverage",i,"cross"),"cross"!==a&&"isolated"!==a)throw new r.BadRequest(this.id+" setLeverage() requires a marginMode parameter that must be either cross or isolated");const o={leverage:e,marginMode:a,instId:s.id};return await this.privatePostAccountSetLeverage(this.extend(o,i))}async closePosition(e,t=void 0,i={}){await this.loadMarkets();const s=this.market(e),r=this.safeString(i,"clientOrderId");let a;[a,i]=this.handleMarginModeAndParams("closePosition",i,"cross");const o={instId:s.id,marginMode:a};void 0!==r&&(o.clientOrderId=r);const n=await this.privatePostTradeClosePosition(this.extend(o,i));return this.safeDict(n,"data")}async fetchClosedOrders(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();let r=!1;if([r,s]=this.handleOptionAndParams(s,"fetchClosedOrders","paginate"),r)return await this.fetchPaginatedCallDynamic("fetchClosedOrders",e,t,i,s);const a={};let o;void 0!==e&&(o=this.market(e),a.instId=o.id),void 0!==i&&(a.limit=i),void 0!==t&&(a.begin=t);const n=this.safeBoolN(s,["stop","trigger","tpsl","TPSL"],!1);let d;[d,s]=this.handleOptionAndParams(s,"fetchOpenOrders","method","privateGetTradeOrdersHistory");const h=this.omit(s,["method","stop","trigger","tpsl","TPSL"]);let c;c=n||"privateGetTradeOrdersTpslHistory"===d?await this.privateGetTradeOrdersTpslHistory(this.extend(a,h)):await this.privateGetTradeOrdersHistory(this.extend(a,h));const l=this.safeList(c,"data",[]);return this.parseOrders(l,o,t,i)}async fetchMarginMode(e,t={}){await this.loadMarkets();const i=this.market(e),s=await this.privateGetAccountMarginMode(t),r=this.safeDict(s,"data",{});return this.parseMarginMode(r,i)}parseMarginMode(e,t=void 0){return{info:e,symbol:this.safeString(t,"symbol"),marginMode:this.safeString(e,"marginMode")}}async setMarginMode(e,t=void 0,i={}){let s;this.checkRequiredArgument("setMarginMode",e,"marginMode",["cross","isolated"]),await this.loadMarkets(),void 0!==t&&(s=this.market(t));const r={marginMode:e},a=await this.privatePostAccountSetMarginMode(this.extend(r,i)),o=this.safeDict(a,"data",{});return this.parseMarginMode(o,s)}async fetchPositionMode(e=void 0,t={}){const i=await this.privateGetAccountPositionMode(t),s=this.safeDict(i,"data",{});return{info:s,hedged:"long_short_mode"===this.safeString(s,"positionMode")}}async setPositionMode(e,t=void 0,i={}){const s={positionMode:e?"long_short_mode":"net_mode"};return await this.privatePostAccountSetPositionMode(this.extend(s,i))}handleErrors(e,t,i,s,a,o,n,d,h){if(void 0===n)return;const c=this.safeString(n,"code"),l=this.safeString(n,"msg"),u=this.id+" "+o;if(void 0!==c&&"0"!==c)throw this.throwExactlyMatchedException(this.exceptions.exact,l,u),this.throwExactlyMatchedException(this.exceptions.exact,c,u),this.throwBroadlyMatchedException(this.exceptions.broad,l,u),new r.ExchangeError(u);const f=this.safeList(n,"data"),p=this.safeDict(f,0),m=this.safeString(p,"msg"),g=this.safeString(p,"code");void 0!==g&&"0"!==g&&(this.throwExactlyMatchedException(this.exceptions.exact,g,u),this.throwExactlyMatchedException(this.exceptions.exact,m,u),this.throwBroadlyMatchedException(this.exceptions.broad,m,u))}sign(e,t="public",i="GET",s={},r=void 0,a=void 0){let o="/api/"+this.version+"/"+this.implodeParams(e,s);const d=this.omit(s,this.extractParams(e));let h=this.implodeHostname(this.urls.api.rest)+o;if("public"===t)this.isEmpty(d)||(h+="?"+this.urlencode(d));else if("private"===t){this.checkRequiredCredentials();const e=this.milliseconds().toString();r={"ACCESS-KEY":this.apiKey,"ACCESS-PASSPHRASE":this.password,"ACCESS-TIMESTAMP":e,"ACCESS-NONCE":e};let t="";if("GET"===i){if(!this.isEmpty(d)){const e="?"+this.urlencode(d);h+=e,o+=e}}else this.isEmpty(d)||(t=a=this.json(d)),r["Content-Type"]="application/json";const s=o+i+e+e+t,c=this.stringToBase64(this.hmac(this.encode(s),this.encode(this.secret),n.s));r["ACCESS-SIGN"]=c}return{url:h,method:i,body:a,headers:r}}}},3413:(e,t,i)=>{i.d(t,{A:()=>d});var s=i(9644),r=i(2079),a=i(5147),o=i(1579),n=i(4852);class d extends s.A{describe(){return this.deepExtend(super.describe(),{id:"btcalpha",name:"BTC-Alpha",countries:["US"],version:"v1",has:{CORS:void 0,spot:!0,margin:!1,swap:!1,future:!1,option:!1,addMargin:!1,borrowCrossMargin:!1,borrowIsolatedMargin:!1,borrowMargin:!1,cancelOrder:!0,closeAllPositions:!1,closePosition:!1,createDepositAddress:!1,createOrder:!0,createOrderWithTakeProfitAndStopLoss:!1,createOrderWithTakeProfitAndStopLossWs:!1,createPostOnlyOrder:!1,createReduceOnlyOrder:!1,createStopLimitOrder:!1,createStopMarketOrder:!1,createStopOrder:!1,fetchBalance:!0,fetchBorrowInterest:!1,fetchBorrowRate:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchBorrowRates:!1,fetchBorrowRatesPerSymbol:!1,fetchClosedOrders:!0,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchDeposit:!1,fetchDepositAddress:!1,fetchDepositAddresses:!1,fetchDepositAddressesByNetwork:!1,fetchDeposits:!0,fetchFundingHistory:!1,fetchFundingInterval:!1,fetchFundingIntervals:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchGreeks:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchIsolatedPositions:!1,fetchL2OrderBook:!0,fetchLeverage:!1,fetchLeverages:!1,fetchLeverageTiers:!1,fetchLiquidations:!1,fetchLongShortRatio:!1,fetchLongShortRatioHistory:!1,fetchMarginAdjustmentHistory:!1,fetchMarginMode:!1,fetchMarginModes:!1,fetchMarketLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMarkPrices:!1,fetchMyLiquidations:!1,fetchMySettlementHistory:!1,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenInterest:!1,fetchOpenInterestHistory:!1,fetchOpenInterests:!1,fetchOpenOrders:!0,fetchOption:!1,fetchOptionChain:!1,fetchOrder:!0,fetchOrderBook:!0,fetchOrders:!0,fetchPosition:!1,fetchPositionHistory:!1,fetchPositionMode:!1,fetchPositions:!1,fetchPositionsForSymbol:!1,fetchPositionsHistory:!1,fetchPositionsRisk:!1,fetchPremiumIndexOHLCV:!1,fetchSettlementHistory:!1,fetchTicker:!0,fetchTickers:!0,fetchTrades:!0,fetchTradingFee:!1,fetchTradingFees:!1,fetchTransfer:!1,fetchTransfers:!1,fetchVolatilityHistory:!1,fetchWithdrawal:!1,fetchWithdrawals:!0,reduceMargin:!1,repayCrossMargin:!1,repayIsolatedMargin:!1,repayMargin:!1,setLeverage:!1,setMargin:!1,setMarginMode:!1,setPositionMode:!1,transfer:!1,withdraw:!1},timeframes:{"5m":"5","15m":"15","30m":"30","1h":"60","4h":"240","1d":"D"},urls:{logo:"https://github.com/user-attachments/assets/dce49f3a-61e5-4ba0-a2fe-41d192fd0e5d",api:{rest:"https://btc-alpha.com/api"},www:"https://btc-alpha.com",doc:"https://btc-alpha.github.io/api-docs",fees:"https://btc-alpha.com/fees/",referral:"https://btc-alpha.com/?r=123788"},api:{public:{get:["currencies/","pairs/","orderbook/{pair_name}","exchanges/","charts/{pair}/{type}/chart/","ticker/"]},private:{get:["wallets/","orders/own/","order/{id}/","exchanges/own/","deposits/","withdraws/"],post:["order/","order-cancel/"]}},fees:{trading:{maker:this.parseNumber("0.002"),taker:this.parseNumber("0.002")},funding:{withdraw:{}}},commonCurrencies:{CBC:"Cashbery"},features:{spot:{sandbox:!1,createOrder:{marginMode:!1,triggerPrice:!1,triggerPriceType:void 0,triggerDirection:!1,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!1,FOK:!1,PO:!1,GTD:!1},hedged:!1,leverage:!1,marketBuyRequiresPrice:!1,marketBuyByCost:!1,selfTradePrevention:!1,trailing:!1,iceberg:!1},createOrders:void 0,fetchMyTrades:{marginMode:!1,limit:100,daysBack:void 0,untilDays:void 0,symbolRequired:!1},fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!1},fetchOpenOrders:{marginMode:!1,limit:2e3,trigger:!1,trailing:!1,symbolRequired:!1},fetchOrders:{marginMode:!1,limit:2e3,daysBack:void 0,untilDays:void 0,trigger:!1,trailing:!1,symbolRequired:!1},fetchClosedOrders:{marginMode:!1,limit:2e3,daysBack:void 0,daysBackCanceled:void 0,untilDays:void 0,trigger:!1,trailing:!1,symbolRequired:!1},fetchOHLCV:{limit:720}},swap:{linear:void 0,inverse:void 0},future:{linear:void 0,inverse:void 0}},precisionMode:o.kb,exceptions:{exact:{},broad:{"Out of balance":r.InsufficientFunds}}})}async fetchMarkets(e={}){const t=await this.publicGetPairs(e);return this.parseMarkets(t)}parseMarket(e){const t=this.safeString(e,"name"),i=this.safeString(e,"currency1"),s=this.safeString(e,"currency2"),r=this.safeCurrencyCode(i),o=this.safeCurrencyCode(s),n=this.safeString(e,"price_precision"),d=this.parsePrecision(n),h=this.safeString(e,"minimum_order_size");return{id:t,symbol:r+"/"+o,base:r,quote:o,settle:void 0,baseId:i,quoteId:s,settleId:void 0,type:"spot",spot:!0,margin:!1,swap:!1,future:!1,option:!1,active:!0,contract:!1,linear:void 0,inverse:void 0,contractSize:void 0,expiry:void 0,expiryDatetime:void 0,strike:void 0,optionType:void 0,precision:{amount:this.parseNumber(this.parsePrecision(this.safeString(e,"amount_precision"))),price:this.parseNumber(this.parsePrecision(n))},limits:{leverage:{min:void 0,max:void 0},amount:{min:this.parseNumber(h),max:this.safeNumber(e,"maximum_order_size")},price:{min:this.parseNumber(d),max:void 0},cost:{min:this.parseNumber(a.Y.stringMul(d,h)),max:void 0}},created:void 0,info:e}}async fetchTickers(e=void 0,t={}){await this.loadMarkets();const i=await this.publicGetTicker(t);return this.parseTickers(i,e)}async fetchTicker(e,t={}){await this.loadMarkets();const i=this.market(e),s={pair:i.id},r=await this.publicGetTicker(this.extend(s,t));return this.parseTicker(r,i)}parseTicker(e,t=void 0){const i=this.safeString(e,"timestamp"),s=parseInt(a.Y.stringMul(i,"1000000")),r=this.safeString(e,"pair");t=this.safeMarket(r,t,"_");const o=this.safeString(e,"last");return this.safeTicker({info:e,symbol:t.symbol,timestamp:s,datetime:this.iso8601(s),high:this.safeString(e,"high"),low:this.safeString(e,"low"),bid:this.safeString(e,"buy"),bidVolume:void 0,ask:this.safeString(e,"sell"),askVolume:void 0,vwap:void 0,open:void 0,close:o,last:o,previousClose:void 0,change:this.safeString(e,"diff"),percentage:void 0,average:void 0,baseVolume:void 0,quoteVolume:this.safeString(e,"vol")},t)}async fetchOrderBook(e,t=void 0,i={}){await this.loadMarkets();const s=this.market(e),r={pair_name:s.id};t&&(r.limit_sell=t,r.limit_buy=t);const a=await this.publicGetOrderbookPairName(this.extend(r,i));return this.parseOrderBook(a,s.symbol,void 0,"buy","sell","price","amount")}parseBidsAsks(e,t=0,i=1,s=2){const r=[];for(let s=0;s{i.d(t,{A:()=>h});var s=i(3829),r=i(2079),a=i(5147),o=i(1579),n=i(4852),d=i(4035);class h extends s.A{describe(){return this.deepExtend(super.describe(),{id:"btcbox",name:"BtcBox",countries:["JP"],rateLimit:1e3,version:"v1",pro:!1,has:{CORS:void 0,spot:!0,margin:!1,swap:!1,future:!1,option:!1,addMargin:!1,borrowCrossMargin:!1,borrowIsolatedMargin:!1,borrowMargin:!1,cancelOrder:!0,closeAllPositions:!1,closePosition:!1,createOrder:!0,createOrderWithTakeProfitAndStopLoss:!1,createOrderWithTakeProfitAndStopLossWs:!1,createPostOnlyOrder:!1,createReduceOnlyOrder:!1,fetchBalance:!0,fetchBorrowInterest:!1,fetchBorrowRate:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchBorrowRates:!1,fetchBorrowRatesPerSymbol:!1,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchFundingHistory:!1,fetchFundingInterval:!1,fetchFundingIntervals:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchGreeks:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchIsolatedPositions:!1,fetchLeverage:!1,fetchLeverages:!1,fetchLeverageTiers:!1,fetchLiquidations:!1,fetchLongShortRatio:!1,fetchLongShortRatioHistory:!1,fetchMarginAdjustmentHistory:!1,fetchMarginMode:!1,fetchMarginModes:!1,fetchMarketLeverageTiers:!1,fetchMarkOHLCV:!1,fetchMarkPrices:!1,fetchMyLiquidations:!1,fetchMySettlementHistory:!1,fetchOpenInterest:!1,fetchOpenInterestHistory:!1,fetchOpenInterests:!1,fetchOpenOrders:!0,fetchOption:!1,fetchOptionChain:!1,fetchOrder:!0,fetchOrderBook:!0,fetchOrders:!0,fetchPosition:!1,fetchPositionHistory:!1,fetchPositionMode:!1,fetchPositions:!1,fetchPositionsForSymbol:!1,fetchPositionsHistory:!1,fetchPositionsRisk:!1,fetchPremiumIndexOHLCV:!1,fetchSettlementHistory:!1,fetchTicker:!0,fetchTickers:!0,fetchTrades:!0,fetchTransfer:!1,fetchTransfers:!1,fetchVolatilityHistory:!1,fetchWithdrawal:!1,fetchWithdrawals:!1,reduceMargin:!1,repayCrossMargin:!1,repayIsolatedMargin:!1,repayMargin:!1,setLeverage:!1,setMargin:!1,setMarginMode:!1,setPositionMode:!1,transfer:!1,withdraw:!1,ws:!1},urls:{logo:"https://github.com/user-attachments/assets/1e2cb499-8d0f-4f8f-9464-3c015cfbc76b",api:{rest:"https://www.btcbox.co.jp/api"},www:"https://www.btcbox.co.jp/",doc:"https://blog.btcbox.jp/en/archives/8762",fees:"https://support.btcbox.co.jp/hc/en-us/articles/360001235694-Fees-introduction"},api:{public:{get:["depth","orders","ticker","tickers"]},private:{post:["balance","trade_add","trade_cancel","trade_list","trade_view","wallet"]},webApi:{get:["ajax/coin/coinInfo"]}},options:{fetchMarkets:{webApiEnable:!0,webApiRetries:3},amountPrecision:"0.0001"},features:{spot:{sandbox:!1,createOrder:{marginMode:!1,triggerPrice:!1,triggerPriceType:void 0,triggerDirection:!1,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!1,FOK:!1,PO:!1,GTD:!1},hedged:!1,leverage:!1,marketBuyRequiresPrice:!1,marketBuyByCost:!1,selfTradePrevention:!1,trailing:!1,iceberg:!1},createOrders:void 0,fetchMyTrades:void 0,fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!0},fetchOpenOrders:{marginMode:!1,limit:100,trigger:!1,trailing:!1,symbolRequired:!0},fetchOrders:{marginMode:!1,limit:100,daysBack:void 0,untilDays:void 0,trigger:!1,trailing:!1,symbolRequired:!0},fetchClosedOrders:void 0,fetchOHLCV:void 0},swap:{linear:void 0,inverse:void 0},future:{linear:void 0,inverse:void 0}},precisionMode:o.kb,exceptions:{104:r.AuthenticationError,105:r.PermissionDenied,106:r.InvalidNonce,107:r.InvalidOrder,200:r.InsufficientFunds,201:r.InvalidOrder,202:r.InvalidOrder,203:r.OrderNotFound,401:r.OrderNotFound,402:r.DDoSProtection}})}async fetchMarkets(e={}){const t=this.publicGetTickers(),i=this.fetchWebEndpoint("fetchMarkets","webApiGetAjaxCoinCoinInfo",!0),[s,r]=await Promise.all([t,i]),a=this.safeDict(r,"data",{}),o=Object.keys(s),n=[];for(let e=0;e1&&(r.coin=s.baseId);const a=await this.publicGetDepth(this.extend(r,i));return this.parseOrderBook(a,s.symbol)}parseTicker(e,t=void 0){const i=this.safeSymbol(void 0,t),s=this.safeString(e,"last");return this.safeTicker({symbol:i,timestamp:void 0,datetime:void 0,high:this.safeString(e,"high"),low:this.safeString(e,"low"),bid:this.safeString(e,"buy"),bidVolume:void 0,ask:this.safeString(e,"sell"),askVolume:void 0,vwap:void 0,open:void 0,close:s,last:s,previousClose:void 0,change:void 0,percentage:void 0,average:void 0,baseVolume:this.safeString(e,"vol"),quoteVolume:this.safeString(e,"volume"),info:e},t)}async fetchTicker(e,t={}){await this.loadMarkets();const i=this.market(e),s={};this.symbols.length>1&&(s.coin=i.baseId);const r=await this.publicGetTicker(this.extend(s,t));return this.parseTicker(r,i)}async fetchTickers(e=void 0,t={}){await this.loadMarkets();const i=await this.publicGetTickers(t);return this.parseTickers(i,e)}parseTrade(e,t=void 0){const i=this.safeTimestamp(e,"date");t=this.safeMarket(void 0,t);const s=this.safeString(e,"tid"),r=this.safeString(e,"price"),a=this.safeString(e,"amount"),o=this.safeString(e,"type");return this.safeTrade({info:e,id:s,order:void 0,timestamp:i,datetime:this.iso8601(i),symbol:t.symbol,type:undefined,side:o,takerOrMaker:void 0,price:r,amount:a,cost:void 0,fee:void 0},t)}async fetchTrades(e,t=void 0,i=void 0,s={}){await this.loadMarkets();const r=this.market(e),a={};this.symbols.length>1&&(a.coin=r.baseId);const o=await this.publicGetOrders(this.extend(a,s));return this.parseTrades(o,r,t,i)}async createOrder(e,t,i,s,r=void 0,a={}){await this.loadMarkets();const o=this.market(e),n={amount:s,price:r,type:i,coin:o.baseId},d=await this.privatePostTradeAdd(this.extend(n,a));return this.parseOrder(d,o)}async cancelOrder(e,t=void 0,i={}){await this.loadMarkets(),void 0===t&&(t="BTC/JPY");const s=this.market(t),r={id:e,coin:s.baseId},a=await this.privatePostTradeCancel(this.extend(r,i));return this.parseOrder(a,s)}parseOrderStatus(e){return this.safeString({part:"open",all:"closed",cancelled:"canceled",closed:"closed",no:"closed"},e,e)}parseOrder(e,t=void 0){const i=this.safeString(e,"id");let s;void 0!==this.safeString(e,"datetime")&&(s=this.parse8601(e.datetime+"+09:00"));const r=this.safeString(e,"amount_original"),o=this.safeString(e,"amount_outstanding"),n=this.safeString(e,"price");let d=this.parseOrderStatus(this.safeString(e,"status"));void 0===d&&a.Y.stringEquals(o,"0")&&(d="closed");t=this.safeMarket(void 0,t);const h=this.safeString(e,"type");return this.safeOrder({id:i,clientOrderId:void 0,timestamp:s,datetime:this.iso8601(s),lastTradeTimestamp:void 0,amount:r,remaining:o,filled:void 0,side:h,type:void 0,timeInForce:void 0,postOnly:void 0,status:d,symbol:t.symbol,price:n,triggerPrice:void 0,cost:void 0,trades:undefined,fee:void 0,info:e,average:void 0},t)}async fetchOrder(e,t=void 0,i={}){await this.loadMarkets(),void 0===t&&(t="BTC/JPY");const s=this.market(t),r=this.extend({id:e,coin:s.baseId},i),a=await this.privatePostTradeView(this.extend(r,i));return this.parseOrder(a,s)}async fetchOrdersByType(e,t=void 0,i=void 0,s=void 0,r={}){await this.loadMarkets();const a=this.market(t),o={type:e,coin:a.baseId},n=await this.privatePostTradeList(this.extend(o,r)),d=this.parseOrders(n,a,i,s);if("open"===e)for(let e=0;e=400)return;const c=this.safeValue(n,"result");if(void 0===c||!0===c)return;const l=this.safeValue(n,"code"),u=this.id+" "+o;throw this.throwExactlyMatchedException(this.exceptions,l,u),new r.ExchangeError(u)}async request(e,t="public",i="GET",s={},a=void 0,o=void 0,n={}){let d=await this.fetch2(e,t,i,s,a,o,n);if("string"==typeof d){if(d=this.strip(d),!this.isJsonEncodedObject(d))throw new r.ExchangeError(this.id+" "+d);d=JSON.parse(d)}return d}}},4936:(e,t,i)=>{i.d(t,{A:()=>d});var s=i(2317),r=i(2079),a=i(1579),o=i(5147),n=i(7481);class d extends s.A{describe(){return this.deepExtend(super.describe(),{id:"btcmarkets",name:"BTC Markets",countries:["AU"],rateLimit:1e3,version:"v3",has:{CORS:void 0,spot:!0,margin:!1,swap:!1,future:!1,option:!1,addMargin:!1,borrowCrossMargin:!1,borrowIsolatedMargin:!1,borrowMargin:!1,cancelOrder:!0,cancelOrders:!0,closeAllPositions:!1,closePosition:!1,createDepositAddress:!1,createOrder:!0,createOrderWithTakeProfitAndStopLoss:!1,createOrderWithTakeProfitAndStopLossWs:!1,createPostOnlyOrder:!1,createReduceOnlyOrder:!1,createTriggerOrder:!0,fetchBalance:!0,fetchBorrowInterest:!1,fetchBorrowRate:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchBorrowRates:!1,fetchBorrowRatesPerSymbol:!1,fetchClosedOrders:"emulated",fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchDepositAddress:!1,fetchDepositAddresses:!1,fetchDepositAddressesByNetwork:!1,fetchDeposits:!0,fetchDepositsWithdrawals:!0,fetchFundingHistory:!1,fetchFundingInterval:!1,fetchFundingIntervals:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchGreeks:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchIsolatedPositions:!1,fetchLeverage:!1,fetchLeverages:!1,fetchLeverageTiers:!1,fetchLiquidations:!1,fetchLongShortRatio:!1,fetchLongShortRatioHistory:!1,fetchMarginAdjustmentHistory:!1,fetchMarginMode:!1,fetchMarginModes:!1,fetchMarketLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMarkPrices:!1,fetchMyLiquidations:!1,fetchMySettlementHistory:!1,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenInterest:!1,fetchOpenInterestHistory:!1,fetchOpenInterests:!1,fetchOpenOrders:!0,fetchOption:!1,fetchOptionChain:!1,fetchOrder:!0,fetchOrderBook:!0,fetchOrders:!0,fetchPosition:!1,fetchPositionHistory:!1,fetchPositionMode:!1,fetchPositions:!1,fetchPositionsForSymbol:!1,fetchPositionsHistory:!1,fetchPositionsRisk:!1,fetchPremiumIndexOHLCV:!1,fetchSettlementHistory:!1,fetchTicker:!0,fetchTime:!0,fetchTrades:!0,fetchTransactions:"emulated",fetchVolatilityHistory:!1,fetchWithdrawals:!0,reduceMargin:!1,repayCrossMargin:!1,repayIsolatedMargin:!1,repayMargin:!1,setLeverage:!1,setMargin:!1,setMarginMode:!1,setPositionMode:!1,withdraw:!0},urls:{logo:"https://github.com/user-attachments/assets/8c8d6907-3873-4cc4-ad20-e22fba28247e",api:{public:"https://api.btcmarkets.net",private:"https://api.btcmarkets.net"},www:"https://btcmarkets.net",doc:["https://api.btcmarkets.net/doc/v3","https://github.com/BTCMarkets/API"]},api:{public:{get:["markets","markets/{marketId}/ticker","markets/{marketId}/trades","markets/{marketId}/orderbook","markets/{marketId}/candles","markets/tickers","markets/orderbooks","time"]},private:{get:["orders","orders/{id}","batchorders/{ids}","trades","trades/{id}","withdrawals","withdrawals/{id}","deposits","deposits/{id}","transfers","transfers/{id}","addresses","withdrawal-fees","assets","accounts/me/trading-fees","accounts/me/withdrawal-limits","accounts/me/balances","accounts/me/transactions","reports/{id}"],post:["orders","batchorders","withdrawals","reports"],delete:["orders","orders/{id}","batchorders/{ids}"],put:["orders/{id}"]}},timeframes:{"1m":"1m","1h":"1h","1d":"1d"},features:{spot:{sandbox:!1,createOrder:{marginMode:!1,triggerPrice:!0,triggerPriceType:void 0,triggerDirection:!1,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!0,FOK:!0,PO:!0,GTD:!1},hedged:!1,leverage:!1,marketBuyRequiresPrice:!1,marketBuyByCost:!1,selfTradePrevention:!0,trailing:!1,iceberg:!1},createOrders:void 0,fetchMyTrades:{marginMode:!1,limit:100,daysBack:1e5,untilDays:1e5,symbolRequired:!0},fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!1},fetchOpenOrders:{marginMode:!1,limit:100,trigger:!1,trailing:!1,symbolRequired:!1},fetchOrders:{marginMode:!1,limit:100,daysBack:1e5,untilDays:1e5,trigger:!1,trailing:!1,symbolRequired:!1},fetchClosedOrders:{marginMode:!1,limit:100,daysBack:1e5,daysBackCanceled:1,untilDays:1e5,trigger:!1,trailing:!1,symbolRequired:!1},fetchOHLCV:{limit:1e3}},swap:{linear:void 0,inverse:void 0},future:{linear:void 0,inverse:void 0}},precisionMode:a.kb,exceptions:{exact:{InsufficientFund:r.InsufficientFunds,InvalidPrice:r.InvalidOrder,InvalidAmount:r.InvalidOrder,MissingArgument:r.BadRequest,OrderAlreadyCancelled:r.InvalidOrder,OrderNotFound:r.OrderNotFound,OrderStatusIsFinal:r.InvalidOrder,InvalidPaginationParameter:r.BadRequest},broad:{}},fees:{percentage:!0,tierBased:!0,maker:this.parseNumber("-0.0005"),taker:this.parseNumber("0.0020")},options:{fees:{AUD:{maker:this.parseNumber("0.0085"),taker:this.parseNumber("0.0085")}}}})}async fetchTransactionsWithMethod(e,t=void 0,i=void 0,s=void 0,r={}){await this.loadMarkets();const a={};let o;void 0!==s&&(a.limit=s),void 0!==i&&(a.after=i),void 0!==t&&(o=this.currency(t));const n=await this[e](this.extend(a,r));return this.parseTransactions(n,o,i,s)}async fetchDepositsWithdrawals(e=void 0,t=void 0,i=void 0,s={}){return await this.fetchTransactionsWithMethod("privateGetTransfers",e,t,i,s)}async fetchDeposits(e=void 0,t=void 0,i=void 0,s={}){return await this.fetchTransactionsWithMethod("privateGetDeposits",e,t,i,s)}async fetchWithdrawals(e=void 0,t=void 0,i=void 0,s={}){return await this.fetchTransactionsWithMethod("privateGetWithdrawals",e,t,i,s)}parseTransactionStatus(e){return this.safeString({Accepted:"pending","Pending Authorization":"pending",Complete:"ok",Cancelled:"cancelled",Failed:"failed"},e,e)}parseTransactionType(e){return this.safeString({Withdraw:"withdrawal",Deposit:"deposit"},e,e)}parseTransaction(e,t=void 0){const i=this.parse8601(this.safeString(e,"creationTime")),s=this.parse8601(this.safeString(e,"lastUpdate"));let r=this.parseTransactionType(this.safeStringLower(e,"type"));"withdraw"===r&&(r="withdrawal");const a=this.safeDict(e,"paymentDetail",{}),n=this.safeString(a,"txId");let d,h=this.safeString(a,"address");if(void 0!==h){const e=h.split("?dt=");e.length>1&&(h=e[0],d=e[1])}const c=h,l=d,u=this.safeString(e,"fee"),f=this.parseTransactionStatus(this.safeString(e,"status")),p=this.safeString(e,"assetName"),m=this.safeCurrencyCode(p);let g=this.safeString(e,"amount");return u&&(g=o.Y.stringSub(g,u)),{id:this.safeString(e,"id"),txid:n,timestamp:i,datetime:this.iso8601(i),network:void 0,address:h,addressTo:c,addressFrom:undefined,tag:d,tagTo:l,tagFrom:undefined,type:r,amount:this.parseNumber(g),currency:m,status:f,updated:s,comment:this.safeString(e,"description"),internal:void 0,fee:{currency:m,cost:this.parseNumber(u),rate:void 0},info:e}}async fetchMarkets(e={}){const t=await this.publicGetMarkets(e);return this.parseMarkets(t)}parseMarket(e){const t=this.safeString(e,"baseAssetName"),i=this.safeString(e,"quoteAssetName"),s=this.safeString(e,"marketId"),r=this.safeCurrencyCode(t),a=this.safeCurrencyCode(i),o=r+"/"+a,n=this.safeValue(this.safeDict(this.options,"fees",{}),a,this.fees),d=this.parseNumber(this.parsePrecision(this.safeString(e,"priceDecimals"))),h=this.safeNumber(e,"minOrderAmount"),c=this.safeNumber(e,"maxOrderAmount");let l;return"AUD"===a&&(l=d),{id:s,symbol:o,base:r,quote:a,settle:void 0,baseId:t,quoteId:i,settleId:void 0,type:"spot",spot:!0,margin:!1,swap:!1,future:!1,option:!1,active:"Online"===this.safeString(e,"status"),contract:!1,linear:void 0,inverse:void 0,taker:n.taker,maker:n.maker,contractSize:void 0,expiry:void 0,expiryDatetime:void 0,strike:void 0,optionType:void 0,precision:{amount:this.parseNumber(this.parsePrecision(this.safeString(e,"amountDecimals"))),price:d},limits:{leverage:{min:void 0,max:void 0},amount:{min:h,max:c},price:{min:l,max:void 0},cost:{min:void 0,max:void 0}},created:void 0,info:e}}async fetchTime(e={}){const t=await this.publicGetTime(e);return this.parse8601(this.safeString(t,"timestamp"))}parseBalance(e){const t={info:e};for(let i=0;i{i.d(t,{A:()=>d});var s=i(8430),r=i(2079),a=i(5147),o=i(1579),n=i(4852);class d extends s.A{describe(){return this.deepExtend(super.describe(),{id:"btcturk",name:"BTCTurk",countries:["TR"],rateLimit:100,pro:!1,has:{CORS:!0,spot:!0,margin:!1,swap:!1,future:!1,option:!1,addMargin:!1,borrowCrossMargin:!1,borrowIsolatedMargin:!1,borrowMargin:!1,cancelOrder:!0,closeAllPositions:!1,closePosition:!1,createDepositAddress:!1,createOrder:!0,createOrderWithTakeProfitAndStopLoss:!1,createOrderWithTakeProfitAndStopLossWs:!1,createPostOnlyOrder:!1,createReduceOnlyOrder:!1,fetchBalance:!0,fetchBorrowInterest:!1,fetchBorrowRate:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchBorrowRates:!1,fetchBorrowRatesPerSymbol:!1,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchDepositAddress:!1,fetchDepositAddresses:!1,fetchDepositAddressesByNetwork:!1,fetchFundingHistory:!1,fetchFundingInterval:!1,fetchFundingIntervals:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchGreeks:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchIsolatedPositions:!1,fetchLeverage:!1,fetchLeverages:!1,fetchLeverageTiers:!1,fetchLiquidations:!1,fetchLongShortRatio:!1,fetchLongShortRatioHistory:!1,fetchMarginAdjustmentHistory:!1,fetchMarginMode:!1,fetchMarginModes:!1,fetchMarketLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMarkPrices:!1,fetchMyLiquidations:!1,fetchMySettlementHistory:!1,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenInterest:!1,fetchOpenInterestHistory:!1,fetchOpenInterests:!1,fetchOpenOrders:!0,fetchOption:!1,fetchOptionChain:!1,fetchOrderBook:!0,fetchOrders:!0,fetchPosition:!1,fetchPositionHistory:!1,fetchPositionMode:!1,fetchPositions:!1,fetchPositionsForSymbol:!1,fetchPositionsHistory:!1,fetchPositionsRisk:!1,fetchPremiumIndexOHLCV:!1,fetchSettlementHistory:!1,fetchTicker:!0,fetchTickers:!0,fetchTrades:!0,fetchVolatilityHistory:!1,reduceMargin:!1,repayCrossMargin:!1,repayIsolatedMargin:!1,repayMargin:!1,setLeverage:!1,setMargin:!1,setMarginMode:!1,setPositionMode:!1,ws:!1},timeframes:{"1m":1,"15m":15,"30m":30,"1h":60,"4h":240,"1d":"1 d","1w":"1 w","1y":"1 y"},urls:{logo:"https://github.com/user-attachments/assets/10e0a238-9f60-4b06-9dda-edfc7602f1d6",api:{public:"https://api.btcturk.com/api/v2",private:"https://api.btcturk.com/api/v1",graph:"https://graph-api.btcturk.com/v1"},www:"https://www.btcturk.com",doc:"https://github.com/BTCTrader/broker-api-docs"},api:{public:{get:{orderbook:1,ticker:.1,trades:1,ohlc:1,"server/exchangeinfo":1}},private:{get:{"users/balances":1,openOrders:1,allOrders:1,"users/transactions/trade":1},post:{"users/transactions/crypto":1,"users/transactions/fiat":1,order:1,cancelOrder:1},delete:{order:1}},graph:{get:{ohlcs:1,"klines/history":1}}},features:{spot:{sandbox:!1,createOrder:{marginMode:!1,triggerPrice:!0,triggerPriceType:void 0,triggerDirection:!1,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!1,FOK:!1,PO:!1,GTD:!1},hedged:!1,leverage:!1,marketBuyRequiresPrice:!1,marketBuyByCost:!1,selfTradePrevention:!1,trailing:!1,iceberg:!1},createOrders:void 0,fetchMyTrades:{marginMode:!1,limit:100,daysBack:1e5,untilDays:30,symbolRequired:!0},fetchOrder:void 0,fetchOpenOrders:{marginMode:!1,limit:void 0,trigger:!1,trailing:!1,symbolRequired:!0},fetchOrders:{marginMode:!1,limit:1e3,daysBack:1e5,untilDays:30,trigger:!1,trailing:!1,symbolRequired:!0},fetchClosedOrders:void 0,fetchOHLCV:{limit:void 0}},swap:{linear:void 0,inverse:void 0},future:{linear:void 0,inverse:void 0}},fees:{trading:{maker:this.parseNumber("0.0005"),taker:this.parseNumber("0.0009")}},exceptions:{exact:{FAILED_ORDER_WITH_OPEN_ORDERS:r.InsufficientFunds,FAILED_LIMIT_ORDER:r.InvalidOrder,FAILED_MARKET_ORDER:r.InvalidOrder}},precisionMode:o.kb})}async fetchMarkets(e={}){const t=await this.publicGetServerExchangeinfo(e),i=this.safeDict(t,"data",{}),s=this.safeList(i,"symbols",[]);return this.parseMarkets(s)}parseMarket(e){const t=this.safeString(e,"name"),i=this.safeString(e,"numerator"),s=this.safeString(e,"denominator"),r=this.safeCurrencyCode(i),a=this.safeCurrencyCode(s),o=this.safeList(e,"filters",[]);let n,d,h,c,l;for(let e=0;e{i.d(t,{A:()=>h});var s=i(1293),r=i(1579),a=i(2079),o=i(5147),n=i(4852),d=i(5354);class h extends s.A{describe(){return this.deepExtend(super.describe(),{id:"bybit",name:"Bybit",countries:["VG"],version:"v5",userAgent:void 0,rateLimit:20,hostname:"bybit.com",pro:!0,certified:!0,has:{CORS:!0,spot:!0,margin:!0,swap:!0,future:!0,option:!0,borrowCrossMargin:!0,cancelAllOrders:!0,cancelAllOrdersAfter:!0,cancelOrder:!0,cancelOrders:!0,cancelOrdersForSymbols:!0,closeAllPositions:!1,closePosition:!1,createConvertTrade:!0,createMarketBuyOrderWithCost:!0,createMarketSellOrderWithCost:!0,createOrder:!0,createOrders:!0,createOrderWithTakeProfitAndStopLoss:!0,createPostOnlyOrder:!0,createReduceOnlyOrder:!0,createStopLimitOrder:!0,createStopLossOrder:!0,createStopMarketOrder:!0,createStopOrder:!0,createTakeProfitOrder:!0,createTrailingAmountOrder:!0,createTriggerOrder:!0,editOrder:!0,editOrders:!0,fetchAllGreeks:!0,fetchBalance:!0,fetchBidsAsks:"emulated",fetchBorrowInterest:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchCanceledAndClosedOrders:!0,fetchCanceledOrders:!0,fetchClosedOrder:!0,fetchClosedOrders:!0,fetchConvertCurrencies:!0,fetchConvertQuote:!0,fetchConvertTrade:!0,fetchConvertTradeHistory:!0,fetchCrossBorrowRate:!0,fetchCrossBorrowRates:!1,fetchCurrencies:!0,fetchDeposit:!1,fetchDepositAddress:!0,fetchDepositAddresses:!1,fetchDepositAddressesByNetwork:!0,fetchDeposits:!0,fetchDepositWithdrawFee:"emulated",fetchDepositWithdrawFees:!0,fetchFundingHistory:!0,fetchFundingRate:"emulated",fetchFundingRateHistory:!0,fetchFundingRates:!0,fetchGreeks:!0,fetchIndexOHLCV:!0,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchLedger:!0,fetchLeverage:!0,fetchLeverageTiers:!0,fetchLongShortRatio:!1,fetchLongShortRatioHistory:!0,fetchMarginAdjustmentHistory:!1,fetchMarketLeverageTiers:!0,fetchMarkets:!0,fetchMarkOHLCV:!0,fetchMyLiquidations:!0,fetchMySettlementHistory:!0,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenInterest:!0,fetchOpenInterestHistory:!0,fetchOpenOrder:!0,fetchOpenOrders:!0,fetchOption:!0,fetchOptionChain:!0,fetchOrder:!0,fetchOrderBook:!0,fetchOrders:!1,fetchOrderTrades:!0,fetchPosition:!0,fetchPositionHistory:"emulated",fetchPositions:!0,fetchPositionsHistory:!0,fetchPremiumIndexOHLCV:!0,fetchSettlementHistory:!0,fetchTicker:!0,fetchTickers:!0,fetchTime:!0,fetchTrades:!0,fetchTradingFee:!0,fetchTradingFees:!0,fetchTransactions:!1,fetchTransfers:!0,fetchUnderlyingAssets:!1,fetchVolatilityHistory:!0,fetchWithdrawals:!0,repayCrossMargin:!0,sandbox:!0,setLeverage:!0,setMarginMode:!0,setPositionMode:!0,transfer:!0,withdraw:!0},timeframes:{"1m":"1","3m":"3","5m":"5","15m":"15","30m":"30","1h":"60","2h":"120","4h":"240","6h":"360","12h":"720","1d":"D","1w":"W","1M":"M"},urls:{test:{spot:"https://api-testnet.{hostname}",futures:"https://api-testnet.{hostname}",v2:"https://api-testnet.{hostname}",public:"https://api-testnet.{hostname}",private:"https://api-testnet.{hostname}"},logo:"https://github.com/user-attachments/assets/97a5d0b3-de10-423d-90e1-6620960025ed",api:{spot:"https://api.{hostname}",futures:"https://api.{hostname}",v2:"https://api.{hostname}",public:"https://api.{hostname}",private:"https://api.{hostname}"},demotrading:{spot:"https://api-demo.{hostname}",futures:"https://api-demo.{hostname}",v2:"https://api-demo.{hostname}",public:"https://api-demo.{hostname}",private:"https://api-demo.{hostname}"},www:"https://www.bybit.com",doc:["https://bybit-exchange.github.io/docs/inverse/","https://bybit-exchange.github.io/docs/linear/","https://github.com/bybit-exchange"],fees:"https://help.bybit.com/hc/en-us/articles/360039261154",referral:"https://www.bybit.com/register?affiliate_id=35953"},api:{public:{get:{"spot/v3/public/symbols":1,"spot/v3/public/quote/depth":1,"spot/v3/public/quote/depth/merged":1,"spot/v3/public/quote/trades":1,"spot/v3/public/quote/kline":1,"spot/v3/public/quote/ticker/24hr":1,"spot/v3/public/quote/ticker/price":1,"spot/v3/public/quote/ticker/bookTicker":1,"spot/v3/public/server-time":1,"spot/v3/public/infos":1,"spot/v3/public/margin-product-infos":1,"spot/v3/public/margin-ensure-tokens":1,"v3/public/time":1,"contract/v3/public/copytrading/symbol/list":1,"derivatives/v3/public/order-book/L2":1,"derivatives/v3/public/kline":1,"derivatives/v3/public/tickers":1,"derivatives/v3/public/instruments-info":1,"derivatives/v3/public/mark-price-kline":1,"derivatives/v3/public/index-price-kline":1,"derivatives/v3/public/funding/history-funding-rate":1,"derivatives/v3/public/risk-limit/list":1,"derivatives/v3/public/delivery-price":1,"derivatives/v3/public/recent-trade":1,"derivatives/v3/public/open-interest":1,"derivatives/v3/public/insurance":1,"v5/announcements/index":5,"v5/market/time":5,"v5/market/kline":5,"v5/market/mark-price-kline":5,"v5/market/index-price-kline":5,"v5/market/premium-index-price-kline":5,"v5/market/instruments-info":5,"v5/market/orderbook":5,"v5/market/tickers":5,"v5/market/funding/history":5,"v5/market/recent-trade":5,"v5/market/open-interest":5,"v5/market/historical-volatility":5,"v5/market/insurance":5,"v5/market/risk-limit":5,"v5/market/delivery-price":5,"v5/market/account-ratio":5,"v5/spot-lever-token/info":5,"v5/spot-lever-token/reference":5,"v5/spot-margin-trade/data":5,"v5/spot-margin-trade/collateral":5,"v5/spot-cross-margin-trade/data":5,"v5/spot-cross-margin-trade/pledge-token":5,"v5/spot-cross-margin-trade/borrow-token":5,"v5/crypto-loan/collateral-data":5,"v5/crypto-loan/loanable-data":5,"v5/ins-loan/product-infos":5,"v5/ins-loan/ensure-tokens-convert":5,"v5/earn/product":5}},private:{get:{"v5/market/instruments-info":5,"v2/private/wallet/fund/records":25,"spot/v3/private/order":2.5,"spot/v3/private/open-orders":2.5,"spot/v3/private/history-orders":2.5,"spot/v3/private/my-trades":2.5,"spot/v3/private/account":2.5,"spot/v3/private/reference":2.5,"spot/v3/private/record":2.5,"spot/v3/private/cross-margin-orders":10,"spot/v3/private/cross-margin-account":10,"spot/v3/private/cross-margin-loan-info":10,"spot/v3/private/cross-margin-repay-history":10,"spot/v3/private/margin-loan-infos":10,"spot/v3/private/margin-repaid-infos":10,"spot/v3/private/margin-ltv":10,"asset/v3/private/transfer/inter-transfer/list/query":50,"asset/v3/private/transfer/sub-member/list/query":50,"asset/v3/private/transfer/sub-member-transfer/list/query":50,"asset/v3/private/transfer/universal-transfer/list/query":25,"asset/v3/private/coin-info/query":25,"asset/v3/private/deposit/address/query":10,"contract/v3/private/copytrading/order/list":30,"contract/v3/private/copytrading/position/list":40,"contract/v3/private/copytrading/wallet/balance":25,"contract/v3/private/position/limit-info":25,"contract/v3/private/order/unfilled-orders":1,"contract/v3/private/order/list":1,"contract/v3/private/position/list":1,"contract/v3/private/execution/list":1,"contract/v3/private/position/closed-pnl":1,"contract/v3/private/account/wallet/balance":1,"contract/v3/private/account/fee-rate":1,"contract/v3/private/account/wallet/fund-records":1,"unified/v3/private/order/unfilled-orders":1,"unified/v3/private/order/list":1,"unified/v3/private/position/list":1,"unified/v3/private/execution/list":1,"unified/v3/private/delivery-record":1,"unified/v3/private/settlement-record":1,"unified/v3/private/account/wallet/balance":1,"unified/v3/private/account/transaction-log":1,"unified/v3/private/account/borrow-history":1,"unified/v3/private/account/borrow-rate":1,"unified/v3/private/account/info":1,"user/v3/private/frozen-sub-member":10,"user/v3/private/query-sub-members":5,"user/v3/private/query-api":5,"user/v3/private/get-member-type":1,"asset/v3/private/transfer/transfer-coin/list/query":50,"asset/v3/private/transfer/account-coin/balance/query":50,"asset/v3/private/transfer/account-coins/balance/query":25,"asset/v3/private/transfer/asset-info/query":50,"asset/v3/public/deposit/allowed-deposit-list/query":.17,"asset/v3/private/deposit/record/query":10,"asset/v3/private/withdraw/record/query":10,"v5/order/realtime":5,"v5/order/history":5,"v5/order/spot-borrow-check":1,"v5/position/list":5,"v5/execution/list":5,"v5/position/closed-pnl":5,"v5/position/move-history":5,"v5/pre-upgrade/order/history":5,"v5/pre-upgrade/execution/list":5,"v5/pre-upgrade/position/closed-pnl":5,"v5/pre-upgrade/account/transaction-log":5,"v5/pre-upgrade/asset/delivery-record":5,"v5/pre-upgrade/asset/settlement-record":5,"v5/account/wallet-balance":1,"v5/account/borrow-history":1,"v5/account/collateral-info":1,"v5/asset/coin-greeks":1,"v5/account/fee-rate":10,"v5/account/info":5,"v5/account/transaction-log":1,"v5/account/contract-transaction-log":1,"v5/account/smp-group":1,"v5/account/mmp-state":5,"v5/account/withdrawal":5,"v5/asset/exchange/query-coin-list":.5,"v5/asset/exchange/convert-result-query":.5,"v5/asset/exchange/query-convert-history":.5,"v5/asset/exchange/order-record":5,"v5/asset/delivery-record":5,"v5/asset/settlement-record":5,"v5/asset/transfer/query-asset-info":50,"v5/asset/transfer/query-account-coins-balance":25,"v5/asset/transfer/query-account-coin-balance":50,"v5/asset/transfer/query-transfer-coin-list":50,"v5/asset/transfer/query-inter-transfer-list":50,"v5/asset/transfer/query-sub-member-list":50,"v5/asset/transfer/query-universal-transfer-list":25,"v5/asset/deposit/query-allowed-list":5,"v5/asset/deposit/query-record":10,"v5/asset/deposit/query-sub-member-record":10,"v5/asset/deposit/query-internal-record":5,"v5/asset/deposit/query-address":10,"v5/asset/deposit/query-sub-member-address":10,"v5/asset/coin/query-info":28,"v5/asset/withdraw/query-record":10,"v5/asset/withdraw/withdrawable-amount":5,"v5/asset/withdraw/vasp/list":5,"v5/user/query-sub-members":5,"v5/user/query-api":5,"v5/user/sub-apikeys":5,"v5/user/get-member-type":5,"v5/user/aff-customer-info":5,"v5/user/del-submember":5,"v5/user/submembers":5,"v5/affiliate/aff-user-list":5,"v5/spot-lever-token/order-record":1,"v5/spot-margin-trade/interest-rate-history":5,"v5/spot-margin-trade/state":5,"v5/spot-cross-margin-trade/loan-info":1,"v5/spot-cross-margin-trade/account":1,"v5/spot-cross-margin-trade/orders":1,"v5/spot-cross-margin-trade/repay-history":1,"v5/crypto-loan/borrowable-collateralisable-number":5,"v5/crypto-loan/ongoing-orders":5,"v5/crypto-loan/repayment-history":5,"v5/crypto-loan/borrow-history":5,"v5/crypto-loan/max-collateral-amount":5,"v5/crypto-loan/adjustment-history":5,"v5/ins-loan/product-infos":5,"v5/ins-loan/ensure-tokens-convert":5,"v5/ins-loan/loan-order":5,"v5/ins-loan/repaid-history":5,"v5/ins-loan/ltv-convert":5,"v5/lending/info":5,"v5/lending/history-order":5,"v5/lending/account":5,"v5/broker/earning-record":5,"v5/broker/earnings-info":5,"v5/broker/account-info":5,"v5/broker/asset/query-sub-member-deposit-record":10,"v5/earn/order":5,"v5/earn/position":5},post:{"spot/v3/private/order":2.5,"spot/v3/private/cancel-order":2.5,"spot/v3/private/cancel-orders":2.5,"spot/v3/private/cancel-orders-by-ids":2.5,"spot/v3/private/purchase":2.5,"spot/v3/private/redeem":2.5,"spot/v3/private/cross-margin-loan":10,"spot/v3/private/cross-margin-repay":10,"asset/v3/private/transfer/inter-transfer":150,"asset/v3/private/withdraw/create":300,"asset/v3/private/withdraw/cancel":50,"asset/v3/private/transfer/sub-member-transfer":150,"asset/v3/private/transfer/transfer-sub-member-save":150,"asset/v3/private/transfer/universal-transfer":10,"user/v3/private/create-sub-member":10,"user/v3/private/create-sub-api":10,"user/v3/private/update-api":10,"user/v3/private/delete-api":10,"user/v3/private/update-sub-api":10,"user/v3/private/delete-sub-api":10,"contract/v3/private/copytrading/order/create":30,"contract/v3/private/copytrading/order/cancel":30,"contract/v3/private/copytrading/order/close":30,"contract/v3/private/copytrading/position/close":40,"contract/v3/private/copytrading/position/set-leverage":40,"contract/v3/private/copytrading/wallet/transfer":25,"contract/v3/private/copytrading/order/trading-stop":2.5,"contract/v3/private/order/create":1,"contract/v3/private/order/cancel":1,"contract/v3/private/order/cancel-all":1,"contract/v3/private/order/replace":1,"contract/v3/private/position/set-auto-add-margin":1,"contract/v3/private/position/switch-isolated":1,"contract/v3/private/position/switch-mode":1,"contract/v3/private/position/switch-tpsl-mode":1,"contract/v3/private/position/set-leverage":1,"contract/v3/private/position/trading-stop":1,"contract/v3/private/position/set-risk-limit":1,"contract/v3/private/account/setMarginMode":1,"unified/v3/private/order/create":30,"unified/v3/private/order/replace":30,"unified/v3/private/order/cancel":30,"unified/v3/private/order/create-batch":30,"unified/v3/private/order/replace-batch":30,"unified/v3/private/order/cancel-batch":30,"unified/v3/private/order/cancel-all":30,"unified/v3/private/position/set-leverage":2.5,"unified/v3/private/position/tpsl/switch-mode":2.5,"unified/v3/private/position/set-risk-limit":2.5,"unified/v3/private/position/trading-stop":2.5,"unified/v3/private/account/upgrade-unified-account":2.5,"unified/v3/private/account/setMarginMode":2.5,"fht/compliance/tax/v3/private/registertime":50,"fht/compliance/tax/v3/private/create":50,"fht/compliance/tax/v3/private/status":50,"fht/compliance/tax/v3/private/url":50,"v5/order/create":2.5,"v5/order/amend":5,"v5/order/cancel":2.5,"v5/order/cancel-all":50,"v5/order/create-batch":5,"v5/order/amend-batch":5,"v5/order/cancel-batch":5,"v5/order/disconnected-cancel-all":5,"v5/position/set-leverage":5,"v5/position/switch-isolated":5,"v5/position/set-tpsl-mode":5,"v5/position/switch-mode":5,"v5/position/set-risk-limit":5,"v5/position/trading-stop":5,"v5/position/set-auto-add-margin":5,"v5/position/add-margin":5,"v5/position/move-positions":5,"v5/position/confirm-pending-mmr":5,"v5/account/upgrade-to-uta":5,"v5/account/quick-repayment":5,"v5/account/set-margin-mode":5,"v5/account/set-hedging-mode":5,"v5/account/mmp-modify":5,"v5/account/mmp-reset":5,"v5/asset/exchange/quote-apply":1,"v5/asset/exchange/convert-execute":1,"v5/asset/transfer/inter-transfer":50,"v5/asset/transfer/save-transfer-sub-member":150,"v5/asset/transfer/universal-transfer":10,"v5/asset/deposit/deposit-to-account":5,"v5/asset/withdraw/create":50,"v5/asset/withdraw/cancel":50,"v5/user/create-sub-member":10,"v5/user/create-sub-api":10,"v5/user/frozen-sub-member":10,"v5/user/update-api":10,"v5/user/update-sub-api":10,"v5/user/delete-api":10,"v5/user/delete-sub-api":10,"v5/spot-lever-token/purchase":2.5,"v5/spot-lever-token/redeem":2.5,"v5/spot-margin-trade/switch-mode":5,"v5/spot-margin-trade/set-leverage":5,"v5/spot-cross-margin-trade/loan":2.5,"v5/spot-cross-margin-trade/repay":2.5,"v5/spot-cross-margin-trade/switch":2.5,"v5/crypto-loan/borrow":5,"v5/crypto-loan/repay":5,"v5/crypto-loan/adjust-ltv":5,"v5/ins-loan/association-uid":5,"v5/lending/purchase":5,"v5/lending/redeem":5,"v5/lending/redeem-cancel":5,"v5/account/set-collateral-switch":5,"v5/account/set-collateral-switch-batch":5,"v5/account/demo-apply-money":5,"v5/broker/award/info":5,"v5/broker/award/distribute-award":5,"v5/broker/award/distribution-record":5,"v5/earn/place-order":5}}},httpExceptions:{403:a.RateLimitExceeded},exceptions:{exact:{"-10009":a.BadRequest,"-1004":a.BadRequest,"-1021":a.BadRequest,"-1103":a.BadRequest,"-1140":a.InvalidOrder,"-1197":a.InvalidOrder,"-2013":a.InvalidOrder,"-2015":a.AuthenticationError,"-6017":a.BadRequest,"-6025":a.BadRequest,"-6029":a.BadRequest,5004:a.ExchangeError,7001:a.BadRequest,10001:a.BadRequest,10002:a.InvalidNonce,10003:a.AuthenticationError,10004:a.AuthenticationError,10005:a.PermissionDenied,10006:a.RateLimitExceeded,10007:a.AuthenticationError,10008:a.AccountSuspended,10009:a.AuthenticationError,10010:a.PermissionDenied,10014:a.BadRequest,10016:a.ExchangeError,10017:a.BadRequest,10018:a.RateLimitExceeded,10020:a.PermissionDenied,10024:a.PermissionDenied,10027:a.PermissionDenied,10028:a.PermissionDenied,10029:a.PermissionDenied,12137:a.InvalidOrder,12201:a.BadRequest,12141:a.BadRequest,100028:a.PermissionDenied,110001:a.OrderNotFound,110003:a.InvalidOrder,110004:a.InsufficientFunds,110005:a.InvalidOrder,110006:a.InsufficientFunds,110007:a.InsufficientFunds,110008:a.InvalidOrder,110009:a.InvalidOrder,110010:a.InvalidOrder,110011:a.InvalidOrder,110012:a.InsufficientFunds,110013:a.BadRequest,110014:a.InsufficientFunds,110015:a.BadRequest,110016:a.InvalidOrder,110017:a.InvalidOrder,110018:a.BadRequest,110019:a.InvalidOrder,110020:a.InvalidOrder,110021:a.InvalidOrder,110022:a.InvalidOrder,110023:a.InvalidOrder,110024:a.BadRequest,110025:a.NoChange,110026:a.MarginModeAlreadySet,110027:a.NoChange,110028:a.BadRequest,110029:a.BadRequest,110030:a.InvalidOrder,110031:a.InvalidOrder,110032:a.InvalidOrder,110033:a.InvalidOrder,110034:a.InvalidOrder,110035:a.InvalidOrder,110036:a.InvalidOrder,110037:a.InvalidOrder,110038:a.InvalidOrder,110039:a.InvalidOrder,110040:a.InvalidOrder,110041:a.InvalidOrder,110042:a.InvalidOrder,110043:a.BadRequest,110044:a.InsufficientFunds,110045:a.InsufficientFunds,110046:a.BadRequest,110047:a.BadRequest,110048:a.BadRequest,110049:a.BadRequest,110050:a.BadRequest,110051:a.InsufficientFunds,110052:a.InsufficientFunds,110053:a.InsufficientFunds,110054:a.InvalidOrder,110055:a.InvalidOrder,110056:a.InvalidOrder,110057:a.InvalidOrder,110058:a.InvalidOrder,110059:a.InvalidOrder,110060:a.BadRequest,110061:a.BadRequest,110062:a.BadRequest,110063:a.ExchangeError,110064:a.InvalidOrder,110065:a.PermissionDenied,110066:a.ExchangeError,110067:a.PermissionDenied,110068:a.PermissionDenied,110069:a.PermissionDenied,110070:a.InvalidOrder,110071:a.ExchangeError,110072:a.InvalidOrder,110073:a.ExchangeError,110092:a.InvalidOrder,110093:a.InvalidOrder,110094:a.InvalidOrder,130006:a.InvalidOrder,130021:a.InsufficientFunds,130074:a.InvalidOrder,131001:a.InsufficientFunds,131084:a.ExchangeError,131200:a.ExchangeError,131201:a.ExchangeError,131202:a.BadRequest,131203:a.BadRequest,131204:a.BadRequest,131205:a.BadRequest,131206:a.ExchangeError,131207:a.BadRequest,131208:a.ExchangeError,131209:a.BadRequest,131210:a.BadRequest,131211:a.BadRequest,131212:a.InsufficientFunds,131213:a.BadRequest,131214:a.BadRequest,131215:a.BadRequest,131216:a.ExchangeError,131217:a.ExchangeError,131231:a.NotSupported,131232:a.NotSupported,131002:a.BadRequest,131003:a.ExchangeError,131004:a.AuthenticationError,131085:a.InsufficientFunds,131086:a.BadRequest,131088:a.BadRequest,131089:a.BadRequest,131090:a.ExchangeError,131091:a.ExchangeError,131092:a.ExchangeError,131093:a.ExchangeError,131094:a.BadRequest,131095:a.BadRequest,131096:a.BadRequest,131097:a.ExchangeError,131098:a.ExchangeError,131099:a.ExchangeError,140001:a.OrderNotFound,140003:a.InvalidOrder,140004:a.InsufficientFunds,140005:a.InvalidOrder,140006:a.InsufficientFunds,140007:a.InsufficientFunds,140008:a.InvalidOrder,140009:a.InvalidOrder,140010:a.InvalidOrder,140011:a.InvalidOrder,140012:a.InsufficientFunds,140013:a.BadRequest,140014:a.InsufficientFunds,140015:a.InvalidOrder,140016:a.InvalidOrder,140017:a.InvalidOrder,140018:a.BadRequest,140019:a.InvalidOrder,140020:a.InvalidOrder,140021:a.InvalidOrder,140022:a.InvalidOrder,140023:a.InvalidOrder,140024:a.BadRequest,140025:a.BadRequest,140026:a.BadRequest,140027:a.BadRequest,140028:a.InvalidOrder,140029:a.BadRequest,140030:a.InvalidOrder,140031:a.BadRequest,140032:a.InvalidOrder,140033:a.InvalidOrder,140034:a.InvalidOrder,140035:a.InvalidOrder,140036:a.BadRequest,140037:a.InvalidOrder,140038:a.BadRequest,140039:a.BadRequest,140040:a.InvalidOrder,140041:a.InvalidOrder,140042:a.InvalidOrder,140043:a.BadRequest,140044:a.InsufficientFunds,140045:a.InsufficientFunds,140046:a.BadRequest,140047:a.BadRequest,140048:a.BadRequest,140049:a.BadRequest,140050:a.InvalidOrder,140051:a.InsufficientFunds,140052:a.InsufficientFunds,140053:a.InsufficientFunds,140054:a.InvalidOrder,140055:a.InvalidOrder,140056:a.InvalidOrder,140057:a.InvalidOrder,140058:a.InvalidOrder,140059:a.InvalidOrder,140060:a.BadRequest,140061:a.BadRequest,140062:a.BadRequest,140063:a.ExchangeError,140064:a.InvalidOrder,140065:a.PermissionDenied,140066:a.ExchangeError,140067:a.PermissionDenied,140068:a.PermissionDenied,140069:a.PermissionDenied,140070:a.InvalidOrder,170001:a.ExchangeError,170005:a.InvalidOrder,170007:a.RequestTimeout,170010:a.InvalidOrder,170011:a.InvalidOrder,170019:a.InvalidOrder,170031:a.ExchangeError,170032:a.ExchangeError,170033:a.InsufficientFunds,170034:a.InsufficientFunds,170035:a.BadRequest,170036:a.BadRequest,170037:a.BadRequest,170105:a.BadRequest,170115:a.InvalidOrder,170116:a.InvalidOrder,170117:a.InvalidOrder,170121:a.InvalidOrder,170124:a.InvalidOrder,170130:a.BadRequest,170131:a.InsufficientFunds,170132:a.InvalidOrder,170133:a.InvalidOrder,170134:a.InvalidOrder,170135:a.InvalidOrder,170136:a.InvalidOrder,170137:a.InvalidOrder,170139:a.InvalidOrder,170140:a.InvalidOrder,170141:a.InvalidOrder,170142:a.InvalidOrder,170143:a.InvalidOrder,170144:a.InvalidOrder,170145:a.InvalidOrder,170146:a.InvalidOrder,170147:a.InvalidOrder,170148:a.InvalidOrder,170149:a.ExchangeError,170150:a.ExchangeError,170151:a.InvalidOrder,170157:a.InvalidOrder,170159:a.InvalidOrder,170190:a.InvalidOrder,170191:a.InvalidOrder,170192:a.InvalidOrder,170193:a.InvalidOrder,170194:a.InvalidOrder,170195:a.InvalidOrder,170196:a.InvalidOrder,170197:a.InvalidOrder,170198:a.InvalidOrder,170199:a.InvalidOrder,170200:a.InvalidOrder,170201:a.PermissionDenied,170202:a.InvalidOrder,170203:a.InvalidOrder,170204:a.InvalidOrder,170206:a.InvalidOrder,170210:a.InvalidOrder,170213:a.OrderNotFound,170217:a.InvalidOrder,170218:a.InvalidOrder,170221:a.BadRequest,170222:a.RateLimitExceeded,170223:a.InsufficientFunds,170224:a.PermissionDenied,170226:a.InsufficientFunds,170227:a.ExchangeError,170228:a.InvalidOrder,170229:a.InvalidOrder,170234:a.ExchangeError,170241:a.ManualInteractionNeeded,175e3:a.InvalidOrder,175001:a.InvalidOrder,175002:a.InvalidOrder,175003:a.InsufficientFunds,175004:a.InvalidOrder,175005:a.InvalidOrder,175006:a.InsufficientFunds,175007:a.InvalidOrder,175008:a.InvalidOrder,175009:a.InvalidOrder,175010:a.PermissionDenied,175012:a.InvalidOrder,175013:a.InvalidOrder,175014:a.InvalidOrder,175015:a.InvalidOrder,175016:a.InvalidOrder,175017:a.InvalidOrder,175027:a.ExchangeError,176002:a.BadRequest,176004:a.BadRequest,176003:a.BadRequest,176006:a.BadRequest,176005:a.BadRequest,176008:a.BadRequest,176007:a.BadRequest,176010:a.BadRequest,176009:a.BadRequest,176012:a.BadRequest,176011:a.BadRequest,176014:a.BadRequest,176013:a.BadRequest,176015:a.InsufficientFunds,176016:a.BadRequest,176017:a.BadRequest,176018:a.BadRequest,176019:a.BadRequest,176020:a.BadRequest,176021:a.BadRequest,176022:a.BadRequest,176023:a.BadRequest,176024:a.BadRequest,176025:a.BadRequest,176026:a.BadRequest,176027:a.BadRequest,176028:a.BadRequest,176029:a.BadRequest,176030:a.BadRequest,176031:a.BadRequest,176034:a.BadRequest,176035:a.PermissionDenied,176036:a.PermissionDenied,176037:a.PermissionDenied,176038:a.BadRequest,176039:a.BadRequest,176040:a.BadRequest,181e3:a.BadRequest,181001:a.BadRequest,181002:a.InvalidOrder,181003:a.InvalidOrder,181004:a.InvalidOrder,182e3:a.InvalidOrder,181017:a.BadRequest,20001:a.OrderNotFound,20003:a.InvalidOrder,20004:a.InvalidOrder,20005:a.InvalidOrder,20006:a.InvalidOrder,20007:a.InvalidOrder,20008:a.InvalidOrder,20009:a.InvalidOrder,20010:a.InvalidOrder,20011:a.InvalidOrder,20012:a.InvalidOrder,20013:a.InvalidOrder,20014:a.InvalidOrder,20015:a.InvalidOrder,20016:a.InvalidOrder,20017:a.InvalidOrder,20018:a.InvalidOrder,20019:a.InvalidOrder,20020:a.InvalidOrder,20021:a.InvalidOrder,20022:a.BadRequest,20023:a.BadRequest,20031:a.BadRequest,20070:a.BadRequest,20071:a.BadRequest,20084:a.BadRequest,30001:a.BadRequest,30003:a.InvalidOrder,30004:a.InvalidOrder,30005:a.InvalidOrder,30007:a.InvalidOrder,30008:a.InvalidOrder,30009:a.ExchangeError,30010:a.InsufficientFunds,30011:a.PermissionDenied,30012:a.PermissionDenied,30013:a.PermissionDenied,30014:a.InvalidOrder,30015:a.InvalidOrder,30016:a.ExchangeError,30017:a.InvalidOrder,30018:a.InvalidOrder,30019:a.InvalidOrder,30020:a.InvalidOrder,30021:a.InvalidOrder,30022:a.InvalidOrder,30023:a.InvalidOrder,30024:a.InvalidOrder,30025:a.InvalidOrder,30026:a.InvalidOrder,30027:a.InvalidOrder,30028:a.InvalidOrder,30029:a.InvalidOrder,30030:a.InvalidOrder,30031:a.InsufficientFunds,30032:a.InvalidOrder,30033:a.RateLimitExceeded,30034:a.OrderNotFound,30035:a.RateLimitExceeded,30036:a.ExchangeError,30037:a.InvalidOrder,30041:a.ExchangeError,30042:a.InsufficientFunds,30043:a.InvalidOrder,30044:a.InvalidOrder,30045:a.InvalidOrder,30049:a.InsufficientFunds,30050:a.ExchangeError,30051:a.ExchangeError,30052:a.ExchangeError,30054:a.ExchangeError,30057:a.ExchangeError,30063:a.ExchangeError,30067:a.InsufficientFunds,30068:a.ExchangeError,30074:a.InvalidOrder,30075:a.InvalidOrder,30078:a.ExchangeError,33004:a.AuthenticationError,34026:a.ExchangeError,34036:a.BadRequest,35015:a.BadRequest,340099:a.ExchangeError,3400045:a.ExchangeError,3100116:a.BadRequest,3100198:a.BadRequest,3200300:a.InsufficientFunds},broad:{"Not supported symbols":a.BadSymbol,"Request timeout":a.RequestTimeout,"unknown orderInfo":a.OrderNotFound,"invalid api_key":a.AuthenticationError,oc_diff:a.InsufficientFunds,new_oc:a.InsufficientFunds,"openapi sign params error!":a.AuthenticationError}},precisionMode:r.kb,options:{usePrivateInstrumentsInfo:!1,enableDemoTrading:!1,fetchMarkets:{types:["spot","linear","inverse","option"]},enableUnifiedMargin:void 0,enableUnifiedAccount:void 0,unifiedMarginStatus:void 0,createMarketBuyOrderRequiresPrice:!1,createUnifiedMarginAccount:!1,defaultType:"swap",defaultSubType:"linear",defaultSettle:"USDT",code:"BTC",recvWindow:5e3,timeDifference:0,adjustForTimeDifference:!1,loadAllOptions:!1,loadExpiredOptions:!1,brokerId:"CCXT",accountsByType:{spot:"SPOT",margin:"SPOT",future:"CONTRACT",swap:"CONTRACT",option:"OPTION",investment:"INVESTMENT",unified:"UNIFIED",funding:"FUND",fund:"FUND",contract:"CONTRACT"},accountsById:{SPOT:"spot",MARGIN:"spot",CONTRACT:"contract",OPTION:"option",INVESTMENT:"investment",UNIFIED:"unified",FUND:"fund"},networks:{ERC20:"ETH",TRC20:"TRX",BEP20:"BSC",SOL:"SOL",ACA:"ACA",ADA:"ADA",ALGO:"ALGO",APT:"APTOS",AR:"AR",ARBONE:"ARBI",AVAXC:"CAVAX",AVAXX:"XAVAX",ATOM:"ATOM",BCH:"BCH",BEP2:"BNB",CHZ:"CHZ",DCR:"DCR",DGB:"DGB",DOGE:"DOGE",DOT:"DOT",EGLD:"EGLD",EOS:"EOS",ETC:"ETC",ETHF:"ETHF",ETHW:"ETHW",FIL:"FIL",STEP:"FITFI",FLOW:"FLOW",FTM:"FTM",GLMR:"GLMR",HBAR:"HBAR",HNT:"HNT",ICP:"ICP",ICX:"ICX",KDA:"KDA",KLAY:"KLAY",KMA:"KMA",KSM:"KSM",LTC:"LTC",MATIC:"MATIC",MINA:"MINA",MOVR:"MOVR",NEAR:"NEAR",NEM:"NEM",OASYS:"OAS",OASIS:"ROSE",OMNI:"OMNI",ONE:"ONE",OPTIMISM:"OP",POKT:"POKT",QTUM:"QTUM",RVN:"RVN",SC:"SC",SCRT:"SCRT",STX:"STX",THETA:"THETA",TON:"TON",WAVES:"WAVES",WAX:"WAXP",XDC:"XDC",XEC:"XEC",XLM:"XLM",XRP:"XRP",XTZ:"XTZ",XYM:"XYM",ZEN:"ZEN",ZIL:"ZIL",ZKSYNC:"ZKSYNC"},networksById:{ETH:"ERC20",TRX:"TRC20",BSC:"BEP20",OMNI:"OMNI",SPL:"SOL"},defaultNetwork:"ERC20",defaultNetworks:{USDT:"TRC20"},intervals:{"5m":"5min","15m":"15min","30m":"30min","1h":"1h","4h":"4h","1d":"1d"},useMarkPriceForPositionCollateral:!1},features:{default:{sandbox:!0,createOrder:{marginMode:!1,triggerPrice:!0,triggerPriceType:{last:!0,mark:!0,index:!0},triggerDirection:!0,stopLossPrice:!0,takeProfitPrice:!0,attachedStopLossTakeProfit:{triggerPriceType:{last:!0,mark:!0,index:!0},price:!0},timeInForce:{IOC:!0,FOK:!0,PO:!0,GTD:!1},hedged:!0,selfTradePrevention:!0,trailing:!0,iceberg:!1,leverage:!1,marketBuyRequiresPrice:!1,marketBuyByCost:!0},createOrders:{max:10},fetchMyTrades:{marginMode:!1,limit:100,daysBack:730,untilDays:7,symbolRequired:!1},fetchOrder:{marginMode:!1,trigger:!0,trailing:!1,symbolRequired:!0},fetchOpenOrders:{marginMode:!1,limit:50,trigger:!0,trailing:!1,symbolRequired:!1},fetchOrders:void 0,fetchClosedOrders:{marginMode:!1,limit:50,daysBack:730,daysBackCanceled:1,untilDays:7,trigger:!0,trailing:!1,symbolRequired:!1},fetchOHLCV:{limit:1e3},editOrders:{max:10}},spot:{extends:"default",createOrder:{triggerPriceType:void 0,triggerDirection:!1,attachedStopLossTakeProfit:{triggerPriceType:void 0,price:!0},marketBuyRequiresPrice:!0}},swap:{linear:{extends:"default"},inverse:{extends:"default"}},future:{linear:{extends:"default"},inverse:{extends:"default"}}},fees:{trading:{feeSide:"get",tierBased:!0,percentage:!0,taker:75e-5,maker:1e-4},funding:{tierBased:!1,percentage:!1,withdraw:{},deposit:{}}}})}enableDemoTrading(e){if(this.isSandboxModeEnabled)throw new a.NotSupported(this.id+" demo trading does not support in sandbox environment");if(e)this.urls.apiBackupDemoTrading=this.urls.api,this.urls.api=this.urls.demotrading;else if("apiBackupDemoTrading"in this.urls){this.urls.api=this.urls.apiBackupDemoTrading;const e=this.omit(this.urls,"apiBackupDemoTrading");this.urls=e}this.options.enableDemoTrading=e}nonce(){return this.milliseconds()-this.options.timeDifference}addPaginationCursorToResult(e){const t=this.safeDict(e,"result",{}),i=this.safeListN(t,["list","rows","data","dataList"],[]),s=this.safeString2(t,"nextPageCursor","cursor"),r=i.length;if(void 0!==s&&r>0){const e=i[0];e.nextPageCursor=s,i[0]=e}return i}async isUnifiedEnabled(e={}){const t=this.safeBool(this.options,"enableUnifiedMargin"),i=this.safeBool(this.options,"enableUnifiedAccount");if(void 0===t||void 0===i){if(this.options.enableDemoTrading)return this.options.enableUnifiedMargin=!1,this.options.enableUnifiedAccount=!0,this.options.unifiedMarginStatus=6,[this.options.enableUnifiedMargin,this.options.enableUnifiedAccount];const t=[this.privateGetV5UserQueryApi(e),this.privateGetV5AccountInfo(e)],i=await Promise.all(t),s=i[0],r=i[1],a=this.safeDict(s,"result",{}),o=this.safeDict(r,"result",{});this.options.enableUnifiedMargin=1===this.safeInteger(a,"unified"),this.options.enableUnifiedAccount=1===this.safeInteger(a,"uta"),this.options.unifiedMarginStatus=this.safeInteger(o,"unifiedMarginStatus",6)}return[this.options.enableUnifiedMargin,this.options.enableUnifiedAccount]}async upgradeUnifiedTradeAccount(e={}){return await this.privatePostV5AccountUpgradeToUta(e)}createExpiredOptionMarket(e){let t,i;const s=e.split("-"),r=e.split("/");let a,o;if(e.indexOf("/")>-1){a=this.safeString(r,0),o=this.safeString(s,1);const e=this.safeString(r,1).split(":"),n=this.safeString(e,0);t=n,i=n}else a=this.safeString(s,0),o=this.convertMarketIdExpireDate(this.safeString(s,1)),e.endsWith("-USDT")?(t="USDT",i="USDT"):(t="USDC",i="USDC");const n=this.safeString(s,2),d=this.safeString(s,3),h=this.convertExpireDate(o),c=this.parse8601(h);let l,u;return"BTC"===a?(l=this.parseNumber("0.01"),u=this.parseNumber("5")):"ETH"===a?(l=this.parseNumber("0.1"),u=this.parseNumber("0.1")):"SOL"===a&&(l=this.parseNumber("1"),u=this.parseNumber("0.01")),{id:a+"-"+this.convertExpireDateToMarketIdDate(o)+"-"+n+"-"+d,symbol:a+"/"+t+":"+i+"-"+o+"-"+n+"-"+d,base:a,quote:t,settle:i,baseId:a,quoteId:t,settleId:i,active:!1,type:"option",linear:void 0,inverse:void 0,spot:!1,swap:!1,future:!1,option:!0,margin:!1,contract:!0,contractSize:this.parseNumber("1"),expiry:c,expiryDatetime:h,optionType:"C"===d?"call":"put",strike:this.parseNumber(n),precision:{amount:l,price:u},limits:{amount:{min:void 0,max:void 0},price:{min:void 0,max:void 0},cost:{min:void 0,max:void 0}},info:void 0}}safeMarket(e=void 0,t=void 0,i=void 0,s=void 0){return void 0!==e&&(e.indexOf("-C")>-1||e.indexOf("-P")>-1)&&!(e in this.markets_by_id)?this.createExpiredOptionMarket(e):super.safeMarket(e,t,i,s)}getBybitType(e,t,i={}){let s,r;return[s,i]=this.handleMarketTypeAndParams(e,t,i),[r,i]=this.handleSubTypeAndParams(e,t,i),"option"===s||"spot"===s?[s,i]:[r,i]}getAmount(e,t){const i=void 0===this.market(e).precision.amount,s=this.numberToString(t);return i||"0"===s?s:this.amountToPrecision(e,t)}getPrice(e,t){if(void 0===t)return t;return void 0===this.market(e).precision.price?t:this.priceToPrecision(e,t)}getCost(e,t){return void 0===this.market(e).precision.price?t:this.costToPrecision(e,t)}async fetchTime(e={}){const t=await this.publicGetV5MarketTime(e);return this.safeInteger(t,"time")}async fetchCurrencies(e={}){if(!this.checkRequiredCredentials(!1))return;if(this.options.enableDemoTrading)return;const t=await this.privateGetV5AssetCoinQueryInfo(e),i=this.safeDict(t,"result",{}),s=this.safeList(i,"rows",[]),r={};for(let e=0;e1)throw new a.InvalidOrder(this.id+" returned more than one order");return this.safeValue(r,0)}async fetchOrder(e,t=void 0,i={}){await this.loadMarkets();const[s,r]=await this.isUnifiedEnabled();if(!(s||r))return await this.fetchOrderClassic(e,t,i);let o=!1;if([o,i]=this.handleOptionAndParams(i,"fetchOrder","acknowledged"),!o)throw new a.ArgumentsRequired(this.id+' fetchOrder() can only access an order if it is in last 500 orders (of any status) for your account. Set params["acknowledged"] = true to hide this warning. Alternatively, we suggest to use fetchOpenOrder or fetchClosedOrder');const n=this.market(t);let d;[d,i]=this.getBybitType("fetchOrder",n,i);const h={symbol:n.id,orderId:e,category:d};let c;[c,i]=this.handleParamBool2(i,"trigger","stop",!1),c&&(h.orderFilter="StopOrder");const l=await this.privateGetV5OrderRealtime(this.extend(h,i)),u=this.safeDict(l,"result",{}),f=this.safeList(u,"list",[]);if(0===f.length){const t=c?"":' If you are trying to fetch SL/TP conditional order, you might try setting params["trigger"] = true';throw new a.OrderNotFound("Order "+e.toString()+" was not found."+t)}const p=this.safeDict(f,0,{});return this.parseOrder(p,n)}async fetchOrders(e=void 0,t=void 0,i=void 0,s={}){const r=await this.isUnifiedEnabled();if(this.safeBool(r,1))throw new a.NotSupported(this.id+" fetchOrders() is not supported after the 5/02 update for UTA accounts, please use fetchOpenOrders, fetchClosedOrders or fetchCanceledOrders");return await this.fetchOrdersClassic(e,t,i,s)}async fetchOrdersClassic(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();let r=!1;if([r,s]=this.handleOptionAndParams(s,"fetchOrders","paginate"),r)return await this.fetchPaginatedCallCursor("fetchOrders",e,t,i,s,"nextPageCursor","cursor",void 0,50);const o={};let n,d;if(void 0!==e&&(n=this.market(e),o.symbol=n.id),[d,s]=this.getBybitType("fetchOrders",n,s),"spot"===d)throw new a.NotSupported(this.id+" fetchOrders() is not supported for spot markets");o.category=d;const h=this.safeBoolN(s,["trigger","stop"],!1);s=this.omit(s,["trigger","stop"]),h&&(o.orderFilter="StopOrder"),void 0!==i&&(o.limit=i),void 0!==t&&(o.startTime=t);const c=this.safeInteger(s,"until"),l=this.safeInteger(s,"endTime",c);s=this.omit(s,["endTime","until"]),void 0!==l&&(o.endTime=l);const u=await this.privateGetV5OrderHistory(this.extend(o,s)),f=this.addPaginationCursorToResult(u);return this.parseOrders(f,n,t,i)}async fetchClosedOrder(e,t=void 0,i={}){await this.loadMarkets();const s={orderId:e},r=await this.fetchClosedOrders(t,void 0,void 0,this.extend(s,i)),o=r.length;if(0===o){const t=this.safeBoolN(i,["trigger","stop"],!1)?"":' If you are trying to fetch SL/TP conditional order, you might try setting params["trigger"] = true';throw new a.OrderNotFound("Order "+e.toString()+" was not found."+t)}if(o>1)throw new a.InvalidOrder(this.id+" returned more than one order");return this.safeValue(r,0)}async fetchOpenOrder(e,t=void 0,i={}){await this.loadMarkets();const s={orderId:e},r=await this.fetchOpenOrders(t,void 0,void 0,this.extend(s,i)),o=r.length;if(0===o){const t=this.safeBoolN(i,["trigger","stop"],!1)?"":' If you are trying to fetch SL/TP conditional order, you might try setting params["trigger"] = true';throw new a.OrderNotFound("Order "+e.toString()+" was not found."+t)}if(o>1)throw new a.InvalidOrder(this.id+" returned more than one order");return this.safeValue(r,0)}async fetchCanceledAndClosedOrders(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();let r=!1;if([r,s]=this.handleOptionAndParams(s,"fetchCanceledAndClosedOrders","paginate"),r)return await this.fetchPaginatedCallCursor("fetchCanceledAndClosedOrders",e,t,i,s,"nextPageCursor","cursor",void 0,50);const a={};let o,n;void 0!==e&&(o=this.market(e),a.symbol=o.id),[n,s]=this.getBybitType("fetchCanceledAndClosedOrders",o,s),a.category=n;const d=this.safeBoolN(s,["trigger","stop"],!1);s=this.omit(s,["trigger","stop"]),d&&(a.orderFilter="StopOrder"),void 0!==i&&(a.limit=i),void 0!==t&&(a.startTime=t);const h=this.safeInteger(s,"until"),c=this.safeInteger(s,"endTime",h);s=this.omit(s,["endTime","until"]),void 0!==c&&(a.endTime=c);const l=await this.privateGetV5OrderHistory(this.extend(a,s)),u=this.addPaginationCursorToResult(l);return this.parseOrders(u,o,t,i)}async fetchClosedOrders(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();return await this.fetchCanceledAndClosedOrders(e,t,i,this.extend({orderStatus:"Filled"},s))}async fetchCanceledOrders(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();return await this.fetchCanceledAndClosedOrders(e,t,i,this.extend({orderStatus:"Cancelled"},s))}async fetchOpenOrders(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();let r=!1;if([r,s]=this.handleOptionAndParams(s,"fetchOpenOrders","paginate"),r)return await this.fetchPaginatedCallCursor("fetchOpenOrders",e,t,i,s,"nextPageCursor","cursor",void 0,50);const a={};let o,n;if(void 0!==e&&(o=this.market(e),a.symbol=o.id),[n,s]=this.getBybitType("fetchOpenOrders",o,s),"linear"===n||"inverse"===n){const t=this.safeString(s,"baseCoin");if(void 0===e&&void 0===t){const e=this.safeString(this.options,"defaultSettle","USDT"),t=this.safeString(s,"settleCoin",e);a.settleCoin=t}}a.category=n;const d=this.safeBool2(s,"stop","trigger",!1);s=this.omit(s,["stop","trigger"]),d&&(a.orderFilter="StopOrder"),void 0!==i&&(a.limit=i);const h=await this.privateGetV5OrderRealtime(this.extend(a,s)),c=this.addPaginationCursorToResult(h);return this.parseOrders(c,o,t,i)}async fetchOrderTrades(e,t=void 0,i=void 0,s=void 0,r={}){const a={},o=this.safeString2(r,"clientOrderId","orderLinkId");return void 0!==o?a.orderLinkId=o:a.orderId=e,r=this.omit(r,["clientOrderId","orderLinkId"]),await this.fetchMyTrades(t,i,s,this.extend(a,r))}async fetchMyTrades(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();let r=!1;if([r,s]=this.handleOptionAndParams(s,"fetchMyTrades","paginate"),r)return await this.fetchPaginatedCallCursor("fetchMyTrades",e,t,i,s,"nextPageCursor","cursor",void 0,100);let a,o,n={execType:"Trade"};void 0!==e&&(a=this.market(e),n.symbol=a.id),[o,s]=this.getBybitType("fetchMyTrades",a,s),n.category=o,void 0!==i&&(n.limit=i),void 0!==t&&(n.startTime=t),[n,s]=this.handleUntilOption("endTime",n,s);const d=await this.privateGetV5ExecutionList(this.extend(n,s)),h=this.addPaginationCursorToResult(d);return this.parseTrades(h,a,t,i)}parseDepositAddress(e,t=void 0){const i=this.safeString(e,"addressDeposit"),s=this.safeString(e,"tagDeposit"),r=this.safeString(t,"code");return this.checkAddress(i),{info:e,currency:r,network:this.networkIdToCode(this.safeString(e,"chain"),r),address:i,tag:s}}async fetchDepositAddressesByNetwork(e,t={}){await this.loadMarkets();let i=this.currency(e);const s={coin:i.id};let r;[r,t]=this.handleNetworkCodeAndParams(t),void 0!==r&&(s.chainType=this.networkCodeToId(r,e));const a=await this.privateGetV5AssetDepositQueryAddress(this.extend(s,t)),o=this.safeDict(a,"result",{}),n=this.safeList(o,"chains",[]),d=this.safeString(o,"coin");i=this.currency(d);const h=this.parseDepositAddresses(n,[i.code],!1,{currency:i.code});return this.indexBy(h,"network")}async fetchDepositAddress(e,t={}){await this.loadMarkets();const i=this.currency(e),[s,r]=this.handleNetworkCodeAndParams(t),a=await this.fetchDepositAddressesByNetwork(e,r);return a[this.selectNetworkCodeFromUnifiedNetworks(i.code,s,a)]}async fetchDeposits(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();let r=!1;if([r,s]=this.handleOptionAndParams(s,"fetchDeposits","paginate"),r)return await this.fetchPaginatedCallCursor("fetchDeposits",e,t,i,s,"nextPageCursor","cursor",void 0,50);let a,o={};void 0!==e&&(a=this.currency(e),o.coin=a.id),void 0!==t&&(o.startTime=t),void 0!==i&&(o.limit=i),[o,s]=this.handleUntilOption("endTime",o,s);const n=await this.privateGetV5AssetDepositQueryRecord(this.extend(o,s)),d=this.addPaginationCursorToResult(n);return this.parseTransactions(d,a,t,i)}async fetchWithdrawals(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();let r=!1;if([r,s]=this.handleOptionAndParams(s,"fetchWithdrawals","paginate"),r)return await this.fetchPaginatedCallCursor("fetchWithdrawals",e,t,i,s,"nextPageCursor","cursor",void 0,50);let a,o={};void 0!==e&&(a=this.currency(e),o.coin=a.id),void 0!==t&&(o.startTime=t),void 0!==i&&(o.limit=i),[o,s]=this.handleUntilOption("endTime",o,s);const n=await this.privateGetV5AssetWithdrawQueryRecord(this.extend(o,s)),d=this.addPaginationCursorToResult(n);return this.parseTransactions(d,a,t,i)}parseTransactionStatus(e){return this.safeString({0:"unknown",1:"pending",2:"processing",3:"ok",4:"fail",SecurityCheck:"pending",Pending:"pending",success:"ok",CancelByUser:"canceled",Reject:"rejected",Fail:"failed",BlockchainConfirmed:"ok"},e,e)}parseTransaction(e,t=void 0){const i=this.safeString(e,"coin"),s=this.safeCurrencyCode(i,t),r=this.safeInteger2(e,"createTime","successAt"),a=this.safeInteger(e,"updateTime"),o=this.parseTransactionStatus(this.safeString(e,"status")),n=this.safeNumber2(e,"depositFee","withdrawFee"),d="depositFee"in e?"deposit":"withdrawal";let h;void 0!==n&&(h={cost:n,currency:s});const c=this.safeString(e,"toAddress");return{info:e,id:this.safeString2(e,"id","withdrawId"),txid:this.safeString(e,"txID"),timestamp:r,datetime:this.iso8601(r),network:this.networkIdToCode(this.safeString(e,"chain")),address:void 0,addressTo:c,addressFrom:void 0,tag:this.safeString(e,"tag"),tagTo:void 0,tagFrom:void 0,type:d,amount:this.safeNumber(e,"amount"),currency:s,status:o,updated:a,fee:h,internal:void 0,comment:void 0}}async fetchLedger(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();let r=!1;if([r,s]=this.handleOptionAndParams(s,"fetchLedger","paginate"),r)return await this.fetchPaginatedCallCursor("fetchLedger",e,t,i,s,"nextPageCursor","cursor",void 0,50);const a={},o=await this.isUnifiedEnabled();let n,d,h,c="coin";if(o[1]?(c="currency",void 0!==t&&(a.startTime=t)):void 0!==t&&(a.start_date=this.yyyymmdd(t)),void 0!==e&&(n=this.currency(e),a[c]=n.id),void 0!==i&&(a.limit=i),[d,s]=this.handleSubTypeAndParams("fetchLedger",void 0,s),o[1]){const e=this.safeInteger(this.options,"unifiedMarginStatus",5);h="inverse"===d&&e<5?await this.privateGetV5AccountContractTransactionLog(this.extend(a,s)):await this.privateGetV5AccountTransactionLog(this.extend(a,s))}else h=await this.privateGetV5AccountContractTransactionLog(this.extend(a,s));const l=this.addPaginationCursorToResult(h);return this.parseLedger(l,n,t,i)}parseLedgerEntry(e,t=void 0){const i=this.safeString2(e,"coin","currency"),s=this.safeCurrencyCode(i,t);t=this.safeCurrency(i,t);const r=this.safeString2(e,"amount","change"),a=this.safeString2(e,"wallet_balance","cashBalance"),n=o.Y.stringLt(r,"0")?"out":"in";let d,h,c;if(void 0!==a&&void 0!==r){const e="out"===n?r:o.Y.stringNeg(r);d=this.parseToNumeric(o.Y.stringAdd(a,e)),h=this.parseToNumeric(a),c=this.parseToNumeric(o.Y.stringAbs(r))}let l=this.parse8601(this.safeString(e,"exec_time"));return void 0===l&&(l=this.safeInteger(e,"transactionTime")),this.safeLedgerEntry({info:e,id:this.safeString(e,"id"),direction:n,account:this.safeString(e,"wallet_id"),referenceId:this.safeString(e,"tx_id"),referenceAccount:void 0,type:this.parseLedgerEntryType(this.safeString(e,"type")),currency:s,amount:c,timestamp:l,datetime:this.iso8601(l),before:d,after:h,status:"ok",fee:{currency:s,cost:this.safeNumber(e,"fee")}},t)}parseLedgerEntryType(e){return this.safeString({Deposit:"transaction",Withdraw:"transaction",RealisedPNL:"trade",Commission:"fee",Refund:"cashback",Prize:"prize",ExchangeOrderWithdraw:"transaction",ExchangeOrderDeposit:"transaction",TRANSFER_IN:"transaction",TRANSFER_OUT:"transaction",TRADE:"trade",SETTLEMENT:"trade",DELIVERY:"trade",LIQUIDATION:"trade",BONUS:"Prize",FEE_REFUND:"cashback",INTEREST:"transaction",CURRENCY_BUY:"trade",CURRENCY_SELL:"trade"},e,e)}async withdraw(e,t,i,s=void 0,r={}){let a;[s,r]=this.handleWithdrawTagAndParams(s,r);const o=(await this.isUnifiedEnabled())[1];[a,r]=this.handleOptionAndParams(r,"withdraw","accountType","SPOT"),o&&(a="UTA"),await this.loadMarkets(),this.checkAddress(i);const n=this.currency(e),d={coin:n.id,amount:this.numberToString(t),address:i,timestamp:this.milliseconds(),accountType:a};void 0!==s&&(d.tag=s);const[h,c]=this.handleNetworkCodeAndParams(r),l=this.networkCodeToId(h);void 0!==l&&(d.chain=l.toUpperCase());const u=await this.privatePostV5AssetWithdrawCreate(this.extend(d,c)),f=this.safeDict(u,"result",{});return this.parseTransaction(f,n)}async fetchPosition(e,t={}){if(void 0===e)throw new a.ArgumentsRequired(this.id+" fetchPosition() requires a symbol argument");await this.loadMarkets();const i=this.market(e),s={symbol:i.id};let r,o;[o,t]=this.getBybitType("fetchPosition",i,t),s.category=o,r=await this.privateGetV5PositionList(this.extend(s,t));const n=this.safeDict(r,"result",{}),d=this.safeList2(n,"list","dataList",[]),h=this.safeInteger(r,"time"),c=this.safeDict(d,0,{}),l=this.parsePosition(c,i);return l.timestamp=h,l.datetime=this.iso8601(h),l}async fetchPositions(e=void 0,t={}){await this.loadMarkets();let i,s=!1;if([s,t]=this.handleOptionAndParams(t,"fetchPositions","paginate"),s)return await this.fetchPaginatedCallCursor("fetchPositions",e,void 0,void 0,t,"nextPageCursor","cursor",void 0,200);if(void 0!==e&&Array.isArray(e)){const t=e.length;if(t>1)throw new a.ArgumentsRequired(this.id+" fetchPositions() does not accept an array with more than one symbol");1===t&&(i=e[0]),e=this.marketSymbols(e)}else void 0!==e&&(i=e,e=[this.symbol(i)]);const r={};let o,n;if(void 0!==i&&(o=this.market(i),i=o.symbol,r.symbol=o.id),[n,t]=this.getBybitType("fetchPositions",o,t),"linear"===n||"inverse"===n){const e=this.safeString(t,"baseCoin");if("linear"===n){if(void 0===i&&void 0===e){const e=this.safeString(this.options,"defaultSettle","USDT"),i=this.safeString(t,"settleCoin",e);r.settleCoin=i}}else void 0===i&&void 0===e&&(r.category="inverse")}void 0===this.safeInteger(t,"limit")&&(r.limit=200),t=this.omit(t,["type"]),r.category=n;const d=await this.privateGetV5PositionList(this.extend(r,t)),h=this.addPaginationCursorToResult(d),c=[];for(let e=0;e0&&(r=this.market(e[0])));const n=this.safeInteger(s,"until");[a,s]=this.handleSubTypeAndParams("fetchPositionsHistory",r,s,"linear"),s=this.omit(s,"until");const d={category:a};void 0!==e&&1===o&&(d.symbol=r.id),void 0!==t&&(d.startTime=t),void 0!==i&&(d.limit=i),void 0!==n&&(d.endTime=n);const h=await this.privateGetV5PositionClosedPnl(this.extend(d,s)),c=this.safeDict(h,"result"),l=this.safeList(c,"list"),u=this.parsePositions(l,e,s);return this.filterBySinceLimit(u,t,i)}async fetchConvertCurrencies(e={}){let t;await this.loadMarkets();const[i,s]=await this.isUnifiedEnabled(),r=i||s?"eb_convert_uta":"eb_convert_spot";[t,e]=this.handleOptionAndParams(e,"fetchConvertCurrencies","accountType",r);const a={accountType:t},o=await this.privateGetV5AssetExchangeQueryCoinList(this.extend(a,e)),n={},d=this.safeDict(o,"result",{}),h=this.safeList(d,"coins",[]);for(let e=0;e=0,t=o.indexOf("unified/v3")>=0,h=o.indexOf("contract/v3")>=0,c=o.indexOf("v5")>=0,l=this.nonce().toString();if(e){a=Object.keys(s).length?this.json(s):"{}";const e=l+this.apiKey+a,t=this.hmac(this.encode(e),this.encode(this.secret),n.s,"hex");r={"Content-Type":"application/json","X-BAPI-API-KEY":this.apiKey,"X-BAPI-TIMESTAMP":l,"X-BAPI-SIGN":t}}else if(t||h||c){r={"Content-Type":"application/json","X-BAPI-API-KEY":this.apiKey,"X-BAPI-TIMESTAMP":l,"X-BAPI-RECV-WINDOW":this.options.recvWindow.toString()},(t||h)&&(r["X-BAPI-SIGN-TYPE"]="2");const e=this.extend({},s),c=this.rawencode(e),u=l.toString()+this.apiKey+this.options.recvWindow.toString();let f,p;"POST"===i?f=u+(a=this.json(e)):(f=u+c,o+="?"+c),p=this.secret.indexOf("PRIVATE KEY")>-1?(0,d.n)(f,this.secret,n.s):this.hmac(this.encode(f),this.encode(this.secret),n.s),r["X-BAPI-SIGN"]=p}else{const e=this.extend(s,{api_key:this.apiKey,recv_window:this.options.recvWindow,timestamp:l}),t=this.keysort(e),h=this.rawencode(t,!0);let c;if(c=this.secret.indexOf("PRIVATE KEY")>-1?(0,d.n)(h,this.secret,n.s):this.hmac(this.encode(h),this.encode(this.secret),n.s),"POST"===i){const t=o.indexOf("spot")>=0,i=this.extend(e,{sign:c});t?(a=this.urlencode(i),r={"Content-Type":"application/x-www-form-urlencoded"}):(a=this.json(i),r={"Content-Type":"application/json"})}else o+="?"+this.rawencode(t,!0),o+="&sign="+c}}if("POST"===i){const e=this.safeString(this.options,"brokerId");void 0!==e&&(r.Referer=e)}return{url:o,method:i,body:a,headers:r}}handleErrors(e,t,i,s,r,o,n,d,h){if(!n)return;const c=this.safeString2(n,"ret_code","retCode");if("0"!==c){if("30084"===c)return;let e;throw e="10005"===c&&i.indexOf("order")<0?this.id+' private api uses /user/v3/private/query-api to check if you have a unified account. The API key of user id must own one of permissions: "Account Transfer", "Subaccount Transfer", "Withdrawal" '+o:this.id+" "+o,o.indexOf("Withdraw address chain or destination tag are not equal")>-1&&(e+="; You might also need to ensure the address is whitelisted"),this.throwBroadlyMatchedException(this.exceptions.broad,o,e),this.throwExactlyMatchedException(this.exceptions.exact,c,e),new a.ExchangeError(e)}}}},8846:(e,t,i)=>{i.d(t,{A:()=>d});var s=i(5465),r=i(2079),a=i(5147),o=i(1579),n=i(4852);class d extends s.A{describe(){return this.deepExtend(super.describe(),{id:"cex",name:"CEX.IO",countries:["GB","EU","CY","RU"],rateLimit:300,pro:!0,has:{CORS:void 0,spot:!0,margin:!1,swap:!1,future:!1,option:!1,addMargin:!1,borrowCrossMargin:!1,borrowIsolatedMargin:!1,borrowMargin:!1,cancelAllOrders:!0,cancelOrder:!0,closeAllPositions:!1,closePosition:!1,createOrder:!0,createOrderWithTakeProfitAndStopLoss:!1,createOrderWithTakeProfitAndStopLossWs:!1,createPostOnlyOrder:!1,createReduceOnlyOrder:!1,createStopOrder:!0,createTriggerOrder:!0,fetchAccounts:!0,fetchBalance:!0,fetchBorrowInterest:!1,fetchBorrowRate:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchBorrowRates:!1,fetchBorrowRatesPerSymbol:!1,fetchClosedOrder:!0,fetchClosedOrders:!0,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!0,fetchDepositAddress:!0,fetchDepositsWithdrawals:!0,fetchFundingHistory:!1,fetchFundingInterval:!1,fetchFundingIntervals:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchGreeks:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchIsolatedPositions:!1,fetchLedger:!0,fetchLeverage:!1,fetchLeverages:!1,fetchLeverageTiers:!1,fetchLiquidations:!1,fetchLongShortRatio:!1,fetchLongShortRatioHistory:!1,fetchMarginAdjustmentHistory:!1,fetchMarginMode:!1,fetchMarginModes:!1,fetchMarketLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMarkPrices:!1,fetchMyLiquidations:!1,fetchMySettlementHistory:!1,fetchOHLCV:!0,fetchOpenInterest:!1,fetchOpenInterestHistory:!1,fetchOpenInterests:!1,fetchOpenOrder:!0,fetchOpenOrders:!0,fetchOption:!1,fetchOptionChain:!1,fetchOrderBook:!0,fetchPosition:!1,fetchPositionHistory:!1,fetchPositionMode:!1,fetchPositions:!1,fetchPositionsForSymbol:!1,fetchPositionsHistory:!1,fetchPositionsRisk:!1,fetchPremiumIndexOHLCV:!1,fetchSettlementHistory:!1,fetchTicker:!0,fetchTickers:!0,fetchTime:!0,fetchTrades:!0,fetchTradingFees:!0,fetchVolatilityHistory:!1,reduceMargin:!1,repayCrossMargin:!1,repayIsolatedMargin:!1,repayMargin:!1,setLeverage:!1,setMargin:!1,setMarginMode:!1,setPositionMode:!1,transfer:!0},urls:{logo:"https://user-images.githubusercontent.com/1294454/27766442-8ddc33b0-5ed8-11e7-8b98-f786aef0f3c9.jpg",api:{public:"https://trade.cex.io/api/spot/rest-public",private:"https://trade.cex.io/api/spot/rest"},www:"https://cex.io",doc:"https://trade.cex.io/docs/",fees:["https://cex.io/fee-schedule","https://cex.io/limits-commissions"],referral:"https://cex.io/r/0/up105393824/0/"},api:{public:{get:{},post:{get_server_time:1,get_pairs_info:1,get_currencies_info:1,get_processing_info:10,get_ticker:1,get_trade_history:1,get_order_book:1,get_candles:1}},private:{get:{},post:{get_my_current_fee:5,get_fee_strategy:1,get_my_volume:5,do_create_account:1,get_my_account_status_v3:5,get_my_wallet_balance:5,get_my_orders:5,do_my_new_order:1,do_cancel_my_order:1,do_cancel_all_orders:5,get_order_book:1,get_candles:1,get_trade_history:1,get_my_transaction_history:1,get_my_funding_history:5,do_my_internal_transfer:1,get_processing_info:10,get_deposit_address:5,do_deposit_funds_from_wallet:1,do_withdrawal_funds_to_wallet:1}}},features:{spot:{sandbox:!1,createOrder:{marginMode:!1,triggerPrice:!0,triggerPriceType:void 0,triggerDirection:!1,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!0,FOK:!0,PO:!1,GTD:!0},hedged:!1,leverage:!1,marketBuyRequiresPrice:!1,marketBuyByCost:!0,selfTradePrevention:!1,trailing:!1,iceberg:!1},createOrders:void 0,fetchMyTrades:void 0,fetchOrder:void 0,fetchOpenOrders:{marginMode:!1,limit:1e3,trigger:!1,trailing:!1,symbolRequired:!1},fetchOrders:void 0,fetchClosedOrders:{marginMode:!1,limit:1e3,daysBack:1e5,daysBackCanceled:1,untilDays:1e5,trigger:!1,trailing:!1,symbolRequired:!1},fetchOHLCV:{limit:1e3}},swap:{linear:void 0,inverse:void 0},future:{linear:void 0,inverse:void 0}},precisionMode:o.kb,exceptions:{exact:{},broad:{"You have negative balance on following accounts":r.InsufficientFunds,"Mandatory parameter side should be one of BUY,SELL":r.BadRequest,"API orders from Main account are not allowed":r.BadRequest,"check failed":r.BadRequest,"Insufficient funds":r.InsufficientFunds,"Get deposit address for main account is not allowed":r.PermissionDenied,"Market Trigger orders are not allowed":r.BadRequest,"key not passed or incorrect":r.AuthenticationError}},timeframes:{"1m":"1m","5m":"5m","15m":"15m","30m":"30m","1h":"1h","2h":"2h","4h":"4h","1d":"1d"},options:{networks:{BTC:"bitcoin",ERC20:"ERC20",BSC20:"binancesmartchain",DOGE:"dogecoin",ALGO:"algorand",XLM:"stellar",ATOM:"cosmos",LTC:"litecoin",XRP:"ripple",FTM:"fantom",MINA:"mina",THETA:"theta",XTZ:"tezos",TIA:"celestia",CRONOS:"cronos",MATIC:"polygon",TON:"ton",TRC20:"tron",SOLANA:"solana",SGB:"songbird",DYDX:"dydx",DASH:"dash",ZIL:"zilliqa",EOS:"eos",AVALANCHEC:"avalanche",ETHPOW:"ethereumpow",NEAR:"near",ARB:"arbitrum",DOT:"polkadot",OPT:"optimism",INJ:"injective",ADA:"cardano",ONT:"ontology",ICP:"icp",KAVA:"kava",KSM:"kusama",SEI:"sei",NEO:"neo",NEO3:"neo3",XDC:"xdc"}}})}async fetchCurrencies(e={}){const t=[];t.push(this.publicPostGetCurrenciesInfo(e)),t.push(this.publicPostGetProcessingInfo(e));const i=await Promise.all(t),s=this.safeList(i[0],"data",[]),r=this.safeDict(i[1],"data",{}),a=this.indexBy(s,"currency"),o=this.deepExtend(a,r);return this.parseCurrencies(this.toArray(o))}parseCurrency(e){const t=this.safeString(e,"currency"),i=this.safeCurrencyCode(t),s=this.safeBool(e,"fiat")?"fiat":"crypto",r=this.parseNumber(this.parsePrecision(this.safeString(e,"precision"))),a={},o=this.safeDict(e,"blockchains",{}),n=Object.keys(o);for(let e=0;e=0){const e=this.safeDict(n,"data",{}),t=this.safeString(e,"rejectReason");if(void 0!==t)throw this.throwBroadlyMatchedException(this.exceptions.broad,t,t),new r.ExchangeError(this.id+" createOrder() "+t)}}}},7504:(e,t,i)=>{i.d(t,{A:()=>h});var s=i(5661),r=i(2079),a=i(5147),o=i(1579),n=i(4852),d=i(5354);class h extends s.A{describe(){return this.deepExtend(super.describe(),{id:"coinbase",name:"Coinbase Advanced",countries:["US"],pro:!0,certified:!1,rateLimit:34,version:"v2",userAgent:this.userAgents.chrome,headers:{"CB-VERSION":"2018-05-30"},has:{CORS:!0,spot:!0,margin:!1,swap:!1,future:!1,option:!1,addMargin:!1,borrowCrossMargin:!1,borrowIsolatedMargin:!1,borrowMargin:!1,cancelOrder:!0,cancelOrders:!0,closeAllPositions:!1,closePosition:!0,createConvertTrade:!0,createDepositAddress:!0,createLimitBuyOrder:!0,createLimitSellOrder:!0,createMarketBuyOrder:!0,createMarketBuyOrderWithCost:!0,createMarketOrderWithCost:!1,createMarketSellOrder:!0,createMarketSellOrderWithCost:!1,createOrder:!0,createOrderWithTakeProfitAndStopLoss:!1,createOrderWithTakeProfitAndStopLossWs:!1,createPostOnlyOrder:!0,createReduceOnlyOrder:!1,createStopLimitOrder:!0,createStopMarketOrder:!1,createStopOrder:!0,deposit:!0,editOrder:!0,fetchAccounts:!0,fetchBalance:!0,fetchBidsAsks:!0,fetchBorrowInterest:!1,fetchBorrowRate:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchBorrowRates:!1,fetchBorrowRatesPerSymbol:!1,fetchCanceledOrders:!0,fetchClosedOrders:!0,fetchConvertQuote:!0,fetchConvertTrade:!0,fetchConvertTradeHistory:!1,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!0,fetchDeposit:!0,fetchDepositAddress:"emulated",fetchDepositAddresses:!1,fetchDepositAddressesByNetwork:!0,fetchDepositMethodId:!0,fetchDepositMethodIds:!0,fetchDeposits:!0,fetchDepositsWithdrawals:!0,fetchFundingHistory:!1,fetchFundingInterval:!1,fetchFundingIntervals:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchGreeks:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchIsolatedPositions:!1,fetchL2OrderBook:!1,fetchLedger:!0,fetchLeverage:!1,fetchLeverages:!1,fetchLeverageTiers:!1,fetchLiquidations:!1,fetchLongShortRatio:!1,fetchLongShortRatioHistory:!1,fetchMarginAdjustmentHistory:!1,fetchMarginMode:!1,fetchMarginModes:!1,fetchMarketLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMarkPrices:!1,fetchMyBuys:!0,fetchMyLiquidations:!1,fetchMySells:!0,fetchMySettlementHistory:!1,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenInterest:!1,fetchOpenInterestHistory:!1,fetchOpenInterests:!1,fetchOpenOrders:!0,fetchOption:!1,fetchOptionChain:!1,fetchOrder:!0,fetchOrderBook:!0,fetchOrders:!0,fetchPosition:!0,fetchPositionHistory:!1,fetchPositionMode:!1,fetchPositions:!0,fetchPositionsForSymbol:!1,fetchPositionsHistory:!1,fetchPositionsRisk:!1,fetchPremiumIndexOHLCV:!1,fetchSettlementHistory:!1,fetchTicker:!0,fetchTickers:!0,fetchTime:!0,fetchTrades:!0,fetchTradingFee:"emulated",fetchTradingFees:!0,fetchVolatilityHistory:!1,fetchWithdrawals:!0,reduceMargin:!1,repayCrossMargin:!1,repayIsolatedMargin:!1,repayMargin:!1,setLeverage:!1,setMargin:!1,setMarginMode:!1,setPositionMode:!1,withdraw:!0},urls:{logo:"https://user-images.githubusercontent.com/1294454/40811661-b6eceae2-653a-11e8-829e-10bfadb078cf.jpg",api:{rest:"https://api.coinbase.com"},www:"https://www.coinbase.com",doc:["https://developers.coinbase.com/api/v2","https://docs.cloud.coinbase.com/advanced-trade/docs/welcome"],fees:["https://support.coinbase.com/customer/portal/articles/2109597-buy-sell-bank-transfer-fees","https://www.coinbase.com/advanced-fees"],referral:"https://www.coinbase.com/join/58cbe25a355148797479dbd2"},requiredCredentials:{apiKey:!0,secret:!0},api:{v2:{public:{get:{currencies:10.6,"currencies/crypto":10.6,time:10.6,"exchange-rates":10.6,"users/{user_id}":10.6,"prices/{symbol}/buy":10.6,"prices/{symbol}/sell":10.6,"prices/{symbol}/spot":10.6}},private:{get:{accounts:10.6,"accounts/{account_id}":10.6,"accounts/{account_id}/addresses":10.6,"accounts/{account_id}/addresses/{address_id}":10.6,"accounts/{account_id}/addresses/{address_id}/transactions":10.6,"accounts/{account_id}/transactions":10.6,"accounts/{account_id}/transactions/{transaction_id}":10.6,"accounts/{account_id}/buys":10.6,"accounts/{account_id}/buys/{buy_id}":10.6,"accounts/{account_id}/sells":10.6,"accounts/{account_id}/sells/{sell_id}":10.6,"accounts/{account_id}/deposits":10.6,"accounts/{account_id}/deposits/{deposit_id}":10.6,"accounts/{account_id}/withdrawals":10.6,"accounts/{account_id}/withdrawals/{withdrawal_id}":10.6,"payment-methods":10.6,"payment-methods/{payment_method_id}":10.6,user:10.6,"user/auth":10.6},post:{accounts:10.6,"accounts/{account_id}/primary":10.6,"accounts/{account_id}/addresses":10.6,"accounts/{account_id}/transactions":10.6,"accounts/{account_id}/transactions/{transaction_id}/complete":10.6,"accounts/{account_id}/transactions/{transaction_id}/resend":10.6,"accounts/{account_id}/buys":10.6,"accounts/{account_id}/buys/{buy_id}/commit":10.6,"accounts/{account_id}/sells":10.6,"accounts/{account_id}/sells/{sell_id}/commit":10.6,"accounts/{account_id}/deposits":10.6,"accounts/{account_id}/deposits/{deposit_id}/commit":10.6,"accounts/{account_id}/withdrawals":10.6,"accounts/{account_id}/withdrawals/{withdrawal_id}/commit":10.6},put:{"accounts/{account_id}":10.6,user:10.6},delete:{"accounts/{id}":10.6,"accounts/{account_id}/transactions/{transaction_id}":10.6}}},v3:{public:{get:{"brokerage/time":3,"brokerage/market/product_book":3,"brokerage/market/products":3,"brokerage/market/products/{product_id}":3,"brokerage/market/products/{product_id}/candles":3,"brokerage/market/products/{product_id}/ticker":3}},private:{get:{"brokerage/accounts":1,"brokerage/accounts/{account_uuid}":1,"brokerage/orders/historical/batch":1,"brokerage/orders/historical/fills":1,"brokerage/orders/historical/{order_id}":1,"brokerage/products":3,"brokerage/products/{product_id}":3,"brokerage/products/{product_id}/candles":3,"brokerage/products/{product_id}/ticker":3,"brokerage/best_bid_ask":3,"brokerage/product_book":3,"brokerage/transaction_summary":3,"brokerage/portfolios":1,"brokerage/portfolios/{portfolio_uuid}":1,"brokerage/convert/trade/{trade_id}":1,"brokerage/cfm/balance_summary":1,"brokerage/cfm/positions":1,"brokerage/cfm/positions/{product_id}":1,"brokerage/cfm/sweeps":1,"brokerage/intx/portfolio/{portfolio_uuid}":1,"brokerage/intx/positions/{portfolio_uuid}":1,"brokerage/intx/positions/{portfolio_uuid}/{symbol}":1,"brokerage/payment_methods":1,"brokerage/payment_methods/{payment_method_id}":1},post:{"brokerage/orders":1,"brokerage/orders/batch_cancel":1,"brokerage/orders/edit":1,"brokerage/orders/edit_preview":1,"brokerage/orders/preview":1,"brokerage/portfolios":1,"brokerage/portfolios/move_funds":1,"brokerage/convert/quote":1,"brokerage/convert/trade/{trade_id}":1,"brokerage/cfm/sweeps/schedule":1,"brokerage/intx/allocate":1,"brokerage/orders/close_position":1},put:{"brokerage/portfolios/{portfolio_uuid}":1},delete:{"brokerage/portfolios/{portfolio_uuid}":1,"brokerage/cfm/sweeps":1}}}},fees:{trading:{taker:this.parseNumber("0.012"),maker:this.parseNumber("0.006"),tierBased:!0,percentage:!0,tiers:{taker:[[this.parseNumber("0"),this.parseNumber("0.006")],[this.parseNumber("10000"),this.parseNumber("0.004")],[this.parseNumber("50000"),this.parseNumber("0.0025")],[this.parseNumber("100000"),this.parseNumber("0.002")],[this.parseNumber("1000000"),this.parseNumber("0.0018")],[this.parseNumber("15000000"),this.parseNumber("0.0016")],[this.parseNumber("75000000"),this.parseNumber("0.0012")],[this.parseNumber("250000000"),this.parseNumber("0.0008")],[this.parseNumber("400000000"),this.parseNumber("0.0005")]],maker:[[this.parseNumber("0"),this.parseNumber("0.004")],[this.parseNumber("10000"),this.parseNumber("0.0025")],[this.parseNumber("50000"),this.parseNumber("0.0015")],[this.parseNumber("100000"),this.parseNumber("0.001")],[this.parseNumber("1000000"),this.parseNumber("0.0008")],[this.parseNumber("15000000"),this.parseNumber("0.0006")],[this.parseNumber("75000000"),this.parseNumber("0.0003")],[this.parseNumber("250000000"),this.parseNumber("0.0")],[this.parseNumber("400000000"),this.parseNumber("0.0")]]}}},precisionMode:o.kb,exceptions:{exact:{two_factor_required:r.AuthenticationError,param_required:r.ExchangeError,validation_error:r.ExchangeError,invalid_request:r.ExchangeError,personal_details_required:r.AuthenticationError,identity_verification_required:r.AuthenticationError,jumio_verification_required:r.AuthenticationError,jumio_face_match_verification_required:r.AuthenticationError,unverified_email:r.AuthenticationError,authentication_error:r.AuthenticationError,invalid_authentication_method:r.AuthenticationError,invalid_token:r.AuthenticationError,revoked_token:r.AuthenticationError,expired_token:r.AuthenticationError,invalid_scope:r.AuthenticationError,not_found:r.ExchangeError,rate_limit_exceeded:r.RateLimitExceeded,internal_server_error:r.ExchangeError,UNSUPPORTED_ORDER_CONFIGURATION:r.BadRequest,INSUFFICIENT_FUND:r.InsufficientFunds,PERMISSION_DENIED:r.PermissionDenied,INVALID_ARGUMENT:r.BadRequest,PREVIEW_STOP_PRICE_ABOVE_LAST_TRADE_PRICE:r.InvalidOrder,PREVIEW_INSUFFICIENT_FUND:r.InsufficientFunds},broad:{"Insufficient balance in source account":r.InsufficientFunds,"request timestamp expired":r.InvalidNonce,"order with this orderID was not found":r.OrderNotFound}},timeframes:{"1m":"ONE_MINUTE","5m":"FIVE_MINUTE","15m":"FIFTEEN_MINUTE","30m":"THIRTY_MINUTE","1h":"ONE_HOUR","2h":"TWO_HOUR","6h":"SIX_HOUR","1d":"ONE_DAY"},commonCurrencies:{CGLD:"CELO"},options:{usePrivate:!1,brokerId:"ccxt",stablePairs:["BUSD-USD","CBETH-ETH","DAI-USD","GUSD-USD","GYEN-USD","PAX-USD","PAX-USDT","USDC-EUR","USDC-GBP","USDT-EUR","USDT-GBP","USDT-USD","USDT-USDC","WBTC-BTC"],fetchCurrencies:{expires:5e3},accounts:["wallet","fiat"],v3Accounts:["ACCOUNT_TYPE_CRYPTO","ACCOUNT_TYPE_FIAT"],networks:{ERC20:"ethereum",XLM:"stellar"},createMarketBuyOrderRequiresPrice:!0,advanced:!0,fetchMarkets:"fetchMarketsV3",timeDifference:0,adjustForTimeDifference:!1,fetchTicker:"fetchTickerV3",fetchTickers:"fetchTickersV3",fetchAccounts:"fetchAccountsV3",fetchBalance:"v2PrivateGetAccounts",fetchTime:"v2PublicGetTime",user_native_currency:"USD"},features:{default:{sandbox:!1,createOrder:{marginMode:!0,triggerPrice:!0,triggerPriceType:void 0,triggerDirection:!0,stopLossPrice:!0,takeProfitPrice:!0,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!0,FOK:!0,PO:!0,GTD:!0},hedged:!1,trailing:!1,leverage:!0,marketBuyByCost:!0,marketBuyRequiresPrice:!0,selfTradePrevention:!1,iceberg:!1},createOrders:void 0,fetchMyTrades:{marginMode:!1,limit:3e3,daysBack:void 0,untilDays:1e4,symbolRequired:!1},fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!1},fetchOpenOrders:{marginMode:!1,limit:void 0,trigger:!1,trailing:!1,symbolRequired:!1},fetchOrders:{marginMode:!1,limit:void 0,daysBack:void 0,untilDays:1e4,trigger:!1,trailing:!1,symbolRequired:!1},fetchClosedOrders:{marginMode:!1,limit:void 0,daysBack:void 0,daysBackCanceled:void 0,untilDays:1e4,trigger:!1,trailing:!1,symbolRequired:!1},fetchOHLCV:{limit:300}},spot:{extends:"default"},swap:{linear:{extends:"default"},inverse:void 0},future:{linear:{extends:"default"},inverse:void 0}}})}async fetchTime(e={}){const t=this.safeString(this.options,"fetchTime","v2PublicGetTime"),i=this.safeString(e,"method",t);let s;return e=this.omit(e,"method"),"v2PublicGetTime"===i?(s=await this.v2PublicGetTime(e),s=this.safeDict(s,"data",{})):s=await this.v3PublicGetBrokerageTime(e),this.safeTimestamp2(s,"epoch","epochSeconds")}async fetchAccounts(e={}){return"fetchAccountsV3"===this.safeString(this.options,"fetchAccounts","fetchAccountsV3")?await this.fetchAccountsV3(e):await this.fetchAccountsV2(e)}async fetchAccountsV2(e={}){await this.loadMarkets();let t=!1;if([t,e]=this.handleOptionAndParams(e,"fetchAccounts","paginate"),t)return await this.fetchPaginatedCallCursor("fetchAccounts",void 0,void 0,void 0,e,"next_starting_after","starting_after",void 0,100);const i=await this.v2PrivateGetAccounts(this.extend({limit:100},e)),s=this.safeList(i,"data",[]),r=this.safeDict(i,"pagination",{}),a=this.safeString(r,"next_starting_after"),o=this.safeList(i,"data",[]),n=o.length-1,d=this.safeDict(o,n);return void 0!==a&&""!==a&&(d.next_starting_after=a,o[n]=d),this.parseAccounts(s,e)}async fetchAccountsV3(e={}){await this.loadMarkets();let t=!1;if([t,e]=this.handleOptionAndParams(e,"fetchAccounts","paginate"),t)return await this.fetchPaginatedCallCursor("fetchAccounts",void 0,void 0,void 0,e,"cursor","cursor",void 0,250);const i=await this.v3PrivateGetBrokerageAccounts(this.extend({limit:250},e)),s=this.safeList(i,"accounts",[]),r=s.length-1,a=this.safeDict(s,r),o=this.safeString(i,"cursor");return void 0!==o&&""!==o&&(a.cursor=o,s[r]=a),this.parseAccounts(s,e)}async fetchPortfolios(e={}){const t=await this.v3PrivateGetBrokeragePortfolios(e),i=this.safeList(t,"portfolios",[]),s=[];for(let e=0;e0?s[0]:void 0,w.push(t)}return w}parseSpotMarket(e,t){const i=this.safeString(e,"product_id"),s=this.safeString(e,"base_currency_id"),r=this.safeString(e,"quote_currency_id"),a=this.safeCurrencyCode(s),o=this.safeCurrencyCode(r),n=this.safeStringLower(e,"product_type"),d=this.safeBool(e,"trading_disabled"),h=this.safeList(this.options,"stablePairs",[]),c=this.safeNumber(this.fees.trading,"taker"),l=this.safeNumber(this.fees.trading,"maker"),u=this.inArray(i,h)?1e-5:this.safeNumber(t,"taker_fee_rate",c),f=this.inArray(i,h)?0:this.safeNumber(t,"maker_fee_rate",l);return this.safeMarketStructure({id:i,symbol:a+"/"+o,base:a,quote:o,settle:void 0,baseId:s,quoteId:r,settleId:void 0,type:n,spot:"spot"===n,margin:void 0,swap:!1,future:!1,option:!1,active:!d,contract:!1,linear:void 0,inverse:void 0,taker:u,maker:f,contractSize:void 0,expiry:void 0,expiryDatetime:void 0,strike:void 0,optionType:void 0,precision:{amount:this.safeNumber(e,"base_increment"),price:this.safeNumber2(e,"price_increment","quote_increment")},limits:{leverage:{min:void 0,max:void 0},amount:{min:this.safeNumber(e,"base_min_size"),max:this.safeNumber(e,"base_max_size")},price:{min:void 0,max:void 0},cost:{min:this.safeNumber(e,"quote_min_size"),max:this.safeNumber(e,"quote_max_size")}},created:void 0,info:e})}parseContractMarket(e,t){const i=this.safeString(e,"product_id"),s=this.safeDict(e,"future_product_details",{}),r=this.safeString(s,"contract_expiry_type"),a=this.safeNumber(s,"contract_size"),o=this.safeString(s,"contract_expiry"),n=this.parse8601(o),d=this.iso8601(n),h="PERPETUAL"===r,c=this.safeString(s,"contract_root_unit"),l=this.safeString(e,"quote_currency_id"),u=this.safeCurrencyCode(c),f=this.safeCurrencyCode(l),p=this.safeBool(e,"is_disabled");let m,g=u+"/"+f;h?(m="swap",g=g+":"+f):(m="future",g=g+":"+f+"-"+this.yymmdd(n));const v=this.safeNumber(t,"taker_fee_rate"),y=this.safeNumber(t,"maker_fee_rate"),w=v||this.parseNumber("0.06"),b=y||this.parseNumber("0.04");return this.safeMarketStructure({id:i,symbol:g,base:u,quote:f,settle:f,baseId:c,quoteId:l,settleId:l,type:m,spot:!1,margin:!1,swap:h,future:!h,option:!1,active:!p,contract:!0,linear:!0,inverse:!1,taker:w,maker:b,contractSize:a,expiry:n,expiryDatetime:d,strike:void 0,optionType:void 0,precision:{amount:this.safeNumber(e,"base_increment"),price:this.safeNumber2(e,"price_increment","quote_increment")},limits:{leverage:{min:void 0,max:void 0},amount:{min:this.safeNumber(e,"base_min_size"),max:this.safeNumber(e,"base_max_size")},price:{min:void 0,max:void 0},cost:{min:this.safeNumber(e,"quote_min_size"),max:this.safeNumber(e,"quote_max_size")}},created:void 0,info:e})}async fetchCurrenciesFromCache(e={}){const t=this.safeDict(this.options,"fetchCurrencies",{}),i=this.safeInteger(t,"timestamp"),s=this.safeInteger(t,"expires",1e3),r=this.milliseconds();if(void 0===i||r-i>s){const i=[this.v2PublicGetCurrencies(e),this.v2PublicGetCurrenciesCrypto(e)],s=await Promise.all(i),a=this.safeDict(s,0,{}),o=this.safeDict(s,1,{}),n=this.safeList(a,"data",[]),d=this.safeList(o,"data",[]),h=await this.v2PublicGetExchangeRates(e);this.options.fetchCurrencies=this.extend(t,{currencies:this.arrayConcat(n,d),exchangeRates:h,timestamp:r})}return this.safeDict(this.options,"fetchCurrencies",{})}async fetchCurrencies(e={}){const t=[this.v2PublicGetCurrencies(e),this.v2PublicGetCurrenciesCrypto(e),this.v2PublicGetExchangeRates(e)],i=await Promise.all(t),s=this.safeDict(i,0,{}),r=this.safeDict(i,1,{}),a=this.safeDict(i,2,{}),o=this.safeList(s,"data",[]),n=this.safeList(r,"data",[]),d=this.safeDict(a,"data",{}),h=this.safeDict(d,"rates",{}),c=Object.keys(h),l=this.arrayConcat(o,n),u={},f={},p={};for(let e=0;e3&&(g=e[3])}return this.safeLedgerEntry({info:e,id:u,timestamp:l,datetime:this.iso8601(l),direction:s,account:g,referenceId:void 0,referenceAccount:void 0,type:f,currency:n,amount:this.parseNumber(r),before:void 0,after:void 0,status:p,fee:d},t)}async findAccountId(e,t={}){await this.loadMarkets(),await this.loadAccounts(!1,t);for(let t=0;t0?l:0,wallet_name:s,account_id:r,account_uuid:this.safeString(t,"account_uuid",""),total_balance_fiat:c,total_balance_crypto:this.parseNumber(this.safeString(t,"total_balance_crypto","0")),available_to_trade_fiat:this.parseNumber(this.safeString(t,"available_to_trade_fiat","0")),available_to_trade_crypto:this.parseNumber(this.safeString(t,"available_to_trade_crypto","0")),available_to_transfer_fiat:this.parseNumber(this.safeString(t,"available_to_transfer_fiat","0")),available_to_transfer_crypto:this.parseNumber(this.safeString(t,"available_to_trade_crypto","0")),allocation:this.parseNumber(this.safeString(t,"allocation","0")),cost_basis:this.parseNumber(f),cost_basis_currency:this.safeString(u,"currency","USD"),is_cash:this.safeBool(t,"is_cash",!1),average_entry_price:this.parseNumber(m),average_entry_price_currency:this.safeString(p,"currency","USD"),asset_uuid:this.safeString(t,"asset_uuid",""),unrealized_pnl:this.parseNumber(this.safeString(t,"unrealized_pnl","0")),asset_color:this.safeString(t,"asset_color",""),account_type:this.safeString(t,"account_type","")};o.push(g)}return o}createAuthToken(e,t=void 0,i=void 0){let s;if(void 0!==i){s=t+" "+i.replace("https://","");const e=s.indexOf("?");e>0&&(s=s.slice(0,e))}const r=this.randomBytes(16),a={aud:["retail_rest_api_proxy"],iss:"coinbase-cloud",nbf:e,exp:e+120,sub:this.apiKey,iat:e};void 0!==s&&(a.uri=s);return(0,d.a)(a,this.encode(this.secret),n.s,!1,{kid:this.apiKey,nonce:r,alg:"ES256"})}nonce(){return this.milliseconds()-this.options.timeDifference}sign(e,t=[],i="GET",s={},a=void 0,o=void 0){const d=t[0],h="private"===t[1],c="v3"===d;let l="/"+(c?"api/v3":"v2")+"/"+this.implodeParams(e,s);const u=this.omit(s,this.extractParams(e)),f=l;"GET"===i&&Object.keys(u).length&&(l+="?"+this.urlencodeWithArrayRepeat(u));const p=this.urls.api.rest+l;if(h){const e=this.safeString(this.headers,"Authorization");let t;if(void 0!==e)t=e;else if(this.token&&!this.checkRequiredCredentials(!1))t="Bearer "+this.token;else{this.checkRequiredCredentials();const e=this.seconds();let s="";"GET"!==i?Object.keys(u).length&&(s=o=this.json(u)):c||Object.keys(u).length&&(s+="?"+this.urlencode(u));if(this.apiKey.indexOf("organizations/")>=0||this.secret.startsWith("-----BEGIN")){if(this.apiKey.startsWith("-----BEGIN"))throw new r.ArgumentsRequired(this.id+" apiKey should contain the name (eg: organizations/3b910e93....) and not the public key");t="Bearer "+this.createAuthToken(e,i,p)}else{const e=this.nonce(),t=this.parseToInt(e/1e3).toString(),r=t+i+f+s,o=this.hmac(this.encode(r),this.encode(this.secret),n.s);a={"CB-ACCESS-KEY":this.apiKey,"CB-ACCESS-SIGN":o,"CB-ACCESS-TIMESTAMP":t,"Content-Type":"application/json"}}}void 0!==t&&(a={Authorization:t,"Content-Type":"application/json"},"GET"!==i&&Object.keys(u).length&&(o=this.json(u)))}return{url:p,method:i,body:o,headers:a}}handleErrors(e,t,i,s,a,o,n,d,h){if(void 0===n)return;const c=this.id+" "+o;let l=this.safeString(n,"error");if(void 0!==l){const e=this.safeString2(n,"error_description","error");throw this.throwExactlyMatchedException(this.exceptions.exact,l,c),this.throwBroadlyMatchedException(this.exceptions.broad,e,c),new r.ExchangeError(c)}const u=this.safeDict(n,"error_response");if(void 0!==u){const e=this.safeString2(u,"preview_failure_reason","preview_failure_reason");throw this.throwExactlyMatchedException(this.exceptions.exact,e,c),this.throwBroadlyMatchedException(this.exceptions.broad,e,c),new r.ExchangeError(c)}const f=this.safeList(n,"errors");if(void 0!==f&&Array.isArray(f)){if(f.length>0){l=this.safeString(f[0],"id");const e=this.safeString(f[0],"message");if(void 0!==l)throw this.throwExactlyMatchedException(this.exceptions.exact,l,c),this.throwBroadlyMatchedException(this.exceptions.broad,e,c),new r.ExchangeError(c)}}const p=this.options.advanced;if(!("data"in n)&&!p)throw new r.ExchangeError(this.id+" failed due to a malformed response "+this.json(n))}}},3278:(e,t,i)=>{i.d(t,{A:()=>r});var s=i(7504);class r extends s.A{describe(){return this.deepExtend(super.describe(),{id:"coinbaseadvanced",name:"Coinbase Advanced",alias:!0})}}},4293:(e,t,i)=>{i.d(t,{A:()=>d});var s=i(1552),r=i(2079),a=i(5147),o=i(1579),n=i(4852);class d extends s.A{describe(){return this.deepExtend(super.describe(),{id:"coinbaseexchange",name:"Coinbase Exchange",countries:["US"],rateLimit:100,userAgent:this.userAgents.chrome,pro:!0,has:{CORS:!0,spot:!0,margin:!1,swap:!1,future:!1,option:!1,addMargin:!1,borrowCrossMargin:!1,borrowIsolatedMargin:!1,borrowMargin:!1,cancelAllOrders:!0,cancelOrder:!0,closeAllPositions:!1,closePosition:!1,createDepositAddress:!0,createOrder:!0,createOrderWithTakeProfitAndStopLoss:!1,createOrderWithTakeProfitAndStopLossWs:!1,createPostOnlyOrder:!1,createReduceOnlyOrder:!1,createStopLimitOrder:!0,createStopMarketOrder:!0,createStopOrder:!0,fetchAccounts:!0,fetchBalance:!0,fetchBorrowInterest:!1,fetchBorrowRate:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchBorrowRates:!1,fetchBorrowRatesPerSymbol:!1,fetchClosedOrders:!0,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!0,fetchDepositAddress:!1,fetchDeposits:!0,fetchDepositsWithdrawals:!0,fetchFundingHistory:!1,fetchFundingInterval:!1,fetchFundingIntervals:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchGreeks:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchIsolatedPositions:!1,fetchLedger:!0,fetchLeverage:!1,fetchLeverages:!1,fetchLeverageTiers:!1,fetchLiquidations:!1,fetchLongShortRatio:!1,fetchLongShortRatioHistory:!1,fetchMarginAdjustmentHistory:!1,fetchMarginMode:!1,fetchMarginModes:!1,fetchMarketLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMarkPrices:!1,fetchMyLiquidations:!1,fetchMySettlementHistory:!1,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenInterest:!1,fetchOpenInterestHistory:!1,fetchOpenInterests:!1,fetchOpenOrders:!0,fetchOption:!1,fetchOptionChain:!1,fetchOrder:!0,fetchOrderBook:!0,fetchOrders:!0,fetchOrderTrades:!0,fetchPosition:!1,fetchPositionHistory:!1,fetchPositionMode:!1,fetchPositions:!1,fetchPositionsForSymbol:!1,fetchPositionsHistory:!1,fetchPositionsRisk:!1,fetchPremiumIndexOHLCV:!1,fetchSettlementHistory:!1,fetchTicker:!0,fetchTickers:!0,fetchTime:!0,fetchTrades:!0,fetchTradingFee:!1,fetchTradingFees:!0,fetchTransactions:"emulated",fetchVolatilityHistory:!1,fetchWithdrawals:!0,reduceMargin:!1,repayCrossMargin:!1,repayIsolatedMargin:!1,repayMargin:!1,setLeverage:!1,setMargin:!1,setMarginMode:!1,setPositionMode:!1,withdraw:!0},timeframes:{"1m":60,"5m":300,"15m":900,"1h":3600,"6h":21600,"1d":86400},hostname:"exchange.coinbase.com",urls:{test:{public:"https://api-public.sandbox.exchange.coinbase.com",private:"https://api-public.sandbox.exchange.coinbase.com"},logo:"https://github.com/ccxt/ccxt/assets/43336371/34a65553-88aa-4a38-a714-064bd228b97e",api:{public:"https://api.{hostname}",private:"https://api.{hostname}"},www:"https://coinbase.com/",doc:"https://docs.cloud.coinbase.com/exchange/docs/",fees:["https://docs.pro.coinbase.com/#fees","https://support.pro.coinbase.com/customer/en/portal/articles/2945310-fees"]},requiredCredentials:{apiKey:!0,secret:!0,password:!0},api:{public:{get:["currencies","products","products/{id}","products/{id}/book","products/{id}/candles","products/{id}/stats","products/{id}/ticker","products/{id}/trades","time","products/spark-lines","products/volume-summary"]},private:{get:["address-book","accounts","accounts/{id}","accounts/{id}/holds","accounts/{id}/ledger","accounts/{id}/transfers","coinbase-accounts","fills","funding","fees","margin/profile_information","margin/buying_power","margin/withdrawal_power","margin/withdrawal_power_all","margin/exit_plan","margin/liquidation_history","margin/position_refresh_amounts","margin/status","oracle","orders","orders/{id}","orders/client:{client_oid}","otc/orders","payment-methods","position","profiles","profiles/{id}","reports/{report_id}","transfers","transfers/{transfer_id}","users/self/exchange-limits","users/self/hold-balances","users/self/trailing-volume","withdrawals/fee-estimate","conversions/{conversion_id}","conversions/fees"],post:["conversions","deposits/coinbase-account","deposits/payment-method","coinbase-accounts/{id}/addresses","funding/repay","orders","position/close","profiles/margin-transfer","profiles/transfer","reports","withdrawals/coinbase","withdrawals/coinbase-account","withdrawals/crypto","withdrawals/payment-method"],delete:["orders","orders/client:{client_oid}","orders/{id}"]}},commonCurrencies:{CGLD:"CELO"},precisionMode:o.kb,fees:{trading:{tierBased:!0,percentage:!0,maker:this.parseNumber("0.004"),taker:this.parseNumber("0.006")},funding:{tierBased:!1,percentage:!1,withdraw:{BCH:0,BTC:0,LTC:0,ETH:0,EUR:.15,USD:25},deposit:{BCH:0,BTC:0,LTC:0,ETH:0,EUR:.15,USD:10}}},features:{default:{sandbox:!0,createOrder:{marginMode:!0,triggerPrice:!0,triggerPriceType:void 0,triggerDirection:!1,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!0,FOK:!0,PO:!0,GTD:!0},hedged:!1,trailing:!1,leverage:!1,marketBuyByCost:!1,marketBuyRequiresPrice:!1,selfTradePrevention:!1,iceberg:!0},createOrders:void 0,fetchMyTrades:{marginMode:!1,limit:100,daysBack:1e5,untilDays:1e5,symbolRequired:!0},fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!1},fetchOpenOrders:{marginMode:!1,limit:100,trigger:!1,trailing:!1,symbolRequired:!1},fetchOrders:{marginMode:!1,limit:100,daysBack:1e5,untilDays:1e5,trigger:!1,trailing:!1,symbolRequired:!1},fetchClosedOrders:{marginMode:!1,limit:100,daysBack:1e5,daysBackCanceled:1,untilDays:1e5,trigger:!1,trailing:!1,symbolRequired:!1},fetchOHLCV:{limit:300}},spot:{extends:"default"},swap:{linear:void 0,inverse:void 0},future:{linear:void 0,inverse:void 0}},options:{networks:{BTC:"bitcoin",ETH:"ethereum",SOL:"solana",ARBONE:"arbitrum",AVAXC:"avacchain",MATIC:"polygon",BASE:"base",SUI:"sui",OP:"optimism",NEAR:"near",APT:"aptos",KAVA:"kava",BLAST:"blast",XLM:"stellar",SEI:"sei",ADA:"cardano",CORE:"coredao",ALGO:"algorand",OSMO:"osmosis",CELO:"celo",HBAR:"hedera",ZKSYNC:"zksync",STX:"stacks",XTZ:"tezos",EGLD:"elrond",LTC:"litecoin",ATOM:"cosmos",FIL:"filecoin",DOT:"polkadot",DOGE:"dogecoin",XRP:"ripple",DASH:"dash"}},exceptions:{exact:{"Insufficient funds":r.InsufficientFunds,NotFound:r.OrderNotFound,"Invalid API Key":r.AuthenticationError,"invalid signature":r.AuthenticationError,"Invalid Passphrase":r.AuthenticationError,"Invalid order id":r.InvalidOrder,"Private rate limit exceeded":r.RateLimitExceeded,"Trading pair not available":r.PermissionDenied,"Product not found":r.InvalidOrder},broad:{"Order already done":r.OrderNotFound,"order not found":r.OrderNotFound,"price too small":r.InvalidOrder,"price too precise":r.InvalidOrder,"under maintenance":r.OnMaintenance,"size is too small":r.InvalidOrder,"Cancel only mode":r.OnMaintenance}}})}async fetchCurrencies(e={}){const t=await this.publicGetCurrencies(e),i={};for(let e=0;e{i.d(t,{A:()=>d});var s=i(2609),r=i(2079),a=i(5147),o=i(1579),n=i(4852);class d extends s.A{describe(){return this.deepExtend(super.describe(),{id:"coinbaseinternational",name:"Coinbase International",countries:["US"],certified:!1,pro:!0,rateLimit:100,version:"v1",userAgent:this.userAgents.chrome,headers:{"CB-VERSION":"2018-05-30"},has:{CORS:!0,spot:!0,margin:!0,swap:!0,future:!0,option:!1,addMargin:!1,cancelAllOrders:!0,cancelOrder:!0,cancelOrders:!1,closeAllPositions:!1,closePosition:!1,createDepositAddress:!0,createLimitBuyOrder:!0,createLimitSellOrder:!0,createMarketBuyOrder:!0,createMarketBuyOrderWithCost:!1,createMarketOrderWithCost:!1,createMarketSellOrder:!0,createMarketSellOrderWithCost:!1,createOrder:!0,createPostOnlyOrder:!0,createReduceOnlyOrder:!1,createStopLimitOrder:!0,createStopMarketOrder:!0,createStopOrder:!0,editOrder:!0,fetchAccounts:!0,fetchBalance:!0,fetchBidsAsks:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchCanceledOrders:!1,fetchClosedOrders:!1,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!0,fetchDeposits:!0,fetchFundingHistory:!0,fetchFundingRate:!1,fetchFundingRateHistory:!0,fetchFundingRates:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchL2OrderBook:!1,fetchLedger:!1,fetchLeverage:!1,fetchLeverageTiers:!1,fetchMarginAdjustmentHistory:!1,fetchMarginMode:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMyBuys:!0,fetchMySells:!0,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenInterestHistory:!1,fetchOpenOrders:!0,fetchOrder:!0,fetchOrderBook:!1,fetchOrders:!1,fetchPosition:!0,fetchPositionHistory:!1,fetchPositionMode:!1,fetchPositions:!0,fetchPositionsHistory:!1,fetchPositionsRisk:!1,fetchPremiumIndexOHLCV:!1,fetchTicker:!0,fetchTickers:!0,fetchTime:!1,fetchTrades:!1,fetchTradingFee:!1,fetchTradingFees:!1,fetchTransfers:!0,fetchWithdrawals:!0,reduceMargin:!1,sandbox:!0,setLeverage:!1,setMargin:!0,setMarginMode:!1,setPositionMode:!1,withdraw:!0},urls:{logo:"https://github.com/ccxt/ccxt/assets/43336371/866ae638-6ab5-4ebf-ab2c-cdcce9545625",api:{rest:"https://api.international.coinbase.com/api"},test:{rest:"https://api-n5e1.coinbase.com/api"},www:"https://international.coinbase.com",doc:["https://docs.cloud.coinbase.com/intx/docs"],fees:["https://help.coinbase.com/en/international-exchange/trading-deposits-withdrawals/international-exchange-fees"],referral:""},requiredCredentials:{apiKey:!0,secret:!0,password:!0},api:{v1:{public:{get:["assets","assets/{assets}","assets/{asset}/networks","instruments","instruments/{instrument}","instruments/{instrument}/quote","instruments/{instrument}/funding","instruments/{instrument}/candles"]},private:{get:["orders","orders/{id}","portfolios","portfolios/{portfolio}","portfolios/{portfolio}/detail","portfolios/{portfolio}/summary","portfolios/{portfolio}/balances","portfolios/{portfolio}/balances/{asset}","portfolios/{portfolio}/positions","portfolios/{portfolio}/positions/{instrument}","portfolios/fills","portfolios/{portfolio}/fills","transfers","transfers/{transfer_uuid}"],post:["orders","portfolios","portfolios/margin","portfolios/transfer","transfers/withdraw","transfers/address","transfers/create-counterparty-id","transfers/validate-counterparty-id","transfers/withdraw/counterparty"],put:["orders/{id}","portfolios/{portfolio}"],delete:["orders","orders/{id}"]}}},fees:{trading:{taker:this.parseNumber("0.004"),maker:this.parseNumber("0.002"),tierBased:!0,percentage:!0,tiers:{taker:[[this.parseNumber("0"),this.parseNumber("0.004")],[this.parseNumber("1000000"),this.parseNumber("0.004")],[this.parseNumber("5000000"),this.parseNumber("0.0035")],[this.parseNumber("10000000"),this.parseNumber("0.0035")],[this.parseNumber("50000000"),this.parseNumber("0.003")],[this.parseNumber("250000000"),this.parseNumber("0.0025")]],maker:[[this.parseNumber("0"),this.parseNumber("0.002")],[this.parseNumber("1000000"),this.parseNumber("0.0016")],[this.parseNumber("5000000"),this.parseNumber("0.001")],[this.parseNumber("10000000"),this.parseNumber("0.0008")],[this.parseNumber("50000000"),this.parseNumber("0.0005")],[this.parseNumber("250000000"),this.parseNumber("0")]]}}},precisionMode:o.kb,exceptions:{exact:{},broad:{DUPLICATE_CLIENT_ORDER_ID:r.DuplicateOrderId,"Order rejected":r.InvalidOrder,"market orders must be IoC":r.InvalidOrder,"tif is required":r.InvalidOrder,"Invalid replace order request":r.InvalidOrder,Unauthorized:r.PermissionDenied,"invalid result_limit":r.BadRequest,"is a required field":r.BadRequest,"Not Found":r.BadRequest,"ip not allowed":r.AuthenticationError}},timeframes:{"1m":"ONE_MINUTE","5m":"FIVE_MINUTE","15m":"FIFTEEN_MINUTE","30m":"THIRTY_MINUTE","1h":"ONE_HOUR","2h":"TWO_HOUR","6h":"SIX_HOUR","1d":"ONE_DAY"},options:{brokerId:"nfqkvdjp",portfolio:"",withdraw:{method:"v1PrivatePostTransfersWithdraw"},networksById:{ethereum:"ETH",arbitrum:"ARBITRUM",avacchain:"AVAX",optimism:"OPTIMISM",polygon:"MATIC",solana:"SOL",bitcoin:"BTC"}},features:{default:{sandbox:!0,createOrder:{marginMode:!1,triggerPrice:!0,triggerPriceType:void 0,triggerDirection:!0,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!0,FOK:!0,PO:!0,GTD:!0,GTC:!0},hedged:!1,trailing:!1,leverage:!1,marketBuyByCost:!1,marketBuyRequiresPrice:!0,selfTradePrevention:!0,iceberg:!1},createOrders:void 0,fetchMyTrades:{marginMode:!1,limit:100,daysBack:void 0,untilDays:1e4,symbolRequired:!1},fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!1},fetchOpenOrders:{marginMode:!1,limit:100,trigger:!1,trailing:!1,symbolRequired:!1},fetchOrders:void 0,fetchClosedOrders:void 0,fetchOHLCV:{limit:300}},spot:{extends:"default"},swap:{linear:{extends:"default"},inverse:{extends:"default"}},future:{linear:void 0,inverse:void 0}}})}async handlePortfolioAndParams(e,t={}){let i;if([i,t]=this.handleOptionAndParams(t,e,"portfolio"),void 0!==i&&""!==i)return[i,t];const s=this.safeString(this.options,"portfolio");if(void 0!==s&&""!==s)return[s,t];const a=await this.fetchAccounts();for(let e=0;e100)throw new r.BadRequest(this.id+" fetchOpenOrders() maximum limit is 100");c.result_limit=i}void 0!==t&&(c.ref_datetime=this.iso8601(t));const u=await this.v1PrivateGetOrders(this.extend(c,s)),f=this.safeList(u,"results",[]);return this.parseOrders(f,l,t,i)}async fetchMyTrades(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();let a=!1;[a,s]=this.handleOptionAndParams(s,"fetchMyTrades","paginate");const o="ccxtPageKey";let n,d;if([n,s]=this.handleOptionAndParams(s,"fetchMyTrades","maxEntriesPerRequest",100),a)return await this.fetchPaginatedCallIncremental("fetchMyTrades",e,t,i,s,o,n);void 0!==e&&(d=this.market(e));const h=this.safeInteger(s,o,1)-1,c={result_offset:this.safeInteger2(s,"offset","result_offset",h*n)};if(void 0!==i){if(i>100)throw new r.BadRequest(this.id+" fetchMyTrades() maximum limit is 100. Consider setting paginate to true to fetch more trades.");c.result_limit=i}void 0!==t&&(c.time_from=this.iso8601(t));const l=this.safeStringN(s,["until"]);void 0!==l&&(s=this.omit(s,["until"]),c.ref_datetime=this.iso8601(l));const u=await this.v1PrivateGetPortfoliosFills(this.extend(c,s)),f=this.safeList(u,"results",[]);return this.parseTrades(f,d,t,i)}async withdraw(e,t,i,s=void 0,r={}){[s,r]=this.handleWithdrawTagAndParams(s,r),this.checkAddress(i),await this.loadMarkets();const a=this.currency(e);let o,n,d;[o,r]=await this.handlePortfolioAndParams("withdraw",r),[n,r]=this.handleOptionAndParams(r,"withdraw","method","v1PrivatePostTransfersWithdraw"),[d,r]=await this.handleNetworkIdAndParams(e,"withdraw",r);const h={portfolio:o,type:"send",asset:a.id,address:i,amount:t,currency:a.id,network_arn_id:d,nonce:this.nonce()},c=await this[n](this.extend(h,r));return this.parseTransaction(c,a)}safeNetwork(e){let t=this.safeBool(e,"withdraw"),i=this.safeBool(e,"deposit");const s=this.safeDict(e,"limits"),r=this.safeDict(s,"withdraw"),a=this.safeNumber(r,"max"),o=this.safeDict(s,"deposit"),n=this.safeNumber(o,"max");void 0===t&&void 0!==a&&(t=a>0),void 0===i&&void 0!==n&&(i=n>0);const d=this.safeString(e,"id"),h=t&&i;return{info:e.info,id:d,name:this.safeString(e,"name"),network:this.safeString(e,"network"),active:this.safeBool(e,"active",h),deposit:i,withdraw:t,fee:this.safeNumber(e,"fee"),precision:this.safeNumber(e,"precision"),limits:{withdraw:{min:this.safeNumber(r,"min"),max:a},deposit:{min:this.safeNumber(o,"min"),max:n}}}}sign(e,t=[],i="GET",s={},r=void 0,a=void 0){const o=t[0],d="private"===t[1];let h="/"+o+"/"+this.implodeParams(e,s);const c=this.omit(s,this.extractParams(e)),l="/api"+h;"GET"!==i&&"DELETE"!==i||Object.keys(c).length&&(h+="?"+this.urlencodeWithArrayRepeat(c));const u=this.urls.api.rest+h;if(d){this.checkRequiredCredentials();const e=this.nonce().toString();let t="";"GET"!==i&&Object.keys(c).length&&(t=a=this.json(c));const s=e+i+l+t;r={"CB-ACCESS-TIMESTAMP":e,"CB-ACCESS-SIGN":this.hmac(this.encode(s),this.base64ToBinary(this.secret),n.s,"base64"),"CB-ACCESS-PASSPHRASE":this.password,"CB-ACCESS-KEY":this.apiKey}}return{url:u,method:i,body:a,headers:r}}handleErrors(e,t,i,s,a,o,n,d,h){if(void 0===n)return;const c=this.id+" "+o,l=this.safeString(n,"title");if(void 0!==l)throw this.throwExactlyMatchedException(this.exceptions.exact,l,c),this.throwBroadlyMatchedException(this.exceptions.broad,l,c),new r.ExchangeError(c)}}},570:(e,t,i)=>{i.d(t,{A:()=>d});var s=i(5769),r=i(2079),a=i(5147),o=i(1579),n=i(4852);class d extends s.A{describe(){return this.deepExtend(super.describe(),{id:"coincatch",name:"CoinCatch",countries:["VG"],rateLimit:50,version:"v1",certified:!1,pro:!0,has:{CORS:void 0,spot:!0,margin:!1,swap:!0,future:!1,option:!1,addMargin:!0,cancelAllOrders:!0,cancelAllOrdersAfter:!1,cancelOrder:!0,cancelOrders:!0,cancelWithdraw:!1,closePosition:!1,createConvertTrade:!1,createDepositAddress:!1,createLimitBuyOrder:!0,createLimitSellOrder:!0,createMarketBuyOrder:!0,createMarketBuyOrderWithCost:!0,createMarketOrder:!0,createMarketOrderWithCost:!1,createMarketSellOrder:!0,createMarketSellOrderWithCost:!1,createOrder:!0,createOrders:!0,createOrderWithTakeProfitAndStopLoss:!0,createPostOnlyOrder:!0,createReduceOnlyOrder:!0,createStopLimitOrder:!0,createStopLossOrder:!0,createStopMarketOrder:!0,createStopOrder:!0,createTakeProfitOrder:!0,createTrailingAmountOrder:!1,createTrailingPercentOrder:!1,createTriggerOrder:!0,fetchAccounts:!1,fetchBalance:!0,fetchCanceledAndClosedOrders:!0,fetchCanceledOrders:!1,fetchClosedOrder:!1,fetchClosedOrders:!1,fetchConvertCurrencies:!1,fetchConvertQuote:!1,fetchConvertTrade:!1,fetchConvertTradeHistory:!1,fetchCurrencies:!0,fetchDepositAddress:!0,fetchDeposits:!0,fetchDepositsWithdrawals:!1,fetchDepositWithdrawFees:!0,fetchFundingHistory:!1,fetchFundingRate:!0,fetchFundingRateHistory:!0,fetchFundingRates:!1,fetchIndexOHLCV:!1,fetchLedger:!0,fetchLeverage:!0,fetchLeverageTiers:!1,fetchMarginAdjustmentHistory:!1,fetchMarginMode:!0,fetchMarkets:!0,fetchMarkOHLCV:!0,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenInterestHistory:!1,fetchOpenOrder:!1,fetchOpenOrders:!0,fetchOrder:!0,fetchOrderBook:!0,fetchOrders:!1,fetchOrderTrades:!0,fetchPosition:!0,fetchPositionHistory:!1,fetchPositionMode:!0,fetchPositions:!0,fetchPositionsForSymbol:!0,fetchPositionsHistory:!1,fetchPremiumIndexOHLCV:!1,fetchStatus:!1,fetchTicker:!0,fetchTickers:!0,fetchTime:!0,fetchTrades:!0,fetchTradingFee:!1,fetchTradingFees:!1,fetchTransactions:!1,fetchTransfers:!1,fetchWithdrawals:!0,reduceMargin:!0,sandbox:!1,setLeverage:!0,setMargin:!1,setMarginMode:!0,setPositionMode:!0,transfer:!1,withdraw:!0},timeframes:{"1m":"1m","3m":"3m","5m":"5m",15:"15m",30:"30m","1h":"1H","2h":"2H","4h":"4H","6h":"6H","12h":"12H","1d":"1D","3d":"3D","1w":"1W","1M":"1M"},urls:{logo:"https://github.com/user-attachments/assets/3d49065f-f05d-4573-88a2-1b5201ec6ff3",api:{public:"https://api.coincatch.com",private:"https://api.coincatch.com"},www:"https://www.coincatch.com/",doc:"https://coincatch.github.io/github.io/en/",fees:"https://www.coincatch.com/en/rate/",referral:{url:"https://partner.coincatch.cc/bg/92hy70391729607848548",discount:.1}},api:{public:{get:{"api/spot/v1/public/time":1,"api/spot/v1/public/currencies":20/3,"api/spot/v1/market/ticker":1,"api/spot/v1/market/tickers":1,"api/spot/v1/market/fills":2,"api/spot/v1/market/fills-history":2,"api/spot/v1/market/candles":1,"api/spot/v1/market/history-candles":1,"api/spot/v1/market/depth":1,"api/spot/v1/market/merge-depth":1,"api/mix/v1/market/contracts":1,"api/mix/v1/market/merge-depth":1,"api/mix/v1/market/depth":1,"api/mix/v1/market/ticker":1,"api/mix/v1/market/tickers":1,"api/mix/v1/market/fills":1,"api/mix/v1/market/fills-history":1,"api/mix/v1/market/candles":1,"pi/mix/v1/market/index":1,"api/mix/v1/market/funding-time":1,"api/mix/v1/market/history-fundRate":1,"api/mix/v1/market/current-fundRate":1,"api/mix/v1/market/open-interest":1,"api/mix/v1/market/mark-price":1,"api/mix/v1/market/symbol-leverage":1,"api/mix/v1/market/queryPositionLever":1}},private:{get:{"api/spot/v1/wallet/deposit-address":4,"pi/spot/v1/wallet/withdrawal-list":1,"api/spot/v1/wallet/withdrawal-list-v2":1,"api/spot/v1/wallet/deposit-list":1,"api/spot/v1/account/getInfo":1,"api/spot/v1/account/assets":2,"api/spot/v1/account/transferRecords":1,"api/mix/v1/account/account":2,"api/mix/v1/account/accounts":2,"api/mix/v1/position/singlePosition-v2":2,"api/mix/v1/position/allPosition-v2":4,"api/mix/v1/account/accountBill":2,"api/mix/v1/account/accountBusinessBill":4,"api/mix/v1/order/current":1,"api/mix/v1/order/marginCoinCurrent":1,"api/mix/v1/order/history":2,"api/mix/v1/order/historyProductType":4,"api/mix/v1/order/detail":2,"api/mix/v1/order/fills":2,"api/mix/v1/order/allFills":2,"api/mix/v1/plan/currentPlan":1,"api/mix/v1/plan/historyPlan":2},post:{"api/spot/v1/wallet/transfer-v2":4,"api/spot/v1/wallet/withdrawal-v2":4,"api/spot/v1/wallet/withdrawal-inner-v2":1,"api/spot/v1/account/bills":2,"api/spot/v1/trade/orders":2,"api/spot/v1/trade/batch-orders":{cost:4,step:10},"api/spot/v1/trade/cancel-order":1,"api/spot/v1/trade/cancel-order-v2":2,"api/spot/v1/trade/cancel-symbol-order":2,"api/spot/v1/trade/cancel-batch-orders":1,"api/spot/v1/trade/cancel-batch-orders-v2":1,"api/spot/v1/trade/orderInfo":1,"api/spot/v1/trade/open-orders":1,"api/spot/v1/trade/history":1,"api/spot/v1/trade/fills":1,"api/spot/v1/plan/placePlan":1,"api/spot/v1/plan/modifyPlan":1,"api/spot/v1/plan/cancelPlan":1,"api/spot/v1/plan/currentPlan":1,"api/spot/v1/plan/historyPlan":1,"api/spot/v1/plan/batchCancelPlan":2,"api/mix/v1/account/open-count":1,"api/mix/v1/account/setLeverage":4,"api/mix/v1/account/setMargin":4,"api/mix/v1/account/setMarginMode":4,"api/mix/v1/account/setPositionMode":4,"api/mix/v1/order/placeOrder":2,"api/mix/v1/order/batch-orders":{cost:4,step:10},"api/mix/v1/order/cancel-order":2,"api/mix/v1/order/cancel-batch-orders":2,"api/mix/v1/order/cancel-symbol-orders":2,"api/mix/v1/order/cancel-all-orders":2,"api/mix/v1/plan/placePlan":2,"api/mix/v1/plan/modifyPlan":2,"api/mix/v1/plan/modifyPlanPreset":2,"api/mix/v1/plan/placeTPSL":2,"api/mix/v1/plan/placeTrailStop":2,"api/mix/v1/plan/placePositionsTPSL":2,"api/mix/v1/plan/modifyTPSLPlan":2,"api/mix/v1/plan/cancelPlan":2,"api/mix/v1/plan/cancelSymbolPlan":2,"api/mix/v1/plan/cancelAllPlan":2}}},requiredCredentials:{apiKey:!0,secret:!0,password:!0},fees:{trading:{spot:{tierBased:!1,percentage:!0,feeSide:"get",maker:this.parseNumber("0.001"),taker:this.parseNumber("0.001")}}},options:{brokerId:"47cfy",createMarketBuyOrderRequiresPrice:!0,timeframes:{spot:{"1m":"1min","5m":"5min","15m":"15min","30m":"30min","1h":"1h","4h":"4h","6h":"6h","12h":"12h","1d":"1day","3d":"3day","1w":"1week","1M":"1M"},swap:{"1m":"1m","3m":"3m","5m":"5m",15:"15m",30:"30m","1h":"1H","2h":"2H","4h":"4H","6h":"6H","12h":"12H","1d":"1D","3d":"3D","1w":"1W","1M":"1M"}},currencyIdsListForParseMarket:void 0,broker:"",networks:{BTC:"BITCOIN",ERC20:"ERC20",TRC20:"TRC20",BEP20:"BEP20",ARB:"ArbitrumOne",OPTIMISM:"Optimism",LTC:"LTC",BCH:"BCH",ETC:"ETC",SOL:"SOL",NEO3:"NEO3",STX:"stacks",EGLD:"Elrond",NEAR:"NEARProtocol",ACA:"AcalaToken",KLAY:"Klaytn",FTM:"Fantom",TERRA:"Terra",WAVES:"WAVES",TAO:"TAO",SUI:"SUI",SEI:"SEI",RUNE:"THORChain",ZIL:"ZIL",SXP:"Solar",FET:"FET",AVAX:"C-Chain",XRP:"XRP",EOS:"EOS",DOGE:"DOGECOIN",CAP20:"CAP20",MATIC:"Polygon",CSPR:"CSPR",GLMR:"Moonbeam",MINA:"MINA",CFX:"CFX",STRAT:"StratisEVM",TIA:"Celestia",ChilizChain:"ChilizChain",APT:"Aptos",ONT:"Ontology",ICP:"ICP",ADA:"Cardano",FIL:"FIL",CELO:"CELO",DOT:"DOT",XLM:"StellarLumens",ATOM:"ATOM",CRO:"CronosChain"},networksById:{TRC20:"TRC20","TRX(TRC20)":"TRC20",ArbitrumOne:"ARB",THORChain:"RUNE",Solar:"SXP","C-Chain":"AVAX",CAP20:"CAP20",CFXeSpace:"CFX",CFX:"CFX",StratisEVM:"STRAT",ChilizChain:"ChilizChain",StellarLumens:"XLM",CronosChain:"CRO"}},features:{default:{sandbox:!1,createOrder:{marginMode:!1,triggerPrice:!0,triggerPriceType:{last:!0,mark:!0,index:!1},triggerDirection:!1,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!0,FOK:!0,PO:!0,GTD:!1},hedged:!1,trailing:!1,leverage:!1,marketBuyByCost:!0,marketBuyRequiresPrice:!1,selfTradePrevention:!1,iceberg:!1},createOrders:{max:50},fetchMyTrades:{marginMode:!1,limit:500,daysBack:1e5,untilDays:1e5,symbolRequired:!0},fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!1},fetchOpenOrders:{marginMode:!1,limit:100,trigger:!0,trailing:!1,marketType:!0,symbolRequired:!1},fetchOrders:void 0,fetchClosedOrders:void 0,fetchOHLCV:{limit:1e3}},spot:{extends:"default"},forDerivatives:{extends:"default",createOrder:{attachedStopLossTakeProfit:{triggerPriceType:void 0,price:!1}},fetchMyTrades:{limit:100}},swap:{linear:{extends:"forDerivatives"},inverse:{extends:"forDerivatives"}},future:{linear:void 0,inverse:void 0}},commonCurrencies:{},exceptions:{exact:{22001:r.OrderNotFound,429:r.DDoSProtection,40001:r.AuthenticationError,40002:r.AuthenticationError,40003:r.AuthenticationError,40005:r.InvalidNonce,40006:r.AuthenticationError,40007:r.BadRequest,40008:r.InvalidNonce,40009:r.AuthenticationError,40011:r.AuthenticationError,40012:r.AuthenticationError,40013:r.ExchangeError,40014:r.PermissionDenied,40015:r.ExchangeError,40016:r.PermissionDenied,40017:r.ExchangeError,40018:r.PermissionDenied,40019:r.BadRequest,40020:r.BadRequest,40034:r.BadRequest,400172:r.BadRequest,40912:r.BadRequest,40913:r.BadRequest,40102:r.BadRequest,40200:r.OnMaintenance,40305:r.BadRequest,40409:r.ExchangeError,40704:r.ExchangeError,40724:r.BadRequest,40725:r.ExchangeError,40762:r.InsufficientFunds,40774:r.BadRequest,40808:r.BadRequest,43001:r.OrderNotFound,43002:r.InvalidOrder,43004:r.OrderNotFound,43005:r.RateLimitExceeded,43006:r.BadRequest,43007:r.BadRequest,43008:r.BadRequest,43009:r.BadRequest,43010:r.BadRequest,43011:r.BadRequest,43012:r.InsufficientFunds,43117:r.InsufficientFunds,43118:r.BadRequest,43122:r.BadRequest,45006:r.InsufficientFunds,45110:r.BadRequest},broad:{}},precisionMode:o.kb})}calculateRateLimiterCost(e,t,i,s,r={}){const a=this.safeInteger(r,"step"),o=this.safeInteger(r,"cost",1),n=this.safeList2(s,"orderList","orderDataList",[]).length;if(void 0!==a&&n>a){return o*Math.ceil(n/a)}return o}async fetchTime(e={}){const t=await this.publicGetApiSpotV1PublicTime(e);return this.safeInteger(t,"data")}async fetchCurrencies(e={}){const t=await this.publicGetApiSpotV1PublicCurrencies(e),i=this.safeList(t,"data",[]),s={},r=[];for(let e=0;e-1){const s=e.replace(a,"");0===o?(t=a,i=s):(t=s,i=a);break}}return{baseId:t,quoteId:i}}async fetchTicker(e,t={}){await this.loadMarkets();const i=this.market(e),s={symbol:i.id};let a;if(i.spot)a=await this.publicGetApiSpotV1MarketTicker(this.extend(s,t));else{if(!i.swap)throw new r.NotSupported(this.id+" fetchTicker() is not supported for "+i.type+" type of markets");a=await this.publicGetApiMixV1MarketTicker(this.extend(s,t))}const o=this.safeDict(a,"data",{});return this.parseTicker(o,i)}async fetchTickers(e=void 0,t={}){const i="fetchTickers";await this.loadMarkets(),e=this.marketSymbols(e,void 0,!0,!0);const s=this.getMarketFromSymbols(e);let a,o="spot";if([o,t]=this.handleMarketTypeAndParams(i,s,t,o),"spot"===o)a=await this.publicGetApiSpotV1MarketTickers(t);else{if("swap"!==o)throw new r.NotSupported(this.id+" "+i+"() is not supported for "+o+" type of markets");{let e="umcbl";[e,t]=this.handleOptionAndParams(t,i,"productType",e);const s={productType:e};a=await this.publicGetApiMixV1MarketTickers(this.extend(s,t))}}const n=this.safeList(a,"data",[]);return this.parseTickers(n,e)}parseTicker(e,t=void 0){const i=this.safeInteger2(e,"ts","timestamp");let s=this.safeString(e,"symbol","");s.indexOf("_")<0&&(s+="_SPBL"),t=this.safeMarketCustom(s,t);const r=this.safeString2(e,"close","last");return this.safeTicker({symbol:t.symbol,timestamp:i,datetime:this.iso8601(i),high:this.safeString(e,"high24h"),low:this.safeString(e,"low24h"),bid:this.safeString2(e,"buyOne","bestBid"),bidVolume:this.safeString(e,"bidSz"),ask:this.safeString2(e,"sellOne","bestAsk"),askVolume:this.safeString(e,"askSz"),vwap:void 0,open:this.safeString2(e,"openUtc0","openUtc"),close:r,last:r,previousClose:void 0,change:void 0,percentage:a.Y.stringMul(this.safeString2(e,"changeUtc","chgUtc"),"100"),average:void 0,baseVolume:this.safeString2(e,"baseVol","baseVolume"),quoteVolume:this.safeString2(e,"quoteVol","quoteVolume"),indexPrice:this.safeString(e,"indexPrice"),markPrice:void 0,info:e},t)}async fetchOrderBook(e,t=void 0,i={}){await this.loadMarkets();const s="fetchOrderBook",a=this.market(e),o={symbol:a.id};let n,d;if(void 0!==t&&(o.limit=t),[n,i]=this.handleOptionAndParams(i,s,"precision"),void 0!==n&&(o.precision=n),a.spot)d=await this.publicGetApiSpotV1MarketMergeDepth(this.extend(o,i));else{if(!a.swap)throw new r.NotSupported(this.id+" "+s+"() is not supported for "+a.type+" type of markets");d=await this.publicGetApiMixV1MarketMergeDepth(this.extend(o,i))}const h=this.safeDict(d,"data",{}),c=this.safeInteger(h,"ts");return this.parseOrderBook(h,e,c,"bids","asks")}async fetchOHLCV(e,t="1m",i=void 0,s=void 0,a={}){const o="fetchOHLCV";await this.loadMarkets();const n=this.market(e),d={symbol:n.id};let h;[h,a]=this.handleOptionAndParams(a,o,"until");const c=n.type,l=this.options.timeframes[c],u=this.safeString(l,t,t);let f,p=s;if(void 0===i&&void 0===h||(p=1e3),void 0!==p&&(d.limit=p),n.spot){d.period=u,void 0!==i&&(d.after=i),void 0!==h&&(d.before=h),f=await this.publicGetApiSpotV1MarketCandles(this.extend(d,a));const e=this.safeList(f,"data",[]);return this.parseOHLCVs(e,n,t,i,s)}if(n.swap){if(d.granularity=u,void 0===h&&(h=this.milliseconds()),void 0===i){i=h-1e3*this.parseTimeframe(t)*1e3}let e;return d.startTime=i,d.endTime=h,[e,a]=this.handleOptionAndParams(a,o,"price"),"mark"===e&&(d.kLineType="market mark index"),f=await this.publicGetApiMixV1MarketCandles(this.extend(d,a)),this.parseOHLCVs(f,n,t,i,s)}throw new r.NotSupported(this.id+" "+o+"() is not supported for "+n.type+" type of markets")}parseOHLCV(e,t=void 0){return[this.safeInteger2(e,"ts",0),this.safeNumber2(e,"open",1),this.safeNumber2(e,"high",2),this.safeNumber2(e,"low",3),this.safeNumber2(e,"close",4),this.safeNumber2(e,"baseVol",5)]}async fetchTrades(e,t=void 0,i=void 0,s={}){const a="fetchTrades";await this.loadMarkets();const o=this.market(e),n={symbol:o.id};let d;[d,s]=this.handleOptionAndParams(s,a,"until");let h,c=i;if(void 0===t&&void 0===d||(c=1e3,void 0!==t&&(n.startTime=t),void 0!==d&&(n.endTime=d)),void 0!==c&&(n.limit=c),o.spot)h=await this.publicGetApiSpotV1MarketFillsHistory(this.extend(n,s));else{if(!o.swap)throw new r.NotSupported(this.id+" "+a+"() is not supported for "+o.type+" type of markets");h=await this.publicGetApiMixV1MarketFillsHistory(this.extend(n,s))}const l=this.safeList(h,"data",[]);return this.parseTrades(l,o,t,i)}parseTrade(e,t=void 0){const i=this.safeString(e,"symbol");t=this.safeMarketCustom(i,t);const s=this.safeIntegerN(e,["fillTime","timestamp","cTime"]),r=this.safeString2(e,"fees","fee");let o;void 0!==r&&(o=a.Y.stringAbs(r));let n=this.safeString(e,"feeCcy");void 0===n&&void 0!==t.settle&&(n=t.settle);const d=this.safeStringLower2(e,"tradeSide","side");return this.safeTrade({id:this.safeString2(e,"tradeId","fillId"),order:this.safeString(e,"orderId"),timestamp:s,datetime:this.iso8601(s),symbol:t.symbol,type:this.safeString(e,"orderType"),side:this.parseOrderSide(d),takerOrMaker:this.safeString(e,"takerMakerFlag"),price:this.safeString2(e,"fillPrice","price"),amount:this.safeStringN(e,["fillQuantity","size","sizeQty"]),cost:this.safeString2(e,"fillTotalAmount","fillAmount"),fee:{cost:o,currency:n},info:e},t)}async fetchFundingRate(e,t={}){await this.loadMarkets();const i=this.market(e),s=i.id,r=s.split("_"),a={symbol:s,productType:this.safeString(r,1)},o=await this.publicGetApiMixV1MarketCurrentFundRate(this.extend(a,t)),n=this.safeDict(o,"data",{});return this.parseFundingRate(n,i)}parseFundingRate(e,t=void 0){const i=this.safeString(e,"symbol");t=this.safeMarketCustom(i,t);const s=this.safeNumber(e,"fundingRate");return{info:e,symbol:t.symbol,markPrice:void 0,indexPrice:void 0,interestRate:void 0,estimatedSettlePrice:void 0,timestamp:void 0,datetime:void 0,fundingRate:s,fundingTimestamp:void 0,fundingDatetime:void 0,nextFundingRate:void 0,nextFundingTimestamp:void 0,nextFundingDatetime:void 0,previousFundingRate:void 0,previousFundingTimestamp:void 0,previousFundingDatetime:void 0}}handleOptionParamsAndRequest(e,t,i,s,r,a=void 0){const[o,n]=this.handleOptionAndParams(e,t,i,a);return void 0!==o&&(s[r]=o),[s,n]}async fetchFundingRateHistory(e=void 0,t=void 0,i=void 0,s={}){if(void 0===e)throw new r.ArgumentsRequired(this.id+" fetchFundingRateHistory() requires a symbol argument");await this.loadMarkets();const a=this.market(e),o={symbol:a.id};let n=i;void 0!==t&&(n=100),void 0!==n&&(o.pageSize=n);const d=await this.publicGetApiMixV1MarketHistoryFundRate(this.extend(o,s)),h=this.safeList(d,"data",[]),c=[];for(let e=0;e1)for(let e=0;e1)throw new r.BadSymbol(this.id+" "+i+"() requires all symbols to belong to the same product type (umcbl or dmcbl)");s=a[0]}else[s,t]=this.handleOptionAndParams(t,i,"productType",s);const a={productType:s};if("dmcbl"===s){let e;if([e,t]=this.handleOptionAndParams(t,i,"marginCoin"),void 0!==e){const t=this.currency(e);a.marginCoin=t.id}}const o=await this.privateGetApiMixV1PositionAllPositionV2(this.extend(a,t)),n=this.safeList(o,"data",[]);return this.parsePositions(n,e)}parsePosition(e,t=void 0){const i=this.safeString(e,"symbol"),s=this.safeString(e,"marginCoin");t=this.safeMarketCustom(i,t,s);const r=this.safeInteger(e,"cTime"),o=this.safeString(e,"marginMode");let n;const d=this.safeString(e,"holdMode");"double_hold"===d?n=!0:"single_hold"===d&&(n=!1);const h=this.safeNumber(e,"margin"),c=this.safeString(e,"keepMarginRate");return this.safePosition({symbol:t.symbol,id:void 0,timestamp:r,datetime:this.iso8601(r),contracts:this.safeNumber(e,"total"),contractSize:void 0,side:this.safeStringLower(e,"holdSide"),notional:h,leverage:this.safeInteger(e,"leverage"),unrealizedPnl:this.safeNumber(e,"unrealizedPL"),realizedPnl:this.safeNumber(e,"achievedProfits"),collateral:void 0,entryPrice:this.safeNumber(e,"averageOpenPrice"),markPrice:this.safeNumber(e,"marketPrice"),liquidationPrice:this.safeNumber(e,"liquidationPrice"),marginMode:this.parseMarginModeType(o),hedged:n,maintenanceMargin:void 0,maintenanceMarginPercentage:this.parseNumber(a.Y.stringMul(c,"100")),initialMargin:h,initialMarginPercentage:void 0,marginRatio:this.safeNumber(e,"marginRatio"),lastUpdateTimestamp:this.safeInteger(e,"uTime"),lastPrice:void 0,stopLossPrice:void 0,takeProfitPrice:void 0,percentage:void 0,info:e})}safeMarketCustom(e,t=void 0,i=void 0){try{t=this.safeMarket(e,t)}catch(s){const r=this.safeList(this.markets_by_id,e,[]);if(void 0===i)t=r[0];else for(let e=0;e=0){const e=this.safeDict(n,"data",{}),t=this.safeList2(e,"failure","fail_infos",[]);if(!this.isEmpty(t)){f=!1;const e=this.safeDict(t,0,{});u=this.safeString(e,"errorCode"),c=this.safeString(e,"errorMsg")}}if(!f)throw this.throwExactlyMatchedException(this.exceptions.exact,u,l),this.throwBroadlyMatchedException(this.exceptions.broad,c,l),new r.ExchangeError(l)}sign(e,t="public",i="GET",s={},r=void 0,a=void 0){let o="/"+e;if("GET"===i){const e=this.urlencode(s);0!==e.length&&(o+="?"+e)}if("private"===t){this.checkRequiredCredentials();const e=this.numberToString(this.milliseconds());let t="";"GET"!==i&&(t=a=this.json(s));const d=e+i+o+t,h=this.hmac(this.encode(d),this.encode(this.secret),n.s,"base64");r={"ACCESS-KEY":this.apiKey,"ACCESS-SIGN":h,"ACCESS-TIMESTAMP":e,"ACCESS-PASSPHRASE":this.password,"Content-Type":"application/json","X-CHANNEL-API-CODE":this.safeString(this.options,"brokerId","47cfy")}}return{url:this.urls.api[t]+o,method:i,body:a,headers:r}}}},2741:(e,t,i)=>{i.d(t,{A:()=>n});var s=i(2938),r=i(2079),a=i(1579),o=i(4852);class n extends s.A{describe(){return this.deepExtend(super.describe(),{id:"coincheck",name:"coincheck",countries:["JP","ID"],rateLimit:1500,has:{CORS:void 0,spot:!0,margin:!1,swap:!1,future:!1,option:!1,addMargin:!1,borrowCrossMargin:!1,borrowIsolatedMargin:!1,borrowMargin:!1,cancelOrder:!0,closeAllPositions:!1,closePosition:!1,createOrder:!0,createOrderWithTakeProfitAndStopLoss:!1,createOrderWithTakeProfitAndStopLossWs:!1,createPostOnlyOrder:!1,createReduceOnlyOrder:!1,fetchBalance:!0,fetchBorrowInterest:!1,fetchBorrowRate:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchBorrowRates:!1,fetchBorrowRatesPerSymbol:!1,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchDeposits:!0,fetchFundingHistory:!1,fetchFundingInterval:!1,fetchFundingIntervals:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchGreeks:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchIsolatedPositions:!1,fetchLeverage:!1,fetchLeverages:!1,fetchLeverageTiers:!1,fetchLiquidations:!1,fetchLongShortRatio:!1,fetchLongShortRatioHistory:!1,fetchMarginAdjustmentHistory:!1,fetchMarginMode:!1,fetchMarginModes:!1,fetchMarketLeverageTiers:!1,fetchMarkOHLCV:!1,fetchMarkPrices:!1,fetchMyLiquidations:!1,fetchMySettlementHistory:!1,fetchMyTrades:!0,fetchOpenInterest:!1,fetchOpenInterestHistory:!1,fetchOpenInterests:!1,fetchOpenOrders:!0,fetchOption:!1,fetchOptionChain:!1,fetchOrderBook:!0,fetchPosition:!1,fetchPositionHistory:!1,fetchPositionMode:!1,fetchPositions:!1,fetchPositionsForSymbol:!1,fetchPositionsHistory:!1,fetchPositionsRisk:!1,fetchPremiumIndexOHLCV:!1,fetchSettlementHistory:!1,fetchTicker:!0,fetchTrades:!0,fetchTradingFee:!1,fetchTradingFees:!0,fetchVolatilityHistory:!1,fetchWithdrawals:!0,reduceMargin:!1,repayCrossMargin:!1,repayIsolatedMargin:!1,repayMargin:!1,setLeverage:!1,setMargin:!1,setMarginMode:!1,setPositionMode:!1,ws:!0},urls:{logo:"https://user-images.githubusercontent.com/51840849/87182088-1d6d6380-c2ec-11ea-9c64-8ab9f9b289f5.jpg",api:{rest:"https://coincheck.com/api"},www:"https://coincheck.com",doc:"https://coincheck.com/documents/exchange/api",fees:["https://coincheck.com/exchange/fee","https://coincheck.com/info/fee"]},api:{public:{get:["exchange/orders/rate","order_books","rate/{pair}","ticker","trades"]},private:{get:["accounts","accounts/balance","accounts/leverage_balance","bank_accounts","deposit_money","exchange/orders/opens","exchange/orders/transactions","exchange/orders/transactions_pagination","exchange/leverage/positions","lending/borrows/matches","send_money","withdraws"],post:["bank_accounts","deposit_money/{id}/fast","exchange/orders","exchange/transfers/to_leverage","exchange/transfers/from_leverage","lending/borrows","lending/borrows/{id}/repay","send_money","withdraws"],delete:["bank_accounts/{id}","exchange/orders/{id}","withdraws/{id}"]}},markets:{"BTC/JPY":this.safeMarketStructure({id:"btc_jpy",symbol:"BTC/JPY",base:"BTC",quote:"JPY",baseId:"btc",quoteId:"jpy",type:"spot",spot:!0}),"ETC/JPY":this.safeMarketStructure({id:"etc_jpy",symbol:"ETC/JPY",base:"ETC",quote:"JPY",baseId:"etc",quoteId:"jpy",type:"spot",spot:!0}),"FCT/JPY":this.safeMarketStructure({id:"fct_jpy",symbol:"FCT/JPY",base:"FCT",quote:"JPY",baseId:"fct",quoteId:"jpy",type:"spot",spot:!0}),"MONA/JPY":this.safeMarketStructure({id:"mona_jpy",symbol:"MONA/JPY",base:"MONA",quote:"JPY",baseId:"mona",quoteId:"jpy",type:"spot",spot:!0}),"ETC/BTC":this.safeMarketStructure({id:"etc_btc",symbol:"ETC/BTC",base:"ETC",quote:"BTC",baseId:"etc",quoteId:"btc",type:"spot",spot:!0})},features:{spot:{sandbox:!1,createOrder:{marginMode:!1,triggerPrice:!1,triggerPriceType:void 0,triggerDirection:!1,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!1,FOK:!1,PO:!0,GTD:!1},hedged:!1,trailing:!1,leverage:!1,marketBuyByCost:!1,marketBuyRequiresPrice:!1,selfTradePrevention:!1,iceberg:!1},createOrders:void 0,fetchMyTrades:{marginMode:!1,limit:void 0,daysBack:void 0,untilDays:void 0,symbolRequired:!0},fetchOrder:void 0,fetchOpenOrders:{marginMode:!1,limit:void 0,trigger:!1,trailing:!1,symbolRequired:!1},fetchOrders:void 0,fetchClosedOrders:void 0,fetchOHLCV:void 0},swap:{linear:void 0,inverse:void 0},future:{linear:void 0,inverse:void 0}},fees:{trading:{tierBased:!1,percentage:!0,maker:this.parseNumber("0"),taker:this.parseNumber("0")}},precisionMode:a.kb,exceptions:{exact:{"disabled API Key":r.AuthenticationError,"invalid authentication":r.AuthenticationError},broad:{}}})}parseBalance(e){const t={info:e},i=Object.keys(this.currencies);for(let s=0;s{i.d(t,{A:()=>h});var s=i(5277),r=i(2079),a=i(5147),o=i(1579),n=i(4852),d=i(4035);class h extends s.A{describe(){return this.deepExtend(super.describe(),{id:"coinex",name:"CoinEx",version:"v2",countries:["CN"],rateLimit:2.5,pro:!0,certified:!0,has:{CORS:void 0,spot:!0,margin:!0,swap:!0,future:!1,option:!1,addMargin:!0,borrowCrossMargin:!1,borrowIsolatedMargin:!0,cancelAllOrders:!0,cancelOrder:!0,cancelOrders:!0,closeAllPositions:!1,closePosition:!0,createDepositAddress:!0,createMarketBuyOrderWithCost:!0,createMarketOrderWithCost:!1,createMarketSellOrderWithCost:!1,createOrder:!0,createOrders:!0,createReduceOnlyOrder:!0,createStopLossOrder:!0,createStopOrder:!0,createTakeProfitOrder:!0,createTriggerOrder:!0,editOrder:!0,fetchBalance:!0,fetchBorrowInterest:!0,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchClosedOrders:!0,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!0,fetchDepositAddress:!0,fetchDepositAddresses:!1,fetchDepositAddressesByNetwork:!1,fetchDeposits:!0,fetchDepositWithdrawFee:!0,fetchDepositWithdrawFees:!0,fetchFundingHistory:!0,fetchFundingInterval:!0,fetchFundingIntervals:!1,fetchFundingRate:!0,fetchFundingRateHistory:!0,fetchFundingRates:!0,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!0,fetchIsolatedBorrowRates:!1,fetchLeverage:!0,fetchLeverages:!1,fetchLeverageTiers:!0,fetchMarginAdjustmentHistory:!0,fetchMarketLeverageTiers:"emulated",fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenOrders:!0,fetchOrder:!0,fetchOrderBook:!0,fetchPosition:!0,fetchPositionHistory:!0,fetchPositions:!0,fetchPositionsHistory:!1,fetchPositionsRisk:!1,fetchPremiumIndexOHLCV:!1,fetchTicker:!0,fetchTickers:!0,fetchTime:!0,fetchTrades:!0,fetchTradingFee:!0,fetchTradingFees:!0,fetchTransfer:!1,fetchTransfers:!0,fetchWithdrawal:!1,fetchWithdrawals:!0,reduceMargin:!0,repayCrossMargin:!1,repayIsolatedMargin:!0,setLeverage:!0,setMarginMode:!0,setPositionMode:!1,transfer:!0,withdraw:!0},timeframes:{"1m":"1min","3m":"3min","5m":"5min","15m":"15min","30m":"30min","1h":"1hour","2h":"2hour","4h":"4hour","6h":"6hour","12h":"12hour","1d":"1day","3d":"3day","1w":"1week"},urls:{logo:"https://user-images.githubusercontent.com/51840849/87182089-1e05fa00-c2ec-11ea-8da9-cc73b45abbbc.jpg",api:{public:"https://api.coinex.com",private:"https://api.coinex.com",perpetualPublic:"https://api.coinex.com/perpetual",perpetualPrivate:"https://api.coinex.com/perpetual"},www:"https://www.coinex.com",doc:"https://docs.coinex.com/api/v2",fees:"https://www.coinex.com/fees",referral:"https://www.coinex.com/register?refer_code=yw5fz"},api:{v1:{public:{get:{"amm/market":1,"common/currency/rate":1,"common/asset/config":1,"common/maintain/info":1,"common/temp-maintain/info":1,"margin/market":1,"market/info":1,"market/list":1,"market/ticker":1,"market/ticker/all":1,"market/depth":1,"market/deals":1,"market/kline":1,"market/detail":1}},private:{get:{"account/amm/balance":40,"account/investment/balance":40,"account/balance/history":40,"account/market/fee":40,"balance/coin/deposit":40,"balance/coin/withdraw":40,"balance/info":40,"balance/deposit/address/{coin_type}":40,"contract/transfer/history":40,"credit/info":40,"credit/balance":40,"investment/transfer/history":40,"margin/account":1,"margin/config":1,"margin/loan/history":40,"margin/transfer/history":40,"order/deals":40,"order/finished":40,"order/pending":8,"order/status":8,"order/status/batch":8,"order/user/deals":40,"order/stop/finished":40,"order/stop/pending":8,"order/user/trade/fee":1,"order/market/trade/info":1,"sub_account/balance":1,"sub_account/transfer/history":40,"sub_account/auth/api":40,"sub_account/auth/api/{user_auth_id}":40},post:{"balance/coin/withdraw":40,"contract/balance/transfer":40,"margin/flat":40,"margin/loan":40,"margin/transfer":40,"order/limit/batch":40,"order/ioc":13.334,"order/limit":13.334,"order/market":13.334,"order/modify":13.334,"order/stop/limit":13.334,"order/stop/market":13.334,"order/stop/modify":13.334,"sub_account/transfer":40,"sub_account/register":1,"sub_account/unfrozen":40,"sub_account/frozen":40,"sub_account/auth/api":40},put:{"balance/deposit/address/{coin_type}":40,"sub_account/unfrozen":40,"sub_account/frozen":40,"sub_account/auth/api/{user_auth_id}":40,"v1/account/settings":40},delete:{"balance/coin/withdraw":40,"order/pending/batch":40,"order/pending":13.334,"order/stop/pending":40,"order/stop/pending/{id}":13.334,"order/pending/by_client_id":40,"order/stop/pending/by_client_id":40,"sub_account/auth/api/{user_auth_id}":40,"sub_account/authorize/{id}":40}},perpetualPublic:{get:{ping:1,time:1,"market/list":1,"market/limit_config":1,"market/ticker":1,"market/ticker/all":1,"market/depth":1,"market/deals":1,"market/funding_history":1,"market/kline":1}},perpetualPrivate:{get:{"market/user_deals":1,"asset/query":40,"order/pending":8,"order/finished":40,"order/stop_finished":40,"order/stop_pending":8,"order/status":8,"order/stop_status":8,"position/finished":40,"position/pending":40,"position/funding":40,"position/adl_history":40,"market/preference":40,"position/margin_history":40,"position/settle_history":40},post:{"market/adjust_leverage":1,"market/position_expect":1,"order/put_limit":20,"order/put_market":20,"order/put_stop_limit":20,"order/put_stop_market":20,"order/modify":20,"order/modify_stop":20,"order/cancel":20,"order/cancel_all":40,"order/cancel_batch":40,"order/cancel_stop":20,"order/cancel_stop_all":40,"order/close_limit":20,"order/close_market":20,"position/adjust_margin":20,"position/stop_loss":20,"position/take_profit":20,"position/market_close":20,"order/cancel/by_client_id":20,"order/cancel_stop/by_client_id":20,"market/preference":20}}},v2:{public:{get:{"maintain/info":1,ping:1,time:1,"spot/market":1,"spot/ticker":1,"spot/depth":1,"spot/deals":1,"spot/kline":1,"spot/index":1,"futures/market":1,"futures/ticker":1,"futures/depth":1,"futures/deals":1,"futures/kline":1,"futures/index":1,"futures/funding-rate":1,"futures/funding-rate-history":1,"futures/position-level":1,"futures/liquidation-history":1,"futures/basis-history":1,"assets/deposit-withdraw-config":1,"assets/all-deposit-withdraw-config":1}},private:{get:{"account/subs":1,"account/subs/api-detail":40,"account/subs/info":1,"account/subs/api":40,"account/subs/transfer-history":40,"account/subs/spot-balance":1,"account/trade-fee-rate":40,"assets/spot/balance":40,"assets/futures/balance":40,"assets/margin/balance":1,"assets/financial/balance":40,"assets/amm/liquidity":40,"assets/credit/info":40,"assets/margin/borrow-history":40,"assets/margin/interest-limit":1,"assets/deposit-address":40,"assets/deposit-history":40,"assets/withdraw":40,"assets/transfer-history":40,"spot/order-status":8,"spot/batch-order-status":8,"spot/pending-order":8,"spot/finished-order":40,"spot/pending-stop-order":8,"spot/finished-stop-order":40,"spot/user-deals":40,"spot/order-deals":40,"futures/order-status":8,"futures/batch-order-status":1,"futures/pending-order":8,"futures/finished-order":40,"futures/pending-stop-order":8,"futures/finished-stop-order":40,"futures/user-deals":1,"futures/order-deals":1,"futures/pending-position":40,"futures/finished-position":1,"futures/position-margin-history":1,"futures/position-funding-history":40,"futures/position-adl-history":1,"futures/position-settle-history":1},post:{"account/subs":40,"account/subs/frozen":40,"account/subs/unfrozen":40,"account/subs/api":40,"account/subs/edit-api":40,"account/subs/delete-api":40,"account/subs/transfer":40,"account/settings":40,"assets/margin/borrow":40,"assets/margin/repay":40,"assets/renewal-deposit-address":40,"assets/withdraw":40,"assets/cancel-withdraw":40,"assets/transfer":40,"assets/amm/add-liquidity":1,"assets/amm/remove-liquidity":1,"spot/order":13.334,"spot/stop-order":13.334,"spot/batch-order":40,"spot/batch-stop-order":1,"spot/modify-order":13.334,"spot/modify-stop-order":13.334,"spot/cancel-all-order":1,"spot/cancel-order":6.667,"spot/cancel-stop-order":6.667,"spot/cancel-batch-order":10,"spot/cancel-batch-stop-order":10,"spot/cancel-order-by-client-id":1,"spot/cancel-stop-order-by-client-id":1,"futures/order":20,"futures/stop-order":20,"futures/batch-order":1,"futures/batch-stop-order":1,"futures/modify-order":20,"futures/modify-stop-order":20,"futures/cancel-all-order":1,"futures/cancel-order":10,"futures/cancel-stop-order":10,"futures/cancel-batch-order":20,"futures/cancel-batch-stop-order":20,"futures/cancel-order-by-client-id":1,"futures/cancel-stop-order-by-client-id":1,"futures/close-position":20,"futures/adjust-position-margin":20,"futures/adjust-position-leverage":20,"futures/set-position-stop-loss":20,"futures/set-position-take-profit":20}}}},fees:{trading:{maker:.001,taker:.001},funding:{withdraw:{BCH:0,BTC:.001,LTC:.001,ETH:.001,ZEC:1e-4,DASH:1e-4}}},limits:{amount:{min:.001,max:void 0}},options:{brokerId:"x-167673045",createMarketBuyOrderRequiresPrice:!0,defaultType:"spot",defaultSubType:"linear",fetchDepositAddress:{fillResponseFromRequest:!0},accountsByType:{spot:"SPOT",margin:"MARGIN",swap:"FUTURES"},accountsById:{SPOT:"spot",MARGIN:"margin",FUTURES:"swap"},networks:{BTC:"BTC",BEP20:"BSC",TRC20:"TRC20",ERC20:"ERC20",BRC20:"BRC20",SOL:"SOL",TON:"TON",BSV:"BSV",AVAXC:"AVA_C",AVAXX:"AVA",SUI:"SUI",ACA:"ACA",CHZ:"CHILIZ",ADA:"ADA",ARB:"ARBITRUM",ARBNOVA:"ARBITRUM_NOVA",OP:"OPTIMISM",APT:"APTOS",ATOM:"ATOM",FTM:"FTM",BCH:"BCH",ASTR:"ASTR",LTC:"LTC",MATIC:"MATIC",CRONOS:"CRONOS",DASH:"DASH",DOT:"DOT",ETC:"ETC",ETHW:"ETHPOW",FIL:"FIL",ZIL:"ZIL",DOGE:"DOGE",TIA:"CELESTIA",SEI:"SEI",XRP:"XRP",XMR:"XMR"}},features:{spot:{sandbox:!1,createOrder:{marginMode:!0,triggerPrice:!0,triggerPriceType:void 0,triggerDirection:!1,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!0,FOK:!0,PO:!0,GTD:!1},hedged:!1,trailing:!1,leverage:!1,marketBuyByCost:!0,marketBuyRequiresPrice:!0,selfTradePrevention:!0,iceberg:!0},createOrders:{max:5},fetchMyTrades:{marginMode:!0,limit:1e3,daysBack:void 0,untilDays:1e5,symbolRequired:!0},fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!0},fetchOpenOrders:{marginMode:!0,limit:1e3,trigger:!0,trailing:!1,symbolRequired:!1},fetchOrders:void 0,fetchClosedOrders:{marginMode:!0,limit:1e3,daysBack:void 0,daysBackCanceled:void 0,untilDays:void 0,trigger:!0,trailing:!1,symbolRequired:!1},fetchOHLCV:{limit:1e3}},forDerivatives:{extends:"spot",createOrder:{marginMode:!0,stopLossPrice:!0,takeProfitPrice:!0},fetchOpenOrders:{marginMode:!1},fetchClosedOrders:{marginMode:!1}},swap:{linear:{extends:"forDerivatives"},inverse:{extends:"forDerivatives"}},future:{linear:void 0,inverse:void 0}},commonCurrencies:{ACM:"Actinium"},precisionMode:o.kb,exceptions:{exact:{23:r.PermissionDenied,24:r.AuthenticationError,25:r.AuthenticationError,34:r.AuthenticationError,35:r.ExchangeNotAvailable,36:r.RequestTimeout,213:r.RateLimitExceeded,107:r.InsufficientFunds,158:r.PermissionDenied,600:r.OrderNotFound,601:r.InvalidOrder,602:r.InvalidOrder,606:r.InvalidOrder,3008:r.RequestTimeout,3109:r.InsufficientFunds,3127:r.InvalidOrder,3600:r.OrderNotFound,3606:r.InvalidOrder,3610:r.ExchangeError,3612:r.InvalidOrder,3613:r.InvalidOrder,3614:r.InvalidOrder,3615:r.InvalidOrder,3616:r.InvalidOrder,3617:r.InvalidOrder,3618:r.InvalidOrder,3619:r.InvalidOrder,3620:r.InvalidOrder,3621:r.InvalidOrder,3622:r.InvalidOrder,3627:r.InvalidOrder,3628:r.InvalidOrder,3629:r.InvalidOrder,3632:r.InvalidOrder,3633:r.InvalidOrder,3634:r.InvalidOrder,3635:r.InvalidOrder,4001:r.ExchangeNotAvailable,4002:r.RequestTimeout,4003:r.ExchangeError,4004:r.BadRequest,4005:r.AuthenticationError,4006:r.AuthenticationError,4007:r.PermissionDenied,4008:r.AuthenticationError,4009:r.ExchangeError,4010:r.ExchangeError,4011:r.PermissionDenied,4017:r.ExchangeError,4115:r.AccountSuspended,4117:r.BadSymbol,4123:r.RateLimitExceeded,4130:r.ExchangeError,4158:r.ExchangeError,4213:r.RateLimitExceeded,4512:r.PermissionDenied},broad:{"ip not allow visit":r.PermissionDenied,"service too busy":r.ExchangeNotAvailable,"Service is not available during funding fee settlement":r.OperationFailed}}})}async fetchCurrencies(e={}){const t=await this.v2PublicGetAssetsAllDepositWithdrawConfig(e),i=this.safeList(t,"data",[]),s={};for(let e=0;e1&&"cfx"!==s[0]?(r=s[0],a=s[1]):r=i,{info:e,currency:this.safeCurrencyCode(void 0,t),network:void 0,address:r,tag:this.safeString(e,"memo",a)}}async fetchMyTrades(e=void 0,t=void 0,i=void 0,s={}){if(void 0===e)throw new r.ArgumentsRequired(this.id+" fetchMyTrades() requires a symbol argument");await this.loadMarkets();const a=this.market(e);let o,n={market:a.id};if(void 0!==i&&(n.limit=i),void 0!==t&&(n.start_time=t),[n,s]=this.handleUntilOption("end_time",n,s),a.swap)n.market_type="FUTURES",o=await this.v2PrivateGetFuturesUserDeals(this.extend(n,s));else{let e;[e,s]=this.handleMarginModeAndParams("fetchMyTrades",s),n.market_type=void 0!==e?"MARGIN":"SPOT",o=await this.v2PrivateGetSpotUserDeals(this.extend(n,s))}const d=this.safeList(o,"data",[]);return this.parseTrades(d,a,t,i)}async fetchPositions(e=void 0,t={}){let i;await this.loadMarkets(),[i,t]=this.handleOptionAndParams(t,"fetchPositions","method","v2PrivateGetFuturesPendingPosition");const s={market_type:"FUTURES"};let a,o;if(void 0!==(e=this.marketSymbols(e))){let t;if(Array.isArray(e)){if(e.length>1)throw new r.BadRequest(this.id+" fetchPositions() symbols argument cannot contain more than 1 symbol");t=e[0]}else t=e;a=this.market(t),s.market=a.id}o="v2PrivateGetFuturesPendingPosition"===i?await this.v2PrivateGetFuturesPendingPosition(this.extend(s,t)):await this.v2PrivateGetFuturesFinishedPosition(this.extend(s,t));const n=this.safeList(o,"data",[]),d=[];for(let e=0;eo)throw new r.BadRequest(this.id+" setMarginMode() leverage should be between 1 and "+o.toString()+" for "+t);const n={market:s.id,market_type:"FUTURES",margin_mode:e,leverage:a};return await this.v2PrivatePostFuturesAdjustPositionLeverage(this.extend(n,i))}async setLeverage(e,t=void 0,i={}){if(void 0===t)throw new r.ArgumentsRequired(this.id+" setLeverage() requires a symbol argument");await this.loadMarkets();const s=this.market(t);if(!s.swap)throw new r.BadSymbol(this.id+" setLeverage() supports swap contracts only");let a;[a,i]=this.handleMarginModeAndParams("setLeverage",i,"cross");const o=this.safeInteger(s.limits.leverage,"min",1),n=this.safeInteger(s.limits.leverage,"max",100);if(en)throw new r.BadRequest(this.id+" setLeverage() leverage should be between "+o.toString()+" and "+n.toString()+" for "+t);const d={market:s.id,market_type:"FUTURES",margin_mode:a,leverage:e};return await this.v2PrivatePostFuturesAdjustPositionLeverage(this.extend(d,i))}async fetchLeverageTiers(e=void 0,t={}){await this.loadMarkets();const i={};if(void 0!==e){const t=this.marketIds(e);i.market=t.join(",")}const s=await this.v2PublicGetFuturesPositionLevel(this.extend(i,t)),r=this.safeList(s,"data",[]);return this.parseLeverageTiers(r,e,"market")}parseMarketLeverageTiers(e,t=void 0){const i=[],s=this.safeList(e,"level",[]);let r=0;for(let a=0;a{i.d(t,{A:()=>d});var s=i(8109),r=i(2079),a=i(5147),o=i(1579),n=i(4852);class d extends s.A{describe(){return this.deepExtend(super.describe(),{id:"coinmate",name:"CoinMate",countries:["GB","CZ","EU"],rateLimit:600,has:{CORS:!0,spot:!0,margin:!1,swap:!1,future:!1,option:!1,addMargin:!1,borrowCrossMargin:!1,borrowIsolatedMargin:!1,borrowMargin:!1,cancelOrder:!0,closeAllPositions:!1,closePosition:!1,createOrder:!0,createOrderWithTakeProfitAndStopLoss:!1,createOrderWithTakeProfitAndStopLossWs:!1,createPostOnlyOrder:!1,createReduceOnlyOrder:!1,fetchBalance:!0,fetchBorrowInterest:!1,fetchBorrowRate:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchBorrowRates:!1,fetchBorrowRatesPerSymbol:!1,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchDepositsWithdrawals:!0,fetchFundingHistory:!1,fetchFundingInterval:!1,fetchFundingIntervals:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchGreeks:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchIsolatedPositions:!1,fetchLeverage:!1,fetchLeverages:!1,fetchLeverageTiers:!1,fetchLiquidations:!1,fetchLongShortRatio:!1,fetchLongShortRatioHistory:!1,fetchMarginAdjustmentHistory:!1,fetchMarginMode:!1,fetchMarginModes:!1,fetchMarketLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMarkPrices:!1,fetchMyLiquidations:!1,fetchMySettlementHistory:!1,fetchMyTrades:!0,fetchOpenInterest:!1,fetchOpenInterestHistory:!1,fetchOpenInterests:!1,fetchOpenOrders:!0,fetchOption:!1,fetchOptionChain:!1,fetchOrder:!0,fetchOrderBook:!0,fetchOrders:!0,fetchPosition:!1,fetchPositionHistory:!1,fetchPositionMode:!1,fetchPositions:!1,fetchPositionsForSymbol:!1,fetchPositionsHistory:!1,fetchPositionsRisk:!1,fetchPremiumIndexOHLCV:!1,fetchSettlementHistory:!1,fetchTicker:!0,fetchTickers:!0,fetchTrades:!0,fetchTradingFee:!0,fetchTradingFees:!1,fetchTransactions:"emulated",fetchVolatilityHistory:!1,reduceMargin:!1,repayCrossMargin:!1,repayIsolatedMargin:!1,repayMargin:!1,setLeverage:!1,setMargin:!1,setMarginMode:!1,setPositionMode:!1,transfer:!1,withdraw:!0},urls:{logo:"https://user-images.githubusercontent.com/51840849/87460806-1c9f3f00-c616-11ea-8c46-a77018a8f3f4.jpg",api:{rest:"https://coinmate.io/api"},www:"https://coinmate.io",fees:"https://coinmate.io/fees",doc:["https://coinmate.docs.apiary.io","https://coinmate.io/developers"],referral:"https://coinmate.io?referral=YTFkM1RsOWFObVpmY1ZjMGREQmpTRnBsWjJJNVp3PT0"},requiredCredentials:{apiKey:!0,secret:!0,uid:!0},api:{public:{get:["orderBook","ticker","tickerAll","products","transactions","tradingPairs"]},private:{post:["balances","bitcoinCashWithdrawal","bitcoinCashDepositAddresses","bitcoinDepositAddresses","bitcoinWithdrawal","bitcoinWithdrawalFees","buyInstant","buyLimit","cancelOrder","cancelOrderWithInfo","createVoucher","dashDepositAddresses","dashWithdrawal","ethereumWithdrawal","ethereumDepositAddresses","litecoinWithdrawal","litecoinDepositAddresses","openOrders","order","orderHistory","orderById","pusherAuth","redeemVoucher","replaceByBuyLimit","replaceByBuyInstant","replaceBySellLimit","replaceBySellInstant","rippleDepositAddresses","rippleWithdrawal","sellInstant","sellLimit","transactionHistory","traderFees","tradeHistory","transfer","transferHistory","unconfirmedBitcoinDeposits","unconfirmedBitcoinCashDeposits","unconfirmedDashDeposits","unconfirmedEthereumDeposits","unconfirmedLitecoinDeposits","unconfirmedRippleDeposits","cancelAllOpenOrders","withdrawVirtualCurrency","virtualCurrencyDepositAddresses","unconfirmedVirtualCurrencyDeposits","adaWithdrawal","adaDepositAddresses","unconfirmedAdaDeposits","solWithdrawal","solDepositAddresses","unconfirmedSolDeposits"]}},fees:{trading:{tierBased:!0,percentage:!0,taker:this.parseNumber("0.006"),maker:this.parseNumber("0.004"),tiers:{taker:[[this.parseNumber("0"),this.parseNumber("0.006")],[this.parseNumber("10000"),this.parseNumber("0.003")],[this.parseNumber("100000"),this.parseNumber("0.0023")],[this.parseNumber("250000"),this.parseNumber("0.0021")],[this.parseNumber("500000"),this.parseNumber("0.0018")],[this.parseNumber("1000000"),this.parseNumber("0.0015")],[this.parseNumber("3000000"),this.parseNumber("0.0012")],[this.parseNumber("15000000"),this.parseNumber("0.001")]],maker:[[this.parseNumber("0"),this.parseNumber("0.004")],[this.parseNumber("10000"),this.parseNumber("0.002")],[this.parseNumber("100000"),this.parseNumber("0.0012")],[this.parseNumber("250000"),this.parseNumber("0.0009")],[this.parseNumber("500000"),this.parseNumber("0.0005")],[this.parseNumber("1000000"),this.parseNumber("0.0003")],[this.parseNumber("3000000"),this.parseNumber("0.0002")],[this.parseNumber("15000000"),this.parseNumber("-0.0004")]]}}},options:{withdraw:{fillResponsefromRequest:!0,methods:{BTC:"privatePostBitcoinWithdrawal",LTC:"privatePostLitecoinWithdrawal",BCH:"privatePostBitcoinCashWithdrawal",ETH:"privatePostEthereumWithdrawal",XRP:"privatePostRippleWithdrawal",DASH:"privatePostDashWithdrawal",DAI:"privatePostDaiWithdrawal",ADA:"privatePostAdaWithdrawal",SOL:"privatePostSolWithdrawal"}}},features:{spot:{sandbox:!1,createOrder:{marginMode:!1,triggerPrice:!0,triggerPriceType:void 0,triggerDirection:!1,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!0,FOK:!1,PO:!0,GTD:!1},hedged:!1,trailing:!0,leverage:!1,marketBuyByCost:!1,marketBuyRequiresPrice:!1,selfTradePrevention:!1,iceberg:!0},createOrders:void 0,fetchMyTrades:{marginMode:!1,limit:1e3,daysBack:1e5,untilDays:1e5,symbolRequired:!1},fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!1},fetchOpenOrders:{marginMode:!1,limit:void 0,trigger:!1,trailing:!1,symbolRequired:!0},fetchOrders:{marginMode:!1,limit:100,daysBack:void 0,untilDays:void 0,trigger:!1,trailing:!1,symbolRequired:!0},fetchClosedOrders:void 0,fetchOHLCV:void 0},swap:{linear:void 0,inverse:void 0},future:{linear:void 0,inverse:void 0}},exceptions:{exact:{"No order with given ID":r.OrderNotFound},broad:{"Not enough account balance available":r.InsufficientFunds,"Incorrect order ID":r.InvalidOrder,"Minimum Order Size ":r.InvalidOrder,"max allowed precision":r.InvalidOrder,"TOO MANY REQUESTS":r.RateLimitExceeded,"Access denied.":r.AuthenticationError}},precisionMode:o.kb})}async fetchMarkets(e={}){const t=await this.publicGetTradingPairs(e),i=this.safeValue(t,"data",[]),s=[];for(let e=0;e{i.d(t,{A:()=>n});var s=i(1671),r=i(2079),a=i(1579),o=i(5147);class n extends s.A{describe(){return this.deepExtend(super.describe(),{id:"coinmetro",name:"Coinmetro",countries:["EE"],version:"v1",rateLimit:200,certified:!1,pro:!1,has:{CORS:void 0,spot:!0,margin:!0,swap:!1,future:!1,option:!1,addMargin:!1,borrowCrossMargin:!0,borrowIsolatedMargin:!1,cancelAllOrders:!1,cancelOrder:!0,cancelOrders:!1,closeAllPositions:!1,closePosition:!0,createDepositAddress:!1,createOrder:!0,createPostOnlyOrder:!1,createReduceOnlyOrder:!1,createStopLimitOrder:!0,createStopMarketOrder:!0,createStopOrder:!0,deposit:!1,editOrder:!1,fetchAccounts:!1,fetchBalance:!0,fetchBidsAsks:!0,fetchBorrowInterest:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchCanceledAndClosedOrders:!0,fetchCanceledOrders:!1,fetchClosedOrder:!1,fetchClosedOrders:!1,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!0,fetchDeposit:!1,fetchDepositAddress:!1,fetchDepositAddresses:!1,fetchDepositAddressesByNetwork:!1,fetchDeposits:!1,fetchDepositsWithdrawals:!1,fetchDepositWithdrawFee:!1,fetchDepositWithdrawFees:!1,fetchFundingHistory:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchL3OrderBook:!1,fetchLedger:!0,fetchLeverage:!1,fetchLeverageTiers:!1,fetchMarketLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenInterestHistory:!1,fetchOpenOrder:!1,fetchOpenOrders:!0,fetchOrder:!0,fetchOrderBook:!0,fetchOrderBooks:!1,fetchOrders:!1,fetchOrderTrades:!1,fetchPosition:!1,fetchPositions:!1,fetchPositionsRisk:!1,fetchPremiumIndexOHLCV:!1,fetchStatus:!1,fetchTicker:!1,fetchTickers:!0,fetchTime:!1,fetchTrades:!0,fetchTradingFee:!1,fetchTradingFees:!1,fetchTradingLimits:!1,fetchTransactionFee:!1,fetchTransactionFees:!1,fetchTransactions:!1,fetchTransfers:!1,fetchWithdrawal:!1,fetchWithdrawals:!1,fetchWithdrawalWhitelist:!1,reduceMargin:!1,repayCrossMargin:!1,repayIsolatedMargin:!1,sandbox:!0,setLeverage:!1,setMargin:!1,setMarginMode:!1,setPositionMode:!1,signIn:!1,transfer:!1,withdraw:!1,ws:!1},timeframes:{"1m":"60000","5m":"300000","30m":"1800000","4h":"14400000","1d":"86400000"},urls:{logo:"https://github.com/ccxt/ccxt/assets/43336371/e86f87ec-6ba3-4410-962b-f7988c5db539",api:{public:"https://api.coinmetro.com",private:"https://api.coinmetro.com"},test:{public:"https://api.coinmetro.com/open",private:"https://api.coinmetro.com/open"},www:"https://coinmetro.com/",doc:["https://documenter.getpostman.com/view/3653795/SVfWN6KS"],fees:"https://help.coinmetro.com/hc/en-gb/articles/6844007317789-What-are-the-fees-on-Coinmetro-",referral:"https://go.coinmetro.com/?ref=crypto24"},api:{public:{get:{"demo/temp":1,"exchange/candles/{pair}/{timeframe}/{from}/{to}":3,"exchange/prices":1,"exchange/ticks/{pair}/{from}":3,assets:1,markets:1,"exchange/book/{pair}":3,"exchange/bookUpdates/{pair}/{from}":1}},private:{get:{"users/balances":1,"users/wallets":1,"users/wallets/history/{since}":1.67,"exchange/orders/status/{orderID}":1,"exchange/orders/active":1,"exchange/orders/history/{since}":1.67,"exchange/fills/{since}":1.67,"exchange/margin":1},post:{jwt:1,jwtDevice:1,devices:1,"jwt-read-only":1,"exchange/orders/create":1,"exchange/orders/modify/{orderID}":1,"exchange/swap":1,"exchange/swap/confirm/{swapId}":1,"exchange/orders/close/{orderID}":1,"exchange/orders/hedge":1},put:{jwt:1,"exchange/orders/cancel/{orderID}":1,"users/margin/collateral":1,"users/margin/primary/{currency}":1}}},requiredCredentials:{apiKey:!1,secret:!1,uid:!0,token:!0},fees:{trading:{feeSide:"get",tierBased:!1,percentage:!0,taker:this.parseNumber("0.001"),maker:this.parseNumber("0")}},precisionMode:a.kb,options:{currenciesByIdForParseMarket:void 0,currencyIdsListForParseMarket:["QRDO"]},features:{spot:{sandbox:!0,createOrder:{marginMode:!0,triggerPrice:!0,triggerPriceType:void 0,triggerDirection:!1,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:{triggerPriceType:void 0,price:!1},timeInForce:{IOC:!0,FOK:!0,PO:!1,GTD:!0},hedged:!1,trailing:!1,leverage:!1,marketBuyByCost:!0,marketBuyRequiresPrice:!1,selfTradePrevention:!1,iceberg:!0},createOrders:void 0,fetchMyTrades:{marginMode:!1,limit:void 0,daysBack:1e5,untilDays:void 0,symbolRequired:!1},fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!1},fetchOpenOrders:{marginMode:!1,limit:void 0,trigger:!1,trailing:!1,symbolRequired:!1},fetchOrders:{marginMode:!1,limit:void 0,daysBack:1e5,untilDays:void 0,trigger:!1,trailing:!1,symbolRequired:!1},fetchClosedOrders:void 0,fetchOHLCV:{limit:1e3}},swap:{linear:void 0,inverse:void 0},future:{linear:void 0,inverse:void 0}},exceptions:{exact:{"Both buyingCurrency and sellingCurrency are required":r.InvalidOrder,"One and only one of buyingQty and sellingQty is required":r.InvalidOrder,"Invalid buyingCurrency":r.InvalidOrder,"Invalid 'from'":r.BadRequest,"Invalid sellingCurrency":r.InvalidOrder,"Invalid buyingQty":r.InvalidOrder,"Invalid sellingQty":r.InvalidOrder,"Insufficient balance":r.InsufficientFunds,"Expiration date is in the past or too near in the future":r.InvalidOrder,Forbidden:r.PermissionDenied,"Order Not Found":r.OrderNotFound,"since must be a millisecond timestamp":r.BadRequest,"This pair is disabled on margin":r.BadSymbol},broad:{"accessing from a new IP":r.PermissionDenied,"available to allocate as collateral":r.InsufficientFunds,"At least":r.BadRequest,"collateral is not allowed":r.BadRequest,"Insufficient liquidity":r.InvalidOrder,"Insufficient order size":r.InvalidOrder,"Invalid quantity":r.InvalidOrder,"Invalid Stop Loss":r.InvalidOrder,"Invalid stop price!":r.InvalidOrder,"Not enough balance":r.InsufficientFunds,"Not enough margin":r.InsufficientFunds,"orderType missing":r.BadRequest,"Server Timeout":r.ExchangeError,"Time in force has to be IOC or FOK for market orders":r.InvalidOrder,"Too many attempts":r.RateLimitExceeded}}})}async fetchCurrencies(e={}){const t=await this.publicGetAssets(e),i={};for(let e=0;e1&&(t=this.parseLedgerEntryType(s[0]),i="-"!==s[1]?s[1]:this.safeString(s,2)),[t,i]}parseLedgerEntryType(e){return this.safeString({Deposit:"transaction",Withdraw:"transaction",Order:"trade"},e,e)}async createOrder(e,t,i,s,a=void 0,n={}){await this.loadMarkets();const d=this.market(e);let h,c={};c.orderType=t,void 0!==s&&(h=this.amountToPrecision(e,s));let l,u=this.safeValue(n,"cost");if(n=this.omit(n,"cost"),"limit"===t){if(void 0===a&&void 0===u)throw new r.ArgumentsRequired(this.id+" createOrder() requires a price or params.cost argument for a "+t+" order");if(void 0!==a&&void 0!==s){const e=o.Y.stringMul(this.numberToString(a),this.numberToString(h));u=this.parseToNumeric(e)}}void 0!==u&&(l=this.costToPrecision(e,u)),"sell"===i?c=this.handleCreateOrderSide(d.baseId,d.quoteId,h,l,c):"buy"===i&&(c=this.handleCreateOrderSide(d.quoteId,d.baseId,l,h,c));const f=this.safeValue(n,"timeInForce");void 0!==f&&(n=this.omit(n,"timeInForce"),c.timeInForce=this.encodeOrderTimeInForce(f));const p=this.safeString2(n,"triggerPrice","stopPrice");void 0!==p&&(n=this.omit(n,["triggerPrice"]),c.stopPrice=this.priceToPrecision(e,p));const m=this.safeValue(n,"userData",{}),g=this.safeString2(n,"clientOrderId","comment");void 0!==g&&(n=this.omit(n,["clientOrderId"]),m.comment=g);const v=this.safeString(n,"stopLossPrice");void 0!==v&&(n=this.omit(n,"stopLossPrice"),m.stopLoss=this.priceToPrecision(e,v));const y=this.safeString(n,"takeProfitPrice");void 0!==y&&(n=this.omit(n,"takeProfitPrice"),m.takeProfit=this.priceToPrecision(e,y)),this.isEmpty(m)||(c.userData=m);const w=await this.privatePostExchangeOrdersCreate(this.extend(c,n));return this.parseOrder(w,d)}handleCreateOrderSide(e,t,i,s,r={}){return r.sellingCurrency=e,r.buyingCurrency=t,void 0!==i&&(r.sellingQty=i),void 0!==s&&(r.buyingQty=s),r}encodeOrderTimeInForce(e){return this.safeValue({GTC:1,IOC:2,GTD:3,FOK:4},e,e)}async cancelOrder(e,t=void 0,i={}){await this.loadMarkets();const s={orderID:e};[i,i]=this.handleMarginModeAndParams("cancelOrder",i);const r=this.safeBool(i,"margin",!1);let a;return i=this.omit(i,"margin"),a=r?await this.privatePostExchangeOrdersCloseOrderID(this.extend(s,i)):await this.privatePutExchangeOrdersCancelOrderID(this.extend(s,i)),this.parseOrder(a)}async closePosition(e,t=void 0,i={}){await this.loadMarkets();const s=this.safeString(i,"orderId");if(void 0===s)throw new r.ArgumentsRequired(this.id+" closePosition() requires a orderId parameter");const a={orderID:s},o=await this.privatePostExchangeOrdersCloseOrderID(this.extend(a,i));return this.parseOrder(o)}async fetchOpenOrders(e=void 0,t=void 0,i=void 0,s={}){let r;await this.loadMarkets(),void 0!==e&&(r=this.market(e));const a=await this.privateGetExchangeOrdersActive(s),o=this.parseOrders(a,r,t,i);for(let e=0;e{i.d(t,{A:()=>d});var s=i(6658),r=i(2079),a=i(5147),o=i(1579),n=i(7481);class d extends s.A{describe(){return this.deepExtend(super.describe(),{id:"coinone",name:"CoinOne",countries:["KR"],rateLimit:50,version:"v2",pro:!1,has:{CORS:void 0,spot:!0,margin:!1,swap:!1,future:!1,option:!1,addMargin:!1,borrowCrossMargin:!1,borrowIsolatedMargin:!1,borrowMargin:!1,cancelOrder:!0,closeAllPositions:!1,closePosition:!1,createMarketOrder:!1,createOrder:!0,createOrderWithTakeProfitAndStopLoss:!1,createOrderWithTakeProfitAndStopLossWs:!1,createPostOnlyOrder:!1,createReduceOnlyOrder:!1,createStopLimitOrder:!1,createStopMarketOrder:!1,createStopOrder:!1,fetchBalance:!0,fetchBorrowInterest:!1,fetchBorrowRate:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchBorrowRates:!1,fetchBorrowRatesPerSymbol:!1,fetchClosedOrders:!1,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!0,fetchDepositAddress:!1,fetchDepositAddresses:!0,fetchDepositAddressesByNetwork:!1,fetchFundingHistory:!1,fetchFundingInterval:!1,fetchFundingIntervals:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchGreeks:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchIsolatedPositions:!1,fetchLeverage:!1,fetchLeverages:!1,fetchLeverageTiers:!1,fetchLiquidations:!1,fetchLongShortRatio:!1,fetchLongShortRatioHistory:!1,fetchMarginAdjustmentHistory:!1,fetchMarginMode:!1,fetchMarginModes:!1,fetchMarketLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMarkPrices:!1,fetchMyLiquidations:!1,fetchMySettlementHistory:!1,fetchMyTrades:!0,fetchOpenInterest:!1,fetchOpenInterestHistory:!1,fetchOpenInterests:!1,fetchOpenOrders:!0,fetchOption:!1,fetchOptionChain:!1,fetchOrder:!0,fetchOrderBook:!0,fetchPosition:!1,fetchPositionHistory:!1,fetchPositionMode:!1,fetchPositions:!1,fetchPositionsForSymbol:!1,fetchPositionsHistory:!1,fetchPositionsRisk:!1,fetchPremiumIndexOHLCV:!1,fetchSettlementHistory:!1,fetchTicker:!0,fetchTickers:!0,fetchTrades:!0,fetchVolatilityHistory:!1,reduceMargin:!1,repayCrossMargin:!1,repayIsolatedMargin:!1,repayMargin:!1,setLeverage:!1,setMargin:!1,setMarginMode:!1,setPositionMode:!1,ws:!0},urls:{logo:"https://user-images.githubusercontent.com/1294454/38003300-adc12fba-323f-11e8-8525-725f53c4a659.jpg",api:{rest:"https://api.coinone.co.kr",v2Public:"https://api.coinone.co.kr/public/v2",v2Private:"https://api.coinone.co.kr/v2",v2_1Private:"https://api.coinone.co.kr/v2.1"},www:"https://coinone.co.kr",doc:"https://doc.coinone.co.kr"},requiredCredentials:{apiKey:!0,secret:!0},api:{public:{get:["orderbook","ticker","ticker_utc","trades"]},v2Public:{get:["range_units","markets/{quote_currency}","markets/{quote_currency}/{target_currency}","orderbook/{quote_currency}/{target_currency}","trades/{quote_currency}/{target_currency}","ticker_new/{quote_currency}","ticker_new/{quote_currency}/{target_currency}","ticker_utc_new/{quote_currency}","ticker_utc_new/{quote_currency}/{target_currency}","currencies","currencies/{currency}","chart/{quote_currency}/{target_currency}"]},private:{post:["account/deposit_address","account/btc_deposit_address","account/balance","account/daily_balance","account/user_info","account/virtual_account","order/cancel_all","order/cancel","order/limit_buy","order/limit_sell","order/complete_orders","order/limit_orders","order/order_info","transaction/auth_number","transaction/history","transaction/krw/history","transaction/btc","transaction/coin"]},v2Private:{post:["account/balance","account/deposit_address","account/user_info","account/virtual_account","order/cancel","order/limit_buy","order/limit_sell","order/limit_orders","order/complete_orders","order/query_order","transaction/auth_number","transaction/btc","transaction/history","transaction/krw/history"]},v2_1Private:{post:["account/balance/all","account/balance","account/trade_fee","account/trade_fee/{quote_currency}/{target_currency}","order/limit","order/cancel","order/cancel/all","order/open_orders","order/open_orders/all","order/complete_orders","order/complete_orders/all","order/info","transaction/krw/history","transaction/coin/history","transaction/coin/withdrawal/limit"]}},fees:{trading:{tierBased:!1,percentage:!0,taker:.002,maker:.002}},features:{spot:{sandbox:!1,createOrder:{marginMode:!1,triggerPrice:!1,triggerPriceType:void 0,triggerDirection:!1,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!1,FOK:!1,PO:!1,GTD:!1},hedged:!1,trailing:!1,leverage:!1,marketBuyByCost:!1,marketBuyRequiresPrice:!1,selfTradePrevention:!1,iceberg:!1},createOrders:void 0,fetchMyTrades:{marginMode:!1,limit:100,daysBack:1e5,untilDays:1e5,symbolRequired:!0},fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!0},fetchOpenOrders:{marginMode:!1,limit:void 0,trigger:!1,trailing:!1,symbolRequired:!0},fetchOrders:void 0,fetchClosedOrders:void 0,fetchOHLCV:void 0},swap:{linear:void 0,inverse:void 0},future:{linear:void 0,inverse:void 0}},precisionMode:o.kb,exceptions:{104:r.OrderNotFound,107:r.BadRequest,108:r.BadSymbol,405:r.OnMaintenance},commonCurrencies:{SOC:"Soda Coin"}})}async fetchCurrencies(e={}){const t=await this.v2PublicGetCurrencies(e),i={},s=this.safeList(t,"currencies",[]);for(let e=0;e{i.d(t,{A:()=>d});var s=i(4935),r=i(2079),a=i(1579),o=i(5147),n=i(4852);class d extends s.A{describe(){return this.deepExtend(super.describe(),{id:"coinsph",name:"Coins.ph",countries:["PH"],version:"v1",rateLimit:50,certified:!1,pro:!1,has:{CORS:void 0,spot:!0,margin:!1,swap:!1,future:!1,option:!1,addMargin:!1,borrowCrossMargin:!1,borrowIsolatedMargin:!1,borrowMargin:!1,cancelAllOrders:!0,cancelOrder:!0,cancelOrders:!1,closeAllPositions:!1,closePosition:!1,createDepositAddress:!1,createMarketBuyOrderWithCost:!0,createMarketOrderWithCost:!1,createMarketSellOrderWithCost:!1,createOrder:!0,createOrderWithTakeProfitAndStopLoss:!1,createOrderWithTakeProfitAndStopLossWs:!1,createPostOnlyOrder:!1,createReduceOnlyOrder:!1,createStopLimitOrder:!0,createStopMarketOrder:!0,createStopOrder:!0,deposit:!0,editOrder:!1,fetchAccounts:!1,fetchBalance:!0,fetchBidsAsks:!1,fetchBorrowInterest:!1,fetchBorrowRate:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchBorrowRates:!1,fetchBorrowRatesPerSymbol:!1,fetchCanceledOrders:!1,fetchClosedOrder:!1,fetchClosedOrders:!0,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!0,fetchDeposit:void 0,fetchDepositAddress:!0,fetchDepositAddresses:!1,fetchDepositAddressesByNetwork:!1,fetchDeposits:!0,fetchDepositWithdrawFee:!1,fetchDepositWithdrawFees:!1,fetchFundingHistory:!1,fetchFundingInterval:!1,fetchFundingIntervals:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchGreeks:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchIsolatedPositions:!1,fetchL3OrderBook:!1,fetchLedger:!1,fetchLeverage:!1,fetchLeverages:!1,fetchLeverageTiers:!1,fetchLiquidations:!1,fetchLongShortRatio:!1,fetchLongShortRatioHistory:!1,fetchMarginAdjustmentHistory:!1,fetchMarginMode:!1,fetchMarginModes:!1,fetchMarketLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMarkPrices:!1,fetchMyLiquidations:!1,fetchMySettlementHistory:!1,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenInterest:!1,fetchOpenInterestHistory:!1,fetchOpenInterests:!1,fetchOpenOrder:void 0,fetchOpenOrders:!0,fetchOption:!1,fetchOptionChain:!1,fetchOrder:!0,fetchOrderBook:!0,fetchOrderBooks:!1,fetchOrders:!1,fetchOrderTrades:!0,fetchPosition:!1,fetchPositionHistory:!1,fetchPositionMode:!1,fetchPositions:!1,fetchPositionsForSymbol:!1,fetchPositionsHistory:!1,fetchPositionsRisk:!1,fetchPremiumIndexOHLCV:!1,fetchSettlementHistory:!1,fetchStatus:!0,fetchTicker:!0,fetchTickers:!0,fetchTime:!0,fetchTrades:!0,fetchTradingFee:!0,fetchTradingFees:!0,fetchTradingLimits:!1,fetchTransactionFee:!1,fetchTransactionFees:!1,fetchTransactions:!1,fetchTransfers:!1,fetchVolatilityHistory:!1,fetchWithdrawal:void 0,fetchWithdrawals:!0,fetchWithdrawalWhitelist:!1,reduceMargin:!1,repayCrossMargin:!1,repayIsolatedMargin:!1,repayMargin:!1,setLeverage:!1,setMargin:!1,setMarginMode:!1,setPositionMode:!1,signIn:!1,transfer:!1,withdraw:!0,ws:!1},timeframes:{"1m":"1m","3m":"3m","5m":"5m","15m":"15m","30m":"30m","1h":"1h","2h":"2h","4h":"4h","6h":"6h","8h":"8h","12h":"12h","1d":"1d","3d":"3d","1w":"1w","1M":"1M"},urls:{logo:"https://user-images.githubusercontent.com/1294454/225719995-48ab2026-4ddb-496c-9da7-0d7566617c9b.jpg",api:{public:"https://api.pro.coins.ph",private:"https://api.pro.coins.ph"},www:"https://coins.ph/",doc:["https://coins-docs.github.io/rest-api"],fees:"https://support.coins.ph/hc/en-us/sections/4407198694681-Limits-Fees"},api:{public:{get:{"openapi/v1/ping":1,"openapi/v1/time":1,"openapi/quote/v1/ticker/24hr":{cost:1,noSymbolAndNoSymbols:40,byNumberOfSymbols:[[101,40],[21,20],[0,1]]},"openapi/quote/v1/ticker/price":{cost:1,noSymbol:2},"openapi/quote/v1/ticker/bookTicker":{cost:1,noSymbol:2},"openapi/v1/exchangeInfo":10,"openapi/quote/v1/depth":{cost:1,byLimit:[[101,5],[0,1]]},"openapi/quote/v1/klines":1,"openapi/quote/v1/trades":1,"openapi/v1/pairs":1,"openapi/quote/v1/avgPrice":1}},private:{get:{"openapi/wallet/v1/config/getall":10,"openapi/wallet/v1/deposit/address":10,"openapi/wallet/v1/deposit/history":1,"openapi/wallet/v1/withdraw/history":1,"openapi/v1/account":10,"openapi/v1/openOrders":{cost:3,noSymbol:40},"openapi/v1/asset/tradeFee":1,"openapi/v1/order":2,"openapi/v1/historyOrders":{cost:10,noSymbol:40},"openapi/v1/myTrades":10,"openapi/v1/capital/deposit/history":1,"openapi/v1/capital/withdraw/history":1,"openapi/v3/payment-request/get-payment-request":1,"merchant-api/v1/get-invoices":1,"openapi/account/v3/crypto-accounts":1,"openapi/transfer/v3/transfers/{id}":1},post:{"openapi/wallet/v1/withdraw/apply":600,"openapi/v1/order/test":1,"openapi/v1/order":1,"openapi/v1/capital/withdraw/apply":1,"openapi/v1/capital/deposit/apply":1,"openapi/v3/payment-request/payment-requests":1,"openapi/v3/payment-request/delete-payment-request":1,"openapi/v3/payment-request/payment-request-reminder":1,"openapi/v1/userDataStream":1,"merchant-api/v1/invoices":1,"merchant-api/v1/invoices-cancel":1,"openapi/convert/v1/get-supported-trading-pairs":1,"openapi/convert/v1/get-quote":1,"openapi/convert/v1/accpet-quote":1,"openapi/fiat/v1/support-channel":1,"openapi/fiat/v1/cash-out":1,"openapi/fiat/v1/history":1,"openapi/migration/v4/sellorder":1,"openapi/migration/v4/validate-field":1,"openapi/transfer/v3/transfers":1},delete:{"openapi/v1/order":1,"openapi/v1/openOrders":1,"openapi/v1/userDataStream":1}}},fees:{trading:{feeSide:"get",tierBased:!0,percentage:!0,maker:this.parseNumber("0.0025"),taker:this.parseNumber("0.003"),tiers:{taker:[[this.parseNumber("0"),this.parseNumber("0.003")],[this.parseNumber("500000"),this.parseNumber("0.0027")],[this.parseNumber("1000000"),this.parseNumber("0.0024")],[this.parseNumber("2500000"),this.parseNumber("0.002")],[this.parseNumber("5000000"),this.parseNumber("0.0018")],[this.parseNumber("10000000"),this.parseNumber("0.0015")],[this.parseNumber("100000000"),this.parseNumber("0.0012")],[this.parseNumber("500000000"),this.parseNumber("0.0009")],[this.parseNumber("1000000000"),this.parseNumber("0.0007")],[this.parseNumber("2500000000"),this.parseNumber("0.0005")]],maker:[[this.parseNumber("0"),this.parseNumber("0.0025")],[this.parseNumber("500000"),this.parseNumber("0.0022")],[this.parseNumber("1000000"),this.parseNumber("0.0018")],[this.parseNumber("2500000"),this.parseNumber("0.0015")],[this.parseNumber("5000000"),this.parseNumber("0.0012")],[this.parseNumber("10000000"),this.parseNumber("0.001")],[this.parseNumber("100000000"),this.parseNumber("0.0008")],[this.parseNumber("500000000"),this.parseNumber("0.0007")],[this.parseNumber("1000000000"),this.parseNumber("0.0006")],[this.parseNumber("2500000000"),this.parseNumber("0.0005")]]}}},precisionMode:a.kb,options:{createMarketBuyOrderRequiresPrice:!0,withdraw:{warning:!1},deposit:{warning:!1},createOrder:{timeInForce:"GTC",newOrderRespType:{market:"FULL",limit:"FULL"}},fetchTicker:{method:"publicGetOpenapiQuoteV1Ticker24hr"},fetchTickers:{method:"publicGetOpenapiQuoteV1Ticker24hr"},networks:{TRC20:"TRX",ERC20:"ETH",BEP20:"BSC",ARB:"ARBITRUM"}},features:{spot:{sandbox:!1,createOrder:{marginMode:!1,triggerPrice:!0,triggerPriceType:void 0,triggerDirection:!1,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!0,FOK:!0,PO:!1,GTD:!1},hedged:!1,trailing:!1,leverage:!1,marketBuyByCost:!0,marketBuyRequiresPrice:!1,selfTradePrevention:!0,iceberg:!1},createOrders:void 0,fetchMyTrades:{marginMode:!1,limit:1e3,daysBack:1e5,untilDays:1e5,symbolRequired:!0},fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!1},fetchOpenOrders:{marginMode:!1,limit:void 0,trigger:!1,trailing:!1,symbolRequired:!1},fetchOrders:void 0,fetchClosedOrders:{marginMode:!1,limit:1e3,daysBack:1e5,daysBackCanceled:1,untilDays:1e5,trigger:!1,trailing:!1,symbolRequired:!0},fetchOHLCV:{limit:1e3}},swap:{linear:void 0,inverse:void 0},future:{linear:void 0,inverse:void 0}},exceptions:{exact:{"-1000":r.BadRequest,"-1001":r.BadRequest,"-1002":r.AuthenticationError,"-1003":r.RateLimitExceeded,"-1004":r.InvalidOrder,"-1006":r.BadResponse,"-1007":r.BadResponse,"-1014":r.InvalidOrder,"-1015":r.RateLimitExceeded,"-1016":r.NotSupported,"-1020":r.NotSupported,"-1021":r.BadRequest,"-1022":r.BadRequest,"-1023":r.AuthenticationError,"-1024":r.BadRequest,"-1025":r.BadRequest,"-1030":r.ExchangeError,"-1100":r.BadRequest,"-1101":r.BadRequest,"-1102":r.BadRequest,"-1103":r.BadRequest,"-1104":r.BadRequest,"-1105":r.BadRequest,"-1106":r.BadRequest,"-1111":r.BadRequest,"-1112":r.BadResponse,"-1114":r.BadRequest,"-1115":r.InvalidOrder,"-1116":r.InvalidOrder,"-1117":r.InvalidOrder,"-1118":r.InvalidOrder,"-1119":r.InvalidOrder,"-1120":r.BadRequest,"-1121":r.BadSymbol,"-1122":r.InvalidOrder,"-1125":r.BadRequest,"-1127":r.BadRequest,"-1128":r.BadRequest,"-1130":r.BadRequest,"-1131":r.InsufficientFunds,"-1132":r.InvalidOrder,"-1133":r.InvalidOrder,"-1134":r.InvalidOrder,"-1135":r.InvalidOrder,"-1136":r.InvalidOrder,"-1137":r.InvalidOrder,"-1138":r.InvalidOrder,"-1139":r.InvalidOrder,"-1140":r.InvalidOrder,"-1141":r.DuplicateOrderId,"-1142":r.InvalidOrder,"-1143":r.OrderNotFound,"-1144":r.InvalidOrder,"-1145":r.InvalidOrder,"-1146":r.InvalidOrder,"-1147":r.InvalidOrder,"-1148":r.InvalidOrder,"-1149":r.InvalidOrder,"-1150":r.InvalidOrder,"-1151":r.BadSymbol,"-1152":r.NotSupported,"-1153":r.AuthenticationError,"-1154":r.BadRequest,"-1155":r.BadRequest,"-1156":r.InvalidOrder,"-1157":r.BadSymbol,"-1158":r.InvalidOrder,"-1159":r.InvalidOrder,"-1160":r.BadRequest,"-1161":r.BadRequest,"-2010":r.InvalidOrder,"-2013":r.OrderNotFound,"-2011":r.BadRequest,"-2014":r.BadRequest,"-2015":r.AuthenticationError,"-2016":r.BadResponse,"-3126":r.InvalidOrder,"-3127":r.InvalidOrder,"-4001":r.BadRequest,"-100011":r.BadSymbol,"-100012":r.BadSymbol,"-30008":r.InsufficientFunds,"-30036":r.InsufficientFunds,403:r.ExchangeNotAvailable},broad:{"Unknown order sent":r.OrderNotFound,"Duplicate order sent":r.DuplicateOrderId,"Market is closed":r.BadSymbol,"Account has insufficient balance for requested action":r.InsufficientFunds,"Market orders are not supported for this symbol":r.BadSymbol,"Iceberg orders are not supported for this symbol":r.BadSymbol,"Stop loss orders are not supported for this symbol":r.BadSymbol,"Stop loss limit orders are not supported for this symbol":r.BadSymbol,"Take profit orders are not supported for this symbol":r.BadSymbol,"Take profit limit orders are not supported for this symbol":r.BadSymbol,"Price* QTY is zero or less":r.BadRequest,"IcebergQty exceeds QTY":r.BadRequest,"This action disabled is on this account":r.PermissionDenied,"Unsupported order combination":r.InvalidOrder,"Order would trigger immediately":r.InvalidOrder,"Cancel order is invalid. Check origClOrdId and orderId":r.InvalidOrder,"Order would immediately match and take":r.OrderImmediatelyFillable,PRICE_FILTER:r.InvalidOrder,LOT_SIZE:r.InvalidOrder,MIN_NOTIONAL:r.InvalidOrder,MAX_NUM_ORDERS:r.InvalidOrder,MAX_ALGO_ORDERS:r.InvalidOrder,BROKER_MAX_NUM_ORDERS:r.InvalidOrder,BROKER_MAX_ALGO_ORDERS:r.InvalidOrder,ICEBERG_PARTS:r.BadRequest}}})}async fetchCurrencies(e={}){if(!this.checkRequiredCredentials(!1))return;const t=await this.privateGetOpenapiWalletV1ConfigGetall(e),i={};for(let e=0;e=s[0])return s[1]}}else if("byLimit"in r&&"limit"in s){const e=s.limit,t=r.byLimit;for(let i=0;i=s[0])return s[1]}}return this.safeValue(r,"cost",1)}async fetchStatus(e={}){return{status:"ok",updated:void 0,eta:void 0,url:void 0,info:await this.publicGetOpenapiV1Ping(e)}}async fetchTime(e={}){const t=await this.publicGetOpenapiV1Time(e);return this.safeInteger(t,"serverTime")}async fetchMarkets(e={}){const t=await this.publicGetOpenapiV1ExchangeInfo(e),i=this.safeList(t,"symbols",[]),s=[];for(let e=0;e{i.d(t,{A:()=>d});var s=i(9360),r=i(2079),a=i(1579),o=i(7481),n=i(5147);class d extends s.A{describe(){return this.deepExtend(super.describe(),{id:"coinspot",name:"CoinSpot",countries:["AU"],rateLimit:1e3,pro:!1,has:{CORS:void 0,spot:!0,margin:!1,swap:!1,future:!1,option:!1,addMargin:!1,borrowCrossMargin:!1,borrowIsolatedMargin:!1,borrowMargin:!1,cancelOrder:!0,closeAllPositions:!1,closePosition:!1,createMarketOrder:!1,createOrder:!0,createOrderWithTakeProfitAndStopLoss:!1,createOrderWithTakeProfitAndStopLossWs:!1,createPostOnlyOrder:!1,createReduceOnlyOrder:!1,createStopLimitOrder:!1,createStopMarketOrder:!1,createStopOrder:!1,fetchBalance:!0,fetchBorrowInterest:!1,fetchBorrowRate:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchBorrowRates:!1,fetchBorrowRatesPerSymbol:!1,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchFundingHistory:!1,fetchFundingInterval:!1,fetchFundingIntervals:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchGreeks:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchIsolatedPositions:!1,fetchLeverage:!1,fetchLeverages:!1,fetchLeverageTiers:!1,fetchLiquidations:!1,fetchLongShortRatio:!1,fetchLongShortRatioHistory:!1,fetchMarginAdjustmentHistory:!1,fetchMarginMode:!1,fetchMarginModes:!1,fetchMarketLeverageTiers:!1,fetchMarkOHLCV:!1,fetchMarkPrices:!1,fetchMyLiquidations:!1,fetchMySettlementHistory:!1,fetchMyTrades:!0,fetchOpenInterest:!1,fetchOpenInterestHistory:!1,fetchOpenInterests:!1,fetchOption:!1,fetchOptionChain:!1,fetchOrderBook:!0,fetchPosition:!1,fetchPositionHistory:!1,fetchPositionMode:!1,fetchPositions:!1,fetchPositionsForSymbol:!1,fetchPositionsHistory:!1,fetchPositionsRisk:!1,fetchPremiumIndexOHLCV:!1,fetchSettlementHistory:!1,fetchTicker:!0,fetchTickers:!0,fetchTrades:!0,fetchTradingFee:!1,fetchTradingFees:!1,fetchVolatilityHistory:!1,reduceMargin:!1,repayCrossMargin:!1,repayIsolatedMargin:!1,repayMargin:!1,setLeverage:!1,setMargin:!1,setMarginMode:!1,setPositionMode:!1,ws:!1},urls:{logo:"https://user-images.githubusercontent.com/1294454/28208429-3cacdf9a-6896-11e7-854e-4c79a772a30f.jpg",api:{public:"https://www.coinspot.com.au/pubapi",private:"https://www.coinspot.com.au/api"},www:"https://www.coinspot.com.au",doc:"https://www.coinspot.com.au/api",referral:"https://www.coinspot.com.au/register?code=PJURCU"},api:{public:{get:["latest"]},private:{post:["orders","orders/history","my/coin/deposit","my/coin/send","quote/buy","quote/sell","my/balances","my/orders","my/buy","my/sell","my/buy/cancel","my/sell/cancel","ro/my/balances","ro/my/balances/{cointype}","ro/my/deposits","ro/my/withdrawals","ro/my/transactions","ro/my/transactions/{cointype}","ro/my/transactions/open","ro/my/transactions/{cointype}/open","ro/my/sendreceive","ro/my/affiliatepayments","ro/my/referralpayments"]}},markets:{"ADA/AUD":this.safeMarketStructure({id:"ada",symbol:"ADA/AUD",base:"ADA",quote:"AUD",baseId:"ada",quoteId:"aud",type:"spot",spot:!0}),"BTC/AUD":this.safeMarketStructure({id:"btc",symbol:"BTC/AUD",base:"BTC",quote:"AUD",baseId:"btc",quoteId:"aud",type:"spot",spot:!0}),"ETH/AUD":this.safeMarketStructure({id:"eth",symbol:"ETH/AUD",base:"ETH",quote:"AUD",baseId:"eth",quoteId:"aud",type:"spot",spot:!0}),"XRP/AUD":this.safeMarketStructure({id:"xrp",symbol:"XRP/AUD",base:"XRP",quote:"AUD",baseId:"xrp",quoteId:"aud",type:"spot",spot:!0}),"LTC/AUD":this.safeMarketStructure({id:"ltc",symbol:"LTC/AUD",base:"LTC",quote:"AUD",baseId:"ltc",quoteId:"aud",type:"spot",spot:!0}),"DOGE/AUD":this.safeMarketStructure({id:"doge",symbol:"DOGE/AUD",base:"DOGE",quote:"AUD",baseId:"doge",quoteId:"aud",type:"spot",spot:!0}),"RFOX/AUD":this.safeMarketStructure({id:"rfox",symbol:"RFOX/AUD",base:"RFOX",quote:"AUD",baseId:"rfox",quoteId:"aud",type:"spot",spot:!0}),"POWR/AUD":this.safeMarketStructure({id:"powr",symbol:"POWR/AUD",base:"POWR",quote:"AUD",baseId:"powr",quoteId:"aud",type:"spot",spot:!0}),"NEO/AUD":this.safeMarketStructure({id:"neo",symbol:"NEO/AUD",base:"NEO",quote:"AUD",baseId:"neo",quoteId:"aud",type:"spot",spot:!0}),"TRX/AUD":this.safeMarketStructure({id:"trx",symbol:"TRX/AUD",base:"TRX",quote:"AUD",baseId:"trx",quoteId:"aud",type:"spot",spot:!0}),"EOS/AUD":this.safeMarketStructure({id:"eos",symbol:"EOS/AUD",base:"EOS",quote:"AUD",baseId:"eos",quoteId:"aud",type:"spot",spot:!0}),"XLM/AUD":this.safeMarketStructure({id:"xlm",symbol:"XLM/AUD",base:"XLM",quote:"AUD",baseId:"xlm",quoteId:"aud",type:"spot",spot:!0}),"RHOC/AUD":this.safeMarketStructure({id:"rhoc",symbol:"RHOC/AUD",base:"RHOC",quote:"AUD",baseId:"rhoc",quoteId:"aud",type:"spot",spot:!0}),"GAS/AUD":this.safeMarketStructure({id:"gas",symbol:"GAS/AUD",base:"GAS",quote:"AUD",baseId:"gas",quoteId:"aud",type:"spot",spot:!0})},commonCurrencies:{DRK:"DASH"},options:{fetchBalance:"private_post_my_balances"},features:{spot:{sandbox:!1,createOrder:{marginMode:!1,triggerPrice:!1,triggerPriceType:void 0,triggerDirection:!1,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!1,FOK:!1,PO:!1,GTD:!1},hedged:!1,trailing:!1,leverage:!1,marketBuyByCost:!1,marketBuyRequiresPrice:!1,selfTradePrevention:!1,iceberg:!1},createOrders:void 0,fetchMyTrades:{marginMode:!1,limit:void 0,daysBack:1e5,untilDays:1e5,symbolRequired:!1},fetchOrder:void 0,fetchOpenOrders:void 0,fetchOrders:void 0,fetchClosedOrders:void 0,fetchOHLCV:void 0},swap:{linear:void 0,inverse:void 0},future:{linear:void 0,inverse:void 0}},precisionMode:a.kb})}parseBalance(e){const t={info:e},i=this.safeValue2(e,"balance","balances");if(Array.isArray(i))for(let e=0;e{i.d(t,{A:()=>d});var s=i(4295),r=i(5147),a=i(2079),o=i(1579),n=i(4852);class d extends s.A{describe(){return this.deepExtend(super.describe(),{id:"cryptocom",name:"Crypto.com",countries:["MT"],version:"v2",rateLimit:10,certified:!0,pro:!0,has:{CORS:!1,spot:!0,margin:!0,swap:!0,future:!0,option:!0,addMargin:!1,cancelAllOrders:!0,cancelOrder:!0,cancelOrders:!0,cancelOrdersForSymbols:!0,closeAllPositions:!1,closePosition:!0,createMarketBuyOrderWithCost:!1,createMarketOrderWithCost:!1,createMarketSellOrderWithCost:!1,createOrder:!0,createOrders:!0,createStopOrder:!0,createTriggerOrder:!0,editOrder:!0,fetchAccounts:!0,fetchBalance:!0,fetchBidsAsks:!1,fetchBorrowInterest:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchClosedOrders:"emulated",fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!0,fetchDepositAddress:!0,fetchDepositAddresses:!1,fetchDepositAddressesByNetwork:!0,fetchDeposits:!0,fetchDepositsWithdrawals:!1,fetchDepositWithdrawFee:"emulated",fetchDepositWithdrawFees:!0,fetchFundingHistory:!1,fetchFundingRate:!0,fetchFundingRateHistory:!0,fetchFundingRates:!1,fetchGreeks:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchLedger:!0,fetchLeverage:!1,fetchLeverageTiers:!1,fetchMarginAdjustmentHistory:!1,fetchMarginMode:!1,fetchMarketLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMySettlementHistory:!1,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenOrders:!0,fetchOrder:!0,fetchOrderBook:!0,fetchOrders:!0,fetchPosition:!0,fetchPositionHistory:!1,fetchPositionMode:!1,fetchPositions:!0,fetchPositionsHistory:!1,fetchPremiumIndexOHLCV:!1,fetchSettlementHistory:!0,fetchStatus:!1,fetchTicker:!0,fetchTickers:!0,fetchTime:!1,fetchTrades:!0,fetchTradingFee:!0,fetchTradingFees:!0,fetchTransactionFees:!1,fetchTransactions:!1,fetchTransfers:!1,fetchUnderlyingAssets:!1,fetchVolatilityHistory:!1,fetchWithdrawals:!0,reduceMargin:!1,repayCrossMargin:!1,repayIsolatedMargin:!1,sandbox:!0,setLeverage:!1,setMarginMode:!1,setPositionMode:!1,transfer:!1,withdraw:!0},timeframes:{"1m":"1m","5m":"5m","15m":"15m","30m":"30m","1h":"1h","4h":"4h","6h":"6h","12h":"12h","1d":"1D","1w":"7D","2w":"14D","1M":"1M"},urls:{logo:"https://user-images.githubusercontent.com/1294454/147792121-38ed5e36-c229-48d6-b49a-48d05fc19ed4.jpeg",test:{v1:"https://uat-api.3ona.co/exchange/v1",v2:"https://uat-api.3ona.co/v2",derivatives:"https://uat-api.3ona.co/v2"},api:{base:"https://api.crypto.com",v1:"https://api.crypto.com/exchange/v1",v2:"https://api.crypto.com/v2",derivatives:"https://deriv-api.crypto.com/v1"},www:"https://crypto.com/",referral:{url:"https://crypto.com/exch/kdacthrnxt",discount:.75},doc:["https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html","https://exchange-docs.crypto.com/spot/index.html","https://exchange-docs.crypto.com/derivatives/index.html"],fees:"https://crypto.com/exchange/document/fees-limits"},api:{base:{public:{get:{"v1/public/get-announcements":1}}},v1:{public:{get:{"public/auth":10/3,"public/get-instruments":10/3,"public/get-book":1,"public/get-candlestick":1,"public/get-trades":1,"public/get-tickers":1,"public/get-valuations":1,"public/get-expired-settlement-price":10/3,"public/get-insurance":1,"public/get-risk-parameters":1},post:{"public/staking/get-conversion-rate":2}},private:{post:{"private/set-cancel-on-disconnect":10/3,"private/get-cancel-on-disconnect":10/3,"private/user-balance":10/3,"private/user-balance-history":10/3,"private/get-positions":10/3,"private/create-order":2/3,"private/amend-order":4/3,"private/create-order-list":10/3,"private/cancel-order":2/3,"private/cancel-order-list":10/3,"private/cancel-all-orders":2/3,"private/close-position":10/3,"private/get-order-history":100,"private/get-open-orders":10/3,"private/get-order-detail":1/3,"private/get-trades":100,"private/change-account-leverage":10/3,"private/get-transactions":10/3,"private/create-subaccount-transfer":10/3,"private/get-subaccount-balances":10/3,"private/get-order-list":10/3,"private/create-withdrawal":10/3,"private/get-currency-networks":10/3,"private/get-deposit-address":10/3,"private/get-accounts":10/3,"private/get-withdrawal-history":10/3,"private/get-deposit-history":10/3,"private/get-fee-rate":2,"private/get-instrument-fee-rate":2,"private/staking/stake":2,"private/staking/unstake":2,"private/staking/get-staking-position":2,"private/staking/get-staking-instruments":2,"private/staking/get-open-stake":2,"private/staking/get-stake-history":2,"private/staking/get-reward-history":2,"private/staking/convert":2,"private/staking/get-open-convert":2,"private/staking/get-convert-history":2}}},v2:{public:{get:{"public/auth":1,"public/get-instruments":1,"public/get-book":1,"public/get-candlestick":1,"public/get-ticker":1,"public/get-trades":1,"public/margin/get-transfer-currencies":1,"public/margin/get-load-currenices":1,"public/respond-heartbeat":1}},private:{post:{"private/set-cancel-on-disconnect":10/3,"private/get-cancel-on-disconnect":10/3,"private/create-withdrawal":10/3,"private/get-withdrawal-history":10/3,"private/get-currency-networks":10/3,"private/get-deposit-history":10/3,"private/get-deposit-address":10/3,"private/export/create-export-request":10/3,"private/export/get-export-requests":10/3,"private/export/download-export-output":10/3,"private/get-account-summary":10/3,"private/create-order":2/3,"private/cancel-order":2/3,"private/cancel-all-orders":2/3,"private/create-order-list":10/3,"private/get-order-history":10/3,"private/get-open-orders":10/3,"private/get-order-detail":1/3,"private/get-trades":100,"private/get-accounts":10/3,"private/get-subaccount-balances":10/3,"private/create-subaccount-transfer":10/3,"private/otc/get-otc-user":10/3,"private/otc/get-instruments":10/3,"private/otc/request-quote":100,"private/otc/accept-quote":100,"private/otc/get-quote-history":10/3,"private/otc/get-trade-history":10/3,"private/otc/create-order":10/3}}},derivatives:{public:{get:{"public/auth":10/3,"public/get-instruments":10/3,"public/get-book":1,"public/get-candlestick":1,"public/get-trades":1,"public/get-tickers":1,"public/get-valuations":1,"public/get-expired-settlement-price":10/3,"public/get-insurance":1}},private:{post:{"private/set-cancel-on-disconnect":10/3,"private/get-cancel-on-disconnect":10/3,"private/user-balance":10/3,"private/user-balance-history":10/3,"private/get-positions":10/3,"private/create-order":2/3,"private/create-order-list":10/3,"private/cancel-order":2/3,"private/cancel-order-list":10/3,"private/cancel-all-orders":2/3,"private/close-position":10/3,"private/convert-collateral":10/3,"private/get-order-history":100,"private/get-open-orders":10/3,"private/get-order-detail":1/3,"private/get-trades":100,"private/change-account-leverage":10/3,"private/get-transactions":10/3,"private/create-subaccount-transfer":10/3,"private/get-subaccount-balances":10/3,"private/get-order-list":10/3}}}},fees:{trading:{maker:this.parseNumber("0.004"),taker:this.parseNumber("0.004"),tiers:{maker:[[this.parseNumber("0"),this.parseNumber("0.004")],[this.parseNumber("25000"),this.parseNumber("0.0035")],[this.parseNumber("50000"),this.parseNumber("0.0015")],[this.parseNumber("100000"),this.parseNumber("0.001")],[this.parseNumber("250000"),this.parseNumber("0.0009")],[this.parseNumber("1000000"),this.parseNumber("0.0008")],[this.parseNumber("20000000"),this.parseNumber("0.0007")],[this.parseNumber("100000000"),this.parseNumber("0.0006")],[this.parseNumber("200000000"),this.parseNumber("0.0004")]],taker:[[this.parseNumber("0"),this.parseNumber("0.004")],[this.parseNumber("25000"),this.parseNumber("0.0035")],[this.parseNumber("50000"),this.parseNumber("0.0025")],[this.parseNumber("100000"),this.parseNumber("0.0016")],[this.parseNumber("250000"),this.parseNumber("0.00015")],[this.parseNumber("1000000"),this.parseNumber("0.00014")],[this.parseNumber("20000000"),this.parseNumber("0.00013")],[this.parseNumber("100000000"),this.parseNumber("0.00012")],[this.parseNumber("200000000"),this.parseNumber("0.0001")]]}}},options:{defaultType:"spot",accountsById:{funding:"SPOT",spot:"SPOT",margin:"MARGIN",derivatives:"DERIVATIVES",swap:"DERIVATIVES",future:"DERIVATIVES"},networks:{BEP20:"BSC",ERC20:"ETH",TRC20:"TRON"},broker:"CCXT"},features:{default:{sandbox:!0,createOrder:{marginMode:!0,triggerPrice:!0,triggerPriceType:{last:!0,mark:!0,index:!0},triggerDirection:!1,stopLossPrice:!0,takeProfitPrice:!0,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!0,FOK:!0,PO:!0,GTD:!1},hedged:!1,selfTradePrevention:!0,trailing:!1,iceberg:!1,leverage:!1,marketBuyByCost:!0,marketBuyRequiresPrice:!0},createOrders:{max:10},fetchMyTrades:{marginMode:!1,limit:100,daysBack:void 0,untilDays:1,symbolRequired:!1},fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!1},fetchOpenOrders:{marginMode:!0,limit:100,trigger:!1,trailing:!1,symbolRequired:!1},fetchOrders:{marginMode:!1,limit:100,daysBack:void 0,untilDays:1,trigger:!1,trailing:!1,symbolRequired:!1},fetchClosedOrders:{marginMode:!1,limit:100,daysBack:void 0,daysBackCanceled:void 0,untilDays:1,trigger:!1,trailing:!1,symbolRequired:!1},fetchOHLCV:{limit:300}},spot:{extends:"default"},swap:{linear:{extends:"default"},inverse:{extends:"default"}},future:{linear:{extends:"default"},inverse:{extends:"default"}}},commonCurrencies:{USD_STABLE_COIN:"USDC"},precisionMode:o.kb,exceptions:{exact:{219:a.InvalidOrder,306:a.InsufficientFunds,314:a.InvalidOrder,325:a.InvalidOrder,415:a.InvalidOrder,10001:a.ExchangeError,10002:a.PermissionDenied,10003:a.PermissionDenied,10004:a.BadRequest,10005:a.PermissionDenied,10006:a.DDoSProtection,10007:a.InvalidNonce,10008:a.BadRequest,10009:a.BadRequest,20001:a.BadRequest,20002:a.InsufficientFunds,20005:a.AccountNotEnabled,30003:a.BadSymbol,30004:a.BadRequest,30005:a.BadRequest,30006:a.InvalidOrder,30007:a.InvalidOrder,30008:a.InvalidOrder,30009:a.InvalidOrder,30010:a.BadRequest,30013:a.InvalidOrder,30014:a.InvalidOrder,30016:a.InvalidOrder,30017:a.InvalidOrder,30023:a.InvalidOrder,30024:a.InvalidOrder,30025:a.InvalidOrder,40001:a.BadRequest,40002:a.BadRequest,40003:a.BadRequest,40004:a.BadRequest,40005:a.BadRequest,40006:a.BadRequest,40007:a.BadRequest,40101:a.AuthenticationError,40102:a.InvalidNonce,40103:a.AuthenticationError,40104:a.AuthenticationError,40107:a.BadRequest,40401:a.OrderNotFound,40801:a.RequestTimeout,42901:a.RateLimitExceeded,43005:a.InvalidOrder,43003:a.InvalidOrder,43004:a.InvalidOrder,43012:a.BadRequest,50001:a.ExchangeError,9010001:a.OnMaintenance},broad:{}}})}async fetchCurrencies(e={}){if(!this.checkRequiredCredentials(!1))return;let t=!1;if([t,e]=this.handleOptionAndParams(e,"fetchCurrencies","skipFetchCurrencies",!1),t)return;let i={};try{i=await this.v1PrivatePostPrivateGetCurrencyNetworks(e)}catch(e){if(e instanceof a.ExchangeError)return;throw e}const s=this.safeDict(i,"result",{}),r=this.safeDict(s,"currency_map",{}),o=Object.keys(r),n={};for(let e=0;e1)throw new a.BadRequest(this.id+" fetchTickers() symbols argument cannot contain more than 1 symbol");t=e[0]}else t=e;i=this.market(t),s.instrument_name=i.id}const r=await this.v1PublicGetPublicGetTickers(this.extend(s,t)),o=this.safeDict(r,"result",{}),n=this.safeList(o,"data",[]);return this.parseTickers(n,e)}async fetchTicker(e,t={}){await this.loadMarkets(),e=this.symbol(e);const i=await this.fetchTickers([e],t);return this.safeValue(i,e)}async fetchOrders(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();let r,a=!1;if([a,s]=this.handleOptionAndParams(s,"fetchOrders","paginate"),a)return await this.fetchPaginatedCallDynamic("fetchOrders",e,t,i,s);const o={};void 0!==e&&(r=this.market(e),o.instrument_name=r.id),void 0!==t&&(o.start_time=t),void 0!==i&&(o.limit=i);const n=this.safeInteger(s,"until");s=this.omit(s,["until"]),void 0!==n&&(o.end_time=n);const d=await this.v1PrivatePostPrivateGetOrderHistory(this.extend(o,s)),h=this.safeDict(d,"result",{}),c=this.safeList(h,"data",[]);return this.parseOrders(c,r,t,i)}async fetchTrades(e,t=void 0,i=void 0,s={}){await this.loadMarkets();let r=!1;if([r,s]=this.handleOptionAndParams(s,"fetchTrades","paginate"),r)return await this.fetchPaginatedCallDynamic("fetchTrades",e,t,i,s);const a=this.market(e),o={instrument_name:a.id};void 0!==t&&(o.start_ts=t),void 0!==i&&(o.count=i);const n=this.safeInteger(s,"until");s=this.omit(s,["until"]),void 0!==n&&(o.end_ts=n);const d=await this.v1PublicGetPublicGetTrades(this.extend(o,s)),h=this.safeDict(d,"result",{}),c=this.safeList(h,"data",[]);return this.parseTrades(c,a,t,i)}async fetchOHLCV(e,t="1m",i=void 0,s=void 0,r={}){await this.loadMarkets();let a=!1;if([a,r]=this.handleOptionAndParams(r,"fetchOHLCV","paginate",!1),a)return await this.fetchPaginatedCallDeterministic("fetchOHLCV",e,i,s,t,r,300);const o=this.market(e),n={instrument_name:o.id,timeframe:this.safeString(this.timeframes,t,t)};void 0!==s&&(s>300&&(s=300),n.count=s);const d=this.microseconds(),h=this.parseTimeframe(t),c=this.safeInteger(r,"until",d);r=this.omit(r,["until"]),void 0!==i?(n.start_ts=i-1e3*h,n.end_ts=void 0!==s?this.sum(i,h*s*1e3):c):n.end_ts=c;const l=await this.v1PublicGetPublicGetCandlestick(this.extend(n,r)),u=this.safeDict(l,"result",{}),f=this.safeList(u,"data",[]);return this.parseOHLCVs(f,o,t,i,s)}async fetchOrderBook(e,t=void 0,i={}){await this.loadMarkets();const s={instrument_name:this.market(e).id};t&&(s.depth=Math.min(t,50));const r=await this.v1PublicGetPublicGetBook(this.extend(s,i)),a=this.safeDict(r,"result",{}),o=this.safeList(a,"data",[]),n=this.safeValue(o,0),d=this.safeInteger(n,"t");return this.parseOrderBook(n,e,d)}parseBalance(e){const t=this.safeDict(e,"result",{}),i=this.safeList(t,"data",[]),s=this.safeValue(i[0],"position_balances",[]),r={info:e};for(let e=0;e0){[t,s]=e.split("?");i=s.split("=")[1]}else t=e;return[t,i]}async withdraw(e,t,i,s=void 0,r={}){[s,r]=this.handleWithdrawTagAndParams(s,r),await this.loadMarkets();const a=this.safeCurrency(e),o={currency:a.id,amount:t,address:i};let n;void 0!==s&&(o.address_tag=s),[n,r]=this.handleNetworkCodeAndParams(r);const d=this.networkCodeToId(n);void 0!==d&&(o.network_id=d);const h=await this.v1PrivatePostPrivateCreateWithdrawal(this.extend(o,r)),c=this.safeDict(h,"result");return this.parseTransaction(c,a)}async fetchDepositAddressesByNetwork(e,t={}){await this.loadMarkets();const i={currency:this.safeCurrency(e).id},s=await this.v1PrivatePostPrivateGetDepositAddress(this.extend(i,t)),r=this.safeDict(s,"result",{}),o=this.safeList(r,"deposit_address_list",[]),n=o.length;if(0===n)throw new a.ExchangeError(this.id+" fetchDepositAddressesByNetwork() generating address...");const d={};for(let e=0;e1)throw new a.BadRequest(this.id+" fetchPositions() symbols argument cannot contain more than 1 symbol");t=e[0]}else t=e;s=this.market(t),i.instrument_name=s.id}const r=await this.v1PrivatePostPrivateGetPositions(this.extend(i,t)),o=this.safeDict(r,"result",{}),n=this.safeList(o,"data",[]),d=[];for(let e=0;e=3)return e.toString();if("string"==typeof e)return e;let i,s="";if(Array.isArray(e))i=e;else{const t=this.keysort(e);i=Object.keys(t)}for(let r=0;r{i.d(t,{A:()=>d});var s=i(3037),r=i(2079),a=i(5147),o=i(1579),n=i(4035);class d extends s.A{describe(){return this.deepExtend(super.describe(),{id:"cryptomus",name:"Cryptomus",countries:["CA"],rateLimit:100,version:"v2",certified:!1,pro:!1,has:{CORS:void 0,spot:!0,margin:!1,swap:!1,future:!1,option:!1,addMargin:!1,borrowCrossMargin:!1,borrowIsolatedMargin:!1,borrowMargin:!1,cancelAllOrders:!1,cancelAllOrdersAfter:!1,cancelOrder:!0,cancelOrders:!1,cancelWithdraw:!1,closeAllPositions:!1,closePosition:!1,createConvertTrade:!1,createDepositAddress:!1,createMarketBuyOrderWithCost:!1,createMarketOrder:!1,createMarketOrderWithCost:!1,createMarketSellOrderWithCost:!1,createOrder:!0,createOrderWithTakeProfitAndStopLoss:!1,createOrderWithTakeProfitAndStopLossWs:!1,createPostOnlyOrder:!1,createReduceOnlyOrder:!1,createStopLimitOrder:!1,createStopLossOrder:!1,createStopMarketOrder:!1,createStopOrder:!1,createTakeProfitOrder:!1,createTrailingAmountOrder:!1,createTrailingPercentOrder:!1,createTriggerOrder:!1,fetchAccounts:!1,fetchBalance:!0,fetchBorrowInterest:!1,fetchBorrowRate:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchBorrowRates:!1,fetchBorrowRatesPerSymbol:!1,fetchCanceledAndClosedOrders:!0,fetchCanceledOrders:!1,fetchClosedOrder:!1,fetchClosedOrders:!1,fetchConvertCurrencies:!1,fetchConvertQuote:!1,fetchConvertTrade:!1,fetchConvertTradeHistory:!1,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!0,fetchDepositAddress:!1,fetchDeposits:!1,fetchDepositsWithdrawals:!1,fetchFundingHistory:!1,fetchFundingInterval:!1,fetchFundingIntervals:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchGreeks:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchIsolatedPositions:!1,fetchLedger:!1,fetchLeverage:!1,fetchLeverages:!1,fetchLeverageTiers:!1,fetchLiquidations:!1,fetchLongShortRatio:!1,fetchLongShortRatioHistory:!1,fetchMarginAdjustmentHistory:!1,fetchMarginMode:!1,fetchMarginModes:!1,fetchMarketLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMarkPrices:!1,fetchMyLiquidations:!1,fetchMySettlementHistory:!1,fetchMyTrades:!1,fetchOHLCV:!1,fetchOpenInterest:!1,fetchOpenInterestHistory:!1,fetchOpenInterests:!1,fetchOpenOrder:!1,fetchOpenOrders:!0,fetchOption:!1,fetchOptionChain:!1,fetchOrder:!0,fetchOrderBook:!0,fetchOrders:!1,fetchOrderTrades:!1,fetchPosition:!1,fetchPositionHistory:!1,fetchPositionMode:!1,fetchPositions:!1,fetchPositionsForSymbol:!1,fetchPositionsHistory:!1,fetchPositionsRisk:!1,fetchPremiumIndexOHLCV:!1,fetchSettlementHistory:!1,fetchStatus:!1,fetchTicker:!1,fetchTickers:!0,fetchTime:!1,fetchTrades:!0,fetchTradingFee:!1,fetchTradingFees:!0,fetchTransactions:!1,fetchTransfers:!1,fetchVolatilityHistory:!1,fetchWithdrawals:!1,reduceMargin:!1,repayCrossMargin:!1,repayIsolatedMargin:!1,repayMargin:!1,sandbox:!1,setLeverage:!1,setMargin:!1,setMarginMode:!1,setPositionMode:!1,transfer:!1,withdraw:!1},timeframes:{},urls:{logo:"https://github.com/user-attachments/assets/8e0b1c48-7c01-4177-9224-f1b01d89d7e7",api:{public:"https://api.cryptomus.com",private:"https://api.cryptomus.com"},www:"https://cryptomus.com",doc:"https://doc.cryptomus.com/personal",fees:"https://cryptomus.com/tariffs",referral:"https://app.cryptomus.com/signup/?ref=JRP4yj"},api:{public:{get:{"v2/user-api/exchange/markets":1,"v2/user-api/exchange/market/price":1,"v1/exchange/market/assets":1,"v1/exchange/market/order-book/{currencyPair}":1,"v1/exchange/market/tickers":1,"v1/exchange/market/trades/{currencyPair}":1}},private:{get:{"v2/user-api/exchange/orders":1,"v2/user-api/exchange/orders/history":1,"v2/user-api/exchange/account/balance":1,"v2/user-api/exchange/account/tariffs":1,"v2/user-api/payment/services":1,"v2/user-api/payout/services":1,"v2/user-api/transaction/list":1},post:{"v2/user-api/exchange/orders":1,"v2/user-api/exchange/orders/market":1},delete:{"v2/user-api/exchange/orders/{orderId}":1}}},fees:{trading:{percentage:!0,feeSide:"get",maker:this.parseNumber("0.02"),taker:this.parseNumber("0.02")}},options:{createMarketBuyOrderRequiresPrice:!0,networks:{BEP20:"bsc",DASH:"dash",POLYGON:"polygon",ARB:"arbitrum",SOL:"sol",TON:"ton",ERC20:"eth",TRC20:"tron",LTC:"ltc",XMR:"xmr",BCH:"bch",DOGE:"doge",AVAX:"avalanche",BTC:"btc",RUB:"rub"},networksById:{bsc:"BEP20",dash:"DASH",polygon:"POLYGON",arbitrum:"ARB",sol:"SOL",ton:"TON",eth:"ERC20",tron:"TRC20",ltc:"LTC",xmr:"XMR",bch:"BCH",doge:"DOGE",avalanche:"AVAX",btc:"BTC",rub:"RUB"},fetchOrderBook:{level:0}},commonCurrencies:{},exceptions:{exact:{500:r.ExchangeError,6:r.InsufficientFunds,"Insufficient funds.":r.InsufficientFunds,"Minimum amount 15 USDT":r.InvalidOrder},broad:{}},precisionMode:o.kb,requiredCredentials:{apiKey:!1,uid:!0},features:{}})}async fetchMarkets(e={}){const t=await this.publicGetV2UserApiExchangeMarkets(e),i=this.safeList(t,"result",[]);return this.parseMarkets(i)}parseMarket(e){const t=this.safeString(e,"symbol"),i=t.split("_"),s=i[0],r=i[1],a=this.safeCurrencyCode(s),o=this.safeCurrencyCode(r),n=this.safeDict(this.fees,"trading");return this.safeMarketStructure({id:t,symbol:a+"/"+o,base:a,quote:o,baseId:s,quoteId:r,active:!0,type:"spot",subType:void 0,spot:!0,margin:!1,swap:!1,future:!1,option:!1,contract:!1,settle:void 0,settleId:void 0,contractSize:void 0,linear:void 0,inverse:void 0,taker:this.safeNumber(n,"taker"),maker:this.safeNumber(n,"maker"),percentage:this.safeBool(n,"percentage"),tierBased:void 0,feeSide:this.safeString(n,"feeSide"),expiry:void 0,expiryDatetime:void 0,strike:void 0,optionType:void 0,precision:{amount:this.parseNumber(this.parsePrecision(this.safeString(e,"quotePrec"))),price:this.parseNumber(this.parsePrecision(this.safeString(e,"basePrec")))},limits:{amount:{min:this.safeNumber(e,"quoteMinSize"),max:this.safeNumber(e,"quoteMaxSize")},price:{min:this.safeNumber(e,"baseMinSize"),max:this.safeNumber(e,"baseMaxSize")},leverage:{min:void 0,max:void 0},cost:{min:void 0,max:void 0}},created:void 0,info:e})}async fetchCurrencies(e={}){const t=await this.publicGetV1ExchangeMarketAssets(e),i=this.safeList(t,"result"),s=this.groupBy(i,"currency_code"),r=Object.keys(s),a={};for(let e=0;e{i.d(t,{A:()=>d});var s=i(9872),r=i(5147),a=i(1579),o=i(4852),n=i(2079);class d extends s.A{describe(){return this.deepExtend(super.describe(),{id:"defx",name:"Defx X",rateLimit:100,version:"v1",certified:!1,pro:!1,hostname:"defx.com",dex:!0,has:{CORS:void 0,spot:!1,margin:!1,swap:!0,future:!1,option:!1,addMargin:!0,cancelAllOrders:!0,cancelAllOrdersAfter:!1,cancelOrder:!0,cancelWithdraw:!1,closeAllPositions:!0,closePosition:!0,createConvertTrade:!1,createDepositAddress:!1,createMarketBuyOrderWithCost:!1,createMarketOrder:!1,createMarketOrderWithCost:!1,createMarketSellOrderWithCost:!1,createOrder:!0,createOrderWithTakeProfitAndStopLoss:!0,createReduceOnlyOrder:!0,createStopLimitOrder:!1,createStopLossOrder:!1,createStopMarketOrder:!1,createStopOrder:!1,createTakeProfitOrder:!0,createTrailingAmountOrder:!1,createTrailingPercentOrder:!1,createTriggerOrder:!0,fetchAccounts:!1,fetchBalance:!0,fetchCanceledOrders:!0,fetchClosedOrder:!1,fetchClosedOrders:!0,fetchConvertCurrencies:!1,fetchConvertQuote:!1,fetchConvertTrade:!1,fetchConvertTradeHistory:!1,fetchCurrencies:!1,fetchDepositAddress:!1,fetchDepositAddresses:!1,fetchDepositAddressesByNetwork:!1,fetchDeposits:!1,fetchDepositsWithdrawals:!1,fetchFundingHistory:!1,fetchFundingInterval:!1,fetchFundingIntervals:!1,fetchFundingRate:!0,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchIndexOHLCV:!1,fetchLedger:!0,fetchLeverage:!1,fetchMarginAdjustmentHistory:!1,fetchMarginMode:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMarkPrice:!1,fetchMarkPrices:!1,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenInterestHistory:!1,fetchOpenOrder:!1,fetchOpenOrders:!0,fetchOrder:!0,fetchOrderBook:!0,fetchOrders:!0,fetchOrderTrades:!1,fetchPosition:!0,fetchPositionHistory:!1,fetchPositionMode:!1,fetchPositions:!0,fetchPositionsHistory:!1,fetchPremiumIndexOHLCV:!1,fetchStatus:!0,fetchTicker:!0,fetchTickers:!0,fetchTime:!0,fetchTrades:!0,fetchTradingFee:!1,fetchTradingFees:!1,fetchTransactions:!1,fetchTransfers:!1,fetchWithdrawals:!1,reduceMargin:!1,sandbox:!0,setLeverage:!0,setMargin:!1,setPositionMode:!1,transfer:!1,withdraw:!0},timeframes:{"1m":"1m","3m":"3m","5m":"5m","15m":"15m","30m":"30m","1h":"1h","2h":"2h","4h":"4h","12h":"12h","1d":"1d","1w":"1w","1M":"1M"},urls:{logo:"https://github.com/user-attachments/assets/4e92bace-d7a9-45ea-92be-122168dc87e4",api:{public:"https://api.{hostname}",private:"https://api.{hostname}"},test:{public:"https://api.testnet.{hostname}",private:"https://api.testnet.{hostname}"},www:"https://defx.com/home",doc:["https://docs.defx.com/docs","https://api-docs.defx.com/"],fees:[""],referral:{url:"https://app.defx.com/join/6I2CZ7"}},api:{v1:{public:{get:{"healthcheck/ping":1,"symbols/{symbol}/ohlc":1,"symbols/{symbol}/trades":1,"symbols/{symbol}/prices":1,"symbols/{symbol}/ticker/24hr":1,"symbols/{symbol}/depth/{level}/{slab}":1,"ticker/24HrAgg":1,"c/markets":1,"c/markets/metadata":1,"analytics/market/stats/newUsers":1,"analytics/market/stats/tvl":1,"analytics/market/stats/volumeByInstrument":1,"analytics/market/stats/liquidation":1,"analytics/market/stats/totalVolume":1,"analytics/market/stats/openInterest":1,"analytics/market/stats/totalTrades":1,"analytics/market/stats/basis":1,"analytics/market/stats/insuranceFund":1,"analytics/market/stats/longAndShortRatio":1,"analytics/market/stats/fundingRate":1,"analytics/market/overview":1,"explorer/search":1,"explorer/transactions":1,"explorer/blocks":1}},private:{get:{"api/order/{orderId}":1,"api/orders":1,"api/orders/oco/{parentOrderId}":1,"api/trades":1,"api/position/active":1,"api/users/metadata/leverage":1,"api/users/metadata/feeMultiplier":1,"api/users/metadata/slippage":1,"api/users/referral":1,"api/users/apikeys":1,"connection-signature-message/evm":1,"api/users/profile/wallets":1,"api/notifications":1,"api/wallet/balance":1,"api/wallet/transactions":1,"api/analytics/user/overview":1,"api/analytics/user/pnl":1,"api/analytics/points/overview":1,"api/analytics/points/history":1},post:{"api/order":1,"api/position/oco":1,"api/users/socket/listenKeys":1,"api/users/metadata/leverage":1,"api/users/metadata/feeMultiplier":1,"api/users/metadata/slippage":1,"api/users/referral/recordReferralSignup":1,"api/users/apikeys":1,"api/users/profile/wallets":1,"api/transfers/withdrawal":1,"api/transfers/bridge/withdrawal":1},put:{"api/position/updatePositionMargin":1,"api/users/socket/listenKeys/{listenKey}":1,"api/users/apikeys/{accessKey}/status":1,"api/users/referral":1},patch:{"api/users/apikeys/{accessKey}":1},delete:{"api/orders/allOpen":1,"api/order/{orderId}":1,"api/position/{positionId}":1,"api/position/all":1,"api/users/socket/listenKeys/{listenKey}":1,"api/users/apikeys/{accessKey}":1}}}},fees:{trading:{tierBased:!0,percentage:!0,maker:this.parseNumber("0.0002"),taker:this.parseNumber("0.0005")}},options:{sandboxMode:!1},features:{spot:void 0,forDerivatives:{sandbox:!0,createOrder:{marginMode:!1,triggerPrice:!0,triggerPriceType:{last:!0,mark:!0,index:!1},triggerDirection:!1,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!0,FOK:!0,PO:!0,GTD:!1},hedged:!1,selfTradePrevention:!1,trailing:!1,iceberg:!1,leverage:!1,marketBuyByCost:!1,marketBuyRequiresPrice:!1},createOrders:void 0,fetchMyTrades:{marginMode:!1,limit:1e3,daysBack:void 0,untilDays:void 0,symbolRequired:!1},fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!1},fetchOpenOrders:{marginMode:!0,limit:100,trigger:!1,trailing:!1,symbolRequired:!1},fetchOrders:{marginMode:!1,limit:500,daysBack:1e5,untilDays:1e5,trigger:!1,trailing:!1,symbolRequired:!1},fetchClosedOrders:{marginMode:!1,limit:500,daysBack:1e5,daysBackCanceled:1,untilDays:1e5,trigger:!1,trailing:!1,symbolRequired:!1},fetchOHLCV:{limit:1e3}},swap:{linear:{extends:"forDerivatives"},inverse:void 0},future:{linear:void 0,inverse:void 0}},commonCurrencies:{},exceptions:{exact:{404:n.BadRequest,missing_auth_signature:n.AuthenticationError,order_rejected:n.InvalidOrder,invalid_order_id:n.InvalidOrder,filter_lotsize_maxqty:n.InvalidOrder,filter_notional_min:n.InvalidOrder,failed_index_price_up_multiplier_filter:n.InvalidOrder,no_open_orders:n.InvalidOrder,active_position_not_found:n.InvalidOrder,position_inactive:n.InvalidOrder,invalid_position_id:n.InvalidOrder,"Internal server error":n.ExchangeError},broad:{"Bad Request":n.BadRequest}},precisionMode:a.kb})}async fetchStatus(e={}){const t=await this.v1PublicGetHealthcheckPing(e);let i;return i=this.safeBool(t,"success")?"ok":"error",{status:i,updated:void 0,eta:void 0,url:void 0,info:t}}async fetchTime(e={}){const t=await this.v1PublicGetHealthcheckPing(e);return this.safeInteger(t,"t")}async fetchMarkets(e={}){const t={type:"perps"},i=[this.v1PublicGetCMarkets(this.extend(t,e)),this.v1PublicGetCMarketsMetadata(this.extend(t,e))],s=await Promise.all(i),r=this.safeList(s[0],"data"),a=this.indexBy(r,"market"),o=this.safeList(s[1],"data");for(let e=0;e=0?p=this.safeString(e,"stopPrice"):m=this.safeString(e,"stopPrice"));const g=this.parse8601(this.safeString(e,"createdAt")),v=this.parse8601(this.safeString(e,"updatedAt"));return this.safeOrder({id:i,clientOrderId:s,timestamp:g,datetime:this.iso8601(g),lastTradeTimestamp:v,lastUpdateTimestamp:v,status:this.parseOrderStatus(h),symbol:a,type:d,timeInForce:f,postOnly:this.safeBool(e,"postOnly"),reduceOnly:this.safeBool(e,"reduceOnly"),side:c,price:o,triggerPrice:m,takeProfitPrice:p,stopLossPrice:void 0,average:u,amount:n,filled:l,remaining:void 0,cost:void 0,trades:void 0,fee:{cost:this.safeString(e,"totalFee"),currency:"USDC"},info:e},t)}async cancelOrder(e,t=void 0,i={}){await this.loadMarkets();const s={orderId:e,idType:"orderId"},r=this.safeStringN(i,["clOrdID","clientOrderId","client_order_id"]),a=void 0!==r;if(a){if(void 0===t)throw new n.ArgumentsRequired(this.id+" cancelOrder() requires a symbol argument");const e=this.market(t);s.orderId=r,s.idType="clientOrderId",s.symbol=e.id}i=this.omit(i,["clOrdID","clientOrderId","client_order_id"]);const o=await this.v1PrivateDeleteApiOrderOrderId(this.extend(s,i)),d={symbol:t};return a?d.clientOrderId=r:d.id=e,this.extend(this.parseOrder(o),d)}async cancelAllOrders(e=void 0,t={}){await this.loadMarkets();const i={symbols:[this.market(e).id]},s=await this.v1PrivateDeleteApiOrdersAllOpen(this.extend(i,t));return[this.safeOrder({info:s})]}async fetchPosition(e,t={}){if(void 0===e)throw new n.ArgumentsRequired(this.id+" fetchPosition() requires a symbol argument");await this.loadMarkets();const i=this.market(e),s={symbol:i.id},r=await this.v1PrivateGetApiPositionActive(this.extend(s,t)),a=this.safeList(r,"data",[]),o=this.safeDict(a,0,{});return this.parsePosition(o,i)}async fetchPositions(e=void 0,t={}){await this.loadMarkets();const i=await this.v1PrivateGetApiPositionActive(t),s=this.safeList(i,"data",[]);return this.parsePositions(s,e)}parsePosition(e,t=void 0){const i=this.safeString(e,"symbol");t=this.safeMarket(i,t);const s=r.Y.stringAbs(this.safeString(e,"quantity")),a=this.safeStringLower(e,"positionSide"),o=this.omitZero(this.safeString(e,"pnl")),n=this.omitZero(this.safeString(e,"entryPrice")),d=this.safeString(e,"marginAmount");return this.safePosition({info:e,id:this.safeString(e,"positionId"),symbol:t.symbol,timestamp:void 0,datetime:void 0,lastUpdateTimestamp:void 0,initialMargin:this.parseNumber(d),initialMarginPercentage:void 0,maintenanceMargin:void 0,maintenanceMarginPercentage:void 0,entryPrice:this.parseNumber(n),notional:void 0,leverage:void 0,unrealizedPnl:this.parseNumber(o),realizedPnl:void 0,contracts:this.parseNumber(s),contractSize:this.safeNumber(t,"contractSize"),marginRatio:void 0,liquidationPrice:void 0,markPrice:void 0,lastPrice:void 0,collateral:void 0,marginMode:void 0,side:a,percentage:void 0,stopLossPrice:void 0,takeProfitPrice:void 0,hedged:void 0})}async fetchOrder(e,t=void 0,i={}){await this.loadMarkets();const s={orderId:e,idType:"orderId"},r=this.safeStringN(i,["clOrdID","clientOrderId","client_order_id"]);if(i=this.omit(i,["clOrdID","clientOrderId","client_order_id"]),void 0!==r){if(void 0===t)throw new n.ArgumentsRequired(this.id+" fetchOrder() requires a symbol argument");const e=this.market(t);s.orderId=r,s.idType="clientOrderId",s.symbol=e.id}const a=await this.v1PrivateGetApiOrderOrderId(this.extend(s,i)),o=this.safeDict(a,"data");return this.parseOrder(o)}async fetchOrders(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();const r={};if(void 0!==e){const t=this.market(e);r.symbols=t.id}const a=this.safeInteger(s,"until");if(void 0!==a&&(s=this.omit(s,"until"),r.end=this.iso8601(a)),void 0!==t&&(r.start=this.iso8601(t)),void 0!==i){const e=100;i=Math.min(e,i),r.pageSize=i}const o=await this.v1PrivateGetApiOrders(this.extend(r,s)),n=this.safeList(o,"data",[]);return this.parseOrders(n,void 0,t,i)}async fetchOpenOrders(e=void 0,t=void 0,i=void 0,s={}){return await this.fetchOrders(e,t,i,this.extend({statuses:"OPEN"},s))}async fetchClosedOrders(e=void 0,t=void 0,i=void 0,s={}){return await this.fetchOrders(e,t,i,this.extend({statuses:"FILLED"},s))}async fetchCanceledOrders(e=void 0,t=void 0,i=void 0,s={}){return await this.fetchOrders(e,t,i,this.extend({statuses:"CANCELED"},s))}async closePosition(e,t=void 0,i={}){await this.loadMarkets();const s=this.safeString(i,"positionId");if(void 0===s)throw new n.ArgumentsRequired(this.id+" closePosition() requires a positionId");const r=this.safeStringUpper(i,"type");if(void 0===r)throw new n.ArgumentsRequired(this.id+" closePosition() requires a type");const a=this.safeString(i,"quantity");if(void 0===a)throw new n.ArgumentsRequired(this.id+" closePosition() requires a quantity");const o={positionId:s,type:r,quantity:a};if("MARKET"!==r){const e=this.safeString(i,"price");if(void 0===e)throw new n.ArgumentsRequired(this.id+" closePosition() requires a price");o.price=e}i=this.omit(i,["positionId","type","quantity","price"]);return await this.v1PrivateDeleteApiPositionPositionId(this.extend(o,i))}async closeAllPositions(e={}){await this.loadMarkets();const t=await this.v1PrivateDeleteApiPositionAll(e),i=this.safeList(t,"data",[]);return this.parsePositions(i,void 0,e)}async fetchLedger(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();let r=!1;if([r,s]=this.handleOptionAndParams(s,"fetchLedger","paginate"),r)return await this.fetchPaginatedCallDynamic("fetchLedger",e,t,i,s);const a={};a.start=void 0!==t?t:0;const o=this.safeInteger(s,"until");void 0!==o?(s=this.omit(s,"until"),a.end=o):a.end=this.milliseconds();const n=await this.v1PrivateGetApiWalletTransactions(this.extend(a,s)),d=this.safeList(n,"transactions",[]);return this.parseLedger(d,void 0,t,i)}parseLedgerEntry(e,t=void 0){const i=this.safeString(e,"amount"),s=this.safeString(e,"asset"),r=this.safeCurrencyCode(s,t);t=this.safeCurrency(s,t);const a=this.safeInteger(e,"timestamp"),o=this.safeString(e,"type");return this.safeLedgerEntry({info:e,id:this.safeString(e,"id"),direction:void 0,account:void 0,referenceAccount:void 0,referenceId:void 0,type:this.parseLedgerEntryType(o),currency:r,amount:this.parseNumber(i),timestamp:a,datetime:this.iso8601(a),before:void 0,after:void 0,status:void 0,fee:void 0},t)}parseLedgerEntryType(e){return this.safeString({FundingFee:"fee",FeeRebate:"fee",FeeKickback:"fee",RealizedPnl:"trade",LiquidationClearance:"trade",Transfer:"transfer",ReferralPayout:"referral",Commission:"commission"},e,e)}async withdraw(e,t,i,s=void 0,r={}){await this.loadMarkets();const a=this.currency(e),o={amount:this.currencyToPrecision(e,t),asset:a.id},n=await this.v1PrivatePostApiTransfersBridgeWithdrawal(this.extend(o,r));return this.parseTransaction(n,a)}parseTransaction(e,t=void 0){return{info:e,id:void 0,txid:this.safeString(e,"transactionId"),timestamp:void 0,datetime:void 0,network:void 0,address:void 0,addressTo:void 0,addressFrom:void 0,tag:void 0,tagTo:void 0,tagFrom:void 0,type:void 0,amount:void 0,currency:this.safeCurrencyCode(void 0,t),status:void 0,updated:void 0,internal:void 0,comment:void 0,fee:void 0}}async setLeverage(e,t=void 0,i={}){if(void 0===t)throw new n.ArgumentsRequired(this.id+" setLeverage() requires a symbol argument");await this.loadMarkets();const s={leverage:this.numberToString(e)},r=this.market(t);s.symbol=r.id;const a=await this.v1PrivatePostApiUsersMetadataLeverage(this.extend(s,i)),o=this.safeDict(a,"data",{});return this.parseLeverage(o,r)}parseLeverage(e,t=void 0){const i=this.safeString(e,"symbol"),s=this.safeInteger(e,"leverage");return{info:e,symbol:this.safeSymbol(i,t),marginMode:void 0,longLeverage:s,shortLeverage:s}}nonce(){return this.milliseconds()}sign(e,t="public",i="GET",s={},r=void 0,a=void 0){const n=t[0],d=t[1],h=this.implodeParams(e,s);let c=this.implodeHostname(this.urls.api[d]);if(c+="/"+n+"/",s=this.omit(s,this.extractParams(e)),s=this.keysort(s),"public"===d)c+="open/"+h,Object.keys(s).length&&(c+="?"+this.rawencode(s));else{this.checkRequiredCredentials(),r={"X-DEFX-SOURCE":"ccxt"},c+="auth/"+h;const t=this.milliseconds().toString();let n=t;"GET"===i||"api/order/{orderId}"===e?(n+=this.rawencode(s),Object.keys(s).length&&(c+="?"+this.rawencode(s))):(void 0!==s&&(n+=a=this.json(s)),r["Content-Type"]="application/json");const d=this.hmac(this.encode(n),this.encode(this.secret),o.s);r["X-DEFX-APIKEY"]=this.apiKey,r["X-DEFX-TIMESTAMP"]=t,r["X-DEFX-SIGNATURE"]=d}return{url:c,method:i,body:a,headers:r}}handleErrors(e,t,i,s,r,a,o,n,d){if(!o)return;const h=this.safeBool(o,"success"),c=this.safeDict(o,"err",o),l=this.safeString2(c,"errorCode","code");if(!h){const e=this.id+" "+this.json(o);this.throwBroadlyMatchedException(this.exceptions.broad,a,e),this.throwExactlyMatchedException(this.exceptions.exact,l,e)}}defaultNetworkCodeForCurrency(e){const t=this.currency(e).networks,i=Object.keys(t);for(let e=0;e{i.d(t,{A:()=>d});var s=i(7227),r=i(2079),a=i(1579),o=i(5147),n=i(4852);class d extends s.A{describe(){return this.deepExtend(super.describe(),{id:"delta",name:"Delta Exchange",countries:["VC"],rateLimit:300,version:"v2",has:{CORS:void 0,spot:!0,margin:!1,swap:!0,future:!1,option:!0,addMargin:!0,cancelAllOrders:!0,cancelOrder:!0,closeAllPositions:!0,closePosition:!1,createOrder:!0,createReduceOnlyOrder:!0,editOrder:!0,fetchBalance:!0,fetchClosedOrders:!0,fetchCurrencies:!0,fetchDeposit:void 0,fetchDepositAddress:!0,fetchDepositAddresses:!1,fetchDepositAddressesByNetwork:!1,fetchDeposits:void 0,fetchFundingHistory:!1,fetchFundingRate:!0,fetchFundingRateHistory:!1,fetchFundingRates:!0,fetchGreeks:!0,fetchIndexOHLCV:!0,fetchLedger:!0,fetchLeverage:!0,fetchLeverageTiers:!1,fetchMarginMode:!0,fetchMarginModes:!1,fetchMarketLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!0,fetchMySettlementHistory:!1,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenInterest:!0,fetchOpenOrders:!0,fetchOption:!0,fetchOptionChain:!1,fetchOrderBook:!0,fetchPosition:!0,fetchPositionMode:!1,fetchPositions:!0,fetchPremiumIndexOHLCV:!1,fetchSettlementHistory:!0,fetchStatus:!0,fetchTicker:!0,fetchTickers:!0,fetchTime:!0,fetchTrades:!0,fetchTransfer:void 0,fetchTransfers:void 0,fetchUnderlyingAssets:!1,fetchVolatilityHistory:!1,fetchWithdrawal:void 0,fetchWithdrawals:void 0,reduceMargin:!0,setLeverage:!0,setMargin:!1,setMarginMode:!1,setPositionMode:!1,transfer:!1,withdraw:!1},timeframes:{"1m":"1m","3m":"3m","5m":"5m","15m":"15m","30m":"30m","1h":"1h","2h":"2h","4h":"4h","6h":"6h","1d":"1d","7d":"7d","1w":"1w","2w":"2w","1M":"30d"},urls:{logo:"https://user-images.githubusercontent.com/1294454/99450025-3be60a00-2931-11eb-9302-f4fd8d8589aa.jpg",test:{public:"https://testnet-api.delta.exchange",private:"https://testnet-api.delta.exchange"},api:{public:"https://api.delta.exchange",private:"https://api.delta.exchange"},www:"https://www.delta.exchange",doc:["https://docs.delta.exchange"],fees:"https://www.delta.exchange/fees",referral:"https://www.delta.exchange/app/signup/?code=IULYNB"},api:{public:{get:["assets","indices","products","products/{symbol}","tickers","tickers/{symbol}","l2orderbook/{symbol}","trades/{symbol}","stats","history/candles","history/sparklines","settings"]},private:{get:["orders","products/{product_id}/orders/leverage","positions/margined","positions","orders/history","fills","fills/history/download/csv","wallet/balances","wallet/transactions","wallet/transactions/download","wallets/sub_accounts_transfer_history","users/trading_preferences","sub_accounts","profile","deposits/address","orders/leverage"],post:["orders","orders/bracket","orders/batch","products/{product_id}/orders/leverage","positions/change_margin","positions/close_all","wallets/sub_account_balance_transfer","orders/cancel_after","orders/leverage"],put:["orders","orders/bracket","orders/batch","positions/auto_topup","users/update_mmp","users/reset_mmp"],delete:["orders","orders/all","orders/batch"]}},fees:{trading:{tierBased:!0,percentage:!0,taker:this.parseNumber("0.0015"),maker:this.parseNumber("0.0010"),tiers:{taker:[[this.parseNumber("0"),this.parseNumber("0.0015")],[this.parseNumber("100"),this.parseNumber("0.0013")],[this.parseNumber("250"),this.parseNumber("0.0013")],[this.parseNumber("1000"),this.parseNumber("0.001")],[this.parseNumber("5000"),this.parseNumber("0.0009")],[this.parseNumber("10000"),this.parseNumber("0.00075")],[this.parseNumber("20000"),this.parseNumber("0.00065")]],maker:[[this.parseNumber("0"),this.parseNumber("0.001")],[this.parseNumber("100"),this.parseNumber("0.001")],[this.parseNumber("250"),this.parseNumber("0.0009")],[this.parseNumber("1000"),this.parseNumber("0.00075")],[this.parseNumber("5000"),this.parseNumber("0.0006")],[this.parseNumber("10000"),this.parseNumber("0.0005")],[this.parseNumber("20000"),this.parseNumber("0.0005")]]}}},options:{networks:{TRC20:"TRC20(TRON)",BEP20:"BEP20(BSC)"}},features:{default:{sandbox:!0,createOrder:{marginMode:!1,triggerPrice:!0,triggerPriceType:{last:!0,mark:!0,index:!0},triggerDirection:!1,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:{triggerPriceType:void 0,price:!0},timeInForce:{IOC:!0,FOK:!0,PO:!0,GTD:!1},hedged:!1,selfTradePrevention:!1,trailing:!1,iceberg:!1,leverage:!1,marketBuyByCost:!1,marketBuyRequiresPrice:!1},createOrders:void 0,fetchMyTrades:{marginMode:!1,limit:100,daysBack:1e5,untilDays:1e5,symbolRequired:!1},fetchOrder:void 0,fetchOpenOrders:{marginMode:!1,limit:100,trigger:!1,trailing:!1,symbolRequired:!1},fetchOrders:void 0,fetchClosedOrders:{marginMode:!1,limit:500,daysBack:1e5,daysBackCanceled:1,untilDays:1e5,trigger:!1,trailing:!1,symbolRequired:!1},fetchOHLCV:{limit:2e3}},spot:{extends:"default"},swap:{linear:{extends:"default"},inverse:{extends:"default"}},future:{linear:{extends:"default"},inverse:{extends:"default"}}},precisionMode:a.kb,requiredCredentials:{apiKey:!0,secret:!0},exceptions:{exact:{insufficient_margin:r.InsufficientFunds,order_size_exceed_available:r.InvalidOrder,risk_limits_breached:r.BadRequest,invalid_contract:r.BadSymbol,immediate_liquidation:r.InvalidOrder,out_of_bankruptcy:r.InvalidOrder,self_matching_disrupted_post_only:r.InvalidOrder,immediate_execution_post_only:r.InvalidOrder,bad_schema:r.BadRequest,invalid_api_key:r.AuthenticationError,invalid_signature:r.AuthenticationError,open_order_not_found:r.OrderNotFound,unavailable:r.ExchangeNotAvailable},broad:{}}})}createExpiredOptionMarket(e){const t="USDT",i=e.split("-"),s=e.split("/");let r,a,o;e.indexOf("/")>-1?(r=this.safeString(s,0),a=this.safeString(i,1),o=this.safeString(i,3)):(r=this.safeString(i,1),a=this.safeString(i,3),o=this.safeString(i,0)),void 0!==a&&(a=a.slice(4)+a.slice(2,4)+a.slice(0,2));const n=t,d=this.safeString(i,2),h=this.convertExpireDate(a),c=this.parse8601(h);return{id:o+"-"+r+"-"+d+"-"+a,symbol:r+"/"+t+":"+n+"-"+a+"-"+d+"-"+o,base:r,quote:t,settle:n,baseId:r,quoteId:t,settleId:n,active:!1,type:"option",linear:void 0,inverse:void 0,spot:!1,swap:!1,future:!1,option:!0,margin:!1,contract:!0,contractSize:this.parseNumber("1"),expiry:c,expiryDatetime:h,optionType:"C"===o?"call":"put",strike:this.parseNumber(d),precision:{amount:void 0,price:void 0},limits:{amount:{min:void 0,max:void 0},price:{min:void 0,max:void 0},cost:{min:void 0,max:void 0}},info:void 0}}safeMarket(e=void 0,t=void 0,i=void 0,s=void 0){return void 0!==e&&(e.endsWith("-C")||e.endsWith("-P")||e.startsWith("C-")||e.startsWith("P-"))&&!(e in this.markets_by_id)?this.createExpiredOptionMarket(e):super.safeMarket(e,t,i,s)}async fetchTime(e={}){const t=await this.publicGetSettings(e),i=this.safeDict(t,"result",{});return this.safeIntegerProduct(i,"server_time",.001)}async fetchStatus(e={}){const t=await this.publicGetSettings(e),i=this.safeDict(t,"result",{});return{status:"true"===this.safeString(i,"under_maintenance")?"maintenance":"ok",updated:this.safeIntegerProduct(i,"server_time",.001,this.milliseconds()),eta:void 0,url:void 0,info:t}}async fetchCurrencies(e={}){const t=await this.publicGetAssets(e),i=this.safeList(t,"result",[]),s={};for(let e=0;e{i.d(t,{A:()=>h});var s=i(4012),r=i(1579),a=i(2079),o=i(5147),n=i(4852),d=i(8995);class h extends s.A{describe(){return this.deepExtend(super.describe(),{id:"deribit",name:"Deribit",countries:["NL"],version:"v2",userAgent:void 0,rateLimit:50,pro:!0,has:{CORS:!0,spot:!1,margin:!1,swap:!0,future:!0,option:!0,cancelAllOrders:!0,cancelOrder:!0,cancelOrders:!1,createDepositAddress:!0,createOrder:!0,createReduceOnlyOrder:!0,createStopLimitOrder:!0,createStopMarketOrder:!0,createStopOrder:!0,createTrailingAmountOrder:!0,editOrder:!0,fetchAccounts:!0,fetchBalance:!0,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchClosedOrders:!0,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!0,fetchDeposit:!1,fetchDepositAddress:!0,fetchDepositAddresses:!1,fetchDepositAddressesByNetwork:!1,fetchDeposits:!0,fetchDepositWithdrawFees:!0,fetchFundingRate:!0,fetchFundingRateHistory:!0,fetchGreeks:!0,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchLeverageTiers:!1,fetchLiquidations:!0,fetchMarginMode:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMyLiquidations:!0,fetchMySettlementHistory:!1,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenOrders:!0,fetchOption:!0,fetchOptionChain:!0,fetchOrder:!0,fetchOrderBook:!0,fetchOrders:!1,fetchOrderTrades:!0,fetchPosition:!0,fetchPositionMode:!1,fetchPositions:!0,fetchPremiumIndexOHLCV:!1,fetchStatus:!0,fetchTicker:!0,fetchTickers:!0,fetchTime:!0,fetchTrades:!0,fetchTradingFee:!1,fetchTradingFees:!0,fetchTransactions:!1,fetchTransfer:!1,fetchTransfers:!0,fetchUnderlyingAssets:!1,fetchVolatilityHistory:!0,fetchWithdrawal:!1,fetchWithdrawals:!0,sandbox:!0,transfer:!0,withdraw:!0},timeframes:{"1m":"1","3m":"3","5m":"5","10m":"10","15m":"15","30m":"30","1h":"60","2h":"120","3h":"180","6h":"360","12h":"720","1d":"1D"},urls:{test:{rest:"https://test.deribit.com"},logo:"https://user-images.githubusercontent.com/1294454/41933112-9e2dd65a-798b-11e8-8440-5bab2959fcb8.jpg",api:{rest:"https://www.deribit.com"},www:"https://www.deribit.com",doc:["https://docs.deribit.com/v2","https://github.com/deribit"],fees:"https://www.deribit.com/pages/information/fees",referral:{url:"https://www.deribit.com/reg-1189.4038",discount:.1}},api:{public:{get:{auth:1,exchange_token:1,fork_token:1,set_heartbeat:1,disable_heartbeat:1,get_time:1,hello:1,status:1,test:1,subscribe:1,unsubscribe:1,unsubscribe_all:1,get_announcements:1,get_book_summary_by_currency:1,get_book_summary_by_instrument:1,get_contract_size:1,get_currencies:1,get_delivery_prices:1,get_funding_chart_data:1,get_funding_rate_history:1,get_funding_rate_value:1,get_historical_volatility:1,get_index:1,get_index_price:1,get_index_price_names:1,get_instrument:1,get_instruments:1,get_last_settlements_by_currency:1,get_last_settlements_by_instrument:1,get_last_trades_by_currency:1,get_last_trades_by_currency_and_time:1,get_last_trades_by_instrument:1,get_last_trades_by_instrument_and_time:1,get_mark_price_history:1,get_order_book:1,get_trade_volumes:1,get_tradingview_chart_data:1,get_volatility_index_data:1,ticker:1}},private:{get:{logout:1,enable_cancel_on_disconnect:1,disable_cancel_on_disconnect:1,get_cancel_on_disconnect:1,subscribe:1,unsubscribe:1,unsubscribe_all:1,change_api_key_name:1,change_scope_in_api_key:1,change_subaccount_name:1,create_api_key:1,create_subaccount:1,disable_api_key:1,disable_tfa_for_subaccount:1,enable_affiliate_program:1,enable_api_key:1,get_access_log:1,get_account_summary:1,get_account_summaries:1,get_affiliate_program_info:1,get_email_language:1,get_new_announcements:1,get_portfolio_margins:1,get_position:1,get_positions:1,get_subaccounts:1,get_subaccounts_details:1,get_transaction_log:1,list_api_keys:1,remove_api_key:1,remove_subaccount:1,reset_api_key:1,set_announcement_as_read:1,set_api_key_as_default:1,set_email_for_subaccount:1,set_email_language:1,set_password_for_subaccount:1,toggle_notifications_from_subaccount:1,toggle_subaccount_login:1,execute_block_trade:4,get_block_trade:1,get_last_block_trades_by_currency:1,invalidate_block_trade_signature:1,verify_block_trade:4,buy:4,sell:4,edit:4,edit_by_label:4,cancel:4,cancel_all:4,cancel_all_by_currency:4,cancel_all_by_instrument:4,cancel_by_label:4,close_position:4,get_margins:1,get_mmp_config:1,get_open_orders_by_currency:1,get_open_orders_by_instrument:1,get_order_history_by_currency:1,get_order_history_by_instrument:1,get_order_margin_by_ids:1,get_order_state:1,get_stop_order_history:1,get_trigger_order_history:1,get_user_trades_by_currency:1,get_user_trades_by_currency_and_time:1,get_user_trades_by_instrument:1,get_user_trades_by_instrument_and_time:1,get_user_trades_by_order:1,reset_mmp:1,set_mmp_config:1,get_settlement_history_by_instrument:1,get_settlement_history_by_currency:1,cancel_transfer_by_id:1,cancel_withdrawal:1,create_deposit_address:1,get_current_deposit_address:1,get_deposits:1,get_transfers:1,get_withdrawals:1,submit_transfer_to_subaccount:1,submit_transfer_to_user:1,withdraw:1}}},features:{default:{sandbox:!0,createOrder:{marginMode:!1,triggerPrice:!0,triggerPriceType:{last:!0,mark:!0,index:!0},triggerDirection:!1,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!0,FOK:!0,PO:!0,GTD:!0},hedged:!1,selfTradePrevention:!1,trailing:!0,leverage:!1,marketBuyByCost:!0,marketBuyRequiresPrice:!1,iceberg:!0},createOrders:void 0,fetchMyTrades:{marginMode:!1,limit:100,daysBack:1e5,untilDays:1e5,symbolRequired:!0},fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!0},fetchOpenOrders:{marginMode:!1,limit:void 0,trigger:!1,trailing:!1,symbolRequired:!0},fetchOrders:void 0,fetchClosedOrders:{marginMode:!1,limit:100,daysBack:1e5,daysBackCanceled:1,untilDays:1e5,trigger:!1,trailing:!1,symbolRequired:!0},fetchOHLCV:{limit:1e3}},spot:{extends:"default"},swap:{linear:{extends:"default"},inverse:{extends:"default"}},future:{linear:{extends:"default"},inverse:{extends:"default"}}},exceptions:{9999:a.PermissionDenied,1e4:a.AuthenticationError,10001:a.ExchangeError,10002:a.InvalidOrder,10003:a.InvalidOrder,10004:a.OrderNotFound,10005:a.InvalidOrder,10006:a.InvalidOrder,10007:a.InvalidOrder,10008:a.InvalidOrder,10009:a.InsufficientFunds,10010:a.OrderNotFound,10011:a.InvalidOrder,10012:a.InvalidOrder,10013:a.PermissionDenied,10014:a.PermissionDenied,10015:a.PermissionDenied,10016:a.PermissionDenied,10017:a.PermissionDenied,10018:a.PermissionDenied,10019:a.PermissionDenied,10020:a.ExchangeError,10021:a.InvalidOrder,10022:a.InvalidOrder,10023:a.InvalidOrder,10024:a.InvalidOrder,10025:a.InvalidOrder,10026:a.InvalidOrder,10027:a.InvalidOrder,10028:a.DDoSProtection,10029:a.OrderNotFound,10030:a.ExchangeError,10031:a.ExchangeError,10032:a.InvalidOrder,10033:a.NotSupported,10034:a.InvalidOrder,10035:a.InvalidOrder,10036:a.InvalidOrder,10040:a.ExchangeNotAvailable,10041:a.OnMaintenance,10043:a.InvalidOrder,10044:a.InvalidOrder,10045:a.InvalidOrder,10046:a.InvalidOrder,10047:a.DDoSProtection,10048:a.ExchangeError,11008:a.InvalidOrder,11029:a.BadRequest,11030:a.ExchangeError,11031:a.ExchangeError,11035:a.DDoSProtection,11036:a.InvalidOrder,11037:a.BadRequest,11038:a.InvalidOrder,11039:a.InvalidOrder,11041:a.InvalidOrder,11042:a.PermissionDenied,11043:a.BadRequest,11044:a.InvalidOrder,11045:a.BadRequest,11046:a.BadRequest,11047:a.BadRequest,11048:a.ExchangeError,11049:a.BadRequest,11050:a.BadRequest,11051:a.OnMaintenance,11052:a.ExchangeError,11053:a.ExchangeError,11090:a.InvalidAddress,11091:a.InvalidAddress,11092:a.InvalidAddress,11093:a.DDoSProtection,11094:a.ExchangeError,11095:a.ExchangeError,11096:a.ExchangeError,12e3:a.AuthenticationError,12001:a.DDoSProtection,12002:a.ExchangeError,12998:a.AuthenticationError,12003:a.AuthenticationError,12004:a.AuthenticationError,12005:a.AuthenticationError,12100:a.ExchangeError,12999:a.AuthenticationError,13e3:a.AuthenticationError,13001:a.AuthenticationError,13002:a.PermissionDenied,13003:a.AuthenticationError,13004:a.AuthenticationError,13005:a.AuthenticationError,13006:a.AuthenticationError,13007:a.AuthenticationError,13008:a.ExchangeError,13009:a.AuthenticationError,13010:a.BadRequest,13011:a.BadRequest,13012:a.PermissionDenied,13013:a.BadRequest,13014:a.BadRequest,13015:a.BadRequest,13016:a.BadRequest,13017:a.ExchangeError,13018:a.ExchangeError,13019:a.ExchangeError,13020:a.ExchangeError,13021:a.PermissionDenied,13025:a.ExchangeError,"-32602":a.BadRequest,"-32601":a.BadRequest,"-32700":a.BadRequest,"-32000":a.BadRequest,11054:a.InvalidOrder},precisionMode:r.kb,options:{code:"BTC",fetchBalance:{code:"BTC"},transfer:{method:"privateGetSubmitTransferToSubaccount"}}})}createExpiredOptionMarket(e){let t,i="USD";const s=e.split("-"),r=e.split("/");let a,o;e.indexOf("/")>-1?(a=this.safeString(r,0),o=this.safeString(s,1),e.indexOf("USDC")>-1&&(a+="_USDC")):(a=this.safeString(s,0),o=this.convertMarketIdExpireDate(this.safeString(s,1))),e.indexOf("USDC")>-1?(i="USDC",t="USDC"):t=a;let n=a;if(a.indexOf("_")>-1){const e=a.split("_");n=this.safeString(e,0)}const d=this.safeString(s,2),h=this.safeString(s,3),c=this.convertExpireDate(o),l=this.parse8601(c);return{id:a+"-"+this.convertExpireDateToMarketIdDate(o)+"-"+d+"-"+h,symbol:n+"/"+i+":"+t+"-"+o+"-"+d+"-"+h,base:a,quote:i,settle:t,baseId:a,quoteId:i,settleId:t,active:!1,type:"option",linear:void 0,inverse:void 0,spot:!1,swap:!1,future:!1,option:!0,margin:!1,contract:!0,contractSize:void 0,expiry:l,expiryDatetime:c,optionType:"C"===h?"call":"put",strike:this.parseNumber(d),precision:{amount:void 0,price:void 0},limits:{amount:{min:void 0,max:void 0},price:{min:void 0,max:void 0},cost:{min:void 0,max:void 0}},info:void 0}}safeMarket(e=void 0,t=void 0,i=void 0,s=void 0){return void 0!==e&&(e.endsWith("-C")||e.endsWith("-P"))&&!(e in this.markets_by_id)?this.createExpiredOptionMarket(e):super.safeMarket(e,t,i,s)}async fetchTime(e={}){const t=await this.publicGetGetTime(e);return this.safeInteger(t,"result")}async fetchCurrencies(e={}){const t=await this.publicGetGetCurrencies(e),i=this.safeList(t,"result",[]),s={};for(let e=0;e=0,g=a.indexOf("option")>=0,v=a.indexOf("combo")>=0,y=this.safeInteger(t,"expiration_timestamp");let w,b,k,S,O=n,T="swap";if(m?T="future":g?T="option":o&&(T="spot"),o)O=l+"/"+u;else if(!v){if(O=l+"/"+u+":"+f,(g||m)&&(O=O+"-"+this.yymmdd(y,""),g)){w=this.safeNumber(t,"strike"),b=this.safeString(t,"option_type");const e="call"===b?"C":"P";O=O+"-"+this.numberToString(w)+"-"+e}k=u!==f,S=f===u}if(this.safeValue(s,O))continue;s[O]=!0;const P=this.safeNumber(t,"min_trade_amount"),M=this.safeNumber(t,"tick_size");i.push({id:n,symbol:O,base:l,quote:u,settle:f,baseId:d,quoteId:h,settleId:c,type:T,spot:o,margin:!1,swap:p,future:m,option:g,active:this.safeValue(t,"is_active"),contract:!o,linear:S,inverse:k,taker:this.safeNumber(t,"taker_commission"),maker:this.safeNumber(t,"maker_commission"),contractSize:this.safeNumber(t,"contract_size"),expiry:y,expiryDatetime:this.iso8601(y),strike:w,optionType:b,precision:{amount:P,price:M},limits:{leverage:{min:void 0,max:void 0},amount:{min:P,max:void 0},price:{min:M,max:void 0},cost:{min:void 0,max:void 0}},created:this.safeInteger(t,"creation_timestamp"),info:t})}}return i}parseBalance(e){const t={info:e};let i=[];i="summaries"in e?this.safeList(e,"summaries"):[e];for(let e=0;e0){const s=t[0],r=t[i-1];s.continuation=e,r.continuation=e,t[0]=s,t[i-1]=r}}return t}async fetchMyLiquidations(e=void 0,t=void 0,i=void 0,s={}){if(void 0===e)throw new a.ArgumentsRequired(this.id+" fetchMyLiquidations() requires a symbol argument");await this.loadMarkets();const r=this.market(e);if(r.spot)throw new a.NotSupported(this.id+" fetchMyLiquidations() does not support "+r.type+" markets");const o={instrument_name:r.id,type:"bankruptcy"};void 0!==t&&(o.search_start_timestamp=t),void 0!==i&&(o.count=i);const n=await this.privateGetGetSettlementHistoryByInstrument(this.extend(o,s)),d=this.safeValue(n,"result",{}),h=this.safeList(d,"settlements",[]);return this.parseLiquidations(h,r,t,i)}parseLiquidation(e,t=void 0){const i=this.safeInteger(e,"timestamp");return this.safeLiquidation({info:e,symbol:this.safeSymbol(void 0,t),contracts:void 0,contractSize:this.safeNumber(t,"contractSize"),price:void 0,baseValue:this.safeNumber(e,"session_bankrupcy"),quoteValue:void 0,timestamp:i,datetime:this.iso8601(i)})}async fetchGreeks(e,t={}){await this.loadMarkets();const i=this.market(e),s={instrument_name:i.id},r=await this.publicGetTicker(this.extend(s,t)),a=this.safeValue(r,"result",{});return this.parseGreeks(a,i)}parseGreeks(e,t=void 0){const i=this.safeInteger(e,"timestamp"),s=this.safeString(e,"instrument_name"),r=this.safeSymbol(s,t),a=this.safeValue(e,"greeks",{});return{symbol:r,timestamp:i,datetime:this.iso8601(i),delta:this.safeNumber(a,"delta"),gamma:this.safeNumber(a,"gamma"),theta:this.safeNumber(a,"theta"),vega:this.safeNumber(a,"vega"),rho:this.safeNumber(a,"rho"),bidSize:this.safeNumber(e,"best_bid_amount"),askSize:this.safeNumber(e,"best_ask_amount"),bidImpliedVolatility:this.safeNumber(e,"bid_iv"),askImpliedVolatility:this.safeNumber(e,"ask_iv"),markImpliedVolatility:this.safeNumber(e,"mark_iv"),bidPrice:this.safeNumber(e,"best_bid_price"),askPrice:this.safeNumber(e,"best_ask_price"),markPrice:this.safeNumber(e,"mark_price"),lastPrice:this.safeNumber(e,"last_price"),underlyingPrice:this.safeNumber(e,"underlying_price"),info:e}}async fetchOption(e,t={}){await this.loadMarkets();const i=this.market(e),s={instrument_name:i.id},r=await this.publicGetGetBookSummaryByInstrument(this.extend(s,t)),a=this.safeList(r,"result",[]),o=this.safeDict(a,0,{});return this.parseOption(o,void 0,i)}async fetchOptionChain(e,t={}){await this.loadMarkets();const i={currency:this.currency(e).id,kind:"option"},s=await this.publicGetGetBookSummaryByCurrency(this.extend(i,t)),r=this.safeList(s,"result",[]);return this.parseOptionChain(r,"base_currency","instrument_name")}parseOption(e,t=void 0,i=void 0){const s=this.safeString(e,"instrument_name");i=this.safeMarket(s,i);const r=this.safeString(e,"base_currency"),a=this.safeCurrencyCode(r,t),o=this.safeInteger(e,"timestamp");return{info:e,currency:a,symbol:i.symbol,timestamp:o,datetime:this.iso8601(o),impliedVolatility:void 0,openInterest:this.safeNumber(e,"open_interest"),bidPrice:this.safeNumber(e,"bid_price"),askPrice:this.safeNumber(e,"ask_price"),midPrice:this.safeNumber(e,"mid_price"),markPrice:this.safeNumber(e,"mark_price"),lastPrice:this.safeNumber(e,"last"),underlyingPrice:this.safeNumber(e,"underlying_price"),change:void 0,percentage:this.safeNumber(e,"price_change"),baseVolume:this.safeNumber(e,"volume"),quoteVolume:this.safeNumber(e,"volume_usd")}}nonce(){return this.milliseconds()}sign(e,t="public",i="GET",s={},r=void 0,a=void 0){let o="/api/"+this.version+"/"+t+"/"+e;if("public"===t&&Object.keys(s).length&&(o+="?"+this.urlencode(s)),"private"===t){this.checkRequiredCredentials();const e=this.nonce().toString(),t=this.milliseconds().toString(),a="";Object.keys(s).length&&(o+="?"+this.urlencode(s));const d=t+"\n"+e+"\n"+(i+"\n"+o+"\n"+a+"\n"),h=this.hmac(this.encode(d),this.encode(this.secret),n.s);r={Authorization:"deri-hmac-sha256 id="+this.apiKey+",ts="+t+",sig="+h+",nonce="+e}}return{url:this.urls.api.rest+o,method:i,body:a,headers:r}}handleErrors(e,t,i,s,r,o,n,d,h){if(!n)return;const c=this.safeValue(n,"error");if(void 0!==c){const e=this.safeString(c,"code"),t=this.id+" "+o;throw this.throwExactlyMatchedException(this.exceptions,e,t),new a.ExchangeError(t)}}}},1839:(e,t,i)=>{i.d(t,{A:()=>c});var s=i(970),r=i(5147),a=i(2079),o=i(8283),n=i(8432),d=i(987),h=i(1579);class c extends s.A{describe(){return this.deepExtend(super.describe(),{id:"derive",name:"derive",countries:[],version:"v1",rateLimit:50,certified:!1,pro:!0,dex:!0,has:{CORS:void 0,spot:!1,margin:!1,swap:!1,future:!1,option:!1,addMargin:!1,borrowCrossMargin:!1,borrowIsolatedMargin:!1,cancelAllOrders:!0,cancelAllOrdersAfter:!1,cancelOrder:!0,cancelOrders:!1,cancelOrdersForSymbols:!1,closeAllPositions:!1,closePosition:!1,createMarketBuyOrderWithCost:!1,createMarketOrderWithCost:!1,createMarketSellOrderWithCost:!1,createOrder:!0,createOrders:!1,createReduceOnlyOrder:!1,createStopOrder:!1,createTriggerOrder:!1,editOrder:!0,fetchAccounts:!1,fetchBalance:!0,fetchBorrowInterest:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchCanceledAndClosedOrders:!1,fetchCanceledOrders:!0,fetchClosedOrders:!0,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!0,fetchDepositAddress:!1,fetchDepositAddresses:!1,fetchDeposits:!0,fetchDepositWithdrawFee:"emulated",fetchDepositWithdrawFees:!1,fetchFundingHistory:!0,fetchFundingRate:!0,fetchFundingRateHistory:!0,fetchFundingRates:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchLedger:!0,fetchLeverage:!1,fetchLeverageTiers:!1,fetchLiquidations:!1,fetchMarginMode:void 0,fetchMarketLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMyLiquidations:!1,fetchMyTrades:!0,fetchOHLCV:!1,fetchOpenInterest:!1,fetchOpenInterestHistory:!1,fetchOpenInterests:!1,fetchOpenOrders:!0,fetchOrder:!1,fetchOrderBook:!1,fetchOrders:!0,fetchOrderTrades:!0,fetchPosition:!1,fetchPositionMode:!1,fetchPositions:!0,fetchPositionsRisk:!1,fetchPremiumIndexOHLCV:!1,fetchTicker:!0,fetchTickers:!1,fetchTime:!0,fetchTrades:!0,fetchTradingFee:!1,fetchTradingFees:!1,fetchTransfer:!1,fetchTransfers:!1,fetchWithdrawal:!1,fetchWithdrawals:!0,reduceMargin:!1,repayCrossMargin:!1,repayIsolatedMargin:!1,sandbox:!0,setLeverage:!1,setMarginMode:!1,setPositionMode:!1,transfer:!1,withdraw:!1},timeframes:{"1m":"1m","3m":"3m","5m":"5m","15m":"15m","30m":"30m","1h":"1h","2h":"2h","4h":"4h","8h":"8h","12h":"12h","1d":"1d","3d":"3d","1w":"1w","1M":"1M"},hostname:"derive.xyz",urls:{logo:"https://github.com/user-attachments/assets/f835b95f-033a-43dd-b6bb-24e698fc498c",api:{public:"https://api.lyra.finance/public",private:"https://api.lyra.finance/private"},test:{public:"https://api-demo.lyra.finance/public",private:"https://api-demo.lyra.finance/private"},www:"https://www.derive.xyz/",doc:"https://docs.derive.xyz/docs/",fees:"https://docs.derive.xyz/reference/fees-1/",referral:"https://www.derive.xyz/invite/3VB0B"},api:{public:{get:["get_all_currencies"],post:["build_register_session_key_tx","register_session_key","deregister_session_key","login","statistics","get_all_currencies","get_currency","get_instrument","get_all_instruments","get_instruments","get_ticker","get_latest_signed_feeds","get_option_settlement_prices","get_spot_feed_history","get_spot_feed_history_candles","get_funding_rate_history","get_trade_history","get_option_settlement_history","get_liquidation_history","get_interest_rate_history","get_transaction","get_margin","margin_watch","validate_invite_code","get_points","get_all_points","get_points_leaderboard","get_descendant_tree","get_tree_roots","get_swell_percent_points","get_vault_assets","get_etherfi_effective_balances","get_kelp_effective_balances","get_bridge_balances","get_ethena_participants","get_vault_share","get_vault_statistics","get_vault_balances","estimate_integrator_points","create_subaccount_debug","deposit_debug","withdraw_debug","send_quote_debug","execute_quote_debug","get_invite_code","register_invite","get_time","get_live_incidents","get_maker_programs","get_maker_program_scores"]},private:{post:["get_account","create_subaccount","get_subaccount","get_subaccounts","get_all_portfolios","change_subaccount_label","get_notificationsv","update_notifications","deposit","withdraw","transfer_erc20","transfer_position","transfer_positions","order","replace","order_debug","get_order","get_orders","get_open_orders","cancel","cancel_by_label","cancel_by_nonce","cancel_by_instrument","cancel_all","cancel_trigger_order","get_order_history","get_trade_history","get_deposit_history","get_withdrawal_history","send_rfq","cancel_rfq","cancel_batch_rfqs","get_rfqs","poll_rfqs","send_quote","cancel_quote","cancel_batch_quotes","get_quotes","poll_quotes","execute_quote","rfq_get_best_quote","get_margin","get_collaterals","get_positions","get_option_settlement_history","get_subaccount_value_history","expired_and_cancelled_history","get_funding_history","get_interest_history","get_erc20_transfer_history","get_liquidation_history","liquidate","get_liquidator_history","session_keys","edit_session_key","register_scoped_session_key","get_mmp_config","set_mmp_config","reset_mmp","set_cancel_on_disconnect","get_invite_code","register_invite"]}},fees:{},requiredCredentials:{apiKey:!1,secret:!1,walletAddress:!0,privateKey:!0},exceptions:{exact:{"-32000":a.RateLimitExceeded,"-32100":a.RateLimitExceeded,"-32700":a.BadRequest,"-32600":a.BadRequest,"-32601":a.BadRequest,"-32602":a.InvalidOrder,"-32603":a.InvalidOrder,9e3:a.InvalidOrder,1e4:a.BadRequest,10001:a.BadRequest,10002:a.BadRequest,10003:a.BadRequest,10004:a.InvalidOrder,10005:a.BadRequest,10006:a.BadRequest,10007:a.BadRequest,10008:a.BadRequest,10009:a.BadRequest,10010:a.InvalidOrder,10011:a.InsufficientFunds,10012:a.InsufficientFunds,10013:a.ExchangeError,10014:a.ExchangeError,11e3:a.InsufficientFunds,11002:a.InvalidOrder,11003:a.InvalidOrder,11004:a.InvalidOrder,11005:a.InvalidOrder,11006:a.OrderNotFound,11007:a.InvalidOrder,11008:a.InvalidOrder,11009:a.InvalidOrder,11010:a.InvalidOrder,11011:a.InvalidOrder,11012:a.InvalidOrder,11013:a.InvalidOrder,11014:a.InvalidOrder,11015:a.InvalidOrder,11016:a.InvalidOrder,11017:a.InvalidOrder,11018:a.InvalidOrder,11019:a.InvalidOrder,11020:a.InsufficientFunds,11021:a.InvalidOrder,11022:a.InvalidOrder,11023:a.InvalidOrder,11024:a.InvalidOrder,11025:a.InvalidOrder,11026:a.BadRequest,11027:a.InvalidOrder,11028:a.InvalidOrder,11050:a.InvalidOrder,11051:a.InvalidOrder,11052:a.InvalidOrder,11053:a.InvalidOrder,11054:a.InvalidOrder,11055:a.InvalidOrder,11100:a.InvalidOrder,11101:a.InvalidOrder,11102:a.InvalidOrder,11103:a.InvalidOrder,11104:a.InvalidOrder,11105:a.InvalidOrder,11106:a.InvalidOrder,11107:a.InvalidOrder,11200:a.InvalidOrder,11201:a.InvalidOrder,11202:a.InvalidOrder,11203:a.InvalidOrder,12e3:a.InvalidOrder,12001:a.InvalidOrder,12002:a.BadRequest,12003:a.BadRequest,13e3:a.BadRequest,14e3:a.BadRequest,14001:a.InvalidOrder,14002:a.BadRequest,14008:a.BadRequest,14009:a.BadRequest,14010:a.BadRequest,14011:a.BadRequest,14012:a.BadRequest,14013:a.BadRequest,14014:a.InvalidOrder,14015:a.BadRequest,14016:a.BadRequest,14017:a.BadRequest,14018:a.BadRequest,14019:a.BadRequest,14020:a.BadRequest,14021:a.BadRequest,14022:a.AuthenticationError,14023:a.InvalidOrder,14024:a.BadRequest,14025:a.BadRequest,14026:a.BadRequest,14027:a.AuthenticationError,14028:a.BadRequest,14029:a.AuthenticationError,14030:a.BadRequest,14031:a.AuthenticationError,14032:a.BadRequest,16e3:a.AuthenticationError,16001:a.AuthenticationError,16100:a.AuthenticationError,17e3:a.BadRequest,17001:a.BadRequest,17002:a.BadRequest,17003:a.BadRequest,17004:a.BadRequest,17005:a.BadRequest,17006:a.BadRequest,17007:a.BadRequest,18e3:a.BadRequest,18001:a.BadRequest,18002:a.BadRequest,18003:a.BadRequest,18004:a.BadRequest,18005:a.BadRequest,18006:a.BadRequest,18007:a.BadRequest,19e3:a.BadRequest},broad:{}},precisionMode:h.kb,commonCurrencies:{},options:{deriveWalletAddress:"",id:"0x0ad42b8e602c2d3d475ae52d678cf63d84ab2749"}})}setSandboxMode(e){super.setSandboxMode(e),this.options.sandboxMode=e}async fetchTime(e={}){const t=await this.publicPostGetTime(e);return this.safeInteger(t,"result")}async fetchCurrencies(e={}){const t={},i=await this.publicGetGetAllCurrencies(e),s=this.safeList(i,"result",[]);for(let e=0;e1e3&&(i=1e3),r.page_size=i),void 0!==t&&(r.from_timestamp=t);const o=this.safeInteger(s,"until");s=this.omit(s,["until"]),void 0!==o&&(r.to_timestamp=o);const n=await this.publicPostGetTradeHistory(this.extend(r,s)),d=this.safeDict(n,"result",{}),h=this.safeList(d,"trades",[]);return this.parseTrades(h,a,t,i)}parseTrade(e,t=void 0){const i=this.safeString(e,"instrument_name"),s=this.safeSymbol(i,t),r=this.safeInteger(e,"timestamp"),a={currency:"USDC",cost:this.safeString(e,"trade_fee")};return this.safeTrade({info:e,id:this.safeString(e,"trade_id"),order:this.safeString(e,"order_id"),symbol:s,side:this.safeStringLower(e,"direction"),type:void 0,takerOrMaker:this.safeString(e,"liquidity_role"),price:this.safeString(e,"trade_price"),amount:this.safeString(e,"trade_amount"),cost:void 0,timestamp:r,datetime:this.iso8601(r),fee:a},t)}async fetchFundingRateHistory(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();const r=this.market(e),a={instrument_name:r.id};void 0!==t&&(a.start_timestamp=t);const o=this.safeInteger(s,"until");s=this.omit(s,["until"]),void 0!==o&&(a.to_timestamp=o);const n=await this.publicPostGetFundingRateHistory(this.extend(a,s)),d=this.safeDict(n,"result",{}),h=this.safeList(d,"funding_rate_history",[]),c=[];for(let e=0;ethis.safeInteger(e,"num_pages"))return[]}const u=this.safeList(c,"orders");return this.parseOrders(u,d,t,i)}async fetchOpenOrders(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();const r=this.extend(s,{status:"open"});return await this.fetchOrders(e,t,i,r)}async fetchClosedOrders(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();const r=this.extend(s,{status:"filled"});return await this.fetchOrders(e,t,i,r)}async fetchCanceledOrders(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();const r=this.extend(s,{status:"cancelled"});return await this.fetchOrders(e,t,i,r)}parseTimeInForce(e){return this.safeString({ioc:"IOC",fok:"FOK",gtc:"GTC",post_only:"PO"},e,void 0)}parseOrderStatus(e){if(void 0!==e){const t={open:"open",untriggered:"open",filled:"closed",cancelled:"canceled",expired:"rejected"};return this.safeString(t,e,e)}return e}parseOrder(e,t=void 0){let i=this.safeDict(e,"data");void 0===i&&(i=e);const s=this.safeInteger2(e,"creation_timestamp","nonce"),r=this.safeString(i,"order_id"),a=this.safeString(i,"instrument_name");void 0!==a&&(t=this.safeMarket(a,t));const o=t.symbol,n=this.safeString(i,"limit_price"),d=this.safeString(i,"average_price"),h=this.safeString(i,"desired_amount"),c=this.safeString(i,"filled_amount"),l=this.safeString(i,"order_fee"),u=this.safeStringLower(i,"order_type"),f=this.safeBool(i,"is_bid");let p=this.safeString(i,"direction");void 0===p&&(p=f?"buy":"sell");const m=this.safeString(i,"trigger_type");let g,v,y;void 0!==m&&(y=this.safeString(i,"trigger_price"),"stoploss"===m?g=y:v=y);const w=this.safeInteger(e,"last_update_timestamp"),b=this.safeString(i,"order_status"),k=this.safeString(i,"time_in_force");return this.safeOrder({id:r,clientOrderId:this.safeString(i,"label"),timestamp:s,datetime:this.iso8601(s),lastTradeTimestamp:void 0,lastUpdateTimestamp:w,status:this.parseOrderStatus(b),symbol:o,type:u,timeInForce:this.parseTimeInForce(k),postOnly:void 0,reduceOnly:this.safeBool(i,"reduce_only"),side:p,price:n,triggerPrice:y,takeProfitPrice:v,stopLossPrice:g,average:d,amount:h,filled:c,remaining:void 0,cost:void 0,trades:void 0,fee:{cost:l,currency:"USDC"},info:i},t)}async fetchOrderTrades(e,t=void 0,i=void 0,s=void 0,r={}){let a;await this.loadMarkets(),[a,r]=this.handleDeriveSubaccountId("fetchOrderTrades",r);const o={order_id:e,subaccount_id:a};let n;void 0!==t&&(n=this.market(t),o.instrument_name=n.id),void 0!==s&&(o.page_size=s),void 0!==i&&(o.from_timestamp=i);const d=await this.privatePostGetTradeHistory(this.extend(o,r)),h=this.safeDict(d,"result",{}),c=this.safeList(h,"trades",[]);return this.parseTrades(c,n,i,s,r)}async fetchMyTrades(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();let r,a=!1;if([a,s]=this.handleOptionAndParams(s,"fetchMyTrades","paginate"),a)return await this.fetchPaginatedCallIncremental("fetchMyTrades",e,t,i,s,"page",500);[r,s]=this.handleDeriveSubaccountId("fetchMyTrades",s);const o={subaccount_id:r};let n;void 0!==e&&(n=this.market(e),o.instrument_name=n.id),void 0!==i&&(o.page_size=i),void 0!==t&&(o.from_timestamp=t);const d=await this.privatePostGetTradeHistory(this.extend(o,s)),h=this.safeDict(d,"result",{}),c=this.safeInteger(s,"page");if(void 0!==c){const e=this.safeDict(h,"pagination");if(c>this.safeInteger(e,"num_pages"))return[]}const l=this.safeList(h,"trades",[]);return this.parseTrades(l,n,t,i,s)}async fetchPositions(e=void 0,t={}){let i;await this.loadMarkets(),[i,t]=this.handleDeriveSubaccountId("fetchPositions",t);const s={subaccount_id:i};t=this.omit(t,["subaccount_id"]);const r=await this.privatePostGetPositions(this.extend(s,t)),a=this.safeDict(r,"result",{}),o=this.safeList(a,"positions",[]);return this.parsePositions(o,e)}parsePosition(e,t=void 0){const i=this.safeString(e,"instrument_name");t=this.safeMarket(i,t);let s,a=this.safeString(e,"amount");s=r.A.stringGt(a,"0")?"long":"short";const o=this.safeString(t,"contractSize"),n=this.safeString(e,"mark_price"),d=this.safeInteger(e,"creation_timestamp"),h=this.safeString(e,"unrealized_pnl");a=r.A.stringAbs(a);const c=r.A.stringMul(a,n);return this.safePosition({info:e,id:void 0,symbol:this.safeString(t,"symbol"),timestamp:d,datetime:this.iso8601(d),lastUpdateTimestamp:void 0,initialMargin:this.safeString(e,"initial_margin"),initialMarginPercentage:void 0,maintenanceMargin:this.safeString(e,"maintenance_margin"),maintenanceMarginPercentage:void 0,entryPrice:void 0,notional:this.parseNumber(c),leverage:this.safeNumber(e,"leverage"),unrealizedPnl:this.parseNumber(h),contracts:this.parseNumber(a),contractSize:this.parseNumber(o),marginRatio:void 0,liquidationPrice:this.safeNumber(e,"liquidation_price"),markPrice:this.parseNumber(n),lastPrice:void 0,collateral:void 0,marginMode:void 0,side:s,percentage:void 0,hedged:void 0,stopLossPrice:void 0,takeProfitPrice:void 0})}async fetchFundingHistory(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();let r,a=!1;if([a,s]=this.handleOptionAndParams(s,"fetchFundingHistory","paginate"),a)return await this.fetchPaginatedCallIncremental("fetchFundingHistory",e,t,i,s,"page",500);[r,s]=this.handleDeriveSubaccountId("fetchFundingHistory",s);const o={subaccount_id:r};let n;void 0!==e&&(n=this.market(e),o.instrument_name=n.id),void 0!==t&&(o.start_timestamp=t),void 0!==i&&(o.page_size=i);const d=await this.privatePostGetFundingHistory(this.extend(o,s)),h=this.safeDict(d,"result",{}),c=this.safeInteger(s,"page");if(void 0!==c){const e=this.safeDict(h,"pagination");if(c>this.safeInteger(e,"num_pages"))return[]}const l=this.safeList(h,"events",[]);return this.parseIncomes(l,n,t,i)}parseIncome(e,t=void 0){const i=this.safeString(e,"instrument_name"),s=this.safeSymbol(i,t),r=this.safeString(e,"funding"),a=this.safeCurrencyCode("USDC"),o=this.safeInteger(e,"timestamp");return{info:e,symbol:s,code:a,timestamp:o,datetime:this.iso8601(o),id:void 0,amount:void 0,rate:r}}async fetchBalance(e={}){let t;await this.loadMarkets(),[t,e]=this.handleDeriveWalletAddress("fetchBalance",e);const i={wallet:t},s=await this.privatePostGetAllPortfolios(this.extend(i,e)),r=this.safeList(s,"result");return this.parseBalance(r)}parseBalance(e){const t={info:e};for(let i=0;i Developers tab.")}handleErrors(e,t,i,s,r,o,n,d,h){if(!n)return;const c=this.safeDict(n,"error");if(void 0!==c){const e=this.safeString(c,"code"),t=this.id+" "+this.json(n);throw this.throwBroadlyMatchedException(this.exceptions.broad,o,t),this.throwExactlyMatchedException(this.exceptions.exact,e,t),new a.ExchangeError(t)}}sign(e,t="public",i="GET",s={},r=void 0,a=void 0){const o=this.urls.api[t]+"/"+e;if("POST"===i){if(r={"Content-Type":"application/json"},"private"===t){const e=this.milliseconds().toString(),t=this.signMessage(e,this.privateKey);r["X-LyraWallet"]=this.safeString(this.options,"deriveWalletAddress"),r["X-LyraTimestamp"]=e,r["X-LyraSignature"]=t}a=this.json(s)}return{url:o,method:i,body:a,headers:r}}}},779:(e,t,i)=>{i.d(t,{A:()=>d});var s=i(9420),r=i(2079),a=i(1579),o=i(5147),n=i(4852);class d extends s.A{describe(){return this.deepExtend(super.describe(),{id:"digifinex",name:"DigiFinex",countries:["SG"],version:"v3",rateLimit:900,has:{CORS:void 0,spot:!0,margin:!0,swap:!0,future:!1,option:!1,addMargin:!0,cancelOrder:!0,cancelOrders:!0,createMarketBuyOrderWithCost:!0,createMarketOrderWithCost:!1,createMarketSellOrderWithCost:!1,createOrder:!0,createOrders:!0,createPostOnlyOrder:!0,createReduceOnlyOrder:!0,createStopLimitOrder:!1,createStopMarketOrder:!1,createStopOrder:!1,fetchBalance:!0,fetchBorrowInterest:!0,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchCrossBorrowRate:!0,fetchCrossBorrowRates:!0,fetchCurrencies:!0,fetchDepositAddress:!0,fetchDepositAddresses:!1,fetchDepositAddressesByNetwork:!1,fetchDeposits:!0,fetchDepositWithdrawFee:"emulated",fetchDepositWithdrawFees:!0,fetchFundingHistory:!0,fetchFundingInterval:!0,fetchFundingIntervals:!1,fetchFundingRate:!0,fetchFundingRateHistory:!0,fetchFundingRates:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchLedger:!0,fetchLeverage:!1,fetchLeverageTiers:!0,fetchMarginMode:!1,fetchMarketLeverageTiers:!0,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenOrders:!0,fetchOrder:!0,fetchOrderBook:!0,fetchOrders:!0,fetchPosition:!0,fetchPositionMode:!1,fetchPositions:!0,fetchPositionsRisk:!1,fetchPremiumIndexOHLCV:!1,fetchStatus:!0,fetchTicker:!0,fetchTickers:!0,fetchTime:!0,fetchTrades:!0,fetchTradingFee:!0,fetchTradingFees:!1,fetchTransfers:!0,fetchWithdrawals:!0,reduceMargin:!0,setLeverage:!0,setMargin:!1,setMarginMode:!0,setPositionMode:!1,transfer:!0,withdraw:!0},timeframes:{"1m":"1","5m":"5","15m":"15","30m":"30","1h":"60","4h":"240","12h":"720","1d":"1D","1w":"1W"},urls:{logo:"https://user-images.githubusercontent.com/51840849/87443315-01283a00-c5fe-11ea-8628-c2a0feaf07ac.jpg",api:{rest:"https://openapi.digifinex.com"},www:"https://www.digifinex.com",doc:["https://docs.digifinex.com"],fees:"https://digifinex.zendesk.com/hc/en-us/articles/360000328422-Fee-Structure-on-DigiFinex",referral:"https://www.digifinex.com/en-ww/from/DhOzBg?channelCode=ljaUPp"},api:{public:{spot:{get:["{market}/symbols","kline","margin/currencies","margin/symbols","markets","order_book","ping","spot/symbols","time","trades","trades/symbols","ticker","currencies"]},swap:{get:["public/api_weight","public/candles","public/candles_history","public/depth","public/funding_rate","public/funding_rate_history","public/instrument","public/instruments","public/ticker","public/tickers","public/time","public/trades"]}},private:{spot:{get:["{market}/financelog","{market}/mytrades","{market}/order","{market}/order/detail","{market}/order/current","{market}/order/history","margin/assets","margin/financelog","margin/mytrades","margin/order","margin/order/current","margin/order/history","margin/positions","otc/financelog","spot/assets","spot/financelog","spot/mytrades","spot/order","spot/order/current","spot/order/history","deposit/address","deposit/history","withdraw/history"],post:["{market}/order/cancel","{market}/order/new","{market}/order/batch_new","margin/order/cancel","margin/order/new","margin/position/close","spot/order/cancel","spot/order/new","transfer","withdraw/new","withdraw/cancel"]},swap:{get:["account/balance","account/positions","account/finance_record","account/trading_fee_rate","account/transfer_record","account/funding_fee","trade/history_orders","trade/history_trades","trade/open_orders","trade/order_info"],post:["account/transfer","account/leverage","account/position_mode","account/position_margin","trade/batch_cancel_order","trade/batch_order","trade/cancel_order","trade/order_place","follow/sponsor_order","follow/close_order","follow/cancel_order","follow/user_center_current","follow/user_center_history","follow/expert_current_open_order","follow/add_algo","follow/cancel_algo","follow/account_available","follow/plan_task","follow/instrument_list"]}}},features:{default:{sandbox:!1,createOrder:{marginMode:!0,triggerPrice:!1,triggerPriceType:void 0,triggerDirection:!1,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!1,FOK:!1,PO:!0,GTD:!1},hedged:!1,selfTradePrevention:!1,trailing:!1,leverage:!1,marketBuyByCost:!1,marketBuyRequiresPrice:!1,iceberg:!1},createOrders:{max:10},fetchMyTrades:{marginMode:!0,limit:500,daysBack:1e5,untilDays:30,symbolRequired:!1},fetchOrder:{marginMode:!0,trigger:!1,trailing:!1,marketType:!0,symbolRequired:!0},fetchOpenOrders:{marginMode:!0,limit:void 0,trigger:!1,trailing:!1,symbolRequired:!1},fetchOrders:{marginMode:!0,limit:100,daysBack:1e5,untilDays:30,trigger:!1,trailing:!1,symbolRequired:!1},fetchClosedOrders:void 0,fetchOHLCV:{limit:500}},spot:{extends:"default"},forDerivatives:{extends:"default",createOrders:{max:20,marginMode:!1},fetchMyTrades:{marginMode:!1,limit:100,daysBack:1e5,untilDays:1e5},fetchOrder:{marginMode:!1},fetchOpenOrders:{marginMode:!1,limit:100},fetchOrders:{marginMode:!1,daysBack:1e5},fetchOHLCV:{limit:100}},swap:{linear:{extends:"forDerivatives"},inverse:{extends:"forDerivatives"}},future:{linear:void 0,inverse:void 0}},fees:{trading:{tierBased:!0,percentage:!0,maker:this.parseNumber("0.002"),taker:this.parseNumber("0.002")}},precisionMode:a.kb,exceptions:{exact:{10001:[r.BadRequest,"Wrong request method, please check it's a GET ot POST request"],10002:[r.AuthenticationError,"Invalid ApiKey"],10003:[r.AuthenticationError,"Sign doesn't match"],10004:[r.BadRequest,"Illegal request parameters"],10005:[r.DDoSProtection,"Request frequency exceeds the limit"],10006:[r.PermissionDenied,"Unauthorized to execute this request"],10007:[r.PermissionDenied,"IP address Unauthorized"],10008:[r.InvalidNonce,"Timestamp for this request is invalid, timestamp must within 1 minute"],10009:[r.NetworkError,"Unexist endpoint, please check endpoint URL"],10011:[r.AccountSuspended,"ApiKey expired. Please go to client side to re-create an ApiKey"],20001:[r.PermissionDenied,"Trade is not open for this trading pair"],20002:[r.PermissionDenied,"Trade of this trading pair is suspended"],20003:[r.InvalidOrder,"Invalid price or amount"],20007:[r.InvalidOrder,"Price precision error"],20008:[r.InvalidOrder,"Amount precision error"],20009:[r.InvalidOrder,"Amount is less than the minimum requirement"],20010:[r.InvalidOrder,"Cash Amount is less than the minimum requirement"],20011:[r.InsufficientFunds,"Insufficient balance"],20012:[r.BadRequest,"Invalid trade type, valid value: buy/sell)"],20013:[r.InvalidOrder,"No order info found"],20014:[r.BadRequest,"Invalid date, Valid format: 2018-07-25)"],20015:[r.BadRequest,"Date exceeds the limit"],20018:[r.PermissionDenied,"Your trading rights have been banned by the system"],20019:[r.BadSymbol,'Wrong trading pair symbol. Correct format:"usdt_btc". Quote asset is in the front'],20020:[r.DDoSProtection,"You have violated the API operation trading rules and temporarily forbid trading. At present, we have certain restrictions on the user's transaction rate and withdrawal rate."],5e4:[r.ExchangeError,"Exception error"],20021:[r.BadRequest,"Invalid currency"],20022:[r.BadRequest,"The ending timestamp must be larger than the starting timestamp"],20023:[r.BadRequest,"Invalid transfer type"],20024:[r.BadRequest,"Invalid amount"],20025:[r.BadRequest,"This currency is not transferable at the moment"],20026:[r.InsufficientFunds,"Transfer amount exceed your balance"],20027:[r.PermissionDenied,"Abnormal account status"],20028:[r.PermissionDenied,"Blacklist for transfer"],20029:[r.PermissionDenied,"Transfer amount exceed your daily limit"],20030:[r.BadRequest,"You have no position on this trading pair"],20032:[r.PermissionDenied,"Withdrawal limited"],20033:[r.BadRequest,"Wrong Withdrawal ID"],20034:[r.PermissionDenied,"Withdrawal service of this crypto has been closed"],20035:[r.PermissionDenied,"Withdrawal limit"],20036:[r.ExchangeError,"Withdrawal cancellation failed"],20037:[r.InvalidAddress,"The withdrawal address, Tag or chain type is not included in the withdrawal management list"],20038:[r.InvalidAddress,"The withdrawal address is not on the white list"],20039:[r.ExchangeError,"Can't be canceled in current status"],20040:[r.RateLimitExceeded,"Withdraw too frequently; limitation: 3 times a minute, 100 times a day"],20041:[r.PermissionDenied,"Beyond the daily withdrawal limit"],20042:[r.BadSymbol,"Current trading pair does not support API trading"],400002:[r.BadRequest,"Invalid Parameter"]},broad:{}},options:{defaultType:"spot",types:["spot","margin","otc"],createMarketBuyOrderRequiresPrice:!0,accountsByType:{spot:"1",margin:"2",OTC:"3"},networks:{ARBITRUM:"Arbitrum",AVALANCEC:"AVAX-CCHAIN",AVALANCEX:"AVAX-XCHAIN",BEP20:"BEP20",BSC:"BEP20",CARDANO:"Cardano",CELO:"Celo",CHILIZ:"Chiliz",COSMOS:"COSMOS",CRC20:"Crypto.com",CRONOS:"Crypto.com",DOGECOIN:"DogeChain",ERC20:"ERC20",ETH:"ERC20",ETHW:"ETHW",IOTA:"MIOTA",KLAYTN:"KLAY",MATIC:"Polygon",METIS:"MetisDAO",MOONBEAM:"GLMR",MOONRIVER:"Moonriver",OPTIMISM:"OPETH",POLYGON:"Polygon",RIPPLE:"XRP",SOLANA:"SOL",STELLAR:"Stella",TERRACLASSIC:"TerraClassic",TERRA:"Terra",TON:"Ton",TRC20:"TRC20",TRON:"TRC20",TRX:"TRC20",VECHAIN:"Vechain"},networksById:{TRC20:"TRC20",TRX:"TRC20",BEP20:"BEP20",BSC:"BEP20",ERC20:"ERC20",ETH:"ERC20",Polygon:"POLYGON","Crypto.com":"CRONOS"}},commonCurrencies:{BHT:"Black House Test",EPS:"Epanus",FREE:"FreeRossDAO",MBN:"Mobilian Coin",TEL:"TEL666"}})}async fetchCurrencies(e={}){const t=await this.publicSpotGetCurrencies(e),i=this.safeList(t,"data",[]),s=this.groupBy(i,"currency"),r=Object.keys(s),a={};for(let e=0;e1?(o=e[0],a=e[1]):a="limit"}return this.safeOrder({info:e,id:this.safeString2(e,"order_id","data"),clientOrderId:void 0,timestamp:i,datetime:this.iso8601(i),lastTradeTimestamp:s,symbol:d,type:a,timeInForce:r,postOnly:void 0,side:o,price:this.safeNumber(e,"price"),triggerPrice:void 0,amount:this.safeNumber2(e,"amount","size"),filled:this.safeNumber2(e,"executed_amount","filled_qty"),remaining:void 0,cost:void 0,average:this.safeNumber2(e,"avg_price","price_avg"),status:this.parseOrderStatus(this.safeString2(e,"status","state")),fee:{cost:this.safeNumber(e,"fee")},trades:void 0},t)}async fetchOpenOrders(e=void 0,t=void 0,i=void 0,s={}){let a,o;await this.loadMarkets(),void 0!==e&&(a=this.market(e)),[o,s]=this.handleMarketTypeAndParams("fetchOpenOrders",a,s);const[n,d]=this.handleMarginModeAndParams("fetchOpenOrders",s),h={},c="swap"===o;if(c?(void 0!==t&&(h.start_timestamp=t),void 0!==i&&(h.limit=i)):h.market=o,void 0!==a){h[c?"instrument_id":"symbol"]=a.id}let l;if(void 0!==n||"margin"===o)o="margin",l=await this.privateSpotGetMarginOrderCurrent(this.extend(h,d));else if("spot"===o)l=await this.privateSpotGetSpotOrderCurrent(this.extend(h,d));else{if("swap"!==o)throw new r.NotSupported(this.id+" fetchOpenOrders() not support this market type");l=await this.privateSwapGetTradeOpenOrders(this.extend(h,d))}const u=this.safeList(l,"data",[]);return this.parseOrders(u,a,t,i)}async fetchOrders(e=void 0,t=void 0,i=void 0,s={}){let a,o;await this.loadMarkets(),void 0!==e&&(a=this.market(e)),[o,s]=this.handleMarketTypeAndParams("fetchOrders",a,s);const[n,d]=this.handleMarginModeAndParams("fetchOrders",s),h={};if("swap"===o?void 0!==t&&(h.start_timestamp=t):(h.market=o,void 0!==t&&(h.start_time=this.parseToInt(t/1e3))),void 0!==a){h["swap"===o?"instrument_id":"symbol"]=a.id}let c;if(void 0!==i&&(h.limit=i),void 0!==n||"margin"===o)o="margin",c=await this.privateSpotGetMarginOrderHistory(this.extend(h,d));else if("spot"===o)c=await this.privateSpotGetSpotOrderHistory(this.extend(h,d));else{if("swap"!==o)throw new r.NotSupported(this.id+" fetchOrders() not support this market type");c=await this.privateSwapGetTradeHistoryOrders(this.extend(h,d))}const l=this.safeList(c,"data",[]);return this.parseOrders(l,a,t,i)}async fetchOrder(e,t=void 0,i={}){let s,a;await this.loadMarkets(),void 0!==t&&(s=this.market(t)),[a,i]=this.handleMarketTypeAndParams("fetchOrder",s,i);const[o,n]=this.handleMarginModeAndParams("fetchOrder",i),d={order_id:e};let h;if("swap"===a?void 0!==s&&(d.instrument_id=s.id):d.market=a,void 0!==o||"margin"===a)a="margin",h=await this.privateSpotGetMarginOrder(this.extend(d,n));else if("spot"===a)h=await this.privateSpotGetSpotOrder(this.extend(d,n));else{if("swap"!==a)throw new r.NotSupported(this.id+" fetchOrder() not support this market type");h=await this.privateSwapGetTradeOrderInfo(this.extend(d,n))}const c=this.safeValue(h,"data"),l="swap"===a?c:this.safeValue(c,0);if(void 0===l)throw new r.OrderNotFound(this.id+" fetchOrder() order "+e.toString()+" not found");return this.parseOrder(l,s)}async fetchMyTrades(e=void 0,t=void 0,i=void 0,s={}){let a;await this.loadMarkets();const o={};let n;void 0!==e&&(a=this.market(e)),[n,s]=this.handleMarketTypeAndParams("fetchMyTrades",a,s);const[d,h]=this.handleMarginModeAndParams("fetchMyTrades",s);"swap"===n?void 0!==t&&(o.start_timestamp=t):(o.market=n,void 0!==t&&(o.start_time=this.parseToInt(t/1e3)));let c;if(void 0!==e&&(o["swap"===n?"instrument_id":"symbol"]=a.id),void 0!==i&&(o.limit=i),void 0!==d||"margin"===n)n="margin",c=await this.privateSpotGetMarginMytrades(this.extend(o,h));else if("spot"===n)c=await this.privateSpotGetSpotMytrades(this.extend(o,h));else{if("swap"!==n)throw new r.NotSupported(this.id+" fetchMyTrades() not support this market type");c=await this.privateSwapGetTradeHistoryTrades(this.extend(o,h))}const l="swap"===n?"data":"list",u=this.safeList(c,l,[]);return this.parseTrades(u,a,t,i)}parseLedgerEntryType(e){return this.safeString({},e,e)}parseLedgerEntry(e,t=void 0){const i=this.parseLedgerEntryType(this.safeString2(e,"type","finance_type")),s=this.safeString2(e,"currency_mark","currency"),r=this.safeCurrencyCode(s,t);t=this.safeCurrency(s,t);const a=this.safeNumber2(e,"num","change"),o=this.safeNumber(e,"balance");let n=this.safeTimestamp(e,"time");return void 0===n&&(n=this.safeInteger(e,"timestamp")),this.safeLedgerEntry({info:e,id:void 0,direction:void 0,account:void 0,referenceId:void 0,referenceAccount:void 0,type:i,currency:r,amount:a,before:void 0,after:o,status:void 0,timestamp:n,datetime:this.iso8601(n),fee:void 0},t)}async fetchLedger(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();const a={};let o;[o,s]=this.handleMarketTypeAndParams("fetchLedger",void 0,s);const[n,d]=this.handleMarginModeAndParams("fetchLedger",s);"swap"===o?void 0!==t&&(a.start_timestamp=t):(a.market=o,void 0!==t&&(a.start_time=this.parseToInt(t/1e3)));const h="swap"===o?"currency":"currency_mark";let c,l,u;if(void 0!==e&&(c=this.currency(e),a[h]=c.id),void 0!==i&&(a.limit=i),void 0!==n||"margin"===o)o="margin",l=await this.privateSpotGetMarginFinancelog(this.extend(a,d));else if("spot"===o)l=await this.privateSpotGetSpotFinancelog(this.extend(a,d));else{if("swap"!==o)throw new r.NotSupported(this.id+" fetchLedger() not support this market type");l=await this.privateSwapGetAccountFinanceRecord(this.extend(a,d))}if("swap"===o)u=this.safeValue(l,"data",[]);else{const e=this.safeValue(l,"data",{});u=this.safeValue(e,"finance",[])}return this.parseLedger(u,c,t,i)}parseDepositAddress(e,t=void 0){const i=this.safeString(e,"address"),s=this.safeString(e,"addressTag"),r=this.safeStringUpper(e,"currency");return{info:e,currency:this.safeCurrencyCode(r),network:void 0,address:i,tag:s}}async fetchDepositAddress(e,t={}){await this.loadMarkets();const i=this.currency(e),s={currency:i.id},a=await this.privateSpotGetDepositAddress(this.extend(s,t)),o=this.safeValue(a,"data",[]),n=this.parseDepositAddresses(o,[i.code]),d=this.safeValue(n,e);if(void 0===d)throw new r.InvalidAddress(this.id+" fetchDepositAddress() did not return an address for "+e+" - create the deposit address in the user settings on the exchange website first.");return d}async fetchTransactionsByType(e,t=void 0,i=void 0,s=void 0,r={}){let a;await this.loadMarkets();const o={};let n;void 0!==t&&(a=this.currency(t),o.currency=a.id),void 0!==s&&(o.size=Math.min(500,s)),n="deposit"===e?await this.privateSpotGetDepositHistory(this.extend(o,r)):await this.privateSpotGetWithdrawHistory(this.extend(o,r));const d=this.safeList(n,"data",[]);return this.parseTransactions(d,a,i,s,{type:e})}async fetchDeposits(e=void 0,t=void 0,i=void 0,s={}){return await this.fetchTransactionsByType("deposit",e,t,i,s)}async fetchWithdrawals(e=void 0,t=void 0,i=void 0,s={}){return await this.fetchTransactionsByType("withdrawal",e,t,i,s)}parseTransactionStatus(e){return this.safeString({1:"pending",2:"pending",3:"ok",4:"failed"},e,e)}parseTransaction(e,t=void 0){const i=this.safeString2(e,"id","withdraw_id"),s=this.safeString(e,"address"),r=this.safeString(e,"memo"),a=this.safeString(e,"hash"),o=this.safeStringUpper(e,"currency"),n=this.safeCurrencyCode(o,t),d=this.parse8601(this.safeString(e,"created_date")),h=this.parse8601(this.safeString(e,"finished_date")),c=this.parseTransactionStatus(this.safeString(e,"state")),l=this.safeNumber(e,"amount"),u=this.safeNumber(e,"fee");let f;void 0!==u&&(f={currency:n,cost:u});const p=this.safeString(e,"chain");return{info:e,id:i,txid:a,timestamp:d,datetime:this.iso8601(d),network:p,address:s,addressTo:s,addressFrom:void 0,tag:r,tagTo:r,tagFrom:void 0,type:void 0,amount:l,currency:n,status:c,updated:h,internal:void 0,comment:void 0,fee:f}}parseTransferStatus(e){return this.safeString({0:"ok"},e,e)}parseTransfer(e,t=void 0){let i,s;const r=this.safeDict(e,"data",e),a=this.safeInteger(r,"type");1===a?(i="spot",s="swap"):2===a&&(i="swap",s="spot");const o=this.safeInteger(e,"timestamp");return{info:e,id:this.safeString(e,"transfer_id"),timestamp:o,datetime:this.iso8601(o),currency:this.safeCurrencyCode(this.safeString(r,"currency"),t),amount:this.safeNumber2(r,"amount","transfer_amount"),fromAccount:i,toAccount:s,status:this.parseTransferStatus(this.safeString(e,"code"))}}async transfer(e,t,i,s,a={}){await this.loadMarkets();const o=this.currency(e),n=o.id,d=this.safeValue(this.options,"accountsByType",{}),h=this.safeString(d,i,i),c=this.safeString(d,s,s),l={},u="swap"===i,f="swap"===s;let p;const m=this.currencyToPrecision(e,t);if(u||f){if("1"!==h&&"1"!==c)throw new r.ExchangeError(this.id+" transfer() supports transferring between spot and swap, spot and margin, spot and OTC only");l.type=f?1:2,l.currency=n,l.transfer_amount=m,p=await this.privateSwapPostAccountTransfer(this.extend(l,a))}else l.currency_mark=n,l.num=m,l.from=h,l.to=c,p=await this.privateSpotPostTransfer(this.extend(l,a));return this.parseTransfer(p,o)}async withdraw(e,t,i,s=void 0,r={}){[s,r]=this.handleWithdrawTagAndParams(s,r),this.checkAddress(i),await this.loadMarkets();const a=this.currency(e),o={address:i,amount:this.currencyToPrecision(e,t),currency:a.id};void 0!==s&&(o.memo=s);const n=await this.privateSpotPostWithdrawNew(this.extend(o,r));return this.parseTransaction(n,a)}async fetchBorrowInterest(e=void 0,t=void 0,i=void 0,s=void 0,r={}){await this.loadMarkets();const a={};let o;void 0!==t&&(o=this.market(t),a.symbol=o.id);const n=await this.privateSpotGetMarginPositions(this.extend(a,r)),d=this.safeValue(n,"positions"),h=this.parseBorrowInterests(d,o);return this.filterByCurrencySinceLimit(h,e,i,s)}parseBorrowInterest(e,t=void 0){const i=this.safeString(e,"symbol"),s=this.safeString(e,"amount"),r=this.safeString(e,"leverage_ratio"),a=o.Y.stringDiv(s,r),n=o.Y.stringSub(s,a),d=void 0===t?void 0:t.base;return{info:e,symbol:this.safeSymbol(i,t),currency:d,interest:void 0,interestRate:.001,amountBorrowed:this.parseNumber(n),marginMode:void 0,timestamp:void 0,datetime:void 0}}async fetchCrossBorrowRate(e,t={}){await this.loadMarkets();const i=await this.privateSpotGetMarginAssets(this.extend({},t)),s=this.safeValue(i,"list",[]);let r=[];for(let t=0;t1)throw new r.BadRequest(this.id+" fetchPositions() symbols argument cannot contain more than 1 symbol");t=e[0]}else t=e;s=this.market(t)}[a,t]=this.handleMarketTypeAndParams("fetchPositions",s,t);const[o,n]=this.handleMarginModeAndParams("fetchPositions",t);if(void 0!==o&&(a="margin"),void 0!==s){i["swap"===a?"instrument_id":"symbol"]=s.id}let d;if("spot"===a||"margin"===a)d=await this.privateSpotGetMarginPositions(this.extend(i,n));else{if("swap"!==a)throw new r.NotSupported(this.id+" fetchPositions() not support this market type");d=await this.privateSwapGetAccountPositions(this.extend(i,n))}const h="swap"===a?"data":"positions",c=this.safeValue(d,h,[]),l=[];for(let e=0;e100)throw new r.BadRequest(this.id+" leverage should be between 1 and 100");const a={instrument_id:s.id,leverage:e},o=this.safeString2(this.options,"marginMode","defaultMarginMode");let n=this.safeStringLower2(i,"marginMode","defaultMarginMode",o);if(void 0!==n&&(n="cross"===n?"crossed":"isolated",a.margin_mode=n,i=this.omit(i,["marginMode","defaultMarginMode"])),"isolated"===n){const e=this.safeString(i,"side");void 0!==e?(a.side=e,i=this.omit(i,"side")):this.checkRequiredArgument("setLeverage",e,"side",["long","short"])}return await this.privateSwapPostAccountLeverage(this.extend(a,i))}async fetchTransfers(e=void 0,t=void 0,i=void 0,s={}){let r;await this.loadMarkets();const a={};void 0!==e&&(r=this.safeCurrencyCode(e),a.currency=r.id),void 0!==t&&(a.start_timestamp=t),void 0!==i&&(a.limit=i);const o=await this.privateSwapGetAccountTransferRecord(this.extend(a,s)),n=this.safeList(o,"data",[]);return this.parseTransfers(n,r,t,i)}async fetchLeverageTiers(e=void 0,t={}){await this.loadMarkets();const i=await this.publicSwapGetPublicInstruments(t),s=this.safeValue(i,"data",[]);return e=this.marketSymbols(e),this.parseLeverageTiers(s,e,"instrument_id")}async fetchMarketLeverageTiers(e,t={}){await this.loadMarkets();const i=this.market(e);if(!i.swap)throw new r.BadRequest(this.id+" fetchMarketLeverageTiers() supports swap markets only");const s={instrument_id:i.id},a=await this.publicSwapGetPublicInstrument(this.extend(s,t)),o=this.safeValue(a,"data",{});return this.parseMarketLeverageTiers(o,i)}parseMarketLeverageTiers(e,t=void 0){const i=[],s=this.safeValue(e,"open_max_limits",{});for(let r=0;r{i.d(t,{A:()=>c});var s=i(6351),r=i(2079),a=i(6414),o=i(8283),n=i(5147),d=i(4852),h=i(1579);class c extends s.A{describe(){return this.deepExtend(super.describe(),{id:"ellipx",name:"Ellipx",countries:["PL"],rateLimit:200,version:"v1",certified:!1,pro:!1,has:{CORS:void 0,spot:!0,margin:!1,swap:!1,future:!1,option:!1,addMargin:!1,borrowCrossMargin:!1,borrowIsolatedMargin:!1,borrowMargin:!1,cancelAllOrders:!1,cancelAllOrdersAfter:!1,cancelOrder:!0,cancelOrders:!1,cancelWithdraw:!1,closeAllPositions:!1,closePosition:!1,createConvertTrade:!1,createDepositAddress:!1,createMarketBuyOrderWithCost:!1,createMarketOrder:!1,createMarketOrderWithCost:!1,createMarketSellOrderWithCost:!1,createOrder:!0,createOrderWithTakeProfitAndStopLoss:!1,createOrderWithTakeProfitAndStopLossWs:!1,createPostOnlyOrder:!1,createReduceOnlyOrder:!1,createStopLimitOrder:!1,createStopLossOrder:!1,createStopMarketOrder:!1,createStopOrder:!1,createTakeProfitOrder:!1,createTrailingAmountOrder:!1,createTrailingPercentOrder:!1,createTriggerOrder:!1,fetchAccounts:!1,fetchBalance:!0,fetchBorrowInterest:!1,fetchBorrowRate:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchBorrowRates:!1,fetchBorrowRatesPerSymbol:!1,fetchCanceledAndClosedOrders:!1,fetchCanceledOrders:!1,fetchClosedOrder:!1,fetchClosedOrders:!1,fetchConvertCurrencies:!1,fetchConvertQuote:!1,fetchConvertTrade:!1,fetchConvertTradeHistory:!1,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!0,fetchDepositAddress:!0,fetchDeposits:!1,fetchDepositsWithdrawals:!1,fetchFundingHistory:!1,fetchFundingInterval:!1,fetchFundingIntervals:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchGreeks:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchIsolatedPositions:!1,fetchLedger:!1,fetchLeverage:!1,fetchLeverages:!1,fetchLeverageTiers:!1,fetchLiquidations:!1,fetchLongShortRatio:!1,fetchLongShortRatioHistory:!1,fetchMarginAdjustmentHistory:!1,fetchMarginMode:!1,fetchMarginModes:!1,fetchMarketLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMarkPrices:!1,fetchMyLiquidations:!1,fetchMySettlementHistory:!1,fetchMyTrades:!1,fetchOHLCV:!0,fetchOpenInterest:!1,fetchOpenInterestHistory:!1,fetchOpenInterests:!1,fetchOpenOrder:!1,fetchOpenOrders:!0,fetchOption:!1,fetchOptionChain:!1,fetchOrder:!0,fetchOrderBook:!0,fetchOrders:!0,fetchOrderTrades:!0,fetchPosition:!1,fetchPositionHistory:!1,fetchPositionMode:!1,fetchPositions:!1,fetchPositionsForSymbol:!1,fetchPositionsHistory:!1,fetchPositionsRisk:!1,fetchPremiumIndexOHLCV:!1,fetchSettlementHistory:!1,fetchStatus:!1,fetchTicker:!0,fetchTickers:!1,fetchTime:!1,fetchTrades:!0,fetchTradingFee:!0,fetchTradingFees:!1,fetchTransactions:!1,fetchTransfers:!1,fetchVolatilityHistory:!1,fetchWithdrawals:!1,reduceMargin:!1,repayCrossMargin:!1,repayIsolatedMargin:!1,repayMargin:!1,sandbox:!1,setLeverage:!1,setMargin:!1,setMarginMode:!1,setPositionMode:!1,transfer:!1,withdraw:!0},timeframes:{"1m":"1m","5m":"5m","10m":"10m","1h":"1h","6h":"6h","12h":"12h","1d":"1d"},urls:{logo:"https://github.com/user-attachments/assets/e07c3f40-281c-4cdf-bacf-fa1c58218a2c",api:{public:"https://data.ellipx.com",private:"https://app.ellipx.com/_rest",_rest:"https://app.ellipx.com/_rest"},www:"https://www.ellipx.com",doc:"https://docs.google.com/document/d/1ZXzTQYffKE_EglTaKptxGQERRnunuLHEMmar7VC9syM",fees:"https://www.ellipx.com/pages/pricing",referral:""},api:{_rest:{get:{Market:1,"Market/{currencyPair}":1,"Crypto/Token/Info":1}},public:{get:{"Market/{currencyPair}:getDepth":1,"Market/{currencyPair}:ticker":1,"Market/{currencyPair}:getTrades":1,"Market/{currencyPair}:getGraph":1,"CMC:summary":1,"CMC/{currencyPair}:ticker":1}},private:{get:{"User/Wallet":1,"Market/{currencyPair}/Order":1,"Market/Order/{orderUuid}":1,"Market/{currencyPair}/Trade":1,"Market/TradeFee:query":1,"Unit/{currency}":1,"Crypto/Token/{currency}":1,"Crypto/Token/{currency}:chains":1},post:{"Market/{currencyPair}/Order":1,"Crypto/Address:fetch":1,"Crypto/Disbursement:withdraw":1},delete:{"Market/Order/{orderUuid}":1}}},fees:{trading:{tierBased:!0,feeSide:"get",percentage:!0,maker:this.parseNumber("0.0025"),taker:this.parseNumber("0.0030"),tiers:{maker:[[this.parseNumber("0"),this.parseNumber("0.0025")],[this.parseNumber("10000"),this.parseNumber("0.0020")],[this.parseNumber("50000"),this.parseNumber("0.0015")],[this.parseNumber("100000"),this.parseNumber("0.0010")],[this.parseNumber("1000000"),this.parseNumber("0.0008")],[this.parseNumber("5000000"),this.parseNumber("0.0003")],[this.parseNumber("15000000"),this.parseNumber("0.0000")],[this.parseNumber("75000000"),this.parseNumber("0.0000")],[this.parseNumber("100000000"),this.parseNumber("0.0000")]],taker:[[this.parseNumber("0"),this.parseNumber("0.0030")],[this.parseNumber("10000"),this.parseNumber("0.0025")],[this.parseNumber("50000"),this.parseNumber("0.0020")],[this.parseNumber("100000"),this.parseNumber("0.0015")],[this.parseNumber("1000000"),this.parseNumber("0.0012")],[this.parseNumber("5000000"),this.parseNumber("0.0010")],[this.parseNumber("15000000"),this.parseNumber("0.0008")],[this.parseNumber("75000000"),this.parseNumber("0.0005")],[this.parseNumber("100000000"),this.parseNumber("0.0003")]]}},stablecoin:{tierBased:!1,percentage:!0,maker:this.parseNumber("0.0000"),taker:this.parseNumber("0.000015")}},options:{defaultType:"spot",recvWindow:5e3,broker:"CCXT",networks:{Bitcoin:"Bitcoin",Ethereum:"ERC20"},defaultNetwork:"defaultNetwork",defaultNetworkCodeReplacements:{BTC:"Bitcoin",ETH:"Ethereum"}},features:{spot:{sandbox:!1,createOrder:{marginMode:!1,triggerPrice:!1,triggerPriceType:void 0,triggerDirection:!1,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!1,FOK:!1,PO:!1,GTD:!1},hedged:!1,selfTradePrevention:!1,trailing:!1,leverage:!1,marketBuyByCost:!0,marketBuyRequiresPrice:!1,iceberg:!1},createOrders:void 0,fetchMyTrades:void 0,fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!1},fetchOpenOrders:{marginMode:!1,limit:void 0,trigger:!1,trailing:!1,symbolRequired:!0},fetchOrders:{marginMode:!1,limit:void 0,daysBack:void 0,untilDays:void 0,trigger:!1,trailing:!1,symbolRequired:!0},fetchClosedOrders:void 0,fetchOHLCV:{limit:100}},swap:{linear:void 0,inverse:void 0},future:{linear:void 0,inverse:void 0}},commonCurrencies:{},exceptions:{exact:{400:r.BadRequest,401:r.AuthenticationError,403:r.PermissionDenied,404:r.BadRequest,429:r.DDoSProtection,418:r.PermissionDenied,500:r.ExchangeError,504:r.ExchangeError},broad:{}},precisionMode:h.kb})}sign(e,t="public",i="GET",s={},r=void 0,n=void 0){e=this.implodeParams(e,s);let h=this.urls.api[t]+"/"+e;if("private"===t){this.checkRequiredCredentials();const t=this.uuid(),r=this.seconds().toString();n="GET"===i?"":this.json(s),s=this.extend({_key:this.apiKey,_time:r,_nonce:t},s);const h=this.urlencode(s),c=this.hash(this.encode(n),d.s),l=this.base16ToBinary(c),u=this.numberToBE(0,1),f=[this.encode(i),u,this.encode(e),u,this.encode(h),u,l],p=this.binaryConcatArray(f),m=this.secret,g=this.calculateMod(m.length,4),v=g?4-g:0;let y=this.secret.replaceAll("-","+");y=y.replaceAll("_","/"),y=y.padEnd(this.secret.length+v,"=");const w=this.base64ToBinary(y),b=this.arraySlice(w,0,32),k=(0,o.q4)(p,b,a.ev);s._sign=k}return Object.keys(s).length&&(h+="?"+this.urlencode(s)),"GET"===i?n=void 0:r={"Content-Type":"application/json"},{url:h,method:i,body:n,headers:r}}calculateMod(e,t){return e%t}async fetchMarkets(e={}){const t=await this._restGetMarket(e),i=this.safeValue(t,"data",[]);return this.parseMarkets(i)}parseMarket(e){const t=this.safeString(e,"Key"),i=this.safeString(e.Primary,"Key"),s=this.safeString(e.Secondary,"Key"),r=this.safeString(e.Primary,"Crypto_Token__"),a=this.safeString(e.Secondary,"Crypto_Token__"),o="active"===this.safeString(e,"Status"),n=this.safeTimestamp(e.Created,"unix"),d=this.parseNumber(this.parsePrecision(this.safeString(e.Primary,"Decimals"))),h=this.parseNumber(this.parsePrecision(this.safeString(e.Secondary,"Decimals"))),c=this.fees;return this.safeMarketStructure({id:t,symbol:i+"/"+s,base:i,quote:s,settle:void 0,baseId:r,quoteId:a,settleId:void 0,type:"spot",spot:!0,margin:!1,swap:!1,future:!1,option:!1,active:o,contract:!1,linear:void 0,inverse:void 0,taker:c.trading.taker,maker:c.trading.maker,contractSize:void 0,expiry:void 0,expiryDatetime:void 0,strike:void 0,optionType:void 0,precision:{amount:d,price:h},limits:{amount:{min:void 0,max:void 0},price:{min:void 0,max:void 0},cost:{min:void 0,max:void 0}},info:e,created:n})}async fetchTicker(e,t={}){await this.loadMarkets();const i=this.market(e),s={currencyPair:i.id},r=await this.publicGetMarketCurrencyPairTicker(this.extend(s,t)),a=this.safeValue(r.data,"ticker",{});return this.parseTicker(a,i)}parseTicker(e,t=void 0){const i=this.safeIntegerProduct(e,"time",1e3),s=this.parseAmount(this.safeValue(e,"open")),r=this.parseAmount(this.safeValue(e,"high")),a=this.parseAmount(this.safeValue(e,"low")),o=this.parseAmount(this.safeValue(e,"close")),n=this.parseAmount(this.safeValue(e,"avg")),d=this.parseAmount(this.safeValue(e,"vwap")),h=this.parseAmount(this.safeValue(e,"vol")),c=this.parseAmount(this.safeValue(e,"secvol"));return this.safeTicker({symbol:this.safeSymbol(void 0,t),timestamp:i,datetime:this.iso8601(i),high:r,low:a,bid:void 0,bidVolume:void 0,ask:void 0,askVolume:void 0,vwap:d,open:s,close:o,last:o,previousClose:void 0,change:void 0,percentage:void 0,average:n,baseVolume:h,quoteVolume:c,info:e},t)}async fetchOrderBook(e,t=void 0,i={}){await this.loadMarkets();const s={currencyPair:this.market(e).id},r=await this.publicGetMarketCurrencyPairGetDepth(this.extend(s,i)),a=this.safeValue(r,"data",{}),o=this.milliseconds(),n=a.bids.length,d=a.asks.length;for(let e=0;e0){const e=s[0],t=this.safeDict(e,"Balance_Date",{});i.timestamp=this.safeInteger(t,"unixms"),i.datetime=this.iso8601(i.timestamp)}for(let e=0;e{i.d(t,{A:()=>r});var s=i(6042);class r extends s.A{describe(){return this.deepExtend(super.describe(),{id:"eterex",name:"Eterex",countries:["IR"],rateLimit:1e3,version:"1",certified:!1,pro:!1,has:{CORS:void 0,spot:!0,margin:!1,swap:!1,future:!1,option:!1,addMargin:!1,cancelAllOrders:!1,cancelOrder:!1,cancelOrders:!1,createDepositAddress:!1,createOrder:!1,createStopLimitOrder:!1,createStopMarketOrder:!1,createStopOrder:!1,editOrder:!1,fetchBalance:!1,fetchBorrowInterest:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchClosedOrders:!1,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!1,fetchDepositAddress:!1,fetchDeposits:!1,fetchFundingHistory:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchL2OrderBook:!1,fetchL3OrderBook:!1,fetchLedger:!1,fetchLedgerEntry:!1,fetchLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMyTrades:!1,fetchOHLCV:!1,fetchOpenInterestHistory:!1,fetchOpenOrders:!1,fetchOrder:!1,fetchOrderBook:!1,fetchOrders:!1,fetchOrderTrades:"emulated",fetchPositions:!1,fetchPremiumIndexOHLCV:!1,fetchTicker:!0,fetchTickers:!0,fetchTime:!1,fetchTrades:!1,fetchTradingFee:!1,fetchTradingFees:!1,fetchWithdrawals:!1,setLeverage:!1,setMarginMode:!1,transfer:!1,withdraw:!1},comment:"This comment is optional",urls:{logo:"https://cdn.arz.digital/cr-odin/img/exchanges/eterex/64x64.png",api:{public:"https://reward.eterex.com"},www:"https://eterex.com",doc:["https://eterex.com"]},api:{public:{get:{"ad/rates":1}}},fees:{trading:{tierBased:!1,percentage:!0,maker:this.parseNumber("0.001"),taker:this.parseNumber("0.001")}}})}async fetchMarkets(e={}){const t=await this.publicGetAdRates(e),i=this.safeDict(t,"markets"),s=Object.keys(i),r=[];for(let e=0;e{i.d(t,{A:()=>r});var s=i(9884);class r extends s.A{describe(){return this.deepExtend(super.describe(),{id:"excoino",name:"Excoino",countries:["IR"],rateLimit:1e3,version:"1",certified:!1,pro:!1,has:{CORS:void 0,spot:!0,margin:!1,swap:!1,future:!1,option:!1,addMargin:!1,cancelAllOrders:!1,cancelOrder:!1,cancelOrders:!1,createDepositAddress:!1,createOrder:!1,createStopLimitOrder:!1,createStopMarketOrder:!1,createStopOrder:!1,editOrder:!1,fetchBalance:!1,fetchBorrowInterest:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchClosedOrders:!1,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!1,fetchDepositAddress:!1,fetchDeposits:!1,fetchFundingHistory:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchL2OrderBook:!1,fetchLedger:!1,fetchLedgerEntry:!1,fetchLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMyTrades:!1,fetchOHLCV:!0,fetchOpenInterestHistory:!1,fetchOpenOrders:!1,fetchOrder:!1,fetchOrderBook:!0,fetchOrders:!1,fetchOrderTrades:"emulated",fetchPositions:!1,fetchPremiumIndexOHLCV:!1,fetchTicker:!0,fetchTickers:!0,fetchTime:!1,fetchTrades:!1,fetchTradingFee:!1,fetchTradingFees:!1,fetchWithdrawals:!1,setLeverage:!1,setMarginMode:!1,transfer:!1,withdraw:!1},comment:"This comment is optional",urls:{logo:"https://cdn.arz.digital/cr-odin/img/exchanges/excoino/64x64.png",api:{public:"https://market-api.excoino.com"},www:"https://www.excoino.com/",doc:["https://market-api.excoino.com"]},timeframes:{"1m":"1","5m":"5","15m":"15","30m":"30","1h":"60","4h":"240","1d":"1D","1W":"1W","1M":"3M"},api:{public:{get:{"market/symbol-thumb-trend":1,"market/history":1,"market/exchange-plate-full":1}}},commonCurrencies:{BTCB:"BTC",IRR:"IRT"},fees:{trading:{tierBased:!1,percentage:!0,maker:this.parseNumber("0.001"),taker:this.parseNumber("0.001")}}})}async fetchMarkets(e={}){const t=await this.publicGetMarketSymbolThumbTrend(),i=[];for(let e=0;e{i.d(t,{A:()=>r});var s=i(5079);class r extends s.A{describe(){return this.deepExtend(super.describe(),{id:"exir",name:"Exir",countries:["IR"],rateLimit:1e3,version:"1",certified:!1,pro:!1,has:{CORS:void 0,spot:!0,margin:!1,swap:!1,future:!1,option:!1,addMargin:!1,cancelAllOrders:!1,cancelOrder:!1,cancelOrders:!1,createDepositAddress:!1,createOrder:!1,createStopLimitOrder:!1,createStopMarketOrder:!1,createStopOrder:!1,editOrder:!1,fetchBalance:!1,fetchBorrowInterest:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchClosedOrders:!1,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!1,fetchDepositAddress:!1,fetchDeposits:!1,fetchFundingHistory:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchL2OrderBook:!1,fetchLedger:!1,fetchLedgerEntry:!1,fetchLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMyTrades:!1,fetchOHLCV:!0,fetchOpenInterestHistory:!1,fetchOpenOrders:!1,fetchOrder:!1,fetchOrderBook:!0,fetchOrders:!1,fetchOrderTrades:"emulated",fetchPositions:!1,fetchPremiumIndexOHLCV:!1,fetchTicker:!0,fetchTickers:!0,fetchTime:!1,fetchTrades:!1,fetchTradingFee:!1,fetchTradingFees:!1,fetchWithdrawals:!1,setLeverage:!1,setMarginMode:!1,transfer:!1,withdraw:!1},comment:"This comment is optional",urls:{logo:"https://cdn.arz.digital/cr-odin/img/exchanges/exir/64x64.png",api:{public:"https://api.exir.io"},www:"https://www.exir.io/",doc:["https://apidocs.exir.io"]},timeframes:{"15m":"15","1h":"60","4h":"240","1d":"1D","1w":"1W"},api:{public:{get:{"v2/tickers":1,"v2/ticker":1,"v2/chart":1,"v2/orderbook":1}}},fees:{trading:{tierBased:!1,percentage:!0,maker:this.parseNumber("0.001"),taker:this.parseNumber("0.001")}}})}async fetchMarkets(e={}){const t=await this.publicGetV2Tickers(),i=Object.keys(t),s=[];for(let e=0;e{i.d(t,{A:()=>d});var s=i(1352),r=i(2079),a=i(5147),o=i(1579),n=i(7481);class d extends s.A{describe(){return this.deepExtend(super.describe(),{id:"exmo",name:"EXMO",countries:["LT"],rateLimit:100,version:"v1.1",has:{CORS:void 0,spot:!0,margin:!0,swap:!1,future:!1,option:!1,addMargin:!0,cancelOrder:!0,cancelOrders:!1,createDepositAddress:!1,createMarketBuyOrder:!0,createMarketBuyOrderWithCost:!0,createMarketOrderWithCost:!0,createOrder:!0,createStopLimitOrder:!0,createStopMarketOrder:!0,createStopOrder:!0,editOrder:!0,fetchAccounts:!1,fetchBalance:!0,fetchCanceledOrders:!0,fetchCurrencies:!0,fetchDeposit:!0,fetchDepositAddress:!0,fetchDepositAddresses:!1,fetchDepositAddressesByNetwork:!1,fetchDeposits:!0,fetchDepositsWithdrawals:!0,fetchDepositWithdrawFee:"emulated",fetchDepositWithdrawFees:!0,fetchFundingHistory:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchIndexOHLCV:!1,fetchMarginMode:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenInterestHistory:!1,fetchOpenOrders:!0,fetchOrder:"emulated",fetchOrderBook:!0,fetchOrderBooks:!0,fetchOrderTrades:!0,fetchPosition:!1,fetchPositionHistory:!1,fetchPositionMode:!1,fetchPositions:!1,fetchPositionsHistory:!1,fetchPositionsRisk:!1,fetchPremiumIndexOHLCV:!1,fetchTicker:!0,fetchTickers:!0,fetchTrades:!0,fetchTradingFee:!1,fetchTradingFees:!0,fetchTransactionFees:!0,fetchTransactions:"emulated",fetchTransfer:!1,fetchTransfers:!1,fetchWithdrawal:!0,fetchWithdrawals:!0,reduceMargin:!0,setMargin:!1,transfer:!1,withdraw:!0},timeframes:{"1m":"1","5m":"5","15m":"15","30m":"30","45m":"45","1h":"60","2h":"120","3h":"180","4h":"240","1d":"D","1w":"W","1M":"M"},urls:{logo:"https://user-images.githubusercontent.com/1294454/27766491-1b0ea956-5eda-11e7-9225-40d67b481b8d.jpg",api:{public:"https://api.exmo.com",private:"https://api.exmo.com",web:"https://exmo.me"},www:"https://exmo.me",referral:"https://exmo.me/?ref=131685",doc:["https://exmo.me/en/api_doc?ref=131685"],fees:"https://exmo.com/en/docs/fees"},api:{web:{get:["ctrl/feesAndLimits","en/docs/fees"]},public:{get:["currency","currency/list/extended","order_book","pair_settings","ticker","trades","candles_history","required_amount","payments/providers/crypto/list"]},private:{post:["user_info","order_create","order_cancel","stop_market_order_create","stop_market_order_cancel","user_open_orders","user_trades","user_cancelled_orders","order_trades","deposit_address","withdraw_crypt","withdraw_get_txid","excode_create","excode_load","code_check","wallet_history","wallet_operations","margin/user/order/create","margin/user/order/update","margin/user/order/cancel","margin/user/position/close","margin/user/position/margin_add","margin/user/position/margin_remove","margin/currency/list","margin/pair/list","margin/settings","margin/funding/list","margin/user/info","margin/user/order/list","margin/user/order/history","margin/user/order/trades","margin/user/order/max_quantity","margin/user/position/list","margin/user/position/margin_remove_info","margin/user/position/margin_add_info","margin/user/wallet/list","margin/user/wallet/history","margin/user/trade/list","margin/trades","margin/liquidation/feed"]}},fees:{trading:{feeSide:"get",tierBased:!0,percentage:!0,maker:this.parseNumber("0.004"),taker:this.parseNumber("0.004")},transaction:{tierBased:!1,percentage:!1}},options:{networks:{ETH:"ERC20",TRX:"TRC20"},fetchTradingFees:{method:"fetchPrivateTradingFees"},margin:{fillResponseFromRequest:!0}},features:{spot:{sandbox:!1,createOrder:{marginMode:!0,triggerPrice:!0,triggerPriceType:void 0,triggerDirection:!1,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!0,FOK:!0,PO:!0,GTD:!0},hedged:!1,selfTradePrevention:!1,trailing:!1,leverage:!0,marketBuyByCost:!0,marketBuyRequiresPrice:!1,iceberg:!1},createOrders:void 0,fetchMyTrades:{marginMode:!0,limit:100,daysBack:void 0,untilDays:void 0,symbolRequired:!0},fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!1},fetchOpenOrders:{marginMode:!1,limit:void 0,trigger:!1,trailing:!1,symbolRequired:!1},fetchOrders:void 0,fetchClosedOrders:void 0,fetchOHLCV:{limit:1e3}},swap:{linear:void 0,inverse:void 0},future:{linear:void 0,inverse:void 0}},commonCurrencies:{GMT:"GMT Token"},precisionMode:o.kb,exceptions:{exact:{140333:r.InvalidOrder,140434:r.BadRequest,40005:r.AuthenticationError,40009:r.InvalidNonce,40015:r.ExchangeError,40016:r.OnMaintenance,40017:r.AuthenticationError,40032:r.PermissionDenied,40033:r.PermissionDenied,40034:r.RateLimitExceeded,50052:r.InsufficientFunds,50054:r.InsufficientFunds,50304:r.OrderNotFound,50173:r.OrderNotFound,50277:r.InvalidOrder,50319:r.InvalidOrder,50321:r.InvalidOrder,50381:r.InvalidOrder},broad:{"range period is too long":r.BadRequest,"invalid syntax":r.BadRequest,"API rate limit exceeded":r.RateLimitExceeded}}})}async modifyMarginHelper(e,t,i,s={}){await this.loadMarkets();const r=this.market(e),a={position_id:r.id,quantity:t};let o;"add"===i?o=await this.privatePostMarginUserPositionMarginAdd(this.extend(a,s)):"reduce"===i&&(o=await this.privatePostMarginUserPositionMarginRemove(this.extend(a,s)));const n=this.parseMarginModification(o,r),d=this.safeValue(this.options,"margin",{});return this.safeBool(d,"fillResponseFromRequest",!0)&&(n.type=i,n.amount=t),n}parseMarginModification(e,t=void 0){return{info:e,symbol:this.safeSymbol(void 0,t),type:void 0,marginMode:"isolated",amount:void 0,total:void 0,code:this.safeValue(t,"quote"),status:"ok",timestamp:void 0,datetime:void 0}}async reduceMargin(e,t,i={}){return await this.modifyMarginHelper(e,t,"reduce",i)}async addMargin(e,t,i={}){return await this.modifyMarginHelper(e,t,"add",i)}async fetchTradingFees(e={}){const t=this.safeValue(this.options,"fetchTradingFees",{}),i=this.safeString(t,"method","fetchPrivateTradingFees"),s=this.safeString(e,"method",i);return e=this.omit(e,"method"),"fetchPrivateTradingFees"===s?await this.fetchPrivateTradingFees(e):await this.fetchPublicTradingFees(e)}async fetchPrivateTradingFees(e={}){await this.loadMarkets();const t=await this.privatePostMarginPairList(e),i=this.safeValue(t,"pairs",[]),s={};for(let e=0;e=0,i=e.split(" ")[0].replace("%",""),s=parseFloat(i);if(s>0&&t)throw new r.ExchangeError(this.id+" parseFixedFloatValue() detected an unsupported non-zero percentage-based fee "+e);return s}async fetchTransactionFees(e=void 0,t={}){await this.loadMarkets();const i=await this.publicGetPaymentsProvidersCryptoList(t),s={},r=Object.keys(i);for(let t=0;t=2}void 0===this.safeValue(i.networks,n)&&(i.networks[n]={withdraw:{fee:void 0,percentage:void 0},deposit:{fee:void 0,percentage:void 0}}),i.networks[n][a]={fee:this.parseFixedFloatValue(this.safeString(c,0)),percentage:h}}return this.assignDefaultDepositWithdrawFees(i)}async fetchCurrencies(e={}){const t=[];t.push(this.publicGetCurrencyListExtended(e)),t.push(this.publicGetPaymentsProvidersCryptoList(e));const i=await Promise.all(t),s=i[0],r=i[1],a={};for(let e=0;e2048){const e=this.ids.length;throw new r.ExchangeError(this.id+" fetchOrderBooks() has "+e.toString()+" symbols exceeding max URL length, you are required to specify a list of symbols in the first argument to fetchOrderBooks")}}else s=this.marketIds(e),s=s.join(",");const a={pair:s};void 0!==t&&(a.limit=t);const o=await this.publicGetOrderBook(this.extend(a,i)),n={},d=Object.keys(o);for(let e=0;e=0&&(e="canceled"),this.safeString({cancel_started:"canceled"},e,e)}parseSide(e){return this.safeString({limit_buy:"buy",limit_sell:"sell",market_buy:"buy",market_sell:"sell",stop_buy:"buy",stop_sell:"sell",stop_limit_buy:"buy",stop_limit_sell:"sell",trailing_stop_buy:"buy",trailing_stop_sell:"sell",stop_market_sell:"sell",stop_market_buy:"buy",buy:"buy",sell:"sell"},e,e)}parseOrder(e,t=void 0){const i=this.safeString2(e,"order_id","parent_order_id"),s=this.safeIntegerProduct2(e,"event_time","created",1e-6),r=this.safeTimestamp(e,"created",s),a=this.safeString2(e,"type","order_type"),o=this.parseSide(a);let n;"pair"in e?n=e.pair:"in_currency"in e&&"out_currency"in e&&(n="buy"===o?e.in_currency+"_"+e.out_currency:e.out_currency+"_"+e.in_currency);const d=(t=this.safeMarket(n,t)).symbol;let h=this.safeString(e,"quantity");if(void 0===h){const t="buy"===o?"in_amount":"out_amount";h=this.safeString(e,t)}const c=this.safeString(e,"price"),l=this.safeString(e,"amount"),u=this.safeValue(e,"trades",[]),f=this.safeInteger(e,"client_id");let p,m=this.safeString(e,"stop_price");return"0"===m&&(m=void 0),"buy"!==a&&"sell"!==a&&(p=a),this.safeOrder({id:i,clientOrderId:f,datetime:this.iso8601(r),timestamp:r,lastTradeTimestamp:this.safeIntegerProduct(e,"updated",1e-6),status:this.parseStatus(this.safeString(e,"order_status")),symbol:d,type:p,timeInForce:void 0,postOnly:void 0,side:o,price:c,triggerPrice:m,cost:l,amount:h,filled:void 0,remaining:void 0,average:void 0,trades:u,fee:void 0,info:e},t)}async fetchCanceledOrders(e=void 0,t=void 0,i=void 0,s={}){let a;if(await this.loadMarkets(),[a,s]=this.handleMarginModeAndParams("fetchOrders",s),"cross"===a)throw new r.BadRequest(this.id+" only supports isolated margin");void 0===i&&(i=100);const o="isolated"!==a;if(void 0!==e){e=this.market(e).symbol}const n={limit:i};let d,h;if(n.offset=void 0!==t?i:0,n.limit=i,void 0!==e&&(d=this.market(e)),o)return h=await this.privatePostUserCancelledOrders(this.extend(n,s)),s=this.extend(s,{status:"canceled"}),this.parseOrders(h,d,t,i,s);{const e=await this.privatePostMarginUserOrderHistory(this.extend(n,s)),r=this.safeValue(e,"items"),a=this.parseOrders(r,d,t,i,s),o=[];for(let e=0;e1&&(a=e[1])}return this.checkAddress(r),{info:i,currency:e,network:void 0,address:r,tag:a}}getMarketFromTrades(e){const t=this.indexBy(e,"pair"),i=Object.keys(t);if(1===i.length)return this.markets[i[0]]}async withdraw(e,t,i,s=void 0,r={}){[s,r]=this.handleWithdrawTagAndParams(s,r),await this.loadMarkets();const a=this.currency(e),o={amount:t,currency:a.id,address:i};void 0!==s&&(o.invoice=s);const n=this.safeValue(this.options,"networks",{});let d=this.safeStringUpper(r,"network");d=this.safeString(n,d,d),void 0!==d&&(o.transport=d,r=this.omit(r,"network"));const h=await this.privatePostWithdrawCrypt(this.extend(o,r));return this.parseTransaction(h,a)}parseTransactionStatus(e){return this.safeString({transferred:"ok",paid:"ok",pending:"pending",processing:"pending",verifying:"pending"},e,e)}parseTransaction(e,t=void 0){const i=this.safeTimestamp2(e,"dt","created");let s=this.safeString(e,"amount");void 0!==s&&(s=a.Y.stringAbs(s));let r=this.safeString(e,"txid");if(void 0===r){const t=this.safeValue(e,"extra",{}),i=this.safeString(t,"txid");""!==i&&(r=i)}const o=this.safeString(e,"type"),n=this.safeString2(e,"curr","currency"),d=this.safeCurrencyCode(n,t);let h,c;const l=this.safeString(e,"account");if("deposit"===o)c=l;else if("withdrawal"===o&&(h=l,void 0!==h)){const e=h.split(":");2===e.length&&(h=this.safeString(e,1),h=h.replace(" ",""))}const u={currency:void 0,cost:void 0,rate:void 0};if(!this.fees.transaction.percentage){const t="withdrawal"===o?"withdraw":"deposit";let i=this.safeString(e,"commission");if(void 0===i){const e=this.safeValue(this.options,"transactionFees",{}),s=this.safeValue(e,d,{});i=this.safeString(s,t)}"cashback"===this.safeString(e,"provider")&&(i="0"),void 0!==i&&("withdrawal"===o&&(s=a.Y.stringSub(s,i)),u.cost=this.parseNumber(i),u.currency=d)}return{info:e,id:this.safeString2(e,"order_id","task_id"),txid:r,type:o,currency:d,network:this.safeString(e,"provider"),amount:this.parseNumber(s),status:this.parseTransactionStatus(this.safeStringLower(e,"status")),timestamp:i,datetime:this.iso8601(i),address:h,addressFrom:void 0,addressTo:h,tag:void 0,tagFrom:void 0,tagTo:void 0,updated:this.safeTimestamp(e,"updated"),comment:c,internal:void 0,fee:u}}async fetchDepositsWithdrawals(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();const r={};let a;void 0!==t&&(r.date=this.parseToInt(t/1e3)),void 0!==e&&(a=this.currency(e));const o=await this.privatePostWalletHistory(this.extend(r,s));return this.parseTransactions(o.history,a,t,i)}async fetchWithdrawals(e=void 0,t=void 0,i=void 0,s={}){let r;await this.loadMarkets();const a={type:"withdraw"};void 0!==i&&(a.limit=i),void 0!==e&&(r=this.currency(e),a.currency=r.id);const o=await this.privatePostWalletOperations(this.extend(a,s)),n=this.safeList(o,"items",[]);return this.parseTransactions(n,r,t,i)}async fetchWithdrawal(e,t=void 0,i={}){let s;await this.loadMarkets();const r={order_id:e,type:"withdraw"};void 0!==t&&(s=this.currency(t),r.currency=s.id);const a=await this.privatePostWalletOperations(this.extend(r,i)),o=this.safeValue(a,"items",[]),n=this.safeDict(o,0,{});return this.parseTransaction(n,s)}async fetchDeposit(e,t=void 0,i={}){let s;await this.loadMarkets();const r={order_id:e,type:"deposit"};void 0!==t&&(s=this.currency(t),r.currency=s.id);const a=await this.privatePostWalletOperations(this.extend(r,i)),o=this.safeValue(a,"items",[]),n=this.safeDict(o,0,{});return this.parseTransaction(n,s)}async fetchDeposits(e=void 0,t=void 0,i=void 0,s={}){let r;await this.loadMarkets();const a={type:"deposit"};void 0!==i&&(a.limit=i),void 0!==e&&(r=this.currency(e),a.currency=r.id);const o=await this.privatePostWalletOperations(this.extend(a,s)),n=this.safeList(o,"items",[]);return this.parseTransactions(n,r,t,i)}sign(e,t="public",i="GET",s={},r=void 0,a=void 0){let o=this.urls.api[t]+"/";if("web"!==t&&(o+=this.version+"/"),o+=e,"public"===t||"web"===t)Object.keys(s).length&&(o+="?"+this.urlencode(s));else if("private"===t){this.checkRequiredCredentials();const e=this.nonce();a=this.urlencode(this.extend({nonce:e},s)),r={"Content-Type":"application/x-www-form-urlencoded",Key:this.apiKey,Sign:this.hmac(this.encode(a),this.encode(this.secret),n.Zf)}}return{url:o,method:i,body:a,headers:r}}nonce(){return this.milliseconds()}handleErrors(e,t,i,s,a,o,n,d,h){if(void 0!==n){if("error"in n&&!("result"in n)){const e=this.safeValue(n,"error",{}),t=this.safeString(e,"msg"),i=this.safeString(e,"code"),s=this.id+" "+o;throw this.throwExactlyMatchedException(this.exceptions.exact,i,s),this.throwBroadlyMatchedException(this.exceptions.broad,t,s),new r.ExchangeError(s)}if("result"in n||"errmsg"in n){let e=this.safeBool(n,"result",!1);if("string"==typeof e&&(e="true"===e||"1"===e),!e){let e;const t=this.safeString2(n,"error","errmsg"),i=t.split(":");if(i.length>1){const t=i[0].split(" ");e=t.length>1?t[1]:t[0]}const s=this.id+" "+o;throw this.throwExactlyMatchedException(this.exceptions.exact,e,s),this.throwBroadlyMatchedException(this.exceptions.broad,t,s),new r.ExchangeError(s)}}}}}},9169:(e,t,i)=>{i.d(t,{A:()=>r});var s=i(2278);class r extends s.A{describe(){return this.deepExtend(super.describe(),{id:"exnovin",name:"Exnovin",countries:["IR"],rateLimit:1e3,version:"1",certified:!1,pro:!1,has:{CORS:void 0,spot:!0,margin:!1,swap:!1,future:!1,option:!1,addMargin:!1,cancelAllOrders:!1,cancelOrder:!1,cancelOrders:!1,createDepositAddress:!1,createOrder:!1,createStopLimitOrder:!1,createStopMarketOrder:!1,createStopOrder:!1,editOrder:!1,fetchBalance:!1,fetchBorrowInterest:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchClosedOrders:!1,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!1,fetchDepositAddress:!1,fetchDeposits:!1,fetchFundingHistory:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchL2OrderBook:!1,fetchLedger:!1,fetchLedgerEntry:!1,fetchLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMyTrades:!1,fetchOHLCV:!1,fetchOpenInterestHistory:!1,fetchOpenOrders:!1,fetchOrder:!1,fetchOrderBook:!0,fetchOrders:!1,fetchOrderTrades:"emulated",fetchPositions:!1,fetchPremiumIndexOHLCV:!1,fetchTicker:!0,fetchTickers:!0,fetchTime:!1,fetchTrades:!1,fetchTradingFee:!1,fetchTradingFees:!1,fetchWithdrawals:!1,setLeverage:!1,setMarginMode:!1,transfer:!1,withdraw:!1},comment:"This comment is optional",urls:{logo:"https://cdn.arz.digital/cr-odin/img/exchanges/exnovin/64x64.png",api:{public:"https://api.exnovinmarket.com"},www:"https://exnovin.io",doc:["https://exnovin.io/"]},api:{public:{get:{"v2/pairs":1,"v1/orderbook":1}}},commonCurrencies:{TMN:"IRT"},fees:{trading:{tierBased:!1,percentage:!0,maker:this.parseNumber("0.001"),taker:this.parseNumber("0.001")}}})}async fetchMarkets(e={}){const t=await this.publicGetV2Pairs(),i=[];for(let e=0;e{i.d(t,{A:()=>r});var s=i(1706);class r extends s.A{describe(){return this.deepExtend(super.describe(),{id:"farhadexchange",name:"Farhad Exchange",countries:["IR"],rateLimit:1e3,version:"1",certified:!1,pro:!1,has:{CORS:void 0,spot:!0,margin:!1,swap:!1,future:!1,option:!1,addMargin:!1,cancelAllOrders:!1,cancelOrder:!1,cancelOrders:!1,createDepositAddress:!1,createOrder:!1,createStopLimitOrder:!1,createStopMarketOrder:!1,createStopOrder:!1,editOrder:!1,fetchBalance:!1,fetchBorrowInterest:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchClosedOrders:!1,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!1,fetchDepositAddress:!1,fetchDeposits:!1,fetchFundingHistory:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchL2OrderBook:!1,fetchLedger:!1,fetchLedgerEntry:!1,fetchLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMyTrades:!1,fetchOHLCV:!1,fetchOpenInterestHistory:!1,fetchOpenOrders:!1,fetchOrder:!1,fetchOrderBook:!1,fetchOrders:!1,fetchOrderTrades:"emulated",fetchPositions:!1,fetchPremiumIndexOHLCV:!1,fetchTicker:!0,fetchTickers:!0,fetchTime:!1,fetchTrades:!1,fetchTradingFee:!1,fetchTradingFees:!1,fetchWithdrawals:!1,setLeverage:!1,setMarginMode:!1,transfer:!1,withdraw:!1},comment:"This comment is optional",urls:{logo:"https://cdn.arz.digital/cr-odin/img/exchanges/farhad-exchange/64x64.png",api:{public:"https://api.farhad-exchange.com"},www:"https://www.efex.pro",doc:["https://www.efex.pro/fa/api-documentation"]},api:{public:{get:{"get-all-rate":1}}},commonCurrencies:{IRR:"IRT"},fees:{trading:{tierBased:!1,percentage:!0,maker:this.parseNumber("0.001"),taker:this.parseNumber("0.001")}}})}async fetchMarkets(e={}){const t=await this.publicGetGetAllRate(),i=[];for(let e=0;e{i.d(t,{A:()=>r});var s=i(7996);class r extends s.A{describe(){return this.deepExtend(super.describe(),{id:"fmfwio",name:"FMFW.io",countries:["KN"],urls:{logo:"https://user-images.githubusercontent.com/1294454/159177712-b685b40c-5269-4cea-ac83-f7894c49525d.jpg",api:{public:"https://api.fmfw.io/api/3",private:"https://api.fmfw.io/api/3"},www:"https://fmfw.io",doc:"https://api.fmfw.io/",fees:"https://fmfw.io/fees-and-limits",referral:"https://fmfw.io/referral/da948b21d6c92d69"},fees:{trading:{maker:this.parseNumber("0.005"),taker:this.parseNumber("0.005")}}})}}},448:(e,t,i)=>{i.d(t,{A:()=>d});var s=i(5147),r=i(2597),a=i(2079),o=i(1579),n=i(4852);class d extends r.A{describe(){return this.deepExtend(super.describe(),{id:"foxbit",name:"Foxbit",countries:["pt-BR"],rateLimit:33.334,version:"1",comment:"Foxbit Exchange",certified:!1,pro:!1,has:{CORS:!0,spot:!0,margin:void 0,swap:void 0,future:void 0,option:void 0,cancelAllOrders:!0,cancelOrder:!0,createLimitBuyOrder:!0,createLimitSellOrder:!0,createMarketBuyOrder:!0,createMarketSellOrder:!0,createOrder:!0,fecthOrderBook:!0,fetchBalance:!0,fetchCanceledOrders:!0,fetchClosedOrders:!0,fetchCurrencies:!0,fetchDepositAddress:!0,fetchDeposits:!0,fetchL2OrderBook:!0,fetchLedger:!0,fetchMarkets:!0,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenOrders:!0,fetchOrder:!0,fetchOrders:!0,fetchTicker:!0,fetchTickers:!0,fetchTrades:!0,fetchTradingFee:!0,fetchTradingFees:!0,fetchTransactions:!0,fetchWithdrawals:!0,loadMarkets:!0,sandbox:!1,withdraw:!0,ws:!1},timeframes:{"1m":"1m","5m":"5m","15m":"15m","30m":"30m","1h":"1h","2h":"2h","4h":"4h","6h":"6h","12h":"12h","1d":"1d","1w":"1w","2w":"2w","1M":"1M"},urls:{logo:"https://github.com/user-attachments/assets/1f8faca2-ae2f-4222-b33e-5671e7d873dd",api:{public:"https://api.foxbit.com.br",private:"https://api.foxbit.com.br",status:"https://metadata-v2.foxbit.com.br/api"},www:"https://app.foxbit.com.br",doc:["https://docs.foxbit.com.br"]},precisionMode:o.fv,exceptions:{exact:{400:a.BadRequest,429:a.RateLimitExceeded,404:a.BadRequest,500:a.ExchangeError,2001:a.AuthenticationError,2002:a.AuthenticationError,2003:a.AuthenticationError,2004:a.BadRequest,2005:a.PermissionDenied,3001:a.PermissionDenied,3002:a.PermissionDenied,3003:a.AccountSuspended,4001:a.BadRequest,4002:a.InsufficientFunds,4003:a.InvalidOrder,4004:a.BadSymbol,4005:a.BadRequest,4007:a.ExchangeError,4008:a.InvalidOrder,4009:a.PermissionDenied,4011:a.RateLimitExceeded,4012:a.ExchangeError,5001:a.ExchangeNotAvailable,5002:a.OnMaintenance,5003:a.OnMaintenance,5004:a.InvalidOrder,5005:a.InvalidOrder,5006:a.InvalidOrder},broad:{}},requiredCredentials:{apiKey:!0,secret:!0},api:{v3:{public:{get:{currencies:5,markets:5,"markets/ticker/24hr":60,"markets/{market}/orderbook":6,"markets/{market}/candlesticks":12,"markets/{market}/trades/history":12,"markets/{market}/ticker/24hr":15}},private:{get:{accounts:2,"accounts/{symbol}/transactions":60,orders:2,"orders/by-order-id/{id}":2,trades:6,"deposits/address":10,deposits:10,withdrawals:10,"me/fees/trading":60},post:{orders:2,"orders/batch":7.5,"orders/cancel-replace":3,withdrawals:10},put:{"orders/cancel":2}}},status:{public:{get:{status:30}}}},fees:{trading:{feeSide:"get",tierBased:!1,percentage:!0,taker:this.parseNumber("0.005"),maker:this.parseNumber("0.0025")}},options:{sandboxMode:!1,networksById:{algorand:"ALGO",arbitrum:"ARBITRUM",avalanchecchain:"AVAX",bitcoin:"BTC",bitcoincash:"BCH",bsc:"BEP20",cardano:"ADA",cosmos:"ATOM",dogecoin:"DOGE",erc20:"ETH",hedera:"HBAR",litecoin:"LTC",near:"NEAR",optimism:"OPTIMISM",polkadot:"DOT",polygon:"MATIC",ripple:"XRP",solana:"SOL",stacks:"STX",stellar:"XLM",tezos:"XTZ",trc20:"TRC20"},networks:{ALGO:"algorand",ARBITRUM:"arbitrum",AVAX:"avalanchecchain",BTC:"bitcoin",BCH:"bitcoincash",BEP20:"bsc",ADA:"cardano",ATOM:"cosmos",DOGE:"dogecoin",ETH:"erc20",HBAR:"hedera",LTC:"litecoin",NEAR:"near",OPTIMISM:"optimism",DOT:"polkadot",MATIC:"polygon",XRP:"ripple",SOL:"solana",STX:"stacks",XLM:"stellar",XTZ:"tezos",TRC20:"trc20"}},features:{spot:{sandbox:!1,createOrder:{marginMode:!1,triggerPrice:!0,triggerPriceType:{last:!0,mark:!1,index:!1},triggerDirection:!1,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,timeInForce:{GTC:!0,FOK:!0,IOC:!0,PO:!0,GTD:!1},hedged:!1,leverage:!1,marketBuyByCost:!1,marketBuyRequiresPrice:!1,selfTradePrevention:{expire_maker:!0,expire_taker:!0,expire_both:!0,none:!0},trailing:!1,icebergAmount:!1},createOrders:{max:5},fetchMyTrades:{marginMode:!1,limit:100,daysBack:90,untilDays:1e4,symbolRequired:!0},fetchOrder:{marginMode:!1,limit:1,daysBack:90,trigger:!1,trailing:!1,symbolRequired:!1},fetchOpenOrders:{marginMode:!1,limit:100,daysBack:90,trigger:!1,trailing:!1,symbolRequired:!1},fetchOrders:{marginMode:!0,limit:100,daysBack:90,untilDays:1e4,trigger:!1,trailing:!1,symbolRequired:!1},fetchClosedOrders:{marginMode:!0,limit:100,daysBack:90,daysBackCanceled:90,untilDays:1e4,trigger:!1,trailing:!1,symbolRequired:!1},fetchOHLCV:{limit:500}}}})}async fetchCurrencies(e={}){const t=await this.v3PublicGetCurrencies(e),i=this.safeList(t,"data",[]),s={};for(let e=0;e200&&(a.page_size=200));const o=await this.v3PublicGetMarketsMarketTradesHistory(this.extend(a,s)),n=this.safeList(o,"data",[]);return this.parseTrades(n,r,t,i)}async fetchOHLCV(e,t="1m",i=void 0,s=void 0,r={}){await this.loadMarkets();const a=this.market(e),o=this.safeString(this.timeframes,t,t),n={market:a.id,interval:o};void 0!==i&&(n.start_time=this.iso8601(i)),void 0!==s&&(n.limit=s,s>500&&(n.limit=500));const d=await this.v3PublicGetMarketsMarketCandlesticks(this.extend(n,r));return this.parseOHLCVs(d,a,o,i,s)}async fetchBalance(e={}){await this.loadMarkets();const t=await this.v3PrivateGetAccounts(e),i=this.safeList(t,"data",[]),s={info:t};for(let e=0;e100&&(o.page_size=100));const n=await this.v3PrivateGetOrders(this.extend(o,r)),d=this.safeList(n,"data",[]);return this.parseOrders(d)}async createOrder(e,t,i,s,r=void 0,o={}){await this.loadMarkets();const n=this.market(e);if("LIMIT"!==(t=t.toUpperCase())&&"MARKET"!==t&&"STOP_MARKET"!==t&&"STOP_LIMIT"!==t&&"INSTANT"!==t)throw new a.InvalidOrder("Invalid order type: "+t+". Must be one of: limit, market, stop_market, stop_limit, instant.");const d=this.safeStringUpper(o,"timeInForce"),h=this.safeBool(o,"postOnly",!1),c=this.safeNumber(o,"triggerPrice"),l={market_symbol:n.id,side:i.toUpperCase(),type:t};if(("STOP_MARKET"===t||"STOP_LIMIT"===t)&&void 0===c)throw new a.InvalidOrder("Invalid order type: "+t+". Must have triggerPrice.");void 0!==d&&("PO"===d?l.post_only=!0:l.time_in_force=d),h&&(l.post_only=!0),void 0!==c&&(l.stop_price=this.priceToPrecision(e,c)),"INSTANT"===t?l.amount=this.priceToPrecision(e,s):l.quantity=this.amountToPrecision(e,s),"LIMIT"!==t&&"STOP_LIMIT"!==t||(l.price=this.priceToPrecision(e,r));const u=this.safeString(o,"clientOrderId");void 0!==u&&(l.client_order_id=u),o=this.omit(o,["timeInForce","postOnly","triggerPrice","clientOrderId"]);const f=await this.v3PrivatePostOrders(this.extend(l,o));return this.parseOrder(f,n)}async createOrders(e,t={}){await this.loadMarkets();const i=[];for(let t=0;t100&&(a.page_size=100));const o=await this.v3PrivateGetOrders(this.extend(a,s)),n=this.safeList(o,"data",[]);return this.parseOrders(n,r,t,i)}async fetchMyTrades(e=void 0,t=void 0,i=void 0,s={}){if(void 0===e)throw new a.ArgumentsRequired(this.id+" fetchMyTrades() requires a symbol argument");await this.loadMarkets();const r=this.market(e),o={market_symbol:r.id};void 0!==t&&(o.start_time=this.iso8601(t)),void 0!==i&&(o.page_size=i,i>100&&(o.page_size=100));const n=await this.v3PrivateGetTrades(this.extend(o,s)),d=this.safeList(n,"data",[]);return this.parseTrades(d,r,t,i)}async fetchDepositAddress(e,t={}){await this.loadMarkets();const i=this.currency(e),s={currency_symbol:i.id},[r,a]=this.handleNetworkCodeAndParams(t);void 0!==r&&(s.network_code=this.networkCodeToId(r,e));const o=await this.v3PrivateGetDepositsAddress(this.extend(s,a));return this.parseDepositAddress(o,i)}async fetchDeposits(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();const r={};let a;void 0!==e&&(a=this.currency(e)),void 0!==i&&(r.page_size=i,i>100&&(r.page_size=100)),void 0!==t&&(r.start_time=this.iso8601(t));const o=await this.v3PrivateGetDeposits(this.extend(r,s)),n=this.safeList(o,"data",[]);return this.parseTransactions(n,a,t,i)}async fetchWithdrawals(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();const r={};let a;void 0!==e&&(a=this.currency(e)),void 0!==i&&(r.page_size=i,i>100&&(r.page_size=100)),void 0!==t&&(r.start_time=this.iso8601(t));const o=await this.v3PrivateGetWithdrawals(this.extend(r,s)),n=this.safeList(o,"data",[]);return this.parseTransactions(n,a,t,i)}async fetchTransactions(e=void 0,t=void 0,i=void 0,s={}){const r=await this.fetchWithdrawals(e,t,i,s),a=await this.fetchDeposits(e,t,i,s),o=this.arrayConcat(r,a);return this.sortBy(o,"timestamp")}async fetchStatus(e={}){const t=await this.statusPublicGetStatus(e),i=this.safeDict(t,"data",{}),s=this.safeDict(i,"attributes",{}),r=this.safeString(s,"status");return{status:this.safeString({NORMAL:"ok",UNDER_MAINTENANCE:"maintenance"},r,r),updated:this.safeString(s,"updatedAt"),eta:void 0,url:void 0,info:t}}async editOrder(e,t,i,s,r=void 0,o=void 0,n={}){if(void 0===t)throw new a.ArgumentsRequired(this.id+" editOrder() requires a symbol argument");if("LIMIT"!==(i=i.toUpperCase())&&"MARKET"!==i&&"STOP_MARKET"!==i&&"INSTANT"!==i)throw new a.InvalidOrder("Invalid order type: "+i+". Must be one of: LIMIT, MARKET, STOP_MARKET, INSTANT.");await this.loadMarkets();const d=this.market(t),h={mode:"ALLOW_FAILURE",cancel:{type:"ID",id:this.parseNumber(e)},create:{type:i,side:s.toUpperCase(),market_symbol:d.id}};"LIMIT"!==i&&"MARKET"!==i||(h.create.quantity=this.amountToPrecision(t,r),"LIMIT"===i&&(h.create.price=this.priceToPrecision(t,o))),"STOP_MARKET"===i&&(h.create.stop_price=this.priceToPrecision(t,o),h.create.quantity=this.amountToPrecision(t,r)),"INSTANT"===i&&(h.create.amount=this.priceToPrecision(t,r));const c=await this.v3PrivatePostOrdersCancelReplace(this.extend(h,n));return this.parseOrder(c.create,d)}async withdraw(e,t,i,s=void 0,r={}){[s,r]=this.handleWithdrawTagAndParams(s,r),await this.loadMarkets();const a={currency_symbol:this.currency(e).id,amount:this.numberToString(t),destination_address:i};let o;void 0!==s&&(a.destination_tag=s),[o,r]=this.handleNetworkCodeAndParams(r),void 0!==o&&(a.network_code=this.networkCodeToId(o));const n=await this.v3PrivatePostWithdrawals(this.extend(a,r));return this.parseTransaction(n)}async fetchLedger(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();const r={};if(void 0===e)throw new a.ArgumentsRequired(this.id+" fetchLedger() requires a code argument");void 0!==i&&(r.page_size=i,i>100&&(r.page_size=100)),void 0!==t&&(r.start_time=this.iso8601(t));const o=this.currency(e);r.symbol=o.id;const n=await this.v3PrivateGetAccountsSymbolTransactions(this.extend(r,s)),d=this.safeList(n,"data",[]);return this.parseLedger(d,o,t,i)}parseMarket(e){const t=this.safeString(e,"symbol"),i=this.safeDict(e,"base"),s=this.safeString(i,"symbol"),r=this.safeDict(e,"quote"),a=this.safeString(r,"symbol"),o=this.safeCurrencyCode(s),n=this.safeCurrencyCode(a),d=o+"/"+n,h=this.safeDict(e,"default_fees");return this.safeMarketStructure({id:t,symbol:d,base:o,quote:n,baseId:s,quoteId:a,active:!0,type:"spot",spot:!0,margin:!1,future:!1,swap:!1,option:!1,contract:!1,settle:void 0,settleId:void 0,contractSize:void 0,linear:void 0,inverse:void 0,expiry:void 0,expiryDatetime:void 0,strike:void 0,optionType:void 0,taker:this.safeNumber(h,"taker"),maker:this.safeNumber(h,"maker"),percentage:!0,tierBased:!1,feeSide:"get",precision:{price:this.safeInteger(r,"precision"),amount:this.safeInteger(i,"precision"),cost:this.safeInteger(r,"precision")},limits:{amount:{min:this.safeNumber(e,"quantity_min"),max:void 0},price:{min:this.safeNumber(e,"price_min"),max:void 0},cost:{min:void 0,max:void 0},leverage:{min:void 0,max:void 0}},info:e})}parseTradingFee(e,t=void 0){return{info:e,symbol:t.symbol,maker:this.safeNumber(e,"maker"),taker:this.safeNumber(e,"taker"),percentage:!0,tierBased:!0}}parseTicker(e,t=void 0){const i=this.safeString(e,"market_symbol"),s=this.safeSymbol(i,t,void 0,"spot"),r=e.rolling_24h,a=this.safeDict(e,"best"),o=this.safeDict(a,"ask"),n=this.safeDict(a,"bid"),d=e.last_trade,h=this.safeString(d,"price");return this.safeTicker({symbol:s,timestamp:this.parseDate(this.safeString(d,"date")),datetime:this.iso8601(this.parseDate(this.safeString(d,"date"))),high:this.safeNumber(r,"high"),low:this.safeNumber(r,"low"),bid:this.safeNumber(n,"price"),bidVolume:this.safeNumber(n,"volume"),ask:this.safeNumber(o,"price"),askVolume:this.safeNumber(o,"volume"),vwap:void 0,open:this.safeNumber(r,"open"),close:h,last:h,previousClose:void 0,change:this.safeString(r,"price_change"),percentage:this.safeString(r,"price_change_percent"),average:void 0,baseVolume:this.safeString(r,"volume"),quoteVolume:this.safeString(r,"quote_volume"),info:e},t)}parseOHLCV(e,t=void 0){return[this.safeInteger(e,0),this.safeNumber(e,1),this.safeNumber(e,2),this.safeNumber(e,3),this.safeNumber(e,4),this.safeNumber(e,6)]}parseTrade(e,t=void 0){const i=this.parseDate(this.safeString(e,"created_at")),r=this.safeString(e,"price"),a=this.safeString(e,"volume",this.safeString(e,"quantity")),o=this.safeStringLower(e,"side"),n=this.safeStringLower(e,"taker_side",o),d=s.Y.stringMul(r,a),h={currency:this.safeSymbol(this.safeString(e,"fee_currency_symbol")),cost:this.safeNumber(e,"fee"),rate:void 0};return this.safeTrade({id:this.safeString(e,"id"),info:e,timestamp:i,datetime:this.iso8601(i),symbol:t.symbol,order:void 0,type:void 0,side:n,takerOrMaker:void 0,price:r,amount:a,cost:d,fee:h},t)}parseOrderStatus(e){return this.safeString({PARTIALLY_CANCELED:"open",ACTIVE:"open",PARTIALLY_FILLED:"open",FILLED:"closed",PENDING_CANCEL:"canceled",CANCELED:"canceled"},e,e)}parseOrder(e,t=void 0){let i=this.safeString(e,"market_symbol");void 0===t&&void 0!==i&&(t=this.market(i)),void 0!==t&&(i=t.symbol);const r=this.parseDate(this.safeString(e,"created_at")),a=this.safeString(e,"price"),o=this.safeString(e,"quantity_executed"),n=this.safeString(e,"quantity");let d;void 0!==n&&void 0!==o&&(d=s.Y.stringAdd(n,o));let h=this.safeString(e,"funds_received");if(!h){const t=this.safeString(e,"price_avg"),i=this.safeString(e,"price",t);h=s.Y.stringMul(i,d)}const c=this.safeStringLower(e,"side");let l=this.safeStringUpper(t,"quoteId");return"buy"===c&&(l=this.safeStringUpper(t,"baseId")),this.safeOrder({id:this.safeString(e,"id"),info:e,clientOrderId:this.safeString(e,"client_order_id"),timestamp:r,datetime:this.iso8601(r),lastTradeTimestamp:void 0,status:this.parseOrderStatus(this.safeString(e,"state")),symbol:this.safeString(t,"symbol"),type:this.safeString(e,"type"),timeInForce:this.safeString(e,"time_in_force"),postOnly:this.safeBool(e,"post_only"),reduceOnly:void 0,side:c,price:this.parseNumber(a),triggerPrice:this.safeNumber(e,"stop_price"),takeProfitPrice:void 0,stopLossPrice:void 0,cost:this.parseNumber(h),average:this.safeNumber(e,"price_avg"),amount:this.parseNumber(d),filled:this.parseNumber(o),remaining:this.parseNumber(n),trades:void 0,fee:{currency:l,cost:this.safeNumber(e,"fee_paid")}})}parseDepositAddress(e,t=void 0){const i=this.safeDict(e,"network"),s=this.safeString(i,"code"),r=this.safeCurrencyCode(void 0,t),a=this.networkIdToCode(s,r);return{address:this.safeString(e,"address"),tag:this.safeString(e,"tag"),currency:r,network:a,info:e}}parseTransactionStatus(e){return this.safeString({SUBMITTING:"pending",SUBMITTED:"pending",REJECTED:"failed",CANCELLED:"canceled",ACCEPTED:"ok",WARNING:"pending",UNBLOCKED:"pending",BLOCKED:"pending",PROCESSING:"pending",CANCELED:"canceled",FAILED:"failed",DONE:"ok"},e,e)}parseTransaction(e,t=void 0,i=void 0,r=void 0){const a=this.safeDict(e,"details_crypto"),o=this.safeString2(a,"receiving_address","destination_address"),n=this.safeString(e,"sn");let d="withdrawal";void 0!==n&&"D"===n[0]&&(d="deposit");const h=this.safeString(e,"fee","0"),c=this.safeString(e,"amount"),l=this.safeString(e,"currency_symbol");let u=c;const f=this.safeCurrencyCode(l),p=this.parseTransactionStatus(this.safeString(e,"state")),m=this.safeString(e,"created_at"),g=this.parseDate(m),v=this.iso8601(g);void 0!==h&&void 0!==c&&(u=s.Y.stringSub(c,h));const y=s.Y.stringDiv(h,u),w={cost:this.parseNumber(h),currency:f,rate:this.parseNumber(y)};return{info:e,id:this.safeString(e,"sn"),txid:this.safeString(a,"transaction_id"),timestamp:g,datetime:v,network:this.safeString(e,"network_code"),address:o,addressTo:o,addressFrom:void 0,tag:this.safeString(e,"destination_tag"),tagTo:this.safeString(e,"destination_tag"),tagFrom:void 0,type:d,amount:this.parseNumber(c),currency:f,status:p,updated:void 0,fee:w,comment:void 0,internal:void 0}}parseLedgerEntryType(e){return this.safeString({DEPOSITING:"transaction",WITHDRAWING:"transaction",TRADING:"trade",INTERNAL_TRANSFERING:"transfer",OTHERS:"transaction"},e,e)}parseLedgerEntry(e,t=void 0){const i=this.safeString(e,"uuid"),s=this.safeString(e,"created_at"),r=this.parse8601(s),a=this.safeString(e,"reason_type"),o=this.parseLedgerEntryType(a),n=this.safeString(e,"currency_symbol"),d=this.safeCurrencyCode(n);let h="in";const c=this.safeNumber(e,"amount");let l=c;const u=this.safeNumber(e,"balance"),f={cost:this.safeNumber(e,"fee"),currency:d};return c<0&&(h="out",l=-1*c),{id:i,info:e,timestamp:r,datetime:this.iso8601(r),direction:h,account:void 0,referenceId:void 0,referenceAccount:void 0,type:o,currency:d,amount:l,before:u-c,after:u,status:"ok",fee:f}}sign(e,t=[],i="GET",s={},r=void 0,a=void 0){const o=t[0];let d=t[1],h="/rest/"+o+"/"+this.implodeParams(e,s);"status"===o&&(h="/status",d="status");let c=this.urls.api[d]+h;s=this.omit(s,this.extractParams(e));const l=this.milliseconds();let u="",f="";if("GET"===i){const e=Object.keys(s),t=e.length;t>0&&(u=this.urlencode(s),c+="?"+u);for(let i=0;i{i.d(t,{A:()=>d});var s=i(7418),r=i(5147),a=i(1579),o=i(2079),n=i(7481);class d extends s.A{describe(){return this.deepExtend(super.describe(),{id:"gate",name:"Gate.io",countries:["KR"],rateLimit:50,version:"v4",certified:!0,pro:!0,urls:{logo:"https://github.com/user-attachments/assets/64f988c5-07b6-4652-b5c1-679a6bf67c85",doc:"https://www.gate.io/docs/developers/apiv4/en/",www:"https://gate.io/",api:{public:{wallet:"https://api.gateio.ws/api/v4",futures:"https://api.gateio.ws/api/v4",margin:"https://api.gateio.ws/api/v4",delivery:"https://api.gateio.ws/api/v4",spot:"https://api.gateio.ws/api/v4",options:"https://api.gateio.ws/api/v4",sub_accounts:"https://api.gateio.ws/api/v4",earn:"https://api.gateio.ws/api/v4"},private:{withdrawals:"https://api.gateio.ws/api/v4",wallet:"https://api.gateio.ws/api/v4",futures:"https://api.gateio.ws/api/v4",margin:"https://api.gateio.ws/api/v4",delivery:"https://api.gateio.ws/api/v4",spot:"https://api.gateio.ws/api/v4",options:"https://api.gateio.ws/api/v4",subAccounts:"https://api.gateio.ws/api/v4",unified:"https://api.gateio.ws/api/v4",rebate:"https://api.gateio.ws/api/v4",earn:"https://api.gateio.ws/api/v4",account:"https://api.gateio.ws/api/v4",loan:"https://api.gateio.ws/api/v4"}},test:{public:{futures:"https://fx-api-testnet.gateio.ws/api/v4",delivery:"https://fx-api-testnet.gateio.ws/api/v4",options:"https://fx-api-testnet.gateio.ws/api/v4"},private:{futures:"https://fx-api-testnet.gateio.ws/api/v4",delivery:"https://fx-api-testnet.gateio.ws/api/v4",options:"https://fx-api-testnet.gateio.ws/api/v4"}},referral:{url:"https://www.gate.io/signup/2436035",discount:.2}},has:{CORS:void 0,spot:!0,margin:!0,swap:!0,future:!0,option:!0,addMargin:!0,borrowCrossMargin:!0,borrowIsolatedMargin:!0,cancelAllOrders:!0,cancelOrder:!0,cancelOrders:!0,cancelOrdersForSymbols:!0,createMarketBuyOrderWithCost:!0,createMarketOrder:!0,createMarketOrderWithCost:!1,createMarketSellOrderWithCost:!1,createOrder:!0,createOrders:!0,createPostOnlyOrder:!0,createReduceOnlyOrder:!0,createStopLimitOrder:!0,createStopLossOrder:!0,createStopMarketOrder:!1,createStopOrder:!0,createTakeProfitOrder:!0,createTriggerOrder:!0,editOrder:!0,fetchBalance:!0,fetchBorrowInterest:!0,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchClosedOrders:!0,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!0,fetchDepositAddress:!0,fetchDepositAddresses:!1,fetchDepositAddressesByNetwork:!0,fetchDeposits:!0,fetchDepositWithdrawFee:"emulated",fetchDepositWithdrawFees:!0,fetchFundingHistory:!0,fetchFundingRate:!0,fetchFundingRateHistory:!0,fetchFundingRates:!0,fetchGreeks:!0,fetchIndexOHLCV:!0,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchLedger:!0,fetchLeverage:!0,fetchLeverages:!0,fetchLeverageTiers:!0,fetchLiquidations:!0,fetchMarginAdjustmentHistory:!1,fetchMarginMode:!1,fetchMarketLeverageTiers:!0,fetchMarkets:!0,fetchMarkOHLCV:!0,fetchMyLiquidations:!0,fetchMySettlementHistory:!0,fetchMyTrades:!0,fetchNetworkDepositAddress:!0,fetchOHLCV:!0,fetchOpenInterest:!1,fetchOpenInterestHistory:!0,fetchOpenOrders:!0,fetchOption:!0,fetchOptionChain:!0,fetchOrder:!0,fetchOrderBook:!0,fetchPosition:!0,fetchPositionHistory:"emulated",fetchPositionMode:!1,fetchPositions:!0,fetchPositionsHistory:!0,fetchPremiumIndexOHLCV:!1,fetchSettlementHistory:!0,fetchTicker:!0,fetchTickers:!0,fetchTime:!0,fetchTrades:!0,fetchTradingFee:!0,fetchTradingFees:!0,fetchTransactionFees:!0,fetchUnderlyingAssets:!0,fetchVolatilityHistory:!1,fetchWithdrawals:!0,reduceMargin:!0,repayCrossMargin:!0,repayIsolatedMargin:!0,sandbox:!0,setLeverage:!0,setMarginMode:!1,setPositionMode:!0,signIn:!1,transfer:!0,withdraw:!0},api:{public:{wallet:{get:{currency_chains:1}},spot:{get:{currencies:1,"currencies/{currency}":1,currency_pairs:1,"currency_pairs/{currency_pair}":1,tickers:1,order_book:1,trades:1,candlesticks:1,time:1}},margin:{get:{currency_pairs:1,"currency_pairs/{currency_pair}":1,funding_book:1,"cross/currencies":1,"cross/currencies/{currency}":1,"uni/currency_pairs":1,"uni/currency_pairs/{currency_pair}":1}},flash_swap:{get:{currencies:1}},futures:{get:{"{settle}/contracts":1,"{settle}/contracts/{contract}":1,"{settle}/order_book":1,"{settle}/trades":1,"{settle}/candlesticks":1,"{settle}/premium_index":1,"{settle}/tickers":1,"{settle}/funding_rate":1,"{settle}/insurance":1,"{settle}/contract_stats":1,"{settle}/index_constituents/{index}":1,"{settle}/liq_orders":1,"{settle}/risk_limit_tiers":1}},delivery:{get:{"{settle}/contracts":1,"{settle}/contracts/{contract}":1,"{settle}/order_book":1,"{settle}/trades":1,"{settle}/candlesticks":1,"{settle}/tickers":1,"{settle}/insurance":1}},options:{get:{underlyings:1,expirations:1,contracts:1,"contracts/{contract}":1,settlements:1,"settlements/{contract}":1,order_book:1,tickers:1,"underlying/tickers/{underlying}":1,candlesticks:1,"underlying/candlesticks":1,trades:1}},earn:{get:{"uni/currencies":1,"uni/currencies/{currency}":1}}},private:{withdrawals:{post:{withdrawals:20,push:1},delete:{"withdrawals/{withdrawal_id}":1}},wallet:{get:{deposit_address:1,withdrawals:1,deposits:1,sub_account_transfers:1,order_status:1,withdraw_status:1,sub_account_balances:2.5,sub_account_margin_balances:2.5,sub_account_futures_balances:2.5,sub_account_cross_margin_balances:2.5,saved_address:1,fee:1,total_balance:2.5,small_balance:1,small_balance_history:1,push:1},post:{transfers:2.5,sub_account_transfers:2.5,sub_account_to_sub_account:2.5,small_balance:1}},subAccounts:{get:{sub_accounts:2.5,"sub_accounts/{user_id}":2.5,"sub_accounts/{user_id}/keys":2.5,"sub_accounts/{user_id}/keys/{key}":2.5},post:{sub_accounts:2.5,"sub_accounts/{user_id}/keys":2.5,"sub_accounts/{user_id}/lock":2.5,"sub_accounts/{user_id}/unlock":2.5},put:{"sub_accounts/{user_id}/keys/{key}":2.5},delete:{"sub_accounts/{user_id}/keys/{key}":2.5}},unified:{get:{accounts:20/15,account_mode:20/15,borrowable:20/15,transferable:20/15,loans:20/15,loan_records:20/15,interest_records:20/15,estimate_rate:20/15,currency_discount_tiers:20/15,risk_units:20/15,unified_mode:20/15,loan_margin_tiers:20/15,"leverage/user_currency_config":20/15,"leverage/user_currency_setting":20/15},post:{account_mode:20/15,loans:200/15,portfolio_calculator:20/15,"leverage/user_currency_setting":20/15},put:{unified_mode:20/15}},spot:{get:{fee:1,batch_fee:1,accounts:1,account_book:1,open_orders:1,orders:1,"orders/{order_id}":1,my_trades:1,price_orders:1,"price_orders/{order_id}":1},post:{batch_orders:.4,cross_liquidate_orders:1,orders:.4,cancel_batch_orders:20/75,countdown_cancel_all:20/75,amend_batch_orders:.4,price_orders:.4},delete:{orders:20/75,"orders/{order_id}":20/75,price_orders:20/75,"price_orders/{order_id}":20/75},patch:{"orders/{order_id}":.4}},margin:{get:{accounts:20/15,account_book:20/15,funding_accounts:20/15,auto_repay:20/15,transferable:20/15,loans:20/15,"loans/{loan_id}":20/15,"loans/{loan_id}/repayment":20/15,loan_records:20/15,"loan_records/{loan_record_id}":20/15,borrowable:20/15,"cross/accounts":20/15,"cross/account_book":20/15,"cross/loans":20/15,"cross/loans/{loan_id}":20/15,"cross/repayments":20/15,"cross/interest_records":20/15,"cross/transferable":20/15,"cross/estimate_rate":20/15,"cross/borrowable":20/15,"uni/estimate_rate":20/15,"uni/loans":20/15,"uni/loan_records":20/15,"uni/interest_records":20/15,"uni/borrowable":20/15},post:{auto_repay:20/15,loans:20/15,merged_loans:20/15,"loans/{loan_id}/repayment":20/15,"cross/loans":20/15,"cross/repayments":20/15,"uni/loans":20/15},patch:{"loans/{loan_id}":20/15,"loan_records/{loan_record_id}":20/15},delete:{"loans/{loan_id}":20/15}},flash_swap:{get:{currencies:1,currency_pairs:1,orders:1,"orders/{order_id}":1},post:{orders:1,"orders/preview":1}},futures:{get:{"{settle}/accounts":1,"{settle}/account_book":1,"{settle}/positions":1,"{settle}/positions/{contract}":1,"{settle}/dual_comp/positions/{contract}":1,"{settle}/orders":1,"{settle}/orders_timerange":1,"{settle}/orders/{order_id}":1,"{settle}/my_trades":1,"{settle}/my_trades_timerange":1,"{settle}/position_close":1,"{settle}/liquidates":1,"{settle}/auto_deleverages":1,"{settle}/fee":1,"{settle}/risk_limit_tiers":1,"{settle}/price_orders":1,"{settle}/price_orders/{order_id}":1},post:{"{settle}/positions/{contract}/margin":1,"{settle}/positions/{contract}/leverage":1,"{settle}/positions/{contract}/risk_limit":1,"{settle}/dual_mode":1,"{settle}/dual_comp/positions/{contract}/margin":1,"{settle}/dual_comp/positions/{contract}/leverage":1,"{settle}/dual_comp/positions/{contract}/risk_limit":1,"{settle}/orders":.4,"{settle}/batch_orders":.4,"{settle}/countdown_cancel_all":.4,"{settle}/batch_cancel_orders":.4,"{settle}/price_orders":.4},put:{"{settle}/orders/{order_id}":1},delete:{"{settle}/orders":20/75,"{settle}/orders/{order_id}":20/75,"{settle}/price_orders":20/75,"{settle}/price_orders/{order_id}":20/75}},delivery:{get:{"{settle}/accounts":20/15,"{settle}/account_book":20/15,"{settle}/positions":20/15,"{settle}/positions/{contract}":20/15,"{settle}/orders":20/15,"{settle}/orders/{order_id}":20/15,"{settle}/my_trades":20/15,"{settle}/position_close":20/15,"{settle}/liquidates":20/15,"{settle}/settlements":20/15,"{settle}/price_orders":20/15,"{settle}/price_orders/{order_id}":20/15},post:{"{settle}/positions/{contract}/margin":20/15,"{settle}/positions/{contract}/leverage":20/15,"{settle}/positions/{contract}/risk_limit":20/15,"{settle}/orders":20/15,"{settle}/price_orders":20/15},delete:{"{settle}/orders":20/15,"{settle}/orders/{order_id}":20/15,"{settle}/price_orders":20/15,"{settle}/price_orders/{order_id}":20/15}},options:{get:{my_settlements:20/15,accounts:20/15,account_book:20/15,positions:20/15,"positions/{contract}":20/15,position_close:20/15,orders:20/15,"orders/{order_id}":20/15,my_trades:20/15,mmp:20/15},post:{orders:20/15,countdown_cancel_all:20/15,mmp:20/15,"mmp/reset":20/15},delete:{orders:20/15,"orders/{order_id}":20/15}},earn:{get:{"uni/currencies":20/15,"uni/currencies/{currency}":20/15,"uni/lends":20/15,"uni/lend_records":20/15,"uni/interests/{currency}":20/15,"uni/interest_records":20/15,"uni/interest_status/{currency}":20/15},post:{"uni/lends":20/15},put:{"uni/interest_reinvest":20/15},patch:{"uni/lends":20/15}},loan:{get:{"collateral/orders":20/15,"collateral/orders/{order_id}":20/15,"collateral/repay_records":20/15,"collateral/collaterals":20/15,"collateral/total_amount":20/15,"collateral/ltv":20/15,"collateral/currencies":20/15,"multi_collateral/orders":20/15,"multi_collateral/orders/{order_id}":20/15,"multi_collateral/repay":20/15,"multi_collateral/mortgage":20/15,"multi_collateral/currency_quota":20/15,"multi_collateral/currencies":20/15,"multi_collateral/ltv":20/15,"multi_collateral/fixed_rate":20/15,"multi_collateral/current_rate":20/15},post:{"collateral/orders":20/15,"collateral/repay":20/15,"collateral/collaterals":20/15,"multi_collateral/orders":20/15,"multi_collateral/repay":20/15,"multi_collateral/mortgage":20/15}},account:{get:{detail:20/15,rate_limit:20/15,stp_groups:20/15,"stp_groups/{stp_id}/users":20/15,"stp_groups/debit_fee":20/15},post:{stp_groups:20/15,"stp_groups/{stp_id}/users":20/15},delete:{"stp_groups/{stp_id}/users":20/15}},rebate:{get:{"agency/transaction_history":20/15,"agency/commission_history":20/15}}}},timeframes:{"10s":"10s","1m":"1m","5m":"5m","15m":"15m","30m":"30m","1h":"1h","2h":"2h","4h":"4h","8h":"8h","1d":"1d","7d":"7d","1w":"7d"},commonCurrencies:{ORT:"XREATORS",ASS:"ASSF","88MPH":"MPH",AXIS:"AXISDEFI",BIFI:"BITCOINFILE",BOX:"DEFIBOX",BYN:"BEYONDFI",EGG:"GOOSEFINANCE",GTC:"GAMECOM",GTC_HT:"GAMECOM_HT",GTC_BSC:"GAMECOM_BSC",HIT:"HITCHAIN",MM:"MILLION",MPH:"MORPHER",POINT:"GATEPOINT",RAI:"RAIREFLEXINDEX",RED:"RedLang",SBTC:"SUPERBITCOIN",TNC:"TRINITYNETWORKCREDIT",VAI:"VAIOT",TRAC:"TRACO"},requiredCredentials:{apiKey:!0,secret:!0},headers:{"X-Gate-Channel-Id":"ccxt"},options:{timeDifference:0,adjustForTimeDifference:!1,sandboxMode:!1,unifiedAccount:void 0,createOrder:{expiration:86400},createMarketBuyOrderRequiresPrice:!0,networks:{BTC:"BTC",BRC20:"BTCBRC",ETH:"ETH",ERC20:"ETH",TRX:"TRX",TRC20:"TRX",HECO:"HT",HRC20:"HT",BSC:"BSC",BEP20:"BSC",SOL:"SOL",MATIC:"MATIC",OPTIMISM:"OPETH",ADA:"ADA",AVAXC:"AVAX_C",NEAR:"NEAR",ARBONE:"ARBEVM",BASE:"BASEEVM",SUI:"SUI",CRONOS:"CRO",CRO:"CRO",APT:"APT",SCROLL:"SCROLLETH",TAIKO:"TAIKOETH",HYPE:"HYPE",ALGO:"ALGO",LINEA:"LINEAETH",BLAST:"BLASTETH",XLM:"XLM",RSK:"RBTC",TON:"TON",MNT:"MNT",CELO:"CELO",HBAR:"HBAR",ZKSERA:"ZKSERA",KLAY:"KLAY",EOS:"EOS",ACA:"ACA",XTZ:"XTZ",EGLD:"EGLD",GLMR:"GLMR",AURORA:"AURORAEVM",KON:"KONET",GATECHAIN:"GTEVM",KUSAMA:"KSMSM",OKC:"OKT",POLKADOT:"DOTSM",LUNA:"LUNC"},networksById:{OPETH:"OP",ETH:"ERC20",ERC20:"ERC20",TRX:"TRC20",TRC20:"TRC20",HT:"HRC20",HECO:"HRC20",BSC:"BEP20",BEP20:"BEP20",POLYGON:"MATIC",POL:"MATIC"},timeInForce:{GTC:"gtc",IOC:"ioc",PO:"poc",POC:"poc",FOK:"fok"},accountsByType:{funding:"spot",spot:"spot",margin:"margin",cross_margin:"cross_margin",cross:"cross_margin",isolated:"margin",swap:"futures",future:"delivery",futures:"futures",delivery:"delivery",option:"options",options:"options"},fetchMarkets:{types:["spot","swap","future","option"]},swap:{fetchMarkets:{settlementCurrencies:["usdt","btc"]}},future:{fetchMarkets:{settlementCurrencies:["usdt"]}}},features:{default:{sandbox:!0,createOrder:{marginMode:!0,triggerPrice:!0,triggerDirection:!0,triggerPriceType:void 0,stopLossPrice:!0,takeProfitPrice:!0,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!0,FOK:!0,PO:!0,GTD:!1},hedged:!1,trailing:!1,iceberg:!0,selfTradePrevention:!0,leverage:!1,marketBuyByCost:!0,marketBuyRequiresPrice:!0},createOrders:{max:40},fetchMyTrades:{marginMode:!0,limit:1e3,daysBack:void 0,untilDays:30,symbolRequired:!1},fetchOrder:{marginMode:!1,trigger:!0,trailing:!1,symbolRequired:!0},fetchOpenOrders:{marginMode:!0,trigger:!0,trailing:!1,limit:100,symbolRequired:!1},fetchOrders:void 0,fetchClosedOrders:{marginMode:!0,trigger:!0,trailing:!1,limit:100,untilDays:30,daysBack:void 0,daysBackCanceled:void 0,symbolRequired:!1},fetchOHLCV:{limit:1e3}},spot:{extends:"default"},forDerivatives:{extends:"spot",createOrder:{marginMode:!1,triggerPriceType:{last:!0,mark:!0,index:!0}},createOrders:{max:10},fetchMyTrades:{marginMode:!1,untilDays:void 0},fetchOpenOrders:{marginMode:!1},fetchClosedOrders:{marginMode:!1,untilDays:void 0,limit:1e3},fetchOHLCV:{limit:1999}},swap:{linear:{extends:"forDerivatives"},inverse:{extends:"forDerivatives"}},future:{linear:{extends:"forDerivatives"},inverse:{extends:"forDerivatives"}}},precisionMode:a.kb,fees:{trading:{tierBased:!0,feeSide:"get",percentage:!0,maker:this.parseNumber("0.002"),taker:this.parseNumber("0.002"),tiers:{maker:[[this.parseNumber("0"),this.parseNumber("0.002")],[this.parseNumber("1.5"),this.parseNumber("0.00185")],[this.parseNumber("3"),this.parseNumber("0.00175")],[this.parseNumber("6"),this.parseNumber("0.00165")],[this.parseNumber("12.5"),this.parseNumber("0.00155")],[this.parseNumber("25"),this.parseNumber("0.00145")],[this.parseNumber("75"),this.parseNumber("0.00135")],[this.parseNumber("200"),this.parseNumber("0.00125")],[this.parseNumber("500"),this.parseNumber("0.00115")],[this.parseNumber("1250"),this.parseNumber("0.00105")],[this.parseNumber("2500"),this.parseNumber("0.00095")],[this.parseNumber("3000"),this.parseNumber("0.00085")],[this.parseNumber("6000"),this.parseNumber("0.00075")],[this.parseNumber("11000"),this.parseNumber("0.00065")],[this.parseNumber("20000"),this.parseNumber("0.00055")],[this.parseNumber("40000"),this.parseNumber("0.00055")],[this.parseNumber("75000"),this.parseNumber("0.00055")]],taker:[[this.parseNumber("0"),this.parseNumber("0.002")],[this.parseNumber("1.5"),this.parseNumber("0.00195")],[this.parseNumber("3"),this.parseNumber("0.00185")],[this.parseNumber("6"),this.parseNumber("0.00175")],[this.parseNumber("12.5"),this.parseNumber("0.00165")],[this.parseNumber("25"),this.parseNumber("0.00155")],[this.parseNumber("75"),this.parseNumber("0.00145")],[this.parseNumber("200"),this.parseNumber("0.00135")],[this.parseNumber("500"),this.parseNumber("0.00125")],[this.parseNumber("1250"),this.parseNumber("0.00115")],[this.parseNumber("2500"),this.parseNumber("0.00105")],[this.parseNumber("3000"),this.parseNumber("0.00095")],[this.parseNumber("6000"),this.parseNumber("0.00085")],[this.parseNumber("11000"),this.parseNumber("0.00075")],[this.parseNumber("20000"),this.parseNumber("0.00065")],[this.parseNumber("40000"),this.parseNumber("0.00065")],[this.parseNumber("75000"),this.parseNumber("0.00065")]]}},swap:{tierBased:!0,feeSide:"base",percentage:!0,maker:this.parseNumber("0.0"),taker:this.parseNumber("0.0005"),tiers:{maker:[[this.parseNumber("0"),this.parseNumber("0.0000")],[this.parseNumber("1.5"),this.parseNumber("-0.00005")],[this.parseNumber("3"),this.parseNumber("-0.00005")],[this.parseNumber("6"),this.parseNumber("-0.00005")],[this.parseNumber("12.5"),this.parseNumber("-0.00005")],[this.parseNumber("25"),this.parseNumber("-0.00005")],[this.parseNumber("75"),this.parseNumber("-0.00005")],[this.parseNumber("200"),this.parseNumber("-0.00005")],[this.parseNumber("500"),this.parseNumber("-0.00005")],[this.parseNumber("1250"),this.parseNumber("-0.00005")],[this.parseNumber("2500"),this.parseNumber("-0.00005")],[this.parseNumber("3000"),this.parseNumber("-0.00008")],[this.parseNumber("6000"),this.parseNumber("-0.01000")],[this.parseNumber("11000"),this.parseNumber("-0.01002")],[this.parseNumber("20000"),this.parseNumber("-0.01005")],[this.parseNumber("40000"),this.parseNumber("-0.02000")],[this.parseNumber("75000"),this.parseNumber("-0.02005")]],taker:[[this.parseNumber("0"),this.parseNumber("0.00050")],[this.parseNumber("1.5"),this.parseNumber("0.00048")],[this.parseNumber("3"),this.parseNumber("0.00046")],[this.parseNumber("6"),this.parseNumber("0.00044")],[this.parseNumber("12.5"),this.parseNumber("0.00042")],[this.parseNumber("25"),this.parseNumber("0.00040")],[this.parseNumber("75"),this.parseNumber("0.00038")],[this.parseNumber("200"),this.parseNumber("0.00036")],[this.parseNumber("500"),this.parseNumber("0.00034")],[this.parseNumber("1250"),this.parseNumber("0.00032")],[this.parseNumber("2500"),this.parseNumber("0.00030")],[this.parseNumber("3000"),this.parseNumber("0.00030")],[this.parseNumber("6000"),this.parseNumber("0.00030")],[this.parseNumber("11000"),this.parseNumber("0.00030")],[this.parseNumber("20000"),this.parseNumber("0.00030")],[this.parseNumber("40000"),this.parseNumber("0.00030")],[this.parseNumber("75000"),this.parseNumber("0.00030")]]}}},exceptions:{exact:{INVALID_PARAM_VALUE:o.BadRequest,INVALID_PROTOCOL:o.BadRequest,INVALID_ARGUMENT:o.BadRequest,INVALID_REQUEST_BODY:o.BadRequest,MISSING_REQUIRED_PARAM:o.ArgumentsRequired,BAD_REQUEST:o.BadRequest,INVALID_CONTENT_TYPE:o.BadRequest,NOT_ACCEPTABLE:o.BadRequest,METHOD_NOT_ALLOWED:o.BadRequest,NOT_FOUND:o.ExchangeError,AUTHENTICATION_FAILED:o.AuthenticationError,INVALID_CREDENTIALS:o.AuthenticationError,INVALID_KEY:o.AuthenticationError,IP_FORBIDDEN:o.AuthenticationError,READ_ONLY:o.PermissionDenied,INVALID_SIGNATURE:o.AuthenticationError,MISSING_REQUIRED_HEADER:o.AuthenticationError,REQUEST_EXPIRED:o.AuthenticationError,ACCOUNT_LOCKED:o.AccountSuspended,FORBIDDEN:o.PermissionDenied,SUB_ACCOUNT_NOT_FOUND:o.ExchangeError,SUB_ACCOUNT_LOCKED:o.AccountSuspended,MARGIN_BALANCE_EXCEPTION:o.ExchangeError,MARGIN_TRANSFER_FAILED:o.ExchangeError,TOO_MUCH_FUTURES_AVAILABLE:o.ExchangeError,FUTURES_BALANCE_NOT_ENOUGH:o.InsufficientFunds,ACCOUNT_EXCEPTION:o.ExchangeError,SUB_ACCOUNT_TRANSFER_FAILED:o.ExchangeError,ADDRESS_NOT_USED:o.ExchangeError,TOO_FAST:o.RateLimitExceeded,WITHDRAWAL_OVER_LIMIT:o.ExchangeError,API_WITHDRAW_DISABLED:o.ExchangeNotAvailable,INVALID_WITHDRAW_ID:o.ExchangeError,INVALID_WITHDRAW_CANCEL_STATUS:o.ExchangeError,INVALID_PRECISION:o.InvalidOrder,INVALID_CURRENCY:o.BadSymbol,INVALID_CURRENCY_PAIR:o.BadSymbol,POC_FILL_IMMEDIATELY:o.OrderImmediatelyFillable,ORDER_NOT_FOUND:o.OrderNotFound,CLIENT_ID_NOT_FOUND:o.OrderNotFound,ORDER_CLOSED:o.InvalidOrder,ORDER_CANCELLED:o.InvalidOrder,QUANTITY_NOT_ENOUGH:o.InvalidOrder,BALANCE_NOT_ENOUGH:o.InsufficientFunds,MARGIN_NOT_SUPPORTED:o.InvalidOrder,MARGIN_BALANCE_NOT_ENOUGH:o.InsufficientFunds,AMOUNT_TOO_LITTLE:o.InvalidOrder,AMOUNT_TOO_MUCH:o.InvalidOrder,REPEATED_CREATION:o.InvalidOrder,LOAN_NOT_FOUND:o.OrderNotFound,LOAN_RECORD_NOT_FOUND:o.OrderNotFound,NO_MATCHED_LOAN:o.ExchangeError,NOT_MERGEABLE:o.ExchangeError,NO_CHANGE:o.ExchangeError,REPAY_TOO_MUCH:o.ExchangeError,TOO_MANY_CURRENCY_PAIRS:o.InvalidOrder,TOO_MANY_ORDERS:o.InvalidOrder,TOO_MANY_REQUESTS:o.RateLimitExceeded,MIXED_ACCOUNT_TYPE:o.InvalidOrder,AUTO_BORROW_TOO_MUCH:o.ExchangeError,TRADE_RESTRICTED:o.InsufficientFunds,USER_NOT_FOUND:o.AccountNotEnabled,CONTRACT_NO_COUNTER:o.ExchangeError,CONTRACT_NOT_FOUND:o.BadSymbol,RISK_LIMIT_EXCEEDED:o.ExchangeError,INSUFFICIENT_AVAILABLE:o.InsufficientFunds,LIQUIDATE_IMMEDIATELY:o.InvalidOrder,LEVERAGE_TOO_HIGH:o.InvalidOrder,LEVERAGE_TOO_LOW:o.InvalidOrder,ORDER_NOT_OWNED:o.ExchangeError,ORDER_FINISHED:o.ExchangeError,POSITION_CROSS_MARGIN:o.ExchangeError,POSITION_IN_LIQUIDATION:o.ExchangeError,POSITION_IN_CLOSE:o.ExchangeError,POSITION_EMPTY:o.InvalidOrder,REMOVE_TOO_MUCH:o.ExchangeError,RISK_LIMIT_NOT_MULTIPLE:o.ExchangeError,RISK_LIMIT_TOO_HIGH:o.ExchangeError,RISK_LIMIT_TOO_lOW:o.ExchangeError,PRICE_TOO_DEVIATED:o.InvalidOrder,SIZE_TOO_LARGE:o.InvalidOrder,SIZE_TOO_SMALL:o.InvalidOrder,PRICE_OVER_LIQUIDATION:o.InvalidOrder,PRICE_OVER_BANKRUPT:o.InvalidOrder,ORDER_POC_IMMEDIATE:o.OrderImmediatelyFillable,INCREASE_POSITION:o.InvalidOrder,CONTRACT_IN_DELISTING:o.ExchangeError,INTERNAL:o.ExchangeNotAvailable,SERVER_ERROR:o.ExchangeNotAvailable,TOO_BUSY:o.ExchangeNotAvailable,CROSS_ACCOUNT_NOT_FOUND:o.ExchangeError,RISK_LIMIT_TOO_LOW:o.BadRequest,AUTO_TRIGGER_PRICE_LESS_LAST:o.InvalidOrder,AUTO_TRIGGER_PRICE_GREATE_LAST:o.InvalidOrder,POSITION_HOLDING:o.BadRequest,USER_LOAN_EXCEEDED:o.BadRequest},broad:{}}})}setSandboxMode(e){super.setSandboxMode(e),this.options.sandboxMode=e}async loadUnifiedStatus(e={}){if(void 0===this.safeBool(this.options,"unifiedAccount"))try{const t=await this.privateAccountGetDetail(e),i=this.safeDict(t,"key",{});this.options.unifiedAccount=2===this.safeInteger(i,"mode")}catch(e){this.options.unifiedAccount=!1}return this.options.unifiedAccount}async upgradeUnifiedTradeAccount(e={}){return await this.privateUnifiedPutUnifiedMode(e)}async fetchTime(e={}){const t=await this.publicSpotGetTime(e);return this.safeInteger(t,"server_time")}createExpiredOptionMarket(e){const t="USDT",i=t,s=e.split("-"),r=e.split("/"),a=e.split("_");let o,n=this.safeString(s,1);e.indexOf("/")>-1?o=this.safeString(r,0):(o=this.safeString(a,0),n=n.slice(2,8));const d=this.safeString(s,2),h=this.safeString(s,3),c=this.convertExpireDate(n),l=this.parse8601(c);return{id:o+"_"+t+"-20"+n+"-"+d+"-"+h,symbol:o+"/"+t+":"+i+"-"+n+"-"+d+"-"+h,base:o,quote:t,settle:i,baseId:o,quoteId:t,settleId:i,active:!1,type:"option",linear:void 0,inverse:void 0,spot:!1,swap:!1,future:!1,option:!0,margin:!1,contract:!0,contractSize:this.parseNumber("1"),expiry:l,expiryDatetime:c,optionType:"C"===h?"call":"put",strike:this.parseNumber(d),precision:{amount:this.parseNumber("1"),price:void 0},limits:{amount:{min:void 0,max:void 0},price:{min:void 0,max:void 0},cost:{min:void 0,max:void 0}},info:void 0}}safeMarket(e=void 0,t=void 0,i=void 0,s=void 0){return void 0!==e&&(e.indexOf("-C")>-1||e.indexOf("-P")>-1)&&!(e in this.markets_by_id)?this.createExpiredOptionMarket(e):super.safeMarket(e,t,i,s)}async fetchMarkets(e={}){this.options.adjustForTimeDifference&&await this.loadTimeDifference(),this.checkRequiredCredentials(!1)&&await this.loadUnifiedStatus();const t=[],i=this.safeBool(this.options,"sandboxMode",!1),s=this.safeDict(this.options,"fetchMarkets"),r=this.safeList(s,"types",["spot","swap","future","option"]);for(let s=0;s10)throw new o.BadRequest(this.id+" createOrders() accepts a maximum of 10 orders at a time");for(let r=0;r28)throw new o.BadRequest(this.id+" createOrder () clientOrderId or text param must be up to 28 characters");n=this.omit(n,["text","clientOrderId","textIsRequired"]),"t"!==c[0]&&(c="t-"+c),O.text=c}else l&&(O.text="t-"+this.uuid16())}else{if(d.option)throw new o.NotSupported(this.id+" createOrder() conditional option orders are not supported");if(h){if(O={initial:{contract:d.id,size:s},settle:d.settleId},O.initial.price="market"===t||0===a?"0":this.priceToPrecision(e,a),void 0===c){let t,s;p?(t="buy"===i?1:2,s=this.priceToPrecision(e,u)):m&&(t="buy"===i?2:1,s=this.priceToPrecision(e,f));const r=this.safeInteger(n,"price_type",0);if(r<0||r>2)throw new o.BadRequest(this.id+" createOrder () price_type should be 0 latest deal price, 1 mark price, 2 index price");n=this.omit(n,["price_type"]),O.trigger={price_type:r,price:this.priceToPrecision(e,s),rule:t}}void 0!==v&&(O.initial.reduce_only=v),void 0!==b&&(O.initial.tif=b)}else{const r=this.safeValue(this.options,"createOrder",{});let o;if([o,n]=this.getMarginMode(!0,n),void 0===b&&(b="gtc"),O={put:{type:t,side:i,price:this.priceToPrecision(e,a),amount:this.amountToPrecision(e,s),account:o,time_in_force:b},market:d.id},void 0===c){const t=this.safeInteger(r,"expiration"),s=this.safeInteger(n,"expiration",t);let a,o;p?(a="buy"===i?">=":"<=",o=this.priceToPrecision(e,u)):m&&(a="buy"===i?"<=":">=",o=this.priceToPrecision(e,f)),O.trigger={price:this.priceToPrecision(e,o),rule:a,expiration:s}}}}return this.extend(O,n)}async createMarketBuyOrderWithCost(e,t,i={}){await this.loadMarkets(),await this.loadUnifiedStatus();if(!this.market(e).spot)throw new o.NotSupported(this.id+" createMarketBuyOrderWithCost() supports spot orders only");return i.createMarketBuyOrderRequiresPrice=!1,await this.createOrder(e,"market","buy",t,void 0,i)}editOrderRequest(e,t,i,s,a=void 0,n=void 0,d={}){const h=this.market(t);let c;[c,d]=this.handleMarketTypeAndParams("editOrder",h,d);let l=this.convertTypeToAccount(c),u=!1;[u,d]=this.handleOptionAndParams(d,"editOrder","unifiedAccount"),u&&(l="unified");if("spot"===l&&!("limit"===i))throw new o.InvalidOrder(this.id+" editOrder() does not support "+i+" orders for "+c+" markets");const f={order_id:e.toString(),currency_pair:h.id,account:l};return void 0!==a&&(h.spot?f.amount=this.amountToPrecision(t,a):f.size="sell"===s?this.parseToNumeric(r.Y.stringNeg(this.amountToPrecision(t,a))):this.parseToNumeric(this.amountToPrecision(t,a))),void 0!==n&&(f.price=this.priceToPrecision(t,n)),h.spot||(f.settle=h.settleId),this.extend(f,d)}async editOrder(e,t,i,s,r=void 0,a=void 0,o={}){await this.loadMarkets(),await this.loadUnifiedStatus();const n=this.market(t),d=this.editOrderRequest(e,t,i,s,r,a,o);let h;return h=n.spot?await this.privateSpotPatchOrdersOrderId(d):await this.privateFuturesPutSettleOrdersOrderId(d),this.parseOrder(h,n)}parseOrderStatus(e){return this.safeString({open:"open",_new:"open",filled:"closed",cancelled:"canceled",liquidated:"closed",ioc:"canceled",failed:"canceled",expired:"canceled",finished:"closed",finish:"closed",succeeded:"closed"},e,e)}parseOrder(e,t=void 0){if(!this.safeBool(e,"succeeded",!0))return this.safeOrder({clientOrderId:this.safeString(e,"text"),info:e,status:"rejected",id:this.safeString(e,"id")});const i=this.safeValue2(e,"put","initial",{}),s=this.safeValue(e,"trigger",{});let a=this.safeString(i,"contract"),o=this.safeString(i,"type"),n=this.safeStringUpper2(i,"time_in_force","tif"),d=this.safeString2(i,"amount","size"),h=this.safeString(i,"side"),c=this.safeString(i,"price");a=this.safeString(e,"contract",a),o=this.safeString(e,"type",o),n=this.safeStringUpper2(e,"time_in_force","tif",n),"POC"===n&&(n="PO");const l="PO"===n;d=this.safeString2(e,"amount","size",d),h=this.safeString(e,"side",h),c=this.safeString(e,"price",c);let u=this.safeString(e,"left"),f=this.safeString(e,"filled_total");const p=this.safeNumber(s,"price");let m=this.safeNumber2(e,"avg_deal_price","fill_price");if(p&&(u=d,f="0"),a){o=r.Y.stringEquals(c,"0")&&"IOC"===n?"market":"limit",h=r.Y.stringGt(d,"0")?"buy":"sell"}const g=this.safeStringN(e,["finish_as","status","open"]);let v=this.safeInteger(e,"create_time_ms");void 0===v&&(v=this.safeTimestamp2(e,"create_time","ctime"));let y=this.safeInteger(e,"update_time_ms");void 0===y&&(y=this.safeTimestamp2(e,"update_time","finish_time"));let w="contract";("currency_pair"in e||"market"in e)&&(w="spot");const b=this.safeString2(e,"currency_pair","market",a),k=this.safeSymbol(b,t,"_",w),S=[],O=this.safeString(e,"gt_fee");void 0!==O&&S.push({currency:"GT",cost:O});const T=this.safeString(e,"fee");void 0!==T&&S.push({currency:this.safeCurrencyCode(this.safeString(e,"fee_currency")),cost:T});const P=this.safeString(e,"rebated_fee");void 0!==P&&S.push({currency:this.safeCurrencyCode(this.safeString(e,"rebated_fee_currency")),cost:r.Y.stringNeg(P)});const M=S.length>1,I=this.parseOrderStatus(g);let x=r.Y.stringAbs(u);if("spot"===this.safeString(e,"account")){const t=this.safeString(e,"avg_deal_price");m=this.parseNumber(t),"market"===o&&"buy"===h&&(x=r.Y.stringDiv(u,t),c=void 0,f=d,d=r.Y.stringDiv(d,t))}return this.safeOrder({id:this.safeString(e,"id"),clientOrderId:this.safeString(e,"text"),timestamp:v,datetime:this.iso8601(v),lastTradeTimestamp:y,status:I,symbol:k,type:o,timeInForce:n,postOnly:l,reduceOnly:this.safeValue(e,"is_reduce_only"),side:h,price:c,triggerPrice:p,average:m,amount:r.Y.stringAbs(d),cost:r.Y.stringAbs(f),filled:void 0,remaining:x,fee:M?void 0:this.safeValue(S,0),fees:M?S:[],trades:void 0,info:e},t)}fetchOrderRequest(e,t=void 0,i={}){const s=void 0===t?void 0:this.market(t),r=this.safeBoolN(i,["trigger","is_stop_order","stop"],!1);i=this.omit(i,["is_stop_order","stop","trigger"]);let a=this.safeString2(i,"text","clientOrderId"),o=e;void 0!==a&&(i=this.omit(i,["text","clientOrderId"]),"t"!==a[0]&&(a="t-"+a),o=a);const[n,d]=this.handleMarketTypeAndParams("fetchOrder",s,i),h="swap"===n||"future"===n||"option"===n,[c,l]=h?this.prepareRequest(s,n,d):this.spotOrderPrepareRequest(s,r,d);return c.order_id=o.toString(),[c,l]}async fetchOrder(e,t=void 0,i={}){await this.loadMarkets(),await this.loadUnifiedStatus();const s=void 0===t?void 0:this.market(t),r=this.handleMarketTypeAndParams("fetchOrder",s,i),a=this.safeString(r,0),n=this.safeBoolN(i,["trigger","is_stop_order","stop"],!1),[d,h]=this.fetchOrderRequest(e,t,i);let c;if("spot"===a||"margin"===a)c=n?await this.privateSpotGetPriceOrdersOrderId(this.extend(d,h)):await this.privateSpotGetOrdersOrderId(this.extend(d,h));else if("swap"===a)c=n?await this.privateFuturesGetSettlePriceOrdersOrderId(this.extend(d,h)):await this.privateFuturesGetSettleOrdersOrderId(this.extend(d,h));else if("future"===a)c=n?await this.privateDeliveryGetSettlePriceOrdersOrderId(this.extend(d,h)):await this.privateDeliveryGetSettleOrdersOrderId(this.extend(d,h));else{if("option"!==a)throw new o.NotSupported(this.id+" fetchOrder() not support this market type");c=await this.privateOptionsGetOrdersOrderId(this.extend(d,h))}return this.parseOrder(c,s)}async fetchOpenOrders(e=void 0,t=void 0,i=void 0,s={}){return await this.fetchOrdersByStatus("open",e,t,i,s)}async fetchClosedOrders(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets(),await this.loadUnifiedStatus();const r=this.safeInteger(s,"until");let a;void 0!==e&&(a=this.market(e),e=a.symbol);const o=this.handleMarketTypeAndParams("fetchClosedOrders",a,s),n=this.safeString(o,0);let d=!1;if([d,s]=this.handleOptionAndParams(s,"fetchClosedOrders","historical",!1),!d&&(void 0===t&&void 0===r||"swap"!==n))return await this.fetchOrdersByStatus("finished",e,t,i,s);s=this.omit(s,"type");let h={};[h,s]=this.prepareRequest(a,n,s),void 0!==t&&(h.from=this.parseToInt(t/1e3)),void 0!==r&&(s=this.omit(s,"until"),h.to=this.parseToInt(r/1e3)),void 0!==i&&(h.limit=i);const c=await this.privateFuturesGetSettleOrdersTimerange(this.extend(h,s));return this.parseOrders(c,a,t,i)}prepareOrdersByStatusRequest(e,t=void 0,i=void 0,s=void 0,r={}){let a,o,n;void 0!==t&&(a=this.market(t),t=a.symbol),[o,r]=this.handleParamBool2(r,"trigger","stop"),[n,r]=this.handleMarketTypeAndParams("fetchOrdersByStatus",a,r);const d="spot"===n||"margin"===n;let h={};if([h,r]=d?this.multiOrderSpotPrepareRequest(a,o,r):this.prepareRequest(a,n,r),d&&o&&(h=this.omit(h,"account")),"closed"===e&&(e="finished"),h.status=e,void 0!==s&&(h.limit=s),d){void 0!==i&&(h.from=this.parseToInt(i/1e3));const e=this.safeInteger(r,"until");void 0!==e&&(r=this.omit(r,"until"),h.to=this.parseToInt(e/1e3))}const[c,l]=this.handleParamString2(r,"lastId","last_id");return void 0!==c&&(h.last_id=c),[h,l]}async fetchOrdersByStatus(e,t=void 0,i=void 0,s=void 0,r={}){let a;await this.loadMarkets(),await this.loadUnifiedStatus(),void 0!==t&&(a=this.market(t),t=a.symbol);const n=this.safeBool2(r,"trigger","stop"),d=this.handleMarketTypeAndParams("fetchOrdersByStatus",a,r),h=this.safeString(d,0),[c,l]=this.prepareOrdersByStatusRequest(e,t,i,s,r),u="spot"===h||"margin"===h,f="open"===e,p=u&&f&&!n;let m;if(u)m=n?await this.privateSpotGetPriceOrders(this.extend(c,l)):f?await this.privateSpotGetOpenOrders(this.extend(c,l)):await this.privateSpotGetOrders(this.extend(c,l));else if("swap"===h)m=n?await this.privateFuturesGetSettlePriceOrders(this.extend(c,l)):await this.privateFuturesGetSettleOrders(this.extend(c,l));else if("future"===h)m=n?await this.privateDeliveryGetSettlePriceOrders(this.extend(c,l)):await this.privateDeliveryGetSettleOrders(this.extend(c,l));else{if("option"!==h)throw new o.NotSupported(this.id+" fetchOrders() not support this market type");m=await this.privateOptionsGetOrders(this.extend(c,l))}let g=m;if(p){g=[];for(let e=0;e100)throw new o.BadRequest(this.id+" setLeverage() leverage should be between 1 and 100");await this.loadMarkets();const s=this.market(t),[r,a]=this.prepareRequest(s,void 0,i),n=this.safeString2(this.options,"marginMode","defaultMarginMode"),d=this.safeString(a,"cross_leverage_limit");let h,c=this.safeString(a,"marginMode",n),l=this.numberToString(e);if(void 0!==d&&(c="cross",l=d),"cross"===c||"cross_margin"===c?(r.cross_leverage_limit=l,r.leverage="0"):r.leverage=l,s.swap)h=await this.privateFuturesPostSettlePositionsContractLeverage(this.extend(r,a));else{if(!s.future)throw new o.NotSupported(this.id+" setLeverage() not support this market type");h=await this.privateDeliveryPostSettlePositionsContractLeverage(this.extend(r,a))}return h}parsePosition(e,t=void 0){const i=this.safeString(e,"contract");t=this.safeMarket(i,t,"_","contract");const s=this.safeString2(e,"size","accum_size");let a=this.safeString(e,"side");void 0===a&&(r.Y.stringGt(s,"0")?a="long":r.Y.stringLt(s,"0")&&(a="short"));const o=this.safeString(e,"maintenance_rate"),n=this.safeString(e,"value"),d=this.safeString(e,"leverage");let h;void 0!==d&&(h="0"===d?"cross":"isolated");let c,l=this.safeString(e,"pnl_fee");if(void 0===l){const e="0.00075";l=r.Y.stringMul(e,n),c=r.Y.stringAdd(r.Y.stringDiv(n,d),l)}let u=this.safeTimestamp2(e,"open_time","first_open_time");return 0===u&&(u=void 0),this.safePosition({info:e,id:void 0,symbol:this.safeString(t,"symbol"),timestamp:u,datetime:this.iso8601(u),lastUpdateTimestamp:this.safeTimestamp2(e,"update_time","time"),initialMargin:this.parseNumber(c),initialMarginPercentage:this.parseNumber(r.Y.stringDiv(c,n)),maintenanceMargin:this.parseNumber(r.Y.stringMul(o,n)),maintenanceMarginPercentage:this.parseNumber(o),entryPrice:this.safeNumber(e,"entry_price"),notional:this.parseNumber(n),leverage:this.safeNumber(e,"leverage"),unrealizedPnl:this.safeNumber(e,"unrealised_pnl"),realizedPnl:this.safeNumber2(e,"realised_pnl","pnl"),contracts:this.parseNumber(r.Y.stringAbs(s)),contractSize:this.safeNumber(t,"contractSize"),marginRatio:void 0,liquidationPrice:this.safeNumber(e,"liq_price"),markPrice:this.safeNumber(e,"mark_price"),lastPrice:void 0,collateral:this.safeNumber(e,"margin"),marginMode:h,side:a,percentage:void 0,stopLossPrice:void 0,takeProfitPrice:void 0})}async fetchPosition(e,t={}){await this.loadMarkets();const i=this.market(e);if(!i.contract)throw new o.BadRequest(this.id+" fetchPosition() supports contract markets only");let s={};[s,t]=this.prepareRequest(i,i.type,t);const r=this.extend(s,t);let a;return i.swap?a=await this.privateFuturesGetSettlePositionsContract(r):i.future?a=await this.privateDeliveryGetSettlePositionsContract(r):"option"===i.type&&(a=await this.privateOptionsGetPositionsContract(r)),this.parsePosition(a,i)}async fetchPositions(e=void 0,t={}){let i,s;if(await this.loadMarkets(),void 0!==(e=this.marketSymbols(e,void 0,!0,!0,!0))){e.length>0&&(i=this.market(e[0]))}let r,a={};if([s,t]=this.handleMarketTypeAndParams("fetchPositions",i,t),void 0!==s&&"spot"!==s||(s="swap"),"option"===s){if(void 0!==e){const e=i.id.split("-");a.underlying=this.safeString(e,0)}}else[a,t]=this.prepareRequest(void 0,s,t);return"swap"===s?r=await this.privateFuturesGetSettlePositions(this.extend(a,t)):"future"===s?r=await this.privateDeliveryGetSettlePositions(this.extend(a,t)):"option"===s&&(r=await this.privateOptionsGetPositions(this.extend(a,t))),this.parsePositions(r,e)}async fetchLeverageTiers(e=void 0,t={}){await this.loadMarkets();const[i,s]=this.handleMarketTypeAndParams("fetchLeverageTiers",void 0,t),[r,a]=this.prepareRequest(void 0,i,s);if("future"!==i&&"swap"!==i)throw new o.BadRequest(this.id+" fetchLeverageTiers only supports swap and future");let n;if("swap"===i)n=await this.publicFuturesGetSettleContracts(this.extend(r,a));else{if("future"!==i)throw new o.NotSupported(this.id+" fetchLeverageTiers() not support this market type");n=await this.publicDeliveryGetSettleContracts(this.extend(r,a))}return this.parseLeverageTiers(n,e,"name")}async fetchMarketLeverageTiers(e,t={}){await this.loadMarkets();const i=this.market(e),[s,r]=this.handleMarketTypeAndParams("fetchMarketLeverageTiers",i,t),[a,n]=this.prepareRequest(i,s,r);if("future"!==s&&"swap"!==s)throw new o.BadRequest(this.id+" fetchMarketLeverageTiers only supports swap and future");const d=await this.privateFuturesGetSettleRiskLimitTiers(this.extend(a,n));return this.parseMarketLeverageTiers(d,i)}parseEmulatedLeverageTiers(e,t=void 0){const i=this.safeString(e,"name"),s=this.safeString(e,"maintenance_rate"),a=this.safeString(e,"leverage_max"),o=this.safeString(e,"risk_limit_step"),n=this.safeString(e,"risk_limit_max"),d=r.Y.stringDiv("1",a);let h=s,c=d,l="0";const u=[];for(;r.Y.stringLt(l,n);){const a=r.Y.stringAdd(l,o);u.push({tier:this.parseNumber(r.Y.stringDiv(a,o)),symbol:this.safeSymbol(i,t,void 0,"contract"),currency:this.safeString(t,"settle"),minNotional:this.parseNumber(l),maxNotional:this.parseNumber(a),maintenanceMarginRate:this.parseNumber(h),maxLeverage:this.parseNumber(r.Y.stringDiv("1",c)),info:e}),h=r.Y.stringAdd(h,s),c=r.Y.stringAdd(c,d),l=a}return u}parseMarketLeverageTiers(e,t=void 0){if(!Array.isArray(e))return this.parseEmulatedLeverageTiers(e,t);let i=0;const s=[];for(let r=0;r-1&&e.endsWith("batch_cancel_orders")){const t=this.safeDict(s,0);e=this.implodeParams(e,t);const i=[],r=s;for(let e=1;e=0||i.indexOf("positions")>=0}if("GET"===i||"DELETE"===i||s||"PATCH"===i)Object.keys(c).length&&(t=this.urlencode(c),t.indexOf("currencies=")>=0&&t.indexOf("%2C")>=0&&(t=t.replaceAll("%2C",",")),f+="?"+t),"PATCH"===i&&(a=this.json(c));else{const e=this.safeValue(c,"query",{});Object.keys(e).length&&(t=this.urlencode(e),f+="?"+t),c=this.omit(c,"query"),a=this.json(c)}const o=void 0===a?"":a,d=this.hash(this.encode(o),n.Zf),l=this.nonce(),p=this.parseToInt(l/1e3).toString(),m="/api/"+this.version+u,g=[i.toUpperCase(),m,t,d,p].join("\n"),v=this.hmac(this.encode(g),this.encode(this.secret),n.Zf);r={KEY:this.apiKey,Timestamp:p,SIGN:v,"Content-Type":"application/json"}}return{url:f,method:i,body:a,headers:r}}async modifyMarginHelper(e,t,i={}){await this.loadMarkets();const s=this.market(e),[r,a]=this.prepareRequest(s,void 0,i);let n;if(r.change=this.numberToString(t),s.swap)n=await this.privateFuturesPostSettlePositionsContractMargin(this.extend(r,a));else{if(!s.future)throw new o.NotSupported(this.id+" modifyMarginHelper() not support this market type");n=await this.privateDeliveryPostSettlePositionsContractMargin(this.extend(r,a))}return this.parseMarginModification(n,s)}parseMarginModification(e,t=void 0){const i=this.safeString(e,"contract");t=this.safeMarket(i,t,"_","contract");const s=this.safeNumber(e,"margin");return{info:e,symbol:t.symbol,type:void 0,marginMode:"isolated",amount:void 0,total:s,code:this.safeValue(t,"quote"),status:"ok",timestamp:void 0,datetime:void 0}}async reduceMargin(e,t,i={}){return await this.modifyMarginHelper(e,-t,i)}async addMargin(e,t,i={}){return await this.modifyMarginHelper(e,t,i)}async fetchOpenInterestHistory(e,t="5m",i=void 0,s=void 0,r={}){await this.loadMarkets();let a=!1;if([a,r]=this.handleOptionAndParams(r,"fetchOpenInterestHistory","paginate",!1),a)return await this.fetchPaginatedCallDeterministic("fetchOpenInterestHistory",e,i,s,t,r,100);const n=this.market(e);if(!n.swap)throw new o.BadRequest(this.id+" fetchOpenInterest() supports swap markets only");const d={contract:n.id,settle:n.settleId,interval:this.safeString(this.timeframes,t,t)};void 0!==s&&(d.limit=s),void 0!==i&&(d.from=i);const h=await this.publicFuturesGetSettleContractStats(this.extend(d,r));return this.parseOpenInterestsHistory(h,n,i,s)}parseOpenInterest(e,t=void 0){const i=this.safeTimestamp(e,"time");return{symbol:this.safeString(t,"symbol"),openInterestAmount:this.safeNumber(e,"open_interest"),openInterestValue:this.safeNumber(e,"open_interest_usd"),timestamp:i,datetime:this.iso8601(i),info:e}}async fetchSettlementHistory(e=void 0,t=void 0,i=void 0,s={}){if(void 0===e)throw new o.ArgumentsRequired(this.id+" fetchSettlementHistory() requires a symbol argument");await this.loadMarkets();const r=this.market(e);let a;if([a,s]=this.handleMarketTypeAndParams("fetchSettlementHistory",r,s),"option"!==a)throw new o.NotSupported(this.id+" fetchSettlementHistory() supports option markets only");const n=r.id.split("-"),d={underlying:this.safeString(n,0)};void 0!==t&&(d.from=t),void 0!==i&&(d.limit=i);const h=await this.publicOptionsGetSettlements(this.extend(d,s)),c=this.parseSettlements(h,r),l=this.sortBy(c,"timestamp");return this.filterBySymbolSinceLimit(l,e,t,i)}async fetchMySettlementHistory(e=void 0,t=void 0,i=void 0,s={}){if(void 0===e)throw new o.ArgumentsRequired(this.id+" fetchMySettlementHistory() requires a symbol argument");await this.loadMarkets();const r=this.market(e);let a;if([a,s]=this.handleMarketTypeAndParams("fetchMySettlementHistory",r,s),"option"!==a)throw new o.NotSupported(this.id+" fetchMySettlementHistory() supports option markets only");const n=r.id,d=n.split("-"),h={underlying:this.safeString(d,0),contract:n};void 0!==t&&(h.from=t),void 0!==i&&(h.limit=i);const c=await this.privateOptionsGetMySettlements(this.extend(h,s)),l=this.safeValue(c,"result",{}),u=this.safeValue(l,"list",[]),f=this.parseSettlements(u,r),p=this.sortBy(f,"timestamp");return this.filterBySymbolSinceLimit(p,r.symbol,t,i)}parseSettlement(e,t){const i=this.safeTimestamp(e,"time"),s=this.safeString(e,"contract");return{info:e,symbol:this.safeSymbol(s,t),price:this.safeNumber(e,"settle_price"),timestamp:i,datetime:this.iso8601(i)}}parseSettlements(e,t){const i=[];for(let s=0;s10?parseInt(n):1e3*parseInt(n);const h=this.safeString(e,"balance"),c=this.safeString(e,"change"),l=this.parseNumber(r.Y.stringSub(h,c));return this.safeLedgerEntry({info:e,id:this.safeString(e,"id"),direction:i,account:void 0,referenceAccount:void 0,referenceId:void 0,type:this.parseLedgerEntryType(o),currency:this.safeCurrencyCode(a,t),amount:this.parseNumber(s),timestamp:d,datetime:this.iso8601(d),before:l,after:this.safeNumber(e,"balance"),status:void 0,fee:void 0},t)}parseLedgerEntryType(e){return this.safeString({deposit:"deposit",withdraw:"withdrawal",sub_account_transfer:"transfer",margin_in:"transfer",margin_out:"transfer",margin_funding_in:"transfer",margin_funding_out:"transfer",cross_margin_in:"transfer",cross_margin_out:"transfer",copy_trading_in:"transfer",copy_trading_out:"transfer",quant_in:"transfer",quant_out:"transfer",futures_in:"transfer",futures_out:"transfer",delivery_in:"transfer",delivery_out:"transfer",new_order:"trade",order_fill:"trade",referral_fee:"rebate",order_fee:"fee",interest:"interest",lend:"loan",redeem:"loan",profit:"interest",flash_swap_buy:"trade",flash_swap_sell:"trade",unknown:"unknown",set:"settlement",prem:"trade",point_refr:"rebate",point_fee:"fee",point_dnw:"deposit/withdraw",fund:"fee",refr:"rebate",fee:"fee",pnl:"trade",dnw:"deposit/withdraw"},e,e)}async setPositionMode(e,t=void 0,i={}){const s=void 0!==t?this.market(t):void 0,[r,a]=this.prepareRequest(s,"swap",i);return r.dual_mode=e,await this.privateFuturesPostSettleDualMode(this.extend(r,a))}async fetchUnderlyingAssets(e={}){let t;if(await this.loadMarkets(),[t,e]=this.handleMarketTypeAndParams("fetchUnderlyingAssets",void 0,e),void 0!==t&&"spot"!==t||(t="option"),"option"!==t)throw new o.NotSupported(this.id+" fetchUnderlyingAssets() supports option markets only");const i=await this.publicOptionsGetUnderlyings(e),s=[];for(let e=0;e{i.d(t,{A:()=>r});var s=i(9403);class r extends s.A{describe(){return this.deepExtend(super.describe(),{id:"gateio",alias:!0})}}},8823:(e,t,i)=>{i.d(t,{A:()=>d});var s=i(3434),r=i(2079),a=i(5147),o=i(1579),n=i(7481);class d extends s.A{describe(){return this.deepExtend(super.describe(),{id:"gemini",name:"Gemini",countries:["US"],rateLimit:100,version:"v1",pro:!0,has:{CORS:void 0,spot:!0,margin:!1,swap:!0,future:!1,option:!1,addMargin:!1,cancelOrder:!0,closeAllPositions:!1,closePosition:!1,createDepositAddress:!0,createMarketOrder:!1,createOrder:!0,createReduceOnlyOrder:!1,fetchBalance:!0,fetchBidsAsks:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchClosedOrders:!1,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!0,fetchDepositAddress:!0,fetchDepositAddresses:!1,fetchDepositAddressesByNetwork:!0,fetchDepositsWithdrawals:!0,fetchFundingHistory:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchLeverage:!1,fetchLeverageTiers:!1,fetchMarginMode:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenInterestHistory:!1,fetchOpenOrders:!0,fetchOrder:!0,fetchOrderBook:!0,fetchOrders:!1,fetchPosition:!1,fetchPositionMode:!1,fetchPositions:!1,fetchPositionsRisk:!1,fetchPremiumIndexOHLCV:!1,fetchTicker:!0,fetchTickers:!0,fetchTrades:!0,fetchTradingFee:!1,fetchTradingFees:!0,fetchTransactions:"emulated",postOnly:!0,reduceMargin:!1,sandbox:!0,setLeverage:!1,setMarginMode:!1,setPositionMode:!1,withdraw:!0},urls:{logo:"https://user-images.githubusercontent.com/1294454/27816857-ce7be644-6096-11e7-82d6-3c257263229c.jpg",api:{public:"https://api.gemini.com",private:"https://api.gemini.com",web:"https://docs.gemini.com",webExchange:"https://exchange.gemini.com"},www:"https://gemini.com/",doc:["https://docs.gemini.com/rest-api","https://docs.sandbox.gemini.com"],test:{public:"https://api.sandbox.gemini.com",private:"https://api.sandbox.gemini.com",web:"https://docs.gemini.com",webExchange:"https://exchange.gemini.com"},fees:["https://gemini.com/api-fee-schedule","https://gemini.com/trading-fees","https://gemini.com/transfer-fees"]},api:{webExchange:{get:[""]},web:{get:["rest-api"]},public:{get:{"v1/symbols":5,"v1/symbols/details/{symbol}":5,"v1/staking/rates":5,"v1/pubticker/{symbol}":5,"v2/ticker/{symbol}":5,"v2/candles/{symbol}/{timeframe}":5,"v1/trades/{symbol}":5,"v1/auction/{symbol}":5,"v1/auction/{symbol}/history":5,"v1/pricefeed":5,"v1/book/{symbol}":5,"v1/earn/rates":5}},private:{post:{"v1/staking/unstake":1,"v1/staking/stake":1,"v1/staking/rewards":1,"v1/staking/history":1,"v1/order/new":1,"v1/order/cancel":1,"v1/wrap/{symbol}":1,"v1/order/cancel/session":1,"v1/order/cancel/all":1,"v1/order/status":1,"v1/orders":1,"v1/mytrades":1,"v1/notionalvolume":1,"v1/tradevolume":1,"v1/clearing/new":1,"v1/clearing/status":1,"v1/clearing/cancel":1,"v1/clearing/confirm":1,"v1/balances":1,"v1/balances/staking":1,"v1/notionalbalances/{currency}":1,"v1/transfers":1,"v1/addresses/{network}":1,"v1/deposit/{network}/newAddress":1,"v1/deposit/{currency}/newAddress":1,"v1/withdraw/{currency}":1,"v1/account/transfer/{currency}":1,"v1/payments/addbank":1,"v1/payments/methods":1,"v1/payments/sen/withdraw":1,"v1/balances/earn":1,"v1/earn/interest":1,"v1/earn/history":1,"v1/approvedAddresses/{network}/request":1,"v1/approvedAddresses/account/{network}":1,"v1/approvedAddresses/{network}/remove":1,"v1/account":1,"v1/account/create":1,"v1/account/list":1,"v1/heartbeat":1,"v1/roles":1}}},precisionMode:o.kb,fees:{trading:{taker:.004,maker:.002}},httpExceptions:{400:r.BadRequest,403:r.PermissionDenied,404:r.OrderNotFound,406:r.InsufficientFunds,429:r.RateLimitExceeded,500:r.ExchangeError,502:r.ExchangeNotAvailable,503:r.OnMaintenance},timeframes:{"1m":"1m","5m":"5m","15m":"15m","30m":"30m","1h":"1hr","6h":"6hr","1d":"1day"},exceptions:{exact:{AuctionNotOpen:r.BadRequest,ClientOrderIdTooLong:r.BadRequest,ClientOrderIdMustBeString:r.BadRequest,ConflictingOptions:r.BadRequest,EndpointMismatch:r.BadRequest,EndpointNotFound:r.BadRequest,IneligibleTiming:r.BadRequest,InsufficientFunds:r.InsufficientFunds,InvalidJson:r.BadRequest,InvalidNonce:r.InvalidNonce,InvalidApiKey:r.AuthenticationError,InvalidOrderType:r.InvalidOrder,InvalidPrice:r.InvalidOrder,InvalidQuantity:r.InvalidOrder,InvalidSide:r.InvalidOrder,InvalidSignature:r.AuthenticationError,InvalidSymbol:r.BadRequest,InvalidTimestampInPayload:r.BadRequest,Maintenance:r.OnMaintenance,MarketNotOpen:r.InvalidOrder,MissingApikeyHeader:r.AuthenticationError,MissingOrderField:r.InvalidOrder,MissingRole:r.AuthenticationError,MissingPayloadHeader:r.AuthenticationError,MissingSignatureHeader:r.AuthenticationError,NoSSL:r.AuthenticationError,OptionsMustBeArray:r.BadRequest,OrderNotFound:r.OrderNotFound,RateLimit:r.RateLimitExceeded,System:r.ExchangeError,UnsupportedOption:r.BadRequest},broad:{"The Gemini Exchange is currently undergoing maintenance.":r.OnMaintenance,"We are investigating technical issues with the Gemini Exchange.":r.ExchangeNotAvailable,"Internal Server Error":r.ExchangeNotAvailable}},options:{fetchMarketsMethod:"fetch_markets_from_api",fetchMarketFromWebRetries:10,fetchMarketsFromAPI:{fetchDetailsForAllSymbols:!1,quoteCurrencies:["USDT","GUSD","USD","DAI","EUR","GBP","SGD","BTC","ETH","LTC","BCH","SOL"]},fetchMarkets:{webApiEnable:!0,webApiRetries:10},fetchUsdtMarkets:["btcusdt","ethusdt"],fetchCurrencies:{webApiEnable:!0,webApiRetries:5,webApiMuteFailure:!0},fetchTickerMethod:"fetchTickerV1",networks:{BTC:"bitcoin",ERC20:"ethereum",BCH:"bitcoincash",LTC:"litecoin",ZEC:"zcash",FIL:"filecoin",DOGE:"dogecoin",XTZ:"tezos",AVAXX:"avalanche",SOL:"solana",ATOM:"cosmos",DOT:"polkadot"},nonce:"milliseconds",conflictingMarkets:{paxgusd:{base:"PAXG",quote:"USD"}}},features:{default:{sandbox:!0,createOrder:{marginMode:!1,triggerPrice:!0,triggerPriceType:void 0,triggerDirection:!1,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!0,FOK:!0,PO:!0,GTD:!1},hedged:!1,trailing:!1,leverage:!1,marketBuyByCost:!0,marketBuyRequiresPrice:!1,selfTradePrevention:!1,iceberg:!1},createOrders:void 0,fetchMyTrades:{marginMode:!1,limit:500,daysBack:void 0,untilDays:void 0,symbolRequired:!0},fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!1},fetchOpenOrders:{marginMode:!1,limit:void 0,trigger:!1,trailing:!1,symbolRequired:!1},fetchOrders:void 0,fetchClosedOrders:void 0,fetchOHLCV:{limit:void 0}},spot:{extends:"default"},swap:{linear:{extends:"default"},inverse:void 0},future:{linear:void 0,inverse:void 0}}})}async fetchCurrencies(e={}){return await this.fetchCurrenciesFromWeb(e)}async fetchCurrenciesFromWeb(e={}){const t=await this.fetchWebEndpoint("fetchCurrencies","webExchangeGet",!0,'="currencyData">',"<\/script>");if(void 0===t)return;const i={};this.options.tradingPairs=this.safeList(t,"tradingPairs");const s=this.safeValue(t,"currencies",[]);for(let e=0;eSymbols and minimums'),i=this.id+" fetchMarketsFromWeb() the API doc HTML markup has changed, breaking the parser of order limits and precision info for markets.",s=t.split("tbody>");if(s.length<2)throw new r.NotSupported(i);const a=s[1].split("\n\n"),o=a.length;if(o<2)throw new r.NotSupported(i);const n=[];for(let e=1;e\n");if(s.length<5)throw new r.NotSupported(i);let o=s[0].replace("","");o=o.replace("*","");const d=s[1].replace("","").split(" "),h=this.safeNumber(d,0),c=s[2].replace("","").split(" "),l=o.length-0,u=l-3,f=s[3].replace("","").split(" "),p=this.safeStringLower(f,1,o.slice(u,l)),m=this.safeStringLower(c,1,o.replace(p,"")),g=this.safeCurrencyCode(m),v=this.safeCurrencyCode(p);n.push({id:o,symbol:g+"/"+v,base:g,quote:v,settle:void 0,baseId:m,quoteId:p,settleId:void 0,type:"spot",spot:!0,margin:!1,swap:!1,future:!1,option:!1,active:void 0,contract:!1,linear:void 0,inverse:void 0,contractSize:void 0,expiry:void 0,expiryDatetime:void 0,strike:void 0,optionType:void 0,precision:{amount:this.safeNumber(c,0),price:this.safeNumber(f,0)},limits:{leverage:{min:void 0,max:void 0},amount:{min:h,max:void 0},price:{min:void 0,max:void 0},cost:{min:void 0,max:void 0}},created:void 0,info:t})}return n}parseMarketActive(e){return void 0===e||this.safeBool({open:!0,closed:!1,cancel_only:!0,post_only:!0,limit_only:!0},e,!0)}async fetchUSDTMarkets(e={}){if("test"in this.urls)return[];const t=this.safeValue(this.options,"fetchUsdtMarkets",[]),i=[];for(let s=0;s=0,c=d.replace("PERP",""),l=this.safeDict(this.options,"conflictingMarkets",{}),u=c.toLowerCase();if(u in l){const e=l[u];i=e.base,s=e.quote,h&&(r=e.quote)}else{const e=this.handleOption("fetchMarketsFromAPI","quoteCurrencies",[]);for(let t=0;t{i.d(t,{A:()=>r});var s=i(7648);class r extends s.A{describe(){return this.deepExtend(super.describe(),{id:"hamtapay",name:"Hamtapay",countries:["IR"],rateLimit:1e3,version:"1",certified:!1,pro:!1,has:{CORS:void 0,spot:!0,margin:!1,swap:!1,future:!1,option:!1,addMargin:!1,cancelAllOrders:!1,cancelOrder:!1,cancelOrders:!1,createDepositAddress:!1,createOrder:!1,createStopLimitOrder:!1,createStopMarketOrder:!1,createStopOrder:!1,editOrder:!1,fetchBalance:!1,fetchBorrowInterest:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchClosedOrders:!1,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!1,fetchDepositAddress:!1,fetchDeposits:!1,fetchFundingHistory:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchL2OrderBook:!1,fetchL3OrderBook:!1,fetchLedger:!1,fetchLedgerEntry:!1,fetchLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMyTrades:!1,fetchOHLCV:!1,fetchOpenInterestHistory:!1,fetchOpenOrders:!1,fetchOrder:!1,fetchOrderBook:!1,fetchOrders:!1,fetchOrderTrades:"emulated",fetchPositions:!1,fetchPremiumIndexOHLCV:!1,fetchTicker:!0,fetchTickers:!0,fetchTime:!1,fetchTrades:!1,fetchTradingFee:!1,fetchTradingFees:!1,fetchWithdrawals:!1,setLeverage:!1,setMarginMode:!1,transfer:!1,withdraw:!1},comment:"This comment is optional",urls:{logo:"https://cdn.arz.digital/cr-odin/img/exchanges/hamtapay/64x64.png",api:{public:"https://api.hamtapay.org"},www:"https://hamtapay.net/",doc:["https://hamtapay.net/"]},api:{public:{get:{"/financial/api/market":1,"/financial/api/vitrin/prices":1}}},fees:{trading:{tierBased:!1,percentage:!0,maker:this.parseNumber("0.001"),taker:this.parseNumber("0.001")}}})}async fetchMarkets(e={}){const t=await this.publicGetFinancialApiMarket(e),i=[],s=this.safeList(t,"data",[]);for(let e=0;e{i.d(t,{A:()=>d});var s=i(9722),r=i(2079),a=i(5147),o=i(1579),n=i(4852);class d extends s.A{describe(){return this.deepExtend(super.describe(),{id:"hashkey",name:"HashKey Global",countries:["BM"],rateLimit:100,version:"v1",certified:!0,pro:!0,has:{CORS:void 0,spot:!0,margin:!1,swap:!1,future:!1,option:!1,addMargin:!1,borrowCrossMargin:!1,borrowIsolatedMargin:!1,borrowMargin:!1,cancelAllOrders:!0,cancelAllOrdersAfter:!1,cancelOrder:!0,cancelOrders:!0,cancelWithdraw:!1,closeAllPositions:!1,closePosition:!1,createConvertTrade:!1,createDepositAddress:!1,createMarketBuyOrderWithCost:!0,createMarketOrder:!0,createMarketOrderWithCost:!1,createMarketSellOrderWithCost:!1,createOrder:!0,createOrderWithTakeProfitAndStopLoss:!1,createReduceOnlyOrder:!0,createStopLimitOrder:!0,createStopLossOrder:!1,createStopMarketOrder:!0,createStopOrder:!0,createTakeProfitOrder:!1,createTrailingAmountOrder:!1,createTrailingPercentOrder:!1,createTriggerOrder:!0,fetchAccounts:!0,fetchAllGreeks:!1,fetchBalance:!0,fetchBorrowInterest:!1,fetchBorrowRate:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchBorrowRates:!1,fetchBorrowRatesPerSymbol:!1,fetchCanceledAndClosedOrders:!0,fetchCanceledOrders:!0,fetchClosedOrder:!0,fetchClosedOrders:!1,fetchConvertCurrencies:!1,fetchConvertQuote:!1,fetchConvertTrade:!1,fetchConvertTradeHistory:!1,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!0,fetchDepositAddress:!0,fetchDepositAddresses:!1,fetchDepositAddressesByNetwork:!1,fetchDeposits:!0,fetchDepositsWithdrawals:!1,fetchFundingHistory:!1,fetchFundingInterval:!1,fetchFundingIntervals:!1,fetchFundingRate:!0,fetchFundingRateHistory:!0,fetchFundingRates:!0,fetchGreeks:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchIsolatedPositions:!1,fetchLedger:!0,fetchLeverage:!0,fetchLeverages:!1,fetchLeverageTiers:!0,fetchLiquidations:!1,fetchLongShortRatio:!1,fetchLongShortRatioHistory:!1,fetchMarginAdjustmentHistory:!1,fetchMarginMode:!1,fetchMarginModes:!1,fetchMarketLeverageTiers:"emulated",fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMarkPrice:!1,fetchMarkPrices:!1,fetchMyLiquidations:!1,fetchMySettlementHistory:!1,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenInterest:!1,fetchOpenInterestHistory:!1,fetchOpenInterests:!1,fetchOpenOrder:!1,fetchOpenOrders:!0,fetchOption:!1,fetchOptionChain:!1,fetchOrder:!0,fetchOrderBook:!0,fetchOrders:!1,fetchOrderTrades:!1,fetchPosition:!1,fetchPositionHistory:!1,fetchPositionMode:!1,fetchPositions:!0,fetchPositionsForSymbol:!0,fetchPositionsHistory:!1,fetchPositionsRisk:!1,fetchPremiumIndexOHLCV:!1,fetchSettlementHistory:!1,fetchStatus:!0,fetchTicker:!0,fetchTickers:!0,fetchTime:!0,fetchTrades:!0,fetchTradingFee:!0,fetchTradingFees:!0,fetchTransactions:!1,fetchTransfers:!1,fetchUnderlyingAssets:!1,fetchVolatilityHistory:!1,fetchWithdrawals:!0,reduceMargin:!1,repayCrossMargin:!1,repayIsolatedMargin:!1,sandbox:!1,setLeverage:!0,setMargin:!1,setMarginMode:!1,setPositionMode:!1,transfer:!0,withdraw:!0},timeframes:{"1m":"1m","3m":"3m","5m":"5m","15m":"15m","30m":"30m","1h":"1h","2h":"2h","4h":"4h","6h":"6h","8h":"8h","12h":"12h","1d":"1d","1w":"1w","1M":"1M"},urls:{logo:"https://github.com/user-attachments/assets/6dd6127b-cc19-4a13-9b29-a98d81f80e98",api:{public:"https://api-glb.hashkey.com",private:"https://api-glb.hashkey.com"},test:{public:"https://api-glb.sim.hashkeydev.com",private:"https://api-glb.sim.hashkeydev.com"},www:"https://global.hashkey.com/",doc:"https://hashkeyglobal-apidoc.readme.io/",fees:"https://support.global.hashkey.com/hc/en-us/articles/13199900083612-HashKey-Global-Fee-Structure",referral:"https://global.hashkey.com/en-US/register/invite?invite_code=82FQUN"},api:{public:{get:{"api/v1/exchangeInfo":5,"quote/v1/depth":1,"quote/v1/trades":1,"quote/v1/klines":1,"quote/v1/ticker/24hr":1,"quote/v1/ticker/price":1,"quote/v1/ticker/bookTicker":1,"quote/v1/depth/merged":1,"quote/v1/markPrice":1,"quote/v1/index":1,"api/v1/futures/fundingRate":1,"api/v1/futures/historyFundingRate":1,"api/v1/ping":1,"api/v1/time":1}},private:{get:{"api/v1/spot/order":1,"api/v1/spot/openOrders":1,"api/v1/spot/tradeOrders":5,"api/v1/futures/leverage":1,"api/v1/futures/order":1,"api/v1/futures/openOrders":1,"api/v1/futures/userTrades":1,"api/v1/futures/positions":1,"api/v1/futures/historyOrders":1,"api/v1/futures/balance":1,"api/v1/futures/liquidationAssignStatus":1,"api/v1/futures/riskLimit":1,"api/v1/futures/commissionRate":1,"api/v1/futures/getBestOrder":1,"api/v1/account/vipInfo":1,"api/v1/account":1,"api/v1/account/trades":5,"api/v1/account/type":5,"api/v1/account/checkApiKey":1,"api/v1/account/balanceFlow":5,"api/v1/spot/subAccount/openOrders":1,"api/v1/spot/subAccount/tradeOrders":1,"api/v1/subAccount/trades":1,"api/v1/futures/subAccount/openOrders":1,"api/v1/futures/subAccount/historyOrders":1,"api/v1/futures/subAccount/userTrades":1,"api/v1/account/deposit/address":1,"api/v1/account/depositOrders":1,"api/v1/account/withdrawOrders":1},post:{"api/v1/userDataStream":1,"api/v1/spot/orderTest":1,"api/v1/spot/order":1,"api/v1.1/spot/order":1,"api/v1/spot/batchOrders":5,"api/v1/futures/leverage":1,"api/v1/futures/order":1,"api/v1/futures/position/trading-stop":3,"api/v1/futures/batchOrders":5,"api/v1/account/assetTransfer":1,"api/v1/account/authAddress":1,"api/v1/account/withdraw":1},put:{"api/v1/userDataStream":1},delete:{"api/v1/spot/order":1,"api/v1/spot/openOrders":5,"api/v1/spot/cancelOrderByIds":5,"api/v1/futures/order":1,"api/v1/futures/batchOrders":1,"api/v1/futures/cancelOrderByIds":1,"api/v1/userDataStream":1}}},fees:{trading:{spot:{tierBased:!0,percentage:!0,feeSide:"get",maker:this.parseNumber("0.0012"),taker:this.parseNumber("0.0012"),tiers:{maker:[[this.parseNumber("0"),this.parseNumber("0.0012")],[this.parseNumber("1000000"),this.parseNumber("0.00080")],[this.parseNumber("5000000"),this.parseNumber("0.00070")],[this.parseNumber("10000000"),this.parseNumber("0.00060")],[this.parseNumber("50000000"),this.parseNumber("0.00040")],[this.parseNumber("200000000"),this.parseNumber("0.00030")],[this.parseNumber("400000000"),this.parseNumber("0.00010")],[this.parseNumber("800000000"),this.parseNumber("0.00")]],taker:[[this.parseNumber("0"),this.parseNumber("0.0012")],[this.parseNumber("1000000"),this.parseNumber("0.00090")],[this.parseNumber("5000000"),this.parseNumber("0.00085")],[this.parseNumber("10000000"),this.parseNumber("0.00075")],[this.parseNumber("50000000"),this.parseNumber("0.00065")],[this.parseNumber("200000000"),this.parseNumber("0.00045")],[this.parseNumber("400000000"),this.parseNumber("0.00040")],[this.parseNumber("800000000"),this.parseNumber("0.00035")]]}},swap:{tierBased:!0,percentage:!0,feeSide:"get",maker:this.parseNumber("0.00025"),taker:this.parseNumber("0.00060"),tiers:{maker:[[this.parseNumber("0"),this.parseNumber("0.00025")],[this.parseNumber("1000000"),this.parseNumber("0.00016")],[this.parseNumber("5000000"),this.parseNumber("0.00014")],[this.parseNumber("10000000"),this.parseNumber("0.00012")],[this.parseNumber("50000000"),this.parseNumber("0.000080")],[this.parseNumber("200000000"),this.parseNumber("0.000060")],[this.parseNumber("400000000"),this.parseNumber("0.000020")],[this.parseNumber("800000000"),this.parseNumber("0.00")]],taker:[[this.parseNumber("0"),this.parseNumber("0.00060")],[this.parseNumber("1000000"),this.parseNumber("0.00050")],[this.parseNumber("5000000"),this.parseNumber("0.00045")],[this.parseNumber("10000000"),this.parseNumber("0.00040")],[this.parseNumber("50000000"),this.parseNumber("0.00035")],[this.parseNumber("200000000"),this.parseNumber("0.00030")],[this.parseNumber("400000000"),this.parseNumber("0.00025")],[this.parseNumber("800000000"),this.parseNumber("0.00020")]]}}}},options:{broker:"10000700011",recvWindow:void 0,sandboxMode:!1,networks:{BTC:"BTC",ERC20:"ETH",AVAX:"AvalancheC",SOL:"Solana",MATIC:"Polygon",ATOM:"Cosmos",DOT:"Polkadot",LTC:"LTC",OPTIMISM:"Optimism",ARB:"Arbitrum",DOGE:"Dogecoin",TRC20:"Tron",ZKSYNC:"zkSync",TON:"TON",KLAYTN:"Klaytn",MERLINCHAIN:"Merlin Chain"},networksById:{BTC:"BTC",Bitcoin:"BTC",ETH:"ERC20",ERC20:"ERC20",AvalancheC:"AVAX","AVAX C-Chain":"AVAX",Solana:"SOL",Cosmos:"ATOM",Arbitrum:"ARB",Polygon:"MATIC",Optimism:"OPTIMISM",Polkadot:"DOT",LTC:"LTC",Litecoin:"LTC",Dogecoin:"DOGE","Merlin Chain":"MERLINCHAIN",zkSync:"ZKSYNC",TRC20:"TRC20",Tron:"TRC20",TON:"TON","BSC(BEP20)":"BSC",Klaytn:"KLAYTN"},defaultNetwork:"ERC20"},features:{default:{sandbox:!0,createOrder:{marginMode:!1,triggerPrice:!1,triggerPriceType:void 0,triggerDirection:!1,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!0,FOK:!0,PO:!0,GTD:!1},hedged:!1,trailing:!1,leverage:!1,marketBuyByCost:!0,marketBuyRequiresPrice:!0,selfTradePrevention:!0,iceberg:!1},createOrders:{max:20},fetchMyTrades:{marginMode:!1,limit:1e3,daysBack:30,untilDays:30,symbolRequired:!1},fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!1},fetchOpenOrders:{marginMode:!1,limit:1e3,trigger:!1,trailing:!1,symbolRequired:!1},fetchOrders:void 0,fetchClosedOrders:void 0,fetchOHLCV:{limit:1e3}},spot:{extends:"default"},forDerivatives:{extends:"default",createOrder:{triggerPrice:!0,selfTradePrevention:!0},fetchOpenOrders:{trigger:!0,limit:500}},swap:{linear:{extends:"forDerivatives"},inverse:void 0},future:{linear:void 0,inverse:void 0}},commonCurrencies:{},exceptions:{exact:{"0001":r.BadRequest,"0002":r.AuthenticationError,"0003":r.RateLimitExceeded,"0102":r.AuthenticationError,"0103":r.AuthenticationError,"0104":r.PermissionDenied,"0201":r.ExchangeError,"0202":r.PermissionDenied,"0206":r.BadRequest,"0207":r.BadRequest,"0209":r.BadRequest,"0210":r.BadRequest,"0211":r.OrderNotFound,"0401":r.InsufficientFunds,"0402":r.BadRequest,"-1000":r.ExchangeError,"-1001":r.ExchangeError,"-100010":r.BadSymbol,"-100012":r.BadSymbol,"-1002":r.AuthenticationError,"-1004":r.BadRequest,"-1005":r.PermissionDenied,"-1006":r.ExchangeError,"-1007":r.RequestTimeout,"-1014":r.InvalidOrder,"-1015":r.InvalidOrder,"-1020":r.OperationRejected,"-1021":r.InvalidNonce,"-1024":r.BadRequest,"-1101":r.ExchangeNotAvailable,"-1115":r.InvalidOrder,"-1117":r.InvalidOrder,"-1123":r.InvalidOrder,"-1124":r.InvalidOrder,"-1126":r.InvalidOrder,"-1129":r.BadRequest,"-1130":r.BadRequest,"-1132":r.BadRequest,"-1133":r.BadRequest,"-1135":r.BadRequest,"-1136":r.BadRequest,"-1138":r.InvalidOrder,"-1137":r.InvalidOrder,"-1139":r.OrderImmediatelyFillable,"-1140":r.InvalidOrder,"-1141":r.DuplicateOrderId,"-1142":r.OrderNotFillable,"-1143":r.OrderNotFound,"-1144":r.OperationRejected,"-1145":r.NotSupported,"-1146":r.RequestTimeout,"-1147":r.RequestTimeout,"-1148":r.InvalidOrder,"-1149":r.OperationRejected,"-1150":r.OperationFailed,"-1151":r.OperationRejected,"-1152":r.AccountNotEnabled,"-1153":r.InvalidOrder,"-1154":r.InvalidOrder,"-1155":r.OperationRejected,"-1156":r.OperationFailed,"-1157":r.OperationFailed,"-1158":r.OperationFailed,"-1159":r.AccountNotEnabled,"-1160":r.AccountNotEnabled,"-1161":r.OperationFailed,"-1162":r.ContractUnavailable,"-1163":r.InvalidAddress,"-1164":r.OperationFailed,"-1165":r.ArgumentsRequired,"-1166":r.OperationRejected,"-1167":r.BadRequest,"-1168":r.BadRequest,"-1169":r.PermissionDenied,"-1170":r.PermissionDenied,"-1171":r.PermissionDenied,"-1172":r.BadRequest,"-1173":r.BadRequest,"-1174":r.PermissionDenied,"-1175":r.BadRequest,"-1176":r.BadRequest,"-1177":r.InvalidOrder,"-1178":r.AccountNotEnabled,"-1179":r.AccountSuspended,"-1181":r.ExchangeError,"-1193":r.OperationRejected,"-1194":r.OperationRejected,"-1195":r.BadRequest,"-1196":r.BadRequest,"-1200":r.BadRequest,"-1201":r.BadRequest,"-1202":r.BadRequest,"-1203":r.BadRequest,"-1204":r.BadRequest,"-1205":r.AccountNotEnabled,"-1206":r.BadRequest,"-1207":r.BadRequest,"-1208":r.BadRequest,"-1209":r.BadRequest,"-2001":r.ExchangeNotAvailable,"-2002":r.OperationFailed,"-2003":r.OperationFailed,"-2004":r.OperationFailed,"-2005":r.RequestTimeout,"-2010":r.OperationRejected,"-2011":r.OperationRejected,"-2016":r.OperationRejected,"-2017":r.OperationRejected,"-2018":r.OperationRejected,"-2019":r.PermissionDenied,"-2020":r.PermissionDenied,"-2021":r.PermissionDenied,"-2022":r.OperationRejected,"-2023":r.AuthenticationError,"-2024":r.AccountNotEnabled,"-2025":r.AccountNotEnabled,"-2026":r.BadRequest,"-2027":r.OperationRejected,"-2028":r.OperationRejected,"-2029":r.OperationRejected,"-2030":r.InsufficientFunds,"-2031":r.NotSupported,"-2032":r.OperationRejected,"-2033":r.OperationFailed,"-2034":r.InsufficientFunds,"-2035":r.OperationRejected,"-2036":r.NotSupported,"-2037":r.ExchangeError,"-2038":r.InsufficientFunds,"-2039":r.NotSupported,"-2040":r.ExchangeNotAvailable,"-2041":r.BadRequest,"-2042":r.OperationRejected,"-2043":r.OperationRejected,"-2044":r.BadRequest,"-2045":r.BadRequest,"-2046":r.BadRequest,"-2048":r.BadRequest,"-2049":r.BadRequest,"-2050":r.BadRequest,"-2051":r.OperationRejected,"-2052":r.OperationRejected,"-2053":r.OperationRejected,"-2054":r.BadRequest,"-2055":r.BadRequest,"-2056":r.BadRequest,"-2057":r.BadRequest,"-3117":r.PermissionDenied,"-3143":r.PermissionDenied,"-3144":r.PermissionDenied,"-3145":r.DDoSProtection,"-4001":r.BadRequest,"-4002":r.BadRequest,"-4003":r.InsufficientFunds,"-4004":r.BadRequest,"-4005":r.BadRequest,"-4006":r.AccountNotEnabled,"-4007":r.NotSupported,"-4008":r.AccountNotEnabled,"-4009":r.PermissionDenied,"-4010":r.PermissionDenied,"-4011":r.ExchangeError,"-4012":r.ExchangeError,"-4013":r.OperationFailed},broad:{}},precisionMode:o.kb})}async fetchTime(e={}){const t=await this.publicGetApiV1Time(e);return this.safeInteger(t,"serverTime")}async fetchStatus(e={}){return{status:"ok",updated:void 0,eta:void 0,url:void 0,info:await this.publicGetApiV1Ping(e)}}async fetchMarkets(e={}){const t=await this.publicGetApiV1ExchangeInfo(this.extend({},e)),i=this.safeList(t,"symbols",[]),s=this.safeList(t,"contracts",[]);let r=this.arrayConcat(i,s);return this.isEmpty(r)&&(r=[t]),this.parseMarkets(r)}parseMarket(e){const t=this.safeString(e,"symbol"),i=this.safeString(e,"quoteAsset"),s=this.safeCurrencyCode(i),r=this.safeString(e,"marginToken"),o=this.safeCurrencyCode(r);let n=this.safeString(e,"baseAsset"),d="spot",h=!0,c=!1,l="";const u=t.split("-");"PERPETUAL"===this.safeString(u,1)&&(d="swap",h=!1,c=!0,n=this.safeString(e,"underlying"),l+=":"+r);const f=this.safeCurrencyCode(n),p=f+"/"+s+l,m="TRADING"===this.safeString(e,"status");let g,v;const y=this.safeBool(e,"inverse");void 0!==y&&(y?(g=!1,v="inverse"):(g=!0,v="linear"));const w=this.safeList(e,"filters",[]),b=this.indexBy(w,"filterType"),k=this.safeDict(b,"PRICE_FILTER",{}),S=this.safeDict(b,"LOT_SIZE",{}),O=this.safeDict(b,"MIN_NOTIONAL",{}),T=this.omitZero(this.safeString(O,"min_notional")),P=this.safeString(e,"contractMultiplier");let M,I,x=this.safeString(S,"stepSize"),A=this.safeString(S,"minQty"),_=this.safeString(S,"maxQty");if(c){x=a.Y.stringDiv(x,P),A=a.Y.stringDiv(A,P),_=a.Y.stringDiv(_,P);const t=this.safeList(e,"riskLimits");if(void 0!==t){const e=this.safeDict(t,0),i=t.length,s=this.safeDict(t,i-1);let r=this.safeString(e,"initialMargin"),o=this.safeString(s,"initialMargin");a.Y.stringGt(r,o)&&([r,o]=[o,r]),M=this.parseToInt(a.Y.stringDiv("1",o)),I=this.parseToInt(a.Y.stringDiv("1",r))}}const C=this.safeDict(this.fees,"trading"),B=h?this.safeDict(C,"spot"):this.safeDict(C,"swap");return this.safeMarketStructure({id:t,symbol:p,base:f,quote:s,baseId:n,quoteId:i,active:m,type:d,subType:v,spot:h,margin:this.safeBool(e,"allowMargin"),swap:c,future:!1,option:!1,contract:c,settle:o,settleId:r,contractSize:this.parseNumber(P),linear:g,inverse:y,taker:this.safeNumber(B,"taker"),maker:this.safeNumber(B,"maker"),percentage:this.safeBool(B,"percentage"),tierBased:this.safeBool(B,"tierBased"),feeSide:this.safeString(B,"feeSide"),expiry:void 0,expiryDatetime:void 0,strike:void 0,optionType:void 0,precision:{amount:this.parseNumber(x),price:this.safeNumber(k,"tickSize")},limits:{amount:{min:this.parseNumber(A),max:this.parseNumber(_)},price:{min:this.safeNumber(k,"minPrice"),max:this.safeNumber(k,"maxPrice")},leverage:{min:M,max:I},cost:{min:this.parseNumber(T),max:void 0}},created:void 0,info:e})}async fetchCurrencies(e={}){const t=await this.publicGetApiV1ExchangeInfo(e),i=this.safeList(t,"coins"),s={};for(let e=0;e=0&&(c="out");const l=this.safeString(e,"total"),u=this.parseNumber(l);return this.safeLedgerEntry({info:e,id:i,timestamp:r,datetime:this.iso8601(r),account:s,direction:c,referenceId:void 0,referenceAccount:void 0,type:a,currency:n,symbol:void 0,amount:h,before:void 0,after:u,status:"ok",fee:void 0},t)}async createOrder(e,t,i,s,a=void 0,o={}){await this.loadMarkets();const n=this.market(e);if(n.spot)return await this.createSpotOrder(e,t,i,s,a,o);if(n.swap)return await this.createSwapOrder(e,t,i,s,a,o);throw new r.NotSupported(this.id+" createOrder() is not supported for "+n.type+" type of markets")}async createMarketBuyOrderWithCost(e,t,i={}){await this.loadMarkets();if(!this.market(e).spot)throw new r.NotSupported(this.id+" createMarketBuyOrderWithCost() is supported for spot markets only");const s={cost:t};return await this.createOrder(e,"market","buy",t,void 0,this.extend(s,i))}async createSpotOrder(e,t,i,s,a=void 0,o={}){if(void 0!==this.safeString2(o,"stopPrice","triggerPrice"))throw new r.NotSupported(this.id+" trigger orders are not supported for spot markets");await this.loadMarkets();const n=this.market(e),d="market"===t&&"buy"===i,h=this.safeString(o,"cost");if(!d&&void 0!==h)throw new r.NotSupported(this.id+" createOrder() supports cost parameter for spot market buy orders only");const c=this.createSpotOrderRequest(e,t,i,s,a,o);let l={};return this.safeBool(o,"test")?(o=this.omit(o,"test"),l=await this.privatePostApiV1SpotOrderTest(c)):l=d&&void 0===h?await this.privatePostApiV11SpotOrder(c):await this.privatePostApiV1SpotOrder(c),this.parseOrder(l,n)}createOrderRequest(e,t,i,s,a=void 0,o={}){const n=this.market(e);if(n.spot)return this.createSpotOrderRequest(e,t,i,s,a,o);if(n.swap)return this.createSwapOrderRequest(e,t,i,s,a,o);throw new r.NotSupported(this.id+" createOrderRequest() is not supported for "+n.type+" type of markets")}createSpotOrderRequest(e,t,i,s,r=void 0,a={}){const o=this.market(e);t=t.toUpperCase();const n={symbol:o.id,side:i.toUpperCase(),type:t};let d;void 0!==s&&(n.quantity=this.amountToPrecision(e,s)),[d,a]=this.handleParamString(a,"cost"),void 0!==d&&(n.quantity=this.costToPrecision(e,d)),void 0!==r&&(n.price=this.priceToPrecision(e,r));const h="MARKET"===t;let c,l=!1;return[l,a]=this.handlePostOnly(h,"LIMIT_MAKER"===t,a),l&&"LIMIT"===t&&(n.type="LIMIT_MAKER"),[c,a]=this.handleParamString(a,"clientOrderId"),void 0!==c&&(a.newClientOrderId=c),this.extend(n,a)}createSwapOrderRequest(e,t,i,s,r=void 0,a={}){const o={symbol:this.market(e).id,type:"LIMIT",quantity:this.amountToPrecision(e,s)},n="market"===t;n&&(o.priceType="MARKET"),void 0!==r&&(o.price=this.priceToPrecision(e,r),o.priceType="INPUT");let d=!1;[d,a]=this.handleParamBool(a,"reduceOnly",d);let h,c="_OPEN";d&&(c="_CLOSE"),o.side=i.toUpperCase()+c,[h,a]=this.handleParamString(a,"timeInForce");let l=!1;[l,a]=this.handlePostOnly(n,"LIMIT_MAKER"===h,a),l&&(h="LIMIT_MAKER"),void 0!==h&&(o.timeInForce=h);void 0===this.safeString(a,"clientOrderId")&&(o.clientOrderId=this.uuid());const u=this.safeString(a,"triggerPrice");return void 0!==u&&(o.stopPrice=this.priceToPrecision(e,u),o.type="STOP",a=this.omit(a,"triggerPrice")),this.extend(o,a)}async createSwapOrder(e,t,i,s,r=void 0,a={}){await this.loadMarkets();const o=this.market(e),n=this.createSwapOrderRequest(e,t,i,s,r,a),d=await this.privatePostApiV1FuturesOrder(this.extend(n,a));return this.parseOrder(d,o)}async createOrders(e,t={}){await this.loadMarkets();const i=[];for(let t=0;t{i.d(t,{A:()=>c});var s=i(5825),r=i(1579),a=i(8283),o=i(4852),n=i(987),d=i(5147),h=i(2079);class c extends s.A{describe(){return this.deepExtend(super.describe(),{id:"hibachi",name:"Hibachi",countries:["US"],rateLimit:100,userAgent:this.userAgents.chrome,certified:!1,pro:!1,dex:!0,has:{CORS:void 0,spot:!1,margin:!1,swap:!0,future:!1,option:!1,addMargin:!1,cancelAllOrders:!0,cancelOrder:!0,cancelOrders:!0,cancelWithdraw:!1,closeAllPositions:!1,closePosition:!1,createConvertTrade:!1,createDepositAddress:!1,createMarketBuyOrderWithCost:!1,createMarketOrder:!1,createMarketOrderWithCost:!1,createMarketSellOrderWithCost:!1,createOrder:!0,createOrders:!0,createOrderWithTakeProfitAndStopLoss:!1,createReduceOnlyOrder:!1,createStopLimitOrder:!1,createStopLossOrder:!1,createStopMarketOrder:!1,createStopOrder:!1,createTakeProfitOrder:!1,createTrailingAmountOrder:!1,createTrailingPercentOrder:!1,createTriggerOrder:!1,editOrder:!0,editOrders:!0,fetchAccounts:!1,fetchBalance:!0,fetchCanceledOrders:!1,fetchClosedOrder:!1,fetchClosedOrders:!1,fetchConvertCurrencies:!1,fetchConvertQuote:!1,fetchCurrencies:!0,fetchDepositAddress:!0,fetchDeposits:!0,fetchDepositsWithdrawals:!1,fetchFundingHistory:!1,fetchFundingInterval:!1,fetchFundingIntervals:!1,fetchFundingRate:!0,fetchFundingRateHistory:!0,fetchFundingRates:!1,fetchIndexOHLCV:!1,fetchLedger:!0,fetchLeverage:!1,fetchMarginAdjustmentHistory:!1,fetchMarginMode:!1,fetchMarkets:!0,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenInterest:!0,fetchOpenInterestHistory:!1,fetchOpenOrder:!1,fetchOpenOrders:!0,fetchOrder:!0,fetchOrderBook:!0,fetchOrders:!1,fetchOrderTrades:!1,fetchPosition:!1,fetchPositionMode:!1,fetchPositions:!0,fetchPremiumIndexOHLCV:!1,fetchStatus:!1,fetchTicker:!0,fetchTickers:!1,fetchTime:!0,fetchTrades:!0,fetchTradingFee:!1,fetchTradingFees:!0,fetchTradingLimits:!1,fetchTransactions:"emulated",fetchTransfers:!1,fetchWithdrawals:!0,reduceMargin:!1,setLeverage:!1,setMargin:!1,setPositionMode:!1,transfer:!1,withdraw:!0},timeframes:{"1m":"1min","5m":"5min","15m":"15min","1h":"1h","4h":"4h","1d":"1d","1w":"1w"},urls:{logo:"https://github.com/user-attachments/assets/7301bbb1-4f27-4167-8a55-75f74b14e973",api:{public:"https://data-api.hibachi.xyz",private:"https://api.hibachi.xyz"},www:"https://www.hibachi.xyz/",referral:{url:"hibachi.xyz/r/ZBL2YFWIHU"}},api:{public:{get:{"market/exchange-info":1,"market/data/trades":1,"market/data/prices":1,"market/data/stats":1,"market/data/klines":1,"market/data/orderbook":1,"market/data/open-interest":1,"market/data/funding-rates":1,"exchange/utc-timestamp":1}},private:{get:{"capital/deposit-info":1,"capital/history":1,"trade/account/trading_history":1,"trade/account/info":1,"trade/order":1,"trade/account/trades":1,"trade/orders":1},put:{"trade/order":1},delete:{"trade/order":1,"trade/orders":1},post:{"trade/order":1,"trade/orders":1,"capital/withdraw":1}}},requiredCredentials:{apiKey:!0,secret:!1,accountId:!0,privateKey:!0},fees:{trading:{tierBased:!1,percentage:!0,maker:this.parseNumber("0.00015"),taker:this.parseNumber("0.00045")}},options:{},features:{default:{sandbox:!1,createOrder:{marginMode:!1,triggerPrice:!0,triggerPriceType:void 0,triggerDirection:void 0,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!0,FOK:!1,PO:!0,GTD:!1},hedged:!1,trailing:!1,leverage:!1,marketBuyByCost:!1,marketBuyRequiresPrice:!1,selfTradePrevention:!1,iceberg:!1},createOrders:void 0,fetchMyTrades:{marginMode:!1,limit:void 0,daysBack:void 0,untilDays:void 0,symbolRequired:!1},fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!1},fetchOpenOrders:{marginMode:!1,limit:void 0,trigger:!1,trailing:!1,symbolRequired:!1},fetchOrders:void 0,fetchClosedOrders:void 0,fetchOHLCV:{limit:void 0}},swap:{linear:{extends:"default"},inverse:void 0},future:{linear:{extends:"default"},inverse:void 0}},commonCurrencies:{},exceptions:{exact:{2:h.BadRequest,3:h.OrderNotFound,4:h.BadRequest},broad:{}},precisionMode:r.kb})}getAccountId(){this.checkRequiredCredentials();return this.parseToInt(this.accountId)}parseMarket(e){const t=this.safeString(e,"symbol"),i=this.safeNumber(e,"id"),s=this.safeString(e,"underlyingSymbol"),r=this.safeString(e,"settlementSymbol"),a=this.safeCurrencyCode(s),o=this.safeCurrencyCode(r),n=this.safeString(e,"settlementSymbol"),d=this.safeCurrencyCode(n),h=a+"/"+o+":"+d,c=this.safeIntegerProduct(e,"marketCreationTimestamp",1e3);return{id:t,numericId:i,symbol:h,base:a,quote:o,settle:d,baseId:s,quoteId:r,settleId:n,type:"swap",spot:!1,margin:!1,swap:!0,future:!1,option:!1,active:"LIVE"===this.safeString(e,"status"),contract:!0,linear:!0,inverse:!1,contractSize:this.parseNumber("1"),expiry:void 0,expiryDatetime:void 0,strike:void 0,optionType:void 0,precision:{amount:this.parseNumber(this.parsePrecision(this.safeString(e,"underlyingDecimals"))),price:this.parseNumber(this.safeList(e,"orderbookGranularities")[0])/1e4},limits:{leverage:{min:void 0,max:void 0},amount:{min:void 0,max:void 0},price:{min:void 0,max:void 0},cost:{min:this.safeNumber(e,"minNotional"),max:void 0}},created:c,info:e}}async fetchMarkets(e={}){const t=await this.publicGetMarketExchangeInfo(e),i=this.safeList(t,"futureContracts");return this.parseMarkets(i)}async fetchCurrencies(e={}){const t={},i={},s="ARBITRUM";i[s]={id:s,network:s,limits:{withdraw:{min:void 0,max:void 0},deposit:{min:void 0,max:void 0}},active:void 0,deposit:void 0,withdraw:void 0,info:{}};const r=this.safeCurrencyCode("USDT");return t[r]=this.safeCurrencyStructure({id:"USDT",name:"USDT",type:"fiat",code:r,precision:this.parseNumber("0.000001"),active:!0,fee:void 0,networks:i,deposit:!0,withdraw:!0,limits:{deposit:{min:void 0,max:void 0},withdraw:{min:void 0,max:void 0}},info:{}}),t}parseBalance(e){const t={info:e},i=this.safeCurrencyCode("USDT"),s=this.account();return s.total=this.safeString(e,"balance"),s.free=this.safeString(e,"maximalWithdraw"),t[i]=s,this.safeBalance(t)}async fetchBalance(e={}){const t={accountId:this.getAccountId()},i=await this.privateGetTradeAccountInfo(this.extend(t,e));return this.parseBalance(i)}parseTicker(e,t=void 0){const i=this.safeDict(e,"prices"),s=this.safeDict(e,"stats"),r=this.safeNumber(i,"bidPrice"),a=this.safeNumber(i,"askPrice"),o=this.safeNumber(i,"tradePrice"),n=this.safeNumber(s,"high24h"),d=this.safeNumber(s,"low24h"),h=this.safeNumber(s,"volume24h");return this.safeTicker({symbol:this.safeSymbol(void 0,t),timestamp:void 0,datetime:void 0,bid:r,ask:a,last:o,high:n,low:d,bidVolume:void 0,askVolume:void 0,vwap:void 0,open:void 0,close:o,previousClose:void 0,change:void 0,percentage:void 0,average:void 0,baseVolume:void 0,quoteVolume:h,info:e},t)}parseTrade(e,t=void 0){const i=this.safeString(e,"symbol"),s=(t=this.safeMarket(i,t)).symbol,r=this.safeString(e,"id"),a=this.safeString(e,"price"),o=this.safeString(e,"quantity"),n=this.safeIntegerProduct(e,"timestamp",1e3),h=d.Y.stringMul(a,o);let c,l,u,f,p;return void 0===r?(c=this.safeStringLower(e,"takerSide"),p="taker"):(c=this.safeStringLower(e,"side"),l={cost:this.safeString(e,"fee"),currency:"USDT"},u=this.safeStringLower(e,"orderType"),f="buy"===c?this.safeString(e,"bidOrderId"):this.safeString(e,"askOrderId")),this.safeTrade({id:r,timestamp:n,datetime:this.iso8601(n),symbol:s,side:c,price:a,amount:o,cost:h,order:f,takerOrMaker:p,type:u,fee:l,info:e},t)}async fetchTrades(e,t=void 0,i=void 0,s={}){await this.loadMarkets();const r=this.market(e),a={symbol:r.id},o=await this.publicGetMarketDataTrades(this.extend(a,s)),n=this.safeList(o,"trades",[]);return this.parseTrades(n,r)}async fetchTicker(e,t={}){await this.loadMarkets();const i=this.market(e),s={symbol:i.id},r=[this.publicGetMarketDataPrices(this.extend(s,t)),this.publicGetMarketDataStats(this.extend(s,t))],a=await Promise.all(r),o={prices:a[0],stats:a[1]};return this.parseTicker(o,i)}parseOrderStatus(e){return this.safeString({PENDING:"open",CHILD_PENDING:"open",SCHEDULED_TWAP:"open",PLACED:"open",PARTIALLY_FILLED:"open",FILLED:"closed",CANCELLED:"canceled",REJECTED:"rejected"},e,e)}parseOrder(e,t=void 0){const i=this.safeString(e,"symbol");t=this.safeMarket(i,t);const s=this.safeString(e,"status"),r=this.safeStringLower(e,"orderType"),a=this.safeString(e,"price"),o=this.safeString(e,"side");let n;"BID"===o?n="buy":"ASK"===o&&(n="sell");const h=this.safeString(e,"totalQuantity"),c=this.safeString(e,"availableQuantity"),l=this.safeString(e,"totalQuantity"),u=this.safeString(e,"availableQuantity");let f;void 0!==l&&void 0!==u&&(f=d.Y.stringSub(l,u));let p="GTC";const m=this.safeValue(e,"orderFlags");let g=!1,v=!1;return"POST_ONLY"===m?(p="PO",g=!0):"IOC"===m?p="IOC":"REDUCE_ONLY"===m&&(v=!0),this.safeOrder({info:e,id:this.safeString(e,"orderId"),clientOrderId:void 0,datetime:void 0,timestamp:void 0,lastTradeTimestamp:void 0,lastUpdateTimestamp:void 0,status:this.parseOrderStatus(s),symbol:t.symbol,type:r,timeInForce:p,side:n,price:a,average:void 0,amount:h,filled:f,remaining:c,cost:void 0,trades:void 0,fee:void 0,reduceOnly:v,postOnly:g,triggerPrice:this.safeNumber(e,"triggerPrice")},t)}async fetchOrder(e,t=void 0,i={}){let s;await this.loadMarkets(),void 0!==t&&(s=this.market(t));const r={orderId:e,accountId:this.getAccountId()},a=await this.privateGetTradeOrder(this.extend(r,i));return this.parseOrder(a,s)}async fetchTradingFees(e={}){await this.loadMarkets();const t={accountId:this.getAccountId()},i=await this.privateGetTradeAccountInfo(this.extend(t,e)),s=this.safeNumber(i,"tradeMakerFeeRate"),r=this.safeNumber(i,"tradeTakerFeeRate"),a={};for(let e=0;e{i.d(t,{A:()=>d});var s=i(706),r=i(1579),a=i(5147),o=i(2079),n=i(4852);class d extends s.A{describe(){return this.deepExtend(super.describe(),{id:"hitbtc",name:"HitBTC",countries:["HK"],rateLimit:3.333,version:"3",has:{CORS:!1,spot:!0,margin:!0,swap:!0,future:!1,option:!1,addMargin:!0,cancelAllOrders:!0,cancelOrder:!0,closePosition:!1,createDepositAddress:!0,createOrder:!0,createPostOnlyOrder:!0,createReduceOnlyOrder:!0,createStopLimitOrder:!0,createStopMarketOrder:!0,createStopOrder:!0,editOrder:!0,fetchAccounts:!1,fetchBalance:!0,fetchBorrowRateHistories:void 0,fetchBorrowRateHistory:void 0,fetchClosedOrders:!0,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!0,fetchDepositAddress:!0,fetchDepositAddresses:!1,fetchDepositAddressesByNetwork:!1,fetchDeposits:!0,fetchDepositsWithdrawals:!0,fetchDepositWithdrawFee:"emulated",fetchDepositWithdrawFees:!0,fetchFundingHistory:void 0,fetchFundingRate:!0,fetchFundingRateHistory:!0,fetchFundingRates:!0,fetchGreeks:!1,fetchIndexOHLCV:!0,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchLeverage:!0,fetchLeverageTiers:void 0,fetchLiquidations:!1,fetchMarginMode:"emulated",fetchMarginModes:!0,fetchMarketLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!0,fetchMyLiquidations:!1,fetchMySettlementHistory:!1,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenInterest:!0,fetchOpenInterestHistory:!1,fetchOpenInterests:!0,fetchOpenOrder:!0,fetchOpenOrders:!0,fetchOption:!1,fetchOptionChain:!1,fetchOrder:!0,fetchOrderBook:!0,fetchOrderBooks:!0,fetchOrders:!1,fetchOrderTrades:!0,fetchPosition:!0,fetchPositions:!0,fetchPremiumIndexOHLCV:!0,fetchSettlementHistory:!1,fetchTicker:!0,fetchTickers:!0,fetchTrades:!0,fetchTradingFee:!0,fetchTradingFees:!0,fetchTransactions:"emulated",fetchVolatilityHistory:!1,fetchWithdrawals:!0,reduceMargin:!0,sandbox:!0,setLeverage:!0,setMargin:!1,setMarginMode:!1,setPositionMode:!1,transfer:!0,withdraw:!0},precisionMode:r.kb,urls:{logo:"https://user-images.githubusercontent.com/1294454/27766555-8eaec20e-5edc-11e7-9c5b-6dc69fc42f5e.jpg",test:{public:"https://api.demo.hitbtc.com/api/3",private:"https://api.demo.hitbtc.com/api/3"},api:{public:"https://api.hitbtc.com/api/3",private:"https://api.hitbtc.com/api/3"},www:"https://hitbtc.com",referral:"https://hitbtc.com/?ref_id=5a5d39a65d466",doc:["https://api.hitbtc.com","https://github.com/hitbtc-com/hitbtc-api/blob/master/APIv2.md"],fees:["https://hitbtc.com/fees-and-limits","https://support.hitbtc.com/hc/en-us/articles/115005148605-Fees-and-limits"]},api:{public:{get:{"public/currency":10,"public/currency/{currency}":10,"public/symbol":10,"public/symbol/{symbol}":10,"public/ticker":10,"public/ticker/{symbol}":10,"public/price/rate":10,"public/price/history":10,"public/price/ticker":10,"public/price/ticker/{symbol}":10,"public/trades":10,"public/trades/{symbol}":10,"public/orderbook":10,"public/orderbook/{symbol}":10,"public/candles":10,"public/candles/{symbol}":10,"public/converted/candles":10,"public/converted/candles/{symbol}":10,"public/futures/info":10,"public/futures/info/{symbol}":10,"public/futures/history/funding":10,"public/futures/history/funding/{symbol}":10,"public/futures/candles/index_price":10,"public/futures/candles/index_price/{symbol}":10,"public/futures/candles/mark_price":10,"public/futures/candles/mark_price/{symbol}":10,"public/futures/candles/premium_index":10,"public/futures/candles/premium_index/{symbol}":10,"public/futures/candles/open_interest":10,"public/futures/candles/open_interest/{symbol}":10}},private:{get:{"spot/balance":15,"spot/balance/{currency}":15,"spot/order":1,"spot/order/{client_order_id}":1,"spot/fee":15,"spot/fee/{symbol}":15,"spot/history/order":15,"spot/history/trade":15,"margin/account":1,"margin/account/isolated/{symbol}":1,"margin/account/cross/{currency}":1,"margin/order":1,"margin/order/{client_order_id}":1,"margin/config":15,"margin/history/order":15,"margin/history/trade":15,"margin/history/positions":15,"margin/history/clearing":15,"futures/balance":15,"futures/balance/{currency}":15,"futures/account":1,"futures/account/isolated/{symbol}":1,"futures/order":1,"futures/order/{client_order_id}":1,"futures/config":15,"futures/fee":15,"futures/fee/{symbol}":15,"futures/history/order":15,"futures/history/trade":15,"futures/history/positions":15,"futures/history/clearing":15,"wallet/balance":30,"wallet/balance/{currency}":30,"wallet/crypto/address":30,"wallet/crypto/address/recent-deposit":30,"wallet/crypto/address/recent-withdraw":30,"wallet/crypto/address/check-mine":30,"wallet/transactions":30,"wallet/transactions/{tx_id}":30,"wallet/crypto/fee/estimate":30,"wallet/airdrops":30,"wallet/amount-locks":30,"sub-account":15,"sub-account/acl":15,"sub-account/balance/{subAccID}":15,"sub-account/crypto/address/{subAccID}/{currency}":15},post:{"spot/order":1,"spot/order/list":1,"margin/order":1,"margin/order/list":1,"futures/order":1,"futures/order/list":1,"wallet/crypto/address":30,"wallet/crypto/withdraw":30,"wallet/convert":30,"wallet/transfer":30,"wallet/internal/withdraw":30,"wallet/crypto/check-offchain-available":30,"wallet/crypto/fees/estimate":30,"wallet/airdrops/{id}/claim":30,"sub-account/freeze":15,"sub-account/activate":15,"sub-account/transfer":15,"sub-account/acl":15},patch:{"spot/order/{client_order_id}":1,"margin/order/{client_order_id}":1,"futures/order/{client_order_id}":1},delete:{"spot/order":1,"spot/order/{client_order_id}":1,"margin/position":1,"margin/position/isolated/{symbol}":1,"margin/order":1,"margin/order/{client_order_id}":1,"futures/position":1,"futures/position/{margin_mode}/{symbol}":1,"futures/order":1,"futures/order/{client_order_id}":1,"wallet/crypto/withdraw/{id}":30},put:{"margin/account/isolated/{symbol}":1,"futures/account/isolated/{symbol}":1,"wallet/crypto/withdraw/{id}":30}}},fees:{trading:{tierBased:!0,percentage:!0,taker:this.parseNumber("0.0009"),maker:this.parseNumber("0.0009"),tiers:{maker:[[this.parseNumber("0"),this.parseNumber("0.0009")],[this.parseNumber("10"),this.parseNumber("0.0007")],[this.parseNumber("100"),this.parseNumber("0.0006")],[this.parseNumber("500"),this.parseNumber("0.0005")],[this.parseNumber("1000"),this.parseNumber("0.0003")],[this.parseNumber("5000"),this.parseNumber("0.0002")],[this.parseNumber("10000"),this.parseNumber("0.0001")],[this.parseNumber("20000"),this.parseNumber("0")],[this.parseNumber("50000"),this.parseNumber("-0.0001")],[this.parseNumber("100000"),this.parseNumber("-0.0001")]],taker:[[this.parseNumber("0"),this.parseNumber("0.0009")],[this.parseNumber("10"),this.parseNumber("0.0008")],[this.parseNumber("100"),this.parseNumber("0.0007")],[this.parseNumber("500"),this.parseNumber("0.0007")],[this.parseNumber("1000"),this.parseNumber("0.0006")],[this.parseNumber("5000"),this.parseNumber("0.0006")],[this.parseNumber("10000"),this.parseNumber("0.0005")],[this.parseNumber("20000"),this.parseNumber("0.0004")],[this.parseNumber("50000"),this.parseNumber("0.0003")],[this.parseNumber("100000"),this.parseNumber("0.0002")]]}}},features:{default:{sandbox:!0,createOrder:{marginMode:!1,triggerPrice:!0,triggerPriceType:void 0,triggerDirection:!1,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!0,FOK:!0,PO:!0,GTD:!0},hedged:!1,selfTradePrevention:!1,trailing:!1,leverage:!1,marketBuyByCost:!1,marketBuyRequiresPrice:!1,iceberg:!0},createOrders:void 0,fetchMyTrades:{marginMode:!0,limit:1e3,daysBack:1e5,untilDays:1e5,symbolRequired:!1,marketType:!0},fetchOrder:{marginMode:!0,trigger:!1,trailing:!1,symbolRequired:!1,marketType:!0},fetchOpenOrders:{marginMode:!0,limit:1e3,trigger:!1,trailing:!1,symbolRequired:!1,marketType:!0},fetchOrders:void 0,fetchClosedOrders:{marginMode:!0,limit:1e3,daysBack:1e5,daysBackCanceled:1,untilDays:1e5,trigger:!1,trailing:!1,symbolRequired:!1,marketType:!0},fetchOHLCV:{limit:1e3}},spot:{extends:"default"},forDerivatives:{extends:"default",createOrder:{marginMode:!0},fetchOrder:{marginMode:!1},fetchMyTrades:{marginMode:!1},fetchOpenOrders:{marginMode:!1},fetchClosedOrders:{marginMode:!1}},swap:{linear:{extends:"forDerivatives"},inverse:{extends:"forDerivatives"}},future:{linear:{extends:"forDerivatives"},inverse:{extends:"forDerivatives"}}},timeframes:{"1m":"M1","3m":"M3","5m":"M5","15m":"M15","30m":"M30","1h":"H1","4h":"H4","1d":"D1","1w":"D7","1M":"1M"},exceptions:{exact:{429:o.RateLimitExceeded,500:o.ExchangeError,503:o.ExchangeNotAvailable,504:o.ExchangeNotAvailable,600:o.PermissionDenied,800:o.ExchangeError,1002:o.AuthenticationError,1003:o.PermissionDenied,1004:o.AuthenticationError,1005:o.AuthenticationError,2001:o.BadSymbol,2002:o.BadRequest,2003:o.BadRequest,2010:o.BadRequest,2011:o.BadRequest,2012:o.BadRequest,2020:o.BadRequest,2022:o.BadRequest,2024:o.InvalidOrder,10001:o.BadRequest,10021:o.AccountSuspended,10022:o.BadRequest,20001:o.InsufficientFunds,20002:o.OrderNotFound,20003:o.ExchangeError,20004:o.ExchangeError,20005:o.ExchangeError,20006:o.ExchangeError,20007:o.ExchangeError,20008:o.InvalidOrder,20009:o.InvalidOrder,20010:o.OnMaintenance,20011:o.ExchangeError,20012:o.ExchangeError,20014:o.ExchangeError,20016:o.ExchangeError,20018:o.ExchangeError,20031:o.ExchangeError,20032:o.ExchangeError,20033:o.ExchangeError,20034:o.ExchangeError,20040:o.ExchangeError,20041:o.ExchangeError,20042:o.ExchangeError,20043:o.ExchangeError,20044:o.PermissionDenied,20045:o.InvalidOrder,20047:o.InvalidOrder,20048:o.InvalidOrder,20049:o.InvalidOrder,20080:o.ExchangeError,21001:o.ExchangeError,21003:o.AccountSuspended,21004:o.AccountSuspended,22004:o.ExchangeError,22008:o.ExchangeError},broad:{}},options:{defaultNetwork:"ERC20",defaultNetworks:{ETH:"ETH",USDT:"TRC20"},networks:{BTC:"btc",OMNI:"BTC",ETH:"eth",ERC20:"ETH",ETC:"ETC",BEP20:"BSC",TRC20:"TRX",NEAR:"NEAR",DGB:"DGB",AE:"AE",AR:"AR",ADA:"ADA",CHZ:"CHZ",ABBC:"ABBC",ALGO:"ALGO",APT:"APT",ATOM:"ATOM",AVAXC:"AVAC",AVAXX:"AVAX",BSV:"BCHSV",BEP2:"BNB",CELO:"CELO",CKB:"CKB",CTXC:"CTXC",DASH:"DASH",DCR:"DCR",DOGE:"doge",EGLD:"EGLD",EOS:"EOS",ETHW:"ETHW",EVER:"EVER",FET:"FET",FIL:"FIL",FLOW:"FLOW",GLMR:"GLMR",GRIN:"GRIN",HBAR:"HBAR",HIVE:"HIVE",HYDRA:"HYDRA",ICP:"ICP",ICX:"ICX",IOST:"IOST",IOTA:"IOTA",IOTX:"IOTX",KAVA:"KAVA",KLAY:"KIM",KOMODO:"KMD",KSM:"KSM",LSK:"LSK",LTC:"ltc",MINA:"MINA",MOVR:"MOVR",NANO:"NANO",NEO:"NEO",ONE:"ONE",ONT:"ONT",OPTIMISM:"OP",PLCU:"PLCU",MATIC:"POLYGON",QTUM:"QTUM",REI:"REI",OASIS:"ROSE",RVN:"RVN",SC:"SC",SCRT:"SCRT",SOL:"SOL",STEEM:"STEEM",THETA:"Theta",TRUE:"TRUE",VET:"VET",VSYS:"VSYS",WAVES:"WAVES",WAX:"WAX",XCH:"XCH",XEC:"XEC",NEM:"XEM",XLM:"XLM",XMR:"xmr",XRD:"XRD",XRP:"XRP",XTZ:"XTZ",XVG:"XVG",XYM:"XYM",ZEC:"ZEC",ZEN:"ZEN",ZIL:"ZIL"},accountsByType:{spot:"spot",funding:"wallet",swap:"derivatives",future:"derivatives"},withdraw:{includeFee:!1}},commonCurrencies:{AUTO:"Cube",BCC:"BCC",BDP:"BidiPass",BET:"DAO.Casino",BIT:"BitRewards",BOX:"BOX Token",CPT:"Cryptaur",GET:"Themis",GMT:"GMT Token",HSR:"HC",IQ:"IQ.Cash",LNC:"LinkerCoin",PLA:"PlayChip",PNT:"Penta",SBTC:"Super Bitcoin",STEPN:"GMT",STX:"STOX",TV:"Tokenville",XMT:"MTL",XPNT:"PNT"}})}nonce(){return this.milliseconds()}async fetchMarkets(e={}){const t=await this.publicGetPublicSymbol(e),i=[],s=Object.keys(t);for(let e=0;ea)throw new o.BadRequest(this.id+" setLeverage() leverage should be between 1 and "+a.toString()+" for "+t);const n={symbol:s.id,leverage:e.toString(),margin_balance:this.amountToPrecision(t,r)};return await this.privatePutFuturesAccountIsolatedSymbol(this.extend(n,i))}async fetchDepositWithdrawFees(e=void 0,t={}){await this.loadMarkets();const i=await this.publicGetPublicCurrency(t);return this.parseDepositWithdrawFees(i,e)}parseDepositWithdrawFee(e,t=void 0){const i=this.safeValue(e,"networks",[]),s=this.depositWithdrawFee(e);for(let e=0;e{i.d(t,{A:()=>r});var s=i(4372);class r extends s.A{describe(){return this.deepExtend(super.describe(),{id:"hitobit",name:"Hitobit",countries:["IR"],rateLimit:1e3,version:"1",certified:!1,pro:!1,has:{CORS:void 0,spot:!0,margin:!1,swap:!1,future:!1,option:!1,addMargin:!1,cancelAllOrders:!1,cancelOrder:!1,cancelOrders:!1,createDepositAddress:!1,createOrder:!1,createStopLimitOrder:!1,createStopMarketOrder:!1,createStopOrder:!1,editOrder:!1,fetchBalance:!1,fetchBorrowInterest:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchClosedOrders:!1,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!1,fetchDepositAddress:!1,fetchDeposits:!1,fetchFundingHistory:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchL2OrderBook:!1,fetchLedger:!1,fetchLedgerEntry:!1,fetchLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMyTrades:!1,fetchOHLCV:!0,fetchOpenInterestHistory:!1,fetchOpenOrders:!1,fetchOrder:!1,fetchOrderBook:!0,fetchOrders:!1,fetchOrderTrades:"emulated",fetchPositions:!1,fetchPremiumIndexOHLCV:!1,fetchTicker:!0,fetchTickers:!0,fetchTime:!1,fetchTrades:!1,fetchTradingFee:!1,fetchTradingFees:!1,fetchWithdrawals:!1,setLeverage:!1,setMarginMode:!1,transfer:!1,withdraw:!1},comment:"This comment is optional",urls:{logo:"https://cdn.arz.digital/cr-odin/img/exchanges/hitobit/64x64.png",api:{public:"https://hitobit.com"},www:"https://hitobit.com/",doc:["https://hitobit.com/"]},timeframes:{"1m":"OneMinute","5m":"FiveMinutes","15m":"FifteenMinutes","30m":"ThirtyMinutes","1h":"OneHour","1d":"OneDay","1w":"OneWeek","1M":"OneMonth"},api:{public:{get:{"hapi/exchange/v1/public/alltickers/24hr":1,"hapi/exchange/v1/public/ticker/24hr":1,"hapi/exchange/v1/public/klines":1,"hapi/exchange/v1/public/depth":1}}},fees:{trading:{tierBased:!1,percentage:!0,maker:this.parseNumber("0.001"),taker:this.parseNumber("0.001")}}})}async fetchMarkets(e={}){const t=await this.publicGetHapiExchangeV1PublicAlltickers24hr(e),i=[];for(let e=0;e{i.d(t,{A:()=>d});var s=i(1180),r=i(2079),a=i(5147),o=i(1579),n=i(4852);class d extends s.A{describe(){return this.deepExtend(super.describe(),{id:"hollaex",name:"HollaEx",countries:["KR"],rateLimit:250,version:"v2",pro:!0,has:{CORS:void 0,spot:!0,margin:void 0,swap:!1,future:!1,option:!1,addMargin:!1,cancelAllOrders:!0,cancelOrder:!0,createLimitBuyOrder:!0,createLimitSellOrder:!0,createMarketBuyOrder:!0,createMarketSellOrder:!0,createOrder:!0,createPostOnlyOrder:!0,createReduceOnlyOrder:!1,createStopLimitOrder:!0,createStopMarketOrder:!0,createStopOrder:!0,fetchBalance:!0,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchClosedOrders:!0,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!0,fetchDepositAddress:"emulated",fetchDepositAddresses:!0,fetchDepositAddressesByNetwork:!1,fetchDeposits:!0,fetchFundingHistory:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchLeverage:!1,fetchMarginMode:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenInterestHistory:!1,fetchOpenOrder:!0,fetchOpenOrders:!0,fetchOrder:!0,fetchOrderBook:!0,fetchOrderBooks:!0,fetchOrders:!0,fetchPosition:!1,fetchPositionMode:!1,fetchPositions:!1,fetchPositionsRisk:!1,fetchPremiumIndexOHLCV:!1,fetchTicker:!0,fetchTickers:!0,fetchTrades:!0,fetchTradingFee:!1,fetchTradingFees:!0,fetchTransactions:!1,fetchTransfer:!1,fetchTransfers:!1,fetchWithdrawal:!0,fetchWithdrawals:!0,reduceMargin:!1,sandbox:!0,setLeverage:!1,setMarginMode:!1,setPositionMode:!1,transfer:!1,withdraw:!0},timeframes:{"1m":"1m","5m":"5m","15m":"15m","1h":"1h","4h":"4h","1d":"1d","1w":"1w"},urls:{logo:"https://user-images.githubusercontent.com/1294454/75841031-ca375180-5ddd-11ea-8417-b975674c23cb.jpg",test:{rest:"https://api.sandbox.hollaex.com"},api:{rest:"https://api.hollaex.com"},www:"https://hollaex.com",doc:"https://apidocs.hollaex.com",referral:"https://pro.hollaex.com/signup?affiliation_code=QSWA6G"},precisionMode:o.kb,requiredCredentials:{apiKey:!0,secret:!0},api:{public:{get:{health:1,constants:1,kit:1,tiers:1,ticker:1,tickers:1,orderbook:1,orderbooks:1,trades:1,chart:1,charts:1,minicharts:1,"oracle/prices":1,"quick-trade":1,"udf/config":1,"udf/history":1,"udf/symbols":1}},private:{get:{user:1,"user/balance":1,"user/deposits":1,"user/withdrawals":1,"user/withdrawal/fee":1,"user/trades":1,orders:1,order:1},post:{"user/withdrawal":1,order:1},delete:{"order/all":1,order:1}}},features:{spot:{sandbox:!0,createOrder:{marginMode:!1,triggerPrice:!0,triggerPriceType:void 0,triggerDirection:!1,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!1,FOK:!1,PO:!0,GTD:!1},hedged:!1,selfTradePrevention:!1,trailing:!1,leverage:!1,marketBuyByCost:!1,marketBuyRequiresPrice:!1,iceberg:!1},createOrders:void 0,fetchMyTrades:{marginMode:!1,limit:100,daysBack:1e5,untilDays:1e5,symbolRequired:!1},fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!1},fetchOpenOrders:{marginMode:!1,limit:100,trigger:!1,trailing:!1,symbolRequired:!1},fetchOrders:{marginMode:!1,limit:100,daysBack:1e5,untilDays:1e5,trigger:!1,trailing:!1,symbolRequired:!1},fetchClosedOrders:{marginMode:!1,limit:100,daysBack:1e5,daysBackCanceled:1,untilDays:1e5,trigger:!1,trailing:!1,symbolRequired:!1},fetchOHLCV:{limit:1e3}},swap:{linear:void 0,inverse:void 0},future:{linear:void 0,inverse:void 0}},fees:{trading:{tierBased:!0,percentage:!0,taker:.001,maker:.001}},exceptions:{broad:{"API request is expired":r.InvalidNonce,"Invalid token":r.AuthenticationError,"Order not found":r.OrderNotFound,"Insufficient balance":r.InsufficientFunds,"Error 1001 - Order rejected. Order could not be submitted as this order was set to a post only order.":r.OrderImmediatelyFillable},exact:{400:r.BadRequest,403:r.AuthenticationError,404:r.BadRequest,405:r.BadRequest,410:r.BadRequest,429:r.BadRequest,500:r.NetworkError,503:r.NetworkError}},options:{"api-expires":this.parseToInt(this.timeout/1e3),networks:{BTC:"btc",ETH:"eth",ERC20:"eth",TRX:"trx",TRC20:"trx",XRP:"xrp",XLM:"xlm",BNB:"bnb",MATIC:"matic"},networksById:{eth:"ERC20",ETH:"ERC20",ERC20:"ERC20",trx:"TRC20",TRX:"TRC20",TRC20:"TRC20"}}})}async fetchMarkets(e={}){const t=await this.publicGetConstants(e),i=this.safeValue(t,"pairs",{}),s=Object.keys(i),r=[];for(let e=0;e=400&&e<=503){const t=this.id+" "+a,i=this.safeString(o,"message");this.throwBroadlyMatchedException(this.exceptions.broad,i,t);const s=e.toString();this.throwExactlyMatchedException(this.exceptions.exact,s,t)}}}},9946:(e,t,i)=>{i.d(t,{A:()=>d});var s=i(8617),r=i(2079),a=i(5147),o=i(1579),n=i(4852);class d extends s.A{describe(){return this.deepExtend(super.describe(),{id:"htx",name:"HTX",countries:["CN"],rateLimit:100,userAgent:this.userAgents.chrome100,certified:!0,version:"v1",hostname:"api.huobi.pro",pro:!0,has:{CORS:void 0,spot:!0,margin:!0,swap:!0,future:!0,option:void 0,addMargin:void 0,borrowCrossMargin:!0,borrowIsolatedMargin:!0,cancelAllOrders:!0,cancelAllOrdersAfter:!0,cancelOrder:!0,cancelOrders:!0,closeAllPositions:!1,closePosition:!0,createDepositAddress:void 0,createMarketBuyOrderWithCost:!0,createMarketOrderWithCost:!1,createMarketSellOrderWithCost:!1,createOrder:!0,createOrders:!0,createReduceOnlyOrder:!1,createStopLimitOrder:!0,createStopLossOrder:!0,createStopMarketOrder:!0,createStopOrder:!0,createTakeProfitOrder:!0,createTrailingPercentOrder:!0,createTriggerOrder:!0,fetchAccounts:!0,fetchBalance:!0,fetchBidsAsks:void 0,fetchBorrowInterest:!0,fetchBorrowRateHistories:void 0,fetchBorrowRateHistory:void 0,fetchCanceledOrders:void 0,fetchClosedOrder:void 0,fetchClosedOrders:!0,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!0,fetchDeposit:void 0,fetchDepositAddress:!0,fetchDepositAddresses:void 0,fetchDepositAddressesByNetwork:!0,fetchDeposits:!0,fetchDepositWithdrawFee:"emulated",fetchDepositWithdrawFees:!0,fetchFundingHistory:!0,fetchFundingRate:!0,fetchFundingRateHistory:!0,fetchFundingRates:!0,fetchIndexOHLCV:!0,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!0,fetchL3OrderBook:void 0,fetchLastPrices:!0,fetchLedger:!0,fetchLedgerEntry:void 0,fetchLeverage:!1,fetchLeverageTiers:!0,fetchLiquidations:!0,fetchMarginAdjustmentHistory:!1,fetchMarketLeverageTiers:"emulated",fetchMarkets:!0,fetchMarkOHLCV:!0,fetchMyLiquidations:!1,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenInterest:!0,fetchOpenInterestHistory:!0,fetchOpenInterests:!0,fetchOpenOrder:void 0,fetchOpenOrders:!0,fetchOrder:!0,fetchOrderBook:!0,fetchOrderBooks:void 0,fetchOrders:!0,fetchOrderTrades:!0,fetchPosition:!0,fetchPositionHistory:"emulated",fetchPositions:!0,fetchPositionsHistory:!1,fetchPositionsRisk:!1,fetchPremiumIndexOHLCV:!0,fetchSettlementHistory:!0,fetchStatus:!0,fetchTicker:!0,fetchTickers:!0,fetchTime:!0,fetchTrades:!0,fetchTradingFee:!0,fetchTradingFees:!1,fetchTradingLimits:!0,fetchTransactionFee:void 0,fetchTransactionFees:void 0,fetchTransactions:void 0,fetchTransfers:void 0,fetchWithdrawAddresses:!0,fetchWithdrawal:void 0,fetchWithdrawals:!0,fetchWithdrawalWhitelist:void 0,reduceMargin:void 0,repayCrossMargin:!0,repayIsolatedMargin:!0,setLeverage:!0,setMarginMode:!1,setPositionMode:!0,signIn:void 0,transfer:!0,withdraw:!0},timeframes:{"1m":"1min","5m":"5min","15m":"15min","30m":"30min","1h":"60min","4h":"4hour","1d":"1day","1w":"1week","1M":"1mon","1y":"1year"},urls:{logo:"https://user-images.githubusercontent.com/1294454/76137448-22748a80-604e-11ea-8069-6e389271911d.jpg",hostnames:{contract:"api.hbdm.com",spot:"api.huobi.pro",status:{spot:"status.huobigroup.com",future:{inverse:"status-dm.huobigroup.com",linear:"status-linear-swap.huobigroup.com"},swap:{inverse:"status-swap.huobigroup.com",linear:"status-linear-swap.huobigroup.com"}}},api:{status:"https://{hostname}",contract:"https://{hostname}",spot:"https://{hostname}",public:"https://{hostname}",private:"https://{hostname}",v2Public:"https://{hostname}",v2Private:"https://{hostname}"},www:"https://www.huobi.com",referral:{url:"https://www.htx.com.vc/invite/en-us/1h?invite_code=6rmm2223",discount:.15},doc:["https://huobiapi.github.io/docs/spot/v1/en/","https://huobiapi.github.io/docs/dm/v1/en/","https://huobiapi.github.io/docs/coin_margined_swap/v1/en/","https://huobiapi.github.io/docs/usdt_swap/v1/en/","https://www.huobi.com/en-us/opend/newApiPages/"],fees:"https://www.huobi.com/about/fee/"},api:{v2Public:{get:{"reference/currencies":1,"market-status":1}},v2Private:{get:{"account/ledger":1,"account/withdraw/quota":1,"account/withdraw/address":1,"account/deposit/address":1,"account/repayment":5,"reference/transact-fee-rate":1,"account/asset-valuation":.2,"point/account":5,"sub-user/user-list":1,"sub-user/user-state":1,"sub-user/account-list":1,"sub-user/deposit-address":1,"sub-user/query-deposit":1,"user/api-key":1,"user/uid":1,"algo-orders/opening":1,"algo-orders/history":1,"algo-orders/specific":1,"c2c/offers":1,"c2c/offer":1,"c2c/transactions":1,"c2c/repayment":1,"c2c/account":1,"etp/reference":1,"etp/transactions":5,"etp/transaction":5,"etp/rebalance":1,"etp/limit":1},post:{"account/transfer":1,"account/repayment":5,"point/transfer":5,"sub-user/management":1,"sub-user/creation":1,"sub-user/tradable-market":1,"sub-user/transferability":1,"sub-user/api-key-generation":1,"sub-user/api-key-modification":1,"sub-user/api-key-deletion":1,"sub-user/deduct-mode":1,"algo-orders":1,"algo-orders/cancel-all-after":1,"algo-orders/cancellation":1,"c2c/offer":1,"c2c/cancellation":1,"c2c/cancel-all":1,"c2c/repayment":1,"c2c/transfer":1,"etp/creation":5,"etp/redemption":5,"etp/{transactId}/cancel":10,"etp/batch-cancel":50}},public:{get:{"common/symbols":1,"common/currencys":1,"common/timestamp":1,"common/exchange":1,"settings/currencys":1}},private:{get:{"account/accounts":.2,"account/accounts/{id}/balance":.2,"account/accounts/{sub-uid}":1,"account/history":4,"cross-margin/loan-info":1,"margin/loan-info":1,"fee/fee-rate/get":1,"order/openOrders":.4,"order/orders":.4,"order/orders/{id}":.4,"order/orders/{id}/matchresults":.4,"order/orders/getClientOrder":.4,"order/history":1,"order/matchresults":1,"query/deposit-withdraw":1,"margin/loan-orders":.2,"margin/accounts/balance":.2,"cross-margin/loan-orders":1,"cross-margin/accounts/balance":1,"points/actions":1,"points/orders":1,"subuser/aggregate-balance":10,"stable-coin/exchange_rate":1,"stable-coin/quote":1},post:{"account/transfer":1,"futures/transfer":1,"order/batch-orders":.4,"order/orders/place":.2,"order/orders/submitCancelClientOrder":.2,"order/orders/batchCancelOpenOrders":.4,"order/orders/{id}/submitcancel":.2,"order/orders/batchcancel":.4,"dw/withdraw/api/create":1,"dw/withdraw-virtual/{id}/cancel":1,"dw/transfer-in/margin":10,"dw/transfer-out/margin":10,"margin/orders":10,"margin/orders/{id}/repay":10,"cross-margin/transfer-in":1,"cross-margin/transfer-out":1,"cross-margin/orders":1,"cross-margin/orders/{id}/repay":1,"stable-coin/exchange":1,"subuser/transfer":10}},status:{public:{spot:{get:{"api/v2/summary.json":1}},future:{inverse:{get:{"api/v2/summary.json":1}},linear:{get:{"api/v2/summary.json":1}}},swap:{inverse:{get:{"api/v2/summary.json":1}},linear:{get:{"api/v2/summary.json":1}}}}},spot:{public:{get:{"v2/market-status":1,"v1/common/symbols":1,"v1/common/currencys":1,"v2/settings/common/currencies":1,"v2/reference/currencies":1,"v1/common/timestamp":1,"v1/common/exchange":1,"v1/settings/common/chains":1,"v1/settings/common/currencys":1,"v1/settings/common/symbols":1,"v2/settings/common/symbols":1,"v1/settings/common/market-symbols":1,"market/history/candles":1,"market/history/kline":1,"market/detail/merged":1,"market/tickers":1,"market/detail":1,"market/depth":1,"market/trade":1,"market/history/trade":1,"market/etp":1,"v2/etp/reference":1,"v2/etp/rebalance":1}},private:{get:{"v1/account/accounts":.2,"v1/account/accounts/{account-id}/balance":.2,"v2/account/valuation":1,"v2/account/asset-valuation":.2,"v1/account/history":4,"v2/account/ledger":1,"v2/point/account":5,"v2/account/deposit/address":1,"v2/account/withdraw/quota":1,"v2/account/withdraw/address":1,"v2/reference/currencies":1,"v1/query/deposit-withdraw":1,"v1/query/withdraw/client-order-id":1,"v2/user/api-key":1,"v2/user/uid":1,"v2/sub-user/user-list":1,"v2/sub-user/user-state":1,"v2/sub-user/account-list":1,"v2/sub-user/deposit-address":1,"v2/sub-user/query-deposit":1,"v1/subuser/aggregate-balance":10,"v1/account/accounts/{sub-uid}":1,"v1/order/openOrders":.4,"v1/order/orders/{order-id}":.4,"v1/order/orders/getClientOrder":.4,"v1/order/orders/{order-id}/matchresult":.4,"v1/order/orders/{order-id}/matchresults":.4,"v1/order/orders":.4,"v1/order/history":1,"v1/order/matchresults":1,"v2/reference/transact-fee-rate":1,"v2/algo-orders/opening":1,"v2/algo-orders/history":1,"v2/algo-orders/specific":1,"v1/margin/loan-info":1,"v1/margin/loan-orders":.2,"v1/margin/accounts/balance":.2,"v1/cross-margin/loan-info":1,"v1/cross-margin/loan-orders":1,"v1/cross-margin/accounts/balance":1,"v2/account/repayment":5,"v1/stable-coin/quote":1,"v1/stable_coin/exchange_rate":1,"v2/etp/transactions":5,"v2/etp/transaction":5,"v2/etp/limit":1},post:{"v1/account/transfer":1,"v1/futures/transfer":1,"v2/point/transfer":5,"v2/account/transfer":1,"v1/dw/withdraw/api/create":1,"v1/dw/withdraw-virtual/{withdraw-id}/cancel":1,"v2/sub-user/deduct-mode":1,"v2/sub-user/creation":1,"v2/sub-user/management":1,"v2/sub-user/tradable-market":1,"v2/sub-user/transferability":1,"v2/sub-user/api-key-generation":1,"v2/sub-user/api-key-modification":1,"v2/sub-user/api-key-deletion":1,"v1/subuser/transfer":10,"v1/trust/user/active/credit":10,"v1/order/orders/place":.2,"v1/order/batch-orders":.4,"v1/order/auto/place":.2,"v1/order/orders/{order-id}/submitcancel":.2,"v1/order/orders/submitCancelClientOrder":.2,"v1/order/orders/batchCancelOpenOrders":.4,"v1/order/orders/batchcancel":.4,"v2/algo-orders/cancel-all-after":1,"v2/algo-orders":1,"v2/algo-orders/cancellation":1,"v2/account/repayment":5,"v1/dw/transfer-in/margin":10,"v1/dw/transfer-out/margin":10,"v1/margin/orders":10,"v1/margin/orders/{order-id}/repay":10,"v1/cross-margin/transfer-in":1,"v1/cross-margin/transfer-out":1,"v1/cross-margin/orders":1,"v1/cross-margin/orders/{order-id}/repay":1,"v1/stable-coin/exchange":1,"v2/etp/creation":5,"v2/etp/redemption":5,"v2/etp/{transactId}/cancel":10,"v2/etp/batch-cancel":50}}},contract:{public:{get:{"api/v1/timestamp":1,"heartbeat/":1,"api/v1/contract_contract_info":1,"api/v1/contract_index":1,"api/v1/contract_query_elements":1,"api/v1/contract_price_limit":1,"api/v1/contract_open_interest":1,"api/v1/contract_delivery_price":1,"market/depth":1,"market/bbo":1,"market/history/kline":1,"index/market/history/mark_price_kline":1,"market/detail/merged":1,"market/detail/batch_merged":1,"v2/market/detail/batch_merged":1,"market/trade":1,"market/history/trade":1,"api/v1/contract_risk_info":1,"api/v1/contract_insurance_fund":1,"api/v1/contract_adjustfactor":1,"api/v1/contract_his_open_interest":1,"api/v1/contract_ladder_margin":1,"api/v1/contract_api_state":1,"api/v1/contract_elite_account_ratio":1,"api/v1/contract_elite_position_ratio":1,"api/v1/contract_liquidation_orders":1,"api/v1/contract_settlement_records":1,"index/market/history/index":1,"index/market/history/basis":1,"api/v1/contract_estimated_settlement_price":1,"api/v3/contract_liquidation_orders":1,"swap-api/v1/swap_contract_info":1,"swap-api/v1/swap_index":1,"swap-api/v1/swap_query_elements":1,"swap-api/v1/swap_price_limit":1,"swap-api/v1/swap_open_interest":1,"swap-ex/market/depth":1,"swap-ex/market/bbo":1,"swap-ex/market/history/kline":1,"index/market/history/swap_mark_price_kline":1,"swap-ex/market/detail/merged":1,"v2/swap-ex/market/detail/batch_merged":1,"index/market/history/swap_premium_index_kline":1,"swap-ex/market/detail/batch_merged":1,"swap-ex/market/trade":1,"swap-ex/market/history/trade":1,"swap-api/v1/swap_risk_info":1,"swap-api/v1/swap_insurance_fund":1,"swap-api/v1/swap_adjustfactor":1,"swap-api/v1/swap_his_open_interest":1,"swap-api/v1/swap_ladder_margin":1,"swap-api/v1/swap_api_state":1,"swap-api/v1/swap_elite_account_ratio":1,"swap-api/v1/swap_elite_position_ratio":1,"swap-api/v1/swap_estimated_settlement_price":1,"swap-api/v1/swap_liquidation_orders":1,"swap-api/v1/swap_settlement_records":1,"swap-api/v1/swap_funding_rate":1,"swap-api/v1/swap_batch_funding_rate":1,"swap-api/v1/swap_historical_funding_rate":1,"swap-api/v3/swap_liquidation_orders":1,"index/market/history/swap_estimated_rate_kline":1,"index/market/history/swap_basis":1,"linear-swap-api/v1/swap_contract_info":1,"linear-swap-api/v1/swap_index":1,"linear-swap-api/v1/swap_query_elements":1,"linear-swap-api/v1/swap_price_limit":1,"linear-swap-api/v1/swap_open_interest":1,"linear-swap-ex/market/depth":1,"linear-swap-ex/market/bbo":1,"linear-swap-ex/market/history/kline":1,"index/market/history/linear_swap_mark_price_kline":1,"linear-swap-ex/market/detail/merged":1,"linear-swap-ex/market/detail/batch_merged":1,"v2/linear-swap-ex/market/detail/batch_merged":1,"linear-swap-ex/market/trade":1,"linear-swap-ex/market/history/trade":1,"linear-swap-api/v1/swap_risk_info":1,"swap-api/v1/linear-swap-api/v1/swap_insurance_fund":1,"linear-swap-api/v1/swap_adjustfactor":1,"linear-swap-api/v1/swap_cross_adjustfactor":1,"linear-swap-api/v1/swap_his_open_interest":1,"linear-swap-api/v1/swap_ladder_margin":1,"linear-swap-api/v1/swap_cross_ladder_margin":1,"linear-swap-api/v1/swap_api_state":1,"linear-swap-api/v1/swap_cross_transfer_state":1,"linear-swap-api/v1/swap_cross_trade_state":1,"linear-swap-api/v1/swap_elite_account_ratio":1,"linear-swap-api/v1/swap_elite_position_ratio":1,"linear-swap-api/v1/swap_liquidation_orders":1,"linear-swap-api/v1/swap_settlement_records":1,"linear-swap-api/v1/swap_funding_rate":1,"linear-swap-api/v1/swap_batch_funding_rate":1,"linear-swap-api/v1/swap_historical_funding_rate":1,"linear-swap-api/v3/swap_liquidation_orders":1,"index/market/history/linear_swap_premium_index_kline":1,"index/market/history/linear_swap_estimated_rate_kline":1,"index/market/history/linear_swap_basis":1,"linear-swap-api/v1/swap_estimated_settlement_price":1}},private:{get:{"api/v1/contract_sub_auth_list":1,"api/v1/contract_api_trading_status":1,"swap-api/v1/swap_sub_auth_list":1,"swap-api/v1/swap_api_trading_status":1,"linear-swap-api/v1/swap_sub_auth_list":1,"linear-swap-api/v1/swap_api_trading_status":1,"linear-swap-api/v1/swap_cross_position_side":1,"linear-swap-api/v1/swap_position_side":1,"linear-swap-api/v3/unified_account_info":1,"linear-swap-api/v3/fix_position_margin_change_record":1,"linear-swap-api/v3/swap_unified_account_type":1,"linear-swap-api/v3/linear_swap_overview_account_info":1},post:{"api/v1/contract_balance_valuation":1,"api/v1/contract_account_info":1,"api/v1/contract_position_info":1,"api/v1/contract_sub_auth":1,"api/v1/contract_sub_account_list":1,"api/v1/contract_sub_account_info_list":1,"api/v1/contract_sub_account_info":1,"api/v1/contract_sub_position_info":1,"api/v1/contract_financial_record":1,"api/v1/contract_financial_record_exact":1,"api/v1/contract_user_settlement_records":1,"api/v1/contract_order_limit":1,"api/v1/contract_fee":1,"api/v1/contract_transfer_limit":1,"api/v1/contract_position_limit":1,"api/v1/contract_account_position_info":1,"api/v1/contract_master_sub_transfer":1,"api/v1/contract_master_sub_transfer_record":1,"api/v1/contract_available_level_rate":1,"api/v3/contract_financial_record":1,"api/v3/contract_financial_record_exact":1,"api/v1/contract-cancel-after":1,"api/v1/contract_order":1,"api/v1/contract_batchorder":1,"api/v1/contract_cancel":1,"api/v1/contract_cancelall":1,"api/v1/contract_switch_lever_rate":1,"api/v1/lightning_close_position":1,"api/v1/contract_order_info":1,"api/v1/contract_order_detail":1,"api/v1/contract_openorders":1,"api/v1/contract_hisorders":1,"api/v1/contract_hisorders_exact":1,"api/v1/contract_matchresults":1,"api/v1/contract_matchresults_exact":1,"api/v3/contract_hisorders":1,"api/v3/contract_hisorders_exact":1,"api/v3/contract_matchresults":1,"api/v3/contract_matchresults_exact":1,"api/v1/contract_trigger_order":1,"api/v1/contract_trigger_cancel":1,"api/v1/contract_trigger_cancelall":1,"api/v1/contract_trigger_openorders":1,"api/v1/contract_trigger_hisorders":1,"api/v1/contract_tpsl_order":1,"api/v1/contract_tpsl_cancel":1,"api/v1/contract_tpsl_cancelall":1,"api/v1/contract_tpsl_openorders":1,"api/v1/contract_tpsl_hisorders":1,"api/v1/contract_relation_tpsl_order":1,"api/v1/contract_track_order":1,"api/v1/contract_track_cancel":1,"api/v1/contract_track_cancelall":1,"api/v1/contract_track_openorders":1,"api/v1/contract_track_hisorders":1,"swap-api/v1/swap_balance_valuation":1,"swap-api/v1/swap_account_info":1,"swap-api/v1/swap_position_info":1,"swap-api/v1/swap_account_position_info":1,"swap-api/v1/swap_sub_auth":1,"swap-api/v1/swap_sub_account_list":1,"swap-api/v1/swap_sub_account_info_list":1,"swap-api/v1/swap_sub_account_info":1,"swap-api/v1/swap_sub_position_info":1,"swap-api/v1/swap_financial_record":1,"swap-api/v1/swap_financial_record_exact":1,"swap-api/v1/swap_user_settlement_records":1,"swap-api/v1/swap_available_level_rate":1,"swap-api/v1/swap_order_limit":1,"swap-api/v1/swap_fee":1,"swap-api/v1/swap_transfer_limit":1,"swap-api/v1/swap_position_limit":1,"swap-api/v1/swap_master_sub_transfer":1,"swap-api/v1/swap_master_sub_transfer_record":1,"swap-api/v3/swap_financial_record":1,"swap-api/v3/swap_financial_record_exact":1,"swap-api/v1/swap-cancel-after":1,"swap-api/v1/swap_order":1,"swap-api/v1/swap_batchorder":1,"swap-api/v1/swap_cancel":1,"swap-api/v1/swap_cancelall":1,"swap-api/v1/swap_lightning_close_position":1,"swap-api/v1/swap_switch_lever_rate":1,"swap-api/v1/swap_order_info":1,"swap-api/v1/swap_order_detail":1,"swap-api/v1/swap_openorders":1,"swap-api/v1/swap_hisorders":1,"swap-api/v1/swap_hisorders_exact":1,"swap-api/v1/swap_matchresults":1,"swap-api/v1/swap_matchresults_exact":1,"swap-api/v3/swap_matchresults":1,"swap-api/v3/swap_matchresults_exact":1,"swap-api/v3/swap_hisorders":1,"swap-api/v3/swap_hisorders_exact":1,"swap-api/v1/swap_trigger_order":1,"swap-api/v1/swap_trigger_cancel":1,"swap-api/v1/swap_trigger_cancelall":1,"swap-api/v1/swap_trigger_openorders":1,"swap-api/v1/swap_trigger_hisorders":1,"swap-api/v1/swap_tpsl_order":1,"swap-api/v1/swap_tpsl_cancel":1,"swap-api/v1/swap_tpsl_cancelall":1,"swap-api/v1/swap_tpsl_openorders":1,"swap-api/v1/swap_tpsl_hisorders":1,"swap-api/v1/swap_relation_tpsl_order":1,"swap-api/v1/swap_track_order":1,"swap-api/v1/swap_track_cancel":1,"swap-api/v1/swap_track_cancelall":1,"swap-api/v1/swap_track_openorders":1,"swap-api/v1/swap_track_hisorders":1,"linear-swap-api/v1/swap_lever_position_limit":1,"linear-swap-api/v1/swap_cross_lever_position_limit":1,"linear-swap-api/v1/swap_balance_valuation":1,"linear-swap-api/v1/swap_account_info":1,"linear-swap-api/v1/swap_cross_account_info":1,"linear-swap-api/v1/swap_position_info":1,"linear-swap-api/v1/swap_cross_position_info":1,"linear-swap-api/v1/swap_account_position_info":1,"linear-swap-api/v1/swap_cross_account_position_info":1,"linear-swap-api/v1/swap_sub_auth":1,"linear-swap-api/v1/swap_sub_account_list":1,"linear-swap-api/v1/swap_cross_sub_account_list":1,"linear-swap-api/v1/swap_sub_account_info_list":1,"linear-swap-api/v1/swap_cross_sub_account_info_list":1,"linear-swap-api/v1/swap_sub_account_info":1,"linear-swap-api/v1/swap_cross_sub_account_info":1,"linear-swap-api/v1/swap_sub_position_info":1,"linear-swap-api/v1/swap_cross_sub_position_info":1,"linear-swap-api/v1/swap_financial_record":1,"linear-swap-api/v1/swap_financial_record_exact":1,"linear-swap-api/v1/swap_user_settlement_records":1,"linear-swap-api/v1/swap_cross_user_settlement_records":1,"linear-swap-api/v1/swap_available_level_rate":1,"linear-swap-api/v1/swap_cross_available_level_rate":1,"linear-swap-api/v1/swap_order_limit":1,"linear-swap-api/v1/swap_fee":1,"linear-swap-api/v1/swap_transfer_limit":1,"linear-swap-api/v1/swap_cross_transfer_limit":1,"linear-swap-api/v1/swap_position_limit":1,"linear-swap-api/v1/swap_cross_position_limit":1,"linear-swap-api/v1/swap_master_sub_transfer":1,"linear-swap-api/v1/swap_master_sub_transfer_record":1,"linear-swap-api/v1/swap_transfer_inner":1,"linear-swap-api/v3/swap_financial_record":1,"linear-swap-api/v3/swap_financial_record_exact":1,"linear-swap-api/v1/swap_order":1,"linear-swap-api/v1/swap_cross_order":1,"linear-swap-api/v1/swap_batchorder":1,"linear-swap-api/v1/swap_cross_batchorder":1,"linear-swap-api/v1/swap_cancel":1,"linear-swap-api/v1/swap_cross_cancel":1,"linear-swap-api/v1/swap_cancelall":1,"linear-swap-api/v1/swap_cross_cancelall":1,"linear-swap-api/v1/swap_switch_lever_rate":1,"linear-swap-api/v1/swap_cross_switch_lever_rate":1,"linear-swap-api/v1/swap_lightning_close_position":1,"linear-swap-api/v1/swap_cross_lightning_close_position":1,"linear-swap-api/v1/swap_order_info":1,"linear-swap-api/v1/swap_cross_order_info":1,"linear-swap-api/v1/swap_order_detail":1,"linear-swap-api/v1/swap_cross_order_detail":1,"linear-swap-api/v1/swap_openorders":1,"linear-swap-api/v1/swap_cross_openorders":1,"linear-swap-api/v1/swap_hisorders":1,"linear-swap-api/v1/swap_cross_hisorders":1,"linear-swap-api/v1/swap_hisorders_exact":1,"linear-swap-api/v1/swap_cross_hisorders_exact":1,"linear-swap-api/v1/swap_matchresults":1,"linear-swap-api/v1/swap_cross_matchresults":1,"linear-swap-api/v1/swap_matchresults_exact":1,"linear-swap-api/v1/swap_cross_matchresults_exact":1,"linear-swap-api/v1/linear-cancel-after":1,"linear-swap-api/v1/swap_switch_position_mode":1,"linear-swap-api/v1/swap_cross_switch_position_mode":1,"linear-swap-api/v3/swap_matchresults":1,"linear-swap-api/v3/swap_cross_matchresults":1,"linear-swap-api/v3/swap_matchresults_exact":1,"linear-swap-api/v3/swap_cross_matchresults_exact":1,"linear-swap-api/v3/swap_hisorders":1,"linear-swap-api/v3/swap_cross_hisorders":1,"linear-swap-api/v3/swap_hisorders_exact":1,"linear-swap-api/v3/swap_cross_hisorders_exact":1,"linear-swap-api/v3/fix_position_margin_change":1,"linear-swap-api/v3/swap_switch_account_type":1,"linear-swap-api/v3/linear_swap_fee_switch":1,"linear-swap-api/v1/swap_trigger_order":1,"linear-swap-api/v1/swap_cross_trigger_order":1,"linear-swap-api/v1/swap_trigger_cancel":1,"linear-swap-api/v1/swap_cross_trigger_cancel":1,"linear-swap-api/v1/swap_trigger_cancelall":1,"linear-swap-api/v1/swap_cross_trigger_cancelall":1,"linear-swap-api/v1/swap_trigger_openorders":1,"linear-swap-api/v1/swap_cross_trigger_openorders":1,"linear-swap-api/v1/swap_trigger_hisorders":1,"linear-swap-api/v1/swap_cross_trigger_hisorders":1,"linear-swap-api/v1/swap_tpsl_order":1,"linear-swap-api/v1/swap_cross_tpsl_order":1,"linear-swap-api/v1/swap_tpsl_cancel":1,"linear-swap-api/v1/swap_cross_tpsl_cancel":1,"linear-swap-api/v1/swap_tpsl_cancelall":1,"linear-swap-api/v1/swap_cross_tpsl_cancelall":1,"linear-swap-api/v1/swap_tpsl_openorders":1,"linear-swap-api/v1/swap_cross_tpsl_openorders":1,"linear-swap-api/v1/swap_tpsl_hisorders":1,"linear-swap-api/v1/swap_cross_tpsl_hisorders":1,"linear-swap-api/v1/swap_relation_tpsl_order":1,"linear-swap-api/v1/swap_cross_relation_tpsl_order":1,"linear-swap-api/v1/swap_track_order":1,"linear-swap-api/v1/swap_cross_track_order":1,"linear-swap-api/v1/swap_track_cancel":1,"linear-swap-api/v1/swap_cross_track_cancel":1,"linear-swap-api/v1/swap_track_cancelall":1,"linear-swap-api/v1/swap_cross_track_cancelall":1,"linear-swap-api/v1/swap_track_openorders":1,"linear-swap-api/v1/swap_cross_track_openorders":1,"linear-swap-api/v1/swap_track_hisorders":1,"linear-swap-api/v1/swap_cross_track_hisorders":1}}}},fees:{trading:{feeSide:"get",tierBased:!1,percentage:!0,maker:this.parseNumber("0.002"),taker:this.parseNumber("0.002")}},exceptions:{broad:{"contract is restricted of closing positions on API. Please contact customer service":r.OnMaintenance,maintain:r.OnMaintenance,"API key has no permission":r.PermissionDenied},exact:{403:r.AuthenticationError,1010:r.AccountNotEnabled,1003:r.AuthenticationError,1013:r.BadSymbol,1017:r.OrderNotFound,1034:r.InvalidOrder,1036:r.InvalidOrder,1039:r.InvalidOrder,1041:r.InvalidOrder,1047:r.InsufficientFunds,1048:r.InsufficientFunds,1061:r.OrderNotFound,1051:r.InvalidOrder,1066:r.BadSymbol,1067:r.InvalidOrder,1094:r.InvalidOrder,1220:r.AccountNotEnabled,1303:r.BadRequest,1461:r.InvalidOrder,4007:r.BadRequest,"bad-request":r.BadRequest,"validation-format-error":r.BadRequest,"validation-constraints-required":r.BadRequest,"base-date-limit-error":r.BadRequest,"api-not-support-temp-addr":r.PermissionDenied,timeout:r.RequestTimeout,"gateway-internal-error":r.ExchangeNotAvailable,"account-frozen-balance-insufficient-error":r.InsufficientFunds,"invalid-amount":r.InvalidOrder,"order-limitorder-amount-min-error":r.InvalidOrder,"order-limitorder-amount-max-error":r.InvalidOrder,"order-marketorder-amount-min-error":r.InvalidOrder,"order-limitorder-price-min-error":r.InvalidOrder,"order-limitorder-price-max-error":r.InvalidOrder,"order-stop-order-hit-trigger":r.InvalidOrder,"order-value-min-error":r.InvalidOrder,"order-invalid-price":r.InvalidOrder,"order-holding-limit-failed":r.InvalidOrder,"order-orderprice-precision-error":r.InvalidOrder,"order-etp-nav-price-max-error":r.InvalidOrder,"order-orderstate-error":r.OrderNotFound,"order-queryorder-invalid":r.OrderNotFound,"order-update-error":r.ExchangeNotAvailable,"api-signature-check-failed":r.AuthenticationError,"api-signature-not-valid":r.AuthenticationError,"base-record-invalid":r.OrderNotFound,"base-symbol-trade-disabled":r.BadSymbol,"base-symbol-error":r.BadSymbol,"system-maintenance":r.OnMaintenance,"base-request-exceed-frequency-limit":r.RateLimitExceeded,"invalid symbol":r.BadSymbol,"symbol trade not open now":r.BadSymbol,"require-symbol":r.BadSymbol,"invalid-address":r.BadRequest,"base-currency-chain-error":r.BadRequest,"dw-insufficient-balance":r.InsufficientFunds,"base-withdraw-fee-error":r.BadRequest,"dw-withdraw-min-limit":r.BadRequest,"request limit":r.RateLimitExceeded}},precisionMode:o.kb,options:{include_OS_certificates:!1,fetchMarkets:{types:{spot:!0,linear:!0,inverse:!0}},timeDifference:0,adjustForTimeDifference:!1,fetchOHLCV:{useHistoricalEndpointForSpot:!0},withdraw:{includeFee:!1},defaultType:"spot",defaultSubType:"linear",defaultNetwork:"ERC20",defaultNetworks:{ETH:"ERC20",BTC:"BTC",USDT:"TRC20"},networks:{TRC20:"TRX",BTC:"BTC",ERC20:"ETH",SOL:"SOLANA",HRC20:"HECO",BEP20:"BSC",XMR:"XMR",LTC:"LTC",XRP:"XRP",XLM:"XLM",CRONOS:"CRO",CRO:"CRO",GLMR:"GLMR",POLYGON:"MATIC",MATIC:"MATIC",BTT:"BTT",CUBE:"CUBE",IOST:"IOST",NEO:"NEO",KLAY:"KLAY",EOS:"EOS",THETA:"THETA",NAS:"NAS",NULS:"NULS",QTUM:"QTUM",FTM:"FTM",CELO:"CELO",DOGE:"DOGE",DOGECHAIN:"DOGECHAIN",NEAR:"NEAR",STEP:"STEP",BITCI:"BITCI",CARDANO:"ADA",ADA:"ADA",ETC:"ETC",LUK:"LUK",MINEPLEX:"MINEPLEX",DASH:"DASH",ZEC:"ZEC",IOTA:"IOTA",NEON3:"NEON3",XEM:"XEM",HC:"HC",LSK:"LSK",DCR:"DCR",BTG:"BTG",STEEM:"STEEM",BTS:"BTS",ICX:"ICX",WAVES:"WAVES",CMT:"CMT",BTM:"BTM",VET:"VET",XZC:"XZC",ACT:"ACT",SMT:"SMT",BCD:"BCD",WAX:"WAX1",WICC:"WICC",ELF:"ELF",ZIL:"ZIL",ELA:"ELA",BCX:"BCX",SBTC:"SBTC",BIFI:"BIFI",CTXC:"CTXC",WAN:"WAN",POLYX:"POLYX",PAI:"PAI",WTC:"WTC",DGB:"DGB",XVG:"XVG",AAC:"AAC",AE:"AE",SEELE:"SEELE",BCV:"BCV",GRS:"GRS",ARDR:"ARDR",NANO:"NANO",ZEN:"ZEN",RBTC:"RBTC",BSV:"BSV",GAS:"GAS",XTZ:"XTZ",LAMB:"LAMB",CVNT1:"CVNT1",DOCK:"DOCK",SC:"SC",KMD:"KMD",ETN:"ETN",TOP:"TOP",IRIS:"IRIS",UGAS:"UGAS",TT:"TT",NEWTON:"NEWTON",VSYS:"VSYS",FSN:"FSN",BHD:"BHD",ONE:"ONE",EM:"EM",CKB:"CKB",EOSS:"EOSS",HIVE:"HIVE",RVN:"RVN",DOT:"DOT",KSM:"KSM",BAND:"BAND",OEP4:"OEP4",NBS:"NBS",FIS:"FIS",AR:"AR",HBAR:"HBAR",FIL:"FIL",MASS:"MASS",KAVA:"KAVA",XYM:"XYM",ENJ:"ENJ",CRUST:"CRUST",ICP:"ICP",CSPR:"CSPR",FLOW:"FLOW",IOTX:"IOTX",LAT:"LAT",APT:"APT",XCH:"XCH",MINA:"MINA",XEC:"ECASH",XPRT:"XPRT",CCA:"ACA",AOTI:"COTI",AKT:"AKT",ARS:"ARS",ASTR:"ASTR",AZERO:"AZERO",BLD:"BLD",BRISE:"BRISE",CORE:"CORE",DESO:"DESO",DFI:"DFI",EGLD:"EGLD",ERG:"ERG",ETHF:"ETHFAIR",ETHW:"ETHW",EVMOS:"EVMOS",FIO:"FIO",FLR:"FLR",FINSCHIA:"FINSCHIA",KMA:"KMA",KYVE:"KYVE",MEV:"MEV",MOVR:"MOVR",NODL:"NODL",OAS:"OAS",OSMO:"OSMO",PAYCOIN:"PAYCOIN",POKT:"POKT",PYG:"PYG",REI:"REI",SCRT:"SCRT",SDN:"SDN",SEI:"SEI",SGB:"SGB",SUI:"SUI",SXP:"SOLAR",SYS:"SYS",TENET:"TENET",TON:"TON",UNQ:"UNQ",UYU:"UYU",WEMIX:"WEMIX",XDC:"XDC",XPLA:"XPLA"},fetchOrdersByStatesMethod:"spot_private_get_v1_order_orders",createMarketBuyOrderRequiresPrice:!0,language:"en-US",broker:{id:"AA03022abc"},accountsByType:{spot:"pro",funding:"pro",future:"futures"},accountsById:{spot:"spot",margin:"margin",otc:"otc",point:"point","super-margin":"super-margin",investment:"investment",borrow:"borrow","grid-trading":"grid-trading","deposit-earning":"deposit-earning","otc-options":"otc-options"},typesByAccount:{pro:"spot",futures:"future"},spot:{stopOrderTypes:{"stop-limit":!0,"buy-stop-limit":!0,"sell-stop-limit":!0,"stop-limit-fok":!0,"buy-stop-limit-fok":!0,"sell-stop-limit-fok":!0},limitOrderTypes:{limit:!0,"buy-limit":!0,"sell-limit":!0,ioc:!0,"buy-ioc":!0,"sell-ioc":!0,"limit-maker":!0,"buy-limit-maker":!0,"sell-limit-maker":!0,"stop-limit":!0,"buy-stop-limit":!0,"sell-stop-limit":!0,"limit-fok":!0,"buy-limit-fok":!0,"sell-limit-fok":!0,"stop-limit-fok":!0,"buy-stop-limit-fok":!0,"sell-stop-limit-fok":!0}}},commonCurrencies:{NGL:"GFNGL",GET:"THEMIS",GTC:"GAMECOM",HIT:"HITCHAIN",PNT:"PENTA",SBTC:"SUPERBITCOIN",SOUL:"SOULSAVER",BIFI:"BITCOINFILE",FUD:"FTX Users Debt"},features:{spot:{sandbox:!0,createOrder:{marginMode:!0,triggerPrice:!0,triggerDirection:!0,triggerPriceType:void 0,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!0,FOK:!0,PO:!0,GTD:!1},hedged:!1,trailing:!1,iceberg:!1,selfTradePrevention:!0,leverage:!0,marketBuyByCost:!0,marketBuyRequiresPrice:!0},createOrders:{max:10},fetchMyTrades:{marginMode:!1,limit:500,daysBack:120,untilDays:2,symbolRequired:!1},fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!1},fetchOpenOrders:{marginMode:!1,trigger:!0,trailing:!1,limit:500,symbolRequired:!1},fetchOrders:{marginMode:!1,trigger:!0,trailing:!1,limit:500,untilDays:2,daysBack:180,symbolRequired:!1},fetchClosedOrders:{marginMode:!1,trigger:!0,trailing:!1,untilDays:2,limit:500,daysBack:180,daysBackCanceled:1/12,symbolRequired:!1},fetchOHLCV:{limit:1e3}},forDerivatives:{extends:"spot",createOrder:{stopLossPrice:!0,takeProfitPrice:!0,trailing:!0,hedged:!0},createOrders:{max:25},fetchOrder:{marginMode:!0},fetchOpenOrders:{marginMode:!0,trigger:!1,trailing:!1,limit:50},fetchOrders:{marginMode:!0,trigger:!1,trailing:!1,limit:50,daysBack:90},fetchClosedOrders:{marginMode:!0,trigger:!1,trailing:!1,untilDays:2,limit:50,daysBack:90,daysBackCanceled:1/12},fetchOHLCV:{limit:2e3}},swap:{linear:{extends:"forDerivatives"},inverse:{extends:"forDerivatives"}},future:{linear:{extends:"forDerivatives"},inverse:{extends:"forDerivatives"}}}})}async fetchStatus(e={}){let t;await this.loadMarkets(),[t,e]=this.handleMarketTypeAndParams("fetchStatus",void 0,e);const i=this.handleOption("fetchStatus","enableForContracts",!1);let s,r,a,o;if("spot"!==t&&i){const i=this.safeString(e,"subType",this.options.defaultSubType);"swap"===t?"linear"===i?s=await this.statusPublicSwapLinearGetApiV2SummaryJson():"inverse"===i&&(s=await this.statusPublicSwapInverseGetApiV2SummaryJson()):"future"===t?"linear"===i?s=await this.statusPublicFutureLinearGetApiV2SummaryJson():"inverse"===i&&(s=await this.statusPublicFutureInverseGetApiV2SummaryJson()):"contract"===t&&(s=await this.contractPublicGetHeartbeat())}else"spot"===t&&(s=await this.statusPublicSpotGetApiV2SummaryJson());if("contract"===t){const e=this.safeString(s,"status");r=void 0===e?void 0:"ok"===e?"ok":"maintenance",a=this.safeString(s,"ts")}else{const e=this.safeValue(s,"status",{});r="none"===this.safeString(e,"indicator")?"ok":"maintenance";const t=this.safeValue(s,"page",{}),i=this.safeString(t,"updated_at");a=this.parse8601(i),o=this.safeString(t,"url")}return{status:r,updated:a,eta:void 0,url:o,info:s}}async fetchTime(e={}){const t=this.safeValue(this.options,"fetchTime",{}),i=this.safeString(this.options,"defaultType","spot");let s,r=this.safeString(t,"type",i);return r=this.safeString(e,"type",r),s="future"===r||"swap"===r?await this.contractPublicGetApiV1Timestamp(e):await this.spotPublicGetV1CommonTimestamp(e),this.safeInteger2(s,"data","ts")}parseTradingFee(e,t=void 0){const i=this.safeString(e,"symbol");return{info:e,symbol:this.safeSymbol(i,t),maker:this.safeNumber(e,"actualMakerRate"),taker:this.safeNumber(e,"actualTakerRate"),percentage:void 0,tierBased:void 0}}async fetchTradingFee(e,t={}){await this.loadMarkets();const i=this.market(e),s={symbols:i.id},r=await this.spotPrivateGetV2ReferenceTransactFeeRate(this.extend(s,t)),a=this.safeValue(r,"data",[]),o=this.safeValue(a,0,{});return this.parseTradingFee(o,i)}async fetchTradingLimits(e=void 0,t={}){await this.loadMarkets(),void 0===e&&(e=this.symbols);const i={};for(let s=0;s=0?c=this.safeString(e,"field-cash-amount"):(l=this.safeString2(e,"volume","amount"),c=this.safeStringN(e,["filled-cash-amount","field-cash-amount","trade_turnover"]));const u=this.safeStringN(e,["filled-amount","field-amount","trade_volume"]),f=this.safeString2(e,"price","order_price");let p,m=this.safeString2(e,"filled-fees","field-fees");if(m=this.safeString(e,"fee",m),void 0!==m){let i;const s=this.safeString(e,"fee_asset");i=void 0!==s?this.safeCurrencyCode(s):"sell"===a?t.quote:t.base,p={cost:m,currency:i}}const g=this.safeString(e,"trade_avg_price"),v=this.safeValue(e,"trades"),y=this.safeInteger(e,"reduce_only");let w;return void 0!==y&&(w=0!==y),this.safeOrder({info:e,id:r,clientOrderId:h,timestamp:d,datetime:this.iso8601(d),lastTradeTimestamp:void 0,symbol:t.symbol,type:o,timeInForce:void 0,postOnly:void 0,side:a,price:f,triggerPrice:this.safeString2(e,"stop-price","trigger_price"),average:g,cost:c,amount:l,filled:u,remaining:void 0,status:s,reduceOnly:w,fee:p,trades:v},t)}async createMarketBuyOrderWithCost(e,t,i={}){await this.loadMarkets();if(!this.market(e).spot)throw new r.NotSupported(this.id+" createMarketBuyOrderWithCost() supports spot orders only");return i.createMarketBuyOrderRequiresPrice=!1,await this.createOrder(e,"market","buy",t,void 0,i)}async createTrailingPercentOrder(e,t,i,s,a=void 0,o=void 0,n=void 0,d={}){if(void 0===o)throw new r.ArgumentsRequired(this.id+" createTrailingPercentOrder() requires a trailingPercent argument");if(void 0===n)throw new r.ArgumentsRequired(this.id+" createTrailingPercentOrder() requires a trailingTriggerPrice argument");return d.trailingPercent=o,d.trailingTriggerPrice=n,await this.createOrder(e,t,i,s,a,d)}async createSpotOrderRequest(e,t,i,s,o=void 0,n={}){await this.loadMarkets(),await this.loadAccounts();const d=this.market(e);let h;[h,n]=this.handleMarginModeAndParams("createOrder",n);const c={"account-id":await this.fetchAccountIdByType(d.type,h,e),symbol:d.id};let l=t.replace("buy-","");l=l.replace("sell-","");const u=this.safeValue(this.options,d.type,{}),f=this.safeStringN(n,["triggerPrice","stopPrice","stop-price"]);if(void 0===f){if(l in this.safeValue(u,"stopOrderTypes",{}))throw new r.ArgumentsRequired(this.id+" createOrder() requires a triggerPrice for a trigger order")}else{const s="sell"===i?"lte":"gte",a=this.safeString(n,"operator",s);if(c["stop-price"]=this.priceToPrecision(e,f),c.operator=a,"limit"===l||"limit-fok"===l)l="stop-"+l;else if("stop-limit"!==l&&"stop-limit-fok"!==l)throw new r.NotSupported(this.id+" createOrder() does not support "+t+" orders")}let p;[p,n]=this.handlePostOnly("market"===l,"limit-maker"===l,n),p&&(l="limit-maker");const m=this.safeString(n,"timeInForce","GTC");"FOK"===m?l+="-fok":"IOC"===m&&(l="ioc"),c.type=i+"-"+l;const g=this.safeString2(n,"clientOrderId","client-order-id");if(void 0===g){const e=this.safeValue(this.options,"broker",{}),t=this.safeString(e,"id");c["client-order-id"]=t+this.uuid()}else c["client-order-id"]=g;if("cross"===h?c.source="super-margin-api":"isolated"===h?c.source="margin-api":"c2c"===h&&(c.source="c2c-margin-api"),"market"===l&&"buy"===i){let t,i=!0;[i,n]=this.handleOptionAndParams(n,"createOrder","createMarketBuyOrderRequiresPrice",!0);const d=this.safeNumber(n,"cost");if(n=this.omit(n,"cost"),void 0!==d)t=this.amountToPrecision(e,d);else if(i){if(void 0===o)throw new r.InvalidOrder(this.id+" createOrder() requires the price argument for market buy orders to calculate the total cost to spend (amount * price), alternatively set the createMarketBuyOrderRequiresPrice option or param to false and pass the cost to spend in the amount argument");{const i=this.numberToString(s),r=this.numberToString(o);t=this.amountToPrecision(e,a.Y.stringMul(i,r))}}else t=this.amountToPrecision(e,s);c.amount=t}else c.amount=this.amountToPrecision(e,s);return l in this.safeValue(u,"limitOrderTypes",{})&&(c.price=this.priceToPrecision(e,o)),n=this.omit(n,["triggerPrice","stopPrice","stop-price","clientOrderId","client-order-id","operator","timeInForce"]),this.extend(c,n)}createContractOrderRequest(e,t,i,s,r=void 0,o={}){const n={contract_code:this.market(e).id,volume:this.amountToPrecision(e,s),direction:i};let d;[d,o]=this.handlePostOnly("market"===t,"post_only"===t,o),d&&(t="post_only");const h=this.safeString(o,"timeInForce","GTC");"FOK"===h?t="fok":"IOC"===h&&(t="ioc");const c=this.safeNumberN(o,["triggerPrice","stopPrice","trigger_price"]),l=this.safeNumber2(o,"stopLossPrice","sl_trigger_price"),u=this.safeNumber2(o,"takeProfitPrice","tp_trigger_price"),f=this.safeString2(o,"trailingPercent","callback_rate"),p=this.safeNumber(o,"trailingTriggerPrice",r),m=void 0!==f,g=void 0!==l,v=void 0!==u;if(void 0!==c){const t=this.safeString2(o,"triggerType","trigger_type","le");n.trigger_type=t,n.trigger_price=this.priceToPrecision(e,c),void 0!==r&&(n.order_price=this.priceToPrecision(e,r))}else if(g||v)g?(n.sl_order_price_type=t,n.sl_trigger_price=this.priceToPrecision(e,l),void 0!==r&&(n.sl_order_price=this.priceToPrecision(e,r))):(n.tp_order_price_type=t,n.tp_trigger_price=this.priceToPrecision(e,u),void 0!==r&&(n.tp_order_price=this.priceToPrecision(e,r)));else if(m){const e=a.Y.stringDiv(f,"100");n.callback_rate=this.parseToNumeric(e),n.active_price=p,n.order_price_type=this.safeString(o,"order_price_type","formula_price")}else{const i=this.safeInteger2(o,"client_order_id","clientOrderId");void 0!==i&&(n.client_order_id=i,o=this.omit(o,["clientOrderId"])),"limit"!==t&&"ioc"!==t&&"fok"!==t&&"post_only"!==t||(n.price=this.priceToPrecision(e,r))}const y=this.safeBool2(o,"reduceOnly","reduce_only",!1);g||v||(y&&(n.reduce_only=1),n.lever_rate=this.safeIntegerN(o,["leverRate","lever_rate","leverage"],1),m||(n.order_price_type=t));this.safeBool(o,"hedged",!1)&&(n.offset=y?"close":"open");const w=this.safeValue(this.options,"broker",{}),b=this.safeString(w,"id");return n.channel_code=b,o=this.omit(o,["reduceOnly","triggerPrice","stopPrice","stopLossPrice","takeProfitPrice","triggerType","leverRate","timeInForce","leverage","trailingPercent","trailingTriggerPrice","hedged"]),this.extend(n,o)}async createOrder(e,t,i,s,a=void 0,o={}){await this.loadMarkets();const n=this.market(e),d=this.safeNumberN(o,["triggerPrice","stopPrice","trigger_price"]),h=this.safeNumber2(o,"stopLossPrice","sl_trigger_price"),c=this.safeNumber2(o,"takeProfitPrice","tp_trigger_price"),l=void 0!==this.safeNumber(o,"trailingPercent"),u=void 0!==d,f=void 0!==h,p=void 0!==c;let m,g,v;if(n.spot){if(l)throw new r.NotSupported(this.id+" createOrder() does not support trailing orders for spot markets");const n=await this.createSpotOrderRequest(e,t,i,s,a,o);m=await this.spotPrivatePostV1OrderOrdersPlace(n)}else{let d=this.createContractOrderRequest(e,t,i,s,a,o);if(n.linear){let e;[e,d]=this.handleMarginModeAndParams("createOrder",d),e=void 0===e?"cross":e,"isolated"===e?m=u?await this.contractPrivatePostLinearSwapApiV1SwapTriggerOrder(d):f||p?await this.contractPrivatePostLinearSwapApiV1SwapTpslOrder(d):l?await this.contractPrivatePostLinearSwapApiV1SwapTrackOrder(d):await this.contractPrivatePostLinearSwapApiV1SwapOrder(d):"cross"===e&&(m=u?await this.contractPrivatePostLinearSwapApiV1SwapCrossTriggerOrder(d):f||p?await this.contractPrivatePostLinearSwapApiV1SwapCrossTpslOrder(d):l?await this.contractPrivatePostLinearSwapApiV1SwapCrossTrackOrder(d):await this.contractPrivatePostLinearSwapApiV1SwapCrossOrder(d))}else if(n.inverse){if(void 0===this.safeString(o,"offset"))throw new r.ArgumentsRequired(this.id+' createOrder () requires an extra parameter params["offset"] to be set to "open" or "close" when placing orders in inverse markets');n.swap?m=u?await this.contractPrivatePostSwapApiV1SwapTriggerOrder(d):f||p?await this.contractPrivatePostSwapApiV1SwapTpslOrder(d):l?await this.contractPrivatePostSwapApiV1SwapTrackOrder(d):await this.contractPrivatePostSwapApiV1SwapOrder(d):n.future&&(m=u?await this.contractPrivatePostApiV1ContractTriggerOrder(d):f||p?await this.contractPrivatePostApiV1ContractTpslOrder(d):l?await this.contractPrivatePostApiV1ContractTrackOrder(d):await this.contractPrivatePostApiV1ContractOrder(d))}}return n.spot?this.safeOrder({info:m,id:this.safeString(m,"data"),timestamp:void 0,datetime:void 0,lastTradeTimestamp:void 0,status:void 0,symbol:void 0,type:t,side:i,price:a,amount:s,filled:void 0,remaining:void 0,cost:void 0,trades:void 0,fee:void 0,clientOrderId:void 0,average:void 0},n):(f?(g=this.safeValue(m,"data",{}),v=this.safeValue(g,"sl_order",{})):p?(g=this.safeValue(m,"data",{}),v=this.safeValue(g,"tp_order",{})):v=this.safeValue(m,"data",{}),this.parseOrder(v,n))}async createOrders(e,t={}){await this.loadMarkets();const i=[];let s,a,o;for(let t=0;t0?this.parseToInt(e/1e3):0};return await this.v2PrivatePostAlgoOrdersCancelAllAfter(this.extend(i,t))}parseDepositAddress(e,t=void 0){const i=this.safeString(e,"address"),s=this.safeString(e,"addressTag"),r=this.safeString(e,"currency");t=this.safeCurrency(r,t);const a=this.safeCurrencyCode(r,t),o=this.safeString(e,"note"),n=this.safeString(e,"chain");return this.checkAddress(i),{currency:a,address:i,tag:s,network:this.networkIdToCode(n),note:o,info:e}}async fetchDepositAddressesByNetwork(e,t={}){await this.loadMarkets();const i=this.currency(e),s={currency:i.id},r=await this.spotPrivateGetV2AccountDepositAddress(this.extend(s,t)),a=this.safeValue(r,"data",[]),o=this.parseDepositAddresses(a,[i.code],!1);return this.indexBy(o,"network")}async fetchDepositAddress(e,t={}){await this.loadMarkets();const i=this.currency(e),[s,r]=this.handleNetworkCodeAndParams(t),a=await this.fetchDepositAddressesByNetwork(e,r);return a[this.selectNetworkCodeFromUnifiedNetworks(i.code,s,a)]}async fetchWithdrawAddresses(e,t=void 0,i=void 0,s={}){await this.loadMarkets();const r=this.currency(e),a={currency:r.id},o=await this.spotPrivateGetV2AccountWithdrawAddress(this.extend(a,s)),n=this.safeValue(o,"data",[]),d=this.parseDepositAddresses(n,[r.code],!1),h=[];for(let e=0;e100)&&(i=100),await this.loadMarkets(),void 0!==e&&(r=this.currency(e));const a={type:"deposit",direct:"next",from:0};void 0!==r&&(a.currency=r.id),void 0!==i&&(a.size=i);const o=await this.spotPrivateGetV1QueryDepositWithdraw(this.extend(a,s));return this.parseTransactions(o.data,r,t,i)}async fetchWithdrawals(e=void 0,t=void 0,i=void 0,s={}){let r;(void 0===i||i>100)&&(i=100),await this.loadMarkets(),void 0!==e&&(r=this.currency(e));const a={type:"withdraw",direct:"next",from:0};void 0!==r&&(a.currency=r.id),void 0!==i&&(a.size=i);const o=await this.spotPrivateGetV1QueryDepositWithdraw(this.extend(a,s));return this.parseTransactions(o.data,r,t,i)}parseTransaction(e,t=void 0){const i=this.safeInteger(e,"created-at"),s=this.safeCurrencyCode(this.safeString(e,"currency"));let r=this.safeString(e,"type");"withdraw"===r&&(r="withdrawal");let o=this.safeString(e,"fee");void 0!==o&&(o=a.Y.stringAbs(o));const n=this.safeString(e,"chain");let d=this.safeString(e,"tx-hash");"ETH"===n&&d.indexOf("0x")<0&&(d="0x"+d);const h="FAST"===this.safeString(e,"sub-type");return{info:e,id:this.safeString2(e,"id","data"),txid:d,timestamp:i,datetime:this.iso8601(i),network:this.networkIdToCode(n),address:this.safeString(e,"address"),addressTo:void 0,addressFrom:void 0,tag:this.safeString(e,"address-tag"),tagTo:void 0,tagFrom:void 0,type:r,amount:this.safeNumber(e,"amount"),currency:s,status:this.parseTransactionStatus(this.safeString(e,"state")),updated:this.safeInteger(e,"updated-at"),comment:void 0,internal:h,fee:{currency:s,cost:this.parseNumber(o),rate:void 0}}}parseTransactionStatus(e){return this.safeString({unknown:"failed",confirming:"pending",confirmed:"ok",safe:"ok",orphan:"failed",submitted:"pending",canceled:"canceled",reexamine:"pending",reject:"failed",pass:"pending","wallet-reject":"failed","confirm-error":"failed",repealed:"failed","wallet-transfer":"pending","pre-transfer":"pending"},e,e)}async withdraw(e,t,i,s=void 0,o={}){[s,o]=this.handleWithdrawTagAndParams(s,o),await this.loadMarkets(),this.checkAddress(i);const n=this.currency(e),d={address:i,currency:n.id.toLowerCase()};let h;void 0!==s&&(d["addr-tag"]=s),[h,o]=this.handleNetworkCodeAndParams(o),void 0!==h&&(d.chain=this.networkCodeToId(h,e)),t=parseFloat(this.currencyToPrecision(e,t,h));const c=this.safeValue(this.options,"withdraw",{});if(this.safeBool(c,"includeFee",!1)){let i=this.safeNumber(o,"fee");if(void 0===i){const e=await this.fetchCurrencies();this.currencies=this.mapToSafeMap(this.deepExtend(this.currencies,e));const t=this.safeValue(n.networks,h,{});if(i=this.safeNumber(t,"fee"),void 0===i)throw new r.ArgumentsRequired(this.id+' withdraw() function can not find withdraw fee for chosen network. You need to re-load markets with "exchange.loadMarkets(true)", or provide the "fee" parameter')}const s=this.currencyToPrecision(e,i,h);o=this.omit(o,"fee");const c=this.numberToString(t),l=a.Y.stringSub(c,s),u=parseFloat(l);d.fee=parseFloat(s),t=parseFloat(this.currencyToPrecision(e,u,h))}d.amount=t;const l=await this.spotPrivatePostV1DwWithdrawApiCreate(this.extend(d,o));return this.parseTransaction(l,n)}parseTransfer(e,t=void 0){return{info:e,id:this.safeString(e,"data"),timestamp:void 0,datetime:void 0,currency:this.safeCurrencyCode(void 0,t),amount:void 0,fromAccount:void 0,toAccount:void 0,status:void 0}}async transfer(e,t,i,s,a={}){await this.loadMarkets();const o=this.currency(e),n={currency:o.id,amount:parseFloat(this.currencyToPrecision(e,t))};let d;[d,a]=this.handleSubTypeAndParams("transfer",void 0,a);let h=this.convertTypeToAccount(i),c=this.convertTypeToAccount(s);const l="cross"===c,u="cross"===h,f=this.inArray(c,this.ids),p=this.inArray(h,this.ids),m="pro"===h,g="pro"===c;if(m&&g)throw new r.BadRequest(this.id+" transfer () cannot make a transfer between "+i+" and "+s);let v;if("futures"===h||"futures"===c){let e=h+"-to-"+c;e=this.safeString(a,"type",e),n.type=e,v=await this.spotPrivatePostV1FuturesTransfer(this.extend(n,a))}else if(m&&l)v=await this.privatePostCrossMarginTransferIn(this.extend(n,a));else if(u&&g)v=await this.privatePostCrossMarginTransferOut(this.extend(n,a));else if(m&&f)n.symbol=c,v=await this.privatePostDwTransferInMargin(this.extend(n,a));else if(p&&g)n.symbol=h,v=await this.privatePostDwTransferOutMargin(this.extend(n,a));else{if("linear"===d){"swap"===h||"linear-swap"===i?h="linear-swap":c="linear-swap";let e=this.safeString(a,"symbol");a=this.omit(a,"symbol"),void 0!==e?(e=this.marketId(e),n["margin-account"]=e):n["margin-account"]="USDT"}n.from=m?"spot":h,n.to=g?"spot":c,v=await this.v2PrivatePostAccountTransfer(this.extend(n,a))}return this.parseTransfer(v,o)}async fetchIsolatedBorrowRates(e={}){await this.loadMarkets();const t=await this.spotPrivateGetV1MarginLoanInfo(e),i=this.safeValue(t,"data",[]);return this.parseIsolatedBorrowRates(i)}parseIsolatedBorrowRate(e,t=void 0){const i=this.safeString(e,"symbol"),s=this.safeSymbol(i,t),r=this.safeValue(e,"currencies",[]),a=this.safeValue(r,0),o=this.safeValue(r,1),n=this.safeString(a,"currency"),d=this.safeString(o,"currency");return{symbol:s,base:this.safeCurrencyCode(n),baseRate:this.safeNumber(a,"actual-rate"),quote:this.safeCurrencyCode(d),quoteRate:this.safeNumber(o,"actual-rate"),period:864e5,timestamp:void 0,datetime:void 0,info:e}}async fetchFundingRateHistory(e=void 0,t=void 0,i=void 0,s={}){if(void 0===e)throw new r.ArgumentsRequired(this.id+" fetchFundingRateHistory() requires a symbol argument");let a=!1;if([a,s]=this.handleOptionAndParams(s,"fetchFundingRateHistory","paginate"),a)return await this.fetchPaginatedCallCursor("fetchFundingRateHistory",e,t,i,s,"current_page","page_index",1,50);await this.loadMarkets();const o=this.market(e),n={contract_code:o.id};let d;if(n.page_size=void 0!==i?i:50,o.inverse)d=await this.contractPublicGetSwapApiV1SwapHistoricalFundingRate(this.extend(n,s));else{if(!o.linear)throw new r.NotSupported(this.id+" fetchFundingRateHistory() supports inverse and linear swaps only");d=await this.contractPublicGetLinearSwapApiV1SwapHistoricalFundingRate(this.extend(n,s))}const h=this.safeValue(d,"data"),c=this.safeValue(h,"current_page"),l=this.safeValue(h,"data",[]),u=[];for(let e=0;e0){const t=this.safeString(e,0);i=this.market(t)}}if([s,t]=this.handleMarginModeAndParams("fetchPositions",t,"cross"),[a,t]=this.handleSubTypeAndParams("fetchPositions",i,t,"linear"),[o,t]=this.handleMarketTypeAndParams("fetchPositions",i,t),"spot"===o&&(o="future"),"linear"===a)if("isolated"===s)n=await this.contractPrivatePostLinearSwapApiV1SwapPositionInfo(t);else{if("cross"!==s)throw new r.NotSupported(this.id+" fetchPositions() not support this market type");n=await this.contractPrivatePostLinearSwapApiV1SwapCrossPositionInfo(t)}else if("future"===o)n=await this.contractPrivatePostApiV1ContractPositionInfo(t);else{if("swap"!==o)throw new r.NotSupported(this.id+" fetchPositions() not support this market type");n=await this.contractPrivatePostSwapApiV1SwapPositionInfo(t)}const d=this.safeValue(n,"data",[]),h=this.safeInteger(n,"ts"),c=[];for(let e=0;e0){const t=this.safeString(e,0);i=this.market(t)}}const s={};let r,a,o;[r,t]=this.handleSubTypeAndParams("fetchPositions",i,t,"linear"),[a,t]=this.handleMarketTypeAndParams("fetchPositions",i,t),"future"===a?o=await this.contractPublicGetApiV1ContractOpenInterest(this.extend(s,t)):"inverse"===r?o=await this.contractPublicGetSwapApiV1SwapOpenInterest(this.extend(s,t)):(s.contract_type="swap",o=await this.contractPublicGetLinearSwapApiV1SwapOpenInterest(this.extend(s,t)));const n=this.safeList(o,"data",[]);return this.parseOpenInterests(n,e)}async fetchOpenInterest(e,t={}){await this.loadMarkets();const i=this.market(e);if(!i.contract)throw new r.BadRequest(this.id+" fetchOpenInterest() supports contract markets only");if(i.option)throw new r.NotSupported(this.id+" fetchOpenInterest() does not currently support option markets");const s={contract_code:i.id};let a;i.future?(s.contract_type=this.safeString(i.info,"contract_type"),s.symbol=i.baseId,a=await this.contractPublicGetApiV1ContractOpenInterest(this.extend(s,t))):i.linear?(s.contract_type="swap",a=await this.contractPublicGetLinearSwapApiV1SwapOpenInterest(this.extend(s,t))):a=await this.contractPublicGetSwapApiV1SwapOpenInterest(this.extend(s,t));const o=this.safeValue(a,"data",[]),n=this.parseOpenInterest(o[0],i),d=this.safeInteger(a,"ts");return n.timestamp=d,n.datetime=this.iso8601(d),n}parseOpenInterest(e,t=void 0){const i=this.safeInteger(e,"ts"),s=this.safeNumber(e,"volume"),r=this.safeNumber(e,"value"),a=this.safeString(e,"contract_code");return this.safeOpenInterest({symbol:this.safeSymbol(a,t),baseVolume:s,quoteVolume:r,openInterestAmount:s,openInterestValue:r,timestamp:i,datetime:this.iso8601(i),info:e},t)}async borrowIsolatedMargin(e,t,i,s={}){await this.loadMarkets();const r=this.currency(t),a=this.market(e),o={currency:r.id,amount:this.currencyToPrecision(t,i),symbol:a.id},n=await this.privatePostMarginOrders(this.extend(o,s)),d=this.parseMarginLoan(n,r);return this.extend(d,{amount:i,symbol:e})}async borrowCrossMargin(e,t,i={}){await this.loadMarkets();const s=this.currency(e),r={currency:s.id,amount:this.currencyToPrecision(e,t)},a=await this.privatePostCrossMarginOrders(this.extend(r,i)),o=this.parseMarginLoan(a,s);return this.extend(o,{amount:t})}async repayIsolatedMargin(e,t,i,s={}){await this.loadMarkets();const r=this.currency(t),a=await this.fetchAccountIdByType("spot","isolated",e,s),o={currency:r.id,amount:this.currencyToPrecision(t,i),accountId:a},n=await this.v2PrivatePostAccountRepayment(this.extend(o,s)),d=this.safeValue(n,"Data",[]),h=this.safeValue(d,0),c=this.parseMarginLoan(h,r);return this.extend(c,{amount:i,symbol:e})}async repayCrossMargin(e,t,i={}){await this.loadMarkets();const s=this.currency(e),r=await this.fetchAccountIdByType("spot","cross",void 0,i),a={currency:s.id,amount:this.currencyToPrecision(e,t),accountId:r},o=await this.v2PrivatePostAccountRepayment(this.extend(a,i)),n=this.safeValue(o,"Data",[]),d=this.safeValue(n,0),h=this.parseMarginLoan(d,s);return this.extend(h,{amount:t})}parseMarginLoan(e,t=void 0){const i=this.safeInteger(e,"repayTime");return{id:this.safeString2(e,"repayId","data"),currency:this.safeCurrencyCode(void 0,t),amount:void 0,symbol:void 0,timestamp:i,datetime:this.iso8601(i),info:e}}async fetchSettlementHistory(e=void 0,t=void 0,i=void 0,s={}){if(void 0===e)throw new r.ArgumentsRequired(this.id+" fetchSettlementHistory() requires a symbol argument");const a=this.safeInteger(s,"until");s=this.omit(s,["until"]);const o=this.market(e),n={};let d;o.future?n.symbol=o.baseId:n.contract_code=o.id,void 0!==t&&(n.start_at=t),void 0!==i&&(n.page_size=i),void 0!==a&&(n.end_at=a),d=o.swap?o.linear?await this.contractPublicGetLinearSwapApiV1SwapSettlementRecords(this.extend(n,s)):await this.contractPublicGetSwapApiV1SwapSettlementRecords(this.extend(n,s)):await this.contractPublicGetApiV1ContractSettlementRecords(this.extend(n,s));const h=this.safeValue(d,"data"),c=this.safeValue(h,"settlement_record"),l=this.parseSettlements(c,o);return this.sortBy(l,"timestamp")}async fetchDepositWithdrawFees(e=void 0,t={}){await this.loadMarkets();const i=await this.spotPublicGetV2ReferenceCurrencies(t),s=this.safeList(i,"data");return this.parseDepositWithdrawFees(s,e,"currency")}parseDepositWithdrawFee(e,t=void 0){const i=this.safeValue(e,"chains",[]);let s=this.depositWithdrawFee(e);for(let e=0;e{i.d(t,{A:()=>r});var s=i(9946);class r extends s.A{describe(){return this.deepExtend(super.describe(),{id:"huobi",alias:!0})}}},1936:(e,t,i)=>{i.d(t,{A:()=>c});var s=i(9023),r=i(2079),a=i(5147),o=i(1579),n=i(8432),d=i(987),h=i(8283);class c extends s.A{describe(){return this.deepExtend(super.describe(),{id:"hyperliquid",name:"Hyperliquid",countries:[],version:"v1",rateLimit:50,certified:!0,pro:!0,dex:!0,has:{CORS:void 0,spot:!0,margin:!1,swap:!0,future:!0,option:!1,addMargin:!0,borrowCrossMargin:!1,borrowIsolatedMargin:!1,cancelAllOrders:!1,cancelAllOrdersAfter:!0,cancelOrder:!0,cancelOrders:!0,cancelOrdersForSymbols:!0,closeAllPositions:!1,closePosition:!1,createMarketBuyOrderWithCost:!1,createMarketOrderWithCost:!1,createMarketSellOrderWithCost:!1,createOrder:!0,createOrders:!0,createOrderWithTakeProfitAndStopLoss:!0,createReduceOnlyOrder:!0,createStopOrder:!0,createTriggerOrder:!0,editOrder:!0,editOrders:!0,fetchAccounts:!1,fetchBalance:!0,fetchBorrowInterest:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchCanceledAndClosedOrders:!0,fetchCanceledOrders:!0,fetchClosedOrders:!0,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!0,fetchDepositAddress:!1,fetchDepositAddresses:!1,fetchDeposits:!0,fetchDepositWithdrawFee:"emulated",fetchDepositWithdrawFees:!1,fetchFundingHistory:!0,fetchFundingRate:!1,fetchFundingRateHistory:!0,fetchFundingRates:!0,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchLedger:!0,fetchLeverage:!1,fetchLeverageTiers:!1,fetchLiquidations:!1,fetchMarginMode:void 0,fetchMarketLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMyLiquidations:!1,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenInterest:!0,fetchOpenInterestHistory:!1,fetchOpenInterests:!0,fetchOpenOrders:!0,fetchOrder:!0,fetchOrderBook:!0,fetchOrders:!0,fetchOrderTrades:!1,fetchPosition:!0,fetchPositionMode:!1,fetchPositions:!0,fetchPositionsRisk:!1,fetchPremiumIndexOHLCV:!1,fetchTicker:"emulated",fetchTickers:!0,fetchTime:!1,fetchTrades:!0,fetchTradingFee:!0,fetchTradingFees:!1,fetchTransfer:!1,fetchTransfers:!1,fetchWithdrawal:!1,fetchWithdrawals:!0,reduceMargin:!0,repayCrossMargin:!1,repayIsolatedMargin:!1,sandbox:!0,setLeverage:!0,setMarginMode:!0,setPositionMode:!1,transfer:!0,withdraw:!0},timeframes:{"1m":"1m","3m":"3m","5m":"5m","15m":"15m","30m":"30m","1h":"1h","2h":"2h","4h":"4h","8h":"8h","12h":"12h","1d":"1d","3d":"3d","1w":"1w","1M":"1M"},hostname:"hyperliquid.xyz",urls:{logo:"https://github.com/ccxt/ccxt/assets/43336371/b371bc6c-4a8c-489f-87f4-20a913dd8d4b",api:{public:"https://api.{hostname}",private:"https://api.{hostname}"},test:{public:"https://api.hyperliquid-testnet.xyz",private:"https://api.hyperliquid-testnet.xyz"},www:"https://hyperliquid.xyz",doc:"https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api",fees:"https://hyperliquid.gitbook.io/hyperliquid-docs/trading/fees",referral:"https://app.hyperliquid.xyz/"},api:{public:{post:{info:{cost:20,byType:{l2Book:2,allMids:2,clearinghouseState:2,orderStatus:2,spotClearinghouseState:2,exchangeStatus:2,candleSnapshot:4}}}},private:{post:{exchange:1}}},fees:{swap:{taker:this.parseNumber("0.00045"),maker:this.parseNumber("0.00015")},spot:{taker:this.parseNumber("0.0007"),maker:this.parseNumber("0.0004")}},requiredCredentials:{apiKey:!1,secret:!1,walletAddress:!0,privateKey:!0},exceptions:{exact:{},broad:{"Price must be divisible by tick size.":r.InvalidOrder,"Order must have minimum value of $10":r.InvalidOrder,"Insufficient margin to place order.":r.InsufficientFunds,"Reduce only order would increase position.":r.InvalidOrder,"Post only order would have immediately matched,":r.InvalidOrder,"Order could not immediately match against any resting orders.":r.InvalidOrder,"Invalid TP/SL price.":r.InvalidOrder,"No liquidity available for market order.":r.InvalidOrder,"Order was never placed, already canceled, or filled.":r.OrderNotFound,"User or API Wallet ":r.InvalidOrder,"Order has invalid size":r.InvalidOrder,"Order price cannot be more than 80% away from the reference price":r.InvalidOrder,"Order has zero size.":r.InvalidOrder,"Insufficient spot balance asset":r.InsufficientFunds,"Insufficient balance for withdrawal":r.InsufficientFunds,"Insufficient balance for token transfer":r.InsufficientFunds}},precisionMode:o.kb,commonCurrencies:{},options:{defaultType:"swap",sandboxMode:!1,defaultSlippage:.05,zeroAddress:"0x0000000000000000000000000000000000000000"},features:{default:{sandbox:!0,createOrder:{marginMode:!1,triggerPrice:!1,triggerPriceType:void 0,triggerDirection:!1,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:{triggerPriceType:{last:!1,mark:!1,index:!1},triggerPrice:!0,type:!0,price:!0},timeInForce:{IOC:!0,FOK:!1,PO:!0,GTD:!1},hedged:!1,trailing:!1,leverage:!1,marketBuyByCost:!1,marketBuyRequiresPrice:!1,selfTradePrevention:!1,iceberg:!1},createOrders:{max:1e3},fetchMyTrades:{marginMode:!1,limit:2e3,daysBack:void 0,untilDays:void 0,symbolRequired:!0},fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!0},fetchOpenOrders:{marginMode:!1,limit:2e3,trigger:!1,trailing:!1,symbolRequired:!0},fetchOrders:{marginMode:!1,limit:2e3,daysBack:void 0,untilDays:void 0,trigger:!1,trailing:!1,symbolRequired:!0},fetchClosedOrders:{marginMode:!1,limit:2e3,daysBack:void 0,daysBackCanceled:void 0,untilDays:void 0,trigger:!1,trailing:!1,symbolRequired:!0},fetchOHLCV:{limit:5e3}},spot:{extends:"default"},forPerps:{extends:"default",createOrder:{stopLossPrice:!0,takeProfitPrice:!0,attachedStopLossTakeProfit:void 0}},swap:{linear:{extends:"forPerps"},inverse:{extends:"forPerps"}},future:{linear:{extends:"forPerps"},inverse:{extends:"forPerps"}}}})}setSandboxMode(e){super.setSandboxMode(e),this.options.sandboxMode=e}async fetchCurrencies(e={}){this.checkRequiredCredentials(!1)&&await this.handleBuilderFeeApproval();const t=await this.publicPostInfo(this.extend({type:"meta"},e)),i=this.safeList(t,"universe",[]),s={};for(let e=0;e=34;o.oid=t?e:this.parseToNumeric(e)}const n=await this.publicPostInfo(this.extend(o,i)),d=this.safeDict(n,"order");return this.parseOrder(d,r)}parseOrder(e,t=void 0){if(void 0!==this.safeString(e,"error"))return this.safeOrder({info:e,status:"rejected"});let i=this.safeDictN(e,["order","resting","filled"]);void 0===i&&(i=e);const s=this.safeString(i,"coin");let r;void 0!==s&&(r=this.coinToMarketId(s));const o=(t=void 0===this.safeString(i,"id")?this.safeMarket(r,void 0):this.safeMarket(r,t)).symbol,n=this.safeInteger(i,"timestamp"),d=this.safeString2(e,"status","ccxtStatus");e=this.omit(e,["ccxtStatus"]);let h=this.safeString(i,"side");void 0!==h&&(h="A"===h?"sell":"buy");const c=this.safeString2(i,"origSz","totalSz"),l=this.safeString(i,"sz"),u=this.safeStringUpper(i,"tif");let f;return void 0!==u&&(f="ALO"===u),this.safeOrder({info:e,id:this.safeString(i,"oid"),clientOrderId:this.safeString(i,"cloid"),timestamp:n,datetime:this.iso8601(n),lastTradeTimestamp:void 0,lastUpdateTimestamp:this.safeInteger(e,"statusTimestamp"),symbol:o,type:this.parseOrderType(this.safeStringLower(i,"orderType")),timeInForce:u,postOnly:f,reduceOnly:this.safeBool(i,"reduceOnly"),side:h,price:this.safeString(i,"limitPx"),triggerPrice:this.safeBool(i,"isTrigger")?this.safeNumber(i,"triggerPx"):void 0,amount:c,cost:void 0,average:this.safeString(i,"avgPx"),filled:a.Y.stringSub(c,l),remaining:l,status:this.parseOrderStatus(d),fee:void 0,trades:void 0},t)}parseOrderStatus(e){if(void 0===e)return;return e.endsWith("Rejected")?"rejected":e.endsWith("Canceled")?"canceled":this.safeString({triggered:"open",filled:"closed",open:"open",canceled:"canceled",rejected:"rejected",marginCanceled:"canceled"},e,e)}parseOrderType(e){return this.safeString({"stop limit":"limit","stop market":"market"},e,e)}async fetchMyTrades(e=void 0,t=void 0,i=void 0,s={}){let r;[r,s]=this.handlePublicAddress("fetchMyTrades",s),await this.loadMarkets();const a=this.safeMarket(e),o={user:r};void 0!==t?(o.type="userFillsByTime",o.startTime=t):o.type="userFills";const n=this.safeInteger(s,"until");s=this.omit(s,"until"),void 0!==n&&(o.endTime=n);const d=await this.publicPostInfo(this.extend(o,s));return this.parseTrades(d,a,t,i)}parseTrade(e,t=void 0){const i=this.safeInteger(e,"time"),s=this.safeString(e,"px"),r=this.safeString(e,"sz"),a=this.safeString(e,"coin"),o=this.coinToMarketId(a),n=(t=this.safeMarket(o,void 0)).symbol,d=this.safeString(e,"tid");let h=this.safeString(e,"side");void 0!==h&&(h="A"===h?"sell":"buy");const c=this.safeString(e,"fee");let l;const u=this.safeBool(e,"crossed");return void 0!==u&&(l=u?"taker":"maker"),this.safeTrade({info:e,timestamp:i,datetime:this.iso8601(i),symbol:n,id:d,order:this.safeString(e,"oid"),type:void 0,side:h,takerOrMaker:l,price:s,amount:r,cost:void 0,fee:{cost:c,currency:this.safeString(e,"feeToken"),rate:void 0}},t)}async fetchPosition(e,t={}){const i=await this.fetchPositions([e],t);return this.safeDict(i,0,{})}async fetchPositions(e=void 0,t={}){let i;await this.loadMarkets(),[i,t]=this.handlePublicAddress("fetchPositions",t),e=this.marketSymbols(e);const s={type:"clearinghouseState",user:i},r=await this.publicPostInfo(this.extend(s,t)),a=this.safeList(r,"assetPositions",[]),o=[];for(let e=0;e swap transfer");let e=this.numberToString(t),i=this.safeString2(o,"vaultAddress","subAccountAddress");void 0!==i&&(i=this.formatVaultAddress(i),e=e+" subaccount:"+i);const a="perp"===s||"swap"===s,h={hyperliquidChain:n?"Testnet":"Mainnet",amount:e,toPerp:a,nonce:d},c=this.buildUsdClassSendSig(h),l={action:{hyperliquidChain:h.hyperliquidChain,signatureChainId:"0x66eee",type:"usdClassTransfer",amount:e,toPerp:a,nonce:d},nonce:d,signature:c};void 0!==i&&(l.vaultAddress=i);return await this.privatePostExchange(l)}let h,c=!1;if("main"===i)h=s,c=!0;else{if("main"!==s)throw new r.NotSupported(this.id+" transfer() only support main <> subaccount transfer");h=i}if(this.checkAddress(h),void 0===e||"USDC"===e.toUpperCase()){const e={type:"subAccountTransfer",subAccountUser:h,isDeposit:c,usd:this.parseToInt(a.Y.stringMul(this.numberToString(t),"1000000"))},i={action:e,nonce:d,signature:this.signL1Action(e,d)},s=await this.privatePostExchange(i);return this.parseTransfer(s)}{const i={type:"subAccountSpotTransfer",subAccountUser:h,isDeposit:c,token:this.symbol(e),amount:this.numberToString(t)},s={action:i,nonce:d,signature:this.signL1Action(i,d)},r=await this.privatePostExchange(s);return this.parseTransfer(r)}}parseTransfer(e,t=void 0){return{info:e,id:void 0,timestamp:void 0,datetime:void 0,currency:void 0,amount:void 0,fromAccount:void 0,toAccount:void 0,status:"ok"}}async withdraw(e,t,i,s=void 0,a={}){if(this.checkRequiredCredentials(),await this.loadMarkets(),this.checkAddress(i),void 0!==e&&"USDC"!==(e=e.toUpperCase()))throw new r.NotSupported(this.id+" withdraw() only support USDC");let o;[o,a]=this.handleOptionAndParams(a,"withdraw","vaultAddress"),o=this.formatVaultAddress(o),a=this.omit(a,"vaultAddress");const n=this.milliseconds();let d,h={};if(void 0!==o)h={type:"vaultTransfer",vaultAddress:"0x"+o,isDeposit:!1,usd:t},d=this.signL1Action(h,n);else{const e={hyperliquidChain:this.safeBool(this.options,"sandboxMode",!1)?"Testnet":"Mainnet",destination:i,amount:t.toString(),time:n};d=this.buildWithdrawSig(e),h={hyperliquidChain:e.hyperliquidChain,signatureChainId:"0x66eee",destination:i,amount:t.toString(),time:n,type:"withdraw3"}}const c={action:h,nonce:n,signature:d},l=await this.privatePostExchange(c);return this.parseTransaction(l)}parseTransaction(e,t=void 0){const i=this.safeInteger(e,"time"),s=this.safeDict(e,"delta",{});let r;const a=this.safeInteger(s,"fee");let o;void 0!==a&&(r={currency:"USDC",cost:a});const n=this.safeString(s,"type");return void 0!==n&&(o="internalTransfer"===n),{info:e,id:void 0,txid:this.safeString(e,"hash"),timestamp:i,datetime:this.iso8601(i),network:void 0,address:void 0,addressTo:this.safeString(s,"destination"),addressFrom:this.safeString(s,"user"),tag:void 0,tagTo:void 0,tagFrom:void 0,type:void 0,amount:this.safeNumber(s,"usdc"),currency:void 0,status:this.safeString(e,"status"),updated:void 0,comment:void 0,internal:o,fee:r}}async fetchTradingFee(e,t={}){let i;await this.loadMarkets(),[i,t]=this.handlePublicAddress("fetchTradingFee",t);const s=this.market(e),r={type:"userFees",user:i},a=await this.publicPostInfo(this.extend(r,t)),o={userCrossRate:this.safeString(a,"userCrossRate"),userAddRate:this.safeString(a,"userAddRate")};return this.parseTradingFee(o,s)}parseTradingFee(e,t=void 0){return{info:e,symbol:this.safeSymbol(void 0,t),maker:this.safeNumber(e,"userAddRate"),taker:this.safeNumber(e,"userCrossRate"),percentage:void 0,tierBased:void 0}}async fetchLedger(e=void 0,t=void 0,i=void 0,s={}){let r;await this.loadMarkets(),[r,s]=this.handlePublicAddress("fetchLedger",s);const a={type:"userNonFundingLedgerUpdates",user:r};void 0!==t&&(a.startTime=t);const o=this.safeInteger(s,"until");void 0!==o&&(a.endTime=o,s=this.omit(s,["until"]));const n=await this.publicPostInfo(this.extend(a,s));return this.parseLedger(n,void 0,t,i)}parseLedgerEntry(e,t=void 0){const i=this.safeInteger(e,"time"),s=this.safeDict(e,"delta",{});let r;const a=this.safeInteger(s,"fee");void 0!==a&&(r={currency:"USDC",cost:a});const o=this.safeString(s,"type"),n=this.safeString(s,"usdc");return this.safeLedgerEntry({info:e,id:this.safeString(e,"hash"),direction:void 0,account:void 0,referenceAccount:this.safeString(s,"user"),referenceId:this.safeString(e,"hash"),type:this.parseLedgerEntryType(o),currency:void 0,amount:this.parseNumber(n),timestamp:i,datetime:this.iso8601(i),before:void 0,after:void 0,status:void 0,fee:r},t)}parseLedgerEntryType(e){return this.safeString({internalTransfer:"transfer",accountClassTransfer:"transfer"},e,e)}async fetchDeposits(e=void 0,t=void 0,i=void 0,s={}){let r;await this.loadMarkets(),[r,s]=this.handlePublicAddress("fetchDepositsWithdrawals",s);const a={type:"userNonFundingLedgerUpdates",user:r};void 0!==t&&(a.startTime=t);const o=this.safeInteger(s,"until");void 0!==o&&(a.endTime=o,s=this.omit(s,["until"]));const n=await this.publicPostInfo(this.extend(a,s)),d=this.extractTypeFromDelta(n),h=this.filterByArray(d,"type",["deposit"],!1);return this.parseTransactions(h,void 0,t,i)}async fetchWithdrawals(e=void 0,t=void 0,i=void 0,s={}){let r;await this.loadMarkets(),[r,s]=this.handlePublicAddress("fetchDepositsWithdrawals",s);const a={type:"userNonFundingLedgerUpdates",user:r};void 0!==t&&(a.startTime=t);const o=this.safeInteger(s,"until");void 0!==o&&(a.endTime=o,s=this.omit(s,["until"]));const n=await this.publicPostInfo(this.extend(a,s)),d=this.extractTypeFromDelta(n),h=this.filterByArray(d,"type",["withdraw"],!1);return this.parseTransactions(h,void 0,t,i)}async fetchOpenInterests(e=void 0,t={}){await this.loadMarkets(),e=this.marketSymbols(e);const i=await this.fetchSwapMarkets();return this.parseOpenInterests(i,e)}async fetchOpenInterest(e,t={}){e=this.symbol(e),await this.loadMarkets();return(await this.fetchOpenInterests([e],t))[e]}parseOpenInterest(e,t=void 0){e=this.safeDict(e,"info",{});const i=this.safeString(e,"name");let s;return void 0!==i&&(s=this.coinToMarketId(i)),this.safeOpenInterest({symbol:this.safeSymbol(s),openInterestAmount:this.safeNumber(e,"openInterest"),openInterestValue:void 0,timestamp:void 0,datetime:void 0,info:e},t)}async fetchFundingHistory(e=void 0,t=void 0,i=void 0,s={}){let r,a;await this.loadMarkets(),void 0!==e&&(r=this.market(e)),[a,s]=this.handlePublicAddress("fetchFundingHistory",s);const o={user:a,type:"userFunding"};void 0!==t&&(o.startTime=t);const n=this.safeInteger(s,"until");s=this.omit(s,"until"),void 0!==n&&(o.endTime=n);const d=await this.publicPostInfo(this.extend(o,s));return this.parseIncomes(d,r,t,i)}parseIncome(e,t=void 0){const i=this.safeString(e,"hash"),s=this.safeInteger(e,"time"),r=this.safeDict(e,"delta"),a=this.safeString(r,"coin")+"/USDC:USDC",o=this.safeMarket(a).symbol,n=this.safeString(r,"usdc"),d=this.safeCurrencyCode("USDC"),h=this.safeNumber(r,"fundingRate");return{info:e,symbol:o,code:d,timestamp:s,datetime:this.iso8601(s),id:i,amount:this.parseNumber(n),rate:h}}async reserveRequestWeight(e,t={}){const i=this.milliseconds(),s={nonce:i},r={type:"reserveRequestWeight",weight:e},a=this.signL1Action(r,i);s.action=r,s.signature=a;return await this.privatePostExchange(this.extend(s,t))}extractTypeFromDelta(e=[]){const t=[];for(let i=0;i-1||e.indexOf("@")>-1?e:this.safeCurrencyCode(e)+"/USDC:USDC"}handleErrors(e,t,i,s,a,o,n,d,h){if(!n)return;const c=this.safeString(n,"status",""),l=this.safeString(n,"error");let u;if("err"===c)u=this.safeString(n,"response");else{if("unknownOid"===c)throw new r.OrderNotFound(this.id+" "+o);if(void 0!==l)u=l;else{const e=this.safeDict(n,"response",{}),t=this.safeDict(e,"data",{}),i=this.safeList(t,"statuses",[]);for(let e=0;e{i.d(t,{A:()=>d});var s=i(359),r=i(5147),a=i(1579),o=i(4852),n=i(2079);class d extends s.A{describe(){return this.deepExtend(super.describe(),{id:"independentreserve",name:"Independent Reserve",countries:["AU","NZ"],rateLimit:1e3,pro:!0,has:{CORS:void 0,spot:!0,margin:!1,swap:!1,future:!1,option:!1,addMargin:!1,borrowCrossMargin:!1,borrowIsolatedMargin:!1,borrowMargin:!1,cancelOrder:!0,closeAllPositions:!1,closePosition:!1,createOrder:!0,createReduceOnlyOrder:!1,createStopLimitOrder:!1,createStopMarketOrder:!1,createStopOrder:!1,fetchAllGreeks:!1,fetchBalance:!0,fetchBorrowInterest:!1,fetchBorrowRate:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchBorrowRates:!1,fetchBorrowRatesPerSymbol:!1,fetchClosedOrders:!0,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchDepositAddress:!0,fetchDepositAddresses:!1,fetchDepositAddressesByNetwork:!1,fetchFundingHistory:!1,fetchFundingInterval:!1,fetchFundingIntervals:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchGreeks:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchIsolatedPositions:!1,fetchLeverage:!1,fetchLeverages:!1,fetchLeverageTiers:!1,fetchLiquidations:!1,fetchLongShortRatio:!1,fetchLongShortRatioHistory:!1,fetchMarginAdjustmentHistory:!1,fetchMarginMode:!1,fetchMarginModes:!1,fetchMarketLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMarkPrice:!1,fetchMarkPrices:!1,fetchMyLiquidations:!1,fetchMySettlementHistory:!1,fetchMyTrades:!0,fetchOpenInterest:!1,fetchOpenInterestHistory:!1,fetchOpenInterests:!1,fetchOpenOrders:!0,fetchOption:!1,fetchOptionChain:!1,fetchOrder:!0,fetchOrderBook:!0,fetchPosition:!1,fetchPositionForSymbolWs:!1,fetchPositionHistory:!1,fetchPositionMode:!1,fetchPositions:!1,fetchPositionsForSymbol:!1,fetchPositionsForSymbolWs:!1,fetchPositionsHistory:!1,fetchPositionsRisk:!1,fetchPremiumIndexOHLCV:!1,fetchSettlementHistory:!1,fetchTicker:!0,fetchTrades:!0,fetchTradingFee:!1,fetchTradingFees:!0,fetchUnderlyingAssets:!1,fetchVolatilityHistory:!1,reduceMargin:!1,repayCrossMargin:!1,repayIsolatedMargin:!1,setLeverage:!1,setMargin:!1,setMarginMode:!1,setPositionMode:!1,withdraw:!0},urls:{logo:"https://user-images.githubusercontent.com/51840849/87182090-1e9e9080-c2ec-11ea-8e49-563db9a38f37.jpg",api:{public:"https://api.independentreserve.com/Public",private:"https://api.independentreserve.com/Private"},www:"https://www.independentreserve.com",doc:"https://www.independentreserve.com/API"},api:{public:{get:["GetValidPrimaryCurrencyCodes","GetValidSecondaryCurrencyCodes","GetValidLimitOrderTypes","GetValidMarketOrderTypes","GetValidOrderTypes","GetValidTransactionTypes","GetMarketSummary","GetOrderBook","GetAllOrders","GetTradeHistorySummary","GetRecentTrades","GetFxRates","GetOrderMinimumVolumes","GetCryptoWithdrawalFees","GetCryptoWithdrawalFees2","GetNetworks","GetPrimaryCurrencyConfig2"]},private:{post:["GetOpenOrders","GetClosedOrders","GetClosedFilledOrders","GetOrderDetails","GetAccounts","GetTransactions","GetFiatBankAccounts","GetDigitalCurrencyDepositAddress","GetDigitalCurrencyDepositAddress2","GetDigitalCurrencyDepositAddresses","GetDigitalCurrencyDepositAddresses2","GetTrades","GetBrokerageFees","GetDigitalCurrencyWithdrawal","PlaceLimitOrder","PlaceMarketOrder","CancelOrder","SynchDigitalCurrencyDepositAddressWithBlockchain","RequestFiatWithdrawal","WithdrawFiatCurrency","WithdrawDigitalCurrency","WithdrawCrypto"]}},fees:{trading:{taker:this.parseNumber("0.005"),maker:this.parseNumber("0.005"),percentage:!0,tierBased:!1}},features:{spot:{sandbox:!1,createOrder:{marginMode:!1,triggerPrice:!1,triggerPriceType:void 0,triggerDirection:!1,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!1,FOK:!1,PO:!1,GTD:!1},hedged:!1,selfTradePrevention:!1,trailing:!1,leverage:!1,marketBuyByCost:!1,marketBuyRequiresPrice:!1,iceberg:!1},createOrders:void 0,fetchMyTrades:{marginMode:!1,limit:100,daysBack:void 0,untilDays:void 0,symbolRequired:!1},fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!1},fetchOpenOrders:{marginMode:!1,limit:100,trigger:!1,trailing:!1,symbolRequired:!1},fetchOrders:void 0,fetchClosedOrders:{marginMode:!1,limit:100,daysBack:void 0,daysBackCanceled:void 0,untilDays:void 0,trigger:!1,trailing:!1,symbolRequired:!1},fetchOHLCV:void 0},swap:{linear:void 0,inverse:void 0},future:{linear:void 0,inverse:void 0}},commonCurrencies:{PLA:"PlayChip"},precisionMode:a.kb,options:{defaultNetworks:{USDT:"Ethereum",USDC:"Ethereum",BTC:"Bitcoin",BCH:"BitcoinCash",ETH:"Ethereum",LTC:"Litecoin",XRP:"XrpLedger",ZRX:"Ethereum",EOS:"EosIo",XLM:"Stellar",BAT:"Ethereum",ETC:"EthereumClassic",LINK:"Ethereum",MKR:"Ethereum",DAI:"Ethereum",COMP:"Ethereum",SNX:"Ethereum",YFI:"Ethereum",AAVE:"Ethereum",GRT:"Ethereum",DOT:"Polkadot",UNI:"Ethereum",ADA:"Cardano",MATIC:"Ethereum",DOGE:"Dogecoin",SOL:"Solana",MANA:"Ethereum",SAND:"Ethereum",SHIB:"Ethereum",TRX:"Tron",RENDER:"Solana",WIF:"Solana",RLUSD:"Ethereum",PEPE:"Ethereum"},networks:{BTC:"Bitcoin",ETH:"Ethereum",BCH:"BitcoinCash",LTC:"Litecoin",XRP:"XrpLedger",EOS:"EosIo",XLM:"Stellar",ETC:"EthereumClassic",BSV:"BitcoinSV",DOGE:"Dogecoin",DOT:"Polkadot",ADA:"Cardano",SOL:"Solana",TRX:"Tron"}}})}async fetchMarkets(e={}){const t=this.publicGetGetValidPrimaryCurrencyCodes(e),i=this.publicGetGetValidSecondaryCurrencyCodes(e),s=this.publicGetGetOrderMinimumVolumes(e),[r,a,o]=await Promise.all([t,i,s]),n=[];for(let e=0;e=0?d="buy":h.indexOf("Offer")>=0&&(d="sell"),h.indexOf("Market")>=0?h="market":h.indexOf("Limit")>=0&&(h="limit"));const c=this.parse8601(this.safeString(e,"CreatedTimestampUtc")),l=this.safeString(e,"VolumeFilled"),u=this.safeString(e,"FeePercent");let f;return void 0!==u&&void 0!==l&&(f=r.Y.stringMul(u,l)),this.safeOrder({info:e,id:this.safeString(e,"OrderGuid"),clientOrderId:void 0,timestamp:c,datetime:this.iso8601(c),lastTradeTimestamp:void 0,symbol:i,type:h,timeInForce:void 0,postOnly:void 0,side:d,price:this.safeString(e,"Price"),triggerPrice:void 0,cost:this.safeString(e,"Value"),average:this.safeString(e,"AvgPrice"),amount:this.safeString2(e,"VolumeOrdered","Volume"),filled:l,remaining:this.safeString(e,"Outstanding"),status:this.parseOrderStatus(this.safeString(e,"Status")),fee:{rate:u,cost:f,currency:o},trades:void 0},t)}parseOrderStatus(e){return this.safeString({Open:"open",PartiallyFilled:"open",Filled:"closed",PartiallyFilledAndCancelled:"canceled",Cancelled:"canceled",PartiallyFilledAndExpired:"canceled",Expired:"canceled"},e,e)}async fetchOrder(e,t=void 0,i={}){await this.loadMarkets();const s=await this.privatePostGetOrderDetails(this.extend({orderGuid:e},i));let r;return void 0!==t&&(r=this.market(t)),this.parseOrder(s,r)}async fetchOpenOrders(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();const r=this.ordered({});let a;void 0!==e&&(a=this.market(e),r.primaryCurrencyCode=a.baseId,r.secondaryCurrencyCode=a.quoteId),void 0===i&&(i=50),r.pageIndex=1,r.pageSize=i;const o=await this.privatePostGetOpenOrders(this.extend(r,s)),n=this.safeList(o,"Data",[]);return this.parseOrders(n,a,t,i)}async fetchClosedOrders(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();const r=this.ordered({});let a;void 0!==e&&(a=this.market(e),r.primaryCurrencyCode=a.baseId,r.secondaryCurrencyCode=a.quoteId),void 0===i&&(i=50),r.pageIndex=1,r.pageSize=i;const o=await this.privatePostGetClosedOrders(this.extend(r,s)),n=this.safeList(o,"Data",[]);return this.parseOrders(n,a,t,i)}async fetchMyTrades(e=void 0,t=void 0,i=50,s={}){await this.loadMarkets();const r=this.safeInteger(s,"pageIndex",1);void 0===i&&(i=50);const a=this.ordered({pageIndex:r,pageSize:i}),o=await this.privatePostGetTrades(this.extend(a,s));let n;return void 0!==e&&(n=this.market(e)),this.parseTrades(o.Data,n,t,i)}parseTrade(e,t=void 0){const i=this.parse8601(e.TradeTimestampUtc),s=this.safeString(e,"TradeGuid"),a=this.safeString(e,"OrderGuid"),o=this.safeString2(e,"Price","SecondaryCurrencyTradePrice"),n=this.safeString2(e,"VolumeTraded","PrimaryCurrencyAmount"),d=this.parseNumber(o),h=this.parseNumber(n),c=this.parseNumber(r.Y.stringMul(o,n)),l=this.safeString(e,"PrimaryCurrencyCode"),u=this.safeString(e,"SecondaryCurrencyCode");let f;void 0!==l&&void 0!==u&&(f=l+"/"+u);const p=this.safeSymbol(f,t,"/");let m=this.safeString(e,"OrderType");return void 0!==m&&(m.indexOf("Bid")>=0?m="buy":m.indexOf("Offer")>=0&&(m="sell")),this.safeTrade({id:s,info:e,timestamp:i,datetime:this.iso8601(i),symbol:p,order:a,type:void 0,side:m,takerOrMaker:void 0,price:d,amount:h,cost:c,fee:void 0},t)}async fetchTrades(e,t=void 0,i=void 0,s={}){await this.loadMarkets();const r=this.market(e),a={primaryCurrencyCode:r.baseId,secondaryCurrencyCode:r.quoteId,numberOfRecentTradesToRetrieve:50},o=await this.publicGetGetRecentTrades(this.extend(a,s));return this.parseTrades(o.Trades,r,t,i)}async fetchTradingFees(e={}){await this.loadMarkets();const t=await this.privatePostGetBrokerageFees(e),i={};for(let e=0;e{i.d(t,{A:()=>d});var s=i(4558),r=i(2079),a=i(1579),o=i(5147),n=i(7481);class d extends s.A{describe(){return this.deepExtend(super.describe(),{id:"indodax",name:"INDODAX",countries:["ID"],rateLimit:50,has:{CORS:void 0,spot:!0,margin:!1,swap:!1,future:!1,option:!1,addMargin:!1,borrowCrossMargin:!1,borrowIsolatedMargin:!1,borrowMargin:!1,cancelAllOrders:!1,cancelOrder:!0,cancelOrders:!1,closeAllPositions:!1,closePosition:!1,createDepositAddress:!1,createOrder:!0,createReduceOnlyOrder:!1,createStopLimitOrder:!1,createStopMarketOrder:!1,createStopOrder:!1,fetchAllGreeks:!1,fetchBalance:!0,fetchBorrowInterest:!1,fetchBorrowRate:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchBorrowRates:!1,fetchBorrowRatesPerSymbol:!1,fetchClosedOrders:!0,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchDeposit:!1,fetchDepositAddress:"emulated",fetchDepositAddresses:!0,fetchDepositAddressesByNetwork:!1,fetchDeposits:!1,fetchDepositsWithdrawals:!0,fetchFundingHistory:!1,fetchFundingInterval:!1,fetchFundingIntervals:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchGreeks:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchIsolatedPositions:!1,fetchLeverage:!1,fetchLeverages:!1,fetchLeverageTiers:!1,fetchLiquidations:!1,fetchLongShortRatio:!1,fetchLongShortRatioHistory:!1,fetchMarginAdjustmentHistory:!1,fetchMarginMode:!1,fetchMarginModes:!1,fetchMarketLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMarkPrice:!1,fetchMarkPrices:!1,fetchMyLiquidations:!1,fetchMySettlementHistory:!1,fetchOpenInterest:!1,fetchOpenInterestHistory:!1,fetchOpenInterests:!1,fetchOpenOrders:!0,fetchOption:!1,fetchOptionChain:!1,fetchOrder:!0,fetchOrderBook:!0,fetchOrders:!1,fetchPosition:!1,fetchPositionForSymbolWs:!1,fetchPositionHistory:!1,fetchPositionMode:!1,fetchPositions:!1,fetchPositionsForSymbol:!1,fetchPositionsForSymbolWs:!1,fetchPositionsHistory:!1,fetchPositionsRisk:!1,fetchPremiumIndexOHLCV:!1,fetchSettlementHistory:!1,fetchTicker:!0,fetchTime:!0,fetchTrades:!0,fetchTradingFee:!1,fetchTradingFees:!1,fetchTransactionFee:!0,fetchTransactionFees:!1,fetchTransactions:"emulated",fetchTransfer:!1,fetchTransfers:!1,fetchUnderlyingAssets:!1,fetchVolatilityHistory:!1,fetchWithdrawal:!1,fetchWithdrawals:!1,reduceMargin:!1,repayCrossMargin:!1,repayIsolatedMargin:!1,setLeverage:!1,setMargin:!1,setMarginMode:!1,setPositionMode:!1,transfer:!1,withdraw:!0},version:"2.0",urls:{logo:"https://user-images.githubusercontent.com/51840849/87070508-9358c880-c221-11ea-8dc5-5391afbbb422.jpg",api:{public:"https://indodax.com",private:"https://indodax.com/tapi"},www:"https://www.indodax.com",doc:"https://github.com/btcid/indodax-official-api-docs",referral:"https://indodax.com/ref/testbitcoincoid/1"},api:{public:{get:{"api/server_time":5,"api/pairs":5,"api/price_increments":5,"api/summaries":5,"api/ticker/{pair}":5,"api/ticker_all":5,"api/trades/{pair}":5,"api/depth/{pair}":5,"tradingview/history_v2":5}},private:{post:{getInfo:4,transHistory:4,trade:1,tradeHistory:4,openOrders:4,orderHistory:4,getOrder:4,cancelOrder:4,withdrawFee:4,withdrawCoin:4,listDownline:4,checkDownline:4,createVoucher:4}}},fees:{trading:{tierBased:!1,percentage:!0,maker:0,taker:.003}},exceptions:{exact:{invalid_pair:r.BadSymbol,"Insufficient balance.":r.InsufficientFunds,"invalid order.":r.OrderNotFound,"Invalid credentials. API not found or session has expired.":r.AuthenticationError,"Invalid credentials. Bad sign.":r.AuthenticationError},broad:{"Minimum price":r.InvalidOrder,"Minimum order":r.InvalidOrder}},options:{recvWindow:5e3,timeDifference:0,adjustForTimeDifference:!1,networks:{XLM:"Stellar Token",BSC:"bep20",TRC20:"trc20",MATIC:"polygon"},timeframes:{"1m":"1","15m":"15","30m":"30","1h":"60","4h":"240","1d":"1D","3d":"3D","1w":"1W"}},features:{spot:{sandbox:!1,createOrder:{marginMode:!1,triggerPrice:!1,triggerPriceType:void 0,triggerDirection:!1,stopLossPrice:!1,takeProfitPrice:!1,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!0,FOK:!1,PO:!1,GTD:!1},hedged:!1,selfTradePrevention:!1,trailing:!1,leverage:!1,marketBuyByCost:!1,marketBuyRequiresPrice:!1,iceberg:!1},createOrders:void 0,fetchMyTrades:void 0,fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!0},fetchOpenOrders:{marginMode:!1,limit:void 0,trigger:!1,trailing:!1,symbolRequired:!1},fetchOrders:void 0,fetchClosedOrders:{marginMode:!1,limit:1e3,daysBack:1e5,daysBackCanceled:1,untilDays:void 0,trigger:!1,trailing:!1,symbolRequired:!0},fetchOHLCV:{limit:2e3}},swap:{linear:void 0,inverse:void 0},future:{linear:void 0,inverse:void 0}},commonCurrencies:{STR:"XLM",BCHABC:"BCH",BCHSV:"BSV",DRK:"DASH",NEM:"XEM"},precisionMode:a.kb})}nonce(){return this.milliseconds()-this.options.timeDifference}async fetchTime(e={}){const t=await this.publicGetApiServerTime(e);return this.safeInteger(t,"server_time")}async fetchMarkets(e={}){const t=await this.publicGetApiPairs(e),i=[];for(let e=0;e=0){e=[];const i=t.split(",");for(let t=0;t{i.d(t,{A:()=>r});var s=i(1688);class r extends s.A{describe(){return this.deepExtend(super.describe(),{id:"jibitex",name:"Jibitex",countries:["IR"],rateLimit:1e3,version:"1",certified:!1,pro:!1,has:{CORS:void 0,spot:!0,margin:!1,swap:!1,future:!1,option:!1,addMargin:!1,cancelAllOrders:!1,cancelOrder:!1,cancelOrders:!1,createDepositAddress:!1,createOrder:!1,createStopLimitOrder:!1,createStopMarketOrder:!1,createStopOrder:!1,editOrder:!1,fetchBalance:!1,fetchBorrowInterest:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchClosedOrders:!1,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!1,fetchDepositAddress:!1,fetchDeposits:!1,fetchFundingHistory:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchL2OrderBook:!1,fetchLedger:!1,fetchLedgerEntry:!1,fetchLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMyTrades:!1,fetchOHLCV:!0,fetchOpenInterestHistory:!1,fetchOpenOrders:!1,fetchOrder:!1,fetchOrderBook:!0,fetchOrders:!1,fetchOrderTrades:"emulated",fetchPositions:!1,fetchPremiumIndexOHLCV:!1,fetchTicker:!0,fetchTickers:!0,fetchTime:!1,fetchTrades:!1,fetchTradingFee:!1,fetchTradingFees:!1,fetchWithdrawals:!1,setLeverage:!1,setMarginMode:!1,transfer:!1,withdraw:!1},comment:"This comment is optional",urls:{logo:"https://cdn.arz.digital/cr-odin/img/exchanges/jibitex/64x64.png",api:{public:"https://jibitex.co"},www:"https://jibitex.net",doc:["https://jibitex.net"]},timeframes:{"1h":"60","2h":"120","1d":"1D","1w":"1W"},api:{public:{get:{"api/1/markets":1,"api/1/ohlcvs/tradingView":1,"api/1/orders/orderBook/market":1}}},fees:{trading:{tierBased:!1,percentage:!0,maker:this.parseNumber("0.001"),taker:this.parseNumber("0.001")}}})}async fetchMarkets(e={}){const t=await this.publicGetApi1Markets(),i=this.safeList(t,"content"),s=[];for(let e=0;e{i.d(t,{A:()=>r});var s=i(7478);class r extends s.A{describe(){return this.deepExtend(super.describe(),{id:"kcex",name:"Kcex",countries:["SC"],rateLimit:1e3,version:"1",certified:!1,pro:!1,has:{CORS:void 0,spot:!0,margin:!1,swap:!1,future:!0,option:!1,addMargin:!1,cancelAllOrders:!1,cancelOrder:!1,cancelOrders:!1,createDepositAddress:!1,createOrder:!1,createStopLimitOrder:!1,createStopMarketOrder:!1,createStopOrder:!1,editOrder:!1,fetchBalance:!1,fetchBorrowInterest:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchClosedOrders:!1,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!1,fetchDepositAddress:!1,fetchDeposits:!1,fetchFundingHistory:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchL2OrderBook:!1,fetchL3OrderBook:!1,fetchLedger:!1,fetchLedgerEntry:!1,fetchLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMyTrades:!1,fetchOHLCV:!0,fetchOpenInterestHistory:!1,fetchOpenOrders:!1,fetchOrder:!1,fetchOrderBook:!0,fetchOrders:!1,fetchOrderTrades:"emulated",fetchPositions:!1,fetchPremiumIndexOHLCV:!1,fetchTicker:!0,fetchTickers:!0,fetchTime:!1,fetchTrades:!1,fetchTradingFee:!1,fetchTradingFees:!1,fetchWithdrawals:!1,setLeverage:!1,setMarginMode:!1,transfer:!1,withdraw:!1},comment:"This comment is optional",urls:{logo:"https://cdn.arz.digital/cr-odin/img/exchanges/kcex/64x64.png",api:{public:"https://www.kcex.com/spot/api"},www:"https://www.kcex.com",doc:["https://www.kcex.com"]},timeframes:{"1m":"1","1h":"60","3h":"180","6h":"360","12h":"720","1d":"1D"},api:{public:{get:{"market-2/spot/market/v2/web/symbols":1,"market-2/spot/market/v2/web/tickers":1,"market-2/spot/market/v2/web/symbol/ticker":1}}}})}async fetchMarkets(e={}){const t=await this.publicGetMarket2SpotMarketV2WebSymbols(e),i=this.safeDict(t,"data"),s=this.safeList(i,"USDT"),r=this.safeList(i,"USDC"),a=this.arrayConcat(s,r),o=[];for(let e=0;e{i.d(t,{A:()=>h});var s=i(2459),r=i(2079),a=i(5147),o=i(1579),n=i(4852),d=i(7481);class h extends s.A{describe(){return this.deepExtend(super.describe(),{id:"kraken",name:"Kraken",countries:["US"],version:"0",rateLimit:1e3,certified:!1,pro:!0,has:{CORS:void 0,spot:!0,margin:!0,swap:!1,future:!1,option:!1,addMargin:!1,cancelAllOrders:!0,cancelAllOrdersAfter:!0,cancelOrder:!0,cancelOrders:!0,createDepositAddress:!0,createMarketBuyOrderWithCost:!0,createMarketOrderWithCost:!1,createMarketSellOrderWithCost:!1,createOrder:!0,createStopLimitOrder:!0,createStopMarketOrder:!0,createStopOrder:!0,createTrailingAmountOrder:!0,createTrailingPercentOrder:!0,editOrder:!0,fetchBalance:!0,fetchBorrowInterest:!1,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchClosedOrders:!0,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!0,fetchDepositAddress:!0,fetchDepositAddresses:!1,fetchDepositAddressesByNetwork:!1,fetchDeposits:!0,fetchFundingHistory:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchLedger:!0,fetchLedgerEntry:!0,fetchLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenInterestHistory:!1,fetchOpenOrders:!0,fetchOrder:!0,fetchOrderBook:!0,fetchOrderTrades:"emulated",fetchPositions:!0,fetchPremiumIndexOHLCV:!1,fetchStatus:!0,fetchTicker:!0,fetchTickers:!0,fetchTime:!0,fetchTrades:!0,fetchTradingFee:!0,fetchTradingFees:!1,fetchWithdrawals:!0,setLeverage:!1,setMarginMode:!1,transfer:!0,withdraw:!0},timeframes:{"1m":1,"5m":5,"15m":15,"30m":30,"1h":60,"4h":240,"1d":1440,"1w":10080,"2w":21600},urls:{logo:"https://user-images.githubusercontent.com/51840849/76173629-fc67fb00-61b1-11ea-84fe-f2de582f58a3.jpg",api:{public:"https://api.kraken.com",private:"https://api.kraken.com",zendesk:"https://kraken.zendesk.com/api/v2/help_center/en-us/articles"},www:"https://www.kraken.com",doc:"https://docs.kraken.com/rest/",fees:"https://www.kraken.com/en-us/features/fee-schedule"},fees:{trading:{tierBased:!0,percentage:!0,taker:this.parseNumber("0.0026"),maker:this.parseNumber("0.0016"),tiers:{taker:[[this.parseNumber("0"),this.parseNumber("0.0026")],[this.parseNumber("50000"),this.parseNumber("0.0024")],[this.parseNumber("100000"),this.parseNumber("0.0022")],[this.parseNumber("250000"),this.parseNumber("0.0020")],[this.parseNumber("500000"),this.parseNumber("0.0018")],[this.parseNumber("1000000"),this.parseNumber("0.0016")],[this.parseNumber("2500000"),this.parseNumber("0.0014")],[this.parseNumber("5000000"),this.parseNumber("0.0012")],[this.parseNumber("10000000"),this.parseNumber("0.0001")]],maker:[[this.parseNumber("0"),this.parseNumber("0.0016")],[this.parseNumber("50000"),this.parseNumber("0.0014")],[this.parseNumber("100000"),this.parseNumber("0.0012")],[this.parseNumber("250000"),this.parseNumber("0.0010")],[this.parseNumber("500000"),this.parseNumber("0.0008")],[this.parseNumber("1000000"),this.parseNumber("0.0006")],[this.parseNumber("2500000"),this.parseNumber("0.0004")],[this.parseNumber("5000000"),this.parseNumber("0.0002")],[this.parseNumber("10000000"),this.parseNumber("0.0")]]}}},handleContentTypeApplicationZip:!0,api:{zendesk:{get:["360000292886","201893608"]},public:{get:{Assets:1,AssetPairs:1,Depth:1.2,OHLC:1.2,Spread:1,SystemStatus:1,Ticker:1,Time:1,Trades:1.2}},private:{post:{AddOrder:0,AddOrderBatch:0,AddExport:3,AmendOrder:0,Balance:3,CancelAll:3,CancelAllOrdersAfter:3,CancelOrder:0,CancelOrderBatch:0,ClosedOrders:3,DepositAddresses:3,DepositMethods:3,DepositStatus:3,EditOrder:0,ExportStatus:3,GetWebSocketsToken:3,Ledgers:6,OpenOrders:3,OpenPositions:3,QueryLedgers:3,QueryOrders:3,QueryTrades:3,RetrieveExport:3,RemoveExport:3,BalanceEx:3,TradeBalance:3,TradesHistory:6,TradeVolume:3,Withdraw:3,WithdrawCancel:3,WithdrawInfo:3,WithdrawMethods:3,WithdrawAddresses:3,WithdrawStatus:3,WalletTransfer:3,CreateSubaccount:3,AccountTransfer:3,"Earn/Allocate":3,"Earn/Deallocate":3,"Earn/AllocateStatus":3,"Earn/DeallocateStatus":3,"Earn/Strategies":3,"Earn/Allocations":3}}},commonCurrencies:{LUNA:"LUNC",LUNA2:"LUNA",REPV2:"REP",REP:"REPV1",UST:"USTC",XBT:"BTC",XDG:"DOGE"},options:{timeDifference:0,adjustForTimeDifference:!1,marketsByAltname:{},delistedMarketsById:{},inactiveCurrencies:["CAD","USD","JPY","GBP"],networks:{ETH:"ERC20",TRX:"TRC20"},depositMethods:{"1INCH":"1inch (1INCH)",AAVE:"Aave",ADA:"ADA",ALGO:"Algorand",ANKR:"ANKR (ANKR)",ANT:"Aragon (ANT)",ATOM:"Cosmos",AXS:"Axie Infinity Shards (AXS)",BADGER:"Bager DAO (BADGER)",BAL:"Balancer (BAL)",BAND:"Band Protocol (BAND)",BAT:"BAT",BCH:"Bitcoin Cash",BNC:"Bifrost (BNC)",BNT:"Bancor (BNT)",BTC:"Bitcoin",CHZ:"Chiliz (CHZ)",COMP:"Compound (COMP)",CQT:"\tCovalent Query Token (CQT)",CRV:"Curve DAO Token (CRV)",CTSI:"Cartesi (CTSI)",DAI:"Dai",DASH:"Dash",DOGE:"Dogecoin",DOT:"Polkadot",DYDX:"dYdX (DYDX)",ENJ:"Enjin Coin (ENJ)",EOS:"EOS",ETC:"Ether Classic (Hex)",ETH:"Ether (Hex)",EWT:"Energy Web Token",FEE:"Kraken Fee Credit",FIL:"Filecoin",FLOW:"Flow",GHST:"Aavegotchi (GHST)",GNO:"GNO",GRT:"GRT",ICX:"Icon",INJ:"Injective Protocol (INJ)",KAR:"Karura (KAR)",KAVA:"Kava",KEEP:"Keep Token (KEEP)",KNC:"Kyber Network (KNC)",KSM:"Kusama",LINK:"Link",LPT:"Livepeer Token (LPT)",LRC:"Loopring (LRC)",LSK:"Lisk",LTC:"Litecoin",MANA:"MANA",MATIC:"Polygon (MATIC)",MINA:"Mina",MIR:"Mirror Protocol (MIR)",MKR:"Maker (MKR)",MLN:"MLN",MOVR:"Moonriver (MOVR)",NANO:"NANO",OCEAN:"OCEAN",OGN:"Origin Protocol (OGN)",OMG:"OMG",OXT:"Orchid (OXT)",OXY:"Oxygen (OXY)",PAXG:"PAX (Gold)",PERP:"Perpetual Protocol (PERP)",PHA:"Phala (PHA)",QTUM:"QTUM",RARI:"Rarible (RARI)",RAY:"Raydium (RAY)",REN:"Ren Protocol (REN)",REP:"REPv2",REPV1:"REP",SAND:"The Sandbox (SAND)",SC:"Siacoin",SDN:"Shiden (SDN)",SOL:"Solana",SNX:"Synthetix Network (SNX)",SRM:"Serum",STORJ:"Storj (STORJ)",SUSHI:"Sushiswap (SUSHI)",TBTC:"tBTC",TRX:"Tron",UNI:"UNI",USDC:"USDC",USDT:"Tether USD (ERC20)","USDT-TRC20":"Tether USD (TRC20)",WAVES:"Waves",WBTC:"Wrapped Bitcoin (WBTC)",XLM:"Stellar XLM",XMR:"Monero",XRP:"Ripple XRP",XTZ:"XTZ",YFI:"YFI",ZEC:"Zcash (Transparent)",ZRX:"0x (ZRX)"},withdrawMethods:{Lightning:"Lightning",Bitcoin:"BTC",Ripple:"XRP",Litecoin:"LTC",Dogecoin:"DOGE",Stellar:"XLM",Ethereum:"ERC20","Arbitrum One":"Arbitrum",Polygon:"MATIC","Arbitrum Nova":"Arbitrum",Optimism:"Optimism","zkSync Era":"zkSync","Ethereum Classic":"ETC",Zcash:"ZEC",Monero:"XMR",Tron:"TRC20",Solana:"SOL",EOS:"EOS","Bitcoin Cash":"BCH",Cardano:"ADA",Qtum:"QTUM",Tezos:"XTZ",Cosmos:"ATOM",Nano:"NANO",Siacoin:"SC",Lisk:"LSK",Waves:"WAVES",ICON:"ICX",Algorand:"ALGO","Polygon - USDC.e":"MATIC","Arbitrum One - USDC.e":"Arbitrum",Polkadot:"DOT",Kava:"KAVA",Filecoin:"FIL",Kusama:"KSM",Flow:"FLOW","Energy Web":"EW",Mina:"MINA",Centrifuge:"CFG",Karura:"KAR",Moonriver:"MOVR",Shiden:"SDN",Khala:"PHA","Bifrost Kusama":"BNC",Songbird:"SGB","Terra classic":"LUNC",KILT:"KILT",Basilisk:"BSX",Flare:"FLR","Avalanche C-Chain":"AVAX",Kintsugi:"KINT",Altair:"AIR",Moonbeam:"GLMR",Acala:"ACA",Astar:"ASTR",Akash:"AKT",Robonomics:"XRT",Fantom:"FTM",Elrond:"EGLD",THORchain:"RUNE",Secret:"SCRT",Near:"NEAR","Internet Computer Protocol":"ICP",Picasso:"PICA","Crust Shadow":"CSM",Integritee:"TEER","Parallel Finance":"PARA",HydraDX:"HDX",Interlay:"INTR","Fetch.ai":"FET",NYM:"NYM","Terra 2.0":"LUNA2",Juno:"JUNO",Nodle:"NODL",Stacks:"STX","Ethereum PoW":"ETHW",Aptos:"APT",Sui:"SUI",Genshiro:"GENS",Aventus:"AVT",Sei:"SEI",OriginTrail:"OTP",Celestia:"TIA"}},features:{spot:{sandbox:!1,createOrder:{marginMode:!1,triggerPrice:!1,triggerPriceType:void 0,triggerDirection:!1,stopLossPrice:!0,takeProfitPrice:!0,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!0,FOK:!0,PO:!0,GTD:!1},hedged:!1,trailing:!0,leverage:!1,marketBuyByCost:!0,marketBuyRequiresPrice:!1,selfTradePrevention:!0,iceberg:!0},createOrders:void 0,fetchMyTrades:{marginMode:!1,limit:void 0,daysBack:void 0,untilDays:void 0,symbolRequired:!1},fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!1},fetchOpenOrders:{marginMode:!1,limit:void 0,trigger:!1,trailing:!1,symbolRequired:!1},fetchOrders:void 0,fetchClosedOrders:{marginMode:!1,limit:void 0,daysBack:void 0,daysBackCanceled:void 0,untilDays:1e5,trigger:!1,trailing:!1,symbolRequired:!1},fetchOHLCV:{limit:720}},swap:{linear:void 0,inverse:void 0},future:{linear:void 0,inverse:void 0}},precisionMode:o.kb,exceptions:{exact:{"EQuery:Invalid asset pair":r.BadSymbol,"EAPI:Invalid key":r.AuthenticationError,"EFunding:Unknown withdraw key":r.InvalidAddress,"EFunding:Invalid amount":r.InsufficientFunds,"EService:Unavailable":r.ExchangeNotAvailable,"EDatabase:Internal error":r.ExchangeNotAvailable,"EService:Busy":r.ExchangeNotAvailable,"EQuery:Unknown asset":r.BadSymbol,"EAPI:Rate limit exceeded":r.DDoSProtection,"EOrder:Rate limit exceeded":r.DDoSProtection,"EGeneral:Internal error":r.ExchangeNotAvailable,"EGeneral:Temporary lockout":r.DDoSProtection,"EGeneral:Permission denied":r.PermissionDenied,"EGeneral:Invalid arguments:price":r.InvalidOrder,"EOrder:Unknown order":r.InvalidOrder,"EOrder:Invalid price:Invalid price argument":r.InvalidOrder,"EOrder:Order minimum not met":r.InvalidOrder,"EOrder:Insufficient funds":r.InsufficientFunds,"EGeneral:Invalid arguments":r.BadRequest,"ESession:Invalid session":r.AuthenticationError,"EAPI:Invalid nonce":r.InvalidNonce,"EFunding:No funding method":r.BadRequest,"EFunding:Unknown asset":r.BadSymbol,"EService:Market in post_only mode":r.OnMaintenance,"EGeneral:Too many requests":r.DDoSProtection,"ETrade:User Locked":r.AccountSuspended},broad:{":Invalid order":r.InvalidOrder,":Invalid arguments:volume":r.InvalidOrder,":Invalid arguments:viqc":r.InvalidOrder,":Invalid nonce":r.InvalidNonce,":IInsufficient funds":r.InsufficientFunds,":Cancel pending":r.CancelPending,":Rate limit exceeded":r.RateLimitExceeded}}})}feeToPrecision(e,t){return this.decimalToPrecision(t,o.R3,this.markets[e].precision.amount,this.precisionMode)}async fetchMarkets(e={}){const t=[];t.push(this.publicGetAssetPairs(e)),this.options.adjustForTimeDifference&&t.push(this.loadTimeDifference());const i=(await Promise.all(t))[0],s=this.safeDict(i,"result",{}),r=this.safeDict(this.options,"cachedCurrencies",{}),o=Object.keys(s),n=[];for(let e=0;eO&&(O=t)}const P="online"===this.safeString(i,"status");n.push({id:t,wsId:this.safeString(i,"wsname"),symbol:c+"/"+l,base:c,quote:l,settle:void 0,baseId:d,quoteId:h,settleId:void 0,altname:i.altname,type:"spot",spot:T,margin:k>0,swap:!1,future:!1,option:!1,active:P,contract:!1,linear:void 0,inverse:void 0,taker:w,maker:m,contractSize:void 0,expiry:void 0,expiryDatetime:void 0,strike:void 0,optionType:void 0,precision:{amount:O,price:S},limits:{leverage:{min:this.parseNumber("1"),max:this.safeNumber(b,k-1,1)},amount:{min:this.safeNumber(i,"ordermin"),max:void 0},price:{min:void 0,max:void 0},cost:{min:this.safeNumber(i,"costmin"),max:void 0}},created:void 0,info:i})}return this.options.marketsByAltname=this.indexBy(n,"altname"),n}safeCurrency(e,t=void 0){return void 0!==e&&e.length>3&&(0!==e.indexOf("X")&&0!==e.indexOf("Z")||e.indexOf(".")>0||"ZEUS"===e||(e=e.slice(1))),super.safeCurrency(e,t)}async fetchStatus(e={}){const t=await this.publicGetSystemStatus(e),i=this.safeDict(t,"result");return{status:"online"===this.safeString(i,"status")?"ok":"maintenance",updated:void 0,eta:void 0,url:void 0,info:t}}async fetchCurrencies(e={}){const t=await this.publicGetAssets(e),i=this.safeValue(t,"result",{}),s=Object.keys(i),r={};for(let e=0;e=0;r[o]=this.safeCurrencyStructure({id:t,code:o,info:a,name:this.safeString(a,"altname"),active:"enabled"===this.safeString(a,"status"),type:n?"fiat":"crypto",deposit:void 0,withdraw:void 0,fee:void 0,precision:this.parseNumber(this.parsePrecision(this.safeString(a,"decimals"))),limits:{amount:{min:void 0,max:void 0},withdraw:{min:void 0,max:void 0}},networks:{}})}return r}safeCurrencyCode(e,t=void 0){if(void 0===e)return e;if(e.indexOf(".")>0){const i=e.split("."),s=this.safeString(i,0),r=this.safeString(i,1);return super.safeCurrencyCode(s,t)+"."+r}return super.safeCurrencyCode(e,t)}async fetchTradingFee(e,t={}){await this.loadMarkets();const i=this.market(e),s={pair:i.id,"fee-info":!0},r=await this.privatePostTradeVolume(this.extend(s,t)),a=this.safeValue(r,"result",{});return this.parseTradingFee(a,i)}parseTradingFee(e,t){const i=this.safeValue(e,"fees_maker",{}),s=this.safeValue(e,"fees",{}),r=this.safeValue(i,t.id,{}),o=this.safeValue(s,t.id,{});return{info:e,symbol:t.symbol,maker:this.parseNumber(a.Y.stringDiv(this.safeString(r,"fee"),"100")),taker:this.parseNumber(a.Y.stringDiv(this.safeString(o,"fee"),"100")),percentage:!0,tierBased:!0}}parseBidAsk(e,t=0,i=1,s=2){return[this.safeNumber(e,t),this.safeNumber(e,i),this.safeInteger(e,2)]}async fetchOrderBook(e,t=void 0,i={}){await this.loadMarkets();const s=this.market(e),r={pair:s.id};void 0!==t&&(r.count=t);const a=await this.publicGetDepth(this.extend(r,i)),o=this.safeValue(a,"result",{});let n=this.safeValue(o,s.id);const d=this.safeValue(s,"info",{}),h=this.safeValue(d,"wsname");return void 0!==h&&(n=this.safeValue(o,h,n)),this.parseOrderBook(n,e)}parseTicker(e,t=void 0){const i=this.safeSymbol(void 0,t),s=this.safeValue(e,"v",[]),r=this.safeString(s,1),o=this.safeValue(e,"p",[]),n=this.safeString(o,1),d=a.Y.stringMul(r,n),h=this.safeValue(e,"c",[]),c=this.safeString(h,0),l=this.safeValue(e,"h",[]),u=this.safeValue(e,"l",[]),f=this.safeValue(e,"b",[]),p=this.safeValue(e,"a",[]);return this.safeTicker({symbol:i,timestamp:void 0,datetime:void 0,high:this.safeString(l,1),low:this.safeString(u,1),bid:this.safeString(f,0),bidVolume:this.safeString(f,2),ask:this.safeString(p,0),askVolume:this.safeString(p,2),vwap:n,open:this.safeString(e,"o"),close:c,last:c,previousClose:void 0,change:void 0,percentage:void 0,average:void 0,baseVolume:r,quoteVolume:d,info:e},t)}async fetchTickers(e=void 0,t={}){await this.loadMarkets();const i={};if(void 0!==e){e=this.marketSymbols(e);const t=[];for(let i=0;i6&&(d=this.safeString(e,6))}else if("string"==typeof e)d=e;else if("ordertxid"in e){const s=this.safeString(e,"pair"),l=this.findMarketByAltnameOrId(s);if(void 0!==l?t=l:void 0!==s&&(t=this.getDelistedMarketById(s)),h=this.safeString(e,"ordertxid"),d=this.safeString2(e,"id","postxid"),i=this.safeTimestamp(e,"time"),r=this.safeString(e,"type"),a=this.safeString(e,"ordertype"),o=this.safeString(e,"price"),n=this.safeString(e,"vol"),"fee"in e){let i;void 0!==t&&(i=t.quote),c={cost:this.safeString(e,"fee"),currency:i}}}else l=this.safeString(e,"symbol"),s=this.safeString(e,"timestamp"),d=this.safeString(e,"trade_id"),r=this.safeString(e,"side"),a=this.safeString(e,"ord_type"),o=this.safeString(e,"price"),n=this.safeString(e,"qty");void 0!==t&&(l=t.symbol);const u=this.safeString(e,"cost"),f=this.safeBool(e,"maker");let p;return void 0!==f&&(p=f?"maker":"taker"),void 0===s?s=this.iso8601(i):i=this.parse8601(s),this.safeTrade({id:d,order:h,info:e,timestamp:i,datetime:s,symbol:l,type:a,side:r,takerOrMaker:p,price:o,amount:n,cost:u,fee:c},t)}async fetchTrades(e,t=void 0,i=void 0,s={}){await this.loadMarkets();const r=this.market(e),a=r.id,o={pair:a};void 0!==t&&(o.since=this.numberToString(this.parseToInt(t/1e3))),void 0!==i&&(o.count=i);const n=(await this.publicGetTrades(this.extend(o,s))).result,d=n[a],h=d.length;if(h<=0)return[];const c=d[h-1],l=this.safeString(n,"last");return c.push(l),d[h-1]=c,this.parseTrades(d,r,t,i)}parseBalance(e){const t=this.safeValue(e,"result",{}),i={info:e,timestamp:void 0,datetime:void 0},s=Object.keys(t);for(let e=0;e-1,h=await this.privatePostAddOrder(this.extend(n[0],n[1])),c=this.safeDict(h,"result");return c.usingCost=d,this.parseOrder(c)}findMarketByAltnameOrId(e){const t=this.safeValue(this.options,"marketsByAltname",{});return e in t?t[e]:this.safeMarket(e)}getDelistedMarketById(e){if(void 0===e)return e;let t=this.safeValue(this.options.delistedMarketsById,e);if(void 0!==t)return t;let i=3,s=3,r=6;8===e.length?(i=4,s=4,r=8):7===e.length&&(i=4,s=4,r=7);const a=e.slice(0,i),o=e.slice(s,r),n=this.safeCurrencyCode(a),d=this.safeCurrencyCode(o);return t={symbol:n+"/"+d,base:n,quote:d,baseId:a,quoteId:o},this.options.delistedMarketsById[e]=t,t}parseOrderStatus(e){return this.safeString({pending:"open",open:"open",closed:"closed",canceled:"canceled",expired:"expired"},e,e)}parseOrderType(e){return this.safeString({"take-profit":"market","stop-loss":"market","stop-loss-limit":"limit","take-profit-limit":"limit","trailing-stop-limit":"limit"},e,e)}parseOrder(e,t=void 0){const i=this.safeBool(e,"usingCost",!1);e=this.omit(e,"usingCost");const s=this.safeDict(e,"descr",{}),r=this.safeDict(e,"descr");let o,n,d,h,c,l,u,f;if(o=void 0!==r?this.safeString(r,"order"):this.safeString(e,"descr"),void 0!==o){const e=o.split(" ");n=this.safeString(e,0),i?u=this.safeString(e,1):l=this.safeString(e,1),h=this.safeString(e,2);const t=this.safeString(e,4),s=this.safeString(e,5);d="limit"===t||"market"===t?t:t+" "+s,"stop loss"===d||"take profit"===d?(f=this.safeString(e,6),c=this.safeString(e,9)):"limit"===d&&(c=this.safeString(e,5))}n=this.safeString(s,"type",n),d=this.safeString(s,"ordertype",d),h=this.safeString(s,"pair",h);const p=this.findMarketByAltnameOrId(h);let m;void 0!==p?t=p:void 0!==h&&(t=this.getDelistedMarketById(h));const g=this.safeTimestamp(e,"opentm");l=this.safeString(e,"vol",l);const v=this.safeString(e,"vol_exec");let y;c=this.safeString(s,"price",c),void 0!==c&&(c.endsWith("%")||a.Y.stringEquals(c,"0.00000")||a.Y.stringEquals(c,"0"))&&(c=void 0),void 0===c&&(c=this.safeString(s,"price2"),c=this.safeString2(e,"limitprice","price",c));const w=this.safeString(e,"oflags","");let b=w.indexOf("post")>-1;const k=this.safeNumber(e,"price");if(void 0!==t&&(m=t.symbol,"fee"in e)){y={cost:this.safeString(e,"fee"),rate:void 0},w.indexOf("fciq")>=0?y.currency=t.quote:w.indexOf("fcib")>=0&&(y.currency=t.base)}const S=this.parseOrderStatus(this.safeString(e,"status"));let O=this.safeStringN(e,["id","txid","order_id","amend_id"]);if(void 0===O||O.startsWith("[")){const t=this.safeList(e,"txid");O=this.safeString(t,0)}const T=this.safeString(e,"userref"),P=this.safeString(e,"cl_ord_id",T),M=this.safeValue(e,"trades",[]),I=[];for(let e=0;e-1;if(b&&(void 0!==k||O)){s.volume=void 0===k&&void 0!==r?this.costToPrecision(t,this.numberToString(r)):this.costToPrecision(t,k);const e=void 0!==S?S+",viqc":"viqc";s.oflags=e}else!w||v||y||(s.price=this.priceToPrecision(t,a));const T=this.safeBool2(o,"reduceOnly","reduce_only");if(u)c?(s.price=this.priceToPrecision(t,d),s.ordertype=w?"stop-loss-limit":"stop-loss"):l&&(s.price=this.priceToPrecision(t,h),s.ordertype=w?"take-profit-limit":"take-profit"),w&&(s.price2=this.priceToPrecision(t,a));else if(v||y){let e;void 0!==p&&(e=p.endsWith("%")?"+"+p:"+"+p+"%");const t=void 0!==f?"+"+f:void 0,i=this.safeString(o,"offset","-"),r=void 0!==m?i+this.numberToString(m):void 0,a=this.safeString(o,"trigger","last");if(s.trigger=a,w||void 0!==m||void 0!==g)if(s.ordertype="trailing-stop-limit",void 0!==g){const t=g.endsWith("%")?i+g:i+g+"%";s.price=e,s.price2=t}else void 0!==m&&(s.price=t,s.price2=r);else s.ordertype="trailing-stop",s.price=void 0!==p?e:t}T&&(s.reduce_only="createOrderWs"===e||"true");let P=this.safeDict(o,"close");if(void 0!==P){P=this.extend({},P);const e=this.safeValue(P,"price");void 0!==e&&(P.price=this.priceToPrecision(t,e));const i=this.safeValue(P,"price2");void 0!==i&&(P.price2=this.priceToPrecision(t,i)),s.close=P}const M=this.safeString2(o,"timeInForce","timeinforce");void 0!==M&&(s.timeinforce=M);const I="market"===i;let x;if([x,o]=this.handlePostOnly(I,!1,o),x){const e=void 0!==S?S+",post":"post";s.oflags=e}return void 0===S||"oflags"in s||(s.oflags=S),[s,o=this.omit(o,["timeInForce","reduceOnly","stopLossPrice","takeProfitPrice","trailingAmount","trailingPercent","trailingLimitAmount","trailingLimitPercent","offset"])]}async editOrder(e,t,i,s,a=void 0,o=void 0,n={}){await this.loadMarkets();const d=this.market(t);if(!d.spot)throw new r.NotSupported(this.id+" editOrder() does not support "+d.type+" orders, only spot orders are accepted");let h={txid:e};const c=this.safeString2(n,"clientOrderId","cl_ord_id");void 0!==c&&(h.cl_ord_id=c,n=this.omit(n,["clientOrderId","cl_ord_id"]),h=this.omit(h,"txid"));const l="market"===i;let u;[u,n]=this.handlePostOnly(l,!1,n),u&&(h.post_only="true"),void 0!==a&&(h.order_qty=this.amountToPrecision(t,a)),void 0!==o&&(h.limit_price=this.priceToPrecision(t,o));let f=this.safeStringN(n,["stopLossPrice","takeProfitPrice","trailingAmount","trailingPercent","trailingLimitAmount","trailingLimitPercent"]);if(void 0!==f){const e=this.safeString(n,"offset");n=this.omit(n,["stopLossPrice","takeProfitPrice","trailingAmount","trailingPercent","trailingLimitAmount","trailingLimitPercent","offset"]),void 0!==e?(f=e+f,h.trigger_price=f):h.trigger_price=this.priceToPrecision(t,f)}const p=await this.privatePostAmendOrder(this.extend(h,n)),m=this.safeDict(p,"result",{});return this.parseOrder(m,d)}async fetchOrder(e,t=void 0,i={}){await this.loadMarkets();const s=this.safeValue2(i,"userref","clientOrderId"),a={trades:!0,txid:e};let o=i;void 0!==s&&(a.userref=s,o=this.omit(i,["userref","clientOrderId"]));const n=await this.privatePostQueryOrders(this.extend(a,o)),d=this.safeValue(n,"result",[]);if(!(e in d))throw new r.OrderNotFound(this.id+" fetchOrder() could not find order id "+e);return this.parseOrder(this.extend({id:e},d[e]))}async fetchOrderTrades(e,t=void 0,i=void 0,s=void 0,a={}){const o=this.safeValue(a,"trades"),n=[];if(void 0===o)throw new r.ArgumentsRequired(this.id+" fetchOrderTrades() requires a unified order structure in the params argument or a 'trades' param (an array of trade id strings)");for(let e=0;e=0)throw new r.OrderNotFound(this.id+" cancelOrder() error "+this.last_http_response);throw e}return this.safeOrder({info:s})}async cancelOrders(e,t=void 0,i={}){const s={orders:e},r=await this.privatePostCancelOrderBatch(this.extend(s,i));return[this.safeOrder({info:r})]}async cancelAllOrders(e=void 0,t={}){await this.loadMarkets();const i=await this.privatePostCancelAll(t);return[this.safeOrder({info:i})]}async cancelAllOrdersAfter(e,t={}){if(e>864e5)throw new r.BadRequest(this.id+" cancelAllOrdersAfter timeout should be less than 86400000 milliseconds");await this.loadMarkets();const i={timeout:e>0?this.parseToInt(e/1e3):0};return await this.privatePostCancelAllOrdersAfter(this.extend(i,t))}async fetchOpenOrders(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();const r={};void 0!==t&&(r.start=this.parseToInt(t/1e3));const a=this.safeInteger(s,"userref");void 0!==a&&(r.userref=a,s=this.omit(s,"userref"));const o=this.safeString(s,"clientOrderId");void 0!==o&&(r.cl_ord_id=o,s=this.omit(s,"clientOrderId"));const n=await this.privatePostOpenOrders(this.extend(r,s));let d;void 0!==e&&(d=this.market(e));const h=this.safeDict(n,"result",{}),c=this.safeDict(h,"open",{}),l=[],u=Object.keys(c);for(let e=0;e0){const e=i[s-1];e.next_cursor=t,i[s-1]=e}return i}async createDepositAddress(e,t={}){return await this.fetchDepositAddress(e,this.extend({new:"true"},t))}async fetchDepositMethods(e,t={}){await this.loadMarkets();const i={asset:this.currency(e).id},s=await this.privatePostDepositMethods(this.extend(i,t));return this.safeValue(s,"result")}async fetchDepositAddress(e,t={}){await this.loadMarkets();const i=this.currency(e);let s=this.safeStringUpper(t,"network");const a=this.safeValue(this.options,"networks",{});s=this.safeString(a,s,s),t=this.omit(t,"network"),"USDT"===e&&"TRC20"===s&&(e=e+"-"+s);const o=this.safeValue(this.options,"depositMethods",{}),n=this.safeString(o,e);let d=this.safeString(t,"method",n);if(void 0===d){const t=await this.fetchDepositMethods(e);if(void 0!==s)for(let e=0;e=0){d=i;break}}if(void 0===d){const e=this.safeValue(t,0,{});d=this.safeString(e,"method")}}const h={asset:i.id,method:d},c=await this.privatePostDepositAddresses(this.extend(h,t)),l=this.safeValue(c,"result",[]),u=this.safeValue(l,0,{});if(void 0===u)throw new r.InvalidAddress(this.id+" privatePostDepositAddresses() returned no addresses for "+e);return this.parseDepositAddress(u,i)}parseDepositAddress(e,t=void 0){const i=this.safeString(e,"address"),s=this.safeString(e,"tag"),r=(t=this.safeCurrency(void 0,t)).code;return this.checkAddress(i),{info:e,currency:r,network:void 0,address:i,tag:s}}async withdraw(e,t,i,s=void 0,a={}){if([s,a]=this.handleWithdrawTagAndParams(s,a),this.checkAddress(i),"key"in a){await this.loadMarkets();const s=this.currency(e),r={asset:s.id,amount:t,address:i},o=await this.privatePostWithdraw(this.extend(r,a)),n=this.safeDict(o,"result",{});return this.parseTransaction(n,s)}throw new r.ExchangeError(this.id+" withdraw() requires a 'key' parameter (withdrawal key name, as set up on your account)")}async fetchPositions(e=void 0,t={}){await this.loadMarkets();const i=await this.privatePostOpenPositions(this.extend({docalcs:"true",consolidation:"market"},t));e=this.marketSymbols(e);const s=this.safeList(i,"result"),r=this.parsePositions(s,e);return this.filterByArrayPositions(r,"symbol",e,!1)}parsePosition(e,t=void 0){const i=this.safeString(e,"pair"),s="buy"===this.safeString(e,"type")?"long":"short";return this.safePosition({info:e,id:void 0,symbol:this.safeSymbol(i,t),notional:void 0,marginMode:void 0,liquidationPrice:void 0,entryPrice:void 0,unrealizedPnl:this.safeNumber(e,"net"),realizedPnl:void 0,percentage:void 0,contracts:this.safeNumber(e,"vol"),contractSize:void 0,markPrice:void 0,lastPrice:void 0,side:s,hedged:void 0,timestamp:void 0,datetime:void 0,lastUpdateTimestamp:void 0,maintenanceMargin:void 0,maintenanceMarginPercentage:void 0,collateral:void 0,initialMargin:this.safeNumber(e,"margin"),initialMarginPercentage:void 0,leverage:this.safeNumber(e,"leverage"),marginRatio:void 0,stopLossPrice:void 0,takeProfitPrice:void 0})}parseAccountType(e){return this.safeString({spot:"Spot Wallet",swap:"Futures Wallet",future:"Futures Wallet"},e,e)}async transferOut(e,t,i={}){return await this.transfer(e,t,"spot","swap",i)}async transfer(e,t,i,s,a={}){await this.loadMarkets();const o=this.currency(e);i=this.parseAccountType(i),s=this.parseAccountType(s);const n={amount:this.currencyToPrecision(e,t),from:i,to:s,asset:o.id};if("Spot Wallet"!==i)throw new r.BadRequest(this.id+" transfer cannot transfer from "+i+" to "+s+". Use krakenfutures instead to transfer from the futures account.");const d=await this.privatePostWalletTransfer(this.extend(n,a)),h=this.parseTransfer(d,o);return this.extend(h,{amount:t,fromAccount:i,toAccount:s})}parseTransfer(e,t=void 0){const i=this.safeValue(e,"result",{});return{info:e,id:this.safeString(i,"refid"),timestamp:void 0,datetime:void 0,currency:this.safeString(t,"code"),amount:void 0,fromAccount:void 0,toAccount:void 0,status:"sucess"}}sign(e,t="public",i="GET",s={},r=void 0,a=void 0){let o="/"+this.version+"/"+t+"/"+e;if("public"===t)Object.keys(s).length&&(o+="?"+this.urlencodeNested(s));else if("private"===t){const t=this.safeString(s,"price");let i=!1;void 0!==t&&(i=!!t.endsWith("%"));const h="CancelOrderBatch"===e;this.checkRequiredCredentials();const c=this.nonce().toString();a=h||i?this.json(this.extend({nonce:c},s)):this.urlencodeNested(this.extend({nonce:c},s));const l=this.encode(c+a),u=this.hash(l,n.s,"binary"),f=this.encode(o),p=this.binaryConcat(f,u),m=this.base64ToBinary(this.secret),g=this.hmac(p,m,d.Zf,"base64");(r={"API-Key":this.apiKey,"API-Sign":g})["Content-Type"]=h||i?"application/json":"application/x-www-form-urlencoded"}else o="/"+e;return o=this.urls.api[t]+o,{url:o,method:i,body:a,headers:r}}nonce(){return this.milliseconds()-this.options.timeDifference}handleErrors(e,t,i,s,a,o,n,d,h){if(520===e)throw new r.ExchangeNotAvailable(this.id+" "+e.toString()+" "+t);if(void 0!==n&&"{"===o[0]&&"string"!=typeof n&&"error"in n){if(n.error.length){const e=this.id+" "+o;for(let t=0;t{i.d(t,{A:()=>h});var s=i(1359),r=i(1579),a=i(2079),o=i(5147),n=i(4852),d=i(7481);class h extends s.A{describe(){return this.deepExtend(super.describe(),{id:"krakenfutures",name:"Kraken Futures",countries:["US"],version:"v3",userAgent:void 0,rateLimit:600,pro:!0,has:{CORS:void 0,spot:!1,margin:!1,swap:!0,future:!0,option:!1,cancelAllOrders:!0,cancelAllOrdersAfter:!0,cancelOrder:!0,cancelOrders:!0,createMarketOrder:!1,createOrder:!0,createPostOnlyOrder:!0,createReduceOnlyOrder:!0,createStopLimitOrder:!0,createStopMarketOrder:!0,createStopOrder:!0,createTriggerOrder:!0,editOrder:!0,fetchBalance:!0,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchCanceledOrders:!0,fetchClosedOrders:!0,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchDepositAddress:!1,fetchDepositAddresses:!1,fetchDepositAddressesByNetwork:!1,fetchFundingHistory:void 0,fetchFundingRate:"emulated",fetchFundingRateHistory:!0,fetchFundingRates:!0,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchIsolatedPositions:!1,fetchLeverage:!0,fetchLeverages:!0,fetchLeverageTiers:!0,fetchMarketLeverageTiers:"emulated",fetchMarkets:!0,fetchMarkOHLCV:!0,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenOrders:!0,fetchOrder:!1,fetchOrderBook:!0,fetchOrders:!1,fetchPositions:!0,fetchPremiumIndexOHLCV:!1,fetchTickers:!0,fetchTrades:!0,sandbox:!0,setLeverage:!0,setMarginMode:!1,transfer:!0},urls:{test:{public:"https://demo-futures.kraken.com/derivatives/api/",private:"https://demo-futures.kraken.com/derivatives/api/",charts:"https://demo-futures.kraken.com/api/charts/",history:"https://demo-futures.kraken.com/api/history/",www:"https://demo-futures.kraken.com"},logo:"https://user-images.githubusercontent.com/24300605/81436764-b22fd580-9172-11ea-9703-742783e6376d.jpg",api:{charts:"https://futures.kraken.com/api/charts/",history:"https://futures.kraken.com/api/history/",feeschedules:"https://futures.kraken.com/api/feeschedules/",public:"https://futures.kraken.com/derivatives/api/",private:"https://futures.kraken.com/derivatives/api/"},www:"https://futures.kraken.com/",doc:["https://docs.kraken.com/api/docs/futures-api/trading/market-data/"],fees:"https://support.kraken.com/hc/en-us/articles/360022835771-Transaction-fees-and-rebates-for-Kraken-Futures",referral:void 0},api:{public:{get:["feeschedules","instruments","orderbook","tickers","history","historicalfundingrates"]},private:{get:["feeschedules/volumes","openpositions","notifications","accounts","openorders","recentorders","fills","transfers","leveragepreferences","pnlpreferences","assignmentprogram/current","assignmentprogram/history"],post:["sendorder","editorder","cancelorder","transfer","batchorder","cancelallorders","cancelallordersafter","withdrawal","assignmentprogram/add","assignmentprogram/delete"],put:["leveragepreferences","pnlpreferences"]},charts:{get:["{price_type}/{symbol}/{interval}"]},history:{get:["orders","executions","triggers","accountlogcsv","account-log","market/{symbol}/orders","market/{symbol}/executions"]}},fees:{trading:{tierBased:!0,percentage:!0,taker:this.parseNumber("0.0005"),maker:this.parseNumber("0.0002"),tiers:{taker:[[this.parseNumber("0"),this.parseNumber("0.0005")],[this.parseNumber("100000"),this.parseNumber("0.0004")],[this.parseNumber("1000000"),this.parseNumber("0.0003")],[this.parseNumber("5000000"),this.parseNumber("0.00025")],[this.parseNumber("10000000"),this.parseNumber("0.0002")],[this.parseNumber("20000000"),this.parseNumber("0.00015")],[this.parseNumber("50000000"),this.parseNumber("0.000125")],[this.parseNumber("100000000"),this.parseNumber("0.0001")]],maker:[[this.parseNumber("0"),this.parseNumber("0.0002")],[this.parseNumber("100000"),this.parseNumber("0.0015")],[this.parseNumber("1000000"),this.parseNumber("0.000125")],[this.parseNumber("5000000"),this.parseNumber("0.0001")],[this.parseNumber("10000000"),this.parseNumber("0.000075")],[this.parseNumber("20000000"),this.parseNumber("0.00005")],[this.parseNumber("50000000"),this.parseNumber("0.000025")],[this.parseNumber("100000000"),this.parseNumber("0")]]}}},exceptions:{exact:{apiLimitExceeded:a.RateLimitExceeded,marketUnavailable:a.ContractUnavailable,requiredArgumentMissing:a.BadRequest,unavailable:a.ExchangeNotAvailable,authenticationError:a.AuthenticationError,accountInactive:a.ExchangeError,invalidAccount:a.BadRequest,invalidAmount:a.BadRequest,insufficientFunds:a.InsufficientFunds,"Bad Request":a.BadRequest,Unavailable:a.ExchangeNotAvailable,invalidUnit:a.BadRequest,"Json Parse Error":a.ExchangeError,nonceBelowThreshold:a.InvalidNonce,nonceDuplicate:a.InvalidNonce,notFound:a.BadRequest,"Server Error":a.ExchangeError,unknownError:a.ExchangeError},broad:{invalidArgument:a.BadRequest,nonceBelowThreshold:a.InvalidNonce,nonceDuplicate:a.InvalidNonce}},precisionMode:r.kb,options:{access:{history:{GET:{orders:"private",executions:"private",triggers:"private",accountlogcsv:"private","account-log":"private"}}},settlementCurrencies:{flex:["USDT","BTC","USD","GBP","EUR","USDC"]},symbol:{quoteIds:["USD","XBT"],reversed:!1},versions:{public:{GET:{historicalfundingrates:"v4"}},charts:{GET:{"{price_type}/{symbol}/{interval}":"v1"}},history:{GET:{orders:"v2",executions:"v2",triggers:"v2",accountlogcsv:"v2"}}},fetchTrades:{method:"historyGetMarketSymbolExecutions"}},features:{default:{sandbox:!0,createOrder:{marginMode:!1,triggerPrice:!0,triggerPriceType:{last:!0,mark:!0,index:!0},triggerDirection:!1,stopLossPrice:!0,takeProfitPrice:!0,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!0,FOK:!0,PO:!0,GTD:!1},hedged:!1,trailing:!1,leverage:!1,marketBuyByCost:!1,marketBuyRequiresPrice:!1,selfTradePrevention:!1,iceberg:!1},createOrders:{max:100},fetchMyTrades:{marginMode:!1,limit:void 0,daysBack:void 0,untilDays:1e5,symbolRequired:!1},fetchOrder:void 0,fetchOpenOrders:{marginMode:!1,limit:void 0,trigger:!1,trailing:!1,symbolRequired:!1},fetchOrders:void 0,fetchClosedOrders:{marginMode:!1,limit:void 0,daysBack:void 0,daysBackCanceled:void 0,untilDays:void 0,trigger:!1,trailing:!1,symbolRequired:!1},fetchOHLCV:{limit:5e3}},spot:void 0,swap:{linear:{extends:"default"},inverse:{extends:"default"}},future:{linear:{extends:"default"},inverse:{extends:"default"}}},timeframes:{"1m":"1m","5m":"5m","15m":"15m","30m":"30m","1h":"1h","4h":"4h","12h":"12h","1d":"1d","1w":"1w"}})}async fetchMarkets(e={}){const t=await this.publicGetInstruments(e),i=this.safeValue(t,"instruments",[]),s=[];for(let e=0;e=0;let d,h,c;if(n)o="index";else{d=a.indexOf("_vanilla")>=0,h=!d;const e=this.safeString(t,"lastTradingTime");o=void 0===e?"swap":"future",c=this.parse8601(e)}const l="swap"===o,u="future"===o;let f=r;const p=r.split("_"),m=this.safeString(p,1),g=m.slice(0,m.length-3),v="usd",y=this.safeCurrencyCode(g),w=this.safeCurrencyCode(v);let b,k;const S=this.safeString(t,"contractValueTradePrecision"),O=this.parseNumber(this.integerPrecisionToAmount(S)),T=this.safeNumber(t,"tickSize"),P=l||u||n;if(l||u){"futures_inverse"===this.safeString(t,"type")?(b=y,k=g,h=!0):(b=w,k=v,h=!1),d=!h,f=y+"/"+w+":"+b,u&&(f=f+"-"+this.yymmdd(c))}s.push({id:r,symbol:f,base:y,quote:w,settle:b,baseId:g,quoteId:v,settleId:k,type:o,spot:!1,margin:!1,swap:l,future:u,option:!1,index:n,active:void 0,contract:P,linear:d,inverse:h,contractSize:this.safeNumber(t,"contractSize"),maintenanceMarginRate:void 0,expiry:c,expiryDatetime:this.iso8601(c),strike:void 0,optionType:void 0,precision:{amount:O,price:T},limits:{leverage:{min:void 0,max:void 0},amount:{min:void 0,max:void 0},price:{min:void 0,max:void 0},cost:{min:void 0,max:void 0}},created:this.parse8601(this.safeString(t,"openingDate")),info:t})}const r=this.options.settlementCurrencies.flex,a=[];for(let e=0;e=0?m="taker":g.indexOf("maker")>=0&&(m="maker"));if("takerOrder"in e){i=this.safeInteger(e,"timestamp");const t=this.safeDict(e,"takerOrder",{});void 0!==t&&(c=this.safeStringLower(t,"direction"),m="taker")}return this.safeTrade({info:e,id:a,symbol:this.safeString(t,"symbol"),timestamp:i,datetime:this.iso8601(i),order:d,type:n,side:c,takerOrMaker:m,price:s,amount:p?r:void 0,cost:f,fee:void 0})}createOrderRequest(e,t,i,s,r=void 0,a={}){const o=this.market(e);e=o.symbol,t=this.safeString(a,"orderType",t);const n=this.safeString(a,"timeInForce");let d=!1;[d,a]=this.handlePostOnly("market"===t,"post"===t,a),d?t="post":"ioc"===n?t="ioc":"limit"===t?t="lmt":"market"===t&&(t="mkt");const h={symbol:o.id,side:i,size:this.amountToPrecision(e,s)},c=this.safeString2(a,"clientOrderId","cliOrdId");void 0!==c&&(h.cliOrdId=c);const l=this.safeString2(a,"triggerPrice","stopPrice"),u=void 0!==l,f=this.safeString(a,"stopLossPrice"),p=this.safeString(a,"takeProfitPrice"),m=void 0!==f,g=void 0!==p,v=m||g,y=this.safeString(a,"triggerSignal","last");let w=this.safeValue(a,"reduceOnly");return(v||u)&&(h.triggerSignal=y),u?(t="stp",h.stopPrice=this.priceToPrecision(e,l)):v&&(w=!0,m?(t="stp",h.stopPrice=this.priceToPrecision(e,f)):g&&(t="take_profit",h.stopPrice=this.priceToPrecision(e,p))),w&&(h.reduceOnly=!0),h.orderType=t,void 0!==r&&(h.limitPrice=this.priceToPrecision(e,r)),a=this.omit(a,["clientOrderId","timeInForce","triggerPrice","stopLossPrice","takeProfitPrice"]),this.extend(h,a)}async createOrder(e,t,i,s,r=void 0,a={}){await this.loadMarkets();const o=this.market(e),n=this.createOrderRequest(e,t,i,s,r,a),d=await this.privatePostSendorder(n),h=this.safeValue(d,"sendStatus"),c=this.safeString(h,"status");return this.verifyOrderActionSuccess(c,"createOrder",["filled"]),this.parseOrder(h,o)}async createOrders(e,t={}){await this.loadMarkets();const i=[];for(let s=0;s0)for(let e=0;e0?this.parseToInt(e/1e3):0};return await this.privatePostCancelallordersafter(this.extend(i,t))}async fetchOpenOrders(e=void 0,t=void 0,i=void 0,s={}){let r;await this.loadMarkets(),void 0!==e&&(r=this.market(e));const a=await this.privateGetOpenorders(s),o=this.safeList(a,"openOrders",[]);return this.parseOrders(o,r,t,i)}async fetchClosedOrders(e=void 0,t=void 0,i=void 0,s={}){let r;await this.loadMarkets(),void 0!==e&&(r=this.market(e));const a={};void 0!==i&&(a.count=i),void 0!==t&&(a.from=t);const o=await this.historyGetOrders(this.extend(a,s)),n=this.safeList(o,"elements",[]),d=[];for(let e=0;e0){let e="0.0";for(let t=0;t1)continue;const c=this.account();if(i)c.total=this.safeString(d,"quantity"),c.free=this.safeString(d,"available");else if(s)c.used="0.0",c.total=d;else{const t=this.safeValue(e,"auxiliary");c.free=this.safeString(t,"af"),c.total=this.safeString(t,"pv")}a[h]=c}return this.safeBalance(a)}async fetchFundingRates(e=void 0,t={}){await this.loadMarkets();const i=this.marketIds(e),s=await this.publicGetTickers(t),r=this.safeList(s,"tickers",[]),a=[];for(let e=0;e{i.d(t,{A:()=>d});var s=i(3548),r=i(2079),a=i(5147),o=i(1579),n=i(4852);class d extends s.A{describe(){return this.deepExtend(super.describe(),{id:"kucoin",name:"KuCoin",countries:["SC"],rateLimit:10,version:"v2",certified:!0,pro:!0,comment:"Platform 2.0",quoteJsonNumbers:!1,has:{CORS:void 0,spot:!0,margin:!0,swap:!1,future:!1,option:!1,borrowCrossMargin:!0,borrowIsolatedMargin:!0,cancelAllOrders:!0,cancelOrder:!0,closeAllPositions:!1,closePosition:!1,createDepositAddress:!0,createMarketBuyOrderWithCost:!0,createMarketOrderWithCost:!0,createMarketSellOrderWithCost:!0,createOrder:!0,createOrders:!0,createPostOnlyOrder:!0,createStopLimitOrder:!0,createStopMarketOrder:!0,createStopOrder:!0,createTriggerOrder:!0,editOrder:!0,fetchAccounts:!0,fetchBalance:!0,fetchBorrowInterest:!0,fetchBorrowRateHistories:!0,fetchBorrowRateHistory:!0,fetchClosedOrders:!0,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!0,fetchDepositAddress:!0,fetchDepositAddresses:!1,fetchDepositAddressesByNetwork:!0,fetchDeposits:!0,fetchDepositWithdrawFee:!0,fetchDepositWithdrawFees:!0,fetchFundingHistory:!1,fetchFundingRate:!1,fetchFundingRateHistory:!1,fetchFundingRates:!1,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchL3OrderBook:!0,fetchLedger:!0,fetchLeverageTiers:!1,fetchMarginAdjustmentHistory:!1,fetchMarginMode:!1,fetchMarketLeverageTiers:!1,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMarkPrice:!0,fetchMarkPrices:!0,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenInterest:!1,fetchOpenInterestHistory:!1,fetchOpenOrders:!0,fetchOrder:!0,fetchOrderBook:!0,fetchOrderBooks:!1,fetchOrdersByStatus:!0,fetchOrderTrades:!0,fetchPositionHistory:!1,fetchPositionMode:!1,fetchPositionsHistory:!1,fetchPremiumIndexOHLCV:!1,fetchStatus:!0,fetchTicker:!0,fetchTickers:!0,fetchTime:!0,fetchTrades:!0,fetchTradingFee:!0,fetchTradingFees:!1,fetchTransactionFee:!0,fetchTransfers:!1,fetchWithdrawals:!0,repayCrossMargin:!0,repayIsolatedMargin:!0,setLeverage:!0,setMarginMode:!1,setPositionMode:!1,signIn:!1,transfer:!0,withdraw:!0},urls:{logo:"https://user-images.githubusercontent.com/51840849/87295558-132aaf80-c50e-11ea-9801-a2fb0c57c799.jpg",referral:"https://www.kucoin.com/ucenter/signup?rcode=E5wkqe",api:{public:"https://api.kucoin.com",private:"https://api.kucoin.com",futuresPrivate:"https://api-futures.kucoin.com",futuresPublic:"https://api-futures.kucoin.com",webExchange:"https://kucoin.com/_api",broker:"https://api-broker.kucoin.com",earn:"https://api.kucoin.com"},www:"https://www.kucoin.com",doc:["https://docs.kucoin.com"]},requiredCredentials:{apiKey:!0,secret:!0,password:!0},api:{public:{get:{currencies:4.5,"currencies/{currency}":4.5,symbols:6,"market/orderbook/level1":3,"market/allTickers":22.5,"market/stats":22.5,markets:4.5,"market/orderbook/level{level}_{limit}":6,"market/orderbook/level2_20":3,"market/orderbook/level2_100":6,"market/histories":4.5,"market/candles":4.5,prices:4.5,timestamp:4.5,status:4.5,"mark-price/{symbol}/current":3,"mark-price/all-symbols":3,"margin/config":25,announcements:20},post:{"bullet-public":15}},private:{get:{"user-info":30,accounts:7.5,"accounts/{accountId}":7.5,"accounts/ledgers":3,"hf/accounts/ledgers":2,"hf/margin/account/ledgers":2,"transaction-history":3,"sub/user":30,"sub-accounts/{subUserId}":22.5,"sub-accounts":30,"sub/api-key":30,"margin/account":40,"margin/accounts":15,"isolated/accounts":15,"deposit-addresses":7.5,deposits:7.5,"hist-deposits":7.5,withdrawals:30,"hist-withdrawals":30,"withdrawals/quotas":30,"accounts/transferable":30,"transfer-list":30,"base-fee":3,"trade-fees":3,"market/orderbook/level{level}":3,"market/orderbook/level2":3,"market/orderbook/level3":3,"hf/accounts/opened":2,"hf/orders/active":2,"hf/orders/active/symbols":2,"hf/margin/order/active/symbols":2,"hf/orders/done":2,"hf/orders/{orderId}":2,"hf/orders/client-order/{clientOid}":2,"hf/orders/dead-cancel-all/query":2,"hf/fills":2,orders:2,"limit/orders":3,"orders/{orderId}":2,"order/client-order/{clientOid}":3,fills:10,"limit/fills":20,"stop-order":8,"stop-order/{orderId}":3,"stop-order/queryOrderByClientOid":3,"oco/order/{orderId}":2,"oco/order/details/{orderId}":2,"oco/client-order/{clientOid}":2,"oco/orders":2,"hf/margin/orders/active":4,"hf/margin/orders/done":10,"hf/margin/orders/{orderId}":4,"hf/margin/orders/client-order/{clientOid}":5,"hf/margin/fills":5,"etf/info":25,"margin/currencies":20,"risk/limit/strategy":20,"isolated/symbols":20,"margin/symbols":5,"isolated/account/{symbol}":50,"margin/borrow":15,"margin/repay":15,"margin/interest":20,"project/list":10,"project/marketInterestRate":7.5,"redeem/orders":10,"purchase/orders":10,"broker/api/rebase/download":3,"migrate/user/account/status":3,"affiliate/inviter/statistics":30},post:{"sub/user/created":22.5,"sub/api-key":30,"sub/api-key/update":45,"deposit-addresses":30,withdrawals:7.5,"accounts/universal-transfer":6,"accounts/sub-transfer":45,"accounts/inner-transfer":15,"transfer-out":30,"transfer-in":30,"hf/orders":1,"hf/orders/test":1,"hf/orders/sync":1,"hf/orders/multi":1,"hf/orders/multi/sync":1,"hf/orders/alter":3,"hf/orders/dead-cancel-all":2,orders:2,"orders/test":2,"orders/multi":3,"stop-order":2,"oco/order":2,"hf/margin/order":5,"hf/margin/order/test":5,"margin/order":5,"margin/order/test":5,"margin/borrow":15,"margin/repay":10,purchase:15,redeem:15,"lend/purchase/update":10,"bullet-private":10,"position/update-user-leverage":5,"deposit-address/create":20},delete:{"sub/api-key":45,"withdrawals/{withdrawalId}":30,"hf/orders/{orderId}":1,"hf/orders/sync/{orderId}":1,"hf/orders/client-order/{clientOid}":1,"hf/orders/sync/client-order/{clientOid}":1,"hf/orders/cancel/{orderId}":2,"hf/orders":2,"hf/orders/cancelAll":30,"orders/{orderId}":3,"order/client-order/{clientOid}":5,orders:20,"stop-order/{orderId}":3,"stop-order/cancelOrderByClientOid":5,"stop-order/cancel":3,"oco/order/{orderId}":3,"oco/client-order/{clientOid}":3,"oco/orders":3,"hf/margin/orders/{orderId}":5,"hf/margin/orders/client-order/{clientOid}":5,"hf/margin/orders":10}},futuresPublic:{get:{"contracts/active":4.5,"contracts/{symbol}":4.5,ticker:3,"level2/snapshot":4.5,"level2/depth20":7.5,"level2/depth100":15,"trade/history":7.5,"kline/query":4.5,"interest/query":7.5,"index/query":3,"mark-price/{symbol}/current":4.5,"premium/query":4.5,"trade-statistics":4.5,"funding-rate/{symbol}/current":3,"contract/funding-rates":7.5,timestamp:3,status:6,"level2/message/query":1.3953},post:{"bullet-public":15}},futuresPrivate:{get:{"transaction-history":3,"account-overview":7.5,"account-overview-all":9,"transfer-list":30,orders:3,stopOrders:9,recentDoneOrders:7.5,"orders/{orderId}":7.5,"orders/byClientOid":7.5,fills:7.5,recentFills:4.5,openOrderStatistics:15,position:3,positions:3,"margin/maxWithdrawMargin":15,"contracts/risk-limit/{symbol}":7.5,"funding-history":7.5},post:{"transfer-out":30,"transfer-in":30,orders:3,"orders/test":3,"orders/multi":4.5,"position/margin/auto-deposit-status":6,"margin/withdrawMargin":15,"position/margin/deposit-margin":6,"position/risk-limit-level/change":6,"bullet-private":15},delete:{"orders/{orderId}":1.5,"orders/client-order/{clientOid}":1.5,orders:45,stopOrders:22.5}},webExchange:{get:{"currency/currency/chain-info":1}},broker:{get:{"broker/nd/info":2,"broker/nd/account":2,"broker/nd/account/apikey":2,"broker/nd/rebase/download":3,"asset/ndbroker/deposit/list":1,"broker/nd/transfer/detail":1,"broker/nd/deposit/detail":1,"broker/nd/withdraw/detail":1},post:{"broker/nd/transfer":1,"broker/nd/account":3,"broker/nd/account/apikey":3,"broker/nd/account/update-apikey":3},delete:{"broker/nd/account/apikey":3}},earn:{get:{"otc-loan/loan":1,"otc-loan/accounts":1,"earn/redeem-preview":7.5,"earn/saving/products":7.5,"earn/hold-assets":7.5,"earn/promotion/products":7.5,"earn/kcs-staking/products":7.5,"earn/staking/products":7.5,"earn/eth-staking/products":7.5},post:{"earn/orders":7.5},delete:{"earn/orders":7.5}}},timeframes:{"1m":"1min","3m":"3min","5m":"5min","15m":"15min","30m":"30min","1h":"1hour","2h":"2hour","4h":"4hour","6h":"6hour","8h":"8hour","12h":"12hour","1d":"1day","1w":"1week","1M":"1month"},precisionMode:o.kb,exceptions:{exact:{"The order does not exist.":r.OrderNotFound,"order not exist":r.OrderNotFound,"order not exist.":r.OrderNotFound,order_not_exist:r.OrderNotFound,order_not_exist_or_not_allow_to_cancel:r.InvalidOrder,"Order size below the minimum requirement.":r.InvalidOrder,"The withdrawal amount is below the minimum requirement.":r.ExchangeError,"Unsuccessful! Exceeded the max. funds out-transfer limit":r.InsufficientFunds,"The amount increment is invalid.":r.BadRequest,"The quantity is below the minimum requirement.":r.InvalidOrder,400:r.BadRequest,401:r.AuthenticationError,403:r.NotSupported,404:r.NotSupported,405:r.NotSupported,415:r.NotSupported,429:r.RateLimitExceeded,500:r.ExchangeNotAvailable,503:r.ExchangeNotAvailable,101030:r.PermissionDenied,103e3:r.InvalidOrder,130101:r.BadRequest,130102:r.ExchangeError,130103:r.OrderNotFound,130104:r.ExchangeError,130105:r.InsufficientFunds,130106:r.NotSupported,130107:r.ExchangeError,130108:r.OrderNotFound,130201:r.PermissionDenied,130202:r.ExchangeError,130203:r.InsufficientFunds,130204:r.BadRequest,130301:r.InsufficientFunds,130302:r.PermissionDenied,130303:r.NotSupported,130304:r.NotSupported,130305:r.NotSupported,130306:r.NotSupported,130307:r.NotSupported,130308:r.InvalidOrder,130309:r.InvalidOrder,130310:r.ExchangeError,130311:r.InvalidOrder,130312:r.InvalidOrder,130313:r.InvalidOrder,130314:r.InvalidOrder,130315:r.NotSupported,126e3:r.ExchangeError,126001:r.NotSupported,126002:r.ExchangeError,126003:r.InvalidOrder,126004:r.ExchangeError,126005:r.PermissionDenied,126006:r.ExchangeError,126007:r.ExchangeError,126009:r.ExchangeError,126010:r.ExchangeError,126011:r.ExchangeError,126013:r.InsufficientFunds,126015:r.ExchangeError,126021:r.NotSupported,126022:r.InvalidOrder,126027:r.InvalidOrder,126028:r.InvalidOrder,126029:r.InvalidOrder,126030:r.InvalidOrder,126033:r.InvalidOrder,126034:r.InvalidOrder,126036:r.InvalidOrder,126037:r.ExchangeError,126038:r.ExchangeError,126039:r.ExchangeError,126041:r.ExchangeError,126042:r.ExchangeError,126043:r.OrderNotFound,126044:r.InvalidOrder,126045:r.NotSupported,126046:r.NotSupported,126047:r.PermissionDenied,126048:r.PermissionDenied,135005:r.ExchangeError,135018:r.ExchangeError,200004:r.InsufficientFunds,210014:r.InvalidOrder,210021:r.InsufficientFunds,230003:r.InsufficientFunds,26e4:r.InvalidAddress,260100:r.InsufficientFunds,3e5:r.InvalidOrder,4e5:r.BadSymbol,400001:r.AuthenticationError,400002:r.InvalidNonce,400003:r.AuthenticationError,400004:r.AuthenticationError,400005:r.AuthenticationError,400006:r.AuthenticationError,400007:r.AuthenticationError,400008:r.NotSupported,400100:r.InsufficientFunds,400200:r.InvalidOrder,400330:r.InvalidOrder,400350:r.InvalidOrder,400370:r.InvalidOrder,400400:r.BadRequest,400401:r.AuthenticationError,400500:r.InvalidOrder,400600:r.BadSymbol,400760:r.InvalidOrder,401e3:r.BadRequest,408e3:r.BadRequest,411100:r.AccountSuspended,415e3:r.BadRequest,400303:r.PermissionDenied,5e5:r.ExchangeNotAvailable,260220:r.InvalidAddress,600100:r.InsufficientFunds,600101:r.InvalidOrder,900014:r.BadRequest},broad:{"Exceeded the access frequency":r.RateLimitExceeded,"require more permission":r.PermissionDenied}},fees:{trading:{tierBased:!0,percentage:!0,taker:this.parseNumber("0.001"),maker:this.parseNumber("0.001"),tiers:{taker:[[this.parseNumber("0"),this.parseNumber("0.001")],[this.parseNumber("50"),this.parseNumber("0.001")],[this.parseNumber("200"),this.parseNumber("0.0009")],[this.parseNumber("500"),this.parseNumber("0.0008")],[this.parseNumber("1000"),this.parseNumber("0.0007")],[this.parseNumber("2000"),this.parseNumber("0.0007")],[this.parseNumber("4000"),this.parseNumber("0.0006")],[this.parseNumber("8000"),this.parseNumber("0.0005")],[this.parseNumber("15000"),this.parseNumber("0.00045")],[this.parseNumber("25000"),this.parseNumber("0.0004")],[this.parseNumber("40000"),this.parseNumber("0.00035")],[this.parseNumber("60000"),this.parseNumber("0.0003")],[this.parseNumber("80000"),this.parseNumber("0.00025")]],maker:[[this.parseNumber("0"),this.parseNumber("0.001")],[this.parseNumber("50"),this.parseNumber("0.0009")],[this.parseNumber("200"),this.parseNumber("0.0007")],[this.parseNumber("500"),this.parseNumber("0.0005")],[this.parseNumber("1000"),this.parseNumber("0.0003")],[this.parseNumber("2000"),this.parseNumber("0")],[this.parseNumber("4000"),this.parseNumber("0")],[this.parseNumber("8000"),this.parseNumber("0")],[this.parseNumber("15000"),this.parseNumber("-0.00005")],[this.parseNumber("25000"),this.parseNumber("-0.00005")],[this.parseNumber("40000"),this.parseNumber("-0.00005")],[this.parseNumber("60000"),this.parseNumber("-0.00005")],[this.parseNumber("80000"),this.parseNumber("-0.00005")]]}},funding:{tierBased:!1,percentage:!1,withdraw:{},deposit:{}}},commonCurrencies:{BIFI:"BIFIF",VAI:"VAIOT",WAX:"WAXP",ALT:"APTOSLAUNCHTOKEN",KALT:"ALT",FUD:"FTX Users' Debt"},options:{hf:void 0,version:"v1",symbolSeparator:"-",fetchMyTradesMethod:"private_get_fills",timeDifference:0,adjustForTimeDifference:!1,fetchCurrencies:{webApiEnable:!0,webApiRetries:1,webApiMuteFailure:!0},fetchMarkets:{fetchTickersFees:!0},withdraw:{includeFee:!1},versions:{public:{GET:{currencies:"v3","currencies/{currency}":"v3",symbols:"v2","mark-price/all-symbols":"v3",announcements:"v3"}},private:{GET:{"user-info":"v2","hf/margin/account/ledgers":"v3","sub/user":"v2","sub-accounts":"v2","margin/accounts":"v3","isolated/accounts":"v3","deposit-addresses":"v1","market/orderbook/level2":"v3","market/orderbook/level3":"v3","market/orderbook/level{level}":"v3","oco/order/{orderId}":"v3","oco/order/details/{orderId}":"v3","oco/client-order/{clientOid}":"v3","oco/orders":"v3","hf/margin/orders/active":"v3","hf/margin/order/active/symbols":"v3","hf/margin/orders/done":"v3","hf/margin/orders/{orderId}":"v3","hf/margin/orders/client-order/{clientOid}":"v3","hf/margin/fills":"v3","etf/info":"v3","margin/currencies":"v3","margin/borrow":"v3","margin/repay":"v3","margin/interest":"v3","project/list":"v3","project/marketInterestRate":"v3","redeem/orders":"v3","purchase/orders":"v3","migrate/user/account/status":"v3","margin/symbols":"v3","affiliate/inviter/statistics":"v2","asset/ndbroker/deposit/list":"v1"},POST:{"sub/user/created":"v2","accounts/universal-transfer":"v3","accounts/sub-transfer":"v2","accounts/inner-transfer":"v2","transfer-out":"v3","deposit-address/create":"v3","oco/order":"v3","hf/margin/order":"v3","hf/margin/order/test":"v3","margin/borrow":"v3","margin/repay":"v3",purchase:"v3",redeem:"v3","lend/purchase/update":"v3","position/update-user-leverage":"v3",withdrawals:"v3"},DELETE:{"hf/margin/orders/{orderId}":"v3","hf/margin/orders/client-order/{clientOid}":"v3","hf/margin/orders":"v3","oco/order/{orderId}":"v3","oco/client-order/{clientOid}":"v3","oco/orders":"v3"}},futuresPrivate:{POST:{"transfer-out":"v3"}}},partner:{spot:{id:"ccxt",key:"9e58cc35-5b5e-4133-92ec-166e3f077cb8"},future:{id:"ccxtfutures",key:"1b327198-f30c-4f14-a0ac-918871282f15"}},accountsByType:{spot:"trade",margin:"margin",cross:"margin",isolated:"isolated",main:"main",funding:"main",future:"contract",swap:"contract",mining:"pool",hf:"trade_hf"},networks:{BRC20:"btc",BTCNATIVESEGWIT:"bech32",ERC20:"eth",TRC20:"trx",HRC20:"heco",MATIC:"matic",KCC:"kcc",SOL:"sol",ALGO:"algo",EOS:"eos",BEP20:"bsc",BEP2:"bnb",ARBONE:"arbitrum",AVAXX:"avax",AVAXC:"avaxc",TLOS:"tlos",CFX:"cfx",ACA:"aca",OPTIMISM:"optimism",ONT:"ont",GLMR:"glmr",CSPR:"cspr",KLAY:"klay",XRD:"xrd",RVN:"rvn",NEAR:"near",APT:"aptos",ETHW:"ethw",TON:"ton",BCH:"bch",BSV:"bchsv",BCHA:"bchabc",OSMO:"osmo",NANO:"nano",XLM:"xlm",VET:"vet",IOST:"iost",ZIL:"zil",XRP:"xrp",TOMO:"tomo",XMR:"xmr",COTI:"coti",XTZ:"xtz",ADA:"ada",WAX:"waxp",THETA:"theta",ONE:"one",IOTEX:"iotx",NULS:"nuls",KSM:"ksm",LTC:"ltc",WAVES:"waves",DOT:"dot",STEEM:"steem",QTUM:"qtum",DOGE:"doge",FIL:"fil",XYM:"xym",FLUX:"flux",ATOM:"atom",XDC:"xdc",KDA:"kda",ICP:"icp",CELO:"celo",LSK:"lsk",VSYS:"vsys",KAR:"kar",XCH:"xch",FLOW:"flow",BAND:"band",EGLD:"egld",HBAR:"hbar",XPR:"xpr",AR:"ar",FTM:"ftm",KAVA:"kava",KMA:"kma",XEC:"xec",IOTA:"iota",HNT:"hnt",ASTR:"astr",PDEX:"pdex",METIS:"metis",ZEC:"zec",POKT:"pokt",OASYS:"oas",OASIS:"oasis",ETC:"etc",AKT:"akt",FSN:"fsn",SCRT:"scrt",CFG:"cfg",ICX:"icx",KMD:"kmd",NEM:"NEM",STX:"stx",DGB:"dgb",DCR:"dcr",CKB:"ckb",ELA:"ela",HYDRA:"hydra",BTM:"btm",KARDIA:"kai",SXP:"sxp",NEBL:"nebl",ZEN:"zen",SDN:"sdn",LTO:"lto",WEMIX:"wemix",EVER:"ever",BNC:"bnc",BNCDOT:"bncdot",AION:"aion",GRIN:"grin",LOKI:"loki",QKC:"qkc",TT:"TT",PIVX:"pivx",SERO:"sero",METER:"meter",STATEMINE:"statemine",DVPN:"dvpn",XPRT:"xprt",MOVR:"movr",ERGO:"ergo",ABBC:"abbc",DIVI:"divi",PURA:"pura",DFI:"dfi",NEON3:"neon3",DOCK:"dock",TRUE:"true",CS:"cs",ORAI:"orai",BASE:"base",TARA:"tara"},marginModes:{cross:"MARGIN_TRADE",isolated:"MARGIN_ISOLATED_TRADE",spot:"TRADE"}},features:{spot:{sandbox:!1,createOrder:{marginMode:!0,triggerPrice:!0,triggerPriceType:void 0,triggerDirection:!1,stopLossPrice:!0,takeProfitPrice:!0,attachedStopLossTakeProfit:void 0,timeInForce:{IOC:!0,FOK:!0,PO:!0,GTD:!0},hedged:!1,trailing:!1,leverage:!1,marketBuyByCost:!0,marketBuyRequiresPrice:!1,selfTradePrevention:!0,iceberg:!0},createOrders:{max:5},fetchMyTrades:{marginMode:!0,limit:void 0,daysBack:void 0,untilDays:7,symbolRequired:!0},fetchOrder:{marginMode:!1,trigger:!0,trailing:!1,symbolRequired:!0},fetchOpenOrders:{marginMode:!0,limit:500,trigger:!0,trailing:!1,symbolRequired:!0},fetchOrders:void 0,fetchClosedOrders:{marginMode:!0,limit:500,daysBack:void 0,daysBackCanceled:void 0,untilDays:7,trigger:!0,trailing:!1,symbolRequired:!0},fetchOHLCV:{limit:1500}},swap:{linear:void 0,inverse:void 0},future:{linear:void 0,inverse:void 0}}})}nonce(){return this.milliseconds()-this.options.timeDifference}async fetchTime(e={}){const t=await this.publicGetTimestamp(e);return this.safeInteger(t,"data")}async fetchStatus(e={}){const t=await this.publicGetStatus(e),i=this.safeDict(t,"data",{});return{status:"open"===this.safeString(i,"status")?"ok":"maintenance",updated:void 0,eta:void 0,url:void 0,info:t}}async fetchMarkets(e={}){let t;[t,e]=this.handleOptionAndParams(e,"fetchMarkets","fetchTickersFees",!0);const i=[];i.push(this.publicGetSymbols(e));const s=this.checkRequiredCredentials(!1),r=s&&this.safeBool(e,"marginables",!0);r&&(i.push(this.privateGetMarginSymbols(e)),i.push(this.privateGetIsolatedSymbols(e))),t&&i.push(this.publicGetMarketAllTickers(e)),s&&i.push(this.loadMigrationStatus());const o=await Promise.all(i),n=this.safeList(o[0],"data"),d=r?this.safeDict(o[1],"data",{}):{},h=this.safeList(d,"items",[]),c=this.indexBy(h,"symbol"),l=r?o[2]:{},u=this.safeList(l,"data",[]),f=this.indexBy(u,"symbol"),p=r?3:1,m=this.safeDict(o,p,{}),g=this.safeList(this.safeDict(m,"data",{}),"ticker",[]),v=this.indexBy(g,"symbol"),y=[];for(let e=0;e1&&void 0===r&&e[1].length>1&&(r=e[1]),n=e[0]}let d=void 0===n?"withdrawal":"deposit";const h=this.safeString(e,"status");let c;const l=this.safeString(e,"fee");if(void 0!==l){let e;void 0!==o&&(e=a.Y.stringDiv(l,o)),c={cost:this.parseNumber(l),rate:this.parseNumber(e),currency:s}}let u=this.safeInteger2(e,"createdAt","createAt"),f=this.safeInteger(e,"updatedAt");!("createdAt"in e)&&(d="address"in e?"withdrawal":"deposit",void 0!==u&&(u*=1e3),void 0!==f&&(f*=1e3));const p=this.safeBool(e,"isInner"),m=this.safeString(e,"memo");return{info:e,id:this.safeString2(e,"id","withdrawalId"),timestamp:u,datetime:this.iso8601(u),network:this.networkIdToCode(this.safeString(e,"chain")),address:r,addressTo:r,addressFrom:void 0,tag:m,tagTo:m,tagFrom:void 0,currency:s,amount:this.parseNumber(o),txid:n,type:d,status:this.parseTransactionStatus(h),comment:this.safeString(e,"remark"),internal:p,fee:c,updated:f}}async fetchDeposits(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();let r=!1;if([r,s]=this.handleOptionAndParams(s,"fetchDeposits","paginate"),r)return await this.fetchPaginatedCallDynamic("fetchDeposits",e,t,i,s);let a,o,n={};void 0!==e&&(a=this.currency(e),n.currency=a.id),void 0!==i&&(n.pageSize=i),[n,s]=this.handleUntilOption("endAt",n,s),void 0!==t&&t<1550448e6?(n.startAt=this.parseToInt(t/1e3),o=await this.privateGetHistDeposits(this.extend(n,s))):(void 0!==t&&(n.startAt=t),o=await this.privateGetDeposits(this.extend(n,s)));const d=this.safeDict(o,"data",{}),h=this.safeList(d,"items",[]);return this.parseTransactions(h,a,t,i,{type:"deposit"})}async fetchWithdrawals(e=void 0,t=void 0,i=void 0,s={}){await this.loadMarkets();let r=!1;if([r,s]=this.handleOptionAndParams(s,"fetchWithdrawals","paginate"),r)return await this.fetchPaginatedCallDynamic("fetchWithdrawals",e,t,i,s);let a,o,n={};void 0!==e&&(a=this.currency(e),n.currency=a.id),void 0!==i&&(n.pageSize=i),[n,s]=this.handleUntilOption("endAt",n,s),void 0!==t&&t<1550448e6?(n.startAt=this.parseToInt(t/1e3),o=await this.privateGetHistWithdrawals(this.extend(n,s))):(void 0!==t&&(n.startAt=t),o=await this.privateGetWithdrawals(this.extend(n,s)));const d=this.safeDict(o,"data",{}),h=this.safeList(d,"items",[]);return this.parseTransactions(h,a,t,i,{type:"withdrawal"})}parseBalanceHelper(e){const t=this.account();t.used=this.safeString2(e,"holdBalance","hold"),t.free=this.safeString2(e,"availableBalance","available"),t.total=this.safeString2(e,"totalBalance","total");const i=this.safeString(e,"liability"),s=this.safeString(e,"interest");return t.debt=a.Y.stringAdd(i,s),t}async fetchBalance(e={}){await this.loadMarkets();const t=this.safeString(e,"code");let i;void 0!==t&&(i=this.currency(t));const s=this.safeString2(this.options,"fetchBalance","defaultType","spot"),r=this.safeString(e,"type",s),a=this.safeDict(this.options,"accountsByType");let o,n=this.safeString(a,r,r);e=this.omit(e,"type"),[o,e]=this.handleHfAndParams(e),o&&"main"!==n&&(n="trade_hf");const[d,h]=this.handleMarginModeAndParams("fetchBalance",e);let c;const l={},u="isolated"===d||"isolated"===n,f="cross"===d||"margin"===n;let p;u?(void 0!==i&&(l.balanceCurrency=i.id),c=await this.privateGetIsolatedAccounts(this.extend(l,h))):f?c=await this.privateGetMarginAccount(this.extend(l,h)):(void 0!==i&&(l.currency=i.id),l.type=n,c=await this.privateGetAccounts(this.extend(l,h)));const m={info:c,timestamp:void 0,datetime:void 0};if(u){p=this.safeDict(c,"data",{});const e=this.safeValue(p,"assets",p);for(let t=0;t{i.d(t,{A:()=>n});var s=i(2079),r=i(5147),a=i(1579),o=i(3942);class n extends o.A{describe(){return this.deepExtend(super.describe(),{id:"kucoinfutures",name:"KuCoin Futures",countries:["SC"],rateLimit:75,version:"v1",certified:!0,pro:!0,comment:"Platform 2.0",quoteJsonNumbers:!1,has:{CORS:void 0,spot:!1,margin:!1,swap:!0,future:!0,option:!1,addMargin:!0,cancelAllOrders:!0,cancelOrder:!0,cancelOrders:!0,closeAllPositions:!1,closePosition:!0,closePositions:!1,createDepositAddress:!0,createOrder:!0,createOrders:!0,createOrderWithTakeProfitAndStopLoss:!0,createReduceOnlyOrder:!0,createStopLimitOrder:!0,createStopLossOrder:!0,createStopMarketOrder:!0,createStopOrder:!0,createTakeProfitOrder:!0,createTriggerOrder:!0,fetchAccounts:!0,fetchBalance:!0,fetchBidsAsks:!0,fetchBorrowRateHistories:!1,fetchBorrowRateHistory:!1,fetchClosedOrders:!0,fetchCrossBorrowRate:!1,fetchCrossBorrowRates:!1,fetchCurrencies:!1,fetchDepositAddress:!0,fetchDepositAddresses:!1,fetchDepositAddressesByNetwork:!1,fetchDeposits:!0,fetchDepositWithdrawFee:!1,fetchDepositWithdrawFees:!1,fetchFundingHistory:!0,fetchFundingInterval:!0,fetchFundingIntervals:!1,fetchFundingRate:!0,fetchFundingRateHistory:!0,fetchIndexOHLCV:!1,fetchIsolatedBorrowRate:!1,fetchIsolatedBorrowRates:!1,fetchL3OrderBook:!0,fetchLedger:!0,fetchLeverage:!0,fetchLeverageTiers:!1,fetchMarginAdjustmentHistory:!1,fetchMarginMode:!0,fetchMarketLeverageTiers:!0,fetchMarkets:!0,fetchMarkOHLCV:!1,fetchMarkPrice:!0,fetchMyTrades:!0,fetchOHLCV:!0,fetchOpenOrders:!0,fetchOrder:!0,fetchOrderBook:!0,fetchPosition:!0,fetchPositionHistory:!1,fetchPositionMode:!1,fetchPositions:!0,fetchPositionsHistory:!0,fetchPremiumIndexOHLCV:!1,fetchStatus:!0,fetchTicker:!0,fetchTickers:!0,fetchTime:!0,fetchTrades:!0,fetchTradingFee:!0,fetchTransactionFee:!1,fetchWithdrawals:!0,setLeverage:!1,setMarginMode:!0,transfer:!0,withdraw:void 0},urls:{logo:"https://user-images.githubusercontent.com/1294454/147508995-9e35030a-d046-43a1-a006-6fabd981b554.jpg",doc:["https://docs.kucoin.com/futures","https://docs.kucoin.com"],www:"https://futures.kucoin.com/",referral:"https://futures.kucoin.com/?rcode=E5wkqe",api:{public:"https://openapi-v2.kucoin.com",private:"https://openapi-v2.kucoin.com",futuresPrivate:"https://api-futures.kucoin.com",futuresPublic:"https://api-futures.kucoin.com",webExchange:"https://futures.kucoin.com/_api/web-front"}},requiredCredentials:{apiKey:!0,secret:!0,password:!0},api:{futuresPublic:{get:{"contracts/active":1,"contracts/{symbol}":1,"contracts/risk-limit/{symbol}":1,ticker:1,allTickers:1,"level2/snapshot":1.33,"level2/depth{limit}":1,"level2/message/query":1,"level3/message/query":1,"level3/snapshot":1,"trade/history":1,"interest/query":1,"index/query":1,"mark-price/{symbol}/current":1,"premium/query":1,"funding-rate/{symbol}/current":1,timestamp:1,status:1,"kline/query":1},post:{"bullet-public":1}},futuresPrivate:{get:{"account-overview":1.33,"transaction-history":4.44,"deposit-address":1,"deposit-list":1,"withdrawals/quotas":1,"withdrawal-list":1,"transfer-list":1,orders:1.33,stopOrders:1,recentDoneOrders:1,"orders/{orderId}":1,"orders/byClientOid":1,fills:4.44,recentFills:4.44,openOrderStatistics:1,position:1,positions:4.44,"funding-history":4.44,"sub/api-key":1,"trade-statistics":1,"trade-fees":1,"history-positions":1,getMaxOpenSize:1,getCrossUserLeverage:1,"position/getMarginMode":1},post:{withdrawals:1,"transfer-out":1,"transfer-in":1,orders:1.33,"st-orders":1.33,"orders/test":1.33,"position/margin/auto-deposit-status":1,"position/margin/deposit-margin":1,"position/risk-limit-level/change":1,"bullet-private":1,"sub/api-key":1,"sub/api-key/update":1,changeCrossUserLeverage:1,"position/changeMarginMode":1},delete:{"withdrawals/{withdrawalId}":1,"cancel/transfer-out":1,"orders/{orderId}":1,orders:4.44,stopOrders:1,"sub/api-key":1,"orders/client-order/{clientOid}":1,"orders/multi-cancel":20}},webExchange:{get:{"contract/{symbol}/funding-rates":1}}},precisionMode:a.kb,exceptions:{exact:{400:s.BadRequest,401:s.AuthenticationError,403:s.NotSupported,404:s.NotSupported,405:s.NotSupported,415:s.BadRequest,429:s.RateLimitExceeded,500:s.ExchangeNotAvailable,503:s.ExchangeNotAvailable,100001:s.InvalidOrder,100004:s.BadRequest,101030:s.PermissionDenied,200004:s.InsufficientFunds,230003:s.InsufficientFunds,260100:s.InsufficientFunds,300003:s.InsufficientFunds,300012:s.InvalidOrder,400001:s.AuthenticationError,400002:s.InvalidNonce,400003:s.AuthenticationError,400004:s.AuthenticationError,400005:s.AuthenticationError,400006:s.AuthenticationError,400007:s.AuthenticationError,404e3:s.NotSupported,400100:s.BadRequest,411100:s.AccountSuspended,5e5:s.ExchangeNotAvailable,300009:s.InvalidOrder},broad:{"Position does not exist":s.OrderNotFound}},fees:{trading:{tierBased:!0,percentage:!0,taker:this.parseNumber("0.0006"),maker:this.parseNumber("0.0002"),tiers:{taker:[[this.parseNumber("0"),this.parseNumber("0.0006")],[this.parseNumber("50"),this.parseNumber("0.0006")],[this.parseNumber("200"),this.parseNumber("0.0006")],[this.parseNumber("500"),this.parseNumber("0.0005")],[this.parseNumber("1000"),this.parseNumber("0.0004")],[this.parseNumber("2000"),this.parseNumber("0.0004")],[this.parseNumber("4000"),this.parseNumber("0.00038")],[this.parseNumber("8000"),this.parseNumber("0.00035")],[this.parseNumber("15000"),this.parseNumber("0.00032")],[this.parseNumber("25000"),this.parseNumber("0.0003")],[this.parseNumber("40000"),this.parseNumber("0.0003")],[this.parseNumber("60000"),this.parseNumber("0.0003")],[this.parseNumber("80000"),this.parseNumber("0.0003")]],maker:[[this.parseNumber("0"),this.parseNumber("0.02")],[this.parseNumber("50"),this.parseNumber("0.015")],[this.parseNumber("200"),this.parseNumber("0.01")],[this.parseNumber("500"),this.parseNumber("0.01")],[this.parseNumber("1000"),this.parseNumber("0.01")],[this.parseNumber("2000"),this.parseNumber("0")],[this.parseNumber("4000"),this.parseNumber("0")],[this.parseNumber("8000"),this.parseNumber("0")],[this.parseNumber("15000"),this.parseNumber("-0.003")],[this.parseNumber("25000"),this.parseNumber("-0.006")],[this.parseNumber("40000"),this.parseNumber("-0.009")],[this.parseNumber("60000"),this.parseNumber("-0.012")],[this.parseNumber("80000"),this.parseNumber("-0.015")]]}},funding:{tierBased:!1,percentage:!1,withdraw:{},deposit:{}}},commonCurrencies:{HOT:"HOTNOW",EDGE:"DADI",WAX:"WAXP",TRY:"Trias",VAI:"VAIOT",XBT:"BTC"},timeframes:{"1m":1,"3m":void 0,"5m":5,"15m":15,"30m":30,"1h":60,"2h":120,"4h":240,"6h":void 0,"8h":480,"12h":720,"1d":1440,"1w":10080},options:{version:"v1",symbolSeparator:"-",defaultType:"swap",code:"USDT",marginModes:{},marginTypes:{},versions:{futuresPrivate:{GET:{getMaxOpenSize:"v2",getCrossUserLeverage:"v2","position/getMarginMode":"v2"},POST:{"transfer-out":"v2",changeCrossUserLeverage:"v2","position/changeMarginMode":"v2"}},futuresPublic:{GET:{"level3/snapshot":"v2"}}},networks:{OMNI:"omni",ERC20:"eth",TRC20:"trx"}},features:{spot:void 0,forDerivs:{sandbox:!1,createOrder:{marginMode:!0,triggerPrice:!0,triggerPriceType:{last:!0,mark:!0,index:!0},triggerDirection:!0,stopLossPrice:!0,takeProfitPrice:!0,attachedStopLossTakeProfit:{triggerPriceType:void 0,price:!0},timeInForce:{IOC:!0,FOK:!1,PO:!0,GTD:!1},hedged:!1,trailing:!1,leverage:!0,marketBuyByCost:!0,marketBuyRequiresPrice:!1,selfTradePrevention:!0,iceberg:!0},createOrders:{max:20},fetchMyTrades:{marginMode:!0,limit:1e3,daysBack:void 0,untilDays:7,symbolRequired:!1},fetchOrder:{marginMode:!1,trigger:!1,trailing:!1,symbolRequired:!1},fetchOpenOrders:{marginMode:!1,limit:1e3,trigger:!0,trailing:!1,symbolRequired:!1},fetchOrders:void 0,fetchClosedOrders:{marginMode:!1,limit:1e3,daysBack:void 0,daysBackCanceled:void 0,untilDays:void 0,trigger:!0,trailing:!1,symbolRequired:!1},fetchOHLCV:{limit:500}},swap:{linear:{extends:"forDerivs"},inverse:{extends:"forDerivs"}},future:{linear:{extends:"forDerivs"},inverse:{extends:"forDerivs"}}}})}async fetchStatus(e={}){const t=await this.futuresPublicGetStatus(e),i=this.safeValue(t,"data",{});return{status:"open"===this.safeString(i,"status")?"ok":"maintenance",updated:void 0,eta:void 0,url:void 0,info:t}}async fetchMarkets(e={}){const t=await this.futuresPublicGetContractsActive(e),i=[],s=this.safeValue(t,"data",[]);for(let e=0;e-1?"long":"short");const d=r.Y.stringAbs(this.safeString(e,"posCost")),h=this.safeString(e,"posInit"),c=r.Y.stringDiv(h,d),l=this.safeString(e,"unrealisedPnl"),u=this.safeValue(e,"crossMode");let f;return void 0!==u&&(f=u?"cross":"isolated"),this.safePosition({info:e,id:this.safeString2(e,"id","positionId"),symbol:this.safeString(t,"symbol"),timestamp:s,datetime:this.iso8601(s),lastUpdateTimestamp:this.safeInteger(e,"closeTime"),initialMargin:this.parseNumber(h),initialMarginPercentage:this.parseNumber(c),maintenanceMargin:this.safeNumber(e,"posMaint"),maintenanceMarginPercentage:this.safeNumber(e,"maintMarginReq"),entryPrice:this.safeNumber2(e,"avgEntryPrice","openPrice"),notional:this.parseNumber(d),leverage:this.safeNumber2(e,"realLeverage","leverage"),unrealizedPnl:this.parseNumber(l),contracts:this.parseNumber(r.Y.stringAbs(a)),contractSize:this.safeValue(t,"contractSize"),realizedPnl:this.safeNumber2(e,"realisedPnl","pnl"),marginRatio:void 0,liquidationPrice:this.safeNumber(e,"liquidationPrice"),markPrice:this.safeNumber(e,"markPrice"),lastPrice:void 0,collateral:this.safeNumber(e,"maintMargin"),marginMode:f,side:o,percentage:void 0,stopLossPrice:void 0,takeProfitPrice:void 0})}async createOrder(e,t,i,s,r=void 0,a={}){await this.loadMarkets();const o=this.market(e),n=this.safeBool(a,"test",!1);a=this.omit(a,"test");const d=void 0!==this.safeValue(a,"stopLoss")||void 0!==this.safeValue(a,"takeProfit"),h=this.createContractOrderRequest(e,t,i,s,r,a);let c;c=n?await this.futuresPrivatePostOrdersTest(h):d?await this.futuresPrivatePostStOrders(h):await this.futuresPrivatePostOrders(h);const l=this.safeDict(c,"data",{});return this.parseOrder(l,o)}async createOrders(e,t={}){await this.loadMarkets();const i=[];for(let t=0;t